diff -c -r --new-file ds1.1/lib/cfg/months.cfg ds2.0r27/lib/cfg/months.cfg *** ds1.1/lib/cfg/months.cfg Fri Jan 3 22:13:10 1997 --- ds2.0r27/lib/cfg/months.cfg Wed Jul 5 00:00:58 2006 *************** *** 5,17 **** # format: # month:season:days:day_length ! Roki:winter:20:9 ! Praxi:winter:20:10 ! Altki:spring:20:10 ! Ketralki:spring:20:10 ! Aenterki:summer:20:11 ! Kepki:summer:20:12 ! Kortki:summer:20:11 ! Kantki:autumn:20:10 ! Sartki:autumn:20:10 ! Denki:winter:20:10 --- 5,17 ---- # format: # month:season:days:day_length ! Roki:winter:20:11 ! Praxi:winter:20:12 ! Altki:spring:20:12 ! Ketralki:spring:20:12 ! Aenterki:summer:20:13 ! Kepki:summer:20:14 ! Kortki:summer:20:13 ! Kantki:autumn:20:12 ! Sartki:autumn:20:12 ! Denki:winter:20:12 diff -c -r --new-file ds1.1/lib/cfg/timezone.cfg ds2.0r27/lib/cfg/timezone.cfg *** ds1.1/lib/cfg/timezone.cfg Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cfg/timezone.cfg Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1 ---- + EDT diff -c -r --new-file ds1.1/lib/cfg/timezones.cfg ds2.0r27/lib/cfg/timezones.cfg *** ds1.1/lib/cfg/timezones.cfg Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cfg/timezones.cfg Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,17 ---- + NZT + AET + AWT + MOT + CET + BST + GMT + ADT + AST + EDT + EST + CDT + CST + MDT + MST + PDT + PST diff -c -r --new-file ds1.1/lib/cmds/admins/arch.c ds2.0r27/lib/cmds/admins/arch.c *** ds1.1/lib/cmds/admins/arch.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cmds/admins/arch.c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,21 ---- + /* /cmds/creators/wiz.c + * Created by Zin@Frontiers + * Sun Sep 21 21:00:16 1997 EDT + */ + + #include + #include + + inherit LIB_DAEMON; + + mixed cmd(string str) { + write("You speed to the Arch room.\n"); + this_player()->eventMoveLiving("/secure/room/arch"); + return 1; + } + + void help() { + message("help", "Syntax: \n\n" + "This command will move you to the Arch room.\n\n", + this_player()); + } diff -c -r --new-file ds1.1/lib/cmds/admins/broadcast.c ds2.0r27/lib/cmds/admins/broadcast.c *** ds1.1/lib/cmds/admins/broadcast.c Sun Feb 1 21:29:49 1998 --- ds2.0r27/lib/cmds/admins/broadcast.c Wed Jul 5 00:01:03 2006 *************** *** 12,18 **** if(!archp(previous_object())) return 0; message("broadcast", sprintf("%%^RED%%^Broadcast message from %s: %%^YELLOW%%^%s%%^RESET%%^", ! (string)this_player()->GetName(), str), users()); return 1; } --- 12,18 ---- if(!archp(previous_object())) return 0; message("broadcast", sprintf("%%^RED%%^Broadcast message from %s: %%^YELLOW%%^%s%%^RESET%%^", ! (string)this_player()->GetName(), str), users()); return 1; } diff -c -r --new-file ds1.1/lib/cmds/admins/cache.c ds2.0r27/lib/cmds/admins/cache.c *** ds1.1/lib/cmds/admins/cache.c Sun Feb 1 21:29:49 1998 --- ds2.0r27/lib/cmds/admins/cache.c Wed Jul 5 00:01:03 2006 *************** *** 5,23 **** int cmd(string arg) { ! if(!archp(previous_object())) return 0; ! cache_stats(); ! return 1; } int help() { ! write( @EndText Syntax: cache Effect: Gets the cache stats from the driver, including the hit rate See man: cache_stats See also: callouts, mstatus, netstat, opcprof, fdinfo, dumpallobj EndText ! ); ! return 1; } --- 5,23 ---- int cmd(string arg) { ! if(!archp(previous_object())) return 0; ! cache_stats(); ! return 1; } int help() { ! write( @EndText Syntax: cache Effect: Gets the cache stats from the driver, including the hit rate See man: cache_stats See also: callouts, mstatus, netstat, opcprof, fdinfo, dumpallobj EndText ! ); ! return 1; } diff -c -r --new-file ds1.1/lib/cmds/admins/channel.c ds2.0r27/lib/cmds/admins/channel.c *** ds1.1/lib/cmds/admins/channel.c Sun Feb 1 21:29:49 1998 --- ds2.0r27/lib/cmds/admins/channel.c Wed Jul 5 00:01:03 2006 *************** *** 13,67 **** if(!str) return 0; if(!archp(previous_object())) return 0; ! // Attempt to remove or add a players line rights. if(sscanf(str, "%s %s %s", opt, who, channel) == 3) { ! if(!(ob = find_player(lower_case(who)))) ! return notify_fail("No such player online.\n"); ! if(opt == "remove") { ! if(member_array(channel, ob->GetChannels()) == -1) { ! this_player()->eventPrint(ob->GetName() ! + " is not currently subscribed to the " + channel + " line."); ! return 1; ! } ! ob->RestrictChannel(channel); ! this_player()->eventPrint("%^RED%^You restrict " + ob->GetName() ! + " from the " + channel + " line.%^RESET%^"); ! ob->eventPrint("%^RED%^You have lost your " + channel ! + " line rights.%^RESET%^"); ! return 1; ! } ! else if(opt == "add") { ! if(member_array(channel, ob->GetRestrictedChannels()) == -1) { ! message("system", ob->GetName() + " is not currently restricted from the " ! + channel + " line.", this_player()); ! return 1; ! } ! ob->UnrestrictChannel(channel); ! this_player()->eventPrint("%^RED%^You unrestrict " + ob->GetName() ! + " from the " + channel + " line.%^RESET%^"); ! ob->eventPrint("%^RED%^You have regained your " + channel ! + " line rights.%^RESET%^"); ! return 1; ! } } // Otherwise, return restriction information, if it is requested. else if(str) { ! string *channels; ! string tmp; ! int size; ! if(!(ob = find_player(lower_case(str)))) ! return notify_fail("No such player online.\n"); ! channels = ob->GetRestrictedChannels(); ! size = sizeof(channels); ! tmp = ob->GetName() + " is currently restricted from "; ! if(size) tmp += "the " + conjunction(channels); ! else tmp += "no"; ! if(size == 1) tmp += " line."; ! else tmp += " lines."; ! this_player()->eventPrint(tmp); ! return 1; } else return 0; } --- 13,67 ---- if(!str) return 0; if(!archp(previous_object())) return 0; ! // Attempt to remove or add a players line rights. if(sscanf(str, "%s %s %s", opt, who, channel) == 3) { ! if(!(ob = find_player(lower_case(who)))) ! return notify_fail("No such player online.\n"); ! if(opt == "remove") { ! if(member_array(channel, ob->GetChannels()) == -1) { ! this_player()->eventPrint(ob->GetName() ! + " is not currently subscribed to the " + channel + " line."); ! return 1; ! } ! ob->RestrictChannel(channel); ! this_player()->eventPrint("%^RED%^You restrict " + ob->GetName() ! + " from the " + channel + " line.%^RESET%^"); ! ob->eventPrint("%^RED%^You have lost your " + channel ! + " line rights.%^RESET%^"); ! return 1; ! } ! else if(opt == "add") { ! if(member_array(channel, ob->GetRestrictedChannels()) == -1) { ! message("system", ob->GetName() + " is not currently restricted from the " ! + channel + " line.", this_player()); ! return 1; ! } ! ob->UnrestrictChannel(channel); ! this_player()->eventPrint("%^RED%^You unrestrict " + ob->GetName() ! + " from the " + channel + " line.%^RESET%^"); ! ob->eventPrint("%^RED%^You have regained your " + channel ! + " line rights.%^RESET%^"); ! return 1; ! } } // Otherwise, return restriction information, if it is requested. else if(str) { ! string *channels; ! string tmp; ! int size; ! if(!(ob = find_player(lower_case(str)))) ! return notify_fail("No such player online.\n"); ! channels = ob->GetRestrictedChannels(); ! size = sizeof(channels); ! tmp = ob->GetName() + " is currently restricted from "; ! if(size) tmp += "the " + conjunction(channels); ! else tmp += "no"; ! if(size == 1) tmp += " line."; ! else tmp += " lines."; ! this_player()->eventPrint(tmp); ! return 1; } else return 0; } diff -c -r --new-file ds1.1/lib/cmds/admins/dumpallobj.c ds2.0r27/lib/cmds/admins/dumpallobj.c *** ds1.1/lib/cmds/admins/dumpallobj.c Sun Feb 1 21:29:49 1998 --- ds2.0r27/lib/cmds/admins/dumpallobj.c Wed Jul 5 00:01:03 2006 *************** *** 5,23 **** int cmd(string arg) { ! if(!archp(previous_object())) return 0; ! dumpallobj("/tmp/objects"); ! return 1; } int help() { ! write( @EndText Syntax: dumpallobj Effect: Puts a list of all currently loaded objects in /log/dumps/obj_dump See man: dumpallobj See also: callouts, cache, mstatus, netstat, fdinfo, opcprof EndText ! ); ! return 1; } --- 5,23 ---- int cmd(string arg) { ! if(!archp(previous_object())) return 0; ! dumpallobj("/tmp/objects"); ! return 1; } int help() { ! write( @EndText Syntax: dumpallobj Effect: Puts a list of all currently loaded objects in /log/dumps/obj_dump See man: dumpallobj See also: callouts, cache, mstatus, netstat, fdinfo, opcprof EndText ! ); ! return 1; } diff -c -r --new-file ds1.1/lib/cmds/admins/fdinfo.c ds2.0r27/lib/cmds/admins/fdinfo.c *** ds1.1/lib/cmds/admins/fdinfo.c Sun Feb 1 21:29:49 1998 --- ds2.0r27/lib/cmds/admins/fdinfo.c Wed Jul 5 00:01:03 2006 *************** *** 5,23 **** int cmd(string arg) { ! if(!archp(previous_object())) return 0; ! dump_file_descriptors(); ! return 1; } int help() { ! write( @EndText Syntax: fdinfo Effect: Lists the status of the machines's file descriptors See man: dump_file_descriptors See also: netstat, mstatus, cache, callouts, dumpallobj, opcprof EndText ! ); ! return 1; } --- 5,23 ---- int cmd(string arg) { ! if(!archp(previous_object())) return 0; ! dump_file_descriptors(); ! return 1; } int help() { ! write( @EndText Syntax: fdinfo Effect: Lists the status of the machines's file descriptors See man: dump_file_descriptors See also: netstat, mstatus, cache, callouts, dumpallobj, opcprof EndText ! ); ! return 1; } diff -c -r --new-file ds1.1/lib/cmds/admins/mfinger.c ds2.0r27/lib/cmds/admins/mfinger.c *** ds1.1/lib/cmds/admins/mfinger.c Sun Feb 1 21:29:49 1998 --- ds2.0r27/lib/cmds/admins/mfinger.c Wed Jul 5 00:01:03 2006 *************** *** 23,29 **** if( !args || args == "" ) return "Mfinger whom?"; if( !(ob = find_player(args)) ) ! return "No one around " + mud_name() + " by that name."; ip = query_ip_number(ob); args = (string)ob->GetCapName(); ob = new(LIB_CLIENT); --- 23,29 ---- if( !args || args == "" ) return "Mfinger whom?"; if( !(ob = find_player(args)) ) ! return "No one around " + mud_name() + " by that name."; ip = query_ip_number(ob); args = (string)ob->GetCapName(); ob = new(LIB_CLIENT); *************** *** 37,43 **** ob->SetRead( (: ReadSocket :) ); ob->eventWrite("\n"); message("system", "Finger sent to " + possessive_noun(args) + " site " + ! ip + ".", this_player()); return 1; } --- 37,43 ---- ob->SetRead( (: ReadSocket :) ); ob->eventWrite("\n"); message("system", "Finger sent to " + possessive_noun(args) + " site " + ! ip + ".", this_player()); return 1; } *************** *** 47,58 **** if( !Waiting[ob = previous_object()] ) return; if( !Waiting[ob]["who"] ) return; message("system", "Information from " + Waiting[ob]["ip"] + " for " + ! Waiting[ob]["player"] + ":", Waiting[ob]["who"]); message("system", str, Waiting[ob]["who"]); } void help() { message("help", "Syntax: \n\n" ! "Allows you to get finger information from a player's site.", ! this_player()); } --- 47,58 ---- if( !Waiting[ob = previous_object()] ) return; if( !Waiting[ob]["who"] ) return; message("system", "Information from " + Waiting[ob]["ip"] + " for " + ! Waiting[ob]["player"] + ":", Waiting[ob]["who"]); message("system", str, Waiting[ob]["who"]); } void help() { message("help", "Syntax: \n\n" ! "Allows you to get finger information from a player's site.", ! this_player()); } diff -c -r --new-file ds1.1/lib/cmds/admins/objload.c ds2.0r27/lib/cmds/admins/objload.c *** ds1.1/lib/cmds/admins/objload.c Sun Feb 1 21:29:49 1998 --- ds2.0r27/lib/cmds/admins/objload.c Wed Jul 5 00:01:03 2006 *************** *** 30,36 **** } foreach(string who, mixed array data in vals) { mapping mp = ([]); ! output += ({ who + ": " + data[0] }); foreach(object ob in data[1]) { mp[base_name(ob)]++; --- 30,36 ---- } foreach(string who, mixed array data in vals) { mapping mp = ([]); ! output += ({ who + ": " + data[0] }); foreach(object ob in data[1]) { mp[base_name(ob)]++; *************** *** 45,52 **** string GetHelp(string unused) { return ("Syntax: \n\n" ! "Provides you with information about how many objects " ! "each creator has in the game."); } ! ! --- 45,52 ---- string GetHelp(string unused) { return ("Syntax: \n\n" ! "Provides you with information about how many objects " ! "each creator has in the game."); } ! ! diff -c -r --new-file ds1.1/lib/cmds/admins/opcprof.c ds2.0r27/lib/cmds/admins/opcprof.c *** ds1.1/lib/cmds/admins/opcprof.c Sun Feb 1 21:29:49 1998 --- ds2.0r27/lib/cmds/admins/opcprof.c Wed Dec 31 19:00:00 1969 *************** *** 1,28 **** - #include - - - inherit LIB_DAEMON; - - int - cmd(string arg) - { - if(!archp(previous_object())) return 0; - #ifdef HAS_OPCPROF - opcprof(LOG_DIR + "/dumps/opcprof"); - #else - message("my_action","Sorry, driver has been compiled with OPC_PROF disabled",this_player()); - #endif - return 1; - } - - int help() - { - write( @EndText - Syntax: opcprof - Effect: Puts a list of efuns and eoperators in /log/dumps/opcprof - See man: opcprof - See also: fdinfo, netstat, mstatus, cache, callouts, dumpallobj, - EndText - ); - return 1; - } --- 0 ---- diff -c -r --new-file ds1.1/lib/cmds/common/help.c ds2.0r27/lib/cmds/common/help.c *** ds1.1/lib/cmds/common/help.c Sun Feb 1 21:29:49 1998 --- ds2.0r27/lib/cmds/common/help.c Wed Jul 5 00:01:03 2006 *************** *** 16,33 **** mixed cmd(string arg) { object who = previous_object(); int array screen = (who->GetScreen() || ({ 80, 24 })); ! string help; ! ! if( !arg ) { ! help = center("Dead Souls System Help", screen[0]); ! help += wrap(HELP_D->GetHelp(0), screen[0]); ! who->eventPage(explode(help, "\n"), MSG_HELP, function() { ! this_player()->eventPrint("Hit the key to get a list of indices," ! "'q' to quit help: ", MSG_PROMPT); ! input_to(function(string str) { ! if( str == "q" ) return; ! HelpMenu(); }); ! }); return 1; } if( arg == "index" || HELP_D->GetTopics(arg) ) { --- 16,33 ---- mixed cmd(string arg) { object who = previous_object(); int array screen = (who->GetScreen() || ({ 80, 24 })); ! string help = ""; ! ! if( arg == "help") { ! help = HELP_D->GetHelp("help"); ! write(help); ! return 1; ! } ! if( !arg || arg == "") { ! if(creatorp(this_player())) help = read_file("/doc/help/creators/creator_general"); ! else help = read_file("/doc/help/players/player_general"); ! if(!sizeof(help)) help = HELP_D->GetHelp("help"); ! write(help); return 1; } if( arg == "index" || HELP_D->GetTopics(arg) ) { *************** *** 41,48 **** if( !(help = HELP_D->GetHelp(arg)) ) { return HELP_D->GetLastError(); } ! help = center("Dead Souls System Help", screen[0]) + help; ! help = wrap(help, screen[0]); who->eventPage(explode(help, "\n"), MSG_HELP); return 1; } --- 41,48 ---- if( !(help = HELP_D->GetHelp(arg)) ) { return HELP_D->GetLastError(); } ! help = center(mud_name()+" System Help", screen[0]) + help; ! if(sizeof(help) < 2000) help = wrap(help, screen[0]); who->eventPage(explode(help, "\n"), MSG_HELP); return 1; } *************** *** 57,161 **** string array indices; int array scr; int y = 0; ! scr = this_player()->GetScreen() || ({ 80, 25 }); ! tmp = center("Dead Souls System Help", scr[0]); if( !index ) { tmp += "Index: %^GREEN%^main index%^RESET%^\n\n"; indices = filter(HELP_D->GetIndices(), ! (: CanAccess(this_player(), $1) :)); foreach(string yuck in indices) { int z = strlen(yuck) + 6; ! if( z > y ) { y = z; } } tmp += format_page(map(indices, function(string str, string array ind) { ! int num = member_array(str, ind) + 1; ! return ("[%^CYAN%^"+(num)+"%^RESET%^] " + str); ! }, indices), scr[0]/(y+2)); } else if( !HELP_D->CanAccess(this_player(), index) ) { message("help", "Invalid index choice.", this_player()); message("prompt", "Hit : ", this_player()); input_to(function(string str) { HelpMenu(0); }); ! return; ! } ! else { ! string array topics = HELP_D->GetTopics(index); ! string array bing = allocate(sizeof(topics)); ! int i = 0; ! ! tmp += "Index: %^GREEN%^" + index + "%^RESET%^\n\n"; ! foreach(string topic in topics) { ! int z = strlen(topic) + 6; ! ! if( z > y ) { ! y = z; ! } ! bing[i++] = "[%^CYAN%^" + (i+1) + "%^RESET%^] " + topic; ! } ! tmp += format_page(bing, scr[0]/(y+2)); ! } ! f = function(string ind) { ! if( !ind ) ! message("prompt", "\n\nEnter a index or 'q' to quit help: ", ! this_player()); ! else ! message("prompt", "\n\nEnter a topic, 'q' to quit help, or " ! " for main menu: ", this_player()); ! input_to(function(string str, string ind) { ! string ret; ! int ind_num; ! int *scr; ! ! if( str == "q" ) { ! message("system", "Exiting help.", this_player()); ! return; ! } ! if( !str || str == "" ) { ! HelpMenu(0); ! return; ! } ! scr = (int *)this_player()->GetScreen() || ({ 80 }); ! if( ind_num = to_int(str) ) { ! string array tmp2; ! if( !ind ) tmp2 = filter(HELP_D->GetIndices(), ! (: CanAccess(this_player(), $1) :)); ! else tmp2 = HELP_D->GetTopics(ind); ! if( ind_num < 1 || ind_num > sizeof(tmp2) ) { ! str = 0; ! HELP_D->SetError("Index number out of range."); } ! else str = tmp2[ind_num - 1]; ! } ! if( !ind && !HELP_D->GetTopics(str) ) { ! message("help", "Invalid index choice.", this_player()); ! message("prompt", "Hit : ", this_player()); ! input_to(function(string str) { HelpMenu(); }); ! return; } ! else if( !ind ) { ! HelpMenu(str); ! return; ! } ! if( !(ret = HELP_D->GetHelpByIndex(ind, str)) ) { ! message("help", HELP_D->GetLastError(), this_player()); ! message("prompt", "\nHit : ", this_player()); ! input_to(function(string str) { HelpMenu(); }); ! return; ! } ! ret = center("Dead Souls System Help", scr[0])+wrap(ret, scr[0]); ! this_player()->eventPage(explode(ret, "\n"), "help", ! function(string ind) { ! message("prompt", "\n\nHit : ", ! this_player()); ! input_to(function(string str, string ind) { ! HelpMenu(ind); }, ind); ! return; ! }, ind); ! }, ind); ! }; ! this_player()->eventPage(explode(tmp, "\n"), "help", f, index); ! } --- 57,161 ---- string array indices; int array scr; int y = 0; ! scr = this_player()->GetScreen() || ({ 80, 25 }); ! tmp = center(mud_name()+" System Help", scr[0]); if( !index ) { tmp += "Index: %^GREEN%^main index%^RESET%^\n\n"; indices = filter(HELP_D->GetIndices(), ! (: CanAccess(this_player(), $1) :)); foreach(string yuck in indices) { int z = strlen(yuck) + 6; ! if( z > y ) { y = z; } } tmp += format_page(map(indices, function(string str, string array ind) { ! int num = member_array(str, ind) + 1; ! return ("[%^CYAN%^"+(num)+"%^RESET%^] " + str); ! }, indices), scr[0]/(y+2)); } else if( !HELP_D->CanAccess(this_player(), index) ) { message("help", "Invalid index choice.", this_player()); message("prompt", "Hit : ", this_player()); input_to(function(string str) { HelpMenu(0); }); ! return; ! } ! else { ! string array topics = HELP_D->GetTopics(index); ! string array bing = allocate(sizeof(topics)); ! int i = 0; ! ! tmp += "Index: %^GREEN%^" + index + "%^RESET%^\n\n"; ! foreach(string topic in topics) { ! int z = strlen(topic) + 6; ! ! if( z > y ) { ! y = z; } ! bing[i++] = "[%^CYAN%^" + (i+1) + "%^RESET%^] " + topic; } ! tmp += format_page(bing, scr[0]/(y+2)); ! } ! f = function(string ind) { ! if( !ind ) ! message("prompt", "\n\nEnter a index or 'q' to quit help: ", ! this_player()); ! else ! message("prompt", "\n\nEnter a topic, 'q' to quit help, or " ! " for main menu: ", this_player()); ! input_to(function(string str, string ind) { ! string ret; ! int ind_num; ! int *scr; ! ! if( str == "q" ) { ! message("system", "Exiting help.", this_player()); ! return; ! } ! if( !str || str == "" ) { ! HelpMenu(0); ! return; ! } ! scr = (int *)this_player()->GetScreen() || ({ 80 }); ! if( ind_num = to_int(str) ) { ! string array tmp2; ! if( !ind ) tmp2 = filter(HELP_D->GetIndices(), ! (: CanAccess(this_player(), $1) :)); ! else tmp2 = HELP_D->GetTopics(ind); ! if( ind_num < 1 || ind_num > sizeof(tmp2) ) { ! str = 0; ! HELP_D->SetError("Index number out of range."); ! } ! else str = tmp2[ind_num - 1]; ! } ! if( !ind && !HELP_D->GetTopics(str) ) { ! message("help", "Invalid index choice.", this_player()); ! message("prompt", "Hit : ", this_player()); ! input_to(function(string str) { HelpMenu(); }); ! return; ! } ! else if( !ind ) { ! HelpMenu(str); ! return; ! } ! if( !(ret = HELP_D->GetHelpByIndex(ind, str)) ) { ! message("help", HELP_D->GetLastError(), this_player()); ! message("prompt", "\nHit : ", this_player()); ! input_to(function(string str) { HelpMenu(); }); ! return; ! } ! ret = center(mud_name()+" System Help", scr[0])+wrap(ret, scr[0]); ! this_player()->eventPage(explode(ret, "\n"), "help", ! function(string ind) { ! message("prompt", "\n\nHit : ", ! this_player()); ! input_to(function(string str, string ind) { ! HelpMenu(ind); }, ind); ! return; ! }, ind); ! }, ind); ! }; ! this_player()->eventPage(explode(tmp, "\n"), "help", f, index); ! } diff -c -r --new-file ds1.1/lib/cmds/creators/anglicize.c ds2.0r27/lib/cmds/creators/anglicize.c *** ds1.1/lib/cmds/creators/anglicize.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cmds/creators/anglicize.c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,41 ---- + #include + #include + + inherit LIB_DAEMON; + + mixed cmd(string str) { + object target; + + if(!str || str == "") str = "me"; + + if(str == "me") str = this_player()->GetKeyName(); + if(!target = present(str, environment(this_player()))){ + write("They're not here."); + return 1; + } + if(!living(target)) { + write("That's not a living thing."); + return 1; + } + if(creatorp(target) && !archp(this_player()) && + target != this_player()){ + write("That's impolite."); + tell_player(target,capitalize(this_player()->GetKeyName())+ + " just tried to anglicize you."); + return 1; + } + + target->SetNativeLanguage("English"); + if(target == this_player()) str = "yourself"; + else str = capitalize(str); + write("You anglicize "+str+"."); + if(target != this_player()) + tell_object(target, capitalize(this_player()->GetKeyName())+" anglicizes you."); + return 1; + } + + void help() { + message("help", "Syntax: anglicize \n\n" + "Make the target's native language English.\n\n", + this_player()); + } diff -c -r --new-file ds1.1/lib/cmds/creators/ascii.c ds2.0r27/lib/cmds/creators/ascii.c *** ds1.1/lib/cmds/creators/ascii.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cmds/creators/ascii.c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,41 ---- + #include + #include + + inherit LIB_COMMAND; + + int cmd(string str){ + int code; + string tmp; + string ret = ""; + + if(str && !code = atoi(str)){ + write("That doesn't appear to be an integer."); + return 1; + } + + if(code) { + ret = convert_ascii(code); + write("The ASCII code "+code+" is: "+ret); + return 1; + } + + for(code = 33; code < 256; code++){ + tmp = convert_ascii(code); + if(sizeof(tmp)) ret += "The ASCII code "+code+" is: "+tmp+"\n"; + } + + write(ret); + return 1; + } + + + + string GetHelp(string str) { + return "Syntax: ascii [CODE]\n" + "Provided an integer that corresponds to an ASCII code known to " + "the mud, that character will be displayed. Note that the mud's " + "understanding of these characters is imperfect, and your client's " + "rendition may be unsatisfactory.\nWithout an argument, the command " + "displays all ASCII codes known to the mud and their characters.\n " + ""; + } diff -c -r --new-file ds1.1/lib/cmds/creators/boards.c ds2.0r27/lib/cmds/creators/boards.c *** ds1.1/lib/cmds/creators/boards.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cmds/creators/boards.c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,28 ---- + // By Magnafix 10-14-96 + // required addition of list_new_posts() in bboard daemon + #include + #include + + inherit LIB_COMMAND; + + + int cmd(string str){ + string *boards; + int x; + + boards = ({ "immortal_board" }); + if(archp(this_player())) boards += ({ "admin_board" }); + + for(x = 0; x < sizeof(boards); x++) + write("/secure/daemon/bboard.c"->list_new_posts(boards[x])); + + return 1; + } + + + + string GetHelp(string str) { + return "Syntax: \n" + "This command tells you which boards have unread messages " + "on them."; + } diff -c -r --new-file ds1.1/lib/cmds/creators/callouts.c ds2.0r27/lib/cmds/creators/callouts.c *** ds1.1/lib/cmds/creators/callouts.c Sun Feb 1 21:29:50 1998 --- ds2.0r27/lib/cmds/creators/callouts.c Wed Jul 5 00:01:03 2006 *************** *** 14,20 **** mixed cmd(string args) { mixed array callouts; string tmp; ! callouts = call_out_info(); if( !sizeof(callouts) ) { previous_object()->eventPrint("No pending callouts.", MSG_SYSTEM); --- 14,20 ---- mixed cmd(string args) { mixed array callouts; string tmp; ! callouts = call_out_info(); if( !sizeof(callouts) ) { previous_object()->eventPrint("No pending callouts.", MSG_SYSTEM); *************** *** 22,28 **** } tmp = sprintf("%:-40s %:-25s Delay\n", "Object", "Function"); tmp += "--------------------------------------------------" ! "-------------------------\n"; foreach(mixed array callout in callouts) { tmp += sprintf("%:-40O %:-25s %d\n", callout...); } --- 22,28 ---- } tmp = sprintf("%:-40s %:-25s Delay\n", "Object", "Function"); tmp += "--------------------------------------------------" ! "-------------------------\n"; foreach(mixed array callout in callouts) { tmp += sprintf("%:-40O %:-25s %d\n", callout...); } *************** *** 32,37 **** string GetHelp() { return ("Syntax: \n\n" ! "Lists all pending callouts.\n\n" ! "See also: events, mstatus, netstat"); } --- 32,37 ---- string GetHelp() { return ("Syntax: \n\n" ! "Lists all pending callouts.\n\n" ! "See also: events, mstatus, netstat"); } diff -c -r --new-file ds1.1/lib/cmds/creators/classblock.c ds2.0r27/lib/cmds/creators/classblock.c *** ds1.1/lib/cmds/creators/classblock.c Sun Feb 1 21:29:50 1998 --- ds2.0r27/lib/cmds/creators/classblock.c Wed Jul 5 00:01:03 2006 *************** *** 12,18 **** #include inherit LIB_DAEMON; ! mixed cmd(string args) { if( !args || (args != "on" && args != "off") ) { return "Syntax: "; --- 12,18 ---- #include inherit LIB_DAEMON; ! mixed cmd(string args) { if( !args || (args != "on" && args != "off") ) { return "Syntax: "; *************** *** 24,30 **** } } previous_object()->eventPrint("You are now blocking all class lines.", ! MSG_SYSTEM); } else { foreach(string class_name in CLASSES_D->GetClasses()) { --- 24,30 ---- } } previous_object()->eventPrint("You are now blocking all class lines.", ! MSG_SYSTEM); } else { foreach(string class_name in CLASSES_D->GetClasses()) { *************** *** 33,46 **** } } previous_object()->eventPrint("You are no longer blocking any class " ! "lines.", MSG_SYSTEM); } return 1; } ! string GetHelp() { return ("Syntax: \n\n" ! "Allows you to make sure that you are blocking all or no " ! "class chat lines.\n\n" ! "See also: codeblock"); } --- 33,46 ---- } } previous_object()->eventPrint("You are no longer blocking any class " ! "lines.", MSG_SYSTEM); } return 1; } ! string GetHelp() { return ("Syntax: \n\n" ! "Allows you to make sure that you are blocking all or no " ! "class chat lines.\n\n" ! "See also: codeblock"); } diff -c -r --new-file ds1.1/lib/cmds/creators/clean.c ds2.0r27/lib/cmds/creators/clean.c *** ds1.1/lib/cmds/creators/clean.c Sun Feb 1 21:29:50 1998 --- ds2.0r27/lib/cmds/creators/clean.c Wed Jul 5 00:01:03 2006 *************** *** 14,20 **** mixed cmd(string args) { object array obs, items, users; object ob; ! if( !args || args == "" ) { ob = environment(previous_object()); } --- 14,20 ---- mixed cmd(string args) { object array obs, items, users; object ob; ! if( !args || args == "" ) { ob = environment(previous_object()); } *************** *** 45,53 **** string GetHelp() { return ("Syntax: \n" ! " \n\n" ! "This command destroys all objects in the inventory of a " ! "specified object. It skips any item that has a user somewhere " ! "in its deep inventory."); } --- 45,53 ---- string GetHelp() { return ("Syntax: \n" ! " \n\n" ! "This command destroys all objects in the inventory of a " ! "specified object. It skips any item that has a user somewhere " ! "in its deep inventory."); } diff -c -r --new-file ds1.1/lib/cmds/creators/clone.c ds2.0r27/lib/cmds/creators/clone.c *** ds1.1/lib/cmds/creators/clone.c Sun Feb 1 21:29:50 1998 --- ds2.0r27/lib/cmds/creators/clone.c Wed Jul 5 00:01:03 2006 *************** *** 17,47 **** if( args == "" || !args ) return "Clone what?"; file = absolute_path((string)this_player()->query_cwd(), args); if( file[<2..] != ".c" ) file = file + ".c"; ! if( file_size(file) < 0 ) return "No such file " + file; if( res = catch(ob = new(file)) ) ! return "Error in cloning object: " + res; if( !ob ) return "Failed to clone file: " + file; if( !((int)ob->eventMove(this_player())) && ! !((int)ob->eventMove(environment(this_player()))) ) { message("system", "Failed to properly move the object.", ! this_player()); return 1; } if( !(nom = (string)ob->GetShort()) ) nom = "something peculiar"; if( !(res = (string)this_player()->GetMessage("clone", ob)) ) ! res = (string)this_player()->GetName() + " clones " + nom + "."; message("info", "You clone " + nom + " (" + file + ").", ! this_player()); message("other_action", res, environment(this_player()), ! ({ this_player() })); return 1; } string GetHelp() { return ("Syntax: \n\n" ! "Clones the object from the code stored in the file named. " ! "If for some reason the object cannot be moved to your " ! "inventory (it is alive, you cannot carry it, etc.), then " ! "it will be moved into your environment.\n\n" ! "See also: dest, message"); } --- 17,47 ---- if( args == "" || !args ) return "Clone what?"; file = absolute_path((string)this_player()->query_cwd(), args); if( file[<2..] != ".c" ) file = file + ".c"; ! if( file_size(file) < 0 && !archp(this_player())) return "No such file " + file; if( res = catch(ob = new(file)) ) ! return "Error in cloning object: " + res; if( !ob ) return "Failed to clone file: " + file; if( !((int)ob->eventMove(this_player())) && ! !((int)ob->eventMove(environment(this_player()))) ) { message("system", "Failed to properly move the object.", ! this_player()); return 1; } if( !(nom = (string)ob->GetShort()) ) nom = "something peculiar"; if( !(res = (string)this_player()->GetMessage("clone", ob)) ) ! res = (string)this_player()->GetName() + " clones " + nom + "."; message("info", "You clone " + nom + " (" + file + ").", ! this_player()); message("other_action", res, environment(this_player()), ! ({ this_player() })); return 1; } string GetHelp() { return ("Syntax: \n\n" ! "Clones the object from the code stored in the file named. " ! "If for some reason the object cannot be moved to your " ! "inventory (it is alive, you cannot carry it, etc.), then " ! "it will be moved into your environment.\n\n" ! "See also: dest, message"); } diff -c -r --new-file ds1.1/lib/cmds/creators/codeblock.c ds2.0r27/lib/cmds/creators/codeblock.c *** ds1.1/lib/cmds/creators/codeblock.c Sun Feb 1 21:29:50 1998 --- ds2.0r27/lib/cmds/creators/codeblock.c Wed Jul 5 00:01:03 2006 *************** *** 15,21 **** previous_object()->SetBlocked("all"); if( previous_object()->GetBlocked("all") ) { previous_object()->eventPrint("All channels are being blocked.", ! MSG_SYSTEM); } else { previous_object()->eventPrint("Codeblock is now off.", MSG_SYSTEM); --- 15,21 ---- previous_object()->SetBlocked("all"); if( previous_object()->GetBlocked("all") ) { previous_object()->eventPrint("All channels are being blocked.", ! MSG_SYSTEM); } else { previous_object()->eventPrint("Codeblock is now off.", MSG_SYSTEM); *************** *** 25,31 **** string GetHelp() { return ("Syntax: \n\n" ! "Allows you to toggle on and off the blocking of all mud " ! "channels.\n\n" ! "See also: classblock"); } --- 25,31 ---- string GetHelp() { return ("Syntax: \n\n" ! "Allows you to toggle on and off the blocking of all mud " ! "channels.\n\n" ! "See also: classblock"); } diff -c -r --new-file ds1.1/lib/cmds/creators/colors.c ds2.0r27/lib/cmds/creators/colors.c *** ds1.1/lib/cmds/creators/colors.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cmds/creators/colors.c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,36 ---- + #include + #include + + inherit LIB_DAEMON; + + int cmd() { + + write( + "%^RED%^RED\n" + "%^GREEN%^GREEN\n" + "%^ORANGE%^ORANGE\n" + "%^YELLOW%^YELLOW\n" + "%^BLUE%^BLUE\n" + "%^CYAN%^CYAN\n" + "%^MAGENTA%^MAGENTA\n" + "%^BLACK%^BLACK\n" + "%^WHITE%^WHITE\n" + "%^B_RED%^B_RED\n" + "%^B_GREEN%^B_GREEN\n" + "%^B_ORANGE%^B_ORANGE\n" + "%^B_YELLOW%^B_YELLOW\n" + "%^B_BLUE%^B_BLUE\n" + "%^B_CYAN%^B_CYAN\n" + "%^B_BLACK%^B_BLACK\n" + "%^B_WHITE%^B_WHITE%^RESET%^\n" + "%^B_MAGENTA%^B_MAGENTA%^RESET%^\n" + ); + return 1; + } + + string GetHelp() { + return("Syntax: colors\n\n" + "Lists all available colors in the corresponding color." + "\n\n"); + } + diff -c -r --new-file ds1.1/lib/cmds/creators/debug.c ds2.0r27/lib/cmds/creators/debug.c *** ds1.1/lib/cmds/creators/debug.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cmds/creators/debug.c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,25 ---- + #include + #include + + inherit LIB_DAEMON; + + mixed cmd(string str) { + int status = this_player()->GetProperty("debug"); + if(!str && !status) str = "on"; + else if(!str && status) str = "off"; + if(str != "on" && str != "off") return 0; + if(str == "on"){ + write("You enable debugging."); + this_player()->SetProperty("debug", 1); + return 1; + } + write("You disable debugging."); + this_player()->SetProperty("debug", 0); + return 1; + } + + void help() { + message("help", "Syntax: debug [on | off]\n\n" + "Allows you to receive debugging information\n\n", + this_player()); + } diff -c -r --new-file ds1.1/lib/cmds/creators/dest.c ds2.0r27/lib/cmds/creators/dest.c *** ds1.1/lib/cmds/creators/dest.c Sun Feb 1 21:29:50 1998 --- ds2.0r27/lib/cmds/creators/dest.c Wed Dec 31 19:00:00 1969 *************** *** 1,67 **** - /* /cmds/creator/dest.c - * From the Dead Souls V Object Library - * Destructs the object named - * Created by Descartes of Borg 950425 - * Version: @(#) dest.c 1.2@(#) - * Last modified: 96/10/08 - */ - - #include - #include - - inherit LIB_DAEMON; - - mixed cmd(string args) { - object who = previous_object(); - object target; - string msg; - - if( !args || args == "" ) { - return "Dest what?"; - } - if( args == "all" ) { - foreach(target in all_inventory(environment(who))) { - if( interactive(target) ) { - continue; - } - msg = who->GetMessage("dest", target); - who->eventPrint("You dest " + target->GetShort() + ".", - MSG_SYSTEM); - environment(who)->eventPrint(msg, MSG_SYSTEM, previous_object()); - target->eventDestruct(); - if( target ) { - destruct(target); - } - } - return 1; - } - if( archp(who) ) { - target = to_object(args); - } - if( !target && !(target = present(lower_case(args), who)) && - !(target = present(lower_case(args), environment(who))) ) { - return "No such thing."; - } - if( interactive(target) && !archp(who) ) { - return "You are not permitted to do that."; - } - msg = who->GetMessage("dest", target); - who->eventPrint("You dest " + target->GetShort() + ".", MSG_SYSTEM); - if( interactive(target) ) { - target->eventPrint(who->GetName() + " dests you.", MSG_SYSTEM); - } - environment(who)->eventPrint(msg, MSG_SYSTEM, ({ who, target })); - target->eventDestruct(); - if( target ) { - destruct(target); - } - return 1; - } - - string GetHelp() { - return ("Syntax: \n\n" - "This command destroys the object named. \"dest all\" " - "destroys all the items in your inventory. See \"help format\" " - "for how to denote objects.\n\n" - "See also: clean, scan"); - } --- 0 ---- diff -c -r --new-file ds1.1/lib/cmds/creators/domains.c ds2.0r27/lib/cmds/creators/domains.c *** ds1.1/lib/cmds/creators/domains.c Sun Feb 1 21:29:52 1998 --- ds2.0r27/lib/cmds/creators/domains.c Wed Jul 5 00:01:03 2006 *************** *** 17,23 **** mapping stats = ([]); string array domains; mixed array tmp; ! foreach(string domain, mixed data in domain_stats()) { if( !data ) { continue; --- 17,23 ---- mapping stats = ([]); string array domains; mixed array tmp; ! foreach(string domain, mixed data in domain_stats()) { if( !data ) { continue; *************** *** 31,59 **** stats[domain] = data; } domains = sort_array(keys(stats), function(string a, string b, mapping mp) { ! if( mp[a]["moves"] > mp[b]["moves"] ) { ! return -1; ! } ! else { ! return 1; ! } ! }, stats); tmp = ({ sprintf("%:-15s %:-11s %:-11s %:-11s %:-11s %s", "Domain", ! "Moves", "Objects", "Errors", "Heart Beats", ! "Array Size"), sprintf("%'-'" + (width-1) + "s", "") }); foreach(string domain in domains) { tmp += ({ sprintf("%:-15s %:-11d %:-11d %:-11d %:-11d %d", ! capitalize(domain), stats[domain]["moves"], ! stats[domain]["objects"], stats[domain]["errors"], ! stats[domain]["heart_beats"], ! stats[domain]["array_size"]) }); } who->eventPage(tmp, MSG_SYSTEM); return 1; } ! string GetHelp() { return ("Syntax: \n\n" ! "Prints out domain statistics for the mud's domains.\n\n" ! "See also: realms"); } --- 31,59 ---- stats[domain] = data; } domains = sort_array(keys(stats), function(string a, string b, mapping mp) { ! if( mp[a]["moves"] > mp[b]["moves"] ) { ! return -1; ! } ! else { ! return 1; ! } ! }, stats); tmp = ({ sprintf("%:-15s %:-11s %:-11s %:-11s %:-11s %s", "Domain", ! "Moves", "Objects", "Errors", "Heart Beats", ! "Array Size"), sprintf("%'-'" + (width-1) + "s", "") }); foreach(string domain in domains) { tmp += ({ sprintf("%:-15s %:-11d %:-11d %:-11d %:-11d %d", ! capitalize(domain), stats[domain]["moves"], ! stats[domain]["objects"], stats[domain]["errors"], ! stats[domain]["heart_beats"], ! stats[domain]["array_size"]) }); } who->eventPage(tmp, MSG_SYSTEM); return 1; } ! string GetHelp() { return ("Syntax: \n\n" ! "Prints out domain statistics for the mud's domains.\n\n" ! "See also: realms"); } diff -c -r --new-file ds1.1/lib/cmds/creators/elog.c ds2.0r27/lib/cmds/creators/elog.c *** ds1.1/lib/cmds/creators/elog.c Sun Feb 1 21:29:50 1998 --- ds2.0r27/lib/cmds/creators/elog.c Wed Jul 5 00:01:03 2006 *************** *** 9,15 **** inherit LIB_DAEMON; int cmd(string str) { ! if(!str) str = DIR_ERROR_LOGS+"/"+(string)previous_object()->GetKeyName(); else str = DIR_ERROR_LOGS+"/"+str; write(str+":\n"); if(!tail(str)) write("No errors in "+str+".\nTry /log/debug.log.\n"); --- 9,15 ---- inherit LIB_DAEMON; int cmd(string str) { ! if(!str) str = DIR_ERROR_LOGS+"/"+(string)previous_object()->GetKeyName(); else str = DIR_ERROR_LOGS+"/"+str; write(str+":\n"); if(!tail(str)) write("No errors in "+str+".\nTry /log/debug.log.\n"); diff -c -r --new-file ds1.1/lib/cmds/creators/events.c ds2.0r27/lib/cmds/creators/events.c *** ds1.1/lib/cmds/creators/events.c Sun Feb 1 21:29:51 1998 --- ds2.0r27/lib/cmds/creators/events.c Wed Jul 5 00:01:03 2006 *************** *** 15,21 **** string *obs; string *st2; string st3; ! int i,j,k; string name; if(!str && archp(previous_object())) { --- 15,21 ---- string *obs; string *st2; string st3; ! int i,j,k,l; string name; if(!str && archp(previous_object())) { *************** *** 23,31 **** i = sizeof(obs = keys(mp)); message("info", "The following events are pending:", this_player()); while(i--) { ! message("info", arrange_string(obs[i], 30) + ! arrange_string(mp[obs[i]]["function"], 15) + ! ctime(mp[obs[i]]["time"])+" Mud Time", this_player()); } return 1; } else if((archp(previous_object()) && str) || creatorp(previous_object())) { --- 23,32 ---- i = sizeof(obs = keys(mp)); message("info", "The following events are pending:", this_player()); while(i--) { ! l=atoi(""+obs[i]); ! message("info", arrange_string(""+l, 30) + ! arrange_string(mp[obs[i]]["function"], 15) + ! local_ctime(l)+" "+query_tz(), this_player()); } return 1; } else if((archp(previous_object()) && str) || creatorp(previous_object())) { *************** *** 38,44 **** i = sizeof(obs = keys(mp)); if (i) { while(i--) ! if((st2 = explode(obs[i], "/"))) if (st2[0] == "realms" && st2[1] == name) { if (j == 0) { if (archp(previous_object())) --- 39,45 ---- i = sizeof(obs = keys(mp)); if (i) { while(i--) ! if((st2 = explode(""+obs[i], "/"))) if (st2[0] == "realms" && st2[1] == name) { if (j == 0) { if (archp(previous_object())) *************** *** 51,57 **** for (k = 2; k < sizeof(st2); k++) st3 += "/" + st2[k]; message("info", arrange_string(st3, 30) + ! arrange_string(mp[obs[i]]["function"], 15) + ctime(mp[obs[i]]["time"])+" Mud Time", this_player()); } } --- 52,58 ---- for (k = 2; k < sizeof(st2); k++) st3 += "/" + st2[k]; message("info", arrange_string(st3, 30) + ! arrange_string(mp[obs[i]]["function"], 15) + ctime(mp[obs[i]]["time"])+" Mud Time", this_player()); } } diff -c -r --new-file ds1.1/lib/cmds/creators/exits.c ds2.0r27/lib/cmds/creators/exits.c *** ds1.1/lib/cmds/creators/exits.c Sun Feb 1 21:29:51 1998 --- ds2.0r27/lib/cmds/creators/exits.c Wed Jul 5 00:01:03 2006 *************** *** 15,21 **** object oEnv; if ( !( oEnv = environment( this_player() ) ) ) ! return "You do not have a valid environment."; asExits = oEnv->GetExits(); asEnters = oEnv->GetEnters(); --- 15,21 ---- object oEnv; if ( !( oEnv = environment( this_player() ) ) ) ! return "You do not have a valid environment."; asExits = oEnv->GetExits(); asEnters = oEnv->GetEnters(); *************** *** 24,48 **** this_player() ); if ( !( sizeof( asExits ) ) ) ! message( "my_action", "This room has no exits.", this_player() ); else { ! message( "Nmy_action", "This room has the following exits :\n\n", ! this_player() ); ! foreach( sExit in asExits ) { ! message( "my_action", sprintf( "\t%10s -> %s", sExit, ! oEnv->GetExit( sExit ) ), this_player() ); ! } } if ( !( sizeof( asEnters ) ) ) ! message( "my_action", "\nThis room has no enters.", this_player() ); else { ! message( "Nmy_action", "\nThis room has the following enters :\n\n", ! this_player() ); ! foreach( sExit in asEnters ) { ! message( "my_action", sprintf( "\t%10s -> %s", sExit, ! oEnv->GetEnter( sExit ) ), this_player() ); ! } } return 1; --- 24,48 ---- this_player() ); if ( !( sizeof( asExits ) ) ) ! message( "my_action", "This room has no exits.", this_player() ); else { ! message( "Nmy_action", "This room has the following exits :\n\n", ! this_player() ); ! foreach( sExit in asExits ) { ! message( "my_action", sprintf( "\t%10s -> %s", sExit, ! oEnv->GetExit( sExit ) ), this_player() ); ! } } if ( !( sizeof( asEnters ) ) ) ! message( "my_action", "\nThis room has no enters.", this_player() ); else { ! message( "Nmy_action", "\nThis room has the following enters :\n\n", ! this_player() ); ! foreach( sExit in asEnters ) { ! message( "my_action", sprintf( "\t%10s -> %s", sExit, ! oEnv->GetEnter( sExit ) ), this_player() ); ! } } return 1; diff -c -r --new-file ds1.1/lib/cmds/creators/expel.c ds2.0r27/lib/cmds/creators/expel.c *** ds1.1/lib/cmds/creators/expel.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cmds/creators/expel.c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,53 ---- + #include + #include + + inherit LIB_DAEMON; + + mixed cmd(string args) { + object ob, *obs; + + if( !args || args == "" ) return "Expel whom?"; + ob = present(args,environment(this_player())); + if(args != "all" && (!ob || !living(ob))){ + + return "Expel only works for living things in your environment."; + } + if(archp(ob) && !archp(this_player())){ + write("You can't expel an admin."); + tell_player(ob, this_player()->GetName()+" just tried to expel you."); + return 1; + } + + if(args == "all"){ + if(archp(this_player())) { + obs = filter(get_livings(environment(this_player())), (: $1 != this_player() :) ); + } + else { + obs = filter(get_livings(environment(this_player())), + (: $1 != this_player() && !archp($1) :) ); + } + } + + else obs = ({ ob }); + + foreach(object nuisance in obs){ + nuisance->eventWimpy(1); + } + + foreach(object nuisance in obs){ + if(environment(nuisance) == environment(this_player())){ + if(creatorp(nuisance)) { + nuisance->eventMoveLiving(homedir(nuisance)+"/workroom"); + } + else nuisance->eventMoveLiving(ROOM_START); + } + } + + return 1; + } + + void help() { + message("help", "Syntax: expel \n\n" + "Forces the specified living thing to leave your environment.\n\n" + "See also: return, goto, move, trans", this_player()); + } diff -c -r --new-file ds1.1/lib/cmds/creators/findobj.c ds2.0r27/lib/cmds/creators/findobj.c *** ds1.1/lib/cmds/creators/findobj.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cmds/creators/findobj.c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,46 ---- + #include + #include + + inherit LIB_DAEMON; + + mixed cmd(string args) { + string tmpfile; + string ret = ""; + object *obs; + + if(args) args = replace_string(args,"\"",""); + + if(!args) obs = ({ this_player() }); + + else obs = findobs(args); + + if(!sizeof(obs)) { + write("No such objects found."); + return 1; + } + + write(sizeof(obs)+" matches found. They are:\n\n"); + + foreach(object ob in obs){ + string name; + string str = "%^BOLD%^BLUE%^Object: "+identify(ob)+", "; + if(args != "door" && name = ob->GetName()) str += "%^BOLD%^GREEN%^name: "+name+", "; + str += "%^BOLD%^WHITE%^"; + if(environment(ob)) str += "environment: "+identify(environment(ob))+".\n"; + else str += "environment: None.\n"; + str += "%^RESET%^\n"; + ret += str; + } + + tmpfile = generate_tmp(); + write_file(tmpfile,ret); + this_player()->eventPage(tmpfile); + rm(tmpfile); + return 1; + } + + string GetHelp() { + return ("Syntax: findobj STRING\n\n" + "Displays matching objects that are loaded into memory.\n\n" + "examples: \n\nfindobj staff\nfindobj /lib/dummy"); + } diff -c -r --new-file ds1.1/lib/cmds/creators/force.c ds2.0r27/lib/cmds/creators/force.c *** ds1.1/lib/cmds/creators/force.c Sun Feb 1 21:29:52 1998 --- ds2.0r27/lib/cmds/creators/force.c Wed Dec 31 19:00:00 1969 *************** *** 1,65 **** - /* /cmds/creators/force.c - * From the Dead Souls V Object Library - * Created by Descartes of Borg 961018 - * Version: %A% - * Last modified: %D% - */ - - #include - - inherit LIB_DAEMON; - - mixed cmd(string args) { - object who = previous_object(); - object target; - string name, cmd; - - if( sscanf(args, "%s to %s", name, cmd) != 1 ) { - int i = strsrch(args, " "); - - name = ""; - while( i != -1 ) { - name += args[0..(i-1)]; - if( strlen(args) < i-1 ) { - args = args[(i+1)..]; - } - else { - args = ""; - } - if( target = find_living(lower_case(name)) ) { - break; - } - if( target = find_living(convert_string(name)) ) { - break; - } - } - if( !target ) { - who->eventPrint("Cannot find any living thing called: " + name); - return 1; - } - cmd = args; - } - else { - target = find_living(lower_case(name)); - if( !target ) { - target = find_living(convert_string(name)); - } - if( !target ) { - who->eventPrint("Cannot find any living thing called: " + name); - return 1; - } - } - target->eventPrint(who->GetName() + " forces you to: " + cmd); - who->eventPrint("You force " + target->GetShort() + " to: " + cmd); - target->eventForce(cmd); - return 1; - } - - string GetErorMessage() { - "Force whom to do what?"; - } - - string GetHelp() { - return ("Syntax: \n\n" - "Allows you to force a living object to take a certain action."); - } --- 0 ---- diff -c -r --new-file ds1.1/lib/cmds/creators/format.c ds2.0r27/lib/cmds/creators/format.c *** ds1.1/lib/cmds/creators/format.c Sun Feb 1 21:29:51 1998 --- ds2.0r27/lib/cmds/creators/format.c Wed Jul 5 00:01:03 2006 *************** *** 9,49 **** int cmd(string str) { ! write("This is a fake wiz command. Try \"help format\" to get" + ! " information on\nspecifying objects for certain wiz commands.\n"); ! return 1; } int help() { ! write("NOTE: This is not a command in itself.\n" + ! "Certain wizard commands require that you specify\n" + ! "objects in a certain format.\n" + ! "The format uses prefixes to specify types of\n" + ! "objects as follows:\n" + ! " !ob ob is NOT an NPC or player\n" + ! " %ob ob is a player\n" + ! " $ob ob is an NPC\n" + ! " #int int is an ordinal value, e.g. 0, 1 , 2...\n" + ! " /str str is a filename of an object\n" + ! "Objects can also be \"me\", which is your player\n" + ! " object, or \"here\", which is you environment.\n"); ! write("Objects denoted by prefixes are joined by a few\n" + ! "functional symbols:\n" + ! " object@environment denotes the object at an\n" + ! " environment. Environment can be either an\n" + ! " object or an object@environment.\n" + ! " e(object) denotes the environment of object.\n\n"); ! write("For example:\n" + ! " !sword@%descartes is the sword in Descartes'\n" + ! " inventory.\n" + ! " #2@!bag@$orc@here is the 3rd item in the bag\n" + ! " that the orc in front of you is holding.\n" + ! " NOTE: #0 is the first object.\n" + ! " $orc@/d/standard/square is the orc that\n" + ! " shouldn't be in the square.\n" + ! "See also: patch\n"+ ! "See man: to_object, get_object, get_objects\n"+ ! ""); ! return 1; } --- 9,49 ---- int cmd(string str) { ! write("This is a fake wiz command. Try \"help format\" to get" + ! " information on\nspecifying objects for certain wiz commands.\n"); ! return 1; } int help() { ! write("NOTE: This is not a command in itself.\n" + ! "Certain wizard commands require that you specify\n" + ! "objects in a certain format.\n" + ! "The format uses prefixes to specify types of\n" + ! "objects as follows:\n" + ! " !ob ob is NOT an NPC or player\n" + ! " %ob ob is a player\n" + ! " $ob ob is an NPC\n" + ! " #int int is an ordinal value, e.g. 0, 1 , 2...\n" + ! " /str str is a filename of an object\n" + ! "Objects can also be \"me\", which is your player\n" + ! " object, or \"here\", which is you environment.\n"); ! write("Objects denoted by prefixes are joined by a few\n" + ! "functional symbols:\n" + ! " object@environment denotes the object at an\n" + ! " environment. Environment can be either an\n" + ! " object or an object@environment.\n" + ! " e(object) denotes the environment of object.\n\n"); ! write("For example:\n" + ! " !sword@%descartes is the sword in Descartes'\n" + ! " inventory.\n" + ! " #2@!bag@$orc@here is the 3rd item in the bag\n" + ! " that the orc in front of you is holding.\n" + ! " NOTE: #0 is the first object.\n" + ! " $orc@/d/standard/square is the orc that\n" + ! " shouldn't be in the square.\n" + ! "See also: patch\n"+ ! "See man: to_object, get_object, get_objects\n"+ ! ""); ! return 1; } diff -c -r --new-file ds1.1/lib/cmds/creators/goto.c ds2.0r27/lib/cmds/creators/goto.c *** ds1.1/lib/cmds/creators/goto.c Sun Feb 1 21:29:51 1998 --- ds2.0r27/lib/cmds/creators/goto.c Wed Jul 5 00:01:03 2006 *************** *** 8,32 **** #include inherit LIB_DAEMON; ! mixed cmd(string str) { object ob; if(!str) return "Goto where?"; if((ob = find_living(lower_case(str))) && (!ob->GetInvis() || !archp(ob)) && ob=environment(ob)) { ! if(ob == environment(this_player())) { ! message("my_action", "You twitch.", this_player()); ! if(hiddenp(this_player())) return 1; ! message("other_action", (string)this_player()->GetName()+ ! " twitches.", ob, ({ this_player() })); ! return 1; ! } } if(ob && ob->GetInvis() && creatorp(ob) && !archp(this_player())) ob = 0; if(!ob) str = absolute_path((string)this_player()->query_cwd(), str); ! if(ob) this_player()->eventMoveLiving(ob, ""); ! else this_player()->eventMoveLiving(str, ""); return 1; } --- 8,40 ---- #include inherit LIB_DAEMON; ! mixed cmd(string str) { object ob; if(!str) return "Goto where?"; if((ob = find_living(lower_case(str))) && (!ob->GetInvis() || !archp(ob)) && ob=environment(ob)) { ! if(ob == environment(this_player())) { ! message("my_action", "You twitch.", this_player()); ! if(hiddenp(this_player())) return 1; ! message("other_action", (string)this_player()->GetName()+ ! " twitches.", ob, ({ this_player() })); ! return 1; ! } } if(ob && ob->GetInvis() && creatorp(ob) && !archp(this_player())) ob = 0; if(!ob) str = absolute_path((string)this_player()->query_cwd(), str); ! if(ob) { ! this_player()->eventMoveLiving(ob, ""); ! return 1; ! } ! if(!file_exists(str)) str += ".c"; ! if(!file_exists(str)) { ! write("Location not found."); ! return 1; ! } ! else this_player()->eventMoveLiving(str, ""); return 1; } *************** *** 35,41 **** "Syntax: \n\n" "This command will move you to where the living thing is if it can " "be found, otherwise it will search for the file named and try to " ! "move you into that file.\n\nSee also: home, move, trans.", this_player() ); } --- 43,49 ---- "Syntax: \n\n" "This command will move you to where the living thing is if it can " "be found, otherwise it will search for the file named and try to " ! "move you into that file.\n\nSee also: home, move, trans, expel.", this_player() ); } diff -c -r --new-file ds1.1/lib/cmds/creators/home.c ds2.0r27/lib/cmds/creators/home.c *** ds1.1/lib/cmds/creators/home.c Sun Feb 1 21:29:51 1998 --- ds2.0r27/lib/cmds/creators/home.c Wed Jul 5 00:01:03 2006 *************** *** 19,76 **** else who = lower_case(str); str = user_path(who); if( ob = (object)this_player()->query_property("workroom") ) { ! if(ob == prev) return "You twitch."; ! if( (int)this_player()->eventMove(ob) ) { ! this_player()->eventDescribeEnvironment(0); ! if(hiddenp(this_player()) || this_player()->GetInvis()) ! return 1; ! message("mmout", (string)this_player()->GetMessage("home"), prev); ! message("mmin", (string)this_player()->GetMessage("telin"), ob, ! ({ this_player() })); ! return 1; ! } } if( !ob ) { ! if( !(ob = load_object(str+"workroom")) && ! str == user_path((string)this_player()->GetKeyName())) { ! ob = new(DIR_OBJ + "workroom"); ! this_player()->set_property("workroom", ob); ! } ! else if( !(ob = load_object(str+"workroom")) ) { ! if(!(ob = find_player(who)) || !(ob=(object)ob->query_property("workroom"))) ! return capitalize(who)+" has no active workroom."; ! } ! else { ! if( file_name(prev) == str+"workroom" ) ! return "You twitch."; ! if( (int)this_player()->eventMove(ob) ) { ! this_player()->eventDescribeEnvironment(0); ! if(hiddenp(this_player()) || this_player()->GetInvis()) ! return 1; ! message("mmout", (string)this_player()->GetMessage("home"), prev); ! message("mmin", (string)this_player()->GetMessage("telin"), ! environment(this_player()), ({ this_player() })); ! return 1; ! } ! return "You stay where you are."; ! } } if(ob == prev) return "You twitch."; if( (int)this_player()->eventMove(ob) ) { ! this_player()->eventDescribeEnvironment(0); ! if(hiddenp(this_player()) || this_player()->GetInvis()) return 1; ! message("mmout", (string)this_player()->GetMessage("home"), prev); ! message("mmin",(string)this_player()->GetMessage("telin"),ob,({this_player()})); ! return 1; } return "You stay where you are."; } void help() { message("help", "Syntax: \n \n\n" ! "Without arguments, this command will take you to your workroom. " ! "With arguments, it takes you to the workroom of the person " ! "you specify.\n\n" ! "See also: goto, trans", this_player()); } --- 19,76 ---- else who = lower_case(str); str = user_path(who); if( ob = (object)this_player()->query_property("workroom") ) { ! if(ob == prev) return "You twitch."; ! if( (int)this_player()->eventMove(ob) ) { ! this_player()->eventDescribeEnvironment(0); ! if(hiddenp(this_player()) || this_player()->GetInvis()) ! return 1; ! message("mmout", (string)this_player()->GetMessage("home"), prev); ! message("mmin", (string)this_player()->GetMessage("telin"), ob, ! ({ this_player() })); ! return 1; ! } } if( !ob ) { ! if( !(ob = load_object(str+"workroom")) && ! str == user_path((string)this_player()->GetKeyName())) { ! ob = new(DIR_OBJ + "workroom"); ! this_player()->set_property("workroom", ob); ! } ! else if( !(ob = load_object(str+"workroom")) ) { ! if(!(ob = find_player(who)) || !(ob=(object)ob->query_property("workroom"))) ! return capitalize(who)+" has no active workroom."; ! } ! else { ! if( file_name(prev) == str+"workroom" ) ! return "You twitch."; ! if( (int)this_player()->eventMove(ob) ) { ! this_player()->eventDescribeEnvironment(0); ! if(hiddenp(this_player()) || this_player()->GetInvis()) ! return 1; ! message("mmout", (string)this_player()->GetMessage("home"), prev); ! message("mmin", (string)this_player()->GetMessage("telin"), ! environment(this_player()), ({ this_player() })); ! return 1; ! } ! return "You stay where you are."; ! } } if(ob == prev) return "You twitch."; if( (int)this_player()->eventMove(ob) ) { ! this_player()->eventDescribeEnvironment(0); ! if(hiddenp(this_player()) || this_player()->GetInvis()) return 1; ! message("mmout", (string)this_player()->GetMessage("home"), prev); ! message("mmin",(string)this_player()->GetMessage("telin"),ob,({this_player()})); ! return 1; } return "You stay where you are."; } void help() { message("help", "Syntax: \n \n\n" ! "Without arguments, this command will take you to your workroom. " ! "With arguments, it takes you to the workroom of the person " ! "you specify.\n\n" ! "See also: goto, trans", this_player()); } diff -c -r --new-file ds1.1/lib/cmds/creators/i3who.c ds2.0r27/lib/cmds/creators/i3who.c *** ds1.1/lib/cmds/creators/i3who.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cmds/creators/i3who.c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,18 ---- + #include + #include + + inherit LIB_DAEMON; + + mixed cmd(string str) { + foreach(string mud in INTERMUD_D->GetMuds()){ + SERVICES_D->eventSendWhoRequest(mud); + } + return 1; + } + + + void help() { + message("help", "Syntax: i3who\n\n" + "Queries each active mud for rwho information.\n\n", + this_player()); + } diff -c -r --new-file ds1.1/lib/cmds/creators/invis.c ds2.0r27/lib/cmds/creators/invis.c *** ds1.1/lib/cmds/creators/invis.c Sun Feb 1 21:29:51 1998 --- ds2.0r27/lib/cmds/creators/invis.c Wed Jul 5 00:01:03 2006 *************** *** 8,20 **** varargs int cmd(string str) { ! if((int)this_player()->GetInvis()) { notify_fail("You are already invisible.\n"); return 0; } this_player()->SetInvis(1); message("my_action", "You fade into the shadows.", this_player()); ! return 1; } void help() --- 8,20 ---- varargs int cmd(string str) { ! if((int)this_player()->GetInvis()) { notify_fail("You are already invisible.\n"); return 0; } this_player()->SetInvis(1); message("my_action", "You fade into the shadows.", this_player()); ! return 1; } void help() diff -c -r --new-file ds1.1/lib/cmds/creators/last.c ds2.0r27/lib/cmds/creators/last.c *** ds1.1/lib/cmds/creators/last.c Sun Feb 1 21:29:52 1998 --- ds2.0r27/lib/cmds/creators/last.c Wed Jul 5 00:01:03 2006 *************** *** 43,49 **** string GetHelp(string topic) { return ("Syntax: \n" ! " \n\n" ! "Gives you a list of the last bunch of people to login or logout " ! "from the enter log."); } --- 43,49 ---- string GetHelp(string topic) { return ("Syntax: \n" ! " \n\n" ! "Gives you a list of the last bunch of people to login or logout " ! "from the enter log."); } diff -c -r --new-file ds1.1/lib/cmds/creators/lightme.c ds2.0r27/lib/cmds/creators/lightme.c *** ds1.1/lib/cmds/creators/lightme.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cmds/creators/lightme.c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,26 ---- + #include + + inherit LIB_COMMAND; + + int cmd(string str){ + int level; + if(!str){ + write("Your current radiant light is: "+this_player()->GetRadiantLight()+"."); + return 1; + } + if(sscanf(str,"%d",level) != 1){ + write("Please specify a numerical light level."); + return 1; + } + if(level < 0 || level > 100){ + write("Please enter a light level between 0 and 100"); + return 1; + } + this_player()->SetRadiantLight(level); + write("Your current radiant light is: "+this_player()->GetRadiantLight()+"."); + return 1; + } + + string GetHelp(string str){ + return "Reports or changes the amount of light your body radiates."; + } diff -c -r --new-file ds1.1/lib/cmds/creators/malloc.c ds2.0r27/lib/cmds/creators/malloc.c *** ds1.1/lib/cmds/creators/malloc.c Sun Feb 1 21:29:51 1998 --- ds2.0r27/lib/cmds/creators/malloc.c Wed Jul 5 00:01:03 2006 *************** *** 5,23 **** int cmd(string arg) { ! malloc_status(); ! return 1; } int help() { ! write( @EndText Syntax: malloc Effect: Lists memory usage statistics Output will depend on memory management package specified in options.h when the driver is compiled. See man: malloc_status EndText ! ); ! return 1; } --- 5,23 ---- int cmd(string arg) { ! malloc_status(); ! return 1; } int help() { ! write( @EndText Syntax: malloc Effect: Lists memory usage statistics Output will depend on memory management package specified in options.h when the driver is compiled. See man: malloc_status EndText ! ); ! return 1; } diff -c -r --new-file ds1.1/lib/cmds/creators/man.c ds2.0r27/lib/cmds/creators/man.c *** ds1.1/lib/cmds/creators/man.c Sun Feb 1 21:29:51 1998 --- ds2.0r27/lib/cmds/creators/man.c Wed Jul 5 00:01:03 2006 *************** *** 8,14 **** inherit LIB_DAEMON; ! #define MAN_PAGES ({ "sefun", "efun", "applies", "lfun" }) int cmd(string str) { string d, tmp; --- 8,14 ---- inherit LIB_DAEMON; ! #define MAN_PAGES ({ "sefun", "efun/all", "applies", "lfun" }) int cmd(string str) { string d, tmp; *************** *** 19,30 **** i = sizeof(MAN_PAGES); pages = ({}); while(i--) ! if(file_exists(tmp = sprintf("%s/%s/%s", DIR_DOCS, MAN_PAGES[i], ! str))) pages += ({ tmp }); if(!(i = sizeof(pages))) return notify_fail("No such man page.\n"); else if(i > 1) ! message("system", "Showing only the first of "+i+" man pages.", ! this_player()); this_player()->eventPage(pages[0]); return 1; ! } --- 19,30 ---- i = sizeof(MAN_PAGES); pages = ({}); while(i--) ! if(file_exists(tmp = sprintf("%s/%s/%s", DIR_DOCS, MAN_PAGES[i], ! str))) pages += ({ tmp }); if(!(i = sizeof(pages))) return notify_fail("No such man page.\n"); else if(i > 1) ! message("system", "Showing only the first of "+i+" man pages.", ! this_player()); this_player()->eventPage(pages[0]); return 1; ! } diff -c -r --new-file ds1.1/lib/cmds/creators/margins.c ds2.0r27/lib/cmds/creators/margins.c *** ds1.1/lib/cmds/creators/margins.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cmds/creators/margins.c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,19 ---- + #include + + inherit LIB_DAEMON; + + mixed cmd(string str) { + return @ENDTEXT + |---------------------------------------------------------------|-------------| + ENDTEXT; + } + + void help() { + write("Syntax: margins\n"); + write(@EndText + This simple command prints a line to help creators when writing + descriptions. It gives a visual indicator of when to stop on + one line and continue on the next. + EndText + ); + } diff -c -r --new-file ds1.1/lib/cmds/creators/message.c ds2.0r27/lib/cmds/creators/message.c *** ds1.1/lib/cmds/creators/message.c Sun Feb 1 21:29:51 1998 --- ds2.0r27/lib/cmds/creators/message.c Wed Jul 5 00:01:03 2006 *************** *** 12,43 **** string type, msg; if( !args || args == "" ) { ! mapping msgs; ! string *cles; ! int i; ! string tmp = ""; ! ! i = sizeof(cles = keys(msgs = (mapping)this_player()->GetMessages())); ! while(i--) tmp += sprintf("%:-10s %s\n", cles[i], msgs[cles[i]]); ! message("system", tmp, this_player()); ! return 1; } if( sscanf(args, "%s %s", type, msg) != 2) return "Set it to what?"; if( !((int)this_player()->SetMessage(type, msg)) ) ! return "Invalid message type."; message("system", "Message " + type + " changed to:\n" + msg, ! this_player()); return 1; } void help() { message("help", "Syntax: \n\n" ! "Allows you to modify standard " + mud_name() + " messages. " ! "The message types are come, leave, telin, telout, home, " ! "clone, dest, login, logout, say, ask, exclaim. Not that " ! "with say, ask, and exclaim you only may enter in the verbs. " ! "Depending on the message class, you may place such placeholders " ! "as:\n$M\t" + mud_name() + "\n$N\tYour name\n$D\tdirection\n" ! "$O\tobject", ! this_player()); } --- 12,43 ---- string type, msg; if( !args || args == "" ) { ! mapping msgs; ! string *cles; ! int i; ! string tmp = ""; ! ! i = sizeof(cles = keys(msgs = (mapping)this_player()->GetMessages())); ! while(i--) tmp += sprintf("%:-10s %s\n", cles[i], msgs[cles[i]]); ! message("system", tmp, this_player()); ! return 1; } if( sscanf(args, "%s %s", type, msg) != 2) return "Set it to what?"; if( !((int)this_player()->SetMessage(type, msg)) ) ! return "Invalid message type."; message("system", "Message " + type + " changed to:\n" + msg, ! this_player()); return 1; } void help() { message("help", "Syntax: \n\n" ! "Allows you to modify standard " + mud_name() + " messages. " ! "The message types are come, leave, telin, telout, home, " ! "clone, dest, login, logout, say, ask, exclaim. Not that " ! "with say, ask, and exclaim you only may enter in the verbs. " ! "Depending on the message class, you may place such placeholders " ! "as:\n$M\t" + mud_name() + "\n$N\tYour name\n$D\tdirection\n" ! "$O\tobject", ! this_player()); } diff -c -r --new-file ds1.1/lib/cmds/creators/move.c ds2.0r27/lib/cmds/creators/move.c *** ds1.1/lib/cmds/creators/move.c Sun Feb 1 21:29:52 1998 --- ds2.0r27/lib/cmds/creators/move.c Wed Dec 31 19:00:00 1969 *************** *** 1,55 **** - /* /cmds/creators/move.c - * From the Dead Souls V Object Library - * Moves object from one place to another - * created by Descartes of Borg 961008 - * Version: @(#) move.c 1.2@(#) - * Last modified: 96/10/08 - */ - - #include - #include - - inherit LIB_DAEMON; - - mixed cmd(string args) { - object what, destination; - string a, b; - mixed res; - - if( sscanf(args, "%s into %s", a, b) != 2 && - sscanf(args, "%s to %s", a, b) != 2 ) { - return "Syntax: \n\n"; - } - what = to_object(a); - destination = to_object(b); - if( !what ) { - return "Unable to find " + a + "."; - } - if( !destination ) { - return "Unable to find " + b + "."; - } - if( living(what) && living(destination) ) { - return "None of that nonsense."; - } - res = what->eventMove(destination); - if( !res ) { - return "Failed to move " + identify(what) + " into " + - identify(destination) + "."; - } - else if( res != 1 ) { - return res; - } - previous_object()->eventPrint("Moved " + identify(what) + " into " + - identify(destination) + ".", MSG_SYSTEM); - if( living(what) ) { - what->eventDescribeEnvironment(); - } - return 1; - } - - string GetHelp() { - return ("Syntax: \n\n" - "Allows you to move the object you name into the container " - "you name.\n\n" - "See also: trans"); - } --- 0 ---- diff -c -r --new-file ds1.1/lib/cmds/creators/mraces.c ds2.0r27/lib/cmds/creators/mraces.c *** ds1.1/lib/cmds/creators/mraces.c Sun Feb 1 21:29:51 1998 --- ds2.0r27/lib/cmds/creators/mraces.c Wed Jul 5 00:01:03 2006 *************** *** 2,31 **** * A tool for cres which displays a listing of all preset npc races * Blitz@NM-IVD */ ! #include ! #include ! mixed cmd(string str) { ! string *types; ! if( str ) types = regexp(PresetNpcTypes, "^"+str); ! else types = PresetNpcTypes; ! if( !sizeof(types) ) { ! if( !str ) return "No list at this time."; ! return "No match was found for \""+str+"\"."; ! } ! types = sort_array(types, 1); ! message("help", format_page(types, 5), this_player() ); ! return 1; } ! void help() { ! message("info", ! "Syntax: mraces\n" ! " mraces \n\n" ! "A simple tool for creators which will list available 'preset' npc " ! "races. Entering \"mraces\" along will list all races. Entering " ! "\"mraces a\" will list all races that begin with 'a', etc.", ! this_player() ); } ! --- 2,28 ---- * A tool for cres which displays a listing of all preset npc races * Blitz@NM-IVD */ ! #include ! #include ! mixed cmd(string str) { ! string *types; ! ! types = load_object(RACES_D)->GetRaces(); ! if( !sizeof(types) ) { ! return "No list at this time."; ! } ! types = sort_array(types, 1); ! message("help", format_page(types, 5), this_player() ); ! return 1; } ! void help() { ! message("info", ! "Syntax: mraces\n" ! " mraces \n\n" ! "A simple tool for creators which will list available npc races.", ! this_player() ); } ! diff -c -r --new-file ds1.1/lib/cmds/creators/mstatus.c ds2.0r27/lib/cmds/creators/mstatus.c *** ds1.1/lib/cmds/creators/mstatus.c Sun Feb 1 21:29:51 1998 --- ds2.0r27/lib/cmds/creators/mstatus.c Wed Jul 5 00:01:03 2006 *************** *** 9,15 **** } string GetHelp(string str) { ! return (@EndText Syntax: mstatus [] Effect: Give you statistics on the driver and mudlib If the optional argument is given, you also get: --- 9,15 ---- } string GetHelp(string str) { ! return (@EndText Syntax: mstatus [] Effect: Give you statistics on the driver and mudlib If the optional argument is given, you also get: diff -c -r --new-file ds1.1/lib/cmds/creators/netstat.c ds2.0r27/lib/cmds/creators/netstat.c *** ds1.1/lib/cmds/creators/netstat.c Sun Feb 1 21:29:51 1998 --- ds2.0r27/lib/cmds/creators/netstat.c Wed Jul 5 00:01:03 2006 *************** *** 18,24 **** void help() { message("help", "Syntax: \n\n" ! "Gives you information about sockets being used by the LPC " ! "server through the MudOS socket efuns.\n\n" ! "See also: callouts, dumpallobj, mstatus", this_player()); } --- 18,24 ---- void help() { message("help", "Syntax: \n\n" ! "Gives you information about sockets being used by the LPC " ! "server through the MudOS socket efuns.\n\n" ! "See also: callouts, dumpallobj, mstatus", this_player()); } diff -c -r --new-file ds1.1/lib/cmds/creators/notices.c ds2.0r27/lib/cmds/creators/notices.c *** ds1.1/lib/cmds/creators/notices.c Sun Feb 1 21:29:52 1998 --- ds2.0r27/lib/cmds/creators/notices.c Wed Jul 5 00:01:03 2006 *************** *** 2,15 **** * from the Dead Souls V Mud Library * created by Blitz@Dead Souls 950115 */ ! #include #include ! #define OneDay (3600 * 24) ! string GetHelp(string foo); ! mixed cmd(string str) { string * words; object ob = this_player(); --- 2,15 ---- * from the Dead Souls V Mud Library * created by Blitz@Dead Souls 950115 */ ! #include #include ! #define OneDay (3600 * 24) ! string GetHelp(string foo); ! mixed cmd(string str) { string * words; object ob = this_player(); *************** *** 17,65 **** if( !sizeof(str) ) x = 1; else x = to_int(str); if( x < 1 ) { ! if( !archp(this_player()) ) return GetHelp(0); ! words = explode(str, " "); ! if( words[0] == "-d" ) { ! if( sizeof(words) < 2 ) return GetHelp(0); ! x = to_int(words[1]); ! if( x < 1 && words[1] != "0" ) ! return "Bad value ("+words[1]+")."; ! if( NOTIFY_D->eventRemoveNotice(x) ) ! ob->eventPrint("Notice number " + x + " has been erased."); ! else ob->eventPrint("Could not remove number " + x + "."); ! return 1; ! } ! else if( words[0] == "-p" && sizeof(words) > 1 ) { ! string file = words[1]; ! if( sizeof(words) > 2 ) x = to_int(words[2]); ! else x = 1; ! if( x < 1 ) return GetHelp(0); ! if( NOTIFY_D->eventWriteNotices(file, time() - (OneDay*x)) ) ! ob->eventPrint("Notices dumped to " + file + "."); ! else ob->eventPrint("No notices found, nothing done."); ! return 1; ! } ! else return GetHelp(0); } x = time() - (OneDay * x); if( !(int)NOTIFY_D->eventPrintNotices(this_player(), x) ) ! return "No recent notices found."; ! else return 1; } ! string GetHelp(string foo) { string str; str = "Syntax: notices\n" ! " notices \n\n" ! "Without arguments, this command displays all notices " ! "posted within the last 24 hours. You may also " ! "specify how many days back to search. For example, " ! "\"notices 7\" will display all notices posted within " ! "the last week.\n\n"; if( archp(this_player()) ) ! str += "Arch Commands: notices -d \n" ! " notices -p \n\n" ! "The d option deletes the specified notice id number.\n" ! "the p option will dump the output into \n"; return str; } --- 17,65 ---- if( !sizeof(str) ) x = 1; else x = to_int(str); if( x < 1 ) { ! if( !archp(this_player()) ) return GetHelp(0); ! words = explode(str, " "); ! if( words[0] == "-d" ) { ! if( sizeof(words) < 2 ) return GetHelp(0); ! x = to_int(words[1]); ! if( x < 1 && words[1] != "0" ) ! return "Bad value ("+words[1]+")."; ! if( NOTIFY_D->eventRemoveNotice(x) ) ! ob->eventPrint("Notice number " + x + " has been erased."); ! else ob->eventPrint("Could not remove number " + x + "."); ! return 1; ! } ! else if( words[0] == "-p" && sizeof(words) > 1 ) { ! string file = words[1]; ! if( sizeof(words) > 2 ) x = to_int(words[2]); ! else x = 1; ! if( x < 1 ) return GetHelp(0); ! if( NOTIFY_D->eventWriteNotices(file, time() - (OneDay*x)) ) ! ob->eventPrint("Notices dumped to " + file + "."); ! else ob->eventPrint("No notices found, nothing done."); ! return 1; ! } ! else return GetHelp(0); } x = time() - (OneDay * x); if( !(int)NOTIFY_D->eventPrintNotices(this_player(), x) ) ! return "No recent notices found."; ! else return 1; } ! string GetHelp(string foo) { string str; str = "Syntax: notices\n" ! " notices \n\n" ! "Without arguments, this command displays all notices " ! "posted within the last 24 hours. You may also " ! "specify how many days back to search. For example, " ! "\"notices 7\" will display all notices posted within " ! "the last week.\n\n"; if( archp(this_player()) ) ! str += "Arch Commands: notices -d \n" ! " notices -p \n\n" ! "The d option deletes the specified notice id number.\n" ! "the p option will dump the output into \n"; return str; } diff -c -r --new-file ds1.1/lib/cmds/creators/people.c ds2.0r27/lib/cmds/creators/people.c *** ds1.1/lib/cmds/creators/people.c Sun Feb 1 21:29:51 1998 --- ds2.0r27/lib/cmds/creators/people.c Wed Jul 5 00:01:03 2006 *************** *** 15,24 **** static private string query_time(); private string calculateFormatString(int screenSize); int cmd(string str) { - object *who, *display; - string *args; string msg, tmp1, tmp2; int i, maxi, aflag, bflag, cflag, eflag, gflag, hflag, lflag, mflag; int nflag, pflag, rflag, sflag, uflag; --- 15,24 ---- static private string query_time(); private string calculateFormatString(int screenSize); + object *whom, *who, *display; + string *args; int cmd(string str) { string msg, tmp1, tmp2; int i, maxi, aflag, bflag, cflag, eflag, gflag, hflag, lflag, mflag; int nflag, pflag, rflag, sflag, uflag; *************** *** 26,70 **** string formatString; string bar; if(!str || str == "" || strlen(str) == 1 || str[0] != '-') args = ({}); else args = explode(str[1..strlen(str)-1], ""); i = sizeof(args); while(i--) { ! switch(args[i]) { ! case "a": aflag = 1; break; /* list arches */ ! case "b": bflag = 1; break; /* list ambassadors */ ! case "c": cflag = 1; break; /* list creators */ ! case "e": eflag = 1; break; /* sort by race */ ! case "g": gflag = 1; break; /* sort by age */ ! case "h": hflag = 1; break; /* list high mortals */ ! case "l": lflag = 1; break; /* sort by level */ ! case "m": mflag = 1; break; /* page through eventPage */ ! case "n": nflag = 1; break; /* list newbies */ ! case "p": pflag = 1; break; /* list regular mortals */ ! case "r": rflag = 1; break; /* sort by realm location */ ! case "s": sflag = 1; break; /* sort by class */ ! case "u": uflag = 1; break; /* list undead */ ! } } who = filter(users(), "filter_invis", this_object()); if(!aflag && !bflag && !cflag && !hflag && !nflag && !pflag && !uflag) ! display = who; else { ! display = ({}); ! if(aflag) display += filter(who, "filter_arches", this_object()); ! if(bflag) display += filter(who, "filter_ambass", this_object()); ! if(cflag) display += filter(who, "filter_cres", this_object()); ! if(hflag) display += filter(who, "filter_hms", this_object()); ! if(nflag) display += filter(who, "filter_newbie", this_object()); ! if(pflag) display += filter(who, "filter_mortal", this_object()); ! if(uflag) display += filter(who, "filter_undead", this_object()); ! display = distinct_array(display); } if(!eflag && !gflag && !lflag && !rflag && !sflag) ! maxi = sizeof(display=sort_array(display,"general_sort",this_object())); else { ! __SortFlags = ({ eflag, gflag, lflag, rflag, sflag }); ! maxi = sizeof(display = sort_array(display,"special_sort",this_object())); } screenSize = ((int*)this_player()->GetScreen())[0]; formatString = calculateFormatString(screenSize); --- 26,78 ---- string formatString; string bar; + whom = ({}); + if(!str || str == "" || strlen(str) == 1 || str[0] != '-') args = ({}); else args = explode(str[1..strlen(str)-1], ""); i = sizeof(args); while(i--) { ! switch(args[i]) { ! case "a": aflag = 1; break; /* list arches */ ! case "b": bflag = 1; break; /* list ambassadors */ ! case "c": cflag = 1; break; /* list creators */ ! case "e": eflag = 1; break; /* sort by race */ ! case "g": gflag = 1; break; /* sort by age */ ! case "h": hflag = 1; break; /* list high mortals */ ! case "l": lflag = 1; break; /* sort by level */ ! case "m": mflag = 1; break; /* page through eventPage */ ! case "n": nflag = 1; break; /* list newbies */ ! case "p": pflag = 1; break; /* list regular mortals */ ! case "r": rflag = 1; break; /* sort by realm location */ ! case "s": sflag = 1; break; /* sort by class */ ! case "u": uflag = 1; break; /* list undead */ ! } } who = filter(users(), "filter_invis", this_object()); + foreach(object real_person in who){ + if(sizeof(base_name(real_person))) whom += ({ real_person }); + } + + who = whom; + if(!aflag && !bflag && !cflag && !hflag && !nflag && !pflag && !uflag) ! display = who; else { ! display = ({}); ! if(aflag) display += filter(who, "filter_arches", this_object()); ! if(bflag) display += filter(who, "filter_ambass", this_object()); ! if(cflag) display += filter(who, "filter_cres", this_object()); ! if(hflag) display += filter(who, "filter_hms", this_object()); ! if(nflag) display += filter(who, "filter_newbie", this_object()); ! if(pflag) display += filter(who, "filter_mortal", this_object()); ! if(uflag) display += filter(who, "filter_undead", this_object()); ! display = distinct_array(display); } if(!eflag && !gflag && !lflag && !rflag && !sflag) ! maxi = sizeof(display=sort_array(display,"general_sort",this_object())); else { ! __SortFlags = ({ eflag, gflag, lflag, rflag, sflag }); ! maxi = sizeof(display = sort_array(display,"special_sort",this_object())); } screenSize = ((int*)this_player()->GetScreen())[0]; formatString = calculateFormatString(screenSize); *************** *** 89,94 **** --- 97,103 ---- } static int filter_invis(object ob) { + if(!ob || !sizeof(base_name(ob))) return 0; if(!((int)ob->GetKeyName())) return 0; if(!((int)ob->GetInvis(this_player()))) return 1; if(archp(this_player())) return 1; *************** *** 106,112 **** static int filter_newbie(object ob) { return (!creatorp(ob) && !ambassadorp(ob) && (MAX_NEWBIE_LEVEL >= ! (int)ob->GetLevel())); } static int filter_mortal(object ob) { --- 115,121 ---- static int filter_newbie(object ob) { return (!creatorp(ob) && !ambassadorp(ob) && (MAX_NEWBIE_LEVEL >= ! (int)ob->GetLevel())); } static int filter_mortal(object ob) { *************** *** 121,148 **** int x, y; if(archp(alpha)) { ! if(!archp(beta)) return -1; ! else return strcmp((string)alpha->GetCapName(), ! (string)beta->GetCapName()); } else if(archp(beta)) return 1; if(creatorp(alpha)) { ! if(!creatorp(beta)) return -1; ! else return strcmp((string)alpha->GetCapName(), ! (string)beta->GetCapName()); } else if(creatorp(beta)) return 1; if(ambassadorp(alpha)) { ! if(!ambassadorp(beta)) return -1; ! else return strcmp((string)alpha->GetCapName(), ! (string)beta->GetCapName()); } else if(ambassadorp(beta)) return 1; if((x = (int)alpha->GetLevel()) > (y = (int)beta->GetLevel())) ! return -1; else if(x < y) return 1; else return strcmp((string)alpha->GetCapName(), ! (string)beta->GetCapName()); } static int special_sort(object alpha, object beta) { --- 130,157 ---- int x, y; if(archp(alpha)) { ! if(!archp(beta)) return -1; ! else return strcmp((string)alpha->GetCapName(), ! (string)beta->GetCapName()); } else if(archp(beta)) return 1; if(creatorp(alpha)) { ! if(!creatorp(beta)) return -1; ! else return strcmp((string)alpha->GetCapName(), ! (string)beta->GetCapName()); } else if(creatorp(beta)) return 1; if(ambassadorp(alpha)) { ! if(!ambassadorp(beta)) return -1; ! else return strcmp((string)alpha->GetCapName(), ! (string)beta->GetCapName()); } else if(ambassadorp(beta)) return 1; if((x = (int)alpha->GetLevel()) > (y = (int)beta->GetLevel())) ! return -1; else if(x < y) return 1; else return strcmp((string)alpha->GetCapName(), ! (string)beta->GetCapName()); } static int special_sort(object alpha, object beta) { *************** *** 150,197 **** int x, y; if(__SortFlags[4]) { ! if((a=(string)alpha->query_class())!=(b=(string)beta->query_class())) { ! if(!a) a = "zzzz"; ! if(!b) b= "zzzz"; ! return strcmp(a, b); ! } } if(__SortFlags[0]) { ! if((a=(string)alpha->query_race()) != (b=(string)beta->query_race())) { ! if(!a) a = "zzzz"; ! if(!b) b = "zzzz"; ! return strcmp(a, b); ! } } if(__SortFlags[3]) { ! if((a = file_name(environment(alpha))) != ! (b = file_name(environment(beta)))) return strcmp(a, b); } if(__SortFlags[2]) { ! if((x = (int)alpha->GetLevel()) != (y=(int)beta->GetLevel())) { ! if(x > y) return -1; ! else return 1; ! } } if(__SortFlags[1]) { ! if((x = (int)alpha->GetAge()) != (y = (int)beta->GetAge())) { ! if(x > y) return -1; ! else return 1; ! } } return 0; } private string calculateFormatString(int screenSize) { ! int nomSize = (((screenSize - 21) * 12) / 54); ! int ipSize = (((screenSize - 21) * 18) / 54); ! int envSize = (((screenSize - 21) * 24) / 54); ! ! if(nomSize < 12) nomSize = 12; ! if(ipSize < 18) ipSize = 18; ! if(envSize < 24) envSize = 24; ! ! return "%:-5s %:-2s %:-" + nomSize + "s %:-" + ipSize + "s %:-5s %:-3s %:-" + envSize + "s"; } --- 159,206 ---- int x, y; if(__SortFlags[4]) { ! if((a=(string)alpha->query_class())!=(b=(string)beta->query_class())) { ! if(!a) a = "zzzz"; ! if(!b) b= "zzzz"; ! return strcmp(a, b); ! } } if(__SortFlags[0]) { ! if((a=(string)alpha->query_race()) != (b=(string)beta->query_race())) { ! if(!a) a = "zzzz"; ! if(!b) b = "zzzz"; ! return strcmp(a, b); ! } } if(__SortFlags[3]) { ! if((a = file_name(environment(alpha))) != ! (b = file_name(environment(beta)))) return strcmp(a, b); } if(__SortFlags[2]) { ! if((x = (int)alpha->GetLevel()) != (y=(int)beta->GetLevel())) { ! if(x > y) return -1; ! else return 1; ! } } if(__SortFlags[1]) { ! if((x = (int)alpha->GetAge()) != (y = (int)beta->GetAge())) { ! if(x > y) return -1; ! else return 1; ! } } return 0; } private string calculateFormatString(int screenSize) { ! int nomSize = (((screenSize - 21) * 12) / 54); ! int ipSize = (((screenSize - 21) * 18) / 54); ! int envSize = (((screenSize - 21) * 24) / 54); ! ! if(nomSize < 12) nomSize = 12; ! if(ipSize < 18) ipSize = 18; ! if(envSize < 24) envSize = 24; ! ! return "%:-5s %:-2s %:-" + nomSize + "s %:-" + ipSize + "s %:-5s %:-3s %:-" + envSize + "s"; } *************** *** 207,219 **** if((int)ob->GetInvis()) nom = "("+nom+")"; if(in_edit(ob) || in_input(ob)) nom = "["+nom+"]"; if(creatorp(ob)) { ! if((int)ob->GetBlocked("all")) blk = "ACG"; ! else { ! if((int)ob->GetBlocked("cre")) blk = " C"; ! else blk = " "; ! if((int)ob->GetBlocked("gossip")) blk += "G"; ! else blk += " "; ! } } else blk = " "; if(!(x = (int)ob->GetLevel())) lev = "-"; --- 216,228 ---- if((int)ob->GetInvis()) nom = "("+nom+")"; if(in_edit(ob) || in_input(ob)) nom = "["+nom+"]"; if(creatorp(ob)) { ! if((int)ob->GetBlocked("all")) blk = "ACG"; ! else { ! if((int)ob->GetBlocked("cre")) blk = " C"; ! else blk = " "; ! if((int)ob->GetBlocked("gossip")) blk += "G"; ! else blk += " "; ! } } else blk = " "; if(!(x = (int)ob->GetLevel())) lev = "-"; *************** *** 225,245 **** if(!environment(ob)) env = "no environment"; else env = file_name(environment(ob)); if(!strsrch(env, REALMS_DIRS)) ! env = "~" + env[strlen(REALMS_DIRS)+1..]; else if(!strsrch(env, DOMAINS_DIRS)) ! env = "^"+env[strlen(DOMAINS_DIRS)+1..strlen(env)-1]; return sprintf(formatString, age, lev, nom, ip, idle, blk, env); } static private string query_time() { string tzone; ! int x; ! tzone = (string)this_player()->GetTimeZone() || localtime(time())[LT_ZONE]; ! x = (int)TIME_D->GetOffset(tzone) * 3600; return tzone + " time is: " + ctime(time() + x); } ! void help() { message("help", "Syntax: people [-abceghlmnprsu]\n\n" "Gives you a listing of people on "+mud_name()+". Output is " --- 234,258 ---- if(!environment(ob)) env = "no environment"; else env = file_name(environment(ob)); if(!strsrch(env, REALMS_DIRS)) ! env = "~" + env[strlen(REALMS_DIRS)+1..]; else if(!strsrch(env, DOMAINS_DIRS)) ! env = "^"+env[strlen(DOMAINS_DIRS)+1..strlen(env)-1]; return sprintf(formatString, age, lev, nom, ip, idle, blk, env); } static private string query_time() { string tzone; ! int x, offset; ! //tzone = (string)this_player()->GetTimeZone() || local_time(time())[LT_ZONE]; ! tzone = query_tz(); ! offset = (int)TIME_D->GetOffset(tzone); ! offset += EXTRA_TIME_OFFSET; ! if(query_os_type() != "windows" ) x = offset * 3600; ! else x = 0; return tzone + " time is: " + ctime(time() + x); } ! void help() { message("help", "Syntax: people [-abceghlmnprsu]\n\n" "Gives you a listing of people on "+mud_name()+". Output is " diff -c -r --new-file ds1.1/lib/cmds/creators/ping.c ds2.0r27/lib/cmds/creators/ping.c *** ds1.1/lib/cmds/creators/ping.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cmds/creators/ping.c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,25 ---- + #include + #include + + inherit LIB_DAEMON; + + mixed cmd(string str) { + string target; + if(!str || str == "") str = "Dead Souls"; + target = INTERMUD_D->GetMudName(str); + this_player()->SetProperty("pinging",1); + INTERMUD_D->eventWrite(({ "auth-mud-req", 5, mud_name(), 0,target, 0 })); + + return 1; + } + + void help() { + message("help", "Syntax: ping \n\n" + "Pings a mud to test connectivity. Only pings to " + "Dead Souls muds are supported and recommended.\n" + "Note that you may receive a reply from a different " + "mud than the one specified if someone else already " + "initiated a ping, or if your mud's keepalive happens " + "to be running at the moment of your command.\n\n", + this_player()); + } diff -c -r --new-file ds1.1/lib/cmds/creators/polyglottize.c ds2.0r27/lib/cmds/creators/polyglottize.c *** ds1.1/lib/cmds/creators/polyglottize.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cmds/creators/polyglottize.c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,41 ---- + #include + #include + + inherit LIB_DAEMON; + + mixed cmd(string str) { + object target; + + if(!str || str == "") str = "me"; + + if(str == "me") str = this_player()->GetKeyName(); + if(!target = present(str, environment(this_player()))){ + write("They're not here."); + return 1; + } + if(!living(target)) { + write("That's not a living thing."); + return 1; + } + if(creatorp(target) && !archp(this_player()) && + target != this_player()){ + write("That's impolite."); + tell_player(target,capitalize(this_player()->GetKeyName())+ + " just tried to polyglottize you."); + return 1; + } + + target->SetPolyglot(1); + if(target == this_player()) str = "yourself"; + else str = capitalize(str); + write("You polyglottize "+str+"."); + if(target != this_player()) + tell_object(target, capitalize(this_player()->GetKeyName())+" polyglottizes you."); + return 1; + } + + void help() { + message("help", "Syntax: polyglottize \n\n" + "Make the target able to understand all languages.\n\n", + this_player()); + } diff -c -r --new-file ds1.1/lib/cmds/creators/quell.c ds2.0r27/lib/cmds/creators/quell.c *** ds1.1/lib/cmds/creators/quell.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cmds/creators/quell.c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,27 ---- + // By Magnafix 10-14-96 + // required addition of list_new_posts() in bboard daemon + #include + #include + + inherit LIB_COMMAND; + + + int cmd(string str){ + write("You casually wave your hand, and bring about peace."); + say(this_player()->GetCapName()+" waves "+possessive()+" hand "+ + "and brings peace to the area."); + foreach(object combatant in get_livings(environment(this_player()))){ + if(combatant->GetInCombat()) tell_object(combatant,"You stop fighting."); + combatant->eventQuell(); + } + + return 1; + } + + + + string GetHelp(string str) { + return "Syntax: \n" + "This command brings peace between combatants in your environment.\n" + "See also: unquell\n"; + } diff -c -r --new-file ds1.1/lib/cmds/creators/realms.c ds2.0r27/lib/cmds/creators/realms.c *** ds1.1/lib/cmds/creators/realms.c Sun Feb 1 21:29:50 1998 --- ds2.0r27/lib/cmds/creators/realms.c Wed Jul 5 00:01:03 2006 *************** *** 20,29 **** text += ({ "Creator Moves Size Errors Objs HBs" }); text += ({ "-----------------------------------------------------" }); foreach(string name in names) { ! mapping foo = Stats[name]; ! text += ({ sprintf("%-14s %-8d %-8d %-8d %-6d %d", name, ! foo["moves"], foo["array_size"], foo["errors"], ! foo["objects"], foo["heart_beats"]) }); } this_player()->eventPage(text); return 1; --- 20,29 ---- text += ({ "Creator Moves Size Errors Objs HBs" }); text += ({ "-----------------------------------------------------" }); foreach(string name in names) { ! mapping foo = Stats[name]; ! text += ({ sprintf("%-14s %-8d %-8d %-8d %-6d %d", name, ! foo["moves"], foo["array_size"], foo["errors"], ! foo["objects"], foo["heart_beats"]) }); } this_player()->eventPage(text); return 1; *************** *** 31,38 **** string GetHelp(string str) { return ("Syntax: \n\n" ! "A creator command that displays individual author " ! "statistics relative to the \"areas\" found within " ! "their directories.\n\n" ! "See also: man author_stats"); } --- 31,38 ---- string GetHelp(string str) { return ("Syntax: \n\n" ! "A creator command that displays individual author " ! "statistics relative to the \"areas\" found within " ! "their directories.\n\n" ! "See also: man author_stats"); } diff -c -r --new-file ds1.1/lib/cmds/creators/rehash.c ds2.0r27/lib/cmds/creators/rehash.c *** ds1.1/lib/cmds/creators/rehash.c Sun Feb 1 21:29:51 1998 --- ds2.0r27/lib/cmds/creators/rehash.c Wed Jul 5 00:01:03 2006 *************** *** 2,27 **** * This allows creators to refresh command lookup tables * Blitz@NM-IVD */ ! #include #include ! inherit LIB_DAEMON; ! mixed cmd(string str) { ! if( !sizeof(str) ) return "Syntax: rehash \n"; ! if( file_size(str) != -2 ) ! return str+": Path not found."; ! CMD_D->eventRehash(str); ! message("system", str+": Rehashed.", this_player() ); ! return 1; } ! void help() { ! message("help", ! "Syntax: rehash \n\n" ! "This command allows creators to refresh the specified path's " ! "command parsing lookup tables.", ! this_player() ); } ! --- 2,27 ---- * This allows creators to refresh command lookup tables * Blitz@NM-IVD */ ! #include #include ! inherit LIB_DAEMON; ! mixed cmd(string str) { ! if( !sizeof(str) ) return "Syntax: rehash \n"; ! if( file_size(str) != -2 ) ! return str+": Path not found."; ! CMD_D->eventRehash(str); ! message("system", str+": Rehashed.", this_player() ); ! return 1; } ! void help() { ! message("help", ! "Syntax: rehash \n\n" ! "This command allows creators to refresh the specified path's " ! "command parsing lookup tables.", ! this_player() ); } ! diff -c -r --new-file ds1.1/lib/cmds/creators/replog.c ds2.0r27/lib/cmds/creators/replog.c *** ds1.1/lib/cmds/creators/replog.c Sun Feb 1 21:29:51 1998 --- ds2.0r27/lib/cmds/creators/replog.c Wed Jul 5 00:01:03 2006 *************** *** 11,22 **** if(!str) str = (string)this_player()->GetKeyName(); str = "/log/reports/"+str; if(!file_exists(str)) { ! notify_fail("No such file: "+str+".\n"); ! return 0; } if(!tail(str)) { ! notify_fail("Failed to read file: "+str+".\n"); ! return 0; } return 1; } --- 11,22 ---- if(!str) str = (string)this_player()->GetKeyName(); str = "/log/reports/"+str; if(!file_exists(str)) { ! notify_fail("No such file: "+str+".\n"); ! return 0; } if(!tail(str)) { ! notify_fail("Failed to read file: "+str+".\n"); ! return 0; } return 1; } diff -c -r --new-file ds1.1/lib/cmds/creators/reset.c ds2.0r27/lib/cmds/creators/reset.c *** ds1.1/lib/cmds/creators/reset.c Sun Feb 1 21:29:51 1998 --- ds2.0r27/lib/cmds/creators/reset.c Wed Jul 5 00:01:03 2006 *************** *** 26,31 **** void help() { write("Syntax: or or \n\n"+ ! "Resets the object named or the environment you are in if no object\n"+ ! "is named.\n"); } --- 26,31 ---- void help() { write("Syntax: or or \n\n"+ ! "Resets the object named or the environment you are in if no object\n"+ ! "is named.\n"); } diff -c -r --new-file ds1.1/lib/cmds/creators/return.c ds2.0r27/lib/cmds/creators/return.c *** ds1.1/lib/cmds/creators/return.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cmds/creators/return.c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,50 ---- + #include + + inherit LIB_DAEMON; + + mixed cmd(string args) { + object ob, room; + string last_loc; + + if( !args || args == "" ) { + if(!last_loc = this_player()->GetProperty("LastLocation")){ + write("You have nowhere to return to."); + return 1; + } + else if(!load_object(last_loc)){ + write("There is a problem with that location."); + write("You remain where you are."); + return 1; + } + else this_player()->eventMoveLiving(load_object(last_loc)); + return 1; + } + + if( !(ob = find_player(convert_name(args))) && !(ob = find_living(args)) ) + return "No such being exists anywhere presently."; + if( !room = load_object(ob->GetProperty("ReturnSite"))){ + write("That person has nowhere to return."); + return 1; + } + + if(room == environment(ob)){ + write("That person is already there."); + return 1; + } + + ob->SetProperty("ReturnSite",""); + if( !((int)ob->eventMoveLiving(room) )) + return "Failed to move " + (string)ob->GetCapName() + "."; + message("system", "You have been returned to your previous location by " + + (string)this_player()->GetName() + ".", ob); + message("system", "You return " + (string)ob->GetCapName() + + " to their previous location.", this_player()); + return 1; + } + + void help() { + message("help", "Syntax: \n\n" + "Sends someone back, after a trans.\n" + "With no arguments, sends you to your last location.\n\n" + "See also: goto", this_player()); + } diff -c -r --new-file ds1.1/lib/cmds/creators/scan.c ds2.0r27/lib/cmds/creators/scan.c *** ds1.1/lib/cmds/creators/scan.c Sun Feb 1 21:29:50 1998 --- ds2.0r27/lib/cmds/creators/scan.c Wed Jul 5 00:01:03 2006 *************** *** 4,91 **** * created by Descartes of Borg 950516 * -fi flags added for Dead Souls by Blitz 951208 */ ! #include ! #define OPT_E (1 << 1) #define OPT_D (1 << 2) #define OPT_I (1 << 3) #define OPT_F (1 << 4) ! inherit LIB_DAEMON; ! string inventory(object ob, int level, int scan); ! mixed cmd(string args) { object *inv; object ob; string tmp; int scan, i, maxi; ! if( args == "" || !args ) { ! ob = this_player(); ! scan = 0; } else { ! while(args[0] == '-') { ! switch(args[1]) { ! case 'd': scan |= OPT_D; break; ! case 'e': scan |= OPT_E; break; ! case 'i': scan |= OPT_I; break; ! case 'f': scan |= OPT_F; break; ! } ! if( strlen(args) > 3 ) args = trim(args[2..]); ! else args = ""; ! } ! if( args != "" ) ob = to_object(args); ! if( !ob ) ob = this_player(); } if( scan & OPT_E ) ob = environment(ob); if( !ob ) return "No environment for requested object."; if( scan & OPT_D ) tmp = "Deep scanning " + identify(ob) + ":\n"; else tmp = "Scanning " + identify(ob) + ":\n"; for(i=0, maxi = sizeof(inv = all_inventory(ob)); ieventPage(explode(tmp, "\n"), "system"); return 1; } ! string inventory(object ob, int level, int scan) { object *inv; string ret; int i, maxi; ! for(i = 1, ret = ""; i <= level; i++) ret += "\t"; if( scan & OPT_I ) { ! string tmp; ! if( scan & OPT_F ) tmp = identify(ob) + "\n" + ret + " "; ! else tmp = ""; ! tmp += sprintf("(%s) - Mass: %d Value: %d Class: %d", ! capitalize((string)ob->GetKeyName()), ! (int)ob->GetMass(), (int)ob->GetValue(), ! (int)ob->GetClass() ); ! if( ob->GetWorn() ) tmp += " (worn)"; ! ret += tmp; } else ret += identify(ob); if( ( scan & OPT_D ) && ! ( maxi = sizeof(inv = all_inventory(ob))) ) ret += ":\n"; else ret += "\n"; if( !( scan & OPT_D ) ) return ret; for(i=0; i\n\n" ! "Scans the inventory of the object you name. If you do " ! "not specify an object, then it gives you your inventory. " ! "If you specify the -e option, the command does the " ! "environment of the object which is targeted. If the -d " ! "option is specified, then a deep scan is done. The -i " ! "option displays information about each object. The -f " ! "option forces filenames to be displayed (default).\n\n" ! "See also: inventory, stat"; } ! --- 4,91 ---- * created by Descartes of Borg 950516 * -fi flags added for Dead Souls by Blitz 951208 */ ! #include ! #define OPT_E (1 << 1) #define OPT_D (1 << 2) #define OPT_I (1 << 3) #define OPT_F (1 << 4) ! inherit LIB_DAEMON; ! string inventory(object ob, int level, int scan); ! mixed cmd(string args) { object *inv; object ob; string tmp; int scan, i, maxi; ! if( args == "" || !args ) { ! ob = this_player(); ! scan = 0; } else { ! while(args[0] == '-') { ! switch(args[1]) { ! case 'd': scan |= OPT_D; break; ! case 'e': scan |= OPT_E; break; ! case 'i': scan |= OPT_I; break; ! case 'f': scan |= OPT_F; break; ! } ! if( strlen(args) > 3 ) args = trim(args[2..]); ! else args = ""; ! } ! if( args != "" ) ob = to_object(args); ! if( !ob ) ob = this_player(); } if( scan & OPT_E ) ob = environment(ob); if( !ob ) return "No environment for requested object."; if( scan & OPT_D ) tmp = "Deep scanning " + identify(ob) + ":\n"; else tmp = "Scanning " + identify(ob) + ":\n"; for(i=0, maxi = sizeof(inv = all_inventory(ob)); ieventPage(explode(tmp, "\n"), "system"); return 1; } ! string inventory(object ob, int level, int scan) { object *inv; string ret; int i, maxi; ! for(i = 1, ret = ""; i <= level; i++) ret += "\t"; if( scan & OPT_I ) { ! string tmp; ! if( scan & OPT_F ) tmp = identify(ob) + "\n" + ret + " "; ! else tmp = ""; ! tmp += sprintf("(%s) - Mass: %d Value: %d Class: %d", ! capitalize((string)ob->GetKeyName()), ! (int)ob->GetMass(), (int)ob->GetValue(), ! intp((int)ob->GetClass()) ? (int)ob->GetClass() : 0 ); ! if( ob->GetWorn() ) tmp += " (worn)"; ! ret += tmp; } else ret += identify(ob); if( ( scan & OPT_D ) && ! ( maxi = sizeof(inv = all_inventory(ob))) ) ret += ":\n"; else ret += "\n"; if( !( scan & OPT_D ) ) return ret; for(i=0; i\n\n" ! "Scans the inventory of the object you name. If you do " ! "not specify an object, then it gives you your inventory. " ! "If you specify the -e option, the command does the " ! "environment of the object which is targeted. If the -d " ! "option is specified, then a deep scan is done. The -i " ! "option displays information about each object. The -f " ! "option forces filenames to be displayed (default).\n\n" ! "See also: inventory, stat"; } ! diff -c -r --new-file ds1.1/lib/cmds/creators/showtree.c ds2.0r27/lib/cmds/creators/showtree.c *** ds1.1/lib/cmds/creators/showtree.c Sun Feb 1 21:29:51 1998 --- ds2.0r27/lib/cmds/creators/showtree.c Wed Jul 5 00:01:03 2006 *************** *** 15,21 **** string func, file; if( !str || str == "" ) ! return "Syntax: or "; if( sscanf(str, "%s in %s", func, file) != 2 ) { if( sscanf(str, "%s %s", func, file) != 2 ) { func = 0; --- 15,21 ---- string func, file; if( !str || str == "" ) ! return "Syntax: or "; if( sscanf(str, "%s in %s", func, file) != 2 ) { if( sscanf(str, "%s %s", func, file) != 2 ) { func = 0; *************** *** 33,39 **** object ob; string str; int found; ! if( strlen(file) > 2 && file[<2..] == ".c" ) file = file[0..<3]; if( file[0] != '/' ) file = "/" + file; if( !(ob = load_object(file)) ) { --- 33,39 ---- object ob; string str; int found; ! if( strlen(file) > 2 && file[<2..] == ".c" ) file = file[0..<3]; if( file[0] != '/' ) file = "/" + file; if( !(ob = load_object(file)) ) { *************** *** 61,71 **** string GetHelp(string str) { return ("Syntax: \n" ! " \n\n" ! "In its first version, shows you the full inheritance " ! "tree for the named object. In its second form, it shows " ! "you all files in the inheritance tree which contain the " ! "function you name, specifically noting those objects which " ! "have definitions for the function.\n\n" ! "See also: help"); } --- 61,71 ---- string GetHelp(string str) { return ("Syntax: \n" ! " \n\n" ! "In its first version, shows you the full inheritance " ! "tree for the named object. In its second form, it shows " ! "you all files in the inheritance tree which contain the " ! "function you name, specifically noting those objects which " ! "have definitions for the function.\n\n" ! "See also: help"); } diff -c -r --new-file ds1.1/lib/cmds/creators/stargate.c ds2.0r27/lib/cmds/creators/stargate.c *** ds1.1/lib/cmds/creators/stargate.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cmds/creators/stargate.c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,46 ---- + /** + * modification of code contributed by daelas + * started 2006-04-04 + */ + #include + #include + + inherit LIB_DAEMON; + + mixed cmd(string str){ + mapping network; + + network = STARGATE_D->GetStargates(); + if (str){ + if (network[lower_case(str)]){ + write(str+" is part of the Stargate Network.\n"); + write(str+" data: "+identify(network[lower_case(str)])); + } + else { + write(str+" is not currently part of the Stargate Network.\n"); + } + return 1; + } + else { + write("These are the current Stargate locations in the Network:\n"); + if (!sizeof(network)){ + write("No locations found."); + return 1; + } + else { + string buf = ""; + string name; + write(implode(keys(network), ", ")); + } + } + return 1; + } + + void help() { + message("help", "Syntax: stargate \n\n" + "With an argument, this command will determine whether the argument " + "supplied is a valid stargate. If so, stargate data on that gate " + "is displayed. Without an argument, this command lists known valid " + "stargates.", + this_player()); + } diff -c -r --new-file ds1.1/lib/cmds/creators/stat.c ds2.0r27/lib/cmds/creators/stat.c *** ds1.1/lib/cmds/creators/stat.c Sun Feb 1 21:29:50 1998 --- ds2.0r27/lib/cmds/creators/stat.c Wed Dec 31 19:00:00 1969 *************** *** 1,105 **** - /* /cmds/creator/stat.c - * from the Dead Souls LPC Library - * a command to view something's stats - * created by Descartes of Borg 950409 - */ - - #include - - inherit LIB_DAEMON; - - mixed cmd(string args) { - string *lines, *arr, *limbs; - object ob; - string tmp1, tmp2; - int i, x, y, cols; - - if( args == "" || !args ) return 0; - if( !(ob = present(args, environment(this_player()))) ) - if( !(ob = find_player(convert_name(args))) && - !(ob = find_living(lower_case(args))) ) - return capitalize(args) + " is nowhere to be found."; - if( creatorp(ob) ) return "You cannot get stat information on a creator."; - cols = ((int *)this_player()->GetScreen())[0]; - tmp1 = (string)ob->GetCapName() + " aka " + (string)ob->GetShort() + - ", level " + (int)ob->GetLevel() + " " + (string)ob->GetGender(); - if( !(tmp2 = (string)ob->GetRace()) ) tmp2 = "blob"; - tmp1 += " " + tmp2; - if( !(tmp2 = (string)ob->GetClass()) ) tmp2 = "drifter"; - tmp1 += " " + capitalize(tmp2); - if( tmp2 = (string)ob->GetSpouse() ) - tmp1 += " (spouse: " + tmp2 + ")"; - lines = ({ center(tmp1, cols) }); - if( (int)ob->GetUndead() ) tmp1 = "Undead"; - else tmp1 = "Alive"; - if( (int)ob->GetSleeping() ) tmp1 += " / Sleeping"; - else tmp1 += " / Awake"; - if( (int)ob->GetParalyzed() ) tmp1 += " / Paralyzed"; - lines += ({ center(tmp1, cols), "" }); - lines += ({ center("Health: " +(int)ob->GetHealthPoints() + "/"+ - (int)ob->GetMaxHealthPoints() + " Magic: " + - (int)ob->GetMagicPoints() + "/" + - (int)ob->GetMaxMagicPoints() + " Stamina: " + - (int)ob->GetStaminaPoints() + "/" + - to_int((float)ob->GetMaxStaminaPoints()) + " Carry: " + - (int)ob->GetCarriedMass() + "/" + - (int)ob->GetMaxCarry(), cols) }); - lines += ({ center("Food: " + (int)ob->GetFood() + " " + - "Drink: " + (int)ob->GetDrink() + " " + - "Alcohol: " + (int)ob->GetAlcohol() + " " + - "Caffeine: " + (int)ob->GetCaffeine() + " " + - "Poison: " + (int)ob->GetPoison() + " ", cols) }); - lines += ({ center("Training Points: " + (int)ob->GetTrainingPoints()) }); - lines += ({ "", "Limbs:" }); - limbs = (string *)ob->GetWieldingLimbs(); - arr = map((string *)ob->GetLimbs(), - (: sprintf("%:-14s%s (%d) %d/%d", $1, - ((member_array($1, $(limbs)) == -1) ? " " : "*"), - (int)($(ob))->GetLimbClass($1), - (int)($(ob))->GetHealthPoints($1), - (int)($(ob))->GetMaxHealthPoints($1)) :)); - i = sizeof(arr); - while(i--) if( (y = strlen(arr[i])) > x ) x = y; - x = cols/(x+2); - lines += explode(format_page(arr, x), "\n") + ({ "", "Skills:" }); - arr = map((string *)ob->GetSkills(), - function(string skill, object who) { - mapping mp = (mapping)who->GetSkill(skill); - int x, max; - x = to_int(percent(mp["points"], - (int)who->GetMaxSkillPoints(skill, mp["level"]))); - max = ( mp["class"] == 1 ? 2 : 1 ) + who->GetLevel(); - max *= 2; - if( max < mp["level"] ) max = mp["level"]; - return sprintf("%:-18s (%d) %:2d%% - %d/%d", - skill, mp["class"], x, mp["level"], max); - }, ob); - i = sizeof(arr); - while(i--) if( (y = strlen(arr[i])) > x ) x = y; - x = cols/(x+2); - lines += explode(format_page(arr, x), "\n") + ({ "", "Stats:" }); - arr = map((string *)ob->GetStats(), - (: sprintf("%:-12s (%d) %d/%d", $1, - (int)($(ob))->GetStatClass($1), - (int)($(ob))->GetStatLevel($1), - (int)($(ob))->GetBaseStatLevel($1)) :)); - i = sizeof(arr); - x = 0; - while(i--) if( (y = strlen(arr[i])) > x ) x = y; - x =cols/(x+2); - lines += explode(format_page(arr, x), "\n"); - lines += ({ "", (string)ob->GetName()+" has amassed a net worth of " + - ( (int)ob->GetNetWorth() * currency_rate("gold") ) + " gold."}); - arr = filter( map((string *)ob->GetCurrencies(), - (: ($(ob))->GetCurrency($1) && - sprintf("%d %s", ($(ob))->GetCurrency($1), $1) :)), - (: $1 :)); - lines += ({ "Money on hand: "+implode(arr, ", ") }); - this_player()->eventPage(lines, "system"); - return 1; - } - - string GetHelp(string blah) { - return ("Syntax: stat \n\n" - "Displays statistical information on the living object named."); - } --- 0 ---- diff -c -r --new-file ds1.1/lib/cmds/creators/tellblock.c ds2.0r27/lib/cmds/creators/tellblock.c *** ds1.1/lib/cmds/creators/tellblock.c Sun Feb 1 21:29:52 1998 --- ds2.0r27/lib/cmds/creators/tellblock.c Wed Jul 5 00:01:03 2006 *************** *** 19,23 **** void help() { write("Syntax: \n\n"+ ! "Toggles the blocking of tells on and off."); } --- 19,23 ---- void help() { write("Syntax: \n\n"+ ! "Toggles the blocking of tells on and off."); } diff -c -r --new-file ds1.1/lib/cmds/creators/trans.c ds2.0r27/lib/cmds/creators/trans.c *** ds1.1/lib/cmds/creators/trans.c Sun Feb 1 21:29:52 1998 --- ds2.0r27/lib/cmds/creators/trans.c Wed Jul 5 00:01:03 2006 *************** *** 13,32 **** if( !args || args == "" ) return "Trans whom?"; if( !(ob = find_player(convert_name(args))) && !(ob = find_living(args)) ) ! return "No such being exists anywhere presently."; if( environment(ob) == environment(this_player()) ) ! return (string)ob->GetCapName() + " is right here."; message("system", "You have been summoned by " + ! (string)this_player()->GetName() + ".", ob); if( !((int)ob->eventMoveLiving(environment(this_player()))) ) ! return "Failed to move " + (string)ob->GetCapName() + "."; else message("system", "You trans " + (string)ob->GetCapName() + ! " to you.", this_player()); return 1; } void help() { message("help", "Syntax: \n\n" ! "Brings a living thing to your location.\n\n" ! "See also: goto", this_player()); } --- 13,38 ---- if( !args || args == "" ) return "Trans whom?"; if( !(ob = find_player(convert_name(args))) && !(ob = find_living(args)) ) ! return "No such being exists anywhere presently."; if( environment(ob) == environment(this_player()) ) ! return (string)ob->GetCapName() + " is right here."; ! if(archp(ob) && !archp(this_player())){ ! write("You can't trans an admin."); ! tell_player(ob, this_player()->GetName()+" just tried to trans you."); ! return 1; ! } ! ob->SetProperty("ReturnSite",base_name(environment(ob))); message("system", "You have been summoned by " + ! (string)this_player()->GetName() + ".", ob); if( !((int)ob->eventMoveLiving(environment(this_player()))) ) ! return "Failed to move " + (string)ob->GetCapName() + "."; else message("system", "You trans " + (string)ob->GetCapName() + ! " to you.", this_player()); return 1; } void help() { message("help", "Syntax: \n\n" ! "Brings a living thing to your location.\n\n" ! "See also: return, goto, move, expel", this_player()); } diff -c -r --new-file ds1.1/lib/cmds/creators/transfer.c ds2.0r27/lib/cmds/creators/transfer.c *** ds1.1/lib/cmds/creators/transfer.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cmds/creators/transfer.c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,59 ---- + /* /cmds/creators/transfer.c + * From the Dead Souls V Object Library + * Moves object from one place to another + * created by Descartes of Borg 961008 + * Version: @(#) transfer.c 1.2@(#) + * Last modified: 96/10/08 + */ + + #include + #include + + inherit LIB_DAEMON; + + mixed cmd(string args) { + object what, destination; + string a, b; + mixed res; + + if(!args || args == ""){ + return "Syntax: \n\n"; + } + + if( sscanf(args, "%s into %s", a, b) != 2 && + sscanf(args, "%s to %s", a, b) != 2 ) { + return "Syntax: \n\n"; + } + what = to_object(a); + destination = to_object(b); + if( !what ) { + return "Unable to find " + a + "."; + } + if( !destination ) { + return "Unable to find " + b + "."; + } + if( living(what) && living(destination) ) { + return "None of that nonsense."; + } + res = what->eventMove(destination); + if( !res ) { + return "Failed to transfer " + identify(what) + " into " + + identify(destination) + "."; + } + else if( res != 1 ) { + return res; + } + previous_object()->eventPrint("Transferred " + identify(what) + " into " + + identify(destination) + ".", MSG_SYSTEM); + if( living(what) ) { + what->eventDescribeEnvironment(); + } + return 1; + } + + string GetHelp() { + return ("Syntax: \n\n" + "Allows you to transfer the object you name into the container " + "you name.\n\n" + "See also: trans, expel, goto, return"); + } diff -c -r --new-file ds1.1/lib/cmds/creators/unquell.c ds2.0r27/lib/cmds/creators/unquell.c *** ds1.1/lib/cmds/creators/unquell.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cmds/creators/unquell.c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,27 ---- + // By Magnafix 10-14-96 + // required addition of list_new_posts() in bboard daemon + #include + #include + + inherit LIB_COMMAND; + + + int cmd(string str){ + write("You snap your fingers, and permit hostilities to resume."); + say(this_player()->GetCapName()+" snaps "+possessive()+" fingers "+ + "and permits hostilities to resume."); + foreach(object combatant in get_livings(environment(this_player()))){ + combatant->eventUnQuell(); + if(combatant->GetInCombat()) tell_object(combatant,"You resume fighting."); + } + + return 1; + } + + + + string GetHelp(string str) { + return "Syntax: \n" + "Allows quelled combat to resume.\n" + "See also: quell\n"; + } diff -c -r --new-file ds1.1/lib/cmds/creators/vis.c ds2.0r27/lib/cmds/creators/vis.c *** ds1.1/lib/cmds/creators/vis.c Sun Feb 1 21:29:52 1998 --- ds2.0r27/lib/cmds/creators/vis.c Wed Jul 5 00:01:03 2006 *************** *** 8,29 **** varargs int cmd(string str) { ! if(!this_player()->GetInvis()) { notify_fail("You are already visible.\n"); return 0; } this_player()->SetInvis(0); message("my_action", "You step out of the shadows.", this_player()); ! return 1; } int help() { ! write( @EndText Syntax: vis Effect: Makes you visible if you wern't already. EndText ! ); ! return 1; } --- 8,29 ---- varargs int cmd(string str) { ! if(!this_player()->GetInvis()) { notify_fail("You are already visible.\n"); return 0; } this_player()->SetInvis(0); message("my_action", "You step out of the shadows.", this_player()); ! return 1; } int help() { ! write( @EndText Syntax: vis Effect: Makes you visible if you wern't already. EndText ! ); ! return 1; } diff -c -r --new-file ds1.1/lib/cmds/creators/which.c ds2.0r27/lib/cmds/creators/which.c *** ds1.1/lib/cmds/creators/which.c Sun Feb 1 21:29:52 1998 --- ds2.0r27/lib/cmds/creators/which.c Wed Jul 5 00:01:03 2006 *************** *** 15,30 **** mixed cmd(string args) { string array dirs; string dir, msg; if( !args ) { return "You want to know information on which command?"; } ! if( !(dirs = CMD_D->GetPaths(args)) ) { return args + ": not found."; } msg = args + ":"; foreach(dir in dirs) { ! msg += "\n\t" + dir; } previous_object()->eventPrint(msg, MSG_SYSTEM); return 1; --- 15,39 ---- mixed cmd(string args) { string array dirs; string dir, msg; + int isverb; + dirs = ({}); + + isverb = 0; if( !args ) { return "You want to know information on which command?"; } ! if(member_array(args,keys(VERBS_D->GetVerbs())) != -1){ ! dirs += ({ (VERBS_D->GetVerbs())[args] }); ! isverb = 1; ! } ! else if( !(dirs = CMD_D->GetPaths(args)) ) { return args + ": not found."; } msg = args + ":"; foreach(dir in dirs) { ! if(isverb) msg += "\n\t" + dir; ! else msg += "\n\t" + dir + "/" + args + ".c"; } previous_object()->eventPrint(msg, MSG_SYSTEM); return 1; *************** *** 32,38 **** string GetHelp() { return ("Syntax: \n\n" ! "Gives you a listing of all directories in which a command " ! "object may be found.\n\n" ! "See also: help, man"); } --- 41,47 ---- string GetHelp() { return ("Syntax: \n\n" ! "Gives you a listing of all directories in which a command " ! "object may be found.\n\n" ! "See also: help, man"); } diff -c -r --new-file ds1.1/lib/cmds/creators/whomuffed.c ds2.0r27/lib/cmds/creators/whomuffed.c *** ds1.1/lib/cmds/creators/whomuffed.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cmds/creators/whomuffed.c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,42 ---- + #include + + inherit LIB_DAEMON; + + mixed cmd(string str) { + object player; + if(!str || str =="") { + if(!sizeof(this_player()->GetMuffed())) write("You are ignoring no one."); + else { + write("You are ignoring the following:\n"); + write(implode(filter(this_player()->GetMuffed(), (: capitalize($1) :)), "\n")+"\n"); + } + return 1; + } + + else str = lower_case(str); + if(!(player = find_player(str))){ + write("No such player to be found."); + return 1; + } + + if(!sizeof(player->GetMuffed())){ + write("That player is ignoring no one."); + return 1; + } + + else { + write(capitalize(str)+" is ignoring: \n"); + write(implode(filter(player->GetMuffed(), (: capitalize($1) :)), "\n")+"\n"); + } + return 1; + } + + void help() { + message("help", + "Syntax: whomuffed\n" + " whomuffed \n\n" + "This command lists who is ignored by the player specified.\n" + "See also: earmuff, unmuff\n\n", + this_player() ); + } + diff -c -r --new-file ds1.1/lib/cmds/creators/wiz.c ds2.0r27/lib/cmds/creators/wiz.c *** ds1.1/lib/cmds/creators/wiz.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cmds/creators/wiz.c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,21 ---- + /* /cmds/creators/wiz.c + * Created by Zin@Frontiers + * Sun Sep 21 21:00:16 1997 EDT + */ + + #include + #include + + inherit LIB_DAEMON; + + mixed cmd(string str) { + write("You speed to the Creators' Hall.\n"); + this_player()->eventMoveLiving("/domains/default/room/wiz_hall"); + return 1; + } + + void help() { + message("help", "Syntax: wiz\n\n" + "This command will move you to the Creators' Hall.\n\n", + this_player()); + } diff -c -r --new-file ds1.1/lib/cmds/hm/.login ds2.0r27/lib/cmds/hm/.login *** ds1.1/lib/cmds/hm/.login Fri Jan 3 22:13:21 1997 --- ds2.0r27/lib/cmds/hm/.login Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - finger holle - honey HONEY! --- 0 ---- diff -c -r --new-file ds1.1/lib/cmds/hm/.login.bak ds2.0r27/lib/cmds/hm/.login.bak *** ds1.1/lib/cmds/hm/.login.bak Fri Jan 3 22:13:21 1997 --- ds2.0r27/lib/cmds/hm/.login.bak Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - finger holle - honey HONEY! --- 0 ---- diff -c -r --new-file ds1.1/lib/cmds/hm/.login.bak.bak ds2.0r27/lib/cmds/hm/.login.bak.bak *** ds1.1/lib/cmds/hm/.login.bak.bak Fri Jan 3 22:13:21 1997 --- ds2.0r27/lib/cmds/hm/.login.bak.bak Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - finger holle - honey HONEY! --- 0 ---- diff -c -r --new-file ds1.1/lib/cmds/hm/.login.bak.bak.bak ds2.0r27/lib/cmds/hm/.login.bak.bak.bak *** ds1.1/lib/cmds/hm/.login.bak.bak.bak Fri Jan 3 22:13:21 1997 --- ds2.0r27/lib/cmds/hm/.login.bak.bak.bak Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - finger holle - honey HONEY! --- 0 ---- diff -c -r --new-file ds1.1/lib/cmds/hm/.login.bak.bak.bak.bak ds2.0r27/lib/cmds/hm/.login.bak.bak.bak.bak *** ds1.1/lib/cmds/hm/.login.bak.bak.bak.bak Fri Jan 3 22:13:21 1997 --- ds2.0r27/lib/cmds/hm/.login.bak.bak.bak.bak Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - finger holle - honey HONEY! --- 0 ---- diff -c -r --new-file ds1.1/lib/cmds/players/biography.c ds2.0r27/lib/cmds/players/biography.c *** ds1.1/lib/cmds/players/biography.c Sun Feb 1 21:29:52 1998 --- ds2.0r27/lib/cmds/players/biography.c Wed Jul 5 00:01:03 2006 *************** *** 22,46 **** cols = ((int *)this_player()->GetScreen())[0]; tmp = ({ center("Biography for " + (string)this_player()->GetShort() + ! " on " + mud_name(), cols), "" }); birth = (int)this_player()->GetBirth(); x = query_year(birth); if( x < 0 ) yrstr = (-x) + " BN"; else yrstr = x + ""; tmp += ({ sprintf("%:-"+(cols/2)+"s%"+(cols/2)+"s", "Level: " + ! (int)this_player()->GetLevel(), "Age: " + ! ((time() - birth)/YEAR) + " years") }); tmp = ({ "You are " + (string)this_player()->GetMoralityDescription() ! + "." }); tmp += ({ sprintf("You were born on the %d%s day of %s, year %s.", ! query_date(birth), ordinal(query_date(birth)), ! query_month(birth), yrstr) }); m = (class marriage *)this_player()->GetMarriages(); if( !sizeof(m) ) tmp += ({ "You have never been married." }); else { class marriage marr; string town; ! marr = m[0]; if( !marr->DivorceDate ) { x = query_year(marr->WeddingDate); --- 22,46 ---- cols = ((int *)this_player()->GetScreen())[0]; tmp = ({ center("Biography for " + (string)this_player()->GetShort() + ! " on " + mud_name(), cols), "" }); birth = (int)this_player()->GetBirth(); x = query_year(birth); if( x < 0 ) yrstr = (-x) + " BN"; else yrstr = x + ""; tmp += ({ sprintf("%:-"+(cols/2)+"s%"+(cols/2)+"s", "Level: " + ! (int)this_player()->GetLevel(), "Age: " + ! ((time() - birth)/YEAR) + " years") }); tmp = ({ "You are " + (string)this_player()->GetMoralityDescription() ! + "." }); tmp += ({ sprintf("You were born on the %d%s day of %s, year %s.", ! query_date(birth), ordinal(query_date(birth)), ! query_month(birth), yrstr) }); m = (class marriage *)this_player()->GetMarriages(); if( !sizeof(m) ) tmp += ({ "You have never been married." }); else { class marriage marr; string town; ! marr = m[0]; if( !marr->DivorceDate ) { x = query_year(marr->WeddingDate); *************** *** 50,57 **** if( !town || town == "wilderness" ) town = "."; else town = " in " + town + "."; tmp += ({ "You married " + marr->Spouse + " the " + ! ordinal(query_date(marr->WeddingDate)) + " of " + ! query_month(marr->WeddingDate) + " " + yrstr + town }); if( sizeof(m) > 1 ) m = m[1..]; else m = ({}); } --- 50,57 ---- if( !town || town == "wilderness" ) town = "."; else town = " in " + town + "."; tmp += ({ "You married " + marr->Spouse + " the " + ! ordinal(query_date(marr->WeddingDate)) + " of " + ! query_month(marr->WeddingDate) + " " + yrstr + town }); if( sizeof(m) > 1 ) m = m[1..]; else m = ({}); } *************** *** 59,65 **** tmp += ({ "Past marriages:" }); while(i--) { string yrstr2; ! marr = m[i]; x = query_year(marr->WeddingDate); if( x < 0 ) yrstr = (-x) + " BN"; --- 59,65 ---- tmp += ({ "Past marriages:" }); while(i--) { string yrstr2; ! marr = m[i]; x = query_year(marr->WeddingDate); if( x < 0 ) yrstr = (-x) + " BN"; *************** *** 71,93 **** if( !town || town == "wilderness" ) town = ""; else town = " in " + town; tmp += ({ "You married " + marr->Spouse + " " + ! query_month(marr->WeddingDate) + " " + ! query_date(marr->WeddingDate) + ", " + yrstr + ! town + ", divorced " + ! query_month(marr->DivorceDate) + " " + ! query_date(marr->DivorceDate) + ", " + yrstr2 + "." ! }); } } } deaths = (mapping *)this_player()->GetDeaths(); if( !(x = sizeof(deaths)) ) ! tmp += ({ "You have never suffered the pain of death." }); else { mapping *d1, *d2; ! tmp += ({ "", "Death has cast its shadow over you on the following " + ! consolidate(x, "occasion") + ":" }); if( x == 1 ) { d1 = deaths[0..0]; d2 = ({}); --- 71,93 ---- if( !town || town == "wilderness" ) town = ""; else town = " in " + town; tmp += ({ "You married " + marr->Spouse + " " + ! query_month(marr->WeddingDate) + " " + ! query_date(marr->WeddingDate) + ", " + yrstr + ! town + ", divorced " + ! query_month(marr->DivorceDate) + " " + ! query_date(marr->DivorceDate) + ", " + yrstr2 + "." ! }); } } } deaths = (mapping *)this_player()->GetDeaths(); if( !(x = sizeof(deaths)) ) ! tmp += ({ "You have never suffered the pain of death." }); else { mapping *d1, *d2; ! tmp += ({ "", "Death has cast its shadow over you on the following " + ! consolidate(x, "occasion") + ":" }); if( x == 1 ) { d1 = deaths[0..0]; d2 = ({}); *************** *** 98,113 **** d2 = deaths[x..]; } for(i=0; i= sizeof(d1)) ? "" : ! d1[i]["enemy"], ! (i >= sizeof(d2)) ? "" : ! d2[i]["enemy"]) }); } kills = (mapping)STATISTICS_D->GetKills((string)this_player()->GetKeyName()); npcs = sort_array(keys(kills), 1); if( !(x = sizeof(npcs)) ) ! tmp += ({ "You have never brought harm to another." }); else { tmp += ({ "","You are responsible for the deaths of the following:" }); if( x < 3 ) { --- 98,113 ---- d2 = deaths[x..]; } for(i=0; i= sizeof(d1)) ? "" : ! d1[i]["enemy"], ! (i >= sizeof(d2)) ? "" : ! d2[i]["enemy"]) }); } kills = (mapping)STATISTICS_D->GetKills((string)this_player()->GetKeyName()); npcs = sort_array(keys(kills), 1); if( !(x = sizeof(npcs)) ) ! tmp += ({ "You have never brought harm to another." }); else { tmp += ({ "","You are responsible for the deaths of the following:" }); if( x < 3 ) { *************** *** 123,135 **** col3 = npcs[(2*x)..]; } for(i=0; i= sizeof(col1)) ? "" : ! col1[i] + " (" + kills[col1[i]] + ")", ! (i >= sizeof(col2)) ? "" : ! col2[i] + " (" + kills[col2[i]] + ")", ! (i >= sizeof(col3)) ? "" : ! col3[i] + " (" + kills[col3[i]] + ")") }); } this_player()->eventPage(tmp, MSG_SYSTEM); return 1; --- 123,135 ---- col3 = npcs[(2*x)..]; } for(i=0; i= sizeof(col1)) ? "" : ! col1[i] + " (" + kills[col1[i]] + ")", ! (i >= sizeof(col2)) ? "" : ! col2[i] + " (" + kills[col2[i]] + ")", ! (i >= sizeof(col3)) ? "" : ! col3[i] + " (" + kills[col3[i]] + ")") }); } this_player()->eventPage(tmp, MSG_SYSTEM); return 1; *************** *** 137,145 **** string GetHelp(string str) { return ("Syntax: \n\n" ! "Biography gives you a full account of the sort of life you " ! "have lived on " + mud_name() + ". This information details " ! "such things as your birth, deaths, marriages, and other life " ! "information.\n\n" ! "See also: score"); } --- 137,145 ---- string GetHelp(string str) { return ("Syntax: \n\n" ! "Biography gives you a full account of the sort of life you " ! "have lived on " + mud_name() + ". This information details " ! "such things as your birth, deaths, marriages, and other life " ! "information.\n\n" ! "See also: score"); } diff -c -r --new-file ds1.1/lib/cmds/players/brief.c ds2.0r27/lib/cmds/players/brief.c *** ds1.1/lib/cmds/players/brief.c Sun Feb 1 21:29:52 1998 --- ds2.0r27/lib/cmds/players/brief.c Wed Jul 5 00:01:03 2006 *************** *** 2,30 **** * A command which allows players to toggle brief room descriptions * Created by Blitz at NM-IVD */ ! #include ! inherit LIB_DAEMON; ! mixed cmd(string str) { ! if( !sizeof(str) ) ! return "Syntax: brief "; ! str = lower_case(str); ! if( str != "on" && str != "off" ) ! return "You can only turn brief 'on' or 'off'"; ! this_player()->SetBriefMode(str == "on"); ! message("system", ! "Brief mode turned "+str+".", ! this_player() ); ! return 1; } ! void help() { ! message("help", ! "Syntax: brief on\n" ! " brief off\n\n" ! "This command allows you to toggle brief room descriptions on or off.\n\n", ! this_player() ); } ! --- 2,30 ---- * A command which allows players to toggle brief room descriptions * Created by Blitz at NM-IVD */ ! #include ! inherit LIB_DAEMON; ! mixed cmd(string str) { ! if( !sizeof(str) ) ! return "Syntax: brief "; ! str = lower_case(str); ! if( str != "on" && str != "off" ) ! return "You can only turn brief 'on' or 'off'"; ! this_player()->SetBriefMode(str == "on"); ! message("system", ! "Brief mode turned "+str+".", ! this_player() ); ! return 1; } ! void help() { ! message("help", ! "Syntax: brief on\n" ! " brief off\n\n" ! "This command allows you to toggle brief room descriptions on or off.\n\n", ! this_player() ); } ! diff -c -r --new-file ds1.1/lib/cmds/players/consider.c ds2.0r27/lib/cmds/players/consider.c *** ds1.1/lib/cmds/players/consider.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cmds/players/consider.c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,147 ---- + #include + #include + + inherit LIB_DAEMON; + + int eventConsider(object whom, object opponent){ + int score = 0; + int tmp = 0; + int protection = 0; + string *attack_types = ({}); + object *dam_types = ({}); + object *weapons = filter(all_inventory(whom), (: $1->GetWielded() :)); + object *enemy_armor = filter(all_inventory(opponent), (: $1->GetWorn() :)); + enemy_armor = filter(enemy_armor, (: !($1->GetWielded()) :) ); + + if(sizeof(weapons)){ + foreach(object weapon in weapons){ + //tc("skill level for "+identify(weapon)+": "+whom->GetSkill(weapon->GetWeaponType()+" attack")["level"]); + if(weapon->GetWeaponType() && whom->GetSkill(weapon->GetWeaponType()+" attack")){ + attack_types += ({ weapon->GetWeaponType() }); + score += ( whom->GetSkill(weapon->GetWeaponType()+" attack")["level"] ) * 3; + } + if(weapon->GetClass()) + score += ( weapon->GetClass() ) * 6; + if(weapon->GetHands() > 1) { + if(!(whom->GetSkill("multi-hand"))) score /= 3; + } + //tc("weapon score: "+score); + } + if(sizeof(weapons) >1) { + if(!(whom->GetSkill("multi-weapon"))) score /= 3; + } + //tc("final weapon score: "+score); + } + + else if((whom->GetMelee())) { + if(whom->GetSkill("melee attack")) + score += (((whom->GetSkill("melee attack")["level"]) * 3)); + //tc("melee score: "+score); + } + if(!sizeof(attack_types)) attack_types = ({"blunt"}); + foreach(string Type in attack_types){ + int DamType = 0; + int tmp_prot = 0; + object *qual_armor = ({}); + + switch(Type){ + case "blade" : DamType = BLADE; break; + case "blunt" : DamType = BLUNT; break; + case "knife" : DamType = KNIFE; break; + case "water" : DamType = WATER; break; + case "shock" : DamType = SHOCK; break; + case "cold" : DamType = COLD; break; + case "heat" : DamType = HEAT; break; + case "gas" : DamType = GAS; break; + case "acid" : DamType = ACID; break; + case "magic" : DamType = MAGIC; break; + case "poison" : DamType = POISON; break; + case "disease" : DamType = DISEASE; break; + case "trauma" : DamType = TRAUMA; break; + default : DamType = BLUNT; break; + } + + foreach(object armor in enemy_armor){ + tmp_prot += armor->GetProtection(DamType); + if(armor->GetProtection(DamType)) qual_armor += ({ armor }); + } + if(sizeof(qual_armor)) protection += tmp_prot / sizeof(qual_armor); + tmp_prot = 0; + DamType = 0; + } + + //tc("protection: "+protection,"blue"); + + + score += whom->GetStatLevel("speed") * 2; + //tc("speed score: "+score); + score += whom->GetStatLevel("strength") * 3; + //tc("strength score: "+score); + score += whom->GetMaxHealthPoints() / 15; + //tc("hp score: "+score); + score += protection; + //tc("score plus protection: "+score); + + + return score; + } + + mixed cmd(string str) { + object thing; + int totalscore, myscore, theirscore; + + if(!str){ + write("Consider what?"); + return 1; + } + if(!(thing = present(str,environment(this_player())))){ + write("That isn't here."); + return 1; + } + if(!living(thing)){ + write("That isn't a living thing."); + return 1; + } + + theirscore = eventConsider(thing, this_player()); + myscore = eventConsider(this_player(), thing); + + //write("Consider complete. "); + //write("My score: "+myscore); + //write("Their score: "+theirscore); + //if(myscore >= theirscore) { + // write("You have the advantage by "+(myscore - theirscore)+" points."); + //} + //else write("They the advantage by "+(theirscore - myscore)+" points."); + totalscore = myscore - theirscore; + //write("totalscore: "+totalscore); + if(totalscore > 100) write("Piece of cake."); + else if(totalscore > 80) write("No problem."); + else if(totalscore > 60) write("Very easy."); + else if(totalscore > 40) write("Fairly easy."); + else if(totalscore > 20) write("You'd probably do fine"); + else if(totalscore > 0) write("A fair match."); + else if(totalscore > -20) write("A workout."); + else if(totalscore > -40) write("A serious match."); + else if(totalscore > -60) write("A major challenge."); + else if(totalscore > -80) write("An unwise choice."); + else if(totalscore > -100) write("Really a bad idea."); + else write("Suicide."); + return 1; + } + + + void help() { + message("help", + "Syntax: consider \n" + "Gives you an idea of how tough a creature would be to defeat " + "in combat. Gauges relative strengths, skills, weapons, " + "armor, levels, health, and so on. The resulting comparison " + "may not be very useful, because a change during combat (such " + "as the opponent changing weapons) or items of unusual class " + "or protection (such as magical armor) may not be taken into " + "account." + "\n", + this_player() ); + } + diff -c -r --new-file ds1.1/lib/cmds/players/converse.c ds2.0r27/lib/cmds/players/converse.c *** ds1.1/lib/cmds/players/converse.c Sun Feb 1 21:29:52 1998 --- ds2.0r27/lib/cmds/players/converse.c Wed Jul 5 00:01:03 2006 *************** *** 14,24 **** mixed cmd(string args) { message("system", "Entering conversation mode. Continue entering things " ! "you wish 'said' until done.", this_player()); message("system", "When done, enter a '.' alone on a line like in edit.", ! this_player()); message("system", "______________________________________________________" ! , this_player()); input_to( (: eventChat :)); return 1; } --- 14,24 ---- mixed cmd(string args) { message("system", "Entering conversation mode. Continue entering things " ! "you wish 'said' until done.", this_player()); message("system", "When done, enter a '.' alone on a line like in edit.", ! this_player()); message("system", "______________________________________________________" ! , this_player()); input_to( (: eventChat :)); return 1; } *************** *** 34,44 **** void help() { message("help", "Syntax: \n\n" ! "Puts you into conversation mode, which means that anything you " ! "type will act as if you are placing the \"say\" command before " ! "it. Once in conversation mode, you exit the same way you do " ! "from the mail or bulletin board editor, that is, by typing " ! "a '.' alone on a line. You may also issue commands while " ! "in conversation mode by putting a ! before whatever you type.\n\n" ! "See also: say, tell", this_player()); } --- 34,44 ---- void help() { message("help", "Syntax: \n\n" ! "Puts you into conversation mode, which means that anything you " ! "type will act as if you are placing the \"say\" command before " ! "it. Once in conversation mode, you exit the same way you do " ! "from the mail or bulletin board editor, that is, by typing " ! "a '.' alone on a line. You may also issue commands while " ! "in conversation mode by putting a ! before whatever you type.\n\n" ! "See also: say, tell", this_player()); } diff -c -r --new-file ds1.1/lib/cmds/players/customize.c ds2.0r27/lib/cmds/players/customize.c *** ds1.1/lib/cmds/players/customize.c Sun Feb 1 21:29:53 1998 --- ds2.0r27/lib/cmds/players/customize.c Wed Jul 5 00:01:03 2006 *************** *** 14,24 **** mixed tmp; string stat; int amt; ! if( !args || args == "" ) { amt = (int)this_player()->GetCustomStats(); this_player()->eventPrint("You have " + amt + " points left to " ! "spend on stats.", MSG_SYSTEM); return 1; } amt = to_int((tmp = explode(args, " "))[<1]); --- 14,24 ---- mixed tmp; string stat; int amt; ! if( !args || args == "" ) { amt = (int)this_player()->GetCustomStats(); this_player()->eventPrint("You have " + amt + " points left to " ! "spend on stats.", MSG_SYSTEM); return 1; } amt = to_int((tmp = explode(args, " "))[<1]); *************** *** 28,45 **** if( stringp(tmp) ) return tmp; if( !tmp ) return "Failed to raise stat."; this_player()->eventPrint("Your " + stat + " is now at " + tmp + ! ", and you have " + ! (int)this_player()->GetCustomStats() + ! " points left to spend.", MSG_SYSTEM); return 1; } string GetHelp(string str) { return ("Syntax: \n" ! " \n\n" ! "Allows you to spend customization points to boost the " ! "stats with which you were born. Once you are down to 0 " ! "customization points, you never get any back.\n" ! "Using this command without arguments tells you how many " ! "points you have left to spend."); } --- 28,45 ---- if( stringp(tmp) ) return tmp; if( !tmp ) return "Failed to raise stat."; this_player()->eventPrint("Your " + stat + " is now at " + tmp + ! ", and you have " + ! (int)this_player()->GetCustomStats() + ! " points left to spend.", MSG_SYSTEM); return 1; } string GetHelp(string str) { return ("Syntax: \n" ! " \n\n" ! "Allows you to spend customization points to boost the " ! "stats with which you were born. Once you are down to 0 " ! "customization points, you never get any back.\n" ! "Using this command without arguments tells you how many " ! "points you have left to spend."); } diff -c -r --new-file ds1.1/lib/cmds/players/date.c ds2.0r27/lib/cmds/players/date.c *** ds1.1/lib/cmds/players/date.c Sun Feb 1 21:29:53 1998 --- ds2.0r27/lib/cmds/players/date.c Wed Jul 5 00:01:03 2006 *************** *** 2,39 **** * A simple command which displays current date and time * Blitz@NM-IVD */ ! #include #include #include ! ! mixed cmd(string unused) { ! string *parts, year, date, time; ! int x, hour, min, sec; ! ! time = (string)this_player()->GetTimeZone() || localtime(time())[LT_ZONE]; ! x = (int)TIME_D->GetOffSet(time) * 3600; ! time = ctime( time() + x ); ! x = sizeof(parts = explode(time, " ")); ! year = parts[x - 1]; ! sscanf(parts[x - 2], "%d:%d:%d", hour, min, sec); ! if( !hour ) hour = 12; ! message("info", ! sprintf("Time: %d:%s%d %s\nDate: %s, %s", ! (hour>12 ? (hour-12) : hour), ! (min < 10 ? "0" : ""), ! min, ! (hour>11 ? "pm" : "am"), ! implode(parts[0..(x-3)], " "), ! year), ! this_player() ); ! return 1; } ! void help() { ! message("help", ! "Syntax: date\n\n" ! "Displays current time and date in your local time if you have it " ! "specified.", ! this_player() ); } --- 2,47 ---- * A simple command which displays current date and time * Blitz@NM-IVD */ ! #include + #include #include #include ! ! mixed cmd(string timezone) { ! string *parts, year, time; ! int offset, x, hour, min, sec; ! ! if(timezone && timezone != "" && valid_timezone(timezone)){ ! write(local_time(timezone)); ! return 1; ! } ! ! offset = (int)TIME_D->GetOffset(local_time()[9]); ! offset += EXTRA_TIME_OFFSET; ! if(query_os_type() != "windows" ) ! x = offset * 3600; ! else x = 0; ! time = ctime( time() + x ); ! x = sizeof(parts = explode(time, " ")); ! year = parts[x - 1]; ! sscanf(parts[x - 2], "%d:%d:%d", hour, min, sec); ! if( !hour ) hour = 12; ! message("info", ! sprintf("Time: %d:%s%d %s\nDate: %s, %s", ! (hour>12 ? (hour-12) : hour), ! (min < 10 ? "0" : ""), ! min, ! (hour>11 ? "pm" : "am"), ! implode(parts[0..(x-3)], " "), ! year), ! this_player() ); ! return 1; } ! void help() { ! message("help", ! "Syntax: date\n\n" ! "Displays current time and date in local time.", ! this_player() ); } diff -c -r --new-file ds1.1/lib/cmds/players/earmuff.c ds2.0r27/lib/cmds/players/earmuff.c *** ds1.1/lib/cmds/players/earmuff.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cmds/players/earmuff.c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,30 ---- + #include + + inherit LIB_DAEMON; + + mixed cmd(string str) { + if(!str || str =="") { + if(!sizeof(this_player()->GetMuffed())) write("You are ignoring no one."); + else { + write("You are ignoring the following name(s):\n"); + write(implode(filter(this_player()->GetMuffed(), (: capitalize($1) :)), "\n")+"\n"); + } + return 1; + } + else this_player()->AddMuffed(str); + write("You add "+capitalize(str)+" to your earmuffed list."); + return 1; + } + + void help() { + message("help", + "Syntax: earmuff\n" + " earmuff \n" + " earmuff @\n\n" + "This command allows you to ignore channel messages from the name specified.\n" + "You can also earmuff all channel messages coming from a " + "specific mud, for example: earmuff @Spammy Mud II\n" + "See also: whomuffed, unmuff\n\n", + this_player() ); + } + diff -c -r --new-file ds1.1/lib/cmds/players/emote.c ds2.0r27/lib/cmds/players/emote.c *** ds1.1/lib/cmds/players/emote.c Sun Feb 1 21:29:53 1998 --- ds2.0r27/lib/cmds/players/emote.c Wed Jul 5 00:01:03 2006 *************** *** 11,38 **** mixed cmd(string args) { if( !creatorp(this_player()) && !avatarp(this_player()) ) { if( (int)this_player()->GetStaminaPoints() < 1 ) ! return "You are too tired."; } if( !args || args == "" ) { message("my_action", "You are feeling emotional.", this_player()); message("other_action", (string)this_player()->GetName() + ! " looks emotional.", environment(this_player()), ! ({ this_player() })); return 1; } if( args[0] != '\'' ) args = " " + args; message("my_action", "You emote: " + (string)this_player()->GetName() + ! args, this_player()); message("other_action", (string)this_player()->GetName() + args, ! environment(this_player()), ({ this_player() }) ); return 1; } void help() { message("help", "Syntax: \n\n" ! "Places any message you specify directly after your name. For " ! "example, \"emote smiles.\" would have others see " ! "\"Descartes smiles.\". Non-avatars lose a stamina point for " ! "each emote to discourage abuse.", this_player()); } --- 11,38 ---- mixed cmd(string args) { if( !creatorp(this_player()) && !avatarp(this_player()) ) { if( (int)this_player()->GetStaminaPoints() < 1 ) ! return "You are too tired."; } if( !args || args == "" ) { message("my_action", "You are feeling emotional.", this_player()); message("other_action", (string)this_player()->GetName() + ! " looks emotional.", environment(this_player()), ! ({ this_player() })); return 1; } if( args[0] != '\'' ) args = " " + args; message("my_action", "You emote: " + (string)this_player()->GetName() + ! args, this_player()); message("other_action", (string)this_player()->GetName() + args, ! environment(this_player()), ({ this_player() }) ); return 1; } void help() { message("help", "Syntax: \n\n" ! "Places any message you specify directly after your name. For " ! "example, \"emote smiles.\" would have others see " ! "\"Descartes smiles.\". Non-avatars lose a stamina point for " ! "each emote to discourage abuse.", this_player()); } diff -c -r --new-file ds1.1/lib/cmds/players/env.c ds2.0r27/lib/cmds/players/env.c *** ds1.1/lib/cmds/players/env.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cmds/players/env.c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,19 ---- + #include + + inherit LIB_DAEMON; + + mixed cmd(string args) { + write("Screen: \t\t"+identify(this_player()->GetScreen())); + write("Terminal: \t\t"+this_player()->GetTerminal()); + write("Brief mode: \t\t"+ ( (this_player()->GetBriefMode()) ? "on" : "off" )); + //write("PlayerKill mode: \t"+ ( (this_player()->GetPK()) ? "on" : "off" )); + if(creatorp(this_player())) + write("Debug mode: \t\t"+ ( (this_player()->GetProperty("debug")) ? "on" : "off" )); + return 1; + } + + void help() { + message("help", "Syntax: \n\n" + "Displays your basic interface and play settings. " + + "See also: brief, terminal, screen", this_player()); + } diff -c -r --new-file ds1.1/lib/cmds/players/faq.c ds2.0r27/lib/cmds/players/faq.c *** ds1.1/lib/cmds/players/faq.c Sun Feb 1 21:29:53 1998 --- ds2.0r27/lib/cmds/players/faq.c Wed Jul 5 00:01:03 2006 *************** *** 16,22 **** int cols, i, maxi, x, y; message("help", mud_name() + " has the following FAQ lists:", ! this_player()); cols = ((int *)this_player()->GetScreen())[0]; i = sizeof(files = get_dir(DIR_FAQS "/")); while(i--) if( (y =strlen(files[i])) > x ) x = y; --- 16,22 ---- int cols, i, maxi, x, y; message("help", mud_name() + " has the following FAQ lists:", ! this_player()); cols = ((int *)this_player()->GetScreen())[0]; i = sizeof(files = get_dir(DIR_FAQS "/")); while(i--) if( (y =strlen(files[i])) > x ) x = y; *************** *** 32,39 **** static void GetFAQ(string args) { string file; ! ! if( !args || args == "" ) args = "general"; if( file_size(file = DIR_FAQS "/" + args) < 0 ) { message("error", "No such FAQ available.", this_player()); return; --- 32,40 ---- static void GetFAQ(string args) { string file; ! //bugfix courtesy of Manchi ! if( !args || args == "" || args == "y" || args == "Y" || lower_case(args) == "yes") ! args = "general"; if( file_size(file = DIR_FAQS "/" + args) < 0 ) { message("error", "No such FAQ available.", this_player()); return; *************** *** 47,60 **** void help() { message("help", "Syntax: \n\n" ! "If you specify a particular FAQ to read, this command will " ! "display that FAQ for you. If you fail to specify a FAQ, it " ! "will give you a list of FAQs from which to choose. FAQ " ! "stands for Frequently Asked Questions. Reading the FAQs is " ! "a good way of coming to understand topics basic to " + ! mud_name() + ".\n\n" ! "See also: help" + (creatorp(this_player()) ? ", man" : ""), ! this_player()); } ! --- 48,61 ---- void help() { message("help", "Syntax: \n\n" ! "If you specify a particular FAQ to read, this command will " ! "display that FAQ for you. If you fail to specify a FAQ, it " ! "will give you a list of FAQs from which to choose. FAQ " ! "stands for Frequently Asked Questions. Reading the FAQs is " ! "a good way of coming to understand topics basic to " + ! mud_name() + ".\n\n" ! "See also: help" + (creatorp(this_player()) ? ", man" : ""), ! this_player()); } ! diff -c -r --new-file ds1.1/lib/cmds/players/hist.c ds2.0r27/lib/cmds/players/hist.c *** ds1.1/lib/cmds/players/hist.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cmds/players/hist.c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,19 ---- + #include + #include + #include + + inherit LIB_DAEMON; + + mixed cmd(string args) { + if(!args) + this_player()->eventPrint("Syntax: "); + + this_player()->eventPrint("Retrieving history..."); + return CHAT_D->cmdLast(args); + return 1; + } + + string GetHelp(string topic) { + return ("Syntax: \n" + "Gives you a list of the hist of a channel "); + } diff -c -r --new-file ds1.1/lib/cmds/players/idle.c ds2.0r27/lib/cmds/players/idle.c *** ds1.1/lib/cmds/players/idle.c Sun Feb 1 21:29:53 1998 --- ds2.0r27/lib/cmds/players/idle.c Wed Jul 5 00:01:03 2006 *************** *** 2,35 **** * Simple command which displays named player's idle time * Recreated by Blitz@Dead Souls 960108 */ ! mixed cmd(string args) { int x; object who; ! if( !sizeof(args) ) return "Syntax: idle "; args = convert_name(args); who = find_player(args); if( !who || who->GetInvis() ) ! return "Unable to locate anyone by that name."; if( !interactive(who) ) ! return (string)who->GetName() + " is link dead."; x = query_idle(who); if( x > 4 ) { ! this_player()->eventPrint( sprintf("%s has been idle for %s%s.", ! (string)who->GetName(), ! ( x>59 ? ( consolidate(x/60, "one minute") + " and " ) : "" ), ! consolidate(x%60, "one second")) ); ! } else this_player()->eventPrint((string)who->GetName() + " is " ! "not idle."); return 1; } ! string GetHelp(string str) { return "Syntax: idle \n\n" ! "Displays named user's idle time. A user's \"idle time\" is " ! "the amount of time since the named user last sent input " ! "to the MUD."; } --- 2,35 ---- * Simple command which displays named player's idle time * Recreated by Blitz@Dead Souls 960108 */ ! mixed cmd(string args) { int x; object who; ! if( !sizeof(args) ) return "Syntax: idle "; args = convert_name(args); who = find_player(args); if( !who || who->GetInvis() ) ! return "Unable to locate anyone by that name."; if( !interactive(who) ) ! return (string)who->GetName() + " is link dead."; x = query_idle(who); if( x > 4 ) { ! this_player()->eventPrint( sprintf("%s has been idle for %s%s.", ! (string)who->GetName(), ! ( x>59 ? ( consolidate(x/60, "one minute") + " and " ) : "" ), ! consolidate(x%60, "one second")) ); ! } else this_player()->eventPrint((string)who->GetName() + " is " ! "not idle."); return 1; } ! string GetHelp(string str) { return "Syntax: idle \n\n" ! "Displays named user's idle time. A user's \"idle time\" is " ! "the amount of time since the named user last sent input " ! "to the MUD."; } diff -c -r --new-file ds1.1/lib/cmds/players/inventory.c ds2.0r27/lib/cmds/players/inventory.c *** ds1.1/lib/cmds/players/inventory.c Sun Feb 1 21:29:53 1998 --- ds2.0r27/lib/cmds/players/inventory.c Wed Jul 5 00:01:03 2006 *************** *** 13,19 **** mixed cmd(string args) { if( (int)this_player()->GetInCombat() ) ! this_player()->SetAttack(0, (: eventInventory :), ROUND_OTHER); else eventInventory(); return 1; } --- 13,19 ---- mixed cmd(string args) { if( (int)this_player()->GetInCombat() ) ! this_player()->SetAttack(0, (: eventInventory :), ROUND_OTHER); else eventInventory(); return 1; } *************** *** 25,32 **** int i; shorts = map(filter(all_inventory(this_player()), ! (: !((int)$1->GetInvis(this_player())) :)), ! (: (string)$1->GetEquippedShort() :)); borg = ([]); if( !(i = sizeof(shorts)) ) { message("system", "You are carrying nothing.", this_player()); --- 25,32 ---- int i; shorts = map(filter(all_inventory(this_player()), ! (: !((int)$1->GetInvis(this_player())) :)), ! (: (string)$1->GetEquippedShort() :)); borg = ([]); if( !(i = sizeof(shorts)) ) { message("system", "You are carrying nothing.", this_player()); *************** *** 38,51 **** i = sizeof(shorts = keys(borg)); while(i--) ret += capitalize(consolidate(borg[shorts[i]], shorts[i]))+"\n"; message("look", ret, this_player()); ! message("other_action", (string)this_player()->GetName() + " checks " + ! possessive(this_player()) + " possessions.", ! environment(this_player()), ({ this_player() })); } void help() { message("help", "Syntax: \n\n" ! "Lists all items you are carrying currently. This command " ! "will take up one round of combat if you happen to be in " ! "combat.", this_player()); } --- 38,52 ---- i = sizeof(shorts = keys(borg)); while(i--) ret += capitalize(consolidate(borg[shorts[i]], shorts[i]))+"\n"; message("look", ret, this_player()); ! if(!this_player()->GetInvis()) ! message("other_action", (string)this_player()->GetName() + " checks " + ! possessive(this_player()) + " possessions.", ! environment(this_player()), ({ this_player() })); } void help() { message("help", "Syntax: \n\n" ! "Lists all items you are carrying currently. This command " ! "will take up one round of combat if you happen to be in " ! "combat.", this_player()); } diff -c -r --new-file ds1.1/lib/cmds/players/kills.c ds2.0r27/lib/cmds/players/kills.c *** ds1.1/lib/cmds/players/kills.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cmds/players/kills.c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,45 ---- + #include + + inherit LIB_DAEMON; + + mapping kills = ([]); + + mixed cmd(string args) { + string *stats; + string killfile, ret, tmp, name; + int i, x, y; + + name = lower_case(this_player()->GetKeyName()); + killfile = "/save/kills/"+name[0..0]+"/"+name; + if(!file_exists(killfile)) { + write("You have no kills to your name."); + return 1; + } + kills = restore_variable(read_file(killfile)); + if(!sizeof(kills)){ + write("You have never harmed a living thing."); + return 1; + } + ret = "You are " +(string)this_player()->GetShort() + ", level " + + (int)this_player()->GetLevel(); + if( (tmp = (string)this_player()->GetClass()) ) + ret += " " + capitalize(tmp); + else ret += " Drifter"; + ret += " (" + (string)this_player()->GetRace() + ")\n"; + ret+= "Your list of victories comprises the following:\n\n"; + stats = map(keys(kills), + (: sprintf("%:-20s: %:-1i", $1, + kills[$1]) :)); + i = sizeof(stats); + while(i--) if( (y = strlen(stats[i])) > x ) x = y; + x = ((int *)this_player()->GetScreen())[0]/(x+2); + ret += format_page(stats, x); + message("system", ret, this_player()); + return 1; + } + + void help() { + message("help", "Syntax: \n\n" + "A list of your victories." + "\n\n",this_player()); + } diff -c -r --new-file ds1.1/lib/cmds/players/language.c ds2.0r27/lib/cmds/players/language.c *** ds1.1/lib/cmds/players/language.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cmds/players/language.c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,34 ---- + #include + + inherit LIB_DAEMON; + + mixed cmd(string str) { + mapping FluencyMap = ([]); + string *langs = this_player()->GetLanguages(); + + foreach(string lang in langs){ + FluencyMap[lang] = this_player()->GetLanguageLevel(lang); + } + + write("You speak:"); + + if(this_player()->GetPolyglot()){ + write("All languages with 100% proficiency."); + } + + else { + foreach(string key, int val in FluencyMap){ + write(capitalize(key)+" with "+val+"% proficiency."); + } + } + + return 1; + } + + void help() { + message("help", + "Syntax: language\n\n" + "This command reports which languages you speak and understand.\n\n", + this_player() ); + } + diff -c -r --new-file ds1.1/lib/cmds/players/lines.c ds2.0r27/lib/cmds/players/lines.c *** ds1.1/lib/cmds/players/lines.c Sun Feb 1 21:29:53 1998 --- ds2.0r27/lib/cmds/players/lines.c Wed Jul 5 00:01:03 2006 *************** *** 2,46 **** // A utility to help wizards and players keep track of what lines they're // on, and to them turn all off and on with one command. // by Gregon@Dead Souls ! ! int cmd(string str) { ! ! string *channels; ! int i; ! ! channels = distinct_array((string *)this_player()->GetChannels()); ! ! if(!str) { ! for(i=0; iGetBlocked(channels[i])) ! message("info","You are blocking "+channels[i]+".",this_player()); ! else message("info","You are not blocking "+channels[i]+".",this_player()); ! } ! return 1; ! } ! ! if(str=="on"){ ! for(i=0; iGetBlocked(channels[i])) ! this_player()->SetBlocked(channels[i]); ! } ! return 1; ! } ! ! if(str=="off"){ ! for(i=0; iGetBlocked(channels[i])) ! this_player()->SetBlocked(channels[i]); ! } ! return 1; ! } ! } ! void help(){ ! message("help","Syntax: lines -or- lines [on|off]\n\n" ! "With no argument this command will display the status " ! "of the lines to which you have access. With the argument on|off " ! "it will turn all of the lines on or off.",this_player()); } --- 2,46 ---- // A utility to help wizards and players keep track of what lines they're // on, and to them turn all off and on with one command. // by Gregon@Dead Souls ! ! int cmd(string str) { ! ! string *channels; ! int i; ! ! channels = distinct_array((string *)this_player()->GetChannels()); ! ! if(!str) { ! for(i=0; iGetBlocked(channels[i])) ! message("info","You are blocking "+channels[i]+".",this_player()); ! else message("info","You are not blocking "+channels[i]+".",this_player()); ! } ! return 1; ! } ! ! if(str=="on"){ ! for(i=0; iGetBlocked(channels[i])) ! this_player()->SetBlocked(channels[i]); ! } ! return 1; ! } ! ! if(str=="off"){ ! for(i=0; iGetBlocked(channels[i])) ! this_player()->SetBlocked(channels[i]); ! } ! return 1; ! } ! } ! void help(){ ! message("help","Syntax: lines -or- lines [on|off]\n\n" ! "With no argument this command will display the status " ! "of the lines to which you have access. With the argument on|off " ! "it will turn all of the lines on or off.",this_player()); } diff -c -r --new-file ds1.1/lib/cmds/players/locate.c ds2.0r27/lib/cmds/players/locate.c *** ds1.1/lib/cmds/players/locate.c Sun Feb 1 21:29:53 1998 --- ds2.0r27/lib/cmds/players/locate.c Wed Jul 5 00:01:03 2006 *************** *** 18,27 **** void help() { message("help", "Syntax: \n\n" ! "This command allows you to know on which MUDs connected " ! "through the Intermud 3 network have someone using the " ! "name you specify. Note that this person may not actually be " ! "the person you think it is, as nothing prevents two different " ! "people from using the same name on different MUDs.\n\n" ! "See also: mail, mudlist, rwho, tell", this_player()); } --- 18,27 ---- void help() { message("help", "Syntax: \n\n" ! "This command allows you to know on which MUDs connected " ! "through the Intermud 3 network have someone using the " ! "name you specify. Note that this person may not actually be " ! "the person you think it is, as nothing prevents two different " ! "people from using the same name on different MUDs.\n\n" ! "See also: mail, mudlist, rwho, tell", this_player()); } diff -c -r --new-file ds1.1/lib/cmds/players/money.c ds2.0r27/lib/cmds/players/money.c *** ds1.1/lib/cmds/players/money.c Sun Feb 1 21:29:53 1998 --- ds2.0r27/lib/cmds/players/money.c Wed Jul 5 00:01:03 2006 *************** *** 14,37 **** int i, tmp; if(str) return 0; /* to allow the wiz command to work */ - if( creatorp(this_player()) ) return "Sorry, coders don't get salaries here!"; currs = (string *)this_player()->GetCurrencies(); currs = filter(currs, (: this_player()->GetCurrency($1) > 0 :)); if( !currs || !sizeof(currs) ) { ! write("You are broke."); ! say(this_player()->GetName()+" comes up with empty pockets."); ! return 1; } say(this_player()->GetName()+" fishes through "+ possessive(this_player())+" pockets examining some money."); message("my_action", "In your pockets you find "+ ((sizeof(currs) > 1) ? "these currencies: " : "only: "), this_player()); for(borg = "", i=0, tmp = sizeof(currs); iGetCurrency(currs[i]))+" "+currs[i]); ! if(i == tmp-1) borg +=(".\n"); ! else if(tmp > 2 && i == tmp-2) borg += (", and "); ! else if(tmp == 2) borg +=(" and "); ! else borg +=(", "); } message("my_action", borg, this_player()); return 1; --- 14,36 ---- int i, tmp; if(str) return 0; /* to allow the wiz command to work */ currs = (string *)this_player()->GetCurrencies(); currs = filter(currs, (: this_player()->GetCurrency($1) > 0 :)); if( !currs || !sizeof(currs) ) { ! write("You are broke."); ! say(this_player()->GetName()+" comes up with empty pockets."); ! return 1; } say(this_player()->GetName()+" fishes through "+ possessive(this_player())+" pockets examining some money."); message("my_action", "In your pockets you find "+ ((sizeof(currs) > 1) ? "these currencies: " : "only: "), this_player()); for(borg = "", i=0, tmp = sizeof(currs); iGetCurrency(currs[i]))+" "+currs[i]); ! if(i == tmp-1) borg +=(".\n"); ! else if(tmp > 2 && i == tmp-2) borg += (", and "); ! else if(tmp == 2) borg +=(" and "); ! else borg +=(", "); } message("my_action", borg, this_player()); return 1; diff -c -r --new-file ds1.1/lib/cmds/players/mudlist.c ds2.0r27/lib/cmds/players/mudlist.c *** ds1.1/lib/cmds/players/mudlist.c Sun Feb 1 21:29:53 1998 --- ds2.0r27/lib/cmds/players/mudlist.c Wed Jul 5 00:01:03 2006 *************** *** 14,19 **** --- 14,20 ---- string *list; mapping borg; string mud; + int all = 0; if( str && str != "" && strlen(str) > 3 ) { mapping tmp; *************** *** 28,42 **** int x, y, z; switch(opt) { ! case "m": ! x = 5; ! break; ! case "d": ! x = 7; ! break; ! case "n": ! x = 0; ! break; } tmpstr = (x ? info[x] : mud); z = strlen(str = replace_string(lower_case(str), " ", "")); --- 29,46 ---- int x, y, z; switch(opt) { ! case "a": ! all = 1; ! break; ! case "m": ! x = 5; ! break; ! case "d": ! x = 7; ! break; ! case "n": ! x = 0; ! break; } tmpstr = (x ? info[x] : mud); z = strlen(str = replace_string(lower_case(str), " ", "")); *************** *** 46,58 **** break; } else if( y > z && tmpstr[0..z-1] == str && info[0] == -1 ) ! borg[mud] = info; } } else { borg = ([ ]); foreach( mud, info in (mapping)INTERMUD_D->GetMudList() ) ! if( info[0] == -1 ) borg[mud] = info; } if( !sizeof(borg) ) { message("system", "No MUDs match your query.", this_player()); --- 50,62 ---- break; } else if( y > z && tmpstr[0..z-1] == str && info[0] == -1 ) ! borg[mud] = info; } } else { borg = ([ ]); foreach( mud, info in (mapping)INTERMUD_D->GetMudList() ) ! if( all == 1 || info[0] == -1 ) borg[mud] = info; } if( !sizeof(borg) ) { message("system", "No MUDs match your query.", this_player()); *************** *** 62,73 **** string msg, svc; int val, comma = 0; mud = keys(borg)[0]; msg = "\nDetailed information on %^GREEN%^" + mud + "%^RESET%^:\n"; msg += sprintf("MUD Type: %:-6s Server: %:-20s Library: %s\n", ! borg[mud][8], borg[mud][7], borg[mud][5]); msg += "Status: " + borg[mud][9] + "\nAdmin email: " + ! borg[mud][10] + "\n"; msg += "Services: "; foreach(svc, val in borg[mud][11]) { if( val == 1 ) { --- 66,79 ---- string msg, svc; int val, comma = 0; + //tc("borg: "+identify(borg)); + mud = keys(borg)[0]; msg = "\nDetailed information on %^GREEN%^" + mud + "%^RESET%^:\n"; msg += sprintf("MUD Type: %:-6s Server: %:-20s Library: %s\n", ! borg[mud][8], borg[mud][7], borg[mud][5]); msg += "Status: " + borg[mud][9] + "\nAdmin email: " + ! borg[mud][10] + "\n"; msg += "Services: "; foreach(svc, val in borg[mud][11]) { if( val == 1 ) { *************** *** 81,103 **** msg += "\nHost: " + borg[mud][1] + "\n"; msg += "Telnet port: " + borg[mud][2] + "\n"; if( borg[mud][11]["amcp"] ) ! msg += "AMCP version: " + borg[mud][11]["amcp"] + "\n"; if( borg[mud][11]["http"] ) ! msg += "HTTP port (World Wide Web): " + borg[mud][11]["http"]+"\n"; if( borg[mud][11]["ftp"] ) ! msg += "FTP port (File Transfer): " + borg[mud][11]["ftp"] + "\n"; if( borg[mud][11]["rcp"] ) ! msg += "RCP port (Remote Creator): " + borg[mud][11]["rcp"] + "\n"; message("info", msg, this_player()); return 1; } list = ({}); foreach(mud, info in borg) ! list += ({ sprintf("%:-15s %:-6s %:-15s %:-18s %s %d", ! mud, info[8], info[7], info[5], info[1], info[2]) }); list = sort_array(list, 1); list = ({ mud_name() + " recognizes " + consolidate(sizeof(borg), "a mud")+ ! " matching your query: ", "" }) + list; this_player()->eventPage(list); return 1; } --- 87,109 ---- msg += "\nHost: " + borg[mud][1] + "\n"; msg += "Telnet port: " + borg[mud][2] + "\n"; if( borg[mud][11]["amcp"] ) ! msg += "AMCP version: " + borg[mud][11]["amcp"] + "\n"; if( borg[mud][11]["http"] ) ! msg += "HTTP port (World Wide Web): " + borg[mud][11]["http"]+"\n"; if( borg[mud][11]["ftp"] ) ! msg += "FTP port (File Transfer): " + borg[mud][11]["ftp"] + "\n"; if( borg[mud][11]["rcp"] ) ! msg += "RCP port (Remote Creator): " + borg[mud][11]["rcp"] + "\n"; message("info", msg, this_player()); return 1; } list = ({}); foreach(mud, info in borg) ! list += ({ sprintf("%:-15s %:-6s %:-15s %:-18s %s %d", ! mud, info[8], info[7], info[5], info[1], info[2]) }); list = sort_array(list, 1); list = ({ mud_name() + " recognizes " + consolidate(sizeof(borg), "a mud")+ ! " matching your query: ", "" }) + list; this_player()->eventPage(list); return 1; } *************** *** 110,127 **** void help() { message("help", "Syntax: \n" ! " \n\n" ! "Without any arguments, it gives a full listing of all muds " ! "with which this mud is capable of communication through " ! "tell, mail, finger, rwho, and other intermud services. " ! "With arguments, requires one and only one option " ! "which must be one of the following:\n" ! "\t-d [driver]: List only muds using the named driver\n" ! "\t-m [mudlib]: List only muds using the named mudlib\n" ! "\t-n [mudname]: List only the muds with the name given\n\n" ! "Note that the argument need not be complete, for example:\n" ! "\t mudlist -n idea\n" ! "will list IdeaExchange as well as any other mud whose name " ! "begins with the string \"idea\".\n\n" ! "See also: finger, mail, rwho, tell", this_player()); } --- 116,133 ---- void help() { message("help", "Syntax: \n" ! " \n\n" ! "Without any arguments, it gives a full listing of all muds " ! "with which this mud is capable of communication through " ! "tell, mail, finger, rwho, and other intermud services. " ! "With arguments, requires one and only one option " ! "which must be one of the following:\n" ! "\t-d [driver]: List only muds using the named driver\n" ! "\t-m [mudlib]: List only muds using the named mudlib\n" ! "\t-n [mudname]: List only the muds with the name given\n\n" ! "Note that the argument need not be complete, for example:\n" ! "\t mudlist -n idea\n" ! "will list IdeaExchange as well as any other mud whose name " ! "begins with the string \"idea\".\n\n" ! "See also: finger, mail, rwho, tell", this_player()); } diff -c -r --new-file ds1.1/lib/cmds/players/nextreboot.c ds2.0r27/lib/cmds/players/nextreboot.c *** ds1.1/lib/cmds/players/nextreboot.c Sun Feb 1 21:29:52 1998 --- ds2.0r27/lib/cmds/players/nextreboot.c Wed Jul 5 00:01:03 2006 *************** *** 4,29 **** */ #include #include inherit LIB_DAEMON; ! mixed cmd(string str) { ! string tzone; ! int x; x = (int)EVENTS_D->GetRebootInterval() * 3600; x = (time() - uptime()) + x; ! if( tzone = (string)this_player()->GetTimeZone() ) ! x += (int)TIME_D->GetOffset(tzone) * 3600; ! else tzone = "CST"; ! str = tzone + " " + ctime(x); ! message("system", "The next reboot will occur " + str + ".",this_player()); return 1; } string GetHelp(string str) { return ("Syntax: \n\n" ! "Tells you when the next regularly scheduled reboot for " + ! mud_name() + " will occur."); } --- 4,35 ---- */ #include + #include #include inherit LIB_DAEMON; ! mixed cmd(string form) { ! string str; ! int x, offset; ! ! offset = (int)TIME_D->GetOffset(local_time()[9]); ! offset += EXTRA_TIME_OFFSET; x = (int)EVENTS_D->GetRebootInterval() * 3600; x = (time() - uptime()) + x; ! if(query_os_type() != "windows" ) ! x += offset * 3600; ! str = query_tz()+ " " + ctime(x); ! message("system", "Current "+query_tz()+" system time is "+timestamp(), ! this_player()); ! if(form && form == "string") return "The next reboot will occur " + str + "."; ! else message("system", "The next reboot will occur " + str + ".",this_player()); return 1; } string GetHelp(string str) { return ("Syntax: \n\n" ! "Tells you when the next regularly scheduled reboot for " + ! mud_name() + " will occur."); } diff -c -r --new-file ds1.1/lib/cmds/players/plugh.c ds2.0r27/lib/cmds/players/plugh.c *** ds1.1/lib/cmds/players/plugh.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cmds/players/plugh.c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,11 ---- + #include + + inherit LIB_DAEMON; + + mixed cmd(string str) { + if(!creatorp(this_player())) write("Nothing happens."); + else tell_room(environment(this_player()),"A hollow voice says: \"%^CYAN%^Xyzzy.%^RESET%^\""); + return 1; + } + + diff -c -r --new-file ds1.1/lib/cmds/players/posting.c ds2.0r27/lib/cmds/players/posting.c *** ds1.1/lib/cmds/players/posting.c Sun Feb 1 21:29:53 1998 --- ds2.0r27/lib/cmds/players/posting.c Wed Jul 5 00:01:03 2006 *************** *** 1,32 **** // Command _posting.c // Written by Hanse@Dead Souls 6/21/93 ! #include inherit LIB_DAEMON; ! int cmd(string str) { ! object *list; ! int i; ! ! if(str) return 0; ! list=users(); ! write("\nList of users in various editors:\n"); ! for(i=0;iGetInvis() && list[i]->GetKeyName()) ! if(present("mailer", list[i])) ! printf("%s - In mailer.\n", ! arrange_string( (string)list[i]->GetName(), 20)); ! else if(in_edit(list[i]) || in_input(list[i])) ! printf("%s - Editing.\n", ! arrange_string( (string)list[i]->GetName(), 20)); ! return 1; } ! void help() { ! write(@END Syntax: posting Displays if a user is in editor, posting on a bulletin board, or in the mailer. END ! ); } --- 1,32 ---- // Command _posting.c // Written by Hanse@Dead Souls 6/21/93 ! #include inherit LIB_DAEMON; ! int cmd(string str) { ! object *list; ! int i; ! ! if(str) return 0; ! list=users(); ! write("\nList of users in various editors:\n"); ! for(i=0;iGetInvis() && list[i]->GetKeyName()) ! if(present("mailer", list[i])) ! printf("%s - In mailer.\n", ! arrange_string( (string)list[i]->GetName(), 20)); ! else if(in_edit(list[i]) || in_input(list[i])) ! printf("%s - Editing.\n", ! arrange_string( (string)list[i]->GetName(), 20)); ! return 1; } ! void help() { ! write(@END Syntax: posting Displays if a user is in editor, posting on a bulletin board, or in the mailer. END ! ); } diff -c -r --new-file ds1.1/lib/cmds/players/quests.c ds2.0r27/lib/cmds/players/quests.c *** ds1.1/lib/cmds/players/quests.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cmds/players/quests.c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,45 ---- + #include + + inherit LIB_DAEMON; + + mixed cmd(string str) { + string ret; + object dude; + + if(str && !creatorp(this_player()) ) { + if(!find_player(str) || find_player(str) != this_player()){ + write("You can only get quest information about yourself."); + return 1; + } + } + if(str && !find_player(str)){ + write("That player isn't logged on."); + return 1; + } + if(str) dude = find_player(str); + else dude = this_player(); + if(!sizeof(dude->GetQuests())){ + if(dude == this_player()) write("You have completed no quests."); + else write(dude->GetName()+" has completed no quests."); + return 1; + } + + if(dude == this_player()) ret = "You have completed the following quests:\n"; + else ret = dude->GetName()+" has completed the following quests:\n"; + + ret += "----------------------------------------\n"; + + foreach(string *quests in dude->GetQuests()){ + ret += quests[1] + "\n"; + } + write(ret); + return 1; + } + + void help() { + message("help", + "Syntax: quests\n\n" + "This command lists the quests you have completed.\n\n", + this_player() ); + } + diff -c -r --new-file ds1.1/lib/cmds/players/rwho.c ds2.0r27/lib/cmds/players/rwho.c *** ds1.1/lib/cmds/players/rwho.c Sun Feb 1 21:29:52 1998 --- ds2.0r27/lib/cmds/players/rwho.c Wed Jul 5 00:01:03 2006 *************** *** 12,18 **** mixed cmd(string str) { if( !str ) return "Get a remote who from where?"; if( !(str = (string)INTERMUD_D->GetMudName(str)) ) ! return mud_name() + " is not aware of such a place."; SERVICES_D->eventSendWhoRequest(str); message("system", "Remote who query sent to " + str + ".", this_player()); return 1; --- 12,18 ---- mixed cmd(string str) { if( !str ) return "Get a remote who from where?"; if( !(str = (string)INTERMUD_D->GetMudName(str)) ) ! return mud_name() + " is not aware of such a place."; SERVICES_D->eventSendWhoRequest(str); message("system", "Remote who query sent to " + str + ".", this_player()); return 1; diff -c -r --new-file ds1.1/lib/cmds/players/save.c ds2.0r27/lib/cmds/players/save.c *** ds1.1/lib/cmds/players/save.c Sun Feb 1 21:29:53 1998 --- ds2.0r27/lib/cmds/players/save.c Wed Jul 5 00:01:03 2006 *************** *** 21,31 **** int help() { ! message("help", "Command: save\nSyntax: save\n\nThis command saves the" ! " present status of your character to disk. This is important as" ! " it is this file that will be used to set your character back " ! "up if the mud should crash. Your character is automatically " ! "saved if you quit.", this_player()); ! return 1; } /* EOF */ --- 21,31 ---- int help() { ! message("help", "Command: save\nSyntax: save\n\nThis command saves the" ! " present status of your character to disk. This is important as" ! " it is this file that will be used to set your character back " ! "up if the mud should crash. Your character is automatically " ! "saved if you quit.", this_player()); ! return 1; } /* EOF */ diff -c -r --new-file ds1.1/lib/cmds/players/score.c ds2.0r27/lib/cmds/players/score.c *** ds1.1/lib/cmds/players/score.c Sun Feb 1 21:29:53 1998 --- ds2.0r27/lib/cmds/players/score.c Wed Jul 5 00:01:03 2006 *************** *** 3,88 **** * Displays a list of score and related info * created by Blitz@Dead Souls */ ! #include ! inherit LIB_DAEMON; inherit LIB_HELP; ! mixed eventScore(); ! static void create() { ! daemon::create(); ! SetNoClean(1); ! SetHelp("Syntax: score\n\n" ! "Displays information about your character.\n\n" ! "See also: status\n"); } ! static string *FoodDegree = ({ "could eat a horse right now!", "could eat plenty more.", ! "could eat some more.", "are partially hungry.", ! "are feeling full.", "feel quite full." }); ! static string *DrunkDegree = ! ({ "sober", "tipsy", "drunk", "blitzed", ! "smashed out of your gord", "FUBAR" }); ! static string *DrinkDegree = ({ "parched", "extremely thirsty", "very thirsty", "thirsty", ! "somewhat thirsty", "not thirsty" }); ! mixed cmd(string unused) { ! if( creatorp(this_player()) ) ! return "Creators have no score, get a life."; ! eventScore(); ! return 1; } ! mixed eventScore() { ! string *str; ! int birth, age, x, y, z; ! ! str = ({ "You are "+(string)this_player()->GetShort() + " (" + ! (string)this_player()->GetMoralityDescription() + ")." }); ! str += ({ sprintf("You are a level %d %s%s %s.", ! (int)this_player()->GetLevel(), ! ( (int)this_player()->GetUndead() ? "undead " : ""), ! capitalize((string)this_player()->GetRace() || "nothing"), ! capitalize((string)this_player()->GetClass() || "commoner")) }); ! str += ({ "Your native town is "+(string)this_player()->GetTown()+", and " ! "you are " + ((string)this_player()->GetReligion() || ! "agnostic") + " in faith." }); ! str += ({ sprintf("You've solved %s, and have %s.", ! consolidate(sizeof((string *)this_player()->GetQuests()), ! "one quest"), ! consolidate(sizeof((string *)this_player()->GetTitles()), ! "one title") ) }); ! birth = (int)this_player()->GetBirth(); ! age = ( query_year(time()) - query_year(birth) ); ! str += ({ sprintf("You were born on the %d%s day of %s, year %d. " ! "(%d years old)", query_date(birth), ordinal(query_date(birth)), ! query_month(birth), query_year(birth), age) }); ! if( x = (int)this_player()->GetTrainingPoints() < 1 ) { ! y = (int)this_player()->GetLevel() + 1 + (x / -4); ! str += ({ "Training points await you at level " + y + "." }); ! } ! else str += ({ "You have " + consolidate( ! (int)this_player()->GetTrainingPoints(), ! "one training point") + "." }); ! if( (int)this_player()->GetWimpy() ) ! str += ({ "You are feeling wimpy." }); else ! str += ({ "You are feeling brave." }); ! if( (int)this_player()->GetPoison() > 0 ) ! str += ({ "You are poisoned." }); ! x = (int)this_player()->GetFood() / 17; ! if( x > sizeof(FoodDegree) - 1 ) x = (sizeof(FoodDegree) - 1); ! y = (int)this_player()->GetDrink() / 17; ! if( y > sizeof(DrinkDegree) - 1 ) y = (sizeof(DrinkDegree) - 1); ! z = (int)this_player()->GetAlcohol() / 17; ! if( z > sizeof(DrunkDegree) - 1 ) z = (sizeof(DrunkDegree) - 1); ! str += ({ "You "+FoodDegree[x] }); ! str += ({ sprintf("You are %s and %s.", DrinkDegree[y], DrunkDegree[z]) }); ! this_player()->eventPage(str, "info"); ! return 1; } --- 3,86 ---- * Displays a list of score and related info * created by Blitz@Dead Souls */ ! #include ! inherit LIB_DAEMON; inherit LIB_HELP; ! mixed eventScore(); ! static void create() { ! daemon::create(); ! SetNoClean(1); ! SetHelp("Syntax: score\n\n" ! "Displays information about your character.\n\n" ! "See also: status\n"); } ! static string *FoodDegree = ({ "could eat a horse right now!", "could eat plenty more.", ! "could eat some more.", "are partially hungry.", ! "are feeling full.", "feel quite full." }); ! static string *DrunkDegree = ! ({ "you are sober", "you are tipsy", "you are drunk", "you are blitzed", ! "you are smashed out of your gord", "you are FUBAR" }); ! static string *DrinkDegree = ({ "parched", "extremely thirsty", "very thirsty", "thirsty", ! "somewhat thirsty", "not thirsty" }); ! mixed cmd(string unused) { ! eventScore(); ! return 1; } ! mixed eventScore() { ! string *str; ! int birth, age, x, y, z; ! ! str = ({ "You are "+(string)this_player()->GetShort() + " (" + ! (string)this_player()->GetMoralityDescription() + ")." }); ! str += ({ sprintf("You are a level %d %s%s %s.", ! (int)this_player()->GetLevel(), ! ( (int)this_player()->GetUndead() ? "undead " : ""), ! capitalize((string)this_player()->GetRace() || "nothing"), ! capitalize((string)this_player()->GetClass() || "commoner")) }); ! str += ({ "Your native town is "+(string)this_player()->GetTown()+", and " ! "you are " + ((string)this_player()->GetReligion() || ! "agnostic") + " in faith." }); ! str += ({ sprintf("You've solved %s, and have %s.", ! consolidate(sizeof((string *)this_player()->GetQuests()), ! "one quest"), ! consolidate(sizeof((string *)this_player()->GetTitles()), ! "one title") ) }); ! birth = (int)this_player()->GetBirth(); ! age = ( query_year(time()) - query_year(birth) ); ! str += ({ sprintf("You were born on the %d%s day of %s, year %d. " ! "(%d years old)", query_date(birth), ordinal(query_date(birth)), ! query_month(birth), query_year(birth), age) }); ! if( x = (int)this_player()->GetTrainingPoints() < 1 ) { ! y = (int)this_player()->GetLevel() + 1 + (x / -4); ! str += ({ "Training points await you at level " + y + "." }); ! } ! else str += ({ "You have " + consolidate( ! (int)this_player()->GetTrainingPoints(), ! "one training point") + "." }); ! if( (int)this_player()->GetWimpy() ) ! str += ({ "You are feeling wimpy." }); else ! str += ({ "You are feeling brave." }); ! if( (int)this_player()->GetPoison() > 0 ) ! str += ({ "You are poisoned." }); ! x = (int)this_player()->GetFood() / 17; ! if( x > sizeof(FoodDegree) - 1 ) x = (sizeof(FoodDegree) - 1); ! y = (int)this_player()->GetDrink() / 17; ! if( y > sizeof(DrinkDegree) - 1 ) y = (sizeof(DrinkDegree) - 1); ! z = (int)this_player()->GetAlcohol() / 17; ! if( z > sizeof(DrunkDegree) - 1 ) z = (sizeof(DrunkDegree) - 1); ! str += ({ "You "+FoodDegree[x] }); ! str += ({ sprintf("You are %s and %s.", DrinkDegree[y], DrunkDegree[z]) }); ! this_player()->eventPage(str, "info"); ! return 1; } diff -c -r --new-file ds1.1/lib/cmds/players/screen.c ds2.0r27/lib/cmds/players/screen.c *** ds1.1/lib/cmds/players/screen.c Sun Feb 1 21:29:53 1998 --- ds2.0r27/lib/cmds/players/screen.c Wed Jul 5 00:01:03 2006 *************** *** 11,21 **** mixed cmd(string args) { int *screen; int h, w; if( args == "" || !args ) ! return "You need to specify both width and height."; if( sscanf(args, "%d %d", w, h) != 2 ) ! return "You need to specify both width and height."; this_player()->SetScreen(w, h); message("system", "Screen set to " + w + " by " + h + ".", this_player()); return 1; --- 11,24 ---- mixed cmd(string args) { int *screen; int h, w; + string chide = "You need to specify both width and height.\n"; + string ret = "Your current settings are: "+ this_player()->GetScreen()[0]; + ret += " "+ this_player()->GetScreen()[1]; if( args == "" || !args ) ! return chide + ret; if( sscanf(args, "%d %d", w, h) != 2 ) ! return chide + ret; this_player()->SetScreen(w, h); message("system", "Screen set to " + w + " by " + h + ".", this_player()); return 1; *************** *** 23,29 **** void help() { message("help", "Syntax: \n\n" ! "Sets the dimensions of your computer screen so that " + ! mud_name() + " knows how to send information to your screen.\n\n" ! "See also: brief, terminal", this_player()); } --- 26,32 ---- void help() { message("help", "Syntax: \n\n" ! "Sets the dimensions of your computer screen so that " + ! mud_name() + " knows how to send information to your screen.\n\n" ! "See also: brief, terminal", this_player()); } diff -c -r --new-file ds1.1/lib/cmds/players/skills.c ds2.0r27/lib/cmds/players/skills.c *** ds1.1/lib/cmds/players/skills.c Sun Feb 1 21:29:53 1998 --- ds2.0r27/lib/cmds/players/skills.c Wed Jul 5 00:01:03 2006 *************** *** 5,63 **** * - Moved map function to GetLine for readability, added a max skill * level display for each skill, grouped in classes. (Blitz 960122/0404) */ ! #include ! inherit LIB_DAEMON; ! string GetLine(string skill) { int x, max; mapping mp = (mapping)this_player()->GetSkill(skill); ! if( !sizeof(mp) ) return 0; x = to_int(percent(mp["points"], ! (int)this_player()->GetMaxSkillPoints(skill, mp["level"]))); max = ( mp["class"] == 1 ? 2 : 1 ) + (int)this_player()->GetLevel(); max *= 2; if( max < mp["level"] ) max = mp["level"]; return sprintf("%:-20s: %:-6s (%d%%)", skill, ! (mp["level"] + "/" + max), x); } ! mixed cmd(string args) { string *skills, *primes, *secs; string ret, tmp; int x, scr; ! ! if( creatorp(this_player()) ) { ! message("system", "Creators have no skills, get a life.", ! this_player()); ! return 1; ! } ret = "You are " +(string)this_player()->GetShort() + ", level " + ! (int)this_player()->GetLevel(); if( (tmp = (string)this_player()->GetClass()) ) ! ret += " " + capitalize(tmp); else ret += " Drifter"; ret += " (" + (string)this_player()->GetRace() + ")\n"; scr = ((int *)this_player()->GetScreen())[0]; ! skills = sort_array((string *)this_player()->GetSkills(), 1); if( !sizeof(skills) ) { ! ret += "You are without skills.\n"; ! this_player()->eventPrint(ret); ! return 1; } skills = skills - (primes = filter(skills, ! (: this_player()->GetSkillClass($1) == 1 :))); skills = skills - (secs = filter(skills, ! (: this_player()->GetSkillClass($1) == 2 :))); skills = map(skills, (: GetLine :)); primes = map(primes, (: GetLine :)); secs = map(secs, (: GetLine :)); foreach(mixed sarray in ({ primes, secs, skills }) ) { ! int y, i = sizeof(sarray); ! while(i--) if( (y = strlen(sarray[i])) > x ) x = y; } x = scr/(x+2); ret += "%^BOLD%^%^BLUE%^Primary skills:%^RESET%^\n"; --- 5,58 ---- * - Moved map function to GetLine for readability, added a max skill * level display for each skill, grouped in classes. (Blitz 960122/0404) */ ! #include ! inherit LIB_DAEMON; ! string GetLine(string skill) { int x, max; mapping mp = (mapping)this_player()->GetSkill(skill); ! if( !sizeof(mp) ) return 0; x = to_int(percent(mp["points"], ! (int)this_player()->GetMaxSkillPoints(skill, mp["level"]))); max = ( mp["class"] == 1 ? 2 : 1 ) + (int)this_player()->GetLevel(); max *= 2; if( max < mp["level"] ) max = mp["level"]; return sprintf("%:-20s: %:-6s (%d%%)", skill, ! (mp["level"] + "/" + max), x); } ! mixed cmd(string args) { string *skills, *primes, *secs; string ret, tmp; int x, scr; ! ret = "You are " +(string)this_player()->GetShort() + ", level " + ! (int)this_player()->GetLevel(); if( (tmp = (string)this_player()->GetClass()) ) ! ret += " " + capitalize(tmp); else ret += " Drifter"; ret += " (" + (string)this_player()->GetRace() + ")\n"; scr = ((int *)this_player()->GetScreen())[0]; ! skills = sort_array((string *)this_player()->GetSkills(), 1); if( !sizeof(skills) ) { ! ret += "You are without skills.\n"; ! this_player()->eventPrint(ret); ! return 1; } skills = skills - (primes = filter(skills, ! (: this_player()->GetSkillClass($1) == 1 :))); skills = skills - (secs = filter(skills, ! (: this_player()->GetSkillClass($1) == 2 :))); skills = map(skills, (: GetLine :)); primes = map(primes, (: GetLine :)); secs = map(secs, (: GetLine :)); foreach(mixed sarray in ({ primes, secs, skills }) ) { ! int y, i = sizeof(sarray); ! while(i--) if( (y = strlen(sarray[i])) > x ) x = y; } x = scr/(x+2); ret += "%^BOLD%^%^BLUE%^Primary skills:%^RESET%^\n"; *************** *** 69,78 **** this_player()->eventPage(explode(ret, "\n")); return 1; } ! string GetHelp(string foo) { return "Syntax: \n\n" ! "Lists all of your skills as well as how skilled you are " ! "at the skill in question.\n\n" ! "See also: stats, status"; } --- 64,73 ---- this_player()->eventPage(explode(ret, "\n")); return 1; } ! string GetHelp(string foo) { return "Syntax: \n\n" ! "Lists all of your skills as well as how skilled you are " ! "at the skill in question.\n\n" ! "See also: stats, status"; } diff -c -r --new-file ds1.1/lib/cmds/players/spells.c ds2.0r27/lib/cmds/players/spells.c *** ds1.1/lib/cmds/players/spells.c Sun Feb 1 21:29:52 1998 --- ds2.0r27/lib/cmds/players/spells.c Wed Jul 5 00:01:03 2006 *************** *** 14,24 **** string array spells = ({}); string tmp; int len; ! ! if( creatorp(who) ) { ! who->eventPrint("Creators know no spells."); ! return 1; ! } tmp = "You know the following spells:\n"; foreach(string spell, int val in who->GetSpellBook()) { spells += ({ sprintf("%:-20s: %:-3d%%", spell, val) }); --- 14,20 ---- string array spells = ({}); string tmp; int len; ! tmp = "You know the following spells:\n"; foreach(string spell, int val in who->GetSpellBook()) { spells += ({ sprintf("%:-20s: %:-3d%%", spell, val) }); *************** *** 29,35 **** else { foreach(string spell in spells) { int i = strlen(spell); ! if( i > len ) { len = i; } --- 25,31 ---- else { foreach(string spell in spells) { int i = strlen(spell); ! if( i > len ) { len = i; } *************** *** 43,49 **** string GetHelp() { return ("Syntax: \n\n" ! "Lists all of your spells in your spell book with your " ! "proficiency in each spell.\n\n" ! "See also: skills, stats, status"); } --- 39,45 ---- string GetHelp() { return ("Syntax: \n\n" ! "Lists all of your spells in your spell book with your " ! "proficiency in each spell.\n\n" ! "See also: skills, stats, status"); } diff -c -r --new-file ds1.1/lib/cmds/players/stat.c ds2.0r27/lib/cmds/players/stat.c *** ds1.1/lib/cmds/players/stat.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cmds/players/stat.c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,117 ---- + /* /cmds/creator/stat.c + * from the Dead Souls LPC Library + * a command to view something's stats + * created by Descartes of Borg 950409 + */ + + #include + + inherit LIB_DAEMON; + + mixed cmd(string args) { + string *lines, *arr, *limbs; + object ob; + string tmp1, tmp2; + int i, x, y, cols; + + if( args == "" || !args || args == "me" ) args = this_player()->GetKeyName(); + else if(args && !creatorp(this_player())) { + write("You can only stat yourself."); + return 1; + } + + if( !(ob = present(args, environment(this_player()))) ) + if( !(ob = find_player(convert_name(args))) && + !(ob = find_living(lower_case(args))) ) + return capitalize(args) + " is nowhere to be found."; + if(!living(ob)) return capitalize(args) + " is not alive."; + cols = ((int *)this_player()->GetScreen())[0]; + tmp1 = (string)ob->GetCapName() + " aka " + (string)ob->GetShort() + + ", level " + (int)ob->GetLevel() + " " + (string)ob->GetGender(); + if( !(tmp2 = (string)ob->GetRace()) ) tmp2 = "blob"; + tmp1 += " " + tmp2; + if( !(tmp2 = (string)ob->GetClass()) || !stringp(tmp2)) tmp2 = "drifter"; + tmp1 += " " + capitalize(tmp2); + if( tmp2 = (string)ob->GetSpouse() ) + tmp1 += " (spouse: " + tmp2 + ")"; + lines = ({ center(tmp1, cols) }); + if( (int)ob->GetUndead() ) tmp1 = "%^BOLD%^RED%^UNDEAD%^RESET%^"; + else tmp1 = "%^BOLD%^GREEN%^Alive%^RESET%^"; + if( (int)ob->GetSleeping() ) tmp1 += " / Sleeping"; + else tmp1 += " / Awake"; + if( (int)ob->GetParalyzed() ) tmp1 += " / Paralyzed"; + lines += ({ center(tmp1, cols), "" }); + lines += ({ center("Health: " +(int)ob->GetHealthPoints() + "/"+ + (int)ob->GetMaxHealthPoints() + " Magic: " + + (int)ob->GetMagicPoints() + "/" + + (int)ob->GetMaxMagicPoints() + " Stamina: " + + (int)ob->GetStaminaPoints() + "/" + + to_int((float)ob->GetMaxStaminaPoints()) + " Carry: " + + (int)ob->GetCarriedMass() + "/" + + (int)ob->GetMaxCarry(), cols) }); + lines += ({ center("Food: " + (int)ob->GetFood() + " " + + "Drink: " + (int)ob->GetDrink() + " " + + "Alcohol: " + (int)ob->GetAlcohol() + " " + + "Caffeine: " + (int)ob->GetCaffeine() + " " + + "Poison: " + (int)ob->GetPoison() + " ", cols) }); + lines += ({ "\n" }) ; + lines += ({ center("Training Points: " + (int)ob->GetTrainingPoints() + + " " + + "Quest Points: "+ (int)ob->GetQuestPoints() + + " " + + //Fix below courtesy of Jonez + "Experience Points: "+ (int)ob->GetExperiencePoints()),cols + }); + lines += ({ "", "Limbs:" }); + limbs = (string *)ob->GetWieldingLimbs(); + if(ob && !ob->GetGhost()) arr = map((string *)ob->GetLimbs(), + (: sprintf("%:-14s%s (%d) %d/%d", $1, + ((member_array($1, $(limbs)) == -1) ? " " : "*"), + (int)($(ob))->GetLimbClass($1), + (int)($(ob))->GetHealthPoints($1), + (int)($(ob))->GetMaxHealthPoints($1)) :)); + i = sizeof(arr); + while(i--) if( (y = strlen(arr[i])) > x ) x = y; + x = cols/(x+2); + lines += explode(format_page(arr, x), "\n") + ({ "", "Skills:" }); + arr = map((string *)ob->GetSkills(), + function(string skill, object who) { + mapping mp = (mapping)who->GetSkill(skill); + int x, max; + x = to_int(percent(mp["points"], + (int)who->GetMaxSkillPoints(skill, mp["level"]))); + max = ( mp["class"] == 1 ? 2 : 1 ) + who->GetLevel(); + max *= 2; + if( max < mp["level"] ) max = mp["level"]; + return sprintf("%:-18s (%d) %:2d%% - %d/%d", + skill, mp["class"], x, mp["level"], max); + }, ob); + i = sizeof(arr); + while(i--) if( (y = strlen(arr[i])) > x ) x = y; + x = cols/(x+2); + lines += explode(format_page(arr, x), "\n") + ({ "", "Stats:" }); + arr = map((string *)ob->GetStats(), + (: sprintf("%:-12s (%d) %d/%d", $1, + (int)($(ob))->GetStatClass($1), + (int)($(ob))->GetStatLevel($1), + (int)($(ob))->GetBaseStatLevel($1)) :)); + i = sizeof(arr); + x = 0; + while(i--) if( (y = strlen(arr[i])) > x ) x = y; + x =cols/(x+2); + lines += explode(format_page(arr, x), "\n"); + lines += ({ "", (string)ob->GetName()+" has amassed a net worth of " + + ( (int)ob->GetNetWorth("gold") ) + " gold."}); + arr = filter( map((string *)ob->GetCurrencies(), + (: ($(ob))->GetCurrency($1) && + sprintf("%d %s", ($(ob))->GetCurrency($1), $1) :)), + (: $1 :)); + lines += ({ "Money on hand: "+implode(arr, ", ") }); + this_player()->eventPage(lines, "system"); + return 1; + } + + string GetHelp(string blah) { + return ("Syntax: stat \n\n" + "Displays statistical information a living object."); + } diff -c -r --new-file ds1.1/lib/cmds/players/stats.c ds2.0r27/lib/cmds/players/stats.c *** ds1.1/lib/cmds/players/stats.c Sun Feb 1 21:29:53 1998 --- ds2.0r27/lib/cmds/players/stats.c Wed Jul 5 00:01:03 2006 *************** *** 13,32 **** string ret, tmp; int i, x, y; - if( creatorp(this_player()) ) { - message("system", "Creators have no stats, get a life.", - this_player()); - return 1; - } ret = "You are " +(string)this_player()->GetShort() + ", level " + ! (int)this_player()->GetLevel(); if( (tmp = (string)this_player()->GetClass()) ) ! ret += " " + capitalize(tmp); else ret += " Drifter"; ret += " (" + (string)this_player()->GetRace() + ")\n"; stats = map((string)this_player()->GetStats(), ! (: sprintf("%:-20s: %:-3d", $1, ! (int)this_player()->GetStatLevel($1)) :)); i = sizeof(stats); while(i--) if( (y = strlen(stats[i])) > x ) x = y; x = ((int *)this_player()->GetScreen())[0]/(x+2); --- 13,27 ---- string ret, tmp; int i, x, y; ret = "You are " +(string)this_player()->GetShort() + ", level " + ! (int)this_player()->GetLevel(); if( (tmp = (string)this_player()->GetClass()) ) ! ret += " " + capitalize(tmp); else ret += " Drifter"; ret += " (" + (string)this_player()->GetRace() + ")\n"; stats = map((string)this_player()->GetStats(), ! (: sprintf("%:-20s: %:-3d", $1, ! (int)this_player()->GetStatLevel($1)) :)); i = sizeof(stats); while(i--) if( (y = strlen(stats[i])) > x ) x = y; x = ((int *)this_player()->GetScreen())[0]/(x+2); *************** *** 37,43 **** void help() { message("help", "Syntax: \n\n" ! "Lists all of your stats as well as how skilled you are " ! "at the skill in question.\n\n" ! "See also: stats, status", this_player()); } --- 32,38 ---- void help() { message("help", "Syntax: \n\n" ! "Lists all of your stats as well as how skilled you are " ! "at the skill in question.\n\n" ! "See also: stats, status", this_player()); } diff -c -r --new-file ds1.1/lib/cmds/players/status.c ds2.0r27/lib/cmds/players/status.c *** ds1.1/lib/cmds/players/status.c Sun Feb 1 21:29:54 1998 --- ds2.0r27/lib/cmds/players/status.c Wed Jul 5 00:01:03 2006 *************** *** 12,17 **** void help() { message("help", "Syntax: \n\n" ! "Gives you information about your current physical status.\n\n" ! "See also: money, skills, stats", this_player()); } --- 12,17 ---- void help() { message("help", "Syntax: \n\n" ! "Gives you information about your current physical status.\n\n" ! "See also: money, skills, stats", this_player()); } diff -c -r --new-file ds1.1/lib/cmds/players/terminal.c ds2.0r27/lib/cmds/players/terminal.c *** ds1.1/lib/cmds/players/terminal.c Sun Feb 1 21:29:54 1998 --- ds2.0r27/lib/cmds/players/terminal.c Wed Jul 5 00:01:03 2006 *************** *** 11,24 **** mixed cmd(string args) { if( !args || args == "" ) return "Set it to what?"; message("system", "Terminal set to " + ! (string)this_player()->SetTerminal(args) + ".", this_player()); return 1; } void help() { message("help", "Syntax: \n\n" ! "Allows you to set your terminal type manually in the " ! "event the MUD does not automatically recognize the proper " ! "setting.\n\n" ! "See also: screen", this_player()); } --- 11,24 ---- mixed cmd(string args) { if( !args || args == "" ) return "Set it to what?"; message("system", "Terminal set to " + ! (string)this_player()->SetTerminal(args) + ".", this_player()); return 1; } void help() { message("help", "Syntax: \n\n" ! "Allows you to set your terminal type manually in the " ! "event the MUD does not automatically recognize the proper " ! "setting.\n\n" ! "See also: screen", this_player()); } diff -c -r --new-file ds1.1/lib/cmds/players/title.c ds2.0r27/lib/cmds/players/title.c *** ds1.1/lib/cmds/players/title.c Sun Feb 1 21:29:52 1998 --- ds2.0r27/lib/cmds/players/title.c Wed Jul 5 00:01:03 2006 *************** *** 5,10 **** --- 5,11 ---- */ #include + #include inherit LIB_DAEMON; *************** *** 14,38 **** mixed cmd(string args) { string *titles; ! int i, maxi; ! if( creatorp(this_player()) || avatarp(this_player()) ) { if( !args || args == "" ) return "Change your title to what?"; else args = (string)this_player()->SetShort(args); message("system", "Title changed to: " + args, this_player()); return 1; } if( !(maxi = sizeof(titles = (string *)this_player()->GetTitles())) ) ! return "You are totally unaccomplished."; if( args == "1" || args == "2" ) { ! this_player()->SetTitleLength(to_int(args)); ! this_player()->SetShort("foo"); ! this_player()->eventPrint("Number of titles in your descriptions changed to " + args + "."); ! return 1; } if( maxi == 1 ) { message("system", "You have only one title: " + titles[0], ! this_player()); return 1; } else if( maxi == 2 ) { --- 15,43 ---- mixed cmd(string args) { string *titles; ! int maxi; ! if( creatorp(this_player()) || avatarp(this_player()) ) { if( !args || args == "" ) return "Change your title to what?"; else args = (string)this_player()->SetShort(args); message("system", "Title changed to: " + args, this_player()); + this_player()->save_player((string)this_player()->GetKeyName()); + update("/secure/daemon/finger"); return 1; } if( !(maxi = sizeof(titles = (string *)this_player()->GetTitles())) ) ! return "You are totally unaccomplished."; if( args == "1" || args == "2" ) { ! this_player()->SetTitleLength(to_int(args)); ! this_player()->SetShort("foo"); ! this_player()->eventPrint("Number of titles in your descriptions changed to " + args + "."); ! this_player()->save_player((string)this_player()->GetKeyName()); ! update("/secure/daemon/finger"); ! return 1; } if( maxi == 1 ) { message("system", "You have only one title: " + titles[0], ! this_player()); return 1; } else if( maxi == 2 ) { *************** *** 46,54 **** } this_player()->SetTitles( ({ titles[1], titles[0] }) ); message("system", "Titles reversed.", this_player()); }; message("system", "You have the following titles:\n\t" + ! titles[0] + "\n\t" + titles[1], this_player()); message("prompt", "Do you wish to reverse them? [n] ", this_player()); input_to(f, titles); return 1; --- 51,61 ---- } this_player()->SetTitles( ({ titles[1], titles[0] }) ); message("system", "Titles reversed.", this_player()); + this_player()->save_player((string)this_player()->GetKeyName()); + update("/secure/daemon/finger"); }; message("system", "You have the following titles:\n\t" + ! titles[0] + "\n\t" + titles[1], this_player()); message("prompt", "Do you wish to reverse them? [n] ", this_player()); input_to(f, titles); return 1; *************** *** 62,70 **** message("system", "You have the following titles:", this_player()); for(i=0; iSetTitles(titles); message("system", "Done.", this_player()); + this_player()->save_player((string)this_player()->GetKeyName()); + update("/secure/daemon/finger"); return; } else if( which == "" || !which ) which = "1"; *************** *** 119,140 **** void help() { if( creatorp(this_player()) ) { message("help", "Syntax: \n\n" ! "Allows you to change your title. You must include the " ! "token $N in your title, which will be replaced with your " ! "name as appropriate. For example:\n" ! "\ttitle We are $N of Borg\n" ! "would make my short appear as:\n" ! "\tWe are Descartes of Borg.\n\n", this_player()); } else { message("help", "Syntax: <title>\n\n" ! "Allows you to reorder your titles. Your first two titles " ! "appear in your short description. This command is " ! "interactive, meaning it prompts you for what to do. " ! "hit 'q' at any point to save your changes and exit out of " ! "this command.\nYou can also type (title 1) or (title 2) " ! "to change how many titles appear in your description.", ! this_player() ); } } --- 128,149 ---- void help() { if( creatorp(this_player()) ) { message("help", "Syntax: <title [title]>\n\n" ! "Allows you to change your title. You must include the " ! "token $N in your title, which will be replaced with your " ! "name as appropriate. For example:\n" ! "\ttitle We are $N of Borg\n" ! "would make my short appear as:\n" ! "\tWe are Descartes of Borg.\n\n", this_player()); } else { message("help", "Syntax: <title>\n\n" ! "Allows you to reorder your titles. Your first two titles " ! "appear in your short description. This command is " ! "interactive, meaning it prompts you for what to do. " ! "hit 'q' at any point to save your changes and exit out of " ! "this command.\nYou can also type (title 1) or (title 2) " ! "to change how many titles appear in your description.", ! this_player() ); } } diff -c -r --new-file ds1.1/lib/cmds/players/unmuff.c ds2.0r27/lib/cmds/players/unmuff.c *** ds1.1/lib/cmds/players/unmuff.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cmds/players/unmuff.c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,26 ---- + #include <lib.h> + + inherit LIB_DAEMON; + + mixed cmd(string str) { + if(!sizeof(this_player()->GetMuffed())) return "You are ignoring no one."; + else if(!str || str == "") return "Please be more specific."; + else { + string *iglist = this_player()->GetMuffed(); + if(member_array(lower_case(str),iglist) == -1) return "You aren't ignoring them."; + iglist -= ({ lower_case(str) }); + this_player()->SetMuffed(iglist); + write("You remove "+capitalize(str)+" from your earmuffed list."); + } + return 1; + } + + void help() { + message("help", + "Syntax: unmuff\n" + " unmuff <name>\n\n" + "This command allows you to stop ignoring channel messages from the name specified.\n" + "See also: earmuff, whomuffed\n\n", + this_player() ); + } + diff -c -r --new-file ds1.1/lib/cmds/players/uptime.c ds2.0r27/lib/cmds/players/uptime.c *** ds1.1/lib/cmds/players/uptime.c Sun Feb 1 21:29:54 1998 --- ds2.0r27/lib/cmds/players/uptime.c Wed Jul 5 00:01:03 2006 *************** *** 20,42 **** str = mud_name() + " has been up for %^ORANGE%^"; if (x = (tm / WEEK)) { ! str += x + "w "; ! tm -= x * WEEK; } if (x = (tm / DAY)) { ! str += x +"d "; ! tm -= x * DAY; } if (x = (tm / HOUR)) { ! str += x + "h "; ! tm -= x * HOUR; } if (x = (tm / MIN)) { ! str += x + "m "; ! tm -= x * MIN; } if (tm) { ! str += tm + "s "; } str = str[0..<2] + "%^RESET%^."; write(str); --- 20,42 ---- str = mud_name() + " has been up for %^ORANGE%^"; if (x = (tm / WEEK)) { ! str += x + "w "; ! tm -= x * WEEK; } if (x = (tm / DAY)) { ! str += x +"d "; ! tm -= x * DAY; } if (x = (tm / HOUR)) { ! str += x + "h "; ! tm -= x * HOUR; } if (x = (tm / MIN)) { ! str += x + "m "; ! tm -= x * MIN; } if (tm) { ! str += tm + "s "; } str = str[0..<2] + "%^RESET%^."; write(str); diff -c -r --new-file ds1.1/lib/cmds/players/users.c ds2.0r27/lib/cmds/players/users.c *** ds1.1/lib/cmds/players/users.c Sun Feb 1 21:29:53 1998 --- ds2.0r27/lib/cmds/players/users.c Wed Jul 5 00:01:03 2006 *************** *** 13,27 **** user_ob = users(); user_name = ({ }); for (i = 0; i < sizeof(user_ob); i++) { ! if( user_ob[i]->GetInvis() ) ! continue; ! name = (string)user_ob[i]->GetKeyName(); ! if (stringp(name)) ! user_name += ({ capitalize(name) }); } user_name = sort_array(user_name, "sort_names"); ! write(format_page(user_name, 4)); ! write(sprintf("Total : %d", sizeof(user_name))); return 1; } --- 13,29 ---- user_ob = users(); user_name = ({ }); for (i = 0; i < sizeof(user_ob); i++) { ! if(user_ob[i]){ ! if( user_ob[i]->GetInvis() ) ! continue; ! name = (string)user_ob[i]->GetKeyName(); ! if (stringp(name)) ! user_name += ({ capitalize(name) }); ! } } user_name = sort_array(user_name, "sort_names"); ! write(format_page(user_name, 4)); ! write(sprintf("Total : %d", sizeof(user_name))); return 1; } *************** *** 37,49 **** int help() { ! write( @EndText Syntax: users Effect: Lists the names of player logged in. A shorter and quicker version of "who" See also: who, where See also: say, tell, class EndText ! ); ! return 1; } --- 39,51 ---- int help() { ! write( @EndText Syntax: users Effect: Lists the names of player logged in. A shorter and quicker version of "who" See also: who, where See also: say, tell, class EndText ! ); ! return 1; } diff -c -r --new-file ds1.1/lib/cmds/players/version.c ds2.0r27/lib/cmds/players/version.c *** ds1.1/lib/cmds/players/version.c Sun Feb 1 21:29:54 1998 --- ds2.0r27/lib/cmds/players/version.c Wed Jul 5 00:01:03 2006 *************** *** 5,29 **** */ #include <lib.h> #include <daemons.h> #include <localtime.h> inherit LIB_DAEMON; int cmd(string str) { ! string tz, tmp; ! int x, scr, nr; ! tz = (string)this_player()->GetTimeZone() || localtime(time())[LT_ZONE]; ! x = (int)TIME_D->GetOffset(tz) * 3600; scr = ((int *)this_player()->GetScreen())[0]; nr = (time() - uptime()) + ((int)EVENTS_D->GetRebootInterval() * 3600); tmp = center(mud_name(), scr) + "\n"; tmp += sprintf("%:-"+(scr/2)+"s%"+(scr/2)+"s\n", "Driver: " + version(), ! "Library: " + mudlib() + " " + mudlib_version()); tmp += sprintf("%:-" + (scr/2) + "s%" + (scr/2) + "s\n", ! "Up since: " + ctime((time() - uptime()) +x), ! "Next reboot: " + ctime(nr + x)); tmp += center("Current time: " + ctime(time() + x) + " " + tz, scr); message("system", tmp, this_player()); return 1; --- 5,34 ---- */ #include <lib.h> + #include <config.h> #include <daemons.h> #include <localtime.h> inherit LIB_DAEMON; int cmd(string str) { ! string tz, tmp, extra; ! int offset, x, scr, nr; ! if(sizeof(query_os_type())) extra = " for "+query_os_type(); ! tz = query_tz(); ! offset = (int)TIME_D->GetOffset(tz); ! offset += EXTRA_TIME_OFFSET; ! if(query_os_type() != "windows" ) x = offset * 3600; ! else x = 0; scr = ((int *)this_player()->GetScreen())[0]; nr = (time() - uptime()) + ((int)EVENTS_D->GetRebootInterval() * 3600); tmp = center(mud_name(), scr) + "\n"; tmp += sprintf("%:-"+(scr/2)+"s%"+(scr/2)+"s\n", "Driver: " + version(), ! "Library: " + mudlib() + " " + mudlib_version()+extra); tmp += sprintf("%:-" + (scr/2) + "s%" + (scr/2) + "s\n", ! "Up since: " + ctime((time() - uptime()) +x), ! "Next reboot: " + ctime(nr + x)); tmp += center("Current time: " + ctime(time() + x) + " " + tz, scr); message("system", tmp, this_player()); return 1; diff -c -r --new-file ds1.1/lib/cmds/players/where.c ds2.0r27/lib/cmds/players/where.c *** ds1.1/lib/cmds/players/where.c Sun Feb 1 21:29:54 1998 --- ds2.0r27/lib/cmds/players/where.c Wed Jul 5 00:01:03 2006 *************** *** 19,25 **** foreach(line in explode(str, "\n")) { string site, where; if( sscanf(line, "%s:%s", site, where) == 2 ) ! Sites[site] = where; } } --- 19,25 ---- foreach(line in explode(str, "\n")) { string site, where; if( sscanf(line, "%s:%s", site, where) == 2 ) ! Sites[site] = where; } } *************** *** 44,54 **** int priv; if( arg == "block" ) { ! if( (int)this_player()->GetWhereBlock() ) ! write("Location blocking off."); ! else write("Now blocking location information."); ! this_player()->SetWhereBlock(); ! return 1; } priv = archp(this_player()); arr = ({}); --- 44,54 ---- int priv; if( arg == "block" ) { ! if( (int)this_player()->GetWhereBlock() ) ! write("Location blocking off."); ! else write("Now blocking location information."); ! this_player()->SetWhereBlock(); ! return 1; } priv = archp(this_player()); arr = ({}); *************** *** 59,65 **** if( (int)ob->GetWhereBlock() ) { if( !priv ) str = sprintf("%:-15s Unknown", (string)ob->GetName()); else str = sprintf("%:-15s [%s]", (string)ob->GetName(), ! GetWhere(ob)); } else str = sprintf("%:-15s %s", (string)ob->GetName(), GetWhere(ob)); arr += ({ str }); --- 59,65 ---- if( (int)ob->GetWhereBlock() ) { if( !priv ) str = sprintf("%:-15s Unknown", (string)ob->GetName()); else str = sprintf("%:-15s [%s]", (string)ob->GetName(), ! GetWhere(ob)); } else str = sprintf("%:-15s %s", (string)ob->GetName(), GetWhere(ob)); arr += ({ str }); *************** *** 70,81 **** void help() { write("Syntax: <where>\n\n" ! "Lists all players online and the towns from which those players\n" ! "whose machine site locations are known. If your site is marked\n" ! "<mail superuser> with the town your *machine* is located in and\n" ! "the ip # (four numbers separated by a period).\n" ! "\nOptional: <where [block]>\n\n" ! "Allows you to keep your location anonymous.\n" ! "See also: users, who\n" ); } --- 70,81 ---- void help() { write("Syntax: <where>\n\n" ! "Lists all players online and the towns from which those players\n" ! "whose machine site locations are known. If your site is marked\n" ! "<mail superuser> with the town your *machine* is located in and\n" ! "the ip # (four numbers separated by a period).\n" ! "\nOptional: <where [block]>\n\n" ! "Allows you to keep your location anonymous.\n" ! "See also: users, who\n" ); } diff -c -r --new-file ds1.1/lib/cmds/players/who.c ds2.0r27/lib/cmds/players/who.c *** ds1.1/lib/cmds/players/who.c Sun Feb 1 21:29:54 1998 --- ds2.0r27/lib/cmds/players/who.c Wed Jul 5 00:01:03 2006 *************** *** 1,67 **** #include <lib.h> #include <config.h> ! inherit LIB_DAEMON; ! ! #define Colours ({\ ! "%^MAGENTA%^",\ ! "%^BOLD%^%^MAGENTA%^",\ ! "%^BOLD%^%^CYAN%^",\ ! "%^CYAN%^",\ ! "%^BLUE%^",\ ! "%^BOLD%^%^BLUE%^",\ ! }) ! ! #define Position ({\ ! "arch",\ ! "creator",\ ! "newbie",\ ! "mortal",\ ! "high mortal",\ ! "avatar",\ ! }) ! ! string AddName(object ob, int x) { ! string str; ! if( query_idle(ob) > 60 ) str = "(idle) "; ! else if( in_input(ob) || in_edit(ob) ) str = "(edit) "; ! else str = " "; ! if( x < 0 || x > 5 ) x = 0; ! return (Colours[x] + str + strip_colours((string)ob->GetShort()) + "%^RESET%^"); ! } ! ! mixed cmd(string args) { ! string *lines; ! mixed group; ! object *avatars, *hms, *norms, *newbies, *adms, *cres, *obs; ! int x, colour, cnt, *screen; ! ! x = sizeof(obs = filter(users(), (: $1->GetName() && ! !((int)$1->GetInvis(this_player())) :))); ! obs = obs - (avatars = filter(obs, (: avatarp :))); ! obs = obs - (hms = filter(obs, (: high_mortalp :))); ! obs = obs - (adms = filter(obs, (: archp :))); ! obs = obs - (cres = filter(obs, (: creatorp :))); ! newbies = obs - ! (norms = filter(obs, (: (int)$1->GetLevel() > MAX_NEWBIE_LEVEL :))); ! screen = (int *)this_player()->GetScreen()[0]; ! colour = sizeof(Colours) - 1; ! cnt = -1; ! lines = ({}); ! foreach(group in ({ adms, cres, newbies, norms, hms, avatars }) ) { ! int i; ! string *tmp; ! cnt++; ! if( !i = sizeof(group) ) continue; ! tmp = ({ capitalize(consolidate(i, Position[cnt])) + ":" }); ! while(i--) tmp += ({ AddName(group[i], colour) }); ! colour--; ! lines = tmp + ({ "" }) + lines; } ! lines = ({ "%^BOLD%^%^BLUE%^" + center(mud_name(), screen), ! center("There are " + x + " members of our reality!", screen), ! "%^RESET%^" }) + lines; ! this_player()->eventPage(lines, "info"); return 1; } ! --- 1,58 ---- + /* Hiccups@Frontiers, 12/16/96 */ + /* Fixes by Haderach, 05 SEP 2005 */ + #include <lib.h> + #include <privs.h> #include <config.h> ! inherit LIB_DAEMON; ! ! #define SEP repeat_string("*=",39)+"*\n"; ! ! int cmd(string args) { ! int p; ! string x, tmp="", ret=""; ! object *obs; ! ! p = 0; ! obs=users(); ! ! for (int i=0; i<sizeof(users()); i++) { ! if(!obs[i] || !environment(obs[i])) continue; ! if(!obs[i]->GetInvis()) { ! if(archp(obs[i])) tmp+="[%^BLUE%^ARCH%^RESET%^]"; ! else if(creatorp(obs[i]) ) tmp+="[%^CYAN%^WIZ%^RESET%^]"; ! else if(avatarp(obs[i]) ) tmp+="[%^GREEN%^AVATAR%^RESET%^]"; ! else if(high_mortalp(obs[i]) ) tmp+="[%^GREEN%^HIGH MORTAL%^RESET%^]"; ! else tmp+=sprintf("[%d]", obs[i]->GetLevel() ); ! if(elderp(obs[i])) tmp+=" [%^YELLOW%^ELDER%^RESET%^]"; ! if(ambassadorp(obs[i])) tmp+=" [%^YELLOW%^AMBASSADOR%^RESET%^]"; ! if(sizeof(obs[i]->GetShort()) < 50) { ! tmp+=sprintf(" %s", obs[i]->GetShort()); ! } ! else { ! tmp+=" "+capitalize(obs[i]->GetKeyName())+ " the Long-Titled."; ! } ! if(obs[i]->GetSleeping() > 0) tmp+=" (%^YELLOW%^sleeping%^RESET%^) "; ! else if (obs[i]->GetProperty("afk")) tmp+=" (%^YELLOW%^afk%^RESET%^)"; ! else if (query_idle(obs[i])>240 && obs[i]->GetInCombat()!=1) tmp+=" (%^YELLOW%^idle%^RESET%^)"; ! else if (in_edit(obs[i])) tmp+=" (%^RED%^edit%^RESET%^)"; ! else if(obs[i]->GetInCombat()) tmp+=" (%^RED%^combat%^RESET%^)"; ! tmp+="\n"; ! p++; ! } } ! ret+=center(mud_name()); ! ret+=SEP; ! ret+=tmp; ! ret+=SEP; ! x="There "; ! (p==1) ? x+="is " : x+="are "; ! x+=cardinal(p); ! (p==1) ? x+=" member " : x+=" members "; ! x+="of our reality.\n"; ! ret+=center(x); ! this_player()->eventPrint(""+ret+""); return 1; } ! diff -c -r --new-file ds1.1/lib/cmds/players/wimpy.c ds2.0r27/lib/cmds/players/wimpy.c *** ds1.1/lib/cmds/players/wimpy.c Sun Feb 1 21:29:54 1998 --- ds2.0r27/lib/cmds/players/wimpy.c Wed Jul 5 00:01:03 2006 *************** *** 18,26 **** percentage = (int)this_player()->GetWimpy(); cmd = (string)this_player()->GetWimpyCommand(); if( !percentage ) ! this_player()->eventPrint("You have wimpy turned off.", MSG_SYSTEM); else this_player()->eventPrint("Percentage: " + percentage + "%\n" ! "Command: " + cmd, MSG_SYSTEM); return 1; } if( args == "0" ) { --- 18,26 ---- percentage = (int)this_player()->GetWimpy(); cmd = (string)this_player()->GetWimpyCommand(); if( !percentage ) ! this_player()->eventPrint("You have wimpy turned off.", MSG_SYSTEM); else this_player()->eventPrint("Percentage: " + percentage + "%\n" ! "Command: " + cmd, MSG_SYSTEM); return 1; } if( args == "0" ) { *************** *** 44,62 **** if( !percentage ) { this_player()->SetWimpy(0); this_player()->eventPrint("Wimpy is now off! You are so brave!", ! MSG_SYSTEM); return 1; } if( percentage > 30 ) { this_player()->eventPrint("You may not set wimpy greater than " ! "30%.", MSG_SYSTEM); return 1; } else if( percentage < 1 ) return "That is not a valid percentage!"; this_player()->SetWimpy(percentage); if( percentage > 20 ) { this_player()->eventPrint("What a weenie! Get some backbone!", ! MSG_SYSTEM); return 1; } else if( percentage > 10 ) { --- 44,62 ---- if( !percentage ) { this_player()->SetWimpy(0); this_player()->eventPrint("Wimpy is now off! You are so brave!", ! MSG_SYSTEM); return 1; } if( percentage > 30 ) { this_player()->eventPrint("You may not set wimpy greater than " ! "30%.", MSG_SYSTEM); return 1; } else if( percentage < 1 ) return "That is not a valid percentage!"; this_player()->SetWimpy(percentage); if( percentage > 20 ) { this_player()->eventPrint("What a weenie! Get some backbone!", ! MSG_SYSTEM); return 1; } else if( percentage > 10 ) { *************** *** 65,108 **** } else { this_player()->eventPrint("You are brave, but not foolish!", ! MSG_SYSTEM); return 1; } } this_player()->SetWimpyCommand(cmd); this_player()->eventPrint("You will execute the command: \"" + cmd + ! "\" next time you wimpy.", MSG_SYSTEM); return 1; } string GetHelp(string str) { return ("Syntax: <wimpy>\n" ! " <wimpy on>\n" ! " <wimpy off>\n" ! " <wimpy PERCENTAGE>\n" ! " <wimpy COMMAND>\n\n" ! "Wimpy is a system that allows you to automatically execute " ! "a command when your health points get below a certain percentage " ! "of your maximum health points. The wimpy command allows you " ! "to set which command will be used at which percentage. " ! "The \"on\" and \"off\" arguments are simply quick ways to " ! "set the percentage to 23% and 0% respectively. You cannot " ! "Set yourself to wimpy at anything greater than 30%.\n" ! "If you set go and enter commands, for example:\n" ! "\tgo west\n" ! "the wimpy system will first try to use that command, and if it " ! "fails, it will search for an exit in the room to take. If " ! "you set another command as your wimpy command, however, other " ! "than a go or enter, it will not make any attempt to execute " ! "some other command.\n" ! "For example, if you issued the command:\n" ! "\twimpy gate to Mystery Person\n" ! "so that \"gate to Mystery Person\" was your wimpy command, " ! "the wimpy system would try to execute that command when you " ! "wimpy and will not try any other command, even if the gate " ! "fails (too low on mp, Mystery Person is not online, etc.).\n" ! "Without any arguments, the wimpy command displays your current " ! "settings.\n\n" ! "See also: attack, status"); } --- 65,108 ---- } else { this_player()->eventPrint("You are brave, but not foolish!", ! MSG_SYSTEM); return 1; } } this_player()->SetWimpyCommand(cmd); this_player()->eventPrint("You will execute the command: \"" + cmd + ! "\" next time you wimpy.", MSG_SYSTEM); return 1; } string GetHelp(string str) { return ("Syntax: <wimpy>\n" ! " <wimpy on>\n" ! " <wimpy off>\n" ! " <wimpy PERCENTAGE>\n" ! " <wimpy COMMAND>\n\n" ! "Wimpy is a system that allows you to automatically execute " ! "a command when your health points get below a certain percentage " ! "of your maximum health points. The wimpy command allows you " ! "to set which command will be used at which percentage. " ! "The \"on\" and \"off\" arguments are simply quick ways to " ! "set the percentage to 23% and 0% respectively. You cannot " ! "Set yourself to wimpy at anything greater than 30%.\n" ! "If you set go and enter commands, for example:\n" ! "\tgo west\n" ! "the wimpy system will first try to use that command, and if it " ! "fails, it will search for an exit in the room to take. If " ! "you set another command as your wimpy command, however, other " ! "than a go or enter, it will not make any attempt to execute " ! "some other command.\n" ! "For example, if you issued the command:\n" ! "\twimpy gate to Mystery Person\n" ! "so that \"gate to Mystery Person\" was your wimpy command, " ! "the wimpy system would try to execute that command when you " ! "wimpy and will not try any other command, even if the gate " ! "fails (too low on mp, Mystery Person is not online, etc.).\n" ! "Without any arguments, the wimpy command displays your current " ! "settings.\n\n" ! "See also: attack, status"); } diff -c -r --new-file ds1.1/lib/cmds/players/xyzzy.c ds2.0r27/lib/cmds/players/xyzzy.c *** ds1.1/lib/cmds/players/xyzzy.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/cmds/players/xyzzy.c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,11 ---- + #include <lib.h> + + inherit LIB_DAEMON; + + mixed cmd(string str) { + if(!creatorp(this_player())) write("Nothing happens."); + else tell_room(environment(this_player()),"A hollow voice says: \"%^CYAN%^Fool!%^RESET%^\""); + return 1; + } + + diff -c -r --new-file ds1.1/lib/daemon/banish.c ds2.0r27/lib/daemon/banish.c *** ds1.1/lib/daemon/banish.c Sun Feb 1 21:30:00 1998 --- ds2.0r27/lib/daemon/banish.c Wed Jul 5 00:00:58 2006 *************** *** 3,21 **** * maintains information on legitimate character creation * created by Descartes of Borg 940115 */ ! #include <lib.h> #include <config.h> #include <objects.h> #include <daemons.h> #include <save.h> ! inherit LIB_DAEMON; ! string *__Names, *__Sites, *__WatchNames, *__WatchSites; string *__Allowed, *__Guests, *__IllegalSubStrings; mapping __TmpBanish; ! static private int valid_access(object ob); void register_site(string str); void temporary_register(string str, int time); --- 3,22 ---- * maintains information on legitimate character creation * created by Descartes of Borg 940115 */ ! #include <lib.h> + #include <privs.h> #include <config.h> #include <objects.h> #include <daemons.h> #include <save.h> ! inherit LIB_DAEMON; ! string *__Names, *__Sites, *__WatchNames, *__WatchSites; string *__Allowed, *__Guests, *__IllegalSubStrings; mapping __TmpBanish; ! static private int valid_access(object ob); void register_site(string str); void temporary_register(string str, int time); *************** *** 48,54 **** int valid_name(string str); int eventConnect(string nom, string ip); static private int match_ip(string ip, string *sites); ! void create() { daemon::create(); SetNoClean(1); --- 49,55 ---- int valid_name(string str); int eventConnect(string nom, string ip); static private int match_ip(string ip, string *sites); ! void create() { daemon::create(); SetNoClean(1); *************** *** 61,78 **** __IllegalSubStrings = ({}); __TmpBanish=([]); if(file_exists(SAVE_BANISH+__SAVE_EXTENSION__)) ! restore_banish(); if(!__TmpBanish) __TmpBanish = ([]); clean_temp_sites(); } ! static private int valid_access(object ob) { ! return (int)master()->valid_apply( ({ "LAW", "SUPERUSER" }) ); } ! int valid_cap_name(string cap, string nom) { int i; ! if(convert_name(cap) != nom) return 0; if((i = strlen(cap)) > MAX_USER_CAP_NAME_LENGTH) return 0; if(strsrch(cap, "'-") != -1) return 0; --- 62,79 ---- __IllegalSubStrings = ({}); __TmpBanish=([]); if(file_exists(SAVE_BANISH+__SAVE_EXTENSION__)) ! restore_banish(); if(!__TmpBanish) __TmpBanish = ([]); clean_temp_sites(); } ! static private int valid_access(object ob) { ! return (int)master()->valid_apply( ({ "ASSIST" }) ); } ! int valid_cap_name(string cap, string nom) { int i; ! if(convert_name(cap) != nom) return 0; if((i = strlen(cap)) > MAX_USER_CAP_NAME_LENGTH) return 0; if(strsrch(cap, "'-") != -1) return 0; *************** *** 85,102 **** if(strsrch(cap, " -") != -1) return 0; if(strsrch(cap, " ") != -1) return 0; if(lower_case(cap[i-1..i-1]) != nom[strlen(nom)-1..strlen(nom)-1]) ! return 0; return 1; } ! void register_site(string str) { if(!valid_access(previous_object())) return; if(member_array(str, keys(__TmpBanish))!=-1) ! map_delete(__TmpBanish,str); __Sites = distinct_array(__Sites + ({ str }) ); save_banish(); } ! void temporary_register(string str, int foo) { if(!valid_access(previous_object())) return; foo+=time(); --- 86,103 ---- if(strsrch(cap, " -") != -1) return 0; if(strsrch(cap, " ") != -1) return 0; if(lower_case(cap[i-1..i-1]) != nom[strlen(nom)-1..strlen(nom)-1]) ! return 0; return 1; } ! void register_site(string str) { if(!valid_access(previous_object())) return; if(member_array(str, keys(__TmpBanish))!=-1) ! map_delete(__TmpBanish,str); __Sites = distinct_array(__Sites + ({ str }) ); save_banish(); } ! void temporary_register(string str, int foo) { if(!valid_access(previous_object())) return; foo+=time(); *************** *** 104,280 **** __Sites = distinct_array(__Sites + ({str})); save_banish(); } ! string query_temp_site_info() { string info, *site; int i; if(!valid_access(previous_object())) return ""; for(i=0,info="";i<sizeof(site=keys(__TmpBanish));i++) ! info+= site[i]+" will expire at "+ctime(__TmpBanish[site[i]])+".\n"; if(!info) info = "No sites are on temporary registration."; return info; } ! void manual_temp_unregister(string str) { ! string *sites; ! if(!valid_access(previous_object())) return; if(member_array(str, keys(__TmpBanish))==-1) return; map_delete(__TmpBanish,str); __Sites -= ({str}); save_banish(); } ! void clean_temp_sites() { int *times,i; string *sites; ! ! times=values(__TmpBanish); sites=keys(__TmpBanish); ! for(i=0;i<sizeof(times);i++) { ! if(times[i]<time()) { ! map_delete(__TmpBanish,sites[i]); ! __Sites -= ({sites[i]}); ! } } save_banish(); call_out("clean_temp_sites", 900); } ! void unregister_site(string str) { if(!valid_access(previous_object())) return; __Sites -= ({ str }); save_banish(); } ! string *query_registered() { if(!valid_access(previous_object())) return ({}); return __Sites; } ! void banish_name(string str) { ! unguarded( (: log_file, "banish", ! (string)this_player()->GetName() + " banished " + str + "." :) ); __Names = distinct_array(__Names + ({ lower_case(str) })); save_banish(); } ! void unbanish_name(string str) { if(!valid_access(previous_object())) return; __Names -= ({ lower_case(str) }); save_banish(); } ! string *query_banished() { if(!valid_access(previous_object())) return ({}); return __Names; } ! void watch_site(string str) { if(!valid_access(previous_object())) return; __WatchSites = distinct_array(__WatchSites + ({ str })); save_banish(); } ! void unwatch_site(string str) { if(!valid_access(previous_object())) return; __WatchSites -= ({ str }); save_banish(); } ! string *query_watched_sites() { if(!valid_access(previous_object())) return ({}); return __WatchSites; } ! void watch_name(string str) { if(!valid_access(previous_object())) return; __WatchNames = distinct_array(__WatchNames + ({ lower_case(str) })); save_banish(); } ! void unwatch_name(string str) { if(!valid_access(previous_object())) return; __WatchNames -= ({ lower_case(str) }); save_banish(); } ! string *query_watched_names() { if(!valid_access(previous_object())) return ({}); return __WatchNames; } ! void allow_name(string str) { if(!valid_access(previous_object())) return; __Allowed = distinct_array(__Allowed + ({ lower_case(str) })); save_banish(); } ! void unallow_name(string str) { if(!valid_access(previous_object())) return; __Allowed -= ({ lower_case(str) }); save_banish(); } ! string *query_allowed() { if(!valid_access(previous_object())) return ({}); return __Allowed; } ! void set_illegal_substring(string str) { if(!valid_access(previous_object())) return; __IllegalSubStrings = distinct_array(__IllegalSubStrings + ({ lower_case(str) })); save_banish(); } ! void remove_illegal_substring(string str) { if(!valid_access(previous_object())) return; __IllegalSubStrings -= ({ lower_case(str) }); save_banish(); } ! string *query_illegal_substrings() { if(!valid_access(previous_object())) return ({}); else return __IllegalSubStrings; } ! void add_guest(string str) { if(!valid_access(previous_object())) return; __Guests = distinct_array(__Guests + ({ lower_case(str) })); save_banish(); } ! void remove_guest(string str) { if(!valid_access(previous_object())) return; __Guests -= ({ lower_case(str) }); save_banish(); } ! string *query_guests() { if(!valid_access(previous_object())) return ({}); else return __Guests; } ! static private void save_banish() { save_object(SAVE_BANISH); } ! static private void restore_banish() { restore_object(SAVE_BANISH); } ! int GetGuest(string str) { if(base_name(previous_object()) != LIB_CONNECT ) return 0; else return (member_array(lower_case(str), __Guests) != -1); } ! int valid_name(string str) { int i, x; ! if(base_name(previous_object()) != LIB_CONNECT ) return 0; if(member_array(str, __Names) != -1) return 0; i = sizeof(__IllegalSubStrings); --- 105,281 ---- __Sites = distinct_array(__Sites + ({str})); save_banish(); } ! string query_temp_site_info() { string info, *site; int i; if(!valid_access(previous_object())) return ""; for(i=0,info="";i<sizeof(site=keys(__TmpBanish));i++) ! info+= site[i]+" will expire at "+ctime(__TmpBanish[site[i]])+".\n"; if(!info) info = "No sites are on temporary registration."; return info; } ! void manual_temp_unregister(string str) { ! if(!valid_access(previous_object())) return; if(member_array(str, keys(__TmpBanish))==-1) return; map_delete(__TmpBanish,str); __Sites -= ({str}); save_banish(); } ! void clean_temp_sites() { int *times,i; string *sites; ! ! times=values(__TmpBanish); sites=keys(__TmpBanish); ! for(i=0;i<sizeof(times);i++) { ! if(times[i]<time()) { ! map_delete(__TmpBanish,sites[i]); ! __Sites -= ({sites[i]}); ! } } save_banish(); call_out("clean_temp_sites", 900); } ! void unregister_site(string str) { if(!valid_access(previous_object())) return; __Sites -= ({ str }); save_banish(); } ! string *query_registered() { if(!valid_access(previous_object())) return ({}); return __Sites; } ! void banish_name(string str) { ! if(!valid_access(previous_object())) return; ! unguarded( (: log_file, "banish", ! (string)this_player()->GetName() + " banished " + str + "." :) ); __Names = distinct_array(__Names + ({ lower_case(str) })); save_banish(); } ! void unbanish_name(string str) { if(!valid_access(previous_object())) return; __Names -= ({ lower_case(str) }); save_banish(); } ! string *query_banished() { if(!valid_access(previous_object())) return ({}); return __Names; } ! void watch_site(string str) { if(!valid_access(previous_object())) return; __WatchSites = distinct_array(__WatchSites + ({ str })); save_banish(); } ! void unwatch_site(string str) { if(!valid_access(previous_object())) return; __WatchSites -= ({ str }); save_banish(); } ! string *query_watched_sites() { if(!valid_access(previous_object())) return ({}); return __WatchSites; } ! void watch_name(string str) { if(!valid_access(previous_object())) return; __WatchNames = distinct_array(__WatchNames + ({ lower_case(str) })); save_banish(); } ! void unwatch_name(string str) { if(!valid_access(previous_object())) return; __WatchNames -= ({ lower_case(str) }); save_banish(); } ! string *query_watched_names() { if(!valid_access(previous_object())) return ({}); return __WatchNames; } ! void allow_name(string str) { if(!valid_access(previous_object())) return; __Allowed = distinct_array(__Allowed + ({ lower_case(str) })); save_banish(); } ! void unallow_name(string str) { if(!valid_access(previous_object())) return; __Allowed -= ({ lower_case(str) }); save_banish(); } ! string *query_allowed() { if(!valid_access(previous_object())) return ({}); return __Allowed; } ! void set_illegal_substring(string str) { if(!valid_access(previous_object())) return; __IllegalSubStrings = distinct_array(__IllegalSubStrings + ({ lower_case(str) })); save_banish(); } ! void remove_illegal_substring(string str) { if(!valid_access(previous_object())) return; __IllegalSubStrings -= ({ lower_case(str) }); save_banish(); } ! string *query_illegal_substrings() { if(!valid_access(previous_object())) return ({}); else return __IllegalSubStrings; } ! void add_guest(string str) { if(!valid_access(previous_object())) return; __Guests = distinct_array(__Guests + ({ lower_case(str) })); save_banish(); } ! void remove_guest(string str) { if(!valid_access(previous_object())) return; __Guests -= ({ lower_case(str) }); save_banish(); } ! string *query_guests() { if(!valid_access(previous_object())) return ({}); else return __Guests; } ! static private void save_banish() { save_object(SAVE_BANISH); } ! static private void restore_banish() { restore_object(SAVE_BANISH); } ! int GetGuest(string str) { if(base_name(previous_object()) != LIB_CONNECT ) return 0; else return (member_array(lower_case(str), __Guests) != -1); } ! int valid_name(string str) { int i, x; ! if(base_name(previous_object()) != LIB_CONNECT ) return 0; if(member_array(str, __Names) != -1) return 0; i = sizeof(__IllegalSubStrings); *************** *** 282,333 **** if((x = strlen(str)) > MAX_USER_NAME_LENGTH) return 0; if(x < MIN_USER_NAME_LENGTH) return 0; for(i=0; i<x; i++) ! if(str[i] < 'a' || str[i] > 'z') return 0; return 1; } ! int eventConnect(string nom, string ip) { if(base_name(previous_object()) != LIB_CONNECT ) return 0; if(member_array(nom, __WatchNames) != -1) { ! log_file("watch/names", sprintf("%s from %s at %s\n", nom, ip, ! ctime(time()))); } if(match_ip(ip, __WatchSites)) { ! log_file("watch/"+ip, sprintf("%s at %s\n", nom, ctime(time()))); } if(member_array(nom, __Allowed) != -1) { ! log_file("watch/allowed", sprintf("%s from %s at %s\n", nom, ip, ! ctime(time()))); ! __Allowed -= ({ nom }); ! save_banish(); ! return 1; } if(match_ip(ip, __Sites)) { ! if(user_exists(nom)) { ! log_file("watch/"+ip, sprintf("%s allowed in from %s at %s\n", ! nom, ip, ! ctime(time()))); ! return 1; ! } ! else { ! log_file("watch/"+ip, sprintf("%s failed from %s at %s\n" ! , nom, ! ip, ! ctime(time()))); ! return 0; ! } } return 1; } ! static private int match_ip(string ip, string *sites) { foreach(string site in sites) { ! int i; if( site == ip ) return 1; i = strsrch(site, "*"); if( i > 0 ) { ! if( ip[0..(i-1)] == site[0..(i-1)] ) return 1; } } return 0; --- 283,334 ---- if((x = strlen(str)) > MAX_USER_NAME_LENGTH) return 0; if(x < MIN_USER_NAME_LENGTH) return 0; for(i=0; i<x; i++) ! if(str[i] < 'a' || str[i] > 'z') return 0; return 1; } ! int eventConnect(string nom, string ip) { if(base_name(previous_object()) != LIB_CONNECT ) return 0; if(member_array(nom, __WatchNames) != -1) { ! log_file("watch/names", sprintf("%s from %s at %s\n", nom, ip, ! ctime(time()))); } if(match_ip(ip, __WatchSites)) { ! log_file("watch/"+ip, sprintf("%s at %s\n", nom, ctime(time()))); } if(member_array(nom, __Allowed) != -1) { ! log_file("watch/allowed", sprintf("%s from %s at %s\n", nom, ip, ! ctime(time()))); ! __Allowed -= ({ nom }); ! save_banish(); ! return 1; } if(match_ip(ip, __Sites)) { ! if(user_exists(nom)) { ! log_file("watch/"+ip, sprintf("%s allowed in from %s at %s\n", ! nom, ip, ! ctime(time()))); ! return 1; ! } ! else { ! log_file("watch/"+ip, sprintf("%s failed from %s at %s\n" ! , nom, ! ip, ! ctime(time()))); ! return 0; ! } } return 1; } ! static private int match_ip(string ip, string *sites) { foreach(string site in sites) { ! int i; if( site == ip ) return 1; i = strsrch(site, "*"); if( i > 0 ) { ! if( ip[0..(i-1)] == site[0..(i-1)] ) return 1; } } return 0; diff -c -r --new-file ds1.1/lib/daemon/bugs.c ds2.0r27/lib/daemon/bugs.c *** ds1.1/lib/daemon/bugs.c Sun Feb 1 21:30:00 1998 --- ds2.0r27/lib/daemon/bugs.c Wed Jul 5 00:00:58 2006 *************** *** 22,28 **** daemon::create(); if( file_size(SAVE_BUGS __SAVE_EXTENSION__) > 0 ) ! unguarded( (: restore_object, SAVE_BUGS :)); if( NextID < 1 || !Bugs ) { NextID = 1; Bugs = ([]); --- 22,28 ---- daemon::create(); if( file_size(SAVE_BUGS __SAVE_EXTENSION__) > 0 ) ! unguarded( (: restore_object, SAVE_BUGS :)); if( NextID < 1 || !Bugs ) { NextID = 1; Bugs = ([]); *************** *** 31,40 **** foreach(bug_id, bug in Bugs) { if( !bug["date assigned"] ) continue; if( t - bug["date assigned"] > UNCOMPLETED_LIFE ) ! map_delete(Bugs, bug_id); else if( bug["date assigned"] && bug["date fixed"] ) { if( t - bug["date fixed"] > COMPLETED_LIFE ) ! map_delete(Bugs, bug_id); } } unguarded( (: save_object, SAVE_BUGS :)); --- 31,40 ---- foreach(bug_id, bug in Bugs) { if( !bug["date assigned"] ) continue; if( t - bug["date assigned"] > UNCOMPLETED_LIFE ) ! map_delete(Bugs, bug_id); else if( bug["date assigned"] && bug["date fixed"] ) { if( t - bug["date fixed"] > COMPLETED_LIFE ) ! map_delete(Bugs, bug_id); } } unguarded( (: save_object, SAVE_BUGS :)); *************** *** 79,85 **** x = NextID++; Bugs[x] = ([ "who" : who, "type" : type, "bug" : bug, "data" : data, ! "assigned" : 0, "date fixed" : 0, "resolution" : 0 ]); if( unguarded( (: save_object, SAVE_BUGS :) ) ) return x; else { map_delete(Bugs, x); --- 79,85 ---- x = NextID++; Bugs[x] = ([ "who" : who, "type" : type, "bug" : bug, "data" : data, ! "assigned" : 0, "date fixed" : 0, "resolution" : 0 ]); if( unguarded( (: save_object, SAVE_BUGS :) ) ) return x; else { map_delete(Bugs, x); *************** *** 92,99 **** int id, x = 0; foreach( id, rep in Bugs) ! if( rep["assigned"] && !rep["date fixed"] && ! (convert_name(rep["assigned"]) == who) ) x++; return x; } --- 92,99 ---- int id, x = 0; foreach( id, rep in Bugs) ! if( rep["assigned"] && !rep["date fixed"] && ! (convert_name(rep["assigned"]) == who) ) x++; return x; } diff -c -r --new-file ds1.1/lib/daemon/chat.c ds2.0r27/lib/daemon/chat.c *** ds1.1/lib/daemon/chat.c Sun Feb 1 21:29:57 1998 --- ds2.0r27/lib/daemon/chat.c Wed Dec 31 19:00:00 1969 *************** *** 1,378 **** - /* /daemon/chat.c - * from the Dead Souls 3.2 Mudlib - * daemon to handle all mud chat channels - * created by Descartes of Borg 931220 - */ - - #include <lib.h> - #include <pov.h> - #include <daemons.h> - #include <origin.h> - #include <message_class.h> - #include "include/chat.h" - - inherit LIB_DAEMON; - - static private mapping Channels; - - static void create() { - object pl; - - daemon::create(); - SetNoClean(1); - Channels = ([]); - foreach(pl in users()) { - string *chans; - string channel; - - if( !(chans = (string *)pl->GetChannels()) ) continue; - foreach(channel in chans) { - if( !Channels[channel] ) Channels[channel] = ({}); - Channels[channel] = distinct_array(Channels[channel] + ({ pl })); - } - } - } - - string *eventRegisterMember(string *chans) { - string *tmp; - object ob; - string channel; - - if( !living(ob = previous_object()) ) return ({}); - tmp = ({}); - foreach(channel in chans) { - /* just check out for secure channels */ - switch(channel) { - case "admin": - if( !archp(ob) ) break; - case "cre": case "intercre": case "gossip": case "intergossip": - if( !creatorp(ob) ) break; - default: - if( !Channels[channel]) Channels[channel] = ({}); - Channels[channel] = distinct_array(Channels[channel] + ({ ob })); - tmp += ({ channel }); - } - } - return tmp; - } - - string *eventRemoveMember(string *chans) { - object ob; - string channel; - - if( !living(ob = previous_object()) ) return({}); - foreach(channel in chans) { - if( !Channels[channel] ) continue; - else Channels[channel] -= ({ ob }); - if( !sizeof(Channels[channel]) ) map_delete(Channels, channel); - } - return chans; - } - - int cmdChannel(string verb, string str) { - string msg, name, rc, target, targetkey, target_msg; - object ob = 0; - int emote; - - if( verb == "list" ) { - string *who; - string ch, mud; - - if( !str ) return 0; - if( sscanf(str, "%s@%s", ch, mud) == 2 ) { - if( !Channels[ch] ) return 0; - if( member_array(this_player(), Channels[ch]) == -1 ) return 0; - if( ch == (ch = GetRemoteChannel(ch)) ) return 0; - if( !(mud = (string)INTERMUD_D->GetMudName(mud)) ) { - this_player()->eventPrint(mud_name() + " is not aware of " - "such a place.", MSG_ERROR); - return 1; - } - SERVICES_D->eventSendChannelWhoRequest(ch, mud); - this_player()->eventPrint("Remote listing request sent.", - MSG_SYSTEM); - return 1; - } - else ch = str; - if( !Channels[ch] ) return 0; - if( member_array(this_player(), Channels[str]) == -1 ) return 0; - who = GetChannelList(str); - msg = "Online: " + implode(who, " "); - this_player()->eventPrint(msg, MSG_SYSTEM); - return 1; - } - if( !Channels[verb] ) { - if( sscanf(verb, "%semote", verb) ) { - string emote_cmd, remains; - mixed array msg_data; - int i; - - if( !Channels[verb] ) { - return 0; - } - rc = GetRemoteChannel(verb); - sscanf(str, "%s %s", emote_cmd, remains); - if( !emote_cmd ) { - emote_cmd = str; - remains = 0; - } - if( !remains ) { - msg_data = SOUL_D->GetChannelEmote(emote_cmd, ""); - if( !msg_data ) { - str = "$N " + str; - } - } - else { - if( ob = find_living(target = convert_name(remains)) ) { - msg_data = SOUL_D->GetChannelEmote(emote_cmd, "LIV"); - if( !msg_data ) { - str = "$N " + str; - target = 0; - } - } - else if( strsrch(target, "@") == -1 || rc == verb ) { - string array words = explode(remains, " "); - - target = ""; - for(i=0; i<sizeof(words); i++) { - target += lower_case(words[i]); - if( ob = find_living(target) ) { - if( i < sizeof(words)-1 ) { - remains = implode(words[(i+1)..], " "); - } - else { - remains = 0; - } - msg_data = SOUL_D->GetChannelEmote(emote_cmd, - "LIV STR", - remains); - break; - } - } - if( !ob ) { - msg_data = SOUL_D->GetChannelEmote(emote_cmd, "STR", - remains); - target = 0; - } - if( !msg_data ) { - str = "$N " + str; - target = 0; - } - } - else if( rc != verb ) { - string array words; - - i = strsrch(remains, "@", -1); - if( i >= strlen(remains)-1 ) { - msg_data = SOUL_D->GetChannelEmote(emote_cmd, "STR", - remains); - target = 0; - } - else { - string mud; - int test = 3; - - words = explode(remains[(i+1)..], " "); - target = remains[0..i]; - remains = ""; - while(sizeof(words)) { - mud = implode(words, " "); - mud = INTERMUD_D->GetMudName(lower_case(mud)); - if( mud ) { - target += mud; - break; - } - if( remains == "" ) { - remains = words[<1]; - } - else { - remains = words[<1] + " " + remains; - } - words = words[0..<2]; - } - if( !mud ) { - msg_data = SOUL_D->GetChannelEmote(emote_cmd, - "STR", remains); - target = 0; - } - else { - if( trim(remains) == "" ) { - msg_data = SOUL_D->GetChannelEmote(emote_cmd, - "LIV"); - } - else { - msg_data = SOUL_D->GetChannelEmote(emote_cmd, - "LIV STR", - remains); - } - if( !msg_data ) { - str = "$N " + str; - target = 0; - } - } - } - } - } - if( msg_data ) { - string sgen = this_player()->GetGender(); - string tgen = 0; - - if( ob ) { - target = ob->GetName(); - tgen = ob->GetGender(); - } - else if( target ) { - string user, mud; - - sscanf(target, "%s@%s", user, mud); - targetkey = target; - tgen = SERVICES_D->GetRemoteGender(user, mud); - target = SERVICES_D->GetRemoteDisplayName(user, mud); - if( !target ) { - target = capitalize(targetkey); - } - } - str = create_message(POV_OBSERVER, msg_data[0][0], - msg_data[0][1], "$N", sgen, "$O", tgen, - msg_data[1]); - if( target ) { - target_msg = create_message(POV_TARGET, msg_data[0][0], - msg_data[0][1], "$N", sgen, - "$O", tgen, msg_data[1]); - } - } - emote = 1; - } - else { - return 0; - } - } - else { - rc = GetRemoteChannel(verb); - } - if( member_array(this_player(), Channels[verb]) == -1 ) return 0; - if( !str || str == "" ) { - this_player()->SetBlocked(verb); - return 1; - } - if( (int)this_player()->GetBlocked(verb) ) { - if( (int)this_player()->GetBlocked("all") ) { - this_player()->eventPrint("You cannot chat while totally blocked.", - MSG_ERROR); - return 1; - } - this_player()->SetBlocked(verb); - } - if( verb == "admin" || verb=="cre" ) { - if( !(name = (string)this_player()->GetCapName()) ) - name = capitalize((string)this_player()->GetKeyName()); - } - else name = (string)this_player()->GetName(); - if( target_msg ) { - target_msg = replace_string(target_msg, "$O's", "your"); - } - eventSendChannel(name, verb, str, emote, target, target_msg); - if( rc != verb ) { - if( ob ) { - SERVICES_D->eventSendChannel(name, rc, str, emote, target, - target_msg); - } - else { - SERVICES_D->eventSendChannel(name, rc, str, emote, targetkey, - target_msg); - } - } - return 1; - } - - varargs void eventSendChannel(string who, string ch, string msg, int emote, - string target, string targmsg) { - if( file_name(previous_object()) == SERVICES_D) { - ch = GetLocalChannel(ch); - if( emote ) msg = replace_string(msg, "$N", who); - } - else if( origin() != ORIGIN_LOCAL && previous_object() != master() && - file_name(previous_object()) != PARTY_D ) return; - if( !Channels[ch] ) return; - if( emote ) { - object *obs; - object ob; - string this_msg, tmp; - int len; - - if( target && (ob = find_player(convert_name(target))) ) { - target = (string)ob->GetName(); - } - this_msg = "%^MAGENTA%^<" + ch + ">%^RESET%^ "; - msg = replace_string(msg, "$N", who); - if( target ) { - msg = replace_string(msg, "$O", target); - targmsg = replace_string(targmsg, "$N", who); - targmsg = capitalize(replace_string(targmsg, "$O", "you")); - } - obs = filter(Channels[ch], (: $1 && !((int)$1->GetBlocked($(ch))) :)); - tmp = this_msg + msg; - foreach(object listener in obs) { - if( listener == ob ) continue; - listener->eventPrint(tmp, MSG_CONV); - } - if( member_array(ob, obs) != -1 ) { - if( ob && !((int)ob->GetBlocked(ch)) ) { - tmp = this_msg + targmsg; - ob->eventPrint(tmp, MSG_CONV); - } - } - } - else { - object *obs; - - msg = who + " %^MAGENTA%^<" + ch + ">%^RESET%^ " + msg; - obs = filter(Channels[ch], (: $1 && !((int)$1->GetBlocked($(ch))) :)); - obs->eventPrint(msg, MSG_CONV); - } - } - - string *GetChannelList(string ch) { - string *ret; - object who; - string list; - int i; - - if( file_name(previous_object()) == SERVICES_D ) ch = GetLocalChannel(ch); - else if( origin() != ORIGIN_LOCAL ) return ({}); - if( !Channels[ch] ) return ({}); - ret = ({}); - foreach(who in Channels[ch]) { - if( !who || (int)who->GetInvis() || (int)who->GetBlocked(ch) ) - continue; - ret += ({ (string)who->GetName() }); - } - return ret; - } - - string GetLocalChannel(string ch) { - switch(ch) { - case "imud_code": - return "intercre"; - - case "imud_gossip": - return "intergossip"; - } - return ch; - } - - string GetRemoteChannel(string ch) { - switch(ch) { - case "intercre": - return "imud_code"; - - case "intergossip": - return "imud_gossip"; - - case "foundation": - return "ie_flibcode"; - } - return ch; - } - - string *GetChannels() { return copy(keys(Channels)); } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/classes.c ds2.0r27/lib/daemon/classes.c *** ds1.1/lib/daemon/classes.c Sun Feb 1 21:29:54 1998 --- ds2.0r27/lib/daemon/classes.c Wed Jul 5 00:00:58 2006 *************** *** 44,159 **** class Class cls; string array lines, tmp; string class_name; ! validate(); if( !file_exists(file) ) error("No such file: " + file); lines = explode(read_file(file), "\n"); lines = filter(lines, function(string str) { ! if( strlen(str) == 0 ) { ! return 0; ! } ! if( str[0] == '#' ) { ! return 0; ! } ! if( str[0] == ' ' || str[0] == '\t' ) { ! return 0; ! } ! return 1; ! }); ! class_name = lines[0]; ! if( Classes[class_name] ) error("Class already exists"); ! cls = new(class Class); ! Classes[class_name] = cls; ! lines = lines[1..]; ! cls->Multis = ([]); ! while( sizeof(tmp = explode(lines[0], ":")) == 2 ) { ! cls->Multis[tmp[0]] = tmp[1]; ! lines = lines[1..]; } ! cls->Skills = ([]); ! while(sizeof(tmp = explode(lines[0], ":")) == 3) { ! class Skill s = new (class Skill); ! ! s->Average = to_int(tmp[1]); ! s->SkillClass = to_int(tmp[2]); ! cls->Skills[tmp[0]] = s; ! if( sizeof(lines) == 1 ) { ! lines = ({}); ! break; ! } ! else { ! lines = lines[1..]; } } - cls->Complete = 1; - save_object(SAVE_CLASSES); - } ! void RemoveClass(string class_name) { ! validate(); ! map_delete(Classes, class_name); ! save_object(SAVE_CLASSES); ! } ! ! void SetClass(string class_name, mixed array args) { ! class Class cls = Classes[class_name]; ! mixed array primes, ots; ! ! if( !cls || !cls->Complete || sizeof(args) != 3 ) return; ! args[0] = cls->Multis; ! primes = ({}); ! ots = ({}); ! foreach(string key, class Skill skill in cls->Skills) { ! if( skill->SkillClass == 1 ) { ! primes = ({ primes..., ({ key, skill->Average, 1 }) }); ! } ! else { ! ots = ({ ots..., ({ key, skill->Average, skill->SkillClass }) }); ! } } ! args[1] = primes; ! args[2] = ots; ! } ! ! void SetComplete(string class_name) { ! class Class cls; ! ! validate(); ! if( !Classes[class_name] ) error("No such class"); ! else cls = Classes[class_name]; ! cls->Complete = 1; ! save_object(SAVE_CLASSES); ! } ! ! varargs string array GetClasses() { ! return filter(keys(Classes), (: ((class Class)Classes[$1])->Complete :)); ! } ! ! string GetHelp(string class_name) { ! class Class cls = Classes[class_name]; ! string help = "Class: " + class_name + "\n\n"; ! string tmp; ! int x; ! ! if( !cls ) return 0; ! if( !sizeof(cls->Multis) ) { ! help += capitalize(class_name) + " cannot multi-class.\n"; } ! else { ! help += capitalize(pluralize(class_name)) + " can multi-class with " + ! "the following primary classes:\n"; ! foreach(string prime, string other in cls->Multis) { ! help += "\t" + capitalize(class_name) + " + " + prime + " = " + other + "\n"; } ! } ! help += "\n" + capitalize(pluralize(class_name)) + " has the following " + "primary skills:\n"; ! foreach(string skill, class Skill s in cls->Skills) { ! if( s->SkillClass == 1 ) { ! help += "\t" + skill + "\n"; } } ! return help + "\n"; ! } ! --- 44,157 ---- class Class cls; string array lines, tmp; string class_name; ! validate(); if( !file_exists(file) ) error("No such file: " + file); lines = explode(read_file(file), "\n"); lines = filter(lines, function(string str) { ! if( strlen(str) == 0 ) { ! return 0; ! } ! if( str[0] == '#' ) { ! return 0; ! } ! if( str[0] == ' ' || str[0] == '\t' ) { ! return 0; ! } ! return 1; ! }); ! class_name = lines[0]; ! if( Classes[class_name] ) error("Class already exists"); ! cls = new(class Class); ! Classes[class_name] = cls; ! lines = lines[1..]; ! cls->Multis = ([]); ! while( sizeof(tmp = explode(lines[0], ":")) == 2 ) { ! cls->Multis[tmp[0]] = tmp[1]; ! lines = lines[1..]; ! } ! cls->Skills = ([]); ! while(sizeof(tmp = explode(lines[0], ":")) == 3) { ! class Skill s = new (class Skill); ! ! s->Average = to_int(tmp[1]); ! s->SkillClass = to_int(tmp[2]); ! cls->Skills[tmp[0]] = s; ! if( sizeof(lines) == 1 ) { ! lines = ({}); ! break; ! } ! else { ! lines = lines[1..]; ! } ! } ! cls->Complete = 1; ! save_object(SAVE_CLASSES); ! } ! ! void RemoveClass(string class_name) { ! validate(); ! map_delete(Classes, class_name); ! save_object(SAVE_CLASSES); } ! ! void SetClass(string class_name, mixed array args) { ! class Class cls = Classes[class_name]; ! mixed array primes, ots; ! ! if( !cls || !cls->Complete || sizeof(args) != 3 ) return; ! args[0] = cls->Multis; ! primes = ({}); ! ots = ({}); ! foreach(string key, class Skill skill in cls->Skills) { ! if( skill->SkillClass == 1 ) { ! primes = ({ primes..., ({ key, skill->Average, 1 }) }); ! } ! else { ! ots = ({ ots..., ({ key, skill->Average, skill->SkillClass }) }); ! } } + args[1] = primes; + args[2] = ots; } ! void SetComplete(string class_name) { ! class Class cls; ! ! validate(); ! if( !Classes[class_name] ) error("No such class"); ! else cls = Classes[class_name]; ! cls->Complete = 1; ! save_object(SAVE_CLASSES); } ! ! varargs string array GetClasses() { ! return filter(keys(Classes), (: ((class Class)Classes[$1])->Complete :)); } ! ! string GetHelp(string class_name) { ! class Class cls = Classes[class_name]; ! string help = "Class: " + class_name + "\n\n"; ! ! if( !cls ) return 0; ! if( !sizeof(cls->Multis) ) { ! help += capitalize(class_name) + " cannot multi-class.\n"; ! } ! else { ! help += capitalize(pluralize(class_name)) + " can multi-class with " + ! "the following primary classes:\n"; ! foreach(string prime, string other in cls->Multis) { ! help += "\t" + capitalize(class_name) + " + " + prime + " = " + other + "\n"; + } } ! help += "\n" + capitalize(pluralize(class_name)) + " has the following " + "primary skills:\n"; ! foreach(string skill, class Skill s in cls->Skills) { ! if( s->SkillClass == 1 ) { ! help += "\t" + skill + "\n"; ! } } + return help + "\n"; } ! diff -c -r --new-file ds1.1/lib/daemon/combat.c ds2.0r27/lib/daemon/combat.c *** ds1.1/lib/daemon/combat.c Sun Feb 1 21:30:00 1998 --- ds2.0r27/lib/daemon/combat.c Wed Dec 31 19:00:00 1969 *************** *** 1,110 **** - /* /daemon/combat.c - * From the Dead Souls V Object Library - * Single point for storing the large arrays where combat messages are - * defined. - * Created by Descartes of Borg 961117 - * Version: %A% - * Last modified: %D% - */ - - #include <lib.h> - - inherit LIB_DAEMON; - - private mixed array BLADES = ({ - // no damage - ({ ({ ({ "take" }), "$target_verb the cut from $limb without a " - "flinch." }) }), - // damage < 5 - ({ ({ ({ "prick" }), "$agent_verb $target_name lightly in the $limb with " - "$using." }), - ({ ({ "prick" }), "$agent_verb $target_name superficially in the $limb " - "with $using." }), - ({ ({ "prick" }), "just barely $agent_verb $target_name in the $limb " - "with $using." }) }), - // damage < 10 - ({ ({ ({ "prick" }), "$agent_verb $target_name decently in the $limb with " - "$using." }), - ({ ({ "prick" }), "$agent_verb $target_name annoyingly in the $limb " - "with $using." }), - ({ ({ "prick" }), "solidly $agent_verb $target_name in the $limb " - "with $using." }) }), - // damage < 15 - ({ ({ ({ "scratch" }), "$agent_verb $target_name mildly in the $limb " - "with $using."}), - ({ ({ "scratch" }), "barely $agent_verb $target_name in the $limb " - "with $using." }), - ({ ({ "scratch" }), "$agent_verb $target_name in the $limb with " - "$using." }) }), - // damage < 20 - ({ ({ ({ "scratch" }), "$agent_verb $target_name nastily in the $limb " - "with $using." }), - ({ ({ "scratch" }), "$agent_verb $target_name wickedly in the $limb " - "with $using." }) }), - // damage < 25 - ({ ({ ({ "jab" }), "$agent_verb $target_name in the $limb with $using." }), - ({ ({ "jab" }), "quickly $agent_verb $target_name in the $limb with " - "$using." }) }), - // damage < 30 - ({ ({ ({ "jab" }), "$agent_verb $target_name meanly in the $limb with " - "$using." }), - ({ ({ "jab" }), "$agent_verb $target_name solidly in the $limb with " - "$using." }) - // damage < 50 - ({ ({ ({ "cut" }), "$agent_verb $target_name pain - - - private mixed array MOVES = ({ - // baby moves - ({ ({ ({ "shake" }), "$agent_name $agent_verb oddly and " }), - ({ ({ "dance" }), "$agent_name $agent_verb and " }), - ({ ({ "shout" }), "$agent_name $agent_verb profanities and " }), - ({ ({ "sidestep" }), "$agent_name $agent_verb weakly and " }), - ({ ({ "blow" }), "$agent_name $agent_verb snot and " }), - ({ ({ "swing" }), "$agent_name $agent_verb blindly and " }), - ({ ({ "bellow" }), "$agent_name $agent_verb loudly and " }), - ({ ({ "see" }), "$agent_name $agent_verb an opening and " }), - ({ ({ "stumble" }), "$agent_name $agent_verb fortuitously and " }) }), - // better moves - ({ ({ ({ "grunt" }), "$agent_name $agent_verb angrily and " }), - ({ ({ "scream" }), "$agent_name $agent_verb \"Die!\", and " }), - ({ ({ "spit", "blow" }), "$agent_name $agent_verb, $agent_verb, and "}), - ({ ({ "slobber" }), "$agent_name $agent_verb evilly and " }), - ({ ({ "duck" }), "$agent_name $agent_verb and " }), - ({ ({ "rant" }), "$agent_name $agent_verb, \"Aaaarrrrggghhh!\" and " }), - ({ ({"glare"}), "$agent_name $agent_verb at $target_name evilly and "}), - ({ ({ "growl" }), "$agent_name $agent_verb menacingly and " }) }), - // awesome moves - ({ ({ ({ "rally" }), "$agent_name $agent_verb with determination and " }), - ({ ({ "lunge" }), "$agent_name $agent_verb quickly and " }), - ({ ({ "twirl" }), "$agent_name $agent_verb with finesse and " }), - ({ ({ "execute" }), "$agent_name $agent_verb a diving roll and " }), - ({ ({ "go" }), "$agent_name $agent_verb completely berserk and " }), - ({ ({ "whirl" }), "$agent_name $agent_verb blurringly and " }) }) }); - - mixed array GetMessages(string type) { - switch(type) { - case "blade": return BLADES; - case "blunt": return BLUNTS; - case "knife": return KNIVES; - case "projectile": return PROJECTILES; - default: return BLUNTS; - } - } - - mixed array GetMove(int amt) { - if( amt < 2 ) { - return 0; - } - amt = random(amt); - if( amt < 4 ) { - list = MOVES[0]; - } - else if( amt < 7 ) { - list = MOVES[1]; - } - else { - list = MOVES[2]; - } - return list[random(sizeof(list))]; - } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/command.c ds2.0r27/lib/daemon/command.c *** ds1.1/lib/daemon/command.c Sun Feb 1 21:30:01 1998 --- ds2.0r27/lib/daemon/command.c Wed Jul 5 00:00:58 2006 *************** *** 19,25 **** Commands = ([]); Paths = ({}); eventRehash( ({ DIR_PLAYER_CMDS, DIR_CREATOR_CMDS, ! DIR_SECURE_CREATOR_CMDS }) ); } void eventRehash(mixed paths) { --- 19,26 ---- Commands = ([]); Paths = ({}); eventRehash( ({ DIR_PLAYER_CMDS, DIR_CREATOR_CMDS, ! DIR_SECURE_PLAYER_CMDS, DIR_SECURE_CREATOR_CMDS, ! DIR_ADMIN_CMDS, DIR_SECURE_ADMIN_CMDS }) ); } void eventRehash(mixed paths) { *************** *** 38,44 **** if( pointerp(Commands[cmd]) ) Commands[cmd] += ({ path }); else Commands[cmd] = ({ path }); } ! Paths = distinct_array(Paths + ({ path })); } } --- 39,45 ---- if( pointerp(Commands[cmd]) ) Commands[cmd] += ({ path }); else Commands[cmd] = ({ path }); } ! Paths = singular_array( distinct_array(Paths + ({ path })) ); } } *************** *** 46,57 **** string *tmp; if( Commands[cmd] && sizeof(tmp = (path & (string *)Commands[cmd])) ) ! return sprintf("%s/%s", tmp[0], cmd); else { ! tmp = (path & Paths); ! if( sizeof(tmp = path - tmp) ) eventRehash(tmp); ! if( Commands[cmd] && sizeof(tmp = (path & (string *)Commands[cmd])) ) ! return sprintf("%s/%s", tmp[0], cmd); } return 0; } --- 47,58 ---- string *tmp; if( Commands[cmd] && sizeof(tmp = (path & (string *)Commands[cmd])) ) ! return sprintf("%s/%s", tmp[0], cmd); else { ! tmp = (path & Paths); ! if( sizeof(tmp = path - tmp) ) eventRehash(tmp); ! if( Commands[cmd] && sizeof(tmp = (path & (string *)Commands[cmd])) ) ! return sprintf("%s/%s", tmp[0], cmd); } return 0; } *************** *** 63,69 **** if( !path ) return keys(Commands); tmp = ({ }); foreach( cmd, paths in Commands) ! if( member_array(path, paths) != -1 ) tmp += ({ cmd }); return tmp; } --- 64,70 ---- if( !path ) return keys(Commands); tmp = ({ }); foreach( cmd, paths in Commands) ! if( member_array(path, paths) != -1 ) tmp += ({ cmd }); return tmp; } diff -c -r --new-file ds1.1/lib/daemon/decay.c ds2.0r27/lib/daemon/decay.c *** ds1.1/lib/daemon/decay.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/daemon/decay.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,27 ---- + #include <lib.h> + + inherit LIB_DAEMON; + + void eventDecay(); + + static void create() { + daemon::create(); + SetNoClean(1); + call_out((: eventDecay :), 30); + } + + static void eventDecay() { + object *limbs = filter(findobs(LIB_LIMB), (: clonep($1) :) ); + object *corpses = filter(findobs(LIB_CORPSE), (: clonep($1) :) ); + + corpses += find_inheritors(LIB_CORPSE); + limbs += find_inheritors(LIB_LIMB); + + //tc("eventDecay called. limbs: "+sizeof(limbs)+", corpses: "+sizeof(corpses)); + + limbs->eventDecay(); + corpses->eventDecay(); + + call_out((: eventDecay :), 30); + return; + } diff -c -r --new-file ds1.1/lib/daemon/domains.c ds2.0r27/lib/daemon/domains.c *** ds1.1/lib/daemon/domains.c Sun Feb 1 21:29:57 1998 --- ds2.0r27/lib/daemon/domains.c Wed Jul 5 00:00:58 2006 *************** *** 1,5 **** /* /daemon/domains.c ! * From the Dead Souls V Object Library * A daemon for handling domain stat information * Created by Descartes of Borg 961110 * Version: %A% --- 1,5 ---- /* /daemon/domains.c ! * From the Dead Souls Object Library * A daemon for handling domain stat information * Created by Descartes of Borg 961110 * Version: %A% diff -c -r --new-file ds1.1/lib/daemon/economy.c ds2.0r27/lib/daemon/economy.c *** ds1.1/lib/daemon/economy.c Sun Feb 1 21:30:01 1998 --- ds2.0r27/lib/daemon/economy.c Wed Dec 31 19:00:00 1969 *************** *** 1,57 **** - // /daemon/mudlib/economy_d.c - // from the Dead Souls Mudlib - // a daemon to handle currenciy inflation - // created by Descartes of Borg 931114 - - #include <lib.h> - #include <privs.h> - #include <save.h> - #include <clock.h> - - inherit LIB_DAEMON; - - private mapping Currencies; - int LastInflation; - - void create() { - string *borg; - float temps, tmp; - int i; - - daemon::create(); - SetNoClean(1); - Currencies = ([]); - restore_object(SAVE_ECONOMY); - i = sizeof(borg = keys(Currencies)); - temps = percent(time()-LastInflation, YEAR)* 0.01; - while(i--) { - tmp = temps * Currencies[borg[i]]["inflation"]; - Currencies[borg[i]]["rate"] += tmp*Currencies[borg[i]]["rate"]; - } - LastInflation = time(); - save_object(SAVE_ECONOMY); - } - - void add_currency(string type, float rate, float infl, float wt) { - if(!((int)master()->valid_apply(({ PRIV_CMDS })))) return; - if(!mapp(Currencies)) Currencies = ([]); - if(!type || !rate || !infl || !wt || Currencies[type]) return; - Currencies[type] = ([ "rate":rate, "inflation":infl, "weight":wt ]); - save_object(SAVE_ECONOMY); - } - - void change_currency(string type, string key, float x) { - if(!((int)master()->valid_apply( ({ PRIV_CMDS }) ))) return; - if(!mapp(Currencies)) Currencies = ([]); - if(!type || !Currencies[type] || !key || !x) return; - if(!Currencies[type][key]) return; - Currencies[type][key] = x; - save_object(SAVE_ECONOMY); - } - - float __Query(string type, string key) { - if(!Currencies[type]) return 0.0; - else return Currencies[type][key]; - } - - string *__QueryCurrencies() { return keys(Currencies); } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/help.c ds2.0r27/lib/daemon/help.c *** ds1.1/lib/daemon/help.c Sun Feb 1 21:29:57 1998 --- ds2.0r27/lib/daemon/help.c Wed Jul 5 00:00:58 2006 *************** *** 1,5 **** /* /verbs/common/help.c ! * from the Dead Soulsr2 Object Library * created by Descartes of Borg 951021 * Version: @(#) help.c 1.15@(#) * Last Modified: 96/12/14 --- 1,5 ---- /* /verbs/common/help.c ! * from the Dead Souls Object Library * created by Descartes of Borg 951021 * Version: @(#) help.c 1.15@(#) * Last Modified: 96/12/14 *************** *** 30,71 **** int CanAccess(object who, string index) { switch(index) { case "admin commands": ! return archp(who); case "creator commands": case "creator documents": case "library objects": case "daemon objects": ! return creatorp(who); default: ! return 1; } } ! static private void LoadIndices() { string array tmp; function f; string dir; ! f = function(string str) { return str[0..<3]; }; Indices = ([]); tmp = get_dir(DIR_ADMIN_VERBS + "/*.c") + get_dir(DIR_ADMIN_CMDS + "/*.c") ! + get_dir(DIR_SECURE_ADMIN_CMDS + "/*.c"); Indices["admin commands"] = map(tmp, f); tmp = get_dir(DIR_COMMON_VERBS+"/*.c") + ! get_dir(DIR_COMMON_CMDS + "/*.c") + ! get_dir(DIR_SECURE_COMMON_CMDS + "/*.c") + ! get_dir(DIR_ITEM_VERBS + "/*.c") + ! get_dir(DIR_PLAYER_VERBS+"/*.c") + ! get_dir(DIR_PLAYER_CMDS+"/*.c") + ! get_dir(DIR_ROOM_VERBS + "/*.c") + ! get_dir(DIR_SPELL_VERBS + "/*.c") + ! get_dir(DIR_SECURE_PLAYER_CMDS + "/*.c"); Indices["commands"] = map(tmp, f); tmp = get_dir(DIR_CREATOR_VERBS+"/*.c") + get_dir(DIR_CREATOR_CMDS+"/*.c") ! + get_dir(DIR_SECURE_CREATOR_CMDS + "/*.c"); Indices["creator commands"] = map(tmp, f); tmp = get_dir(DIR_UNDEAD_VERBS "/*.c"); --- 30,71 ---- int CanAccess(object who, string index) { switch(index) { case "admin commands": ! return archp(who); case "creator commands": case "creator documents": case "library objects": case "daemon objects": ! return creatorp(who); default: ! return 1; } } ! static private void LoadIndices() { string array tmp; function f; string dir; ! f = function(string str) { return str[0..<3]; }; Indices = ([]); tmp = get_dir(DIR_ADMIN_VERBS + "/*.c") + get_dir(DIR_ADMIN_CMDS + "/*.c") ! + get_dir(DIR_SECURE_ADMIN_CMDS + "/*.c"); Indices["admin commands"] = map(tmp, f); tmp = get_dir(DIR_COMMON_VERBS+"/*.c") + ! get_dir(DIR_COMMON_CMDS + "/*.c") + ! get_dir(DIR_SECURE_COMMON_CMDS + "/*.c") + ! get_dir(DIR_ITEM_VERBS + "/*.c") + ! get_dir(DIR_PLAYER_VERBS+"/*.c") + ! get_dir(DIR_PLAYER_CMDS+"/*.c") + ! get_dir(DIR_ROOM_VERBS + "/*.c") + ! get_dir(DIR_SPELL_VERBS + "/*.c") + ! get_dir(DIR_SECURE_PLAYER_CMDS + "/*.c"); Indices["commands"] = map(tmp, f); tmp = get_dir(DIR_CREATOR_VERBS+"/*.c") + get_dir(DIR_CREATOR_CMDS+"/*.c") ! + get_dir(DIR_SECURE_CREATOR_CMDS + "/*.c"); Indices["creator commands"] = map(tmp, f); tmp = get_dir(DIR_UNDEAD_VERBS "/*.c"); *************** *** 73,496 **** tmp = SOUL_D->GetEmotes(); Indices["feelings"] = tmp; - - tmp = filter(map(get_dir(DIR_SPELLS "/*.c"), - function(string file) { - file = DIR_SPELLS "/" + file; - if( file->GetVerb() == "cast" ) { - return file->GetSpell(); - } - return 0; - }), (: $1 :)); - Indices["spells"] = tmp; tmp = filter(map(get_dir(DIR_SPELLS "/*.c"), ! function(string file) { ! file = DIR_SPELLS "/" + file; ! if( file->GetVerb() == "pray" ) { ! return file->GetSpell(); ! } ! return 0; ! }), (: $1 :)); ! Indices["prayers"] = tmp; ! ! if( tmp = get_dir(DIR_PLAYER_HELP + "/") ) ! Indices["player documents"] = tmp + ({ "soul" }); ! else Indices["player documents"] = ({ "soul" }); ! ! if( tmp = get_dir(DIR_CREATOR_HELP "/") ) ! Indices["creator documents"] = tmp; ! else Indices["creator document"] = ({}); ! ! if( tmp = (string array)CLASSES_D->GetClasses() ) ! Indices["classes"] = tmp; ! else Indices["classes"] = ({}); ! ! if( tmp = (string array)RACES_D->GetRaces(1) ) ! Indices["races"] = tmp; ! else Indices["races"] = ({}); ! ! if( tmp = get_dir(DIR_LAW_HELP "/") ) ! Indices["law"] = tmp; ! else Indices["law"] = ({}); ! ! if( tmp = get_dir(DIR_RELIGION_HELP "/") ) ! Indices["religion"] = tmp; ! else Indices["religion"] = ({}); ! ! Indices["library objects"] = ({}); ! foreach(dir in ({ DIR_LIB, DIR_SECURE_LIB })){ ! if( !(tmp = get_dir(dir + "/*.c")) ) continue; ! else Indices["library objects"] += ! map(tmp, (: $(dir)+"/"+$1[0..<3] :)); ! } ! ! Indices["daemon objects"] = ({}); ! foreach(dir in ({ DIR_DAEMONS, DIR_SECURE_DAEMONS })) { ! if( !(tmp = get_dir(dir + "/*.c")) ) continue; ! else Indices["daemon objects"] += ! map(tmp, (: $(dir)+"/"+$1[0..<3] :)); } - } ! string GetHelp(string str) { ! string *tmp; ! string topic; ! int x; ! ! Error = 0; ! if( !str || str == "" || str == "help" ) { ! return ("Syntax: <help>\n" " <help index>\n" " <help TOPIC>\n" " <help INDEX TOPIC>\n\n" ! "Without an argument, you get this help screen. The same " ! "applies for trying to get help on the help command. With " ! "an argument, you are given information on the topic you " ! "specified. The special topic, \"help index\", puts you into " ! "a menu driven index of categories for which help exists. In " ! "some cases, the same help topic will exist in two separate " ! "categories. If help tells you that you have asked for " ! "help on such a topic, you may specify the index from which " ! "it comes by using the index name help gives you. For " ! "example:\n" ! "> help list\n" ! "There exists help for \"list\" in the following indices:\n" ! "commands, channels\n" ! ">\n" ! "You could then type \"help player commands list\" to get " ! "the help for the list player command.\n\n" ! "In general, most commands have only a single index, so there " ! "is generally no need to specify the index.\n" ! "Finally, to help you better understand how to issue commands " ! "on Dead Souls, you should check out the document " ! "\"help syntax\".\n\n" ! "See also: faq, index, syntax"); ! } ! if( sscanf(str, "adverbs %s", topic) || str == "adverbs" ) { ! return (string)SOUL_D->GetHelp(str); ! } ! tmp = GetIndices(str); ! if( sizeof(tmp) == 1 ) { ! return GetHelpByIndex(tmp[0], str); ! } ! else if( sizeof(tmp) > 1 ) { ! Error = "There exists help for \"" + str + "\" under the following " ! "indices:\n" + implode(tmp, ", "); ! return 0; ! } ! topic = ""; ! str = trim(str); ! while( (x = strsrch(str, " ")) != -1 ) { ! if( topic != "" ) { ! topic = topic + " " + str[0..(x-1)]; ! } ! else { ! topic = str[0..(x-1)]; ! } ! str = str[(x+1)..]; ! if( Indices[topic] && strlen(str) ) { ! return GetHelpByIndex(topic, str); ! } ! } ! Error = "Help for the topic \"" + str + "\" could not be found."; ! return 0; ! } ! ! string GetHelpByIndex(string index, string topic) { ! mixed array tmparr, fun; ! mapping tmpmap; ! object ob; ! string help, file, tmpstr; ! ! if( this_player() && !CanAccess(this_player(), index) ) { ! Error = "You do not have access to that information."; ! return 0; ! } ! switch(index) { ! case "admin commands": case "creator commands": case "undead commands": ! case "commands": ! switch(index) { ! case "admin commands": ! if( file_exists( DIR_ADMIN_VERBS + "/" + topic + ".c") ) ! file = DIR_ADMIN_VERBS + "/" + topic; ! else if( file_exists( DIR_ADMIN_CMDS + "/" + topic + ".c") ) ! file = DIR_ADMIN_CMDS + "/" + topic; ! else file = DIR_SECURE_ADMIN_CMDS + "/" + topic; ! break; ! ! case "creator commands": ! if( file_exists( DIR_CREATOR_VERBS + "/" + topic + ".c") ) ! file = DIR_CREATOR_VERBS + "/" + topic; ! else if( file_exists(DIR_CREATOR_CMDS + "/" + topic + ".c") ) ! file = DIR_CREATOR_CMDS + "/" + topic; ! else file = DIR_SECURE_CREATOR_CMDS + "/" + topic; ! break; ! ! case "commands": ! foreach(string directory in ({ DIR_COMMON_VERBS, ! DIR_COMMON_CMDS, ! DIR_SECURE_COMMON_CMDS, ! DIR_ITEM_VERBS, ! DIR_PLAYER_VERBS, ! DIR_PLAYER_CMDS, ! DIR_SECURE_PLAYER_CMDS, ! DIR_ROOM_VERBS, ! DIR_SPELL_VERBS })) { ! if( file_exists(directory + "/" + topic + ".c") ) { ! file = directory + "/" + topic; ! break; ! } ! } ! break; ! ! case "undead commands": ! file = DIR_UNDEAD_VERBS + "/" + topic; ! break; ! } ! if( !file_exists(file + ".c") ) { ! Error = "No such " + index[0..<2] + " exists."; ! return 0; ! } ! if( catch(help = file->GetHelp(topic)) ) { ! Error = "An error occurred in attempting to access help."; ! return 0; ! } ! if( !help ) { ! string *syn, *pd; ! string line; ! ! pd = regexp(explode(parse_dump(), "\n"), file[1..]); ! syn = ({}); ! foreach(line in pd) { ! sscanf(line, "%*s"+file[1..]+") %s", tmpstr); ! syn += ({ tmpstr }); ! } ! if( !sizeof(syn) ) { ! if( function_exists("help", load_object(file)) ) { ! Error = "This help may be out of date."; ! file->help(); ! return 0; ! } ! Error = "Unable to locate any syntax information on " + ! topic + "."; ! return 0; ! } ! help = "Syntax: " + topic + " " + syn[0] + "\n"; ! if( sizeof(syn) == 1 ) help += "\n"; ! else { ! foreach(line in syn[1..]) ! help += " " + topic + " " + line + "\n"; ! help += "\n"; ! } ! help += "No detailed documentation exists for this command."; ! } ! help = "Index: %^GREEN%^" + index + "%^RESET%^\n" + ! "Topic: %^GREEN%^" + topic + "%^RESET%^\n\n" + help; ! return help; ! ! case "player documents": case "creator documents": ! case "law": ! switch(index) { ! case "player documents": ! if( topic == "soul" ) { ! help = SOUL_D->GetHelp("soul"); ! help = "Index: %^GREEN%^" + index + "%^RESET%^\n" + ! "Topic: %^GREEN%^" + topic + "%^RESET%^\n\n" + help; ! return help; ! } ! file = DIR_PLAYER_HELP "/" + topic; ! break; ! ! case "creator documents": ! file = DIR_CREATOR_HELP "/" + topic; ! break; ! ! case "law": ! file = DIR_LAW_HELP "/" + topic; ! break; ! } ! if( !file_exists(file) ) { ! Error = "No such " + index[0..<2] + " is available."; ! return 0; ! } ! if( !(help = read_file(file)) ) { ! Error = "The document " + topic + " was empty."; ! return 0; ! } ! help = "Index: %^GREEN%^" + index + "%^RESET%^\n" + ! "Topic: %^GREEN%^" + topic + "%^RESET%^\n\n" + help; ! return help; ! ! case "feelings": ! help = SOUL_D->GetHelp(topic); ! if( !help ) { ! Error = "No such " + index[0..<2] + " is available."; ! return 0; ! } ! help = "Index: %^GREEN%^" + index + "%^RESET%^\n" + ! "Topic: %^GREEN%^" + topic + "%^RESET%^\n\n" + help; ! return help;; ! ! case "library objects": ! topic = GetTopic(index, topic); ! if( catch(help = topic->GetHelp(topic)) ) { ! Error = "An error occurred in attempting to access help."; ! return 0; ! } ! if( !help ) { ! help = "No synopsis available for this object.\n\n"; ! } ! else { ! help = "Synopsis:\n" + help + "\n\n"; ! } ! tmparr = stat(topic + ".c"); ! tmpstr = "Object: " + topic + "\n" ! "Last Modified: " + ctime(tmparr[1]) + "\n"; ! if( tmparr[2] ) { ! tmpstr += "Last Loaded: " + ctime(tmparr[2]) + "\n\n"; ! } ! tmparr = inherit_list(ob = find_object(topic)); ! if( !sizeof(tmparr) ) { ! tmpstr += "No inherited objects\n\n"; ! } ! else { ! tmpstr += "Inherits:\n" + format_page(tmparr, 4) + "\n"; ! } ! tmparr = functions(ob, 1); ! tmpmap = ([]); ! foreach(fun in tmparr) { ! if( function_exists(fun[0], ob) != topic ) { ! continue; ! } ! if( fun[0] == "#global_init#" ) { ! continue; ! } ! if( tmpmap[fun[0]] ) { ! continue; ! } ! else { ! tmpmap[fun[0]] = ([ "type" : fun[2], ! "args" : (fun[1] ? fun[3..] : ({})) ]); ! } ! } ! help = tmpstr + help; ! if( !sizeof(tmparr) ) { ! help += "No functions\n\n"; ! } ! else { ! string fnc; ! ! help += "Functions:\n"; ! tmparr = sort_array(keys(tmpmap), 1); ! foreach(fnc in tmparr) { ! help += tmpmap[fnc]["type"] + fnc + "(" + ! implode(tmpmap[fnc]["args"], ", ") + ")\n"; ! } ! } ! help = "Index: %^GREEN%^" + index + "%^RESET%^\n" + ! "Topic: %^GREEN%^" + topic + "%^RESET%^\n\n" + help; ! return help; ! ! case "daemon objects": ! topic = GetTopic(index, topic); ! if( catch(help = topic->GetHelp(topic)) ) { ! Error = "An error occurred in attempting to access help."; ! return 0; ! } ! if( !help ) { ! help = "No synopsis available for this object.\n\n"; ! } ! else { ! help = "Synopsis:\n" + help + "\n\n"; ! } ! tmparr = stat(topic + ".c"); ! tmpstr = "Object: " + topic + "\n" ! "Last Modified: " + ctime(tmparr[1]) + "\n"; ! if( tmparr[2] ) tmpstr += "Last Loaded: " + ctime(tmparr[2]) + "\n\n"; ! tmparr = inherit_list(ob = find_object(topic)); ! if( !sizeof(tmparr) ) tmpstr += "No inherited objects\n\n"; ! else tmpstr += "Inherits:\n" + format_page(tmparr, 4) + "\n"; ! tmparr = functions(ob, 1); ! tmpmap = ([]); ! foreach(fun in tmparr) { ! if( function_exists(fun[0], ob) != topic ) continue; ! if( fun[0] == "#global_init#" ) continue; ! if( tmpmap[fun[0]] ) continue; ! else tmpmap[fun[0]] = ([ "type" : fun[2], ! "args" : (fun[1] ? fun[3..] : ({})) ]); ! } ! help = tmpstr + help; ! if( !sizeof(tmparr) ) help += "No functions\n\n"; ! else { ! string fnc; ! ! help += "Functions:\n"; ! tmparr = sort_array(keys(tmpmap), 1); ! foreach(fnc in tmparr) ! help += tmpmap[fnc]["type"] + fnc + "(" + ! implode(tmpmap[fnc]["args"], ", ") + ")\n"; ! } ! help = "Index: %^GREEN%^" + index + "%^RESET%^\n" + ! "Topic: %^GREEN%^" + topic + "%^RESET%^\n\n" + help; ! return help; ! ! case "religons": case "religion": ! if( file_exists(DIR_RELIGION_HELP "/" + topic) ) { ! help = read_file(DIR_RELIGION_HELP "/" + topic); ! help = "Index: %^GREEN%^" + index + "%^RESET%^\n" + ! "Topic: %^GREEN%^" + topic + "%^RESET%^\n\n" + help; ! return help; ! } ! Error = "No such religion exists."; ! return 0; ! ! case "races": ! if( help = (string)RACES_D->GetHelp(topic) ) { ! help = "Index: %^GREEN%^" + index + "%^RESET%^\n" + ! "Topic: %^GREEN%^" + topic + "%^RESET%^\n\n" + help; ! if( file_exists(DIR_RACE_HELP + "/" + topic) ) ! help += read_file(DIR_RACE_HELP + "/" + topic); ! return help; ! } ! Error = "No such race exists."; ! return 0; ! ! case "spells": case "prayers": ! ob = SPELLS_D->GetSpell(topic); ! if( !ob ) { ! Error = "No such spell exists."; ! return 0; ! } ! if( !(help = ob->GetHelp(topic)) ) { ! Error = "No help is available for that spell."; ! return 0; ! } ! help = "Index: %^GREEN%^" + index + "%^RESET%^\n" + ! "Topic: %^GREEN%^" + topic + "%^RESET%^\n\n" + help; ! return help; ! ! case "classes": ! if( help = (string)CLASSES_D->GetHelp(topic) ) { ! help = "Index: %^GREEN%^" + index + "%^RESET%^\n" + ! "Topic: %^GREEN%^" + topic + "%^RESET%^\n\n" + help; ! if( file_exists(DIR_CLASS_HELP + "/" + topic) ) ! help += read_file(DIR_CLASS_HELP + "/" + topic); ! return help; ! } ! Error = "No such class exists."; ! return 0; ! ! default: ! Error = "No help exists for the index " + index + "."; ! return 0; ! } } varargs string array GetIndices(string topic) { string array topics, val; string ind, tmp; ! if( !topic ) { return sort_array(keys(Indices), 1); } --- 73,484 ---- tmp = SOUL_D->GetEmotes(); Indices["feelings"] = tmp; tmp = filter(map(get_dir(DIR_SPELLS "/*.c"), ! function(string file) { ! file = DIR_SPELLS "/" + file; ! if( file->GetVerb() == "cast" ) { ! return file->GetSpell(); ! } ! return 0; ! }), (: $1 :)); ! Indices["spells"] = tmp; ! ! tmp = filter(map(get_dir(DIR_SPELLS "/*.c"), ! function(string file) { ! file = DIR_SPELLS "/" + file; ! if( file->GetVerb() == "pray" ) { ! return file->GetSpell(); ! } ! return 0; ! }), (: $1 :)); ! Indices["prayers"] = tmp; ! ! if( tmp = get_dir(DIR_PLAYER_HELP + "/") ) ! Indices["player documents"] = tmp + ({ "soul" }); ! else Indices["player documents"] = ({ "soul" }); ! ! if( tmp = get_dir(DIR_CREATOR_HELP "/") ) ! Indices["creator documents"] = tmp; ! else Indices["creator document"] = ({}); ! ! if( tmp = (string array)CLASSES_D->GetClasses() ) ! Indices["classes"] = tmp; ! else Indices["classes"] = ({}); ! ! if( tmp = (string array)RACES_D->GetRaces(1) ) ! Indices["races"] = tmp; ! else Indices["races"] = ({}); ! ! if( tmp = get_dir(DIR_LAW_HELP "/") ) ! Indices["law"] = tmp; ! else Indices["law"] = ({}); ! ! if( tmp = get_dir(DIR_RELIGION_HELP "/") ) ! Indices["religion"] = tmp; ! else Indices["religion"] = ({}); ! ! Indices["library objects"] = ({}); ! foreach(dir in ({ DIR_LIB, DIR_SECURE_LIB })){ ! if( !(tmp = get_dir(dir + "/*.c")) ) continue; ! else Indices["library objects"] += ! map(tmp, (: $(dir)+"/"+$1[0..<3] :)); ! } ! ! Indices["daemon objects"] = ({}); ! foreach(dir in ({ DIR_DAEMONS, DIR_SECURE_DAEMONS })) { ! if( !(tmp = get_dir(dir + "/*.c")) ) continue; ! else Indices["daemon objects"] += ! map(tmp, (: $(dir)+"/"+$1[0..<3] :)); ! } } ! string GetHelp(string str) { ! string *tmp; ! string topic; ! int x; ! ! Error = 0; ! if( !str || str == "" || str == "help" ) { ! return ("Syntax: <help>\n" " <help index>\n" " <help TOPIC>\n" " <help INDEX TOPIC>\n\n" ! "The special topic, \"help index\", puts you into " ! "a menu driven index of categories for which help exists.\n\n" ! "For players, \"help commands\" will provide an index of " ! "available player commands.\n " ! "For creators, \"help creator commands\" provides an " ! "index of available creator commands.\n\n " ! "Try \"help commands\" " ! "and \"help creator commands\" first. \n\n" ! " "); ! } ! if( sscanf(str, "adverbs %s", topic) || str == "adverbs" ) { ! return (string)SOUL_D->GetHelp(str); ! } ! tmp = GetIndices(str); ! if( sizeof(tmp) == 1 ) { ! return GetHelpByIndex(tmp[0], str); ! } ! else if( sizeof(tmp) > 1 ) { ! Error = "There exists help for \"" + str + "\" under the following " ! "indices:\n" + implode(tmp, ", "); ! return 0; ! } ! topic = ""; ! str = trim(str); ! while( (x = strsrch(str, " ")) != -1 ) { ! if( topic != "" ) { ! topic = topic + " " + str[0..(x-1)]; ! } ! else { ! topic = str[0..(x-1)]; ! } ! str = str[(x+1)..]; ! if( Indices[topic] && strlen(str) ) { ! return GetHelpByIndex(topic, str); ! } ! } ! Error = "Help for the topic \"" + str + "\" could not be found."; ! return 0; ! } ! ! string GetHelpByIndex(string index, string topic) { ! mixed array tmparr, fun; ! mapping tmpmap; ! object ob; ! string help, file, tmpstr; ! ! if( this_player() && !CanAccess(this_player(), index) ) { ! Error = "You do not have access to that information."; ! return 0; ! } ! switch(index) { ! case "admin commands": case "creator commands": case "undead commands": ! case "commands": ! switch(index) { ! case "admin commands": ! if( file_exists( DIR_ADMIN_VERBS + "/" + topic + ".c") ) ! file = DIR_ADMIN_VERBS + "/" + topic; ! else if( file_exists( DIR_ADMIN_CMDS + "/" + topic + ".c") ) ! file = DIR_ADMIN_CMDS + "/" + topic; ! else file = DIR_SECURE_ADMIN_CMDS + "/" + topic; ! break; ! ! case "creator commands": ! if( file_exists( DIR_CREATOR_VERBS + "/" + topic + ".c") ) ! file = DIR_CREATOR_VERBS + "/" + topic; ! else if( file_exists(DIR_CREATOR_CMDS + "/" + topic + ".c") ) ! file = DIR_CREATOR_CMDS + "/" + topic; ! else file = DIR_SECURE_CREATOR_CMDS + "/" + topic; ! break; ! ! case "commands": ! foreach(string directory in ({ DIR_COMMON_VERBS, ! DIR_COMMON_CMDS, ! DIR_SECURE_COMMON_CMDS, ! DIR_ITEM_VERBS, ! DIR_PLAYER_VERBS, ! DIR_PLAYER_CMDS, ! DIR_SECURE_PLAYER_CMDS, ! DIR_ROOM_VERBS, ! DIR_SPELL_VERBS })) { ! if( file_exists(directory + "/" + topic + ".c") ) { ! file = directory + "/" + topic; ! break; ! } ! } ! break; ! ! case "undead commands": ! file = DIR_UNDEAD_VERBS + "/" + topic; ! break; ! } ! if( !file_exists(file + ".c") ) { ! Error = "No such " + index[0..<2] + " exists."; ! return 0; ! } ! if( catch(help = file->GetHelp(topic)) ) { ! Error = "An error occurred in attempting to access help."; ! return 0; ! } ! if( !help ) { ! string *syn, *pd; ! string line; ! ! pd = regexp(explode(parse_dump(), "\n"), file[1..]); ! syn = ({}); ! foreach(line in pd) { ! sscanf(line, "%*s"+file[1..]+") %s", tmpstr); ! syn += ({ tmpstr }); ! } ! if( !sizeof(syn) ) { ! if( function_exists("help", load_object(file)) ) { ! //Error = "This help may be out of date."; ! Error = " "; ! file->help(); ! return 0; ! } ! Error = "Unable to locate any syntax information on " + ! topic + "."; ! return 0; ! } ! help = "Syntax: " + topic + " " + syn[0] + "\n"; ! if( sizeof(syn) == 1 ) help += "\n"; ! else { ! foreach(line in syn[1..]) ! help += " " + topic + " " + line + "\n"; ! help += "\n"; ! } ! help += "No detailed documentation exists for this command."; ! } ! help = "Index: %^GREEN%^" + index + "%^RESET%^\n" + ! "Topic: %^GREEN%^" + topic + "%^RESET%^\n\n" + help; ! return help; ! ! case "player documents": case "creator documents": ! case "law": ! switch(index) { ! case "player documents": ! if( topic == "soul" ) { ! help = SOUL_D->GetHelp("soul"); ! help = "Index: %^GREEN%^" + index + "%^RESET%^\n" + ! "Topic: %^GREEN%^" + topic + "%^RESET%^\n\n" + help; ! return help; ! } ! file = DIR_PLAYER_HELP "/" + topic; ! break; ! ! case "creator documents": ! file = DIR_CREATOR_HELP "/" + topic; ! break; ! ! case "law": ! file = DIR_LAW_HELP "/" + topic; ! break; ! } ! if( !file_exists(file) ) { ! Error = "No such " + index[0..<2] + " is available."; ! return 0; ! } ! if( !(help = read_file(file)) ) { ! Error = "The document " + topic + " was empty."; ! return 0; ! } ! help = "Index: %^GREEN%^" + index + "%^RESET%^\n" + ! "Topic: %^GREEN%^" + topic + "%^RESET%^\n\n" + help; ! return help; ! ! case "feelings": ! help = SOUL_D->GetHelp(topic); ! if( !help ) { ! Error = "No such " + index[0..<2] + " is available."; ! return 0; ! } ! help = "Index: %^GREEN%^" + index + "%^RESET%^\n" + ! "Topic: %^GREEN%^" + topic + "%^RESET%^\n\n" + help; ! return help;; ! ! case "library objects": ! topic = GetTopic(index, topic); ! if( catch(help = topic->GetHelp(topic)) ) { ! Error = "An error occurred in attempting to access help."; ! return 0; ! } ! if( !help ) { ! help = "No synopsis available for this object.\n\n"; ! } ! else { ! help = "Synopsis:\n" + help + "\n\n"; ! } ! tmparr = stat(topic + ".c"); ! tmpstr = "Object: " + topic + "\n" ! "Last Modified: " + ctime(tmparr[1]) + "\n"; ! if( tmparr[2] ) { ! tmpstr += "Last Loaded: " + ctime(tmparr[2]) + "\n\n"; ! } ! tmparr = inherit_list(ob = find_object(topic)); ! if( !sizeof(tmparr) ) { ! tmpstr += "No inherited objects\n\n"; ! } ! else { ! tmpstr += "Inherits:\n" + format_page(tmparr, 4) + "\n"; ! } ! tmparr = functions(ob, 1); ! tmpmap = ([]); ! foreach(fun in tmparr) { ! if( function_exists(fun[0], ob) != topic ) { ! continue; ! } ! if( fun[0] == "#global_init#" ) { ! continue; ! } ! if( tmpmap[fun[0]] ) { ! continue; ! } ! else { ! tmpmap[fun[0]] = ([ "type" : fun[2], ! "args" : (fun[1] ? fun[3..] : ({})) ]); ! } ! } ! help = tmpstr + help; ! if( !sizeof(tmparr) ) { ! help += "No functions\n\n"; ! } ! else { ! string fnc; ! ! help += "Functions:\n"; ! tmparr = sort_array(keys(tmpmap), 1); ! foreach(fnc in tmparr) { ! help += tmpmap[fnc]["type"] + fnc + "(" + ! implode(tmpmap[fnc]["args"], ", ") + ")\n"; ! } ! } ! help = "Index: %^GREEN%^" + index + "%^RESET%^\n" + ! "Topic: %^GREEN%^" + topic + "%^RESET%^\n\n" + help; ! return help; ! ! case "daemon objects": ! topic = GetTopic(index, topic); ! if( catch(help = topic->GetHelp(topic)) ) { ! Error = "An error occurred in attempting to access help."; ! return 0; ! } ! if( !help ) { ! help = "No synopsis available for this object.\n\n"; ! } ! else { ! help = "Synopsis:\n" + help + "\n\n"; ! } ! tmparr = stat(topic + ".c"); ! tmpstr = "Object: " + topic + "\n" ! "Last Modified: " + ctime(tmparr[1]) + "\n"; ! if( tmparr[2] ) tmpstr += "Last Loaded: " + ctime(tmparr[2]) + "\n\n"; ! tmparr = inherit_list(ob = find_object(topic)); ! if( !sizeof(tmparr) ) tmpstr += "No inherited objects\n\n"; ! else tmpstr += "Inherits:\n" + format_page(tmparr, 4) + "\n"; ! tmparr = functions(ob, 1); ! tmpmap = ([]); ! foreach(fun in tmparr) { ! if( function_exists(fun[0], ob) != topic ) continue; ! if( fun[0] == "#global_init#" ) continue; ! if( tmpmap[fun[0]] ) continue; ! else tmpmap[fun[0]] = ([ "type" : fun[2], ! "args" : (fun[1] ? fun[3..] : ({})) ]); ! } ! help = tmpstr + help; ! if( !sizeof(tmparr) ) help += "No functions\n\n"; ! else { ! string fnc; ! ! help += "Functions:\n"; ! tmparr = sort_array(keys(tmpmap), 1); ! foreach(fnc in tmparr) ! help += tmpmap[fnc]["type"] + fnc + "(" + ! implode(tmpmap[fnc]["args"], ", ") + ")\n"; ! } ! help = "Index: %^GREEN%^" + index + "%^RESET%^\n" + ! "Topic: %^GREEN%^" + topic + "%^RESET%^\n\n" + help; ! return help; ! ! case "religons": case "religion": ! if( file_exists(DIR_RELIGION_HELP "/" + topic) ) { ! help = read_file(DIR_RELIGION_HELP "/" + topic); ! help = "Index: %^GREEN%^" + index + "%^RESET%^\n" + ! "Topic: %^GREEN%^" + topic + "%^RESET%^\n\n" + help; ! return help; ! } ! Error = "No such religion exists."; ! return 0; ! ! case "races": ! if( help = (string)RACES_D->GetHelp(topic) ) { ! help = "Index: %^GREEN%^" + index + "%^RESET%^\n" + ! "Topic: %^GREEN%^" + topic + "%^RESET%^\n\n" + help; ! if( file_exists(DIR_RACE_HELP + "/" + topic) ) ! //help += read_file(DIR_RACE_HELP + "/" + topic); ! return help; ! } ! Error = "No such race exists."; ! return 0; ! ! case "spells": case "prayers": ! ob = SPELLS_D->GetSpell(topic); ! if( !ob ) { ! Error = "No such spell exists."; ! return 0; ! } ! if( !(help = ob->GetHelp(topic)) ) { ! Error = "No help is available for that spell."; ! return 0; ! } ! help = "Index: %^GREEN%^" + index + "%^RESET%^\n" + ! "Topic: %^GREEN%^" + topic + "%^RESET%^\n\n" + help; ! return help; ! ! case "classes": ! if( help = (string)CLASSES_D->GetHelp(topic) ) { ! help = "Index: %^GREEN%^" + index + "%^RESET%^\n" + ! "Topic: %^GREEN%^" + topic + "%^RESET%^\n\n" + help; ! if( file_exists(DIR_CLASS_HELP + "/" + topic) ) ! help += read_file(DIR_CLASS_HELP + "/" + topic); ! return help; ! } ! Error = "No such class exists."; ! return 0; ! ! default: ! Error = "No help exists for the index " + index + "."; ! return 0; ! } } varargs string array GetIndices(string topic) { string array topics, val; string ind, tmp; ! if( !topic ) { return sort_array(keys(Indices), 1); } *************** *** 510,516 **** string GetTopic(string index, string topic) { string array dirlist; string dir; ! if( index != "library objects" && index != "daemon objects" ) { return topic; } --- 498,504 ---- string GetTopic(string index, string topic) { string array dirlist; string dir; ! if( index != "library objects" && index != "daemon objects" ) { return topic; } diff -c -r --new-file ds1.1/lib/daemon/include/classes.h ds2.0r27/lib/daemon/include/classes.h *** ds1.1/lib/daemon/include/classes.h Sun Feb 1 21:29:58 1998 --- ds2.0r27/lib/daemon/include/classes.h Wed Jul 5 00:01:03 2006 *************** *** 4,15 **** class Skill { int SkillClass; int Average; ! }; class Class { int Complete; mapping Multis; mapping Skills; ! }; #endif /* l_classes_h */ --- 4,15 ---- class Skill { int SkillClass; int Average; ! } class Class { int Complete; mapping Multis; mapping Skills; ! } #endif /* l_classes_h */ diff -c -r --new-file ds1.1/lib/daemon/include/races.h ds2.0r27/lib/daemon/include/races.h *** ds1.1/lib/daemon/include/races.h Sun Feb 1 21:29:58 1998 --- ds2.0r27/lib/daemon/include/races.h Wed Jul 5 00:01:03 2006 *************** *** 4,10 **** class Stat { int Class; int Average; ! }; class Race { mixed array Limbs; --- 4,10 ---- class Stat { int Class; int Average; ! } class Race { mixed array Limbs; *************** *** 15,23 **** int Complete; int PlayerFlag; string Language; ! }; ! int GetArmour(string str); int GetResistance(string str); #endif /* l_races_h */ --- 15,24 ---- int Complete; int PlayerFlag; string Language; ! mapping Skills; ! } ! int GetArmor(string str); int GetResistance(string str); #endif /* l_races_h */ diff -c -r --new-file ds1.1/lib/daemon/include/stargate.h ds2.0r27/lib/daemon/include/stargate.h *** ds1.1/lib/daemon/include/stargate.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/daemon/include/stargate.h Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,18 ---- + #include "/include/stargate.h" + + #ifndef daemon_stargate_h + #define daemon_stargate_h + + void eventLoad(); + void eventSave(); + int SetStargate(string address, string destination); + int RemoveStargate(string address); + mapping GetStargates(); + int SetStatus(string address, string status); + string GetStatus(string address); + string GetDestination(string address); + string GetEndpoint(string address); + int eventConnect(string from, string to); + int eventDisconnect(string from); + + #endif diff -c -r --new-file ds1.1/lib/daemon/intermud.c ds2.0r27/lib/daemon/intermud.c *** ds1.1/lib/daemon/intermud.c Sun Feb 1 21:34:37 1998 --- ds2.0r27/lib/daemon/intermud.c Wed Jul 5 00:00:58 2006 *************** *** 11,16 **** --- 11,17 ---- #else #include <lib.h> + #include <privs.h> #include <save.h> #include <config.h> #include <daemons.h> *************** *** 31,37 **** Password = 0; Tries = 0; Banned = ([]); - Nameservers = ({ ({ "*gjs", "208.192.43.105 9000" }) }); MudList = new(class list); ChannelList = new(class list); MudList->ID = -1; --- 32,37 ---- *************** *** 39,51 **** ChannelList->ID = -1; ChannelList->List = ([]); if( file_size( SAVE_INTERMUD __SAVE_EXTENSION__ ) > 0 ) ! unguarded( (: restore_object, SAVE_INTERMUD, 1 :) ); SetNoClean(1); SetDestructOnClose(1); SetSocketType(MUD); ! call_out( (: Setup :), 2); } static void Setup() { string ip; int port; --- 39,57 ---- ChannelList->ID = -1; ChannelList->List = ([]); if( file_size( SAVE_INTERMUD __SAVE_EXTENSION__ ) > 0 ) ! unguarded( (: restore_object, SAVE_INTERMUD, 1 :) ); ! Nameservers = ({ ({ "*yatmim", "149.152.218.102 23" }) }); SetNoClean(1); + tn("INTERMUD_D reloaded."); SetDestructOnClose(1); SetSocketType(MUD); ! if(DISABLE_INTERMUD == 1){ ! call_out( (: eventDestruct :), 2); ! } ! else call_out( (: Setup :), 2); } + static void Setup() { string ip; int port; *************** *** 54,184 **** sscanf(Nameservers[0][1], "%s %d", ip, port); if( eventCreateSocket(ip, port) < 0 ) return; eventWrite( ({ "startup-req-3", 5, mud_name(), 0, Nameservers[0][0], 0, ! Password, MudList->ID, ChannelList->ID, query_host_port(), ! PORT_OOB, PORT_UDP, mudlib() + " " + mudlib_version(), ! mudlib() + " " + mudlib_version(), version(), "LPMud", ! MUD_STATUS, ADMIN_EMAIL, ! (mapping)SERVICES_D->GetServices(), ([]) }) ); } static void eventRead(mixed *packet) { - string *cles; mixed val; ! string ns, cle; ! int i, maxi; if( !packet || sizeof(packet) < 6 ) return; /* should send error */ if( Banned[packet[2]] ) { - string reason = Banned[packet[2]]; eventWrite(({ "error", 5, mud_name(), 0, packet[2], ! packet[3], "unk-user", ! "Your mud is not allowed to send to Dead Souls.", ! packet })); ! return; } switch(packet[0]) { ! case "startup-reply": ! if( sizeof(packet) != 8 ) return; /* should send error */ ! if( !sizeof(packet[6]) ) return; ! if( packet[6][0][0] == Nameservers[0][0] ) { ! Nameservers = packet[6]; ! Connected = Nameservers[0][0]; ! Password = packet[7]; ! save_object(SAVE_INTERMUD); ! } ! else { ! Nameservers = packet[6]; ! Setup(); ! } ! return; ! case "mudlist": ! if( sizeof(packet) != 8 ) return; ! if( packet[6] == MudList->ID ) return; ! if( packet[2] != Nameservers[0][0] ) return; ! MudList->ID = packet[6]; ! foreach(cle, val in packet[7]) { ! if( !val && MudList->List[cle] != 0 ) map_delete(MudList->List, cle); ! else if( val ) MudList->List[cle] = val; ! } ! save_object(SAVE_INTERMUD); ! return; ! case "channel-t": ! SERVICES_D->eventReceiveChannelTargettedEmote(packet); ! break; ! case "channel-e": ! SERVICES_D->eventReceiveChannelEmote(packet); ! break; ! case "channel-m": ! SERVICES_D->eventReceiveChannelMessage(packet); ! break; ! case "chan-who-reply": ! SERVICES_D->eventReceiveChannelWhoReply(packet); ! break; ! case "chan-who-req": ! SERVICES_D->eventReceiveChannelWhoRequest(packet); ! break; ! case "chan-user-req": ! SERVICES_D->eventReceiveChannelUserRequest(packet); ! break; ! case "chanlist-reply": ! // if( packet[6] == ChannelList->ID ) return; ! if( packet[2] != Nameservers[0][0] ) return; ! ChannelList->ID = packet[6]; ! foreach(cle, val in packet[7]) { ! if( !val && ChannelList->List != 0 ) map_delete(ChannelList->List, cle); ! else if( val ) ChannelList->List[cle] = val; ! } ! save_object(SAVE_INTERMUD); ! SERVICES_D->eventRegisterChannels(packet[7]); ! return; ! case "emoteto": ! SERVICES_D->eventReceiveEmote(packet); ! break; ! case "finger-req": ! SERVICES_D->eventReceiveFingerRequest(packet); ! break; ! case "finger-reply": ! SERVICES_D->eventReceiveFingerReply(packet); ! break; ! case "locate-req": ! SERVICES_D->eventReceiveLocateRequest(packet); ! break; ! case "locate-reply": ! SERVICES_D->eventReceiveLocateReply(packet); ! break; ! case "tell": ! SERVICES_D->eventReceiveTell(packet); ! break; ! case "chan-user-reply": ! case "ucache-update": ! SERVICES_D->eventReceiveUcacheUpdate(packet); ! break; ! case "who-req": ! SERVICES_D->eventReceiveWhoRequest(packet); ! break; ! case "who-reply": ! SERVICES_D->eventReceiveWhoReply(packet); ! break; ! case "news": ! SERVICES_D->eventReceiveNews(packet); ! break; ! case "mail": ! SERVICES_D->eventReceiveMail(packet); ! break; ! case "mail-ok": ! SERVICES_D->eventReceiveMailOk(packet); ! break; ! case "file": ! break; ! case "error": ! SERVICES_D->eventReceiveError(packet); ! break; ! default: ! break; } } --- 60,241 ---- sscanf(Nameservers[0][1], "%s %d", ip, port); if( eventCreateSocket(ip, port) < 0 ) return; eventWrite( ({ "startup-req-3", 5, mud_name(), 0, Nameservers[0][0], 0, ! Password, MudList->ID, ChannelList->ID, query_host_port(), ! PORT_OOB, PORT_UDP, mudlib() + " " + mudlib_version(), ! mudlib() + " " + mudlib_version(), version(), "LPMud", ! MUD_STATUS, ADMIN_EMAIL, ! (mapping)SERVICES_D->GetServices(), ([]) }) ); ! tn("INTERMUD_D setup: "+identify( ({ ! "startup-req-3", 5, mud_name(), 0, Nameservers[0][0], 0, ! Password, MudList->ID, ChannelList->ID, query_host_port(), ! PORT_OOB, PORT_UDP, mudlib() + " " + mudlib_version(), ! mudlib() + " " + mudlib_version(), version(), "LPMud", ! MUD_STATUS, ADMIN_EMAIL, ! (mapping)SERVICES_D->GetServices(), ([]) }) ), "red");; ! } ! ! void eventClearVars(){ ! if( !((int)master()->valid_apply(({ PRIV_ASSIST, INTERMUD_D }))) ) ! error("Illegal attempt to reset intermud: "+get_stack()+" "+identify(previous_object(-1))); ! Connected = 0; ! Tries = 0; ! MudList = new(class list); ! ChannelList = new(class list); ! MudList->ID = -1; ! MudList->List = ([]); ! ChannelList->ID = -1; ! ChannelList->List = ([]); ! save_object(SAVE_INTERMUD); } static void eventRead(mixed *packet) { mixed val; ! string cle; if( !packet || sizeof(packet) < 6 ) return; /* should send error */ if( Banned[packet[2]] ) { eventWrite(({ "error", 5, mud_name(), 0, packet[2], ! packet[3], "unk-user", ! "Your mud is not allowed to send to Dead Souls.", ! packet })); ! return; } switch(packet[0]) { ! //default : tc("Packet: "+identify(packet)); ! case "startup-reply": ! log_file("intermud",identify(packet)); ! tn("INTERMUD_D: "+identify(packet),"red"); ! if( sizeof(packet) != 8 ) { ! tn("We don't like the mudlist packet size.","red"); ! return; ! } ! if( !sizeof(packet[6]) ) { ! tn("We don't like an absence of packet element 6.","red"); ! return; ! } ! if( packet[6][0][0] == Nameservers[0][0] ) { ! Nameservers = packet[6]; ! Connected = Nameservers[0][0]; ! Password = packet[7]; ! save_object(SAVE_INTERMUD); ! } ! else { ! Nameservers = packet[6]; ! Setup(); ! } ! return; ! case "mudlist": ! tn("INTERMUD_D mudlist received.","red"); ! log_file("mudlist_packet",identify(packet),1); ! if( sizeof(packet) != 8 ) { ! tn("We don't like the mudlist packet size.","red"); ! return; ! } ! if( packet[6] == MudList->ID ) { ! tn("We don't like packet element 6. It is: "+identify(packet[6]),"red"); ! //return; ! tn("We will continue anyway.","red"); ! } ! if( packet[2] != Nameservers[0][0] ) { ! tn("We don't like packet element 2. It is: "+identify(packet[2]),"red"); ! return; ! } ! ! MudList->ID = packet[6]; ! foreach(cle, val in packet[7]) { ! if(cle) tn("Procesing cle: "+identify(cle),"cyan"); ! if(val) tn("Procesing val: "+identify(val)+"\n--\n","cyan"); ! if( !val && MudList->List[cle] != 0 ) map_delete(MudList->List, cle); ! else if( val ) MudList->List[cle] = val; ! } ! save_object(SAVE_INTERMUD); ! return; ! case "auth-mud-req": ! SERVICES_D->eventReceiveAuthRequest(packet); ! break; ! case "auth-mud-reply": ! SERVICES_D->eventReceiveAuthReply(packet); ! break; ! case "channel-t": ! SERVICES_D->eventReceiveChannelTargettedEmote(packet); ! break; ! case "channel-e": ! SERVICES_D->eventReceiveChannelEmote(packet); ! break; ! case "channel-m": ! SERVICES_D->eventReceiveChannelMessage(packet); ! break; ! case "chan-who-reply": ! SERVICES_D->eventReceiveChannelWhoReply(packet); ! break; ! case "chan-who-req": ! SERVICES_D->eventReceiveChannelWhoRequest(packet); ! break; ! case "chan-user-req": ! SERVICES_D->eventReceiveChannelUserRequest(packet); ! break; ! case "chanlist-reply": ! // if( packet[6] == ChannelList->ID ) return; ! tn("chanlist reply: "+identify(packet), "blue"); ! if( packet[2] != Nameservers[0][0] ) return; ! ChannelList->ID = packet[6]; ! foreach(cle, val in packet[7]) { ! if( !val && ChannelList->List != 0 ) map_delete(ChannelList->List, cle); ! else if( val ) ChannelList->List[cle] = val; ! } ! save_object(SAVE_INTERMUD); ! SERVICES_D->eventRegisterChannels(packet[7]); ! return; ! case "emoteto": ! SERVICES_D->eventReceiveEmote(packet); ! break; ! case "finger-req": ! SERVICES_D->eventReceiveFingerRequest(packet); ! break; ! case "finger-reply": ! SERVICES_D->eventReceiveFingerReply(packet); ! break; ! case "locate-req": ! SERVICES_D->eventReceiveLocateRequest(packet); ! break; ! case "locate-reply": ! SERVICES_D->eventReceiveLocateReply(packet); ! break; ! case "tell": ! SERVICES_D->eventReceiveTell(packet); ! break; ! case "chan-user-reply": ! tn("INTERMUD_D: chan-user-reply received.","red"); ! case "ucache-update": ! SERVICES_D->eventReceiveUcacheUpdate(packet); ! break; ! case "who-req": ! SERVICES_D->eventReceiveWhoRequest(packet); ! break; ! case "who-reply": ! SERVICES_D->eventReceiveWhoReply(packet); ! break; ! case "news": ! SERVICES_D->eventReceiveNews(packet); ! break; ! case "mail": ! SERVICES_D->eventReceiveMail(packet); ! break; ! case "mail-ok": ! SERVICES_D->eventReceiveMailOk(packet); ! break; ! case "file": ! tn("INTERMUD_D: file packet received.","red"); ! break; ! case "error": ! SERVICES_D->eventReceiveError(packet); ! break; ! default: ! break; } } *************** *** 193,198 **** --- 250,256 ---- static void eventConnectionFailure() { if( Connected ) return; + tn("INTERMUD_D: CONNECTION FAILED","red"); error("Failed to find a useful name server.\n"); } *************** *** 206,248 **** if( MudList->List[mud] ) return mud; lc = map(uc = keys(MudList->List), function(string str) { ! if( !str ) return ""; ! else return lower_case(str); ! }); ! x = member_array(lower_case(mud), lc); ! if( x < 0 ) return 0; ! else return uc[x]; ! } ! ! mapping GetMudList() { return copy(MudList->List); } ! string *GetMuds() { return keys(MudList->List); } ! mapping GetChannelList() { return copy(ChannelList->List); } ! string *GetChannels() { return keys(ChannelList->List); } ! string *GetMatch(string mud) { ! string *uc, *lc; ! mud = lower_case(mud); ! lc = map(uc = keys(MudList->List), (: lower_case :)); ! return map(filter(regexp(lc, "^"+mud, 1), (: intp :)), (: $(uc)[$1] :)); ! } ! string GetNameserver() { return Nameservers[0][0]; } ! int AddBanned(string mud, string reason) { ! if( !master()->valid_apply(({})) ) { ! return 0; } - if( !(mud = GetMudName(mud)) ) { - return 0; - } - Banned[mud] = reason; - save_object(SAVE_INTERMUD); - return 1; - } #endif /* __PACKAGE_SOCKETS__ */ --- 264,318 ---- if( MudList->List[mud] ) return mud; lc = map(uc = keys(MudList->List), function(string str) { ! if( !str ) return ""; ! else return lower_case(str); ! }); ! x = member_array(lower_case(mud), lc); ! if( x < 0 ) return 0; ! else return uc[x]; ! } ! ! mapping GetMudList() { return copy(MudList->List); } ! ! string *GetMuds() { return keys(MudList->List); } ! ! string *GetLCMuds() { ! string *orig_arr, *new_arr; ! orig_arr = GetMuds(); ! new_arr = ({}); ! foreach(string namen in orig_arr){ ! new_arr += ({ lower_case(namen) }); ! } ! return new_arr; ! } ! mapping GetChannelList() { return copy(ChannelList->List); } ! string *GetChannels() { return keys(ChannelList->List); } ! string *GetMatch(string mud) { ! string *uc, *lc; ! mud = lower_case(mud); ! lc = map(uc = keys(MudList->List), (: lower_case :)); ! return map(filter(regexp(lc, "^"+mud, 1), (: intp :)), (: $(uc)[$1] :)); ! } ! string GetNameserver() { return Nameservers[0][0]; } ! mixed *GetNameservers() { return copy(Nameservers); } ! int AddBanned(string mud, string reason) { ! if( !master()->valid_apply(({})) ) { ! return 0; ! } ! if( !(mud = GetMudName(mud)) ) { ! return 0; ! } ! Banned[mud] = reason; ! save_object(SAVE_INTERMUD); ! return 1; } #endif /* __PACKAGE_SOCKETS__ */ diff -c -r --new-file ds1.1/lib/daemon/news.c ds2.0r27/lib/daemon/news.c *** ds1.1/lib/daemon/news.c Sun Feb 1 21:30:02 1998 --- ds2.0r27/lib/daemon/news.c Wed Jul 5 00:00:58 2006 *************** *** 17,36 **** s = stat(NEWS_GENERAL)[1]; if( s != (int)this_player()->GetNews("general") ) { string news; ! news = GetNews("general"); this_player()->SetNews("general", s); message("news", "\n%^RED%^General news:", this_player()); ! this_player()->eventPrint(news); ! message("prompt", "Press <return> to continue: ", this_player()); if( !((int)this_player()->GetClass()) && !creatorp(this_player()) ) ! input_to((: NewbieNews :)); else input_to((: ClassNews, "" :)); return; } } if( !((int)this_player()->GetClass()) && !creatorp(this_player()) ) ! NewbieNews(); else ClassNews(""); } --- 17,36 ---- s = stat(NEWS_GENERAL)[1]; if( s != (int)this_player()->GetNews("general") ) { string news; ! news = GetNews("general"); this_player()->SetNews("general", s); message("news", "\n%^RED%^General news:", this_player()); ! this_player()->eventPrint(news); ! message("prompt", "Press <return> to continue: ", this_player()); if( !((int)this_player()->GetClass()) && !creatorp(this_player()) ) ! input_to((: NewbieNews :)); else input_to((: ClassNews, "" :)); return; } } if( !((int)this_player()->GetClass()) && !creatorp(this_player()) ) ! NewbieNews(); else ClassNews(""); } *************** *** 52,82 **** if( !cl || cl == "" ) cl = "cleric"; else { switch(cl) { ! case "cleric": cl = "fighter"; break; ! case "fighter": cl = "fisher"; break; ! case "fisher": cl = "kataan"; break; ! ! case "kataan": cl = "mage"; break; ! case "mage": cl = "monk"; break; ! case "monk": cl = "rogue"; break; ! case "rogue": HighMortalNews(); return; } --- 52,82 ---- if( !cl || cl == "" ) cl = "cleric"; else { switch(cl) { ! case "cleric": cl = "fighter"; break; ! case "fighter": cl = "fisher"; break; ! case "fisher": cl = "kataan"; break; ! ! case "kataan": cl = "mage"; break; ! case "mage": cl = "monk"; break; ! case "monk": cl = "rogue"; break; ! case "rogue": HighMortalNews(); return; } *************** *** 91,97 **** news = GetNews(cl); this_player()->SetNews(cl, s); message("news", "\n%^RED%^" + capitalize(cl) + " news:", ! this_player()); message("news", news, this_player()); message("prompt", "Press <return> to continue: ", this_player()); input_to( (: ClassNews, cl :)); --- 91,97 ---- news = GetNews(cl); this_player()->SetNews(cl, s); message("news", "\n%^RED%^" + capitalize(cl) + " news:", ! this_player()); message("news", news, this_player()); message("prompt", "Press <return> to continue: ", this_player()); input_to( (: ClassNews, cl :)); *************** *** 108,114 **** s = stat(NEWS_HM)[1]; if( s != (int)this_player()->GetNews("hm") ) { string news; ! news = GetNews("hm"); this_player()->SetNews("hm", s); message("news", "\n%^RED%^High mortal news:", this_player()); --- 108,114 ---- s = stat(NEWS_HM)[1]; if( s != (int)this_player()->GetNews("hm") ) { string news; ! news = GetNews("hm"); this_player()->SetNews("hm", s); message("news", "\n%^RED%^High mortal news:", this_player()); *************** *** 128,134 **** s = stat(NEWS_AVATAR)[1]; if( s != (int)this_player()->GetNews("avatar") ) { string news; ! news = GetNews("avatar"); this_player()->SetNews("avatar", s); message("news", "\n%^RED%^Avatar news:", this_player()); --- 128,134 ---- s = stat(NEWS_AVATAR)[1]; if( s != (int)this_player()->GetNews("avatar") ) { string news; ! news = GetNews("avatar"); this_player()->SetNews("avatar", s); message("news", "\n%^RED%^Avatar news:", this_player()); *************** *** 148,154 **** s = stat(NEWS_CREATOR)[1]; if( s != (int)this_player()->GetNews("creator") ) { string news; ! news = GetNews("creator"); this_player()->SetNews("creator", s); message("news", "\n%^RED%^Creator news:", this_player()); --- 148,154 ---- s = stat(NEWS_CREATOR)[1]; if( s != (int)this_player()->GetNews("creator") ) { string news; ! news = GetNews("creator"); this_player()->SetNews("creator", s); message("news", "\n%^RED%^Creator news:", this_player()); *************** *** 168,174 **** s = stat(NEWS_ADMIN)[1]; if( s != (int)this_player()->GetNews("admin") ) { string news; ! news = GetNews("admin"); this_player()->SetNews("admin", s); message("news", "\n%^RED%^Admin news:", this_player()); --- 168,174 ---- s = stat(NEWS_ADMIN)[1]; if( s != (int)this_player()->GetNews("admin") ) { string news; ! news = GetNews("admin"); this_player()->SetNews("admin", s); message("news", "\n%^RED%^Admin news:", this_player()); *************** *** 187,219 **** string GetNews(string type) { string file; ! switch(type) { ! case "admin": file = NEWS_ADMIN; break; ! case "avatar": file = NEWS_AVATAR; break; ! case "creator": file = NEWS_CREATOR; break; ! case "general": file = NEWS_GENERAL; break; ! ! case "hm": file = NEWS_HM; break; ! case "newbie": file = NEWS_NEWBIE; break; ! default: file = DIR_NEWS "/" + type; break; } --- 187,219 ---- string GetNews(string type) { string file; ! switch(type) { ! case "admin": file = NEWS_ADMIN; break; ! case "avatar": file = NEWS_AVATAR; break; ! case "creator": file = NEWS_CREATOR; break; ! case "general": file = NEWS_GENERAL; break; ! ! case "hm": file = NEWS_HM; break; ! case "newbie": file = NEWS_NEWBIE; break; ! default: file = DIR_NEWS "/" + type; break; } diff -c -r --new-file ds1.1/lib/daemon/notify.c ds2.0r27/lib/daemon/notify.c *** ds1.1/lib/daemon/notify.c Sun Feb 1 21:30:02 1998 --- ds2.0r27/lib/daemon/notify.c Wed Jul 5 00:00:58 2006 *************** *** 2,47 **** * created by Blitz@Dead Souls 960115 * notification daemon which displays notices to all cres who login */ ! #include <lib.h> #include <save.h> #include "include/notify.h" ! inherit LIB_DAEMON; ! #define MaxTime (3600 * 24 * 60) ! private mixed * Notes; ! static void create() { int x; daemon::create(); SetNoClean(1); Notes = ({}); if( unguarded((: file_size(SAVE_NOTIFY __SAVE_EXTENSION__) :)) > 0 ) ! unguarded((: restore_object(SAVE_NOTIFY) :)); x = sizeof(Notes); while( sizeof(Notes) && (time() - Notes[0][Date]) > MaxTime ) ! Notes -= ({ Notes[0] }); if( x != sizeof(Notes) ) eventSaveNotices(); } ! static int eventSaveNotices() { if( !archp(this_player()) ) return 0; else return unguarded((: save_object(SAVE_NOTIFY) :)); } ! int eventAddNotice(object who, string msg) { object * obs; - int x = time(); if( !who || !sizeof(msg) ) return 0; Notes += ({ ({ time(), (string)who->GetName(), msg }) }); if( sizeof(obs = filter(users() - ({ who }), (: creatorp :))) ) ! obs->eventPrint("["+(string)who->GetName()+" added a new notice]"); if( eventSaveNotices() ) return (sizeof(Notes)); else return 0; } ! int eventRemoveNotice(int x) { mixed var = copy(Notes); if( x < 0 || x > sizeof(Notes) - 1 ) return 0; --- 2,46 ---- * created by Blitz@Dead Souls 960115 * notification daemon which displays notices to all cres who login */ ! #include <lib.h> #include <save.h> #include "include/notify.h" ! inherit LIB_DAEMON; ! #define MaxTime (3600 * 24 * 60) ! private mixed * Notes; ! static void create() { int x; daemon::create(); SetNoClean(1); Notes = ({}); if( unguarded((: file_size(SAVE_NOTIFY __SAVE_EXTENSION__) :)) > 0 ) ! unguarded((: restore_object(SAVE_NOTIFY) :)); x = sizeof(Notes); while( sizeof(Notes) && (time() - Notes[0][Date]) > MaxTime ) ! Notes -= ({ Notes[0] }); if( x != sizeof(Notes) ) eventSaveNotices(); } ! static int eventSaveNotices() { if( !archp(this_player()) ) return 0; else return unguarded((: save_object(SAVE_NOTIFY) :)); } ! int eventAddNotice(object who, string msg) { object * obs; if( !who || !sizeof(msg) ) return 0; Notes += ({ ({ time(), (string)who->GetName(), msg }) }); if( sizeof(obs = filter(users() - ({ who }), (: creatorp :))) ) ! obs->eventPrint("["+(string)who->GetName()+" added a new notice]"); if( eventSaveNotices() ) return (sizeof(Notes)); else return 0; } ! int eventRemoveNotice(int x) { mixed var = copy(Notes); if( x < 0 || x > sizeof(Notes) - 1 ) return 0; *************** *** 49,55 **** if( !eventSaveNotices() ) return (Notes = var), 0; else return 1; } ! int eventPrintNotices(object who, int start_time) { mixed str = ({ "[ %^YELLOW%^"+mud_name()+" Creator Notices %^RESET%^]", "" }); int y = sizeof(Notes); --- 48,54 ---- if( !eventSaveNotices() ) return (Notes = var), 0; else return 1; } ! int eventPrintNotices(object who, int start_time) { mixed str = ({ "[ %^YELLOW%^"+mud_name()+" Creator Notices %^RESET%^]", "" }); int y = sizeof(Notes); *************** *** 57,69 **** if( x < 0 || start_time > Notes[x][Date] ) return 0; while( x > 0 && Notes[x - 1][Date] > start_time ) x--; do str += ({ sprintf("%sAdded %s by %s [id #%d]:\n\t%s%s", ! "%^RESET%^", ctime(Notes[x][Date]), Notes[x][Author], x, ! "%^CYAN%^", Notes[x][Message]), "" }); while( ++x < y ); who->eventPage(str); return 1; } ! int eventWriteNotices(string file, int start_time) { string str = "Dead Souls Notices Text Dump.\n\n"; mixed var; --- 56,68 ---- if( x < 0 || start_time > Notes[x][Date] ) return 0; while( x > 0 && Notes[x - 1][Date] > start_time ) x--; do str += ({ sprintf("%sAdded %s by %s [id #%d]:\n\t%s%s", ! "%^RESET%^", ctime(Notes[x][Date]), Notes[x][Author], x, ! "%^CYAN%^", Notes[x][Message]), "" }); while( ++x < y ); who->eventPage(str); return 1; } ! int eventWriteNotices(string file, int start_time) { string str = "Dead Souls Notices Text Dump.\n\n"; mixed var; *************** *** 72,78 **** if( x < 0 || start_time > Notes[x][Date] ) return 0; while( x > 0 && Notes[x - 1][Date] > start_time ) x--; foreach(var in Notes[x..]) ! str += sprintf("Added %s by %s\n\t%s\n\n", ctime(var[Date]), ! var[Author], var[Message]); return write_file(file, str); } --- 71,77 ---- if( x < 0 || start_time > Notes[x][Date] ) return 0; while( x > 0 && Notes[x - 1][Date] > start_time ) x--; foreach(var in Notes[x..]) ! str += sprintf("Added %s by %s\n\t%s\n\n", ctime(var[Date]), ! var[Author], var[Message]); return write_file(file, str); } diff -c -r --new-file ds1.1/lib/daemon/party.c ds2.0r27/lib/daemon/party.c *** ds1.1/lib/daemon/party.c Sun Feb 1 21:30:03 1998 --- ds2.0r27/lib/daemon/party.c Wed Jul 5 00:00:58 2006 *************** *** 25,40 **** if( !(p = Parties[pname]) ) return "No such party exists."; if( p->Leader != who ) ! return "You must be the party leader in order to change leaders."; if( member_array(targ, p->Members) == -1 ) ! return (string)targ->GetName() + " is not in the party."; return 1; } mixed CanCreateParty(object who, string name) { if( Parties[name] ) return "A party by that name already exists."; if( member_array(name, (string *)CHAT_D->GetChannels()) != -1 ) ! return "You cannot use the name " + name + " for your party."; if( (string)who->GetParty() ) return "You are already in a party!"; return 1; } --- 25,40 ---- if( !(p = Parties[pname]) ) return "No such party exists."; if( p->Leader != who ) ! return "You must be the party leader in order to change leaders."; if( member_array(targ, p->Members) == -1 ) ! return (string)targ->GetName() + " is not in the party."; return 1; } mixed CanCreateParty(object who, string name) { if( Parties[name] ) return "A party by that name already exists."; if( member_array(name, (string *)CHAT_D->GetChannels()) != -1 ) ! return "You cannot use the name " + name + " for your party."; if( (string)who->GetParty() ) return "You are already in a party!"; return 1; } *************** *** 45,65 **** pname = (string)who->GetParty(); if( !Parties[pname] ) return "There is no such party!"; if( ((class party)Parties[pname])->Leader != who ) ! return "Only the party leader may add members!"; if( (string)member->GetParty() ) ! return (string)member->GetName() + " is already in a party."; if( environment(member) != environment(who) ) ! return (string)member->GetName() + " must be somewhere near you."; return 1; } mixed CanJoinParty(object who, string pname) { if( !Parties[pname] ) return "There is no such party."; if( member_array(who, ((class party)Parties[pname])->Invited) == -1 ) ! return "You have not been invited to join that party."; if( (string)who->GetParty() ) return "You are already in a party."; if( environment(who) != environment(((class party)Parties[pname])->Leader) ) ! return "You are nowhere the leader of the party."; return 1; } --- 45,65 ---- pname = (string)who->GetParty(); if( !Parties[pname] ) return "There is no such party!"; if( ((class party)Parties[pname])->Leader != who ) ! return "Only the party leader may add members!"; if( (string)member->GetParty() ) ! return (string)member->GetName() + " is already in a party."; if( environment(member) != environment(who) ) ! return (string)member->GetName() + " must be somewhere near you."; return 1; } mixed CanJoinParty(object who, string pname) { if( !Parties[pname] ) return "There is no such party."; if( member_array(who, ((class party)Parties[pname])->Invited) == -1 ) ! return "You have not been invited to join that party."; if( (string)who->GetParty() ) return "You are already in a party."; if( environment(who) != environment(((class party)Parties[pname])->Leader) ) ! return "You are nowhere the leader of the party."; return 1; } *************** *** 70,76 **** pname = (string)who->GetParty(); if( !pname || !(p = Parties[pname]) ) return "There is no such party."; if( member_array(who, p->Members) == -1 ) ! return "You are not in that party."; return 1; } --- 70,76 ---- pname = (string)who->GetParty(); if( !pname || !(p = Parties[pname]) ) return "There is no such party."; if( member_array(who, p->Members) == -1 ) ! return "You are not in that party."; return 1; } *************** *** 81,87 **** pname = (string)who->GetParty(); if( !(p = Parties[pname]) ) return "There is no such party."; if( p->Leader != who ) return "Only the party leader may remove people."; ! return 1; } mixed CanRemoveParty(object who) { --- 81,87 ---- pname = (string)who->GetParty(); if( !(p = Parties[pname]) ) return "There is no such party."; if( p->Leader != who ) return "Only the party leader may remove people."; ! return 1; } mixed CanRemoveParty(object who) { *************** *** 91,97 **** pname = (string)who->GetParty(); if( !(p = Parties[pname]) ) return "There is no such party!"; if( p->Leader != who ) ! return "Only the party leader may disband the party."; return 1; } --- 91,97 ---- pname = (string)who->GetParty(); if( !(p = Parties[pname]) ) return "There is no such party!"; if( p->Leader != who ) ! return "Only the party leader may disband the party."; return 1; } *************** *** 103,109 **** p = Parties[pname]; p->Leader = targ; CHAT_D->eventSend("System", pname, (string)targ->GetName() + " is now " ! "the leader."); return 1; } --- 103,109 ---- p = Parties[pname]; p->Leader = targ; CHAT_D->eventSend("System", pname, (string)targ->GetName() + " is now " ! "the leader."); return 1; } *************** *** 111,117 **** class party this_party; if( (string)who->SetParty(name) != name ) ! return "There was some bizarre problem sticking you in a party."; this_party = new(class party); this_party->Leader = who; this_party->Members = ({ who }); --- 111,117 ---- class party this_party; if( (string)who->SetParty(name) != name ) ! return "There was some bizarre problem sticking you in a party."; this_party = new(class party); this_party->Leader = who; this_party->Members = ({ who }); *************** *** 123,155 **** mixed eventInviteMember(object who, object targ) { class party this_party; - mixed tmp; string name; name = (string)who->GetParty(); this_party = Parties[name]; this_party->Invited += ({ targ }); CHAT_D->eventSendChannel("System", name, (string)targ->GetName() + ! " has been invited to join the party."); call_out((: RemoveInvitiation :), 60, name, targ); targ->eventPrint("You have been invited to join the party \"" + name + ! "\".\nType \"party join " + name + "\" in 60 " ! "seconds to join.", MSG_SYSTEM); return 1; } mixed eventJoinParty(object who, string name) { class party this_party; mixed tmp; ! if( (tmp = CanJoinParty(who, name)) != 1 ) return tmp; this_party = Parties[name]; if( (string)who->SetParty(name) != name ) ! return "Bogus error in joining party."; this_party->Invited -= ({ who }); this_party->Members += ({ who }); CHAT_D->eventSendChannel("System", name, (string)who->GetName() + ! " has joined the party."); return 1; } --- 123,154 ---- mixed eventInviteMember(object who, object targ) { class party this_party; string name; name = (string)who->GetParty(); this_party = Parties[name]; this_party->Invited += ({ targ }); CHAT_D->eventSendChannel("System", name, (string)targ->GetName() + ! " has been invited to join the party."); call_out((: RemoveInvitiation :), 60, name, targ); targ->eventPrint("You have been invited to join the party \"" + name + ! "\".\nType \"party join " + name + "\" in 60 " ! "seconds to join.", MSG_SYSTEM); return 1; } mixed eventJoinParty(object who, string name) { class party this_party; mixed tmp; ! if( (tmp = CanJoinParty(who, name)) != 1 ) return tmp; this_party = Parties[name]; if( (string)who->SetParty(name) != name ) ! return "Bogus error in joining party."; this_party->Invited -= ({ who }); this_party->Members += ({ who }); CHAT_D->eventSendChannel("System", name, (string)who->GetName() + ! " has joined the party."); return 1; } *************** *** 171,177 **** else { p->Leader = ob; ob->eventPrint("You are now the leader of the party " + name + ! ".", MSG_SYSTEM); } } } --- 170,176 ---- else { p->Leader = ob; ob->eventPrint("You are now the leader of the party " + name + ! ".", MSG_SYSTEM); } } } *************** *** 179,188 **** if( Parties[name] ) { p->Members -= ({ targ }); CHAT_D->eventSendChannel("System", name, (string)targ->GetName() + ! " is no longer in the party."); } targ->eventPrint("You are no longer a member of the party " + name + ! ".", MSG_SYSTEM); return 1; } --- 178,187 ---- if( Parties[name] ) { p->Members -= ({ targ }); CHAT_D->eventSendChannel("System", name, (string)targ->GetName() + ! " is no longer in the party."); } targ->eventPrint("You are no longer a member of the party " + name + ! ".", MSG_SYSTEM); return 1; } *************** *** 192,200 **** name = (string)who->GetParty(); CHAT_D->eventSendChannel("System", name, "The party " + name + " has been " ! "disbanded."); foreach(ob in ((class party)Parties[name])->Members) ! ob->SetParty(0); map_delete(Parties, name); return 1; } --- 191,199 ---- name = (string)who->GetParty(); CHAT_D->eventSendChannel("System", name, "The party " + name + " has been " ! "disbanded."); foreach(ob in ((class party)Parties[name])->Members) ! ob->SetParty(0); map_delete(Parties, name); return 1; } *************** *** 202,208 **** object GetPartyLeader(string name) { class party p; string nom; ! foreach(nom, p in Parties) if( nom == name ) return p->Leader; return 0; } --- 201,207 ---- object GetPartyLeader(string name) { class party p; string nom; ! foreach(nom, p in Parties) if( nom == name ) return p->Leader; return 0; } *************** *** 218,223 **** static void RemoveInvitiation(string name, object who) { if( !Parties[name] ) return; if( member_array(who, ((class party)Parties[name])->Invited) == -1 ) ! return; ((class party)Parties[name])->Invited -= ({ who }); } --- 217,222 ---- static void RemoveInvitiation(string name, object who) { if( !Parties[name] ) return; if( member_array(who, ((class party)Parties[name])->Invited) == -1 ) ! return; ((class party)Parties[name])->Invited -= ({ who }); } diff -c -r --new-file ds1.1/lib/daemon/preload_check.c ds2.0r27/lib/daemon/preload_check.c *** ds1.1/lib/daemon/preload_check.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/daemon/preload_check.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,24 ---- + #include <lib.h> + #include <daemons.h> + #include <cfg.h> + + inherit LIB_DAEMON; + + string *preloads; + + static void checkPreloads(){ + foreach(string daemon in preloads){ + if(!find_object(daemon) && daemon != INTERMUD_D && + daemon != AUTOEXEC_D) + update(daemon); + } + call_out((: checkPreloads :), 300); + } + + static void create() { + daemon::create(); + SetNoClean(1); + preloads = filter(explode(read_file(CFG_PRELOAD),"\n"), (: !grepp($1,"#") :) ); + call_out((: checkPreloads :), 300); + } + diff -c -r --new-file ds1.1/lib/daemon/races.c ds2.0r27/lib/daemon/races.c *** ds1.1/lib/daemon/races.c Sun Feb 1 21:29:54 1998 --- ds2.0r27/lib/daemon/races.c Wed Jul 5 00:00:58 2006 *************** *** 3,63 **** * handles race configuration and administration * created by Descartes of Borg 960108 * Version: @(#) races.c 1.4@(#) ! * Last modified: 96/11/10 */ #include <lib.h> #include <save.h> #include <privs.h> #include "include/races.h" inherit LIB_DAEMON; private mapping Races = ([]); static private mapping Resistances = ([]); ! static private mapping Armours = ([]); static void create() { string array lines; ! daemon::create(); if( unguarded((: file_size(SAVE_RACES __SAVE_EXTENSION__) :)) > 0 ) unguarded((: restore_object(SAVE_RACES) :)); if( !Races ) Races = ([]); ! // Hocus pocus to load armour and resistance info ! lines = explode(read_file("/include/armour_types.h"), "\n"); foreach(string line in lines) { string type; if( sscanf(line, "#define %s %*s", type) == 2 ) { string file = DIR_DAEMONS "/tmp/" + type + ".c"; ! if( type == "A_MAX_ARMOUR_BIT" ) { continue; } if( !file_exists(file) ) { ! unguarded((: write_file($(file), "#include <armour_types.h>\n" ! "int armour() { return " + ! $(type) + "; }\n") :)); } ! Armours[type] = call_other(file, "armour"); } } lines = explode(read_file("/include/damage_types.h"), "\n"); foreach(string line in lines) { string type; if( sscanf(line, "#define %s %*s", type) == 2 ) { string file = DIR_DAEMONS "/tmp/" + type + ".c"; - if( type == "MAX_DAMAGE_BIT" ) { continue; } if( !file_exists(file) ) { unguarded((: write_file($(file), "#include <damage_types.h>\n" ! "int damage() { return " + ! $(type) + "; }\n") :)); } Resistances[type] = call_other(file, "damage"); } } --- 3,83 ---- * handles race configuration and administration * created by Descartes of Borg 960108 * Version: @(#) races.c 1.4@(#) ! * Fixed by Ashon @ Stargate Atlantis 16 March 2006 */ #include <lib.h> #include <save.h> #include <privs.h> + #include <armor_types.h> #include "include/races.h" inherit LIB_DAEMON; private mapping Races = ([]); static private mapping Resistances = ([]); ! static private mapping Armors = ([]); ! string array FlyingRaces = ({"wtf"}); ! string array LimblessCombatRaces = ({}); ! string array LimblessRaces = ({}); ! string array NonBitingRaces = ({}); ! ! ! string wtf = "/tmp/wtf.txt"; ! static void create() { string array lines; ! daemon::create(); + if( unguarded((: file_size(SAVE_RACES __SAVE_EXTENSION__) :)) > 0 ) unguarded((: restore_object(SAVE_RACES) :)); + if( !Races ) Races = ([]); ! if(!FlyingRaces) FlyingRaces = ({}); ! if(!LimblessCombatRaces) LimblessCombatRaces = ({}); ! if(!LimblessRaces) LimblessRaces = ({}); ! if(!NonBitingRaces) NonBitingRaces = ({}); ! ! // Hocus pocus to load armor and resistance info ! lines = explode(read_file("/include/armor_types.h"), "\n"); foreach(string line in lines) { string type; if( sscanf(line, "#define %s %*s", type) == 2 ) { string file = DIR_DAEMONS "/tmp/" + type + ".c"; ! if( type == "A_MAX_ARMOR_BIT" ) { continue; } + if( !file_exists(file) ) { ! unguarded((: write_file($(file), "#include <armor_types.h>\n" ! "int armor() { return " + ! $(type) + "; }\n") :)); } ! ! Armors[type] = call_other(file, "armor"); } } + lines = explode(read_file("/include/damage_types.h"), "\n"); foreach(string line in lines) { string type; if( sscanf(line, "#define %s %*s", type) == 2 ) { string file = DIR_DAEMONS "/tmp/" + type + ".c"; if( type == "MAX_DAMAGE_BIT" ) { continue; } + if( !file_exists(file) ) { unguarded((: write_file($(file), "#include <damage_types.h>\n" ! "int damage() { return " + ! $(type) + "; }\n") :)); } + Resistances[type] = call_other(file, "damage"); } } *************** *** 68,313 **** error("Illegal attempt to modify race data"); } ! void AddRace(string file, int player) { ! class Race res; ! string array lines, tmp; ! string race; ! ! validate(); ! if( !file_exists(file) ) error("No such file: " + file); ! lines = explode(read_file(file), "\n"); ! lines = filter(lines, function(string str) { ! if( strlen(str) == 0 ) { ! return 0; ! } ! if( str[0] == '#' ) { ! return 0; ! } ! if( str[0] == ' ' || str[0] == '\t' ) { ! return 0; ! } ! return 1; ! }); ! race = lines[0]; ! if( Races[race] ) error("Race already exists"); ! res = new(class Race); ! res->Sensitivity = map(explode(lines[1], ":"), (: to_int :)); ! res->Language = lines[2]; ! lines = lines[3..]; ! res->Resistance = ([]); ! while(sizeof(tmp = explode(lines[0], ":")) == 2) { ! int x = to_int(tmp[0]); ! ! if( x == 0 && tmp[0] != "0" ) x = GetResistance(tmp[0]); ! res->Resistance[x] = tmp[1]; ! lines = lines[1..]; ! } ! res->Stats = ([]); ! while(sizeof(tmp = explode(lines[0], ":")) == 3) { ! class Stat s = new (class Stat); ! s->Average = to_int(tmp[1]); ! s->Class = to_int(tmp[2]); ! res->Stats[tmp[0]] = s; ! lines = lines[1..]; ! } ! res->Limbs = ({}); ! while(sizeof(tmp = explode(lines[0], ":")) == 4) { ! mixed array limb = allocate(4); ! limb[0] = tmp[0]; ! limb[1] = (tmp[1] == "0" ? 0 : tmp[1]); ! limb[2] = to_int(tmp[2]); ! limb[3] = map(explode(tmp[3], ","), function(string str) { ! int x = to_int(str); ! ! if( x == 0 && str != "0" ) ! return GetArmour(str); ! return x; ! }); ! res->Limbs = ({ res->Limbs..., limb }); ! if( sizeof(lines) > 1 ) lines = lines[1..]; ! else { ! lines = ({}); ! break; ! } ! } ! res->Fingers = ([]); ! if( sizeof(lines) ) { ! foreach(string hand in lines) { ! string array parts = explode(hand, ":"); ! res->Fingers[parts[0]] = to_int(parts[1]); ! } ! } ! res->Complete = 1; ! if( player ) { ! res->PlayerFlag = 1; ! } ! else { ! res->PlayerFlag = 0; ! } ! Races[race] = res; ! save_object(SAVE_RACES); } ! void RemoveRace(string race) { ! validate(); ! map_delete(Races, race); ! save_object(SAVE_RACES); } ! int GetArmour(string str) { ! string file = DIR_DAEMONS "/tmp/" + str + ".c"; ! ! if( !unguarded((: file_exists($(file)) :)) ) { ! unguarded((: write_file($(file), "#include <armour_types.h>\n" + ! "int armour() { return " + $(str) + "; }\n") :)); ! } ! return call_other(file, "armour"); } ! int GetResistance(string str) { ! string file = DIR_DAEMONS "/tmp/" + str + ".c"; ! ! if( !unguarded((: file_exists($(file)) :)) ) { ! unguarded((: write_file($(file), "#include <damage_types.h>\n" + ! "int damage() { return " + $(str) + "; }\n") :)); ! } ! return call_other(file, "damage"); } ! mapping GetRemoteRaces() { ! mapping mp = ([]); ! foreach(string race, class Race res in Races) { ! mapping stats = ([]); ! mp[race] = ([]); ! mp[race]["limbs"] = res->Limbs; ! mp[race]["resistance"] = res->Resistance; ! foreach(string stat, class Stat st in res->Stats) { ! stats[stat] = ([]); ! stats[stat]["class"] = st->Class; ! stats[stat]["average"] = st->Average; ! } ! mp[race]["stats"] = stats; ! mp[race]["fingers"] = res->Fingers; ! mp[race]["sensitivity"] = res->Sensitivity; ! mp[race]["player"] = res->PlayerFlag; ! mp[race]["language"] = res->Language; ! } ! return mp; } ! void SetComplete(string race) { ! class Race res; ! ! validate(); ! if( !Races[race] ) error("No such race"); ! else res = Races[race]; ! res->Complete = 1; ! save_object(SAVE_RACES); } ! void SetLightSensitivity(string race, int array sensitivity) { class Race res; ! validate(); - if( !Races[race] ) error("No such race"); - else res = Races[race]; - if( sensitivity[0] < 1 ) error("Invalid sensitivity value"); - if( sensitivity[1] > 99 ) error("Invalid sensitivity value"); - if( sensitivity[0] > sensitivity[1] ) error("Invalid sensitivity value"); - res->Sensitivity = sensitivity; - save_object(SAVE_RACES); - } - - void SetCharacterLimbs(string race, mixed array args) { - class Race res = Races[race]; - mixed array tmp = ({}); - - if( !res || !res->Complete || sizeof(args) != 2 ) return; - args[0] = copy(res->Limbs); - foreach(string finger, int count in res->Fingers) - tmp = ({ tmp..., ({ finger, count }) }); - args[1] = tmp; - } - - void SetCharacterRace(string race, mixed array args) { - class Race res = Races[race]; - mixed array tmp; - - if( !res || !res->Complete || sizeof(args) != 4 ) return; - tmp = ({}); - foreach(int key, string val in res->Resistance) - tmp = ({ tmp..., ({ key, val }) }); - args[0] = tmp; - tmp = ({}); - foreach(string key, class Stat stat in res->Stats) - tmp = ({ tmp..., ({ key, stat->Average, stat->Class }) }); - args[1] = tmp; - args[2] = res->Language; - args[3] = ({ res->Sensitivity[0], res->Sensitivity[1] }); - } - - varargs string array GetRaces(int player_only) { - return filter(keys(Races), function(string race, int player_only) { - class Race res = Races[race]; - - if( !res->Complete ) return 0; - if( player_only && !res->PlayerFlag ) - return 0; - return 1; - }, player_only); - } - - string GetHelp(string race) { - class Race res = Races[race]; - string array limbs; - string help = "Race: " + race + "\n\n"; - string tmp; - int x; - - if( !res ) return 0; - limbs = map(res->Limbs, (: $1[0] :)); - help += "Limbs:\n"; - help += capitalize(item_list(map(limbs, (: add_article :)))) + ".\n"; - help += "\nFingered limbs:\n"; - foreach(string finger, int count in res->Fingers) - help += "\t" + finger + " (" + count + ")\n"; - limbs = regexp(limbs, ".* wing"); - if( sizeof(limbs) ) { - help += "\nFlying\n"; - } - else { - help += "\nNon-flying\n"; - } - x = res->Sensitivity[0]; - if( x < 11 ) tmp = "excellent"; - else if( x < 16 ) tmp = "above average"; - else if( x < 21 ) tmp = "good"; - else if( x < 26 ) tmp = "average"; - else if( x < 31 ) tmp = "below average"; - else if( x < 36 ) tmp = "very poor"; - else tmp = "extremely poor"; - help += "\nNight vision: " + tmp + "\n"; - x = res->Sensitivity[1]; - if( x < 61 ) tmp = "extremely poor"; - else if( x < 66 ) tmp = "very poor"; - else if( x < 71 ) tmp = "below average"; - else if( x < 76 ) tmp = "average"; - else if( x < 81 ) tmp = "good"; - else if( x < 86 ) tmp = "above average"; - else tmp = "excellent"; - help += "Day vision: " + tmp + "\n\n"; - return help; - } ! public mapping GetResistances() { ! return copy(Resistances); ! } - public mapping GetArmours() { - return copy(Armours); - } --- 88,508 ---- error("Illegal attempt to modify race data"); } ! int CanFly(string str){ ! if( !Races[str] ) return 0; ! if(member_array(str, FlyingRaces) != -1) return 1; ! else return 0; ! } ! int GetLimblessCombatRace(string str){ ! if(member_array(str,LimblessCombatRaces) == -1) return 0; ! else return 1; ! } ! int GetLimblessRace(string str){ ! if(member_array(str,LimblessRaces) == -1) return 0; ! else return 1; ! } ! int SetLimblessCombatRace(string str){ ! if(member_array(str,LimblessCombatRaces) != -1) return 0; ! LimblessCombatRaces += ({ lower_case(str) }); ! return 1; } ! int SetLimblessRace(string str){ ! if(member_array(str,LimblessRaces) != -1) return 0; ! LimblessRaces += ({ lower_case(str) }); ! return 1; } ! int SetFlyingRace(string str){ ! //if(member_array(str,FlyingRaces) != -1) return 0; ! FlyingRaces += ({ str }); ! return 1; } ! int SetNonBitingRace(string str){ ! //if(member_array(str,FlyingRaces) != -1) return 0; ! NonBitingRaces += ({ str }); ! return 1; } ! string *GetLimblessCombatRaces(){ ! return LimblessCombatRaces; ! } ! string *GetLimblessRaces(){ ! return LimblessRaces; ! } ! string *GetFlyingRaces(){ ! return FlyingRaces; } ! int GetBitingRace(string str){ ! if(member_array(str,NonBitingRaces) == -1) return 1; ! else return 0; } ! void AddRace(string file, int player) { class Race res; ! string array lines, tmp, parts; ! string race, test_string; ! int i, x; ! mixed array limb = allocate(4); ! mixed array tmp_limb = allocate(4); ! class Stat s; ! ! //tc("hello."); ! //tc("hellow"); ! ! res = new(class Race); ! ! res->Resistance = ([]); ! res->Skills = ([]); ! res->Stats = ([]); ! res->Limbs = ({}); ! validate(); ! if( !file_exists(file) ) error("No such file: " + file); ! race = last_string_element(file,"/"); ! //tc("race: "+race); ! ! lines = explode(read_file(file), "\n"); ! ! lines = filter(lines, function(string str) { ! if( strlen(str) == 0 ) { ! return 0; ! } ! if( str[0] == '#' ) { ! return 0; ! } ! if( str[0] == ' ' || str[0] == '\t' ) { ! return 0; ! } ! return 1; ! }); ! ! res->Fingers = ([]); ! ! ! foreach(string line in explode(read_file(file),"\n")){ ! //tc("line: "+line,"red"); ! //tc("first_string_element: "+first_string_element(line," "),"green"); ! test_string = first_string_element(line," "); ! if(!test_string || !sizeof(test_string)) test_string = line; ! ! //tc("test_string: "+test_string,"green"); ! ! switch(test_string){ ! ! case "FLYINGRACE": ! //tc("flying","red"); ! SetFlyingRace(race); ! break; ! ! case "LIMBLESSRACE": ! //tc("limbless","red"); ! SetLimblessRace(race); ! break; ! ! case "LIMBLESSCOMBATRACE": ! //tc("limblesscombat","red"); ! SetLimblessCombatRace(race); ! break; ! ! case "NONBITINGRACE": ! //tc("nonbiting","red"); ! SetNonBitingRace(race); ! break; ! ! case "RACE": ! race = replace_string(line, "RACE ", ""); ! if( Races[race] ) error(race+": Race already exists"); ! break; ! ! case "SENSITIVITY": ! line = replace_string(line, "SENSITIVITY ", ""); ! res->Sensitivity = map(explode(line, ":"), (: to_int :)); ! break; ! ! case "PLAYER_RACE": ! line = replace_string(line, "PLAYER_RACE ", ""); ! if(!player && to_int(line) > 0) player = 1; ! break; ! ! case "LANGUAGE": ! //TODO: This should be a Language array to handle multiple ! //languages but further research is required first. ! res->Language = replace_string(line, "LANGUAGE ", ""); ! //tc("res->Language "+res->Language,"blue"); ! break; ! ! case "RESISTANCE": ! tmp = explode(replace_string(line, "RESISTANCE ", ""), ":"); ! x = to_int(tmp[0]); ! if( x == 0 && tmp[0] != "0" ) x = GetResistance(tmp[0]); ! res->Resistance[x] = tmp[1]; ! break; ! ! case "SKILL": ! tmp = explode(replace_string(line, "SKILL ", ""), ":"); ! //tc("tmp: "+identify(tmp)); ! res->Skills[tmp[0]] = ({ tmp[1], tmp[2], tmp[3], tmp[4] }); ! break; ! ! case "STATS": ! tmp = ({}); ! s = new (class Stat); ! tmp = explode(replace_string(line, "STATS ",""), ":"); ! //tc("stat: "+identify(tmp),"yellow"); ! s->Average = copy(to_int(tmp[1])); ! s->Class = copy(to_int(tmp[2])); ! res->Stats[tmp[0]] = s; ! //tc("ihnfcaa: "+(res->Stats[tmp[0]])->Average,"yellow"); ! //tc("ihnfcaax2: "+(res->Stats[tmp[0]])->Class,"yellow"); ! break; ! ! case "LIMB": ! limb = ({ ({}), ({}), ({}), ({}) }); ! tmp_limb = explode(replace_string(line, "LIMB ",""), ":"); ! //tc("tmp_limb: "+identify(tmp_limb),"cyan"); ! limb[0] = tmp_limb[0]; ! limb[1] = (tmp_limb[1] == "0" ? 0 : tmp_limb[1]); ! limb[2] = to_int(tmp_limb[2]); ! limb[3] = map(explode(tmp_limb[3], ","), function(string str) { ! int x = to_int(str); ! if( x == 0 && str != "0" ) { return GetArmor(str); } ! return x; ! }); ! //tc("limb: "+identify(limb),"green"); ! ! res->Limbs = ({ res->Limbs..., limb }); ! res->Limbs += ({limb}); ! break; ! ! case "HAND": ! parts = explode(replace_string(line, "HAND ",""), ":"); ! res->Fingers[parts[0]] = to_int(parts[1]); ! break; ! ! default: ! break; ! } ! } ! ! //tc("ok then.","blue"); ! ! res->Complete = 1; ! ! if( player ) { ! res->PlayerFlag = 1; ! } ! ! else { ! res->PlayerFlag = 0; ! } ! ! Races[race] = res; ! wtf = save_variable(Races[race]); ! //tc("wtf: "+identify(wtf),"yellow"); ! save_object(SAVE_RACES); ! } ! ! void RemoveRace(string race) { ! validate(); ! wtf = save_variable(Races[race]); ! //tc("wtf: "+identify(wtf),"yellow"); ! map_delete(Races, race); ! if(Races[race]) //tc("wtf: "+identify(wtf),"blue"); ! save_object(SAVE_RACES); ! } ! ! ! int GetArmor(string str) { ! string file = DIR_DAEMONS "/tmp/" + str + ".c"; ! ! if( !unguarded((: file_exists($(file)) :)) ) { ! unguarded((: write_file($(file), "#include <armor_types.h>\n" + ! "int armor() { return " + $(str) + "; }\n") :)); ! } ! return call_other(file, "armor"); ! } ! ! int GetResistance(string str) { ! string file = DIR_DAEMONS "/tmp/" + str + ".c"; ! ! if( !unguarded((: file_exists($(file)) :)) ) { ! unguarded((: write_file($(file), "#include <damage_types.h>\n" + ! "int damage() { return " + $(str) + "; }\n") :)); ! } ! return call_other(file, "damage"); ! } ! ! varargs mapping GetRemoteRaces(string str) { ! mapping mp = ([]); ! mapping foo = ([]); ! ! if(str && Races[str]) foo[str] = Races[str]; ! else foo = copy(Races); ! ! foreach(string race, class Race res in foo) { ! mapping stats = ([]); ! ! mp[race] = ([]); ! mp[race]["limbs"] = res->Limbs; ! mp[race]["resistance"] = res->Resistance; ! ! foreach(string stat, class Stat st in res->Stats) { ! stats[stat] = ([]); ! stats[stat]["class"] = st->Class; ! stats[stat]["average"] = st->Average; ! } ! ! mp[race]["stats"] = stats; ! mp[race]["fingers"] = res->Fingers; ! mp[race]["sensitivity"] = res->Sensitivity; ! mp[race]["player"] = res->PlayerFlag; ! mp[race]["language"] = res->Language; ! ! } ! return mp; ! } ! ! void SetComplete(string race) { ! class Race res; ! ! validate(); ! ! if( !Races[race] ) error("No such race"); ! else res = Races[race]; ! res->Complete = 1; ! save_object(SAVE_RACES); ! } ! ! void SetLightSensitivity(string race, int array sensitivity) { ! class Race res; ! ! validate(); ! ! if( !Races[race] ) error("No such race"); ! else res = Races[race]; ! if( sensitivity[0] < 1 ) error("Invalid sensitivity value"); ! if( sensitivity[1] > 99 ) error("Invalid sensitivity value"); ! if( sensitivity[0] > sensitivity[1] ) error("Invalid sensitivity value"); ! res->Sensitivity = sensitivity; ! save_object(SAVE_RACES); ! } ! ! void SetCharacterLimbs(string race, mixed array args) { ! class Race res = Races[race]; ! mixed array tmp = ({}); ! ! if( !res || !res->Complete || sizeof(args) != 2 ) return; ! args[0] = copy(res->Limbs); ! foreach(string finger, int count in res->Fingers) ! tmp = ({ tmp..., ({ finger, count }) }); ! args[1] = tmp; ! } ! ! void SetCharacterRace(string race, mixed array args) { ! class Race res = Races[race]; ! mixed array tmp; ! mapping StatMap; ! string schluss; ! ! if( !res || !res->Complete || sizeof(args) != 5 ) return; ! tmp = ({}); ! foreach(int key, string val in res->Resistance) ! tmp = ({ tmp..., ({ key, val }) }); ! args[0] = tmp; ! tmp = ({}); ! //foreach(string key, class Stat stat in res->Stats){ ! StatMap = copy(res->Stats); ! schluss = ""; ! foreach(schluss in keys(StatMap)){ ! //tc("key: "+identify(StatMap[schluss]),"green"); ! //tc("Average: "+identify(StatMap[schluss]->Average),"green"); ! //tc("Class: "+identify(StatMap[schluss]->Class),"green"); ! tmp = ({ tmp..., ({ schluss, StatMap[schluss]->Average, StatMap[schluss]->Class }) }); ! //tc("SetCharacterRace: "+identify(tmp)); ! } ! args[1] = tmp; ! args[2] = res->Language; ! //args[3] = ({ res->Sensitivity[0], res->Sensitivity[1] }); ! args[3] = res->Sensitivity; ! args[4] = res->Skills; ! } ! ! varargs string array GetRaces(int player_only) { ! ! return filter(keys(Races), function(string race, int player_only) { ! class Race res = Races[race]; ! ! if( !res->Complete ) return 0; ! if( player_only && !res->PlayerFlag ) ! return 0; ! return 1; ! }, player_only); ! } ! ! string GetHelp(string race) { ! class Race res = Races[race]; ! string array limbs; ! string help = "Race: " + race + "\n\n"; ! string tmp, h_file; ! int x; ! ! if( !res ) return 0; ! h_file = "/doc/help/races/"+lower_case(race); ! if(file_exists(h_file)) return read_file(h_file); ! limbs = map(res->Limbs, (: $1[0] :)); ! limbs = singular_array(limbs); ! help += "Limbs:\n"; ! help += capitalize(item_list(map(limbs, (: add_article :)))) + ".\n"; ! help += "\nFingered limbs:\n"; ! foreach(string finger, int count in res->Fingers) ! help += "\t" + finger + " (" + count + ")\n"; ! limbs = regexp(limbs, ".* wing"); ! if( sizeof(limbs) ) { ! help += "\nFlying\n"; ! } ! ! else { ! help += "\nNon-flying\n"; ! } ! ! x = res->Sensitivity[0]; ! if( x < 11 ) tmp = "excellent"; ! else if( x < 16 ) tmp = "above average"; ! else if( x < 21 ) tmp = "good"; ! else if( x < 26 ) tmp = "average"; ! else if( x < 31 ) tmp = "below average"; ! else if( x < 36 ) tmp = "very poor"; ! else tmp = "extremely poor"; ! help += "\nNight vision: " + tmp + "\n"; ! x = res->Sensitivity[1]; ! if( x < 61 ) tmp = "extremely poor"; ! else if( x < 66 ) tmp = "very poor"; ! else if( x < 71 ) tmp = "below average"; ! else if( x < 76 ) tmp = "average"; ! else if( x < 81 ) tmp = "good"; ! else if( x < 86 ) tmp = "above average"; ! else tmp = "excellent"; ! help += "Day vision: " + tmp + "\n\n"; ! return help; ! } ! ! public mapping GetResistances() { ! return copy(Resistances); ! } ! ! ! ! public mapping GetArmors() { ! return copy(Armors); ! } ! diff -c -r --new-file ds1.1/lib/daemon/reaper.c ds2.0r27/lib/daemon/reaper.c *** ds1.1/lib/daemon/reaper.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/daemon/reaper.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,23 ---- + /* + * Seeks dummy items without an environment and destroys them. + * Hackey workaround to sloppy code I'm still tracking down. + * -Crat 21Jan06 + */ + + #include <lib.h> + + inherit LIB_DAEMON; + + static void eventReap() { + + call_out((: eventReap :), 300); + + reap_dummies(); + } + + static void create() { + daemon::create(); + SetNoClean(1); + call_out((: eventReap :), 300); + } + diff -c -r --new-file ds1.1/lib/daemon/seasons.c ds2.0r27/lib/daemon/seasons.c *** ds1.1/lib/daemon/seasons.c Sun Feb 1 21:29:57 1998 --- ds2.0r27/lib/daemon/seasons.c Wed Jul 5 00:00:58 2006 *************** *** 14,19 **** --- 14,20 ---- inherit LIB_DAEMON; private static int CurrentDay, CurrentYear, Dawn, Morning, Twilight, Night; + private static int ticktock; private static string CurrentSeason, TimeOfDay; private static mapping Moons; private static class month CurrentMonth; *************** *** 22,27 **** --- 23,42 ---- private static function *NightCalls, *MidnightCalls; private static class month *Months; + int eventTickTock(int tick){ + if(!tick) tick = 0; + ticktock = tick; + eventConfigure(); + return GetCurrentTime()/1200; + } + + int GetTickTock(){ return ticktock; } + + int *GetMudTime(){ + return ({ GetHour(GetCurrentTime()), GetMinutes(GetCurrentTime()) }); + } + + static void create() { string *lines; int i, maxi; *************** *** 32,63 **** TwilightCalls = ({}); NightCalls = ({}); MidnightCalls = ({}); maxi = sizeof(lines = filter(explode(read_file(CFG_MONTHS), "\n"), ! (: $1 && $1 != "" && $1[0] != '#' :))); Months = allocate(maxi); for(i=0; i<maxi; i++) { ! Months[i] = new(class month); ! sscanf(lines[i], "%s:%s:%d:%d",((class month)Months[i])->Name, ! ((class month)Months[i])->Season, ! ((class month)Months[i])->Days, ! ((class month)Months[i])->DaylightHours); } Days = filter(explode(read_file(CFG_DAYS), "\n"), ! (: $1 && $1 != "" && $1[0] != '#' :)); maxi = sizeof(lines = filter(explode(read_file(CFG_MOONS), "\n"), ! (: $1 && $1 != "" && $1[0] != '#' :))); Moons = allocate_mapping(maxi); for(i=0; i<maxi; i++) { ! string nom, id, desc, lnom; ! int phase; ! sscanf(lines[i], "%s:%d:%s:%s", nom, phase, id, desc); ! lnom = convert_name(nom); ! Moons[lnom] = new(class moon); ! ((class moon)Moons[lnom])->Name = nom; ! ((class moon)Moons[lnom])->Phase = phase; ! ((class moon)Moons[lnom])->Id = id; ! ((class moon)Moons[lnom])->Description = desc; } eventConfigure(); } --- 47,79 ---- TwilightCalls = ({}); NightCalls = ({}); MidnightCalls = ({}); + ticktock = 0; maxi = sizeof(lines = filter(explode(read_file(CFG_MONTHS), "\n"), ! (: $1 && $1 != "" && $1[0] != '#' :))); Months = allocate(maxi); for(i=0; i<maxi; i++) { ! Months[i] = new(class month); ! sscanf(lines[i], "%s:%s:%d:%d",((class month)Months[i])->Name, ! ((class month)Months[i])->Season, ! ((class month)Months[i])->Days, ! ((class month)Months[i])->DaylightHours); } Days = filter(explode(read_file(CFG_DAYS), "\n"), ! (: $1 && $1 != "" && $1[0] != '#' :)); maxi = sizeof(lines = filter(explode(read_file(CFG_MOONS), "\n"), ! (: $1 && $1 != "" && $1[0] != '#' :))); Moons = allocate_mapping(maxi); for(i=0; i<maxi; i++) { ! string nom, id, desc, lnom; ! int phase; ! sscanf(lines[i], "%s:%d:%s:%s", nom, phase, id, desc); ! lnom = convert_name(nom); ! Moons[lnom] = new(class moon); ! ((class moon)Moons[lnom])->Name = nom; ! ((class moon)Moons[lnom])->Phase = phase; ! ((class moon)Moons[lnom])->Id = id; ! ((class moon)Moons[lnom])->Description = desc; } eventConfigure(); } *************** *** 67,115 **** days = (time() - DAY_ONE) / (DAY_LENGTH * HOUR_LENGTH); for(tot=0, i=0, maxi = sizeof(Months); i<maxi; i++) ! tot += ((class month)Months[i])->Days; CurrentYear = days / tot + 1; days = (days % tot) + 1; for(i=0, maxi = sizeof(Months); i<maxi; i++) { ! if( days <= ((class month)Months[i])->Days ) { ! CurrentMonth = (class month)Months[i]; ! CurrentSeason = ((class month)Months[i])->Season; ! CurrentDay = days; ! break; ! } ! else days -= ((class month)Months[i])->Days; } x = CurrentMonth->DaylightHours * HOUR_LENGTH; ! Morning = ((DAY_LENGTH * HOUR_LENGTH) - x) / 2; Twilight = Morning + x; if( Morning < HOUR_LENGTH ) { ! Dawn = Morning/2; ! Night = Twilight + Morning/2; } else { ! Dawn = Morning - HOUR_LENGTH; ! Night = Twilight + HOUR_LENGTH; } x = GetCurrentTime(); if( x < Dawn ) { ! TimeOfDay = "night"; ! call_out( (: eventDawn :), Dawn - x); } else if( x < Morning ) { ! TimeOfDay = "dawn"; ! call_out( (: eventMorning :), Morning - x); } else if( x < Twilight ) { ! TimeOfDay = "day"; ! call_out( (: eventTwilight :), Twilight - x); } else if( x < Night ) { ! TimeOfDay = "twilight"; ! call_out( (: eventNight :), Night - x ); } else { ! TimeOfDay = "night"; ! call_out( (: eventMidnight :), (DAY_LENGTH * HOUR_LENGTH) - x); } } --- 83,131 ---- days = (time() - DAY_ONE) / (DAY_LENGTH * HOUR_LENGTH); for(tot=0, i=0, maxi = sizeof(Months); i<maxi; i++) ! tot += ((class month)Months[i])->Days; CurrentYear = days / tot + 1; days = (days % tot) + 1; for(i=0, maxi = sizeof(Months); i<maxi; i++) { ! if( days <= ((class month)Months[i])->Days ) { ! CurrentMonth = (class month)Months[i]; ! CurrentSeason = ((class month)Months[i])->Season; ! CurrentDay = days; ! break; ! } ! else days -= ((class month)Months[i])->Days; } x = CurrentMonth->DaylightHours * HOUR_LENGTH; ! Morning = ((((DAY_LENGTH + 4) * HOUR_LENGTH) - x) / 3) * 2; Twilight = Morning + x; if( Morning < HOUR_LENGTH ) { ! Dawn = Morning/2; ! Night = Twilight + Morning/2; } else { ! Dawn = Morning - HOUR_LENGTH; ! Night = Twilight + HOUR_LENGTH; } x = GetCurrentTime(); if( x < Dawn ) { ! TimeOfDay = "night"; ! call_out( (: eventDawn :), Dawn - x); } else if( x < Morning ) { ! TimeOfDay = "dawn"; ! call_out( (: eventMorning :), Morning - x); } else if( x < Twilight ) { ! TimeOfDay = "day"; ! call_out( (: eventTwilight :), Twilight - x); } else if( x < Night ) { ! TimeOfDay = "twilight"; ! call_out( (: eventNight :), Night - x ); } else { ! TimeOfDay = "night"; ! call_out( (: eventMidnight :), (DAY_LENGTH * HOUR_LENGTH) - x); } } *************** *** 120,129 **** call_out( (: eventMorning :), Morning - GetCurrentTime() ); TimeOfDay = "dawn"; obs = filter(users(), (: environment($1) && ! (string)environment($1)->GetClimate()!="indoors" && ! !((int)environment($1)->GetProperty("no time")) :)); message("environment", "%^YELLOW%^The sun appears just over the horizon.", ! obs ); i = sizeof(DawnCalls); while(i--) catch(evaluate(DawnCalls[i])); } --- 136,145 ---- call_out( (: eventMorning :), Morning - GetCurrentTime() ); TimeOfDay = "dawn"; obs = filter(users(), (: environment($1) && ! (string)environment($1)->GetClimate()!="indoors" && ! !((int)environment($1)->GetProperty("no time")) :)); message("environment", "%^YELLOW%^The sun appears just over the horizon.", ! obs ); i = sizeof(DawnCalls); while(i--) catch(evaluate(DawnCalls[i])); } *************** *** 135,144 **** call_out( (: eventTwilight :), Twilight - GetCurrentTime()); TimeOfDay = "day"; obs = filter(users(), (: environment($1) && ! (string)environment($1)->GetClimate()!="indoors" && ! !((int)environment($1)->GetProperty("no time")) :)); message("environment", "%^BOLD%^YELLOW%^The sun now shines completely " ! "on a new day.", obs); i = sizeof(MorningCalls); while(i--) catch(evaluate(MorningCalls[i])); } --- 151,160 ---- call_out( (: eventTwilight :), Twilight - GetCurrentTime()); TimeOfDay = "day"; obs = filter(users(), (: environment($1) && ! (string)environment($1)->GetClimate()!="indoors" && ! !((int)environment($1)->GetProperty("no time")) :)); message("environment", "%^BOLD%^YELLOW%^The sun now shines completely " ! "on a new day.", obs); i = sizeof(MorningCalls); while(i--) catch(evaluate(MorningCalls[i])); } *************** *** 150,159 **** call_out( (: eventNight :), Night - GetCurrentTime() ); TimeOfDay = "twilight"; obs = filter(users(), (: environment($1) && ! (string)environment($1)->GetClimate()!="indoors" && ! !((int)environment($1)->GetProperty("no time")) :)); message("environment", "%^CYAN%^The sun begins to fall away into " ! "twilight.", obs); i = sizeof(TwilightCalls); while(i--) catch(evaluate(TwilightCalls[i])); } --- 166,175 ---- call_out( (: eventNight :), Night - GetCurrentTime() ); TimeOfDay = "twilight"; obs = filter(users(), (: environment($1) && ! (string)environment($1)->GetClimate()!="indoors" && ! !((int)environment($1)->GetProperty("no time")) :)); message("environment", "%^CYAN%^The sun begins to fall away into " ! "twilight.", obs); i = sizeof(TwilightCalls); while(i--) catch(evaluate(TwilightCalls[i])); } *************** *** 165,172 **** call_out( (: eventMidnight :), DAY_LENGTH - GetCurrentTime() ); TimeOfDay = "night"; obs = filter(users(), (: environment($1) && ! (string)environment($1)->GetClimate()!="indoors" && ! !((int)environment($1)->GetProperty("no time")) :)); message("environment", "%^BOLD%^BLUE%^Night darkens all that is real.", obs); i = sizeof(NightCalls); while(i--) catch(evaluate(NightCalls[i])); --- 181,188 ---- call_out( (: eventMidnight :), DAY_LENGTH - GetCurrentTime() ); TimeOfDay = "night"; obs = filter(users(), (: environment($1) && ! (string)environment($1)->GetClimate()!="indoors" && ! !((int)environment($1)->GetProperty("no time")) :)); message("environment", "%^BOLD%^BLUE%^Night darkens all that is real.", obs); i = sizeof(NightCalls); while(i--) catch(evaluate(NightCalls[i])); *************** *** 178,191 **** CurrentDay++; i = CurrentMonth->Days; if( CurrentDay > i ) { ! int y; ! y = CurrentYear; ! eventConfigure(); ! if( y != CurrentYear ) ! message("shout", "Happy New Year!!!\nIt is now the year " + ! GetYearString(CurrentYear) + "!!!!!", users()); ! return; } call_out( (: eventDawn :), Dawn); TimeOfDay = "night"; --- 194,207 ---- CurrentDay++; i = CurrentMonth->Days; if( CurrentDay > i ) { ! int y; ! y = CurrentYear; ! eventConfigure(); ! if( y != CurrentYear ) ! message("shout", "Happy New Year!!!\nIt is now the year " + ! GetYearString(CurrentYear) + "!!!!!", users()); ! return; } call_out( (: eventDawn :), Dawn); TimeOfDay = "night"; *************** *** 201,207 **** string GetCurrentSeason() { return CurrentSeason; } ! int GetCurrentTime() { return (time()- DAY_ONE) % (DAY_LENGTH * HOUR_LENGTH); } int GetCurrentYear() { return CurrentYear; } --- 217,223 ---- string GetCurrentSeason() { return CurrentSeason; } ! int GetCurrentTime() { return (time()- DAY_ONE) % (DAY_LENGTH * HOUR_LENGTH) + ticktock; } int GetCurrentYear() { return CurrentYear; } *************** *** 210,229 **** days = absolute_value((x - DAY_ONE) / (DAY_LENGTH * HOUR_LENGTH)); for(tot=0, i=0, maxi = sizeof(Months); i<maxi; i++) ! tot += ((class month)Months[i])->Days; days = (days % tot) + ( (x < DAY_ONE) ? 0 : 1 ); if( x < DAY_ONE ) { ! i = sizeof(Months); ! while(i--) { ! if( days < ((class month)Months[i])->Days ) ! return ((class month)Months[i])->Days - days; ! else days -= ((class month)Months[i])->Days; ! } ! return 0; } for(i=0, maxi = sizeof(Months); i<maxi; i++) { ! if( days <= ((class month)Months[i])->Days ) return days; ! else days -= ((class month)Months[i])->Days; } return 0; } --- 226,245 ---- days = absolute_value((x - DAY_ONE) / (DAY_LENGTH * HOUR_LENGTH)); for(tot=0, i=0, maxi = sizeof(Months); i<maxi; i++) ! tot += ((class month)Months[i])->Days; days = (days % tot) + ( (x < DAY_ONE) ? 0 : 1 ); if( x < DAY_ONE ) { ! i = sizeof(Months); ! while(i--) { ! if( days < ((class month)Months[i])->Days ) ! return ((class month)Months[i])->Days - days; ! else days -= ((class month)Months[i])->Days; ! } ! return 0; } for(i=0, maxi = sizeof(Months); i<maxi; i++) { ! if( days <= ((class month)Months[i])->Days ) return days; ! else days -= ((class month)Months[i])->Days; } return 0; } *************** *** 242,249 **** i = sizeof(Months); while(i--) { ! if( ((class month)Months[i])->Name == mon ) ! return ((class month)Months[i])->DaylightHours; } return 0; } --- 258,265 ---- i = sizeof(Months); while(i--) { ! if( ((class month)Months[i])->Name == mon ) ! return ((class month)Months[i])->DaylightHours; } return 0; } *************** *** 268,274 **** string GetMonth(int x) { int monthIndex; ! monthIndex = GetMonthIndex(x); return Months[monthIndex]->Name; } --- 284,290 ---- string GetMonth(int x) { int monthIndex; ! monthIndex = GetMonthIndex(x); return Months[monthIndex]->Name; } *************** *** 279,299 **** if( x < DAY_ONE ) days = (DAY_ONE - x) / (DAY_LENGTH * HOUR_LENGTH); else days = (x - DAY_ONE) / (DAY_LENGTH * HOUR_LENGTH); for(tot=0, i=0, maxi = sizeof(Months); i<maxi; i++) ! tot += ((class month)Months[i])->Days; days = (days % tot) + ((x >= DAY_ONE) ? 1 : 0); if( x < DAY_ONE ) { ! i = sizeof(Months); ! while(i--) { ! if( days < ((class month)Months[i])->Days ) ! return i; ! else days -= ((class month)Months[i])->Days; ! } ! return 0; } for(i=0, maxi = sizeof(Months); i<maxi; i++) { ! if( days <= ((class month)Months[i])->Days ) ! return i; ! else days -= ((class month)Months[i])->Days; } return 0; } --- 295,315 ---- if( x < DAY_ONE ) days = (DAY_ONE - x) / (DAY_LENGTH * HOUR_LENGTH); else days = (x - DAY_ONE) / (DAY_LENGTH * HOUR_LENGTH); for(tot=0, i=0, maxi = sizeof(Months); i<maxi; i++) ! tot += ((class month)Months[i])->Days; days = (days % tot) + ((x >= DAY_ONE) ? 1 : 0); if( x < DAY_ONE ) { ! i = sizeof(Months); ! while(i--) { ! if( days < ((class month)Months[i])->Days ) ! return i; ! else days -= ((class month)Months[i])->Days; ! } ! return 0; } for(i=0, maxi = sizeof(Months); i<maxi; i++) { ! if( days <= ((class month)Months[i])->Days ) ! return i; ! else days -= ((class month)Months[i])->Days; } return 0; } *************** *** 303,315 **** int i, maxi; for(i=0, maxi = sizeof(Months); i<maxi; i++) ! ret += ({ ((class month)Months[i])->Name }); return ret; } string GetSeason(int x) { int monthIndex; ! monthIndex = GetMonthIndex(x); return Months[monthIndex]->Season; } --- 319,331 ---- int i, maxi; for(i=0, maxi = sizeof(Months); i<maxi; i++) ! ret += ({ ((class month)Months[i])->Name }); return ret; } string GetSeason(int x) { int monthIndex; ! monthIndex = GetMonthIndex(x); return Months[monthIndex]->Season; } *************** *** 320,339 **** function AddTimeEvent(string tod, function f) { switch(tod) { ! case "dawn": DawnCalls += ({ f }); break; ! case "morning": MorningCalls += ({ f }); break; ! case "twilight": TwilightCalls += ({ f }); break; ! case "night": NightCalls += ({ f }); break; ! case "midnight": MidnightCalls += ({ f }); break; ! default: return 0; } return f; } mapping GetTimeEvents() { return ([ "dawn" : DawnCalls + ({}), "morning" : MorningCalls + ({}), ! "twilight" : TwilightCalls + ({}), "night" : NightCalls + ({}), ! "midnight" : MidnightCalls + ({}) ]); } int GetYear(int x) { --- 336,355 ---- function AddTimeEvent(string tod, function f) { switch(tod) { ! case "dawn": DawnCalls += ({ f }); break; ! case "morning": MorningCalls += ({ f }); break; ! case "twilight": TwilightCalls += ({ f }); break; ! case "night": NightCalls += ({ f }); break; ! case "midnight": MidnightCalls += ({ f }); break; ! default: return 0; } return f; } mapping GetTimeEvents() { return ([ "dawn" : DawnCalls + ({}), "morning" : MorningCalls + ({}), ! "twilight" : TwilightCalls + ({}), "night" : NightCalls + ({}), ! "midnight" : MidnightCalls + ({}) ]); } int GetYear(int x) { *************** *** 356,366 **** val = GetPhase(val); } switch(val) { ! case 0: return "new"; ! case 1: return "waxing"; ! case 2: return "waning"; ! case 3: return "full"; ! default: return "error"; } } --- 372,382 ---- val = GetPhase(val); } switch(val) { ! case 0: return "new"; ! case 1: return "waxing"; ! case 2: return "waning"; ! case 3: return "full"; ! default: return "error"; } } *************** *** 388,398 **** i = sizeof(moons = keys(Moons)); while(i--) { ! int z; ! z = GetPhase(moons[i]); ! if( z == 4) z = 2; ! y += z; } return y; } --- 404,414 ---- i = sizeof(moons = keys(Moons)); while(i--) { ! int z; ! z = GetPhase(moons[i]); ! if( z == 4) z = 2; ! y += z; } return y; } *************** *** 404,474 **** int i; if( !(env = environment(this_player())) ) ! return "You are in serious trouble."; switch(arg) { ! case "sun": ! switch(GetTimeOfDay()) { ! case "dawn": ! return "The sun is hanging low in the eastern sky."; ! case "day": ! return "The sun is shining brightly in the daytime sky."; ! case "twilight": ! return "The sun is sinking into the western sky."; ! case "night": ! return "There is no sun to be seen."; ! } ! case "moon": case "moons": ! if( GetTimeOfDay() != "night" ) return "During the day?"; ! else { ! string *moons; ! int x = 0; ! ! i = sizeof(moons = keys(Moons)); ! while(i--) { ! int y; ! ! if( y = GetPhase(moons[i]) ) continue; ! else if( tmp ) ! tmp += capitalize(((class moon)Moons[moons[i]])->Id) + ! " is " + GetPhaseName(y) + ". "; ! else tmp = "\n" + ! capitalize(((class moon)Moons[moons[i]])->Id) + " is " + ! GetPhaseName(y) + ". "; ! x = 1; ! } ! if( !x ) return 0; ! else return tmp; ! } ! case "sky": ! if( GetTimeOfDay() == "night" ) { ! tmp = GetLong("moon"); ! if( !tmp ) { ! return "The sky is filled only with the glitter of stars."; ! } ! else { ! return tmp; ! } ! } ! else { ! string sky; ! ! tmp = GetLong("sun"); ! if( this_player() ) { ! env = environment(this_player()); ! } ! if( sky = env->GetSky() ) { ! env = find_object(sky); ! if( env ) { ! object array obs = filter(all_inventory(env), ! function(object ob) { ! if( ob->GetInvis(this_player()) ) { ! return 0; ! } ! if( living(ob) ) { ! return 1; ! } ! return 0; ! }); if( sizeof(obs) ) { int maxi = sizeof(obs); --- 420,490 ---- int i; if( !(env = environment(this_player())) ) ! return "You are in serious trouble."; switch(arg) { ! case "sun": ! switch(GetTimeOfDay()) { ! case "dawn": ! return "The sun is hanging low in the eastern sky."; ! case "day": ! return "The sun is shining brightly in the daytime sky."; ! case "twilight": ! return "The sun is sinking into the western sky."; ! case "night": ! return "There is no sun to be seen."; ! } ! case "moon": case "moons": ! if( GetTimeOfDay() != "night" ) return "During the day?"; ! else { ! string *moons; ! int x = 0; ! ! i = sizeof(moons = keys(Moons)); ! while(i--) { ! int y; ! ! if( y = GetPhase(moons[i]) ) continue; ! else if( tmp ) ! tmp += capitalize(((class moon)Moons[moons[i]])->Id) + ! " is " + GetPhaseName(y) + ". "; ! else tmp = "\n" + ! capitalize(((class moon)Moons[moons[i]])->Id) + " is " + ! GetPhaseName(y) + ". "; ! x = 1; ! } ! if( !x ) return 0; ! else return tmp; ! } ! case "sky": ! if( GetTimeOfDay() == "night" ) { ! tmp = GetLong("moon"); ! if( !tmp ) { ! return "The sky is filled only with the glitter of stars."; ! } ! else { ! return tmp; ! } ! } ! else { ! string sky; ! ! tmp = GetLong("sun"); ! if( this_player() ) { ! env = environment(this_player()); ! } ! if( sky = env->GetSky() ) { ! env = find_object(sky); ! if( env ) { ! object array obs = filter(all_inventory(env), ! function(object ob) { ! if( ob->GetInvis(this_player()) ) { ! return 0; ! } ! if( living(ob) ) { ! return 1; ! } ! return 0; ! }); if( sizeof(obs) ) { int maxi = sizeof(obs); *************** *** 497,527 **** tmp = sky + "\n" + tmp; } } ! } ! return tmp; ! } ! default: ! if( Moons[arg] ) return ((class moon)Moons[arg])->Description; ! arr = map(mn = keys(Moons), (: ((class moon)Moons[$1])->Id :)); ! if( (i = member_array(arg, arr)) != -1 ) ! return ((class moon)Moons[mn[i]])->Description; ! else return 0; } - } - - string array GetMoons() { - return map(keys(Moons), (: ((class moon)Moons[$1])->Name :)); - } - - int eventShow(object who, string args) { - string str; - if( !who || !sizeof(args) ) return 0; - if( !str = GetLong(args) ) return 0; - if( (string)environment(who)->GetClimate() == "indoors" ) { - who->eventPrint("You are indoors!"); - return 1; - } - who->eventPrint(str); - environment(who)->eventPrint((string)who->GetName() + " gazes toward the sky.", who); - return 1; - } --- 513,543 ---- tmp = sky + "\n" + tmp; } } ! } ! return tmp; ! } ! default: ! if( Moons[arg] ) return ((class moon)Moons[arg])->Description; ! arr = map(mn = keys(Moons), (: ((class moon)Moons[$1])->Id :)); ! if( (i = member_array(arg, arr)) != -1 ) ! return ((class moon)Moons[mn[i]])->Description; ! else return 0; ! } ! } ! ! string array GetMoons() { ! return map(keys(Moons), (: ((class moon)Moons[$1])->Name :)); ! } ! ! int eventShow(object who, string args) { ! string str; ! if( !who || !sizeof(args) ) return 0; ! if( !str = GetLong(args) ) return 0; ! if( (string)environment(who)->GetClimate() == "indoors" ) { ! who->eventPrint("You are indoors!"); ! return 1; ! } ! who->eventPrint(str); ! environment(who)->eventPrint((string)who->GetName() + " gazes toward the sky.", who); ! return 1; } diff -c -r --new-file ds1.1/lib/daemon/services/auth.c ds2.0r27/lib/daemon/services/auth.c *** ds1.1/lib/daemon/services/auth.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/daemon/services/auth.c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,44 ---- + #define SERVICE_AUTH + + #include <daemons.h> + #include <rooms.h> + #include <message_class.h> + + void eventReceiveAuthReply(mixed array packet) { + object pinger; + object *pingers = filter( users(), (: $1->GetProperty("pinging") :) ); + PING_D->SetOK(); + if(pinger = find_object("/secure/daemon/ping")){ + if(pinger->GetPinging()){ + pinger->SetOK(1); + } + } + tn("Auth reply received from "+packet[2]+".","white"); + tn("Ping packet: "+identify(packet),"white"); + if(sizeof(pingers)){ + foreach(object dude in pingers){ + tell_player(dude, packet[2]+" has just replied to a ping request from "+ + packet[4]+"."); + dude->SetProperty("pinging",0); + } + } + } + + void eventReceiveAuthRequest(mixed array packet) { + string mudlist = ""; + PING_D->SetOK(); + tn("Auth request received from "+packet[2]+".","white"); + INTERMUD_D->eventWrite( ({"auth-mud-reply", 5, mud_name(), 0, packet[2], + 0, (random(9999) * 10000) + 1138 }) ); + if(file_exists("/tmp/muds.txt")) + mudlist = read_file("/tmp/muds.txt"); + if(!grepp(mudlist,packet[2]) || packet[2] == "DeadSoulsNew" || + packet[2] == "DeadSoulsWin"){ + write_file("/tmp/muds.txt",packet[2]+"\n"); + tc("We have a new mud! "+packet[2]+" has joined intermud.","red"); + tn("We have a new mud! "+packet[2]+" has joined intermud.","red"); + } + + } + + diff -c -r --new-file ds1.1/lib/daemon/services/channel.c ds2.0r27/lib/daemon/services/channel.c *** ds1.1/lib/daemon/services/channel.c Sun Feb 1 21:29:59 1998 --- ds2.0r27/lib/daemon/services/channel.c Wed Jul 5 00:01:03 2006 *************** *** 9,93 **** #define SERVICE_CHANNEL #include <daemons.h> #include <message_class.h> void eventReceiveChannelWhoReply(mixed array packet) { object ob; if( file_name(previous_object()) != INTERMUD_D ) return; if( !(ob = find_player(packet[5])) ) return; packet[6] = (string)CHAT_D->GetLocalChannel(packet[6]); if( !sizeof(packet[7]) ) { ob->eventPrint("No one is listening to " + packet[6] + " at " + ! packet[2] + ".", MSG_SYSTEM); return; } ob->eventPrint("Listening to " + packet[6] + " at " + packet[2] + ":" + ! implode(packet[7], " "), MSG_SYSTEM); } void eventReceiveChannelWhoRequest(mixed array packet) { string array who; ! if( file_name(previous_object()) != INTERMUD_D ) return; who = (string array)CHAT_D->GetChannelList(packet[6]); INTERMUD_D->eventWrite(({ "chan-who-reply", 5, mud_name(), 0, packet[2], ! packet[3], packet[6], who })); } void eventReceiveChannelUserRequest(mixed array packet) { object ob; string visname; int gender; - if( file_name(previous_object()) != INTERMUD_D ) return; if( !(ob = find_player(packet[6])) ) { INTERMUD_D->eventWrite( ({ "error", 5, mud_name(), 0, packet[2], 0, ! "unk-user", packet[6] + " is not a valid " ! "player.", packet }) ); return; } visname = (string)ob->GetCapName(); switch( (string)ob->GetGender() ) { ! case "male": gender = 0; break; ! case "female": gender = 1; break; ! default: gender = 2; break; } INTERMUD_D->eventWrite( ({ "chan-user-reply", 5, mud_name(), 0, ! packet[2], 0, packet[6], visname, gender })); } void eventReceiveChannelMessage(mixed array packet) { if( file_name(previous_object()) != INTERMUD_D ) return; if( packet[2] == mud_name() ) return; CHAT_D->eventSendChannel(packet[7] + "@" + packet[2], packet[6], ! packet[8]); } void eventReceiveChannelEmote(mixed array packet) { if( file_name(previous_object()) != INTERMUD_D ) return; if( packet[2] == mud_name() ) return; if( !packet[7] ) return; CHAT_D->eventSendChannel(packet[7] + "@" + packet[2], packet[6], ! packet[8], 1, 0, 0); } void eventReceiveChannelTargettedEmote(mixed array packet) { string target; if( file_name(previous_object()) != INTERMUD_D ) return; if( packet[2] == mud_name() ) return; if( packet[7] != mud_name() ) target = packet[12] + "@" + packet[7]; else target = packet[12]; CHAT_D->eventSendChannel(packet[11] + "@" + packet[2], packet[6], ! packet[9], 1, target, packet[10]); } varargs void eventSendChannel(string who, string ch, string msg, int emote, ! string target, string targmsg) { mixed array packet; string targpl, where; // targpl is target keyname if( emote ) { if( target && targmsg ) { if( sscanf(target, "%s@%s", targpl, where) != 2 ) { --- 9,121 ---- #define SERVICE_CHANNEL #include <daemons.h> + #include <rooms.h> #include <message_class.h> + static private string *local_chans = ({"newbie","cre","gossip","admin","error", + "priest", "mage", "explorer", "thief", "fighter", "death" }); + + void eventReceiveChannelWhoReply(mixed array packet) { object ob; + tn("eventReceiveChannelWhoReply: "+identify(packet),"green"); if( file_name(previous_object()) != INTERMUD_D ) return; if( !(ob = find_player(packet[5])) ) return; packet[6] = (string)CHAT_D->GetLocalChannel(packet[6]); if( !sizeof(packet[7]) ) { ob->eventPrint("No one is listening to " + packet[6] + " at " + ! packet[2] + ".", MSG_SYSTEM); return; } ob->eventPrint("Listening to " + packet[6] + " at " + packet[2] + ":" + ! implode(packet[7], " "), MSG_SYSTEM); } void eventReceiveChannelWhoRequest(mixed array packet) { string array who; ! string ret = ""; if( file_name(previous_object()) != INTERMUD_D ) return; who = (string array)CHAT_D->GetChannelList(packet[6]); INTERMUD_D->eventWrite(({ "chan-who-reply", 5, mud_name(), 0, packet[2], ! packet[3], packet[6], who })); ! ! foreach(string entry in who){ ! ret += entry+", "; ! } ! ret = truncate(ret,2); ! tn("eventReceiveChannelWhoRequest: "+identify(packet),"green"); ! ! tell_room(ROOM_ARCH,"The Arch Room loudspeaker announces: \"%^BOLD%^CYAN%^"+capitalize(packet[3])+" at "+packet[2]+" has requested a list of users listening to channel "+packet[6]+". Replying with: %^BOLD%^GREEN%^"+ret+".%^RESET%^\""); } void eventReceiveChannelUserRequest(mixed array packet) { object ob; string visname; int gender; if( file_name(previous_object()) != INTERMUD_D ) return; + tn("eventReceiveChannelUserRequest: "+identify(packet),"green"); if( !(ob = find_player(packet[6])) ) { INTERMUD_D->eventWrite( ({ "error", 5, mud_name(), 0, packet[2], 0, ! "unk-user", packet[6] + " is not a valid " ! "player.", packet }) ); return; } visname = (string)ob->GetCapName(); switch( (string)ob->GetGender() ) { ! case "male": gender = 0; break; ! case "female": gender = 1; break; ! default: gender = 2; break; } INTERMUD_D->eventWrite( ({ "chan-user-reply", 5, mud_name(), 0, ! packet[2], 0, packet[6], visname, gender })); } void eventReceiveChannelMessage(mixed array packet) { + tn("eventReceiveChannelMessage: "+identify(packet),"green"); + if( file_name(previous_object()) != INTERMUD_D ) return; if( packet[2] == mud_name() ) return; + CHAT_D->eventSendChannel(packet[7] + "@" + packet[2], packet[6], ! packet[8]); ! if(packet[2] != mud_name()) CHAT_D->eventAddLast(packet[6],"",packet[6],packet[8],packet[7] + "@" + packet[2]); ! } void eventReceiveChannelEmote(mixed array packet) { + tn("eventReceiveChannelEmote: "+identify(packet),"green"); + if( file_name(previous_object()) != INTERMUD_D ) return; if( packet[2] == mud_name() ) return; if( !packet[7] ) return; CHAT_D->eventSendChannel(packet[7] + "@" + packet[2], packet[6], ! packet[8], 1, 0, 0); ! if(packet[2] != mud_name()) CHAT_D->eventAddLast(packet[6],"",packet[6],packet[7] + "@" + packet[2] + replace_string(packet[8],"$N","")); } void eventReceiveChannelTargettedEmote(mixed array packet) { string target; + tn("eventReceiveChannelTargettedEmote: "+identify(packet),"green"); if( file_name(previous_object()) != INTERMUD_D ) return; if( packet[2] == mud_name() ) return; if( packet[7] != mud_name() ) target = packet[12] + "@" + packet[7]; else target = packet[12]; CHAT_D->eventSendChannel(packet[11] + "@" + packet[2], packet[6], ! packet[9], 1, target, packet[10]); ! if(packet[2] != mud_name()) true(); } varargs void eventSendChannel(string who, string ch, string msg, int emote, ! string target, string targmsg) { mixed array packet; + mixed array packet_thing = ({ who, ch, msg, emote || "", target || "", targmsg || "" }); + string targpl, where; // targpl is target keyname + tn("eventSendChannel raw: "+identify( packet_thing ),"green"); + if( emote ) { if( target && targmsg ) { if( sscanf(target, "%s@%s", targpl, where) != 2 ) { *************** *** 95,112 **** where = mud_name(); } else { target = SERVICES_D->GetRemoteDisplayName(targpl, where); if( !target ) target = capitalize(targpl); } packet = ({ "channel-t", 5, mud_name(), convert_name(who), 0, 0, ! ch, where, targpl, msg, targmsg, who, target }); } else packet = ({ "channel-e", 5, mud_name(), convert_name(who), 0, 0, ! ch, who, msg }); } else packet = ({ "channel-m", 5, mud_name(), convert_name(who), 0, 0, ch, ! who, msg }); ! INTERMUD_D->eventWrite(packet); } void eventSendChannelWhoRequest(string channel, string mud) { --- 123,149 ---- where = mud_name(); } else { + where = trim(where); + if(!alphap(last(where,1))) where = truncate(where,1); + if(member_array(lower_case(where), INTERMUD_D->GetLCMuds()) == -1) { + write("No such mud."); + return; + } target = SERVICES_D->GetRemoteDisplayName(targpl, where); if( !target ) target = capitalize(targpl); } packet = ({ "channel-t", 5, mud_name(), convert_name(who), 0, 0, ! ch, where, targpl, msg, targmsg, who, target }); } else packet = ({ "channel-e", 5, mud_name(), convert_name(who), 0, 0, ! ch, who, msg }); } else packet = ({ "channel-m", 5, mud_name(), convert_name(who), 0, 0, ch, ! who, msg }); ! if(member_array(ch, local_chans) == -1){ ! INTERMUD_D->eventWrite(packet); ! tn("eventSendChannel processed: "+identify(packet),"green"); ! } } void eventSendChannelWhoRequest(string channel, string mud) { *************** *** 114,120 **** pl = (string)this_player(1)->GetKeyName(); INTERMUD_D->eventWrite(({ "chan-who-req", 5, mud_name(), pl, mud, 0, ! channel })); } void eventRegisterChannels(mapping list) { --- 151,158 ---- pl = (string)this_player(1)->GetKeyName(); INTERMUD_D->eventWrite(({ "chan-who-req", 5, mud_name(), pl, mud, 0, ! channel })); ! tn("eventSendChannelWhoRequest: "+identify( ({ "chan-who-req", 5, mud_name(), pl, mud, 0, channel })) , "green"); } void eventRegisterChannels(mapping list) { *************** *** 125,171 **** ns = (string)INTERMUD_D->GetNameserver(); foreach(channel, val in list) { if( !val ) continue; ! if( channel == (string)CHAT_D->GetLocalChannel(channel) ) { INTERMUD_D->eventWrite(({ "channel-listen", 5, mud_name(), 0, ns, ! 0, channel, 0 })); log_file("channels", "New channel: " + channel + " recognized " + ! ctime(time()) + "\nValue: " + identify(val) + "\n\n"); } else INTERMUD_D->eventWrite(({ "channel-listen", 5, mud_name(), 0, ns, ! 0, channel, 1 })); } } int eventAdministerChannel(string channel, string array additions, ! string array subs) { if( !((int)master()->valid_apply( ({}) )) ) return 0; if( member_array(channel, (string array)INTERMUD_D->GetChannels()) == -1 ) ! return 0; INTERMUD_D->eventWrite(({ "channel-admin", 5, mud_name(), ! (string)this_player(1)->GetKeyName(), ! (string)INTERMUD_D->GetNameserver(), ! 0, channel, additions, subs })); return 1; } int AddChannel(string channel, int privee) { ! if( !((int)master()->valid_apply( ({}) )) ) return 0; ! if( member_array(channel, (string array)INTERMUD_D->GetChannels()) != -1 ) ! return 0; INTERMUD_D->eventWrite(({ "channel-add", 5, mud_name(), ! (string)this_player(1)->GetKeyName(), ! (string)INTERMUD_D->GetNameserver(), 0, ! channel, privee })); return 1; } int RemoveChannel(string channel) { ! if( !((int)master()->valid_apply( ({}) )) ) return 0; ! if( member_array(channel, (string array)INTERMUD_D->GetChannels()) == -1 ) ! return 0; INTERMUD_D->eventWrite(({ "channel-remove", 5, mud_name(), ! (string)this_player(1)->GetKeyName(), ! (string)INTERMUD_D->GetNameserver(), 0, ! channel })); return 1; } --- 163,225 ---- ns = (string)INTERMUD_D->GetNameserver(); foreach(channel, val in list) { if( !val ) continue; ! if( channel == (string)CHAT_D->GetLocalChannel(channel) && ! channel != "dead_test4" && channel != "dead_souls" && ! channel != "lpuni" && channel != "german" ) { INTERMUD_D->eventWrite(({ "channel-listen", 5, mud_name(), 0, ns, ! 0, channel, 0 })); log_file("channels", "New channel: " + channel + " recognized " + ! ctime(time()) + "\nValue: " + identify(val) + "\n\n"); } else INTERMUD_D->eventWrite(({ "channel-listen", 5, mud_name(), 0, ns, ! 0, channel, 1 })); } + tn("eventRegisterChannels: "+identify(list),"green"); + } int eventAdministerChannel(string channel, string array additions, ! string array subs) { ! tn("eventAdministerChannel. ","green"); ! if( !((int)master()->valid_apply( ({}) )) ) return 0; if( member_array(channel, (string array)INTERMUD_D->GetChannels()) == -1 ) ! return 0; INTERMUD_D->eventWrite(({ "channel-admin", 5, mud_name(), ! (string)this_player(1)->GetKeyName(), ! (string)INTERMUD_D->GetNameserver(), ! 0, channel, additions, subs })); ! ! tn("eventAdministerChannel: "+channel+" "+identify(additions)+" "+identify(subs),"green"); return 1; } int AddChannel(string channel, int privee) { ! tn("eventAdministerChannel: "+channel+", "+privee,"green"); ! ! if( !((int)master()->valid_apply( ({}) )) ){ ! return 0; ! } ! if( member_array(channel, (string array)INTERMUD_D->GetChannels()) != -1 ){ ! return 0; ! } INTERMUD_D->eventWrite(({ "channel-add", 5, mud_name(), ! (string)this_player(1)->GetKeyName(), ! (string)INTERMUD_D->GetNameserver(), 0, ! channel, privee })); return 1; } int RemoveChannel(string channel) { ! //if( !((int)master()->valid_apply( ({}) )) ) return 0; ! tn("RemoveChannel: "+identify(channel),"green"); ! ! if( member_array(channel, (string array)INTERMUD_D->GetChannels()) == -1 ){ ! return 0; ! } INTERMUD_D->eventWrite(({ "channel-remove", 5, mud_name(), ! (string)this_player(1)->GetKeyName(), ! (string)INTERMUD_D->GetNameserver(), 0, ! channel })); return 1; } diff -c -r --new-file ds1.1/lib/daemon/services/emoteto.c ds2.0r27/lib/daemon/services/emoteto.c *** ds1.1/lib/daemon/services/emoteto.c Sun Feb 1 21:29:59 1998 --- ds2.0r27/lib/daemon/services/emoteto.c Wed Jul 5 00:01:03 2006 *************** *** 12,25 **** object ob; string who; if( file_name(previous_object()) != INTERMUD_D ) return; who = convert_name(packet[5]); if( !(ob = find_player(who)) || (int)ob->GetInvis() ) { INTERMUD_D->eventWrite(({ "error", 5, mud_name(), 0, packet[2], ! packet[3], "unk-user", ! capitalize(packet[5]) + " is nowhere to " ! "be found on " + mud_name() + ".", ! packet })); return; } packet[7] = replace_string(packet[7], "$N", packet[6] + "@" + packet[2]); --- 12,26 ---- object ob; string who; + tn("eventReceiveEmote: "+identify(packet), "green"); if( file_name(previous_object()) != INTERMUD_D ) return; who = convert_name(packet[5]); if( !(ob = find_player(who)) || (int)ob->GetInvis() ) { INTERMUD_D->eventWrite(({ "error", 5, mud_name(), 0, packet[2], ! packet[3], "unk-user", ! capitalize(packet[5]) + " is nowhere to " ! "be found on " + mud_name() + ".", ! packet })); return; } packet[7] = replace_string(packet[7], "$N", packet[6] + "@" + packet[2]); *************** *** 28,41 **** void eventSendEmote(string who, string where, string msg) { string pl, plc; ! pl = (string)this_player(1)->GetKeyName(); plc = (string)this_player(1)->GetCapName(); where = (string)INTERMUD_D->GetMudName(where); INTERMUD_D->eventWrite(({ "emoteto", 5, mud_name(), pl, where, ! convert_name(who), plc, msg })); } - ! --- 29,43 ---- void eventSendEmote(string who, string where, string msg) { string pl, plc; ! pl = (string)this_player(1)->GetKeyName(); plc = (string)this_player(1)->GetCapName(); where = (string)INTERMUD_D->GetMudName(where); INTERMUD_D->eventWrite(({ "emoteto", 5, mud_name(), pl, where, ! convert_name(who), plc, msg })); ! tn("eventSendEmote: "+identify( "emoteto", 5, mud_name(), pl, where,convert_name(who), plc, msg ),"green"); } ! ! diff -c -r --new-file ds1.1/lib/daemon/services/error.c ds2.0r27/lib/daemon/services/error.c *** ds1.1/lib/daemon/services/error.c Sun Feb 1 21:29:59 1998 --- ds2.0r27/lib/daemon/services/error.c Wed Jul 5 00:01:03 2006 *************** *** 8,13 **** --- 8,15 ---- object ob; string error_code, mud, target, msg; + tn("ERROR RECEIVED: "+identify(packet)); + if( packet[5] ) { target = convert_name(packet[5]); if( !(ob = find_player(target)) ) return; *************** *** 17,32 **** msg = packet[7]; packet = packet[8]; switch(error_code) { ! case "unk-dst": case "not-imp": case "unk-type": case "unk-src": log_file("errors/intermud", error_code + ": " + msg + "\n"); return; ! case "unk-type": log_file("errors/intermud", error_code + ": " + msg + "\n"); return; ! case "unk-user": if( !ob ) return; message("system", (msg ? msg : "Unknown user reported from " + mud + ! "."), ob); return; } } --- 19,34 ---- msg = packet[7]; packet = packet[8]; switch(error_code) { ! case "unk-dst": case "not-imp": case "unk-type": case "unk-src": log_file("errors/intermud", error_code + ": " + msg + "\n"); return; ! case "unk-type": log_file("errors/intermud", error_code + ": " + msg + "\n"); return; ! case "unk-user": if( !ob ) return; message("system", (msg ? msg : "Unknown user reported from " + mud + ! "."), ob); return; } } diff -c -r --new-file ds1.1/lib/daemon/services/finger.c ds2.0r27/lib/daemon/services/finger.c *** ds1.1/lib/daemon/services/finger.c Sun Feb 1 21:29:59 1998 --- ds2.0r27/lib/daemon/services/finger.c Wed Jul 5 00:01:03 2006 *************** *** 9,14 **** --- 9,15 ---- #define SERVICE_FINGER #include <daemons.h> + #include <rooms.h> #include <message_class.h> void eventReceiveFingerRequest(mixed array packet) { *************** *** 16,29 **** if( file_name(previous_object()) != INTERMUD_D ) return; if( !(ret = (mixed array)FINGER_D->GetRemoteFinger(packet[6])) ) { ! INTERMUD_D->eventWrite(({ "error", 5, mud_name(), 0, packet[2], ! packet[3], "unk-user", ! capitalize(packet[6]) + " is not involved.", ! packet })); return; } ret = ({ "finger-reply", 5, mud_name(), 0, packet[2], packet[3] }) + ret; INTERMUD_D->eventWrite(ret); } void eventReceiveFingerReply(mixed array packet) { --- 17,33 ---- if( file_name(previous_object()) != INTERMUD_D ) return; if( !(ret = (mixed array)FINGER_D->GetRemoteFinger(packet[6])) ) { ! INTERMUD_D->eventWrite(({ "error", 5, mud_name(), 0, packet[2], ! packet[3], "unk-user", ! capitalize(packet[6]) + " is not involved.", ! packet })); return; } ret = ({ "finger-reply", 5, mud_name(), 0, packet[2], packet[3] }) + ret; INTERMUD_D->eventWrite(ret); + tell_room(ROOM_ARCH,"The Arch Room loudspeaker announces: \"%^BOLD%^CYAN%^"+capitalize(packet[3])+" at "+packet[2]+" has requested finger information about "+capitalize(ret[6])+".%^RESET%^\""); + tn("eventReceiveFingerRequest: "+identify(packet),"cyan"); + } void eventReceiveFingerReply(mixed array packet) { *************** *** 45,54 **** fing += sprintf(" (idle %02d:%02d:%02d)\n", i/3600, (i/60)%60, i%60); } else fing += (packet[10] ? "Last logged in: " + packet[10] + "\n" : ! "Not logged in.\n"); fing += "Site: " + (packet[12] ? packet[12] : "Confidential") + "\n"; fing += (packet[14] ? packet[14] : "\n"); ob->eventPrint(fing, MSG_SYSTEM); } void eventSendFingerRequest(string who, string where) { --- 49,59 ---- fing += sprintf(" (idle %02d:%02d:%02d)\n", i/3600, (i/60)%60, i%60); } else fing += (packet[10] ? "Last logged in: " + packet[10] + "\n" : ! "Not logged in.\n"); fing += "Site: " + (packet[12] ? packet[12] : "Confidential") + "\n"; fing += (packet[14] ? packet[14] : "\n"); ob->eventPrint(fing, MSG_SYSTEM); + tn("eventReceiveFingerReply: "+identify(packet),"cyan"); } void eventSendFingerRequest(string who, string where) { *************** *** 56,60 **** if( !(pl = (string)this_player(1)->GetKeyName()) ) return; INTERMUD_D->eventWrite( ({ "finger-req", 5, mud_name(), pl, where, 0, ! who }) ); } --- 61,66 ---- if( !(pl = (string)this_player(1)->GetKeyName()) ) return; INTERMUD_D->eventWrite( ({ "finger-req", 5, mud_name(), pl, where, 0, ! who }) ); ! tn("eventSendFingerRequest: "+identify( ({ "finger-req", 5, mud_name(), pl, where, 0,who }) ),"cyan"); } diff -c -r --new-file ds1.1/lib/daemon/services/locate.c ds2.0r27/lib/daemon/services/locate.c *** ds1.1/lib/daemon/services/locate.c Sun Feb 1 21:29:58 1998 --- ds2.0r27/lib/daemon/services/locate.c Wed Jul 5 00:01:03 2006 *************** *** 9,14 **** --- 9,15 ---- #define SERVICE_LOCATE #include <daemons.h> + #include <rooms.h> #include <message_class.h> void eventReceiveLocateRequest(mixed array packet) { *************** *** 17,22 **** --- 18,25 ---- object ob; if( file_name(previous_object()) != INTERMUD_D ) return; + tell_room(ROOM_ARCH,"The Arch Room loudspeaker announces: \"%^BOLD%^CYAN%^"+capitalize(packet[3])+" at "+packet[2]+" has issued a locate request for %^BOLD%^YELLOW%^"+capitalize(packet[6])+".%^RESET%^\""); + tn("Locate request received: "+identify(packet),"white"); if( !(ob = find_player(packet[6])) || ob->GetInvis()) return; if( interactive(ob) ) { string array tmp = ({ }); *************** *** 29,36 **** } else status = "link-dead"; INTERMUD_D->eventWrite( ({ "locate-reply", 5, mud_name(), 0, packet[2], ! packet[3], mud_name(), ! (string)ob->GetName(), idl, status }) ); } void eventReceiveLocateReply(mixed array packet) { --- 32,39 ---- } else status = "link-dead"; INTERMUD_D->eventWrite( ({ "locate-reply", 5, mud_name(), 0, packet[2], ! packet[3], mud_name(), ! (string)ob->GetName(), idl, status }) ); } void eventReceiveLocateReply(mixed array packet) { *************** *** 41,46 **** --- 44,50 ---- if( file_name(previous_object()) != INTERMUD_D ) return; if( !stringp(packet[5]) || !(ob = find_player(convert_name(packet[5]))) ) return; + tn("Locate reply received: "+identify(packet),"white"); m = packet[7] + " was just located on " + packet[6] + "."; if( (idl = (int)packet[8]) > 60 ) m += sprintf(" (idle %02d:%02d:%02d)", idl/3600, (idl/60)%60, idl%60); *************** *** 51,57 **** void eventSendLocateRequest(string who) { string pl; ! if( !(pl = (string)this_player(1)->GetKeyName()) ) return; INTERMUD_D->eventWrite( ({ "locate-req", 5, mud_name(), pl, 0, 0, who }) ); } --- 55,62 ---- void eventSendLocateRequest(string who) { string pl; ! mixed *locate_request = ({ "locate-req", 5, mud_name(), pl, 0, 0, who }); if( !(pl = (string)this_player(1)->GetKeyName()) ) return; INTERMUD_D->eventWrite( ({ "locate-req", 5, mud_name(), pl, 0, 0, who }) ); + tn("Locate request being sent: "+identify(locate_request),"white"); } diff -c -r --new-file ds1.1/lib/daemon/services/tell.c ds2.0r27/lib/daemon/services/tell.c *** ds1.1/lib/daemon/services/tell.c Sun Feb 1 21:29:59 1998 --- ds2.0r27/lib/daemon/services/tell.c Wed Jul 5 00:01:03 2006 *************** *** 10,46 **** #include <message_class.h> void eventReceiveTell(mixed *packet) { ! object ob; string who; if( file_name(previous_object()) != INTERMUD_D ) return; who = convert_name(packet[5]); if( !(ob = find_player(who)) || (int)ob->GetInvis() ) { INTERMUD_D->eventWrite(({ "error", 5, mud_name(), 0, packet[2], ! packet[3], "unk-user", ! capitalize(packet[5]) + " is nowhere to " ! "be found on " + mud_name() + ".", ! packet })); ! return; } ob->eventPrint("%^BOLD%^RED%^" + packet[6] + "@" + packet[2] + ! " tells you:%^RESET%^ " + packet[7], MSG_CONV); ! ob->SetProperty("reply", packet[6] + "@" + packet[2]); } void eventSendTell(string who, string where, string msg) { string pl, plc; ! pl = (string)this_player(1)->GetName(); plc = (string)this_player(1)->GetCapName(); where = (string)INTERMUD_D->GetMudName(where); INTERMUD_D->eventWrite(({ "tell", 5, mud_name(), pl, where, ! convert_name(who), plc, msg })); this_player(1)->eventPrint("%^BOLD%^RED%^You tell " + capitalize(who) + ! "@" + where + ":%^RESET%^ " + msg, ! MSG_CONV); } - ! --- 10,68 ---- #include <message_class.h> void eventReceiveTell(mixed *packet) { ! object ob, machine; string who; + string adverb = ""; + tn("eventReceiveTell: "+identify(packet),"yellow"); if( file_name(previous_object()) != INTERMUD_D ) return; who = convert_name(packet[5]); if( !(ob = find_player(who)) || (int)ob->GetInvis() ) { INTERMUD_D->eventWrite(({ "error", 5, mud_name(), 0, packet[2], ! packet[3], "unk-user", ! capitalize(packet[5]) + " is nowhere to " ! "be found on " + mud_name() + ".", ! packet })); ! if(!(ob = find_player(who))) return; ! adverb = " %^BOLD%^MAGENTA%^unknowingly%^BOLD%^RED%^"; } + + machine=present("answering machine",ob); + if(machine && base_name(machine) == "/secure/obj/machine"){ + int parse_it; + string machine_message; + parse_it=machine->query_answer(); + if(parse_it && !(int)ob->GetInvis()){ + machine->get_message(packet[6] + "@" + packet[2]+ + " tells you: "+packet[7]+"\n"); + machine_message=machine->send_message(); + INTERMUD_D->eventWrite(({ "error", 5, mud_name(), 0, packet[2], + packet[3], "unk-user", + machine_message, + packet })); + return; + } + } + ob->eventPrint("%^BOLD%^RED%^" + packet[6] + "@" + packet[2] + ! adverb + " tells you:%^RESET%^ " + packet[7], MSG_CONV); ! if(!sizeof(adverb)) ob->SetProperty("reply", packet[6] + "@" + packet[2]); } void eventSendTell(string who, string where, string msg) { string pl, plc; ! pl = (string)this_player(1)->GetName(); plc = (string)this_player(1)->GetCapName(); where = (string)INTERMUD_D->GetMudName(where); INTERMUD_D->eventWrite(({ "tell", 5, mud_name(), pl, where, ! convert_name(who), plc, msg })); this_player(1)->eventPrint("%^BOLD%^RED%^You tell " + capitalize(who) + ! "@" + where + ":%^RESET%^ " + msg, ! MSG_CONV); ! tn("eventSendTell: "+identify( ({ "tell", 5, mud_name(), pl, where, convert_name(who), plc, msg }) ), "yellow"); } ! ! diff -c -r --new-file ds1.1/lib/daemon/services/ucache.c ds2.0r27/lib/daemon/services/ucache.c *** ds1.1/lib/daemon/services/ucache.c Sun Feb 1 21:29:59 1998 --- ds2.0r27/lib/daemon/services/ucache.c Wed Dec 31 19:00:00 1969 *************** *** 1,99 **** - /* /daemon/services/ucache.c - * From the Dead Souls V Object Library - * Intermud 3 ucache service implementation - * created by Tim 961211 - * Version: @(#) ucache.c 1.2@(#) - * Last modified: 96/12/14 - */ - - #define SERVICE_UCACHE - - // Number of days until an item is removed from the cache - #define UCACHE_INFO_LIFETIME 4 - - class uinfo { - string Visname; - int Gender; - int TimeStamp; - } - - private mapping Ucache = ([ ]); - - void eventReceiveUcacheUpdate(mixed array packet) { - string mud = packet[2], user = packet[6]; - class uinfo ui; - - if( file_name(previous_object()) != INTERMUD_D ) return; - if( !Ucache[mud] ) Ucache[mud] = ([ ]); - if( !(ui = Ucache[mud][user]) ) Ucache[mud][user] = ui = new(class uinfo); - ui->Visname = (string)packet[7]; - ui->Gender = (int)packet[8]; - ui->TimeStamp = time(); - } - - static void eventSendChannelUserRequest(string who, string where) { - string pl; - - INTERMUD_D->eventWrite( ({ "chan-user-req", 5, mud_name(), 0, where, 0, - who }) ); - } - - void eventClearUcache() { - if( this_player(1) && !archp(this_player(1)) ) return; - Ucache = ([ ]); - } - - void eventDisplayUcache(object agent) { - string array lines; - - if( !agent || (this_player(1) && !archp(this_player(1))) ) return; - lines = ({ "Mud User VisName Gender" }); - foreach(string mud, mapping uc in Ucache) { - foreach(string user, class uinfo ui in uc) - lines += ({ sprintf("%-:10s %-:10s %-:10s %d", - mud, user, ui->Visname, ui->Gender) }); - } - agent->eventPage(lines); - } - - static void eventCompactUcache() { - int ts = time() - (UCACHE_INFO_LIFETIME * 3600 * 24); - - foreach(string mud, mapping uc in Ucache) { - foreach(string user, class uinfo ui in uc) - if( ui->TimeStamp < ts ) map_delete(uc, user); - } - eventSave(); - call_out((: eventCompactUcache :), 3600); - } - - string GetRemoteDisplayName(string user, string mud) { - class uinfo ui; - - if( !Ucache[mud] || !(ui = Ucache[mud][user]) ) { - eventSendChannelUserRequest(user, mud); - return 0; - } - else { - ui->TimeStamp = time(); - return ui->Visname; - } - } - - string GetRemoteGender(string user, string mud) { - class uinfo ui; - - if( !Ucache[mud] || !(ui = Ucache[mud][user]) ) { - eventSendChannelUserRequest(user, mud); - return 0; - } - else { - ui->TimeStamp = time(); - switch( ui->Gender ) { - case 0: return "male"; - case 1: return "female"; - case 2: return "neuter"; - default: return 0; - } - } - } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/services/who.c ds2.0r27/lib/daemon/services/who.c *** ds1.1/lib/daemon/services/who.c Sun Feb 1 21:29:59 1998 --- ds2.0r27/lib/daemon/services/who.c Wed Jul 5 00:01:03 2006 *************** *** 7,43 **** #define SERVICE_WHO #include <daemons.h> void eventReceiveWhoReply(mixed *packet) { ! string *list, *who; object ob; if( file_name(previous_object()) != INTERMUD_D ) return; if( !packet[5] || !(ob = find_player(convert_name(packet[5]))) ) return; ! list = ({ "Remote who information from " + packet[2] + ":" }); foreach(who in packet[6]) ! list += ({ who[0] + " (" + who[1] + " idle): " + who[2] }); ! ob->eventPage(list); } void eventReceiveWhoRequest(mixed *packet) { mixed *msg; ! if( file_name(previous_object()) != INTERMUD_D ) return; ! msg = map(filter(users(), (: !((int)$1->GetInvis()) :)), ! (: ({ (string)$1->GetCapName(), query_idle($1), ! (string)$1->GetShort() }) :)); INTERMUD_D->eventWrite(({ "who-reply", 5, mud_name(), 0, packet[2], ! packet[3], msg })); } void eventSendWhoRequest(string mud) { string who; ! who = (string)this_player(1)->GetName(); INTERMUD_D->eventWrite(({ "who-req", 5, mud_name(), who, mud, 0 })); } - ! --- 7,55 ---- #define SERVICE_WHO #include <daemons.h> + #include <rooms.h> void eventReceiveWhoReply(mixed *packet) { ! string list, *who; object ob; + //tc("who packet: "+identify(packet)); if( file_name(previous_object()) != INTERMUD_D ) return; if( !packet[5] || !(ob = find_player(convert_name(packet[5]))) ) return; ! list = "%^MAGENTA%^Remote who information from " + packet[2] + ":%^RESET%^\n"; foreach(who in packet[6]) ! list += who[0] + " (" + who[1] + " idle): " + who[2] +"\n"; ! //tc("list: "+list,"blue"); ! //ob->eventPage(({list})); ! ob->eventPrint(list); ! tn("eventReceiveWhoReply: "+identify(packet),"blue"); } void eventReceiveWhoRequest(mixed *packet) { mixed *msg; ! string ret = ""; if( file_name(previous_object()) != INTERMUD_D ) return; ! msg = map(filter(users(), (: (environment($1) && !((int)$1->GetInvis())) :)), ! (: ({ (string)$1->GetCapName(), query_idle($1), ! (string)$1->GetShort() }) :)); INTERMUD_D->eventWrite(({ "who-reply", 5, mud_name(), 0, packet[2], ! packet[3], msg })); ! foreach(string *entry in msg){ ! ret += entry[0]+", "; ! } ! ret = truncate(ret,2); ! tn("eventReceiveWhoRequest: "+identify(packet),"blue"); ! tell_room(ROOM_ARCH,"The Arch Room loudspeaker announces: \"%^BOLD%^CYAN%^"+capitalize(packet[3])+" at "+packet[2]+" has requested a list of users currently logged on. Replying with: %^BOLD%^YELLOW%^"+ret+".%^RESET%^\""); } void eventSendWhoRequest(string mud) { string who; ! who = (string)this_player(1)->GetKeyName(); INTERMUD_D->eventWrite(({ "who-req", 5, mud_name(), who, mud, 0 })); + tn("eventSendWhoRequest: "+identify( ({ "who-req", 5, mud_name(), who, mud, 0 })), "blue"); } ! ! diff -c -r --new-file ds1.1/lib/daemon/services.c ds2.0r27/lib/daemon/services.c *** ds1.1/lib/daemon/services.c Sun Feb 1 21:29:56 1998 --- ds2.0r27/lib/daemon/services.c Wed Jul 5 00:00:58 2006 *************** *** 25,31 **** #include "/daemon/services/locate.c" #include "/daemon/services/tell.c" #include "/daemon/services/who.c" ! #include "/daemon/services/ucache.c" static void create() { SetSaveFile(SAVE_SERVICES); --- 25,31 ---- #include "/daemon/services/locate.c" #include "/daemon/services/tell.c" #include "/daemon/services/who.c" ! #include "/daemon/services/auth.c" static void create() { SetSaveFile(SAVE_SERVICES); *************** *** 44,97 **** mapping GetServices() { return ([ #ifdef SERVICE_AUTH ! "auth" : 1, #endif #ifdef SERVICE_CHANNEL ! "channel" : 1, #endif #ifdef SERVICE_EMOTETO ! "emoteto" : 1, #endif #ifdef SERVICE_FILE ! "file" : 1, #endif #ifdef SERVICE_FINGER ! "finger" : 1, #endif #ifdef SERVICE_LOCATE ! "locate" : 1, #endif #ifdef SERVICE_MAIL ! "mail" : 1, #endif #ifdef SERVICE_NEWS ! "news" : 1, #endif #ifdef SERVICE_TELL ! "tell" : 1, #endif #ifdef SERVICE_UCACHE ! "ucache" : 1, #endif #ifdef SERVICE_WHO ! "who" : 1, #endif #ifdef PORT_FTP ! "ftp" : PORT_FTP, #endif #ifdef PORT_HTTP ! "http" : PORT_HTTP, #endif #ifdef PORT_NNTP ! "nntp" : PORT_NNTP, #endif #ifdef PORT_RCP ! "rcp" : PORT_RCP, #endif #ifdef PORT_SMTP ! "smtp" : PORT_SMTP, #endif ! ]); } #endif /* __PACKAGE_SOCKETS__ */ --- 44,97 ---- mapping GetServices() { return ([ #ifdef SERVICE_AUTH ! "auth" : 1, #endif #ifdef SERVICE_CHANNEL ! "channel" : 1, #endif #ifdef SERVICE_EMOTETO ! "emoteto" : 1, #endif #ifdef SERVICE_FILE ! "file" : 1, #endif #ifdef SERVICE_FINGER ! "finger" : 1, #endif #ifdef SERVICE_LOCATE ! "locate" : 1, #endif #ifdef SERVICE_MAIL ! "mail" : 1, #endif #ifdef SERVICE_NEWS ! "news" : 1, #endif #ifdef SERVICE_TELL ! "tell" : 1, #endif #ifdef SERVICE_UCACHE ! "ucache" : 1, #endif #ifdef SERVICE_WHO ! "who" : 1, #endif #ifdef PORT_FTP ! "ftp" : PORT_FTP, #endif #ifdef PORT_HTTP ! "http" : PORT_HTTP, #endif #ifdef PORT_NNTP ! "nntp" : PORT_NNTP, #endif #ifdef PORT_RCP ! "rcp" : PORT_RCP, #endif #ifdef PORT_SMTP ! "smtp" : PORT_SMTP, #endif ! ]); } #endif /* __PACKAGE_SOCKETS__ */ diff -c -r --new-file ds1.1/lib/daemon/soul.c ds2.0r27/lib/daemon/soul.c *** ds1.1/lib/daemon/soul.c Sun Feb 1 21:29:54 1998 --- ds2.0r27/lib/daemon/soul.c Wed Jul 5 00:00:58 2006 *************** *** 1,5 **** /* /daemon/emote.c ! * From the Dead Souls V Object Library * A centralized soul handler * Created by Descartes of Borg 961207 * Version: @(#) soul.c 1.11@(#) --- 1,5 ---- /* /daemon/emote.c ! * From the Dead Souls Object Library * A centralized soul handler * Created by Descartes of Borg 961207 * Version: @(#) soul.c 1.11@(#) *************** *** 34,43 **** } varargs int AddRule(string verb, string rle, mixed array msg, ! string array advs) { class emote e = Emotes[verb]; class rule r; ! if( !e ) { return 0; } --- 34,43 ---- } varargs int AddRule(string verb, string rle, mixed array msg, ! string array advs) { class emote e = Emotes[verb]; class rule r; ! if( !e ) { return 0; } *************** *** 70,76 **** int RemoveRule(string emt, string rle) { class emote e = Emotes[emt]; ! if( !master()->valid_apply(({ PRIV_ASSIST })) ) { return 0; } --- 70,76 ---- int RemoveRule(string emt, string rle) { class emote e = Emotes[emt]; ! if( !master()->valid_apply(({ PRIV_ASSIST })) ) { return 0; } *************** *** 99,105 **** class emote e = Emotes[emote]; mapping adverb = ([]); class rule r; ! if( !e ) { return 0; } --- 99,105 ---- class emote e = Emotes[emote]; mapping adverb = ([]); class rule r; ! if( !e ) { return 0; } *************** *** 125,136 **** return 0; } adverb = ([ "$adverb" : matches[0] ]); - } - else { - adverb = ([ "$adverb" : args ]); - } } ! return ({ r->Message, adverb }); } string array GetEmotes() { --- 125,136 ---- return 0; } adverb = ([ "$adverb" : matches[0] ]); } ! else { ! adverb = ([ "$adverb" : args ]); ! } ! } ! return ({ r->Message, adverb }); } string array GetEmotes() { *************** *** 153,171 **** if( arg == "soul" ) { str = "Your \"soul\" is a system of expressions you can use " ! "to express how you are feeling. Though it does not really " ! "cause anything to happen, other people, including NPC's, may " ! "react to your emotions, especially when they are violent or " ! "negative.\n\n" ! "Some soul commands allow you to express an adverb to give some " ! "sort of emphasis to the expression. Some commands are limited " ! "to a certain set of adverbs, while most commands will allow you " ! "to choose from the list of system wide adverbs given below. " ! "You may always use your racial adverb in any expression " ! "allowing an adverb. A racial adverb is simply a way of " ! "emoting unique to your race, like \"smile gnomishly\".\n\n" ! "For a list of soul commands, try <help feelings>.\n\n" ! "The list of system adverbs are:\n"; str += format_page(sort_array(Adverbs, 1), 5); return str; } --- 153,171 ---- if( arg == "soul" ) { str = "Your \"soul\" is a system of expressions you can use " ! "to express how you are feeling. Though it does not really " ! "cause anything to happen, other people, including NPC's, may " ! "react to your emotions, especially when they are violent or " ! "negative.\n\n" ! "Some soul commands allow you to express an adverb to give some " ! "sort of emphasis to the expression. Some commands are limited " ! "to a certain set of adverbs, while most commands will allow you " ! "to choose from the list of system wide adverbs given below. " ! "You may always use your racial adverb in any expression " ! "allowing an adverb. A racial adverb is simply a way of " ! "emoting unique to your race, like \"smile gnomishly\".\n\n" ! "For a list of soul commands, try <help feelings>.\n\n" ! "The list of system adverbs are:\n"; str += format_page(sort_array(Adverbs, 1), 5); return str; } *************** *** 198,204 **** int all_advs = (member_array("-", r->Adverbs) != -1); int anything = (member_array("*", r->Adverbs) != -1); string rule = rls[0]; ! rule = replace_string(rule, "LIV", "SINGLE_LIVING"); rule = replace_string(rule, "LVS", "ONE_OR_MORE_LIVINGS"); if( anything ) { --- 198,204 ---- int all_advs = (member_array("-", r->Adverbs) != -1); int anything = (member_array("*", r->Adverbs) != -1); string rule = rls[0]; ! rule = replace_string(rule, "LIV", "SINGLE_LIVING"); rule = replace_string(rule, "LVS", "ONE_OR_MORE_LIVINGS"); if( anything ) { *************** *** 252,261 **** str += capitalize(arg) + " is a soul command and affects nothing.\n"; str += "System adverbs are listed in <help soul>.\n"; str += "SINGLE_LIVING: You can target a single living thing\n" ! "ONE_OR_MORE_LIVINGS: You can target multiple people using \"all\"\n" ! "PHRASE: Any random phrase\n" ! "ADVERB: Any adverb from the list of supported adverbs, or your " ! "racial adverb."; return str; } --- 252,261 ---- str += capitalize(arg) + " is a soul command and affects nothing.\n"; str += "System adverbs are listed in <help soul>.\n"; str += "SINGLE_LIVING: You can target a single living thing\n" ! "ONE_OR_MORE_LIVINGS: You can target multiple people using \"all\"\n" ! "PHRASE: Any random phrase\n" ! "ADVERB: Any adverb from the list of supported adverbs, or your " ! "racial adverb."; return str; } *************** *** 277,285 **** if( objectp(who) ) { res = who->GetRace(); } ! else { ! res == who; ! } if( !res ) { return "godly"; } --- 277,283 ---- if( objectp(who) ) { res = who->GetRace(); } ! if( !res ) { return "godly"; } *************** *** 296,302 **** mapping GetRules(string emote) { class emote e = Emotes[emote]; mapping m = ([]); ! if( !e ) { return 0; } --- 294,300 ---- mapping GetRules(string emote) { class emote e = Emotes[emote]; mapping m = ([]); ! if( !e ) { return 0; } *************** *** 321,327 **** mixed can_verb_rule(string verb, string rle) { class emote e = Emotes[verb]; class rule r; - mixed array msg; if( !e ) { return 0; --- 319,324 ---- *************** *** 338,344 **** class emote e = Emotes[verb]; class rule r = e->Rules[rle]; string adv = 0; ! switch( rle ) { case "": args = 0; --- 335,341 ---- class emote e = Emotes[verb]; class rule r = e->Rules[rle]; string adv = 0; ! switch( rle ) { case "": args = 0; *************** *** 400,412 **** if( !sizeof(matches) ) { this_player()->eventPrint("You cannot " + verb + " " + adv + ! "!"); return 1; } adv = matches[0]; } send_messages(r->Message[0], r->Message[1], this_player(), args, env, ! ([ "$adverb" : adv ])); if( args ) { args->eventReceiveEmote(this_player(), verb, adv); } --- 397,409 ---- if( !sizeof(matches) ) { this_player()->eventPrint("You cannot " + verb + " " + adv + ! "!"); return 1; } adv = matches[0]; } send_messages(r->Message[0], r->Message[1], this_player(), args, env, ! ([ "$adverb" : adv ])); if( args ) { args->eventReceiveEmote(this_player(), verb, adv); } diff -c -r --new-file ds1.1/lib/daemon/spells.c ds2.0r27/lib/daemon/spells.c *** ds1.1/lib/daemon/spells.c Sun Feb 1 21:29:57 1998 --- ds2.0r27/lib/daemon/spells.c Wed Jul 5 00:00:58 2006 *************** *** 27,33 **** spells = get_dir(DIR_SPELLS "/*.c"); foreach(string spell in spells) { object ob = find_object(DIR_SPELLS "/" + spell); ! if( ob ) { ob->eventDestruct(); } --- 27,33 ---- spells = get_dir(DIR_SPELLS "/*.c"); foreach(string spell in spells) { object ob = find_object(DIR_SPELLS "/" + spell); ! if( ob ) { ob->eventDestruct(); } diff -c -r --new-file ds1.1/lib/daemon/stargate.c ds2.0r27/lib/daemon/stargate.c *** ds1.1/lib/daemon/stargate.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/daemon/stargate.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,153 ---- + /** + * stargate_d : stargate daemon. tracks the entire stargate network. + * started 2006-03-23 by jonez + * + * 2006-03-24, jonez + * - with help from cratylus, changed the daemon so it saves it's state + * whenever there is a change, and tries to load from disk at create + * time. + * 2006-03-28, jonez + * - gate is status is now "idle", "outbound", or "inbound". gate cannot be entered from the inbound side. + */ + + #include <lib.h> + #include <save.h> + #include "/daemon/include/stargate.h" + + inherit LIB_DAEMON; + + private mapping Stargates = ([]); + + static void create(){ + daemon::create(); + SetNoClean(1); + eventLoad(); + if (!Stargates) Stargates = ([]); + } + + void eventSave(){ + unguarded( (: save_object, SAVE_STARGATE, 1 :) ); + //tc("stargate daemon saved itself"); + return; + } + + void eventLoad(){ + if (file_size(SAVE_STARGATE __SAVE_EXTENSION__) > 0){ + //tc("stargate save file exists"); + unguarded( (: restore_object, SAVE_STARGATE :) ); + } + //tc("stargate daemon loaded itself"); + //tc("Stargates: "+identify(Stargates),"red"); + return; + } + + int SetStargate(string address, string destination){ + mapping tmp = ([]); + Stargates[address] = tmp; + //tc("Stargates: "+identify(Stargates),"yellow"); + if (address == "" || destination == "") return 1; + if(sizeof(Stargates[address])) return 1; + Stargates[address]["status"] = "idle"; + Stargates[address]["destination"] = destination; + Stargates[address]["endpoint"] = ""; + eventSave(); + return 0; + } + + mapping GetStargate(string address){ + //tc("Stargates: "+identify(Stargates),"blue"); + return copy(Stargates[address]); + } + + int RemoveStargate(string address){ + //tc("Stargates: "+identify(Stargates),"red"); + map_delete(Stargates, address); + //tc("Stargates: "+identify(Stargates),"cyan"); + eventSave(); + return 0; + } + + mapping GetStargates(){ + //tc("Stargates: "+identify(Stargates),"blue"); + return copy(Stargates); + } + + int SetStatus(string address, string status){ + //tc("Setting status of "+status+" on "+address+"."); + Stargates[address]["status"] = status; + eventSave(); + return 0; + } + + string GetStatus(string address){ + //tc("Stargates: "+identify(Stargates),"red"); + return Stargates[address]["status"]; + } + + string GetDestination(string address){ + string ret = Stargates[address]; + //tc("Stargates: "+identify(Stargates),"white"); + if(sizeof(Stargates[address]) && sizeof(Stargates[address]["destination"])) + return Stargates[address]["destination"]; + else return ""; + } + + string GetEndpoint(string address){ + //tc("Stargates: "+identify(Stargates),"blue"); + return Stargates[address]["endpoint"]; + } + + int eventConnect(string from, string to){ + //tc("Stargates: "+identify(Stargates),"red"); + //tc("STARGATE_D, from: "+from+", to: "+to,"green"); + + if (from == to) return 0; + + if (!Stargates[from] || !sizeof(Stargates[from])){ + //tc("failed to lookup status of outbound gate"); + return 0; + } + + if (!Stargates[to] || !sizeof(Stargates[to])){ + //tc("failed to lookup status of inbound gate"); + return 0; + } + + if (Stargates[from]["status"] == "idle" && Stargates[to]["status"] == "idle"){ + //tc("situation normal"); + + Stargates[from]["endpoint"] = to; + Stargates[from]["status"] = "outbound"; + + Stargates[to]["endpoint"] = from; + Stargates[to]["status"] = "inbound"; + //tc("Stargates: "+identify(Stargates)); + eventSave(); + + return 1; + } + //tc("exception"); + return 0; + } + + int eventDisconnect(string from){ + string endpoint; + if(!from || from == "") return 0; + //tc("Stargates: "+identify(Stargates),"blue"); + + if (!Stargates[from] || !sizeof(Stargates[from])) return 0; + + endpoint = Stargates[from]["endpoint"]; + if (!endpoint) return 0; + + if(sizeof(Stargates[endpoint])){ + Stargates[endpoint]["endpoint"] = ""; + Stargates[endpoint]["status"] = "idle"; + } + + Stargates[from]["endpoint"] = ""; + Stargates[from]["status"] = "idle"; + + eventSave(); + return 1; + } diff -c -r --new-file ds1.1/lib/daemon/statistics.c ds2.0r27/lib/daemon/statistics.c *** ds1.1/lib/daemon/statistics.c Sun Feb 1 21:29:57 1998 --- ds2.0r27/lib/daemon/statistics.c Wed Jul 5 00:00:58 2006 *************** *** 1,5 **** /* /daemon/statistics.c ! * from the Dead Souls V Object Library * Keeps track of RAM intensive data on players * created by Descartes of Borg 951217 * Version: @(#) statistics.c 1.2@(#) --- 1,5 ---- /* /daemon/statistics.c ! * from the Dead Souls Object Library * Keeps track of RAM intensive data on players * created by Descartes of Borg 951217 * Version: @(#) statistics.c 1.2@(#) *************** *** 38,44 **** mapping GetKills(string who) { string file; ! who = convert_name(who); file = DIR_KILLS "/" + who[0..0] + "/" + who; if( unguarded((: file_size, file :)) < 1 ) return ([]); --- 38,44 ---- mapping GetKills(string who) { string file; ! who = convert_name(who); file = DIR_KILLS "/" + who[0..0] + "/" + who; if( unguarded((: file_size, file :)) < 1 ) return ([]); diff -c -r --new-file ds1.1/lib/daemon/terminal.c ds2.0r27/lib/daemon/terminal.c *** ds1.1/lib/daemon/terminal.c Sun Feb 1 21:29:57 1998 --- ds2.0r27/lib/daemon/terminal.c Wed Jul 5 00:00:58 2006 *************** *** 18,94 **** void create() { mapping nohtml; ! daemon::create(); SetNoClean(1); nohtml = ([ "BR": "", "P" : "", "/P" : "", "HREF" : "", ">" : "", ! "NAME" : "", "/A" : "", "I" : "", "/I" : "", "PRE" : "", ! "/PRE" : "", "STRONG" : "", "/STRONG" : "", "TABLE" : "", ! "/TABLE" : "", "TR" : "", "/TR" : "", "TD" : "", "/TD" : ""]); term_info = ([ ]); term_info["unknown"] = ! ([ "RESET": "", "BOLD": "", "FLASH":"", "BLACK":"", "RED":"", ! "BLUE":"", "CYAN":"", "MAGENTA":"", "ORANGE":"", "YELLOW":"", ! "GREEN":"", "WHITE":"", "BLACK":"", "B_RED":"", "B_ORANGE":"", ! "B_YELLOW":"", "B_BLACK":"", "B_CYAN":"","B_WHITE":"", "B_GREEN":"", ! "B_MAGENTA":"", "STATUS":"", "WINDOW":"", "INITTERM": "", ! "ENDTERM":""]) + nohtml; term_info["ansi"] = ! ([ "RESET":ANSI("0"), "BOLD":ANSI(1), "FLASH":ANSI(5), ! "BLACK":ANSI(30), "RED":ANSI(31), "GREEN":ANSI(32), ! "ORANGE":ANSI(33), "YELLOW":ANSI(1)+ANSI(33), "BLUE": ANSI(34), ! "CYAN":ANSI(36), "MAGENTA":ANSI(35), "BLACK":ANSI(30), ! "WHITE": ANSI(37), "B_RED":ANSI(41), "B_GREEN":ANSI(42), ! "B_ORANGE":ANSI(43), "B_YELLOW":ANSI(1)+ANSI(43), "B_BLUE":ANSI(44), ! "B_CYAN":ANSI(46), "B_BLACK":ANSI(40), "B_WHITE": ANSI(47), ! "CLEARLINE":ESC("[L")+ESC("[G"), "B_MAGENTA":ANSI(45), "STATUS":"", ! "WINDOW":"", "INITTERM":ESC("[H")+ESC("[2J"), "ENDTERM":"" ]) + ! nohtml; term_info["freedom"] = ! ([ "RESET": ESC("G0"), "BOLD":ESC("G@"), "FLASH":ESC("G2"), ! "BLACK":"", "RED":"", "GREEN":"", "ORANGE":"", "YELLOW":"", "BLUE":"", ! "CYAN":"", "MAGENTA":"", "BLACK":"", "WHITE":"", "B_RED":ESC("GD"), ! "B_GREEN": ESC("GD"), "B_ORANGE":ESC("G4"), "B_YELLOW":ESC("G4"), ! "B_BLUE":ESC("G4"), "B_CYAN":ESC("GD"), "B_BLACK": ESC("GD"), ! "B_WHITE":ESC("G4"), "B_MAGENTA":("G4"), "STATUS":"", "WINDOW":"", ! "CLEARLINE":"\r", "INITTERM":"", "ENDTERM":"" ]) + nohtml; term_info["ansi-status"] = ! ([ "RESET": ANSI("0;37;40"), "BOLD":ANSI(1), "FLASH":ANSI(5), ! "BLACK":ANSI(30), "RED":ANSI(31), "GREEN":ANSI(32), "ORANGE":ANSI(33), ! "YELLOW":ANSI(33), "BLUE":ANSI(34), "CYAN": ANSI(36), ! "MAGENTA": ANSI(35), "BLACK":ANSI(30), "WHITE":ANSI(37), ! "B_RED":ANSI(41), "B_GREEN":ANSI(42), "B_ORANGE":ANSI(43), ! "B_YELLOW": ANSI(1)+ANSI(43), "B_BLUE":ANSI(44), ! "B_CYAN": ANSI(46), "B_BLACK":ANSI(40), "B_WHITE":ANSI(47), ! "B_MAGENTA":ANSI(45), "STATUS":ESC("[23;24r")+ESC(8), ! "WINDOW":ESC(7)+ESC("[0;22r")+ESC("[22H\n"), ! "INITTERM":ESC("[H")+ESC("[J")+ESC("[23;24r")+ESC("23H\n"), ! "CLEARLINE":"\r", "ENDTERM":ESC("[0r")+ESC("[H")+ESC("[J") ]) +nohtml; ! term_info["xterm"] = ! ([ "RESET" : ANSI("0;37;40"), "BOLD": ESC("[7m"), ! "FLASH":ESC("[5m$<2>"), "BLACK":ANSI(30), "RED":ANSI(31), ! "GREEN":ANSI(32), "ORANGE":ANSI(33), "YELLOW":ANSI(33), ! "BLUE":ANSI(34), "CYAN":ANSI(36), "MAGENTA":ANSI(35),"BLACK":ANSI(34), ! "WHITE":ANSI(38), "B_RED":ANSI(41), "B_GREEN":ANSI(42), ! "B_ORANGE":ANSI(43), "B_YELLOW":ANSI(43), "B_BLUE":ANSI(44), ! "B_CYAN":ANSI(46), "B_BLACK":ANSI(40), "B_WHITE": ANSI(47), ! "B_MAGENTA": ANSI(45), "STATUS":"", "WINDOW":"", "INITTERM":"", ! "CLEARLINE":"\r", "ENDTERM":"" ]) + nohtml; ! term_info["html"] = term_info["unknown"] + ! ([ "RED" : "<FONT COLOR=\"#FF0000\">", ! "GREEN" : "<FONT COLOR=\"#00FF00\">", ! "BLUE" : "<FONT COLOR=\"#0000FF\">", ! "YELLOW" : "<FONT COLOR=\"#FFFF00\">", ! "CYAN" : "<FONT COLOR=\"#00A0DD\">", ! "MAGENTA" : "<FONT COLOR=\"#C50067\">", ! "YELLOW" : "<FONT COLOR=\"#FFFF00\">", ! "RESET": "</FONT>", ! "BR" : "<BR>", "P" : "<P>", "/P" : "</P>", ">" : ">", ! "HREF" : "<A HREF=", "NAME" : "<A NAME=", "/A" : "</A>", ! "I" : "<I>", "/I" : "</I>", "PRE" : "</PRE>", "/PRE" : "</PRE>", ! "STRONG" : "<STRONG>", "/STRONG" : "</STRONG>", ! "TABLE" : "<TABLE>", "/TABLE" : "</TABLE>", "TR" : "<TR>", ! "/TR" : "</TR>", "TD" : "<TD>" , "/TD" : "</TD>" ]); } mapping query_term_info(string type) { --- 18,94 ---- void create() { mapping nohtml; ! daemon::create(); SetNoClean(1); nohtml = ([ "BR": "", "P" : "", "/P" : "", "HREF" : "", ">" : "", ! "NAME" : "", "/A" : "", "I" : "", "/I" : "", "PRE" : "", ! "/PRE" : "", "STRONG" : "", "/STRONG" : "", "TABLE" : "", ! "/TABLE" : "", "TR" : "", "/TR" : "", "TD" : "", "/TD" : ""]); term_info = ([ ]); term_info["unknown"] = ! ([ "RESET": "", "BOLD": "", "FLASH":"", "BLACK":"", "RED":"", ! "BLUE":"", "CYAN":"", "MAGENTA":"", "ORANGE":"", "YELLOW":"", ! "GREEN":"", "WHITE":"", "BLACK":"", "B_RED":"", "B_ORANGE":"", ! "B_YELLOW":"", "B_BLACK":"", "B_CYAN":"","B_WHITE":"", "B_GREEN":"", ! "B_MAGENTA":"", "STATUS":"", "WINDOW":"", "INITTERM": "", ! "ENDTERM":""]) + nohtml; term_info["ansi"] = ! ([ "RESET":ANSI("0"), "BOLD":ANSI(1), "FLASH":ANSI(5), ! "BLACK":ANSI(30), "RED":ANSI(31), "GREEN":ANSI(32), ! "ORANGE":ANSI(33), "YELLOW":ANSI(1)+ANSI(33), "BLUE": ANSI(34), ! "CYAN":ANSI(36), "MAGENTA":ANSI(35), "BLACK":ANSI(30), ! "WHITE": ANSI(37), "B_RED":ANSI(41), "B_GREEN":ANSI(42), ! "B_ORANGE":ANSI(43), "B_YELLOW":ANSI(1)+ANSI(43), "B_BLUE":ANSI(44), ! "B_CYAN":ANSI(46), "B_BLACK":ANSI(40), "B_WHITE": ANSI(47), ! "CLEARLINE":ESC("[L")+ESC("[G"), "B_MAGENTA":ANSI(45), "STATUS":"", ! "WINDOW":"", "INITTERM":ESC("[H")+ESC("[2J"), "ENDTERM":"" ]) + ! nohtml; term_info["freedom"] = ! ([ "RESET": ESC("G0"), "BOLD":ESC("G@"), "FLASH":ESC("G2"), ! "BLACK":"", "RED":"", "GREEN":"", "ORANGE":"", "YELLOW":"", "BLUE":"", ! "CYAN":"", "MAGENTA":"", "BLACK":"", "WHITE":"", "B_RED":ESC("GD"), ! "B_GREEN": ESC("GD"), "B_ORANGE":ESC("G4"), "B_YELLOW":ESC("G4"), ! "B_BLUE":ESC("G4"), "B_CYAN":ESC("GD"), "B_BLACK": ESC("GD"), ! "B_WHITE":ESC("G4"), "B_MAGENTA":("G4"), "STATUS":"", "WINDOW":"", ! "CLEARLINE":"\r", "INITTERM":"", "ENDTERM":"" ]) + nohtml; term_info["ansi-status"] = ! ([ "RESET": ANSI("0;37;40"), "BOLD":ANSI(1), "FLASH":ANSI(5), ! "BLACK":ANSI(30), "RED":ANSI(31), "GREEN":ANSI(32), "ORANGE":ANSI(33), ! "YELLOW":ANSI(33), "BLUE":ANSI(34), "CYAN": ANSI(36), ! "MAGENTA": ANSI(35), "BLACK":ANSI(30), "WHITE":ANSI(37), ! "B_RED":ANSI(41), "B_GREEN":ANSI(42), "B_ORANGE":ANSI(43), ! "B_YELLOW": ANSI(1)+ANSI(43), "B_BLUE":ANSI(44), ! "B_CYAN": ANSI(46), "B_BLACK":ANSI(40), "B_WHITE":ANSI(47), ! "B_MAGENTA":ANSI(45), "STATUS":ESC("[23;24r")+ESC(8), ! "WINDOW":ESC(7)+ESC("[0;22r")+ESC("[22H\n"), ! "INITTERM":ESC("[H")+ESC("[J")+ESC("[23;24r")+ESC("23H\n"), ! "CLEARLINE":"\r", "ENDTERM":ESC("[0r")+ESC("[H")+ESC("[J") ]) +nohtml; ! term_info["xterm"] = ! ([ "RESET" : ANSI("0;37;40"), "BOLD": ESC("[7m"), ! "FLASH":ESC("[5m$<2>"), "BLACK":ANSI(30), "RED":ANSI(31), ! "GREEN":ANSI(32), "ORANGE":ANSI(33), "YELLOW":ANSI(33), ! "BLUE":ANSI(34), "CYAN":ANSI(36), "MAGENTA":ANSI(35),"BLACK":ANSI(34), ! "WHITE":ANSI(38), "B_RED":ANSI(41), "B_GREEN":ANSI(42), ! "B_ORANGE":ANSI(43), "B_YELLOW":ANSI(43), "B_BLUE":ANSI(44), ! "B_CYAN":ANSI(46), "B_BLACK":ANSI(40), "B_WHITE": ANSI(47), ! "B_MAGENTA": ANSI(45), "STATUS":"", "WINDOW":"", "INITTERM":"", ! "CLEARLINE":"\r", "ENDTERM":"" ]) + nohtml; ! term_info["html"] = term_info["unknown"] + ! ([ "RED" : "<FONT COLOR=\"#FF0000\">", ! "GREEN" : "<FONT COLOR=\"#00FF00\">", ! "BLUE" : "<FONT COLOR=\"#0000FF\">", ! "YELLOW" : "<FONT COLOR=\"#FFFF00\">", ! "CYAN" : "<FONT COLOR=\"#00A0DD\">", ! "MAGENTA" : "<FONT COLOR=\"#C50067\">", ! "YELLOW" : "<FONT COLOR=\"#FFFF00\">", ! "RESET": "</FONT>", ! "BR" : "<BR>", "P" : "<P>", "/P" : "</P>", ">" : ">", ! "HREF" : "<A HREF=", "NAME" : "<A NAME=", "/A" : "</A>", ! "I" : "<I>", "/I" : "</I>", "PRE" : "</PRE>", "/PRE" : "</PRE>", ! "STRONG" : "<STRONG>", "/STRONG" : "</STRONG>", ! "TABLE" : "<TABLE>", "/TABLE" : "</TABLE>", "TR" : "<TR>", ! "/TR" : "</TR>", "TD" : "<TD>" , "/TD" : "</TD>" ]); } mapping query_term_info(string type) { *************** *** 108,114 **** string GetHTML(string str) { int i, tot, fcount = 0, ncount = 0; string tmp; ! str = terminal_colour(str, term_info["html"]); tmp = str; while( (i = strsrch(tmp, "<FONT")) != -1 ) { --- 108,114 ---- string GetHTML(string str) { int i, tot, fcount = 0, ncount = 0; string tmp; ! str = terminal_colour(str, term_info["html"]); tmp = str; while( (i = strsrch(tmp, "<FONT")) != -1 ) { diff -c -r --new-file ds1.1/lib/daemon/time.c ds2.0r27/lib/daemon/time.c *** ds1.1/lib/daemon/time.c Sun Feb 1 21:30:03 1998 --- ds2.0r27/lib/daemon/time.c Wed Jul 5 00:00:58 2006 *************** *** 21,32 **** daemon::create(); Zones = ([]); ! tmp = localtime(time()); LocalZone = tmp[LT_ZONE]; x = tmp[LT_GMTOFF] / 3600; if( file_size(CFG_TIME) < 1 ) return; i = sizeof(lines = filter(explode(read_file(CFG_TIME), "\n"), ! (: $1 && $1 != "" && $1[0] != '#' :))); while(i--) { string *words; --- 21,32 ---- daemon::create(); Zones = ([]); ! tmp = local_time(time()); LocalZone = tmp[LT_ZONE]; x = tmp[LT_GMTOFF] / 3600; if( file_size(CFG_TIME) < 1 ) return; i = sizeof(lines = filter(explode(read_file(CFG_TIME), "\n"), ! (: $1 && $1 != "" && $1[0] != '#' :))); while(i--) { string *words; diff -c -r --new-file ds1.1/lib/daemon/tmp/ACID.c ds2.0r27/lib/daemon/tmp/ACID.c *** ds1.1/lib/daemon/tmp/ACID.c Sun Feb 1 21:29:56 1998 --- ds2.0r27/lib/daemon/tmp/ACID.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <damage_types.h> - int damage() { return ACID; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/tmp/ALL_DAMAGE.c ds2.0r27/lib/daemon/tmp/ALL_DAMAGE.c *** ds1.1/lib/daemon/tmp/ALL_DAMAGE.c Sun Feb 1 21:29:56 1998 --- ds2.0r27/lib/daemon/tmp/ALL_DAMAGE.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <damage_types.h> - int damage() { return ALL_DAMAGE; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/tmp/A_AMULET.c ds2.0r27/lib/daemon/tmp/A_AMULET.c *** ds1.1/lib/daemon/tmp/A_AMULET.c Sun Feb 1 21:29:55 1998 --- ds2.0r27/lib/daemon/tmp/A_AMULET.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <armour_types.h> - int armour() { return A_AMULET; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/tmp/A_ARMOUR.c ds2.0r27/lib/daemon/tmp/A_ARMOUR.c *** ds1.1/lib/daemon/tmp/A_ARMOUR.c Sun Feb 1 21:29:55 1998 --- ds2.0r27/lib/daemon/tmp/A_ARMOUR.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <armour_types.h> - int armour() { return A_ARMOUR; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/tmp/A_BELT.c ds2.0r27/lib/daemon/tmp/A_BELT.c *** ds1.1/lib/daemon/tmp/A_BELT.c Sun Feb 1 21:29:55 1998 --- ds2.0r27/lib/daemon/tmp/A_BELT.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <armour_types.h> - int armour() { return A_BELT; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/tmp/A_BODY_ARMOUR.c ds2.0r27/lib/daemon/tmp/A_BODY_ARMOUR.c *** ds1.1/lib/daemon/tmp/A_BODY_ARMOUR.c Sun Feb 1 21:29:56 1998 --- ds2.0r27/lib/daemon/tmp/A_BODY_ARMOUR.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <armour_types.h> - int armour() { return A_BODY_ARMOUR; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/tmp/A_BOOT.c ds2.0r27/lib/daemon/tmp/A_BOOT.c *** ds1.1/lib/daemon/tmp/A_BOOT.c Sun Feb 1 21:29:54 1998 --- ds2.0r27/lib/daemon/tmp/A_BOOT.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <armour_types.h> - int armour() { return A_BOOT; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/tmp/A_CLOAK.c ds2.0r27/lib/daemon/tmp/A_CLOAK.c *** ds1.1/lib/daemon/tmp/A_CLOAK.c Sun Feb 1 21:29:55 1998 --- ds2.0r27/lib/daemon/tmp/A_CLOAK.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <armour_types.h> - int armour() { return A_CLOAK; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/tmp/A_GLOVE.c ds2.0r27/lib/daemon/tmp/A_GLOVE.c *** ds1.1/lib/daemon/tmp/A_GLOVE.c Sun Feb 1 21:29:54 1998 --- ds2.0r27/lib/daemon/tmp/A_GLOVE.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <armour_types.h> - int armour() { return A_GLOVE; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/tmp/A_HELMET.c ds2.0r27/lib/daemon/tmp/A_HELMET.c *** ds1.1/lib/daemon/tmp/A_HELMET.c Sun Feb 1 21:29:55 1998 --- ds2.0r27/lib/daemon/tmp/A_HELMET.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <armour_types.h> - int armour() { return A_HELMET; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/tmp/A_LONG_BOOT.c ds2.0r27/lib/daemon/tmp/A_LONG_BOOT.c *** ds1.1/lib/daemon/tmp/A_LONG_BOOT.c Sun Feb 1 21:29:54 1998 --- ds2.0r27/lib/daemon/tmp/A_LONG_BOOT.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <armour_types.h> - int armour() { return A_LONG_BOOT; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/tmp/A_LONG_GLOVE.c ds2.0r27/lib/daemon/tmp/A_LONG_GLOVE.c *** ds1.1/lib/daemon/tmp/A_LONG_GLOVE.c Sun Feb 1 21:29:54 1998 --- ds2.0r27/lib/daemon/tmp/A_LONG_GLOVE.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <armour_types.h> - int armour() { return A_LONG_GLOVE; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/tmp/A_LONG_SOCK.c ds2.0r27/lib/daemon/tmp/A_LONG_SOCK.c *** ds1.1/lib/daemon/tmp/A_LONG_SOCK.c Sun Feb 1 21:29:55 1998 --- ds2.0r27/lib/daemon/tmp/A_LONG_SOCK.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <armour_types.h> - int armour() { return A_LONG_SOCK; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/tmp/A_MAX_ARMOUR_BIT.c ds2.0r27/lib/daemon/tmp/A_MAX_ARMOUR_BIT.c *** ds1.1/lib/daemon/tmp/A_MAX_ARMOUR_BIT.c Sun Feb 1 21:29:56 1998 --- ds2.0r27/lib/daemon/tmp/A_MAX_ARMOUR_BIT.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <armour_types.h> - int armour() { return A_MAX_ARMOUR_BIT; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/tmp/A_PANTS.c ds2.0r27/lib/daemon/tmp/A_PANTS.c *** ds1.1/lib/daemon/tmp/A_PANTS.c Sun Feb 1 21:29:55 1998 --- ds2.0r27/lib/daemon/tmp/A_PANTS.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <armour_types.h> - int armour() { return A_PANTS; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/tmp/A_RING.c ds2.0r27/lib/daemon/tmp/A_RING.c *** ds1.1/lib/daemon/tmp/A_RING.c Sun Feb 1 21:29:54 1998 --- ds2.0r27/lib/daemon/tmp/A_RING.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <armour_types.h> - int armour() { return A_RING; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/tmp/A_SHIELD.c ds2.0r27/lib/daemon/tmp/A_SHIELD.c *** ds1.1/lib/daemon/tmp/A_SHIELD.c Sun Feb 1 21:29:55 1998 --- ds2.0r27/lib/daemon/tmp/A_SHIELD.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <armour_types.h> - int armour() { return A_SHIELD; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/tmp/A_SHIRT.c ds2.0r27/lib/daemon/tmp/A_SHIRT.c *** ds1.1/lib/daemon/tmp/A_SHIRT.c Sun Feb 1 21:29:55 1998 --- ds2.0r27/lib/daemon/tmp/A_SHIRT.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <armour_types.h> - int armour() { return A_SHIRT; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/tmp/A_SOCK.c ds2.0r27/lib/daemon/tmp/A_SOCK.c *** ds1.1/lib/daemon/tmp/A_SOCK.c Sun Feb 1 21:29:54 1998 --- ds2.0r27/lib/daemon/tmp/A_SOCK.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <armour_types.h> - int armour() { return A_SOCK; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/tmp/A_VEST.c ds2.0r27/lib/daemon/tmp/A_VEST.c *** ds1.1/lib/daemon/tmp/A_VEST.c Sun Feb 1 21:29:55 1998 --- ds2.0r27/lib/daemon/tmp/A_VEST.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <armour_types.h> - int armour() { return A_VEST; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/tmp/A_VISOR.c ds2.0r27/lib/daemon/tmp/A_VISOR.c *** ds1.1/lib/daemon/tmp/A_VISOR.c Sun Feb 1 21:29:55 1998 --- ds2.0r27/lib/daemon/tmp/A_VISOR.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <armour_types.h> - int armour() { return A_VISOR; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/tmp/A_WEAPON.c ds2.0r27/lib/daemon/tmp/A_WEAPON.c *** ds1.1/lib/daemon/tmp/A_WEAPON.c Sun Feb 1 21:29:55 1998 --- ds2.0r27/lib/daemon/tmp/A_WEAPON.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <armour_types.h> - int armour() { return A_WEAPON; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/tmp/A_WEARON.c ds2.0r27/lib/daemon/tmp/A_WEARON.c *** ds1.1/lib/daemon/tmp/A_WEARON.c Sun Feb 1 21:29:56 1998 --- ds2.0r27/lib/daemon/tmp/A_WEARON.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <armour_types.h> - int armour() { return A_WEARON; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/tmp/BLADE.c ds2.0r27/lib/daemon/tmp/BLADE.c *** ds1.1/lib/daemon/tmp/BLADE.c Sun Feb 1 21:29:56 1998 --- ds2.0r27/lib/daemon/tmp/BLADE.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <damage_types.h> - int damage() { return BLADE; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/tmp/BLUNT.c ds2.0r27/lib/daemon/tmp/BLUNT.c *** ds1.1/lib/daemon/tmp/BLUNT.c Sun Feb 1 21:29:56 1998 --- ds2.0r27/lib/daemon/tmp/BLUNT.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <damage_types.h> - int damage() { return BLUNT; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/tmp/COLD.c ds2.0r27/lib/daemon/tmp/COLD.c *** ds1.1/lib/daemon/tmp/COLD.c Sun Feb 1 21:29:56 1998 --- ds2.0r27/lib/daemon/tmp/COLD.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <damage_types.h> - int damage() { return COLD; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/tmp/GAS.c ds2.0r27/lib/daemon/tmp/GAS.c *** ds1.1/lib/daemon/tmp/GAS.c Sun Feb 1 21:29:56 1998 --- ds2.0r27/lib/daemon/tmp/GAS.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <damage_types.h> - int damage() { return GAS; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/tmp/HEAT.c ds2.0r27/lib/daemon/tmp/HEAT.c *** ds1.1/lib/daemon/tmp/HEAT.c Sun Feb 1 21:29:56 1998 --- ds2.0r27/lib/daemon/tmp/HEAT.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <damage_types.h> - int damage() { return HEAT; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/tmp/KNIFE.c ds2.0r27/lib/daemon/tmp/KNIFE.c *** ds1.1/lib/daemon/tmp/KNIFE.c Sun Feb 1 21:29:56 1998 --- ds2.0r27/lib/daemon/tmp/KNIFE.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <damage_types.h> - int damage() { return KNIFE; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/tmp/MAGIC.c ds2.0r27/lib/daemon/tmp/MAGIC.c *** ds1.1/lib/daemon/tmp/MAGIC.c Sun Feb 1 21:29:56 1998 --- ds2.0r27/lib/daemon/tmp/MAGIC.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <damage_types.h> - int damage() { return MAGIC; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/tmp/MAX_DAMAGE_BIT.c ds2.0r27/lib/daemon/tmp/MAX_DAMAGE_BIT.c *** ds1.1/lib/daemon/tmp/MAX_DAMAGE_BIT.c Sun Feb 1 21:29:56 1998 --- ds2.0r27/lib/daemon/tmp/MAX_DAMAGE_BIT.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <damage_types.h> - int damage() { return MAX_DAMAGE_BIT; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/tmp/SHOCK.c ds2.0r27/lib/daemon/tmp/SHOCK.c *** ds1.1/lib/daemon/tmp/SHOCK.c Sun Feb 1 21:29:56 1998 --- ds2.0r27/lib/daemon/tmp/SHOCK.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <damage_types.h> - int damage() { return SHOCK; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/tmp/WATER.c ds2.0r27/lib/daemon/tmp/WATER.c *** ds1.1/lib/daemon/tmp/WATER.c Sun Feb 1 21:29:56 1998 --- ds2.0r27/lib/daemon/tmp/WATER.c Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #include <damage_types.h> - int damage() { return WATER; } --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/underworld.c ds2.0r27/lib/daemon/underworld.c *** ds1.1/lib/daemon/underworld.c Sun Feb 1 21:29:57 1998 --- ds2.0r27/lib/daemon/underworld.c Wed Dec 31 19:00:00 1969 *************** *** 1,111 **** - /* /daemon/underworld.c - * From Dead Souls LPMud - * This object belongs to Dead Souls LPMud and is NOT part of - * the Dead Souls LPC Library distribution - * Any use of this object or the code contained within - * outside of Dead Souls LPMud without the express written - * permission of the Dead Souls LPMud administration is prohibted - * copyright (c) 1995 Dead Souls LPMud - * created by Descartes of Borg 950402 - * Version: @(#) underworld.c 1.5@(#) - * Last modified: 96/10/27 - */ - - #ifdef Dead SoulsLPMud - - #include <lib.h> - #include <dirs.h> - #include <rooms.h> - - inherit LIB_DAEMON; - - string array UndeadTypes = ({ "ghost", "phantom", "vampire", "shade", - "wraith", "zombie", "mummy", "skeleton", - "ghoul", "werewolf", "liche" }); - - static void create() { - daemon::create(); - SetNoClean(1); - } - - int CanFly(string type) { - switch(type) { - case "ghost": case "phantom": case "vampire": case "shade": - case "wraith": - return 2; - - default: - return 0; - } - } - - int GetMaterial(string type) { - switch(type) { - case "ghost": case "phantom": case "shade": case "wraith": - return 0; - - case "vampire": case "zombie": case "mummy": case "skeleton": - case "liche": case "ghoul": - return 1; - - default: - return 1; - } - } - - int isUndeadType(string type) { - return (member_array(type, UndeadTypes) != -1); - } - - string GetRandomUndead(object who) { - int x; - - if( who->ClassMember("mage") ) { - x = 10; - } - else { - x = 9; - } - switch(random(x)) { - case 0: - return "ghost"; - - case 1: - return "zombie"; - - case 2: - return "vampire"; - - case 3: - return "ghoul"; - - case 4: - return "skeleton"; - - case 5: - return "mummy"; - - case 6: - return "phantom"; - - case 7: - return "shade"; - - case 8: - return "wraith"; - - case 9: - return "liche"; - } - } - - string GetStandardRoom() { - return ROOM_START; - } - - string GetUnderworldRoom() { - return ROOM_START; - return DIR_UNDERWORLD_DOMAIN "/start"; - } - - #endif // Dead SoulsLPMud --- 0 ---- diff -c -r --new-file ds1.1/lib/daemon/unique.c ds2.0r27/lib/daemon/unique.c *** ds1.1/lib/daemon/unique.c Sun Feb 1 21:29:59 1998 --- ds2.0r27/lib/daemon/unique.c Wed Jul 5 00:00:58 2006 *************** *** 15,21 **** daemon::create(); Objects = ([]); if( file_size(SAVE_UNIQUE __SAVE_EXTENSION__) > 0 ) ! unguarded( (: restore_object, SAVE_UNIQUE :) ); } void eventTouchObject() { --- 15,21 ---- daemon::create(); Objects = ([]); if( file_size(SAVE_UNIQUE __SAVE_EXTENSION__) > 0 ) ! unguarded( (: restore_object, SAVE_UNIQUE :) ); } void eventTouchObject() { *************** *** 44,46 **** --- 44,55 ---- unguarded( (: save_object, SAVE_UNIQUE :) ); return ob; } + + mapping GetUniques(){ + return copy(Objects); + } + + mapping ResetUniques(){ + Objects = ([]); + unguarded( (: save_object, SAVE_UNIQUE :) ); + } diff -c -r --new-file ds1.1/lib/daemon/verbs.c ds2.0r27/lib/daemon/verbs.c *** ds1.1/lib/daemon/verbs.c Sun Feb 1 21:29:57 1998 --- ds2.0r27/lib/daemon/verbs.c Wed Jul 5 00:00:58 2006 *************** *** 1,5 **** /* /daemon/verbs.c ! * from the Dead Soulsr2 Object Library * handles the loading and rehashing of verbs * created by Descartes of Borg 951016 */ --- 1,5 ---- /* /daemon/verbs.c ! * from the Dead Souls Object Library * handles the loading and rehashing of verbs * created by Descartes of Borg 951016 */ *************** *** 14,19 **** --- 14,20 ---- static void create() { daemon::create(); Verbs = ([]); + SetNoClean(1); eventReloadVerbs(); } *************** *** 22,27 **** --- 23,29 ---- string verb; int i; + //tc("/daemon/verbs: eventReloadVerbs"); if( arrayp(val) ) verbs = filter(val, (: GetValidVerb($1) :)); else if( stringp(val) ) { if( strlen(val) > 2 && val[<2..] == ".c" ) val = val[0..<3]; *************** *** 32,42 **** if( this_player() && cwd = (string)this_player()->query_cwd() ) { tmp = absolute_path(cwd, val); if( file_exists(tmp + ".c") && GetValidVerb(tmp) ) ! verbs = ({ tmp }); } if( !verbs ) { if( file_size(tmp) == -2 && GetValidVerb(tmp) ) ! verbs = map(get_dir(tmp+"/*.c"), (: $(tmp) + "/" + $1 :)); } else { string dir; --- 34,44 ---- if( this_player() && cwd = (string)this_player()->query_cwd() ) { tmp = absolute_path(cwd, val); if( file_exists(tmp + ".c") && GetValidVerb(tmp) ) ! verbs = ({ tmp }); } if( !verbs ) { if( file_size(tmp) == -2 && GetValidVerb(tmp) ) ! verbs = map(get_dir(tmp+"/*.c"), (: $(tmp) + "/" + $1 :)); } else { string dir; *************** *** 60,82 **** foreach(dir in get_dir(DIR_VERBS + "/")) { dir = DIR_VERBS + "/" + dir; if( file_size(dir) == -2 ) ! verbs += map(get_dir(dir + "/*.c"), (: $(dir) + "/" + $1 :)); } } i = 0; foreach(verb in verbs) { object ob; string *verb_list; ! if( ob = find_object(verb) ) ob->eventDestruct(); if( ob = load_object(verb) ) { i++; if( !(verb_list = (string *)ob->GetVerbs()) ) ! verb_list = ({ explode(verb, "/")[<1][0..<3] }); else { verb_list += (string *)ob->GetSynonyms(); verb_list =distinct_array(map(verb_list, ! (: explode($1," ")[0] :))); } Verbs += expand_keys(([ verb_list : verb ])); } --- 62,84 ---- foreach(dir in get_dir(DIR_VERBS + "/")) { dir = DIR_VERBS + "/" + dir; if( file_size(dir) == -2 ) ! verbs += map(get_dir(dir + "/*.c"), (: $(dir) + "/" + $1 :)); } } i = 0; foreach(verb in verbs) { object ob; string *verb_list; ! if( ob = find_object(verb) ) ob->eventDestruct(); if( ob = load_object(verb) ) { i++; if( !(verb_list = (string *)ob->GetVerbs()) ) ! verb_list = ({ explode(verb, "/")[<1][0..<3] }); else { verb_list += (string *)ob->GetSynonyms(); verb_list =distinct_array(map(verb_list, ! (: explode($1," ")[0] :))); } Verbs += expand_keys(([ verb_list : verb ])); } *************** *** 85,96 **** --- 87,101 ---- } string GetErrorMessage(string verb) { + //tc("/daemon/verbs: GetErrorMessage"); if( !Verbs[verb] ) return 0; else return (string)Verbs[verb]->GetErrorMessage(); } int GetValidVerb(string verb) { + //tc("/daemon/verbs: GetValidVerb: verb: "+verb); return !strsrch(verb, DIR_VERBS); + //key_arr = keys(GetVerbs()); } mapping GetVerbs() { return copy(Verbs); } diff -c -r --new-file ds1.1/lib/daemon/war.c ds2.0r27/lib/daemon/war.c *** ds1.1/lib/daemon/war.c Sun Feb 1 21:30:00 1998 --- ds2.0r27/lib/daemon/war.c Wed Dec 31 19:00:00 1969 *************** *** 1,86 **** - /* /daemon/war.c - * From Dead Souls LPMud - * A daemon to manage who can kill whom - * Created by Descartes of Borg 961117 - * Version: %A% - * Last modified: %D% - */ - - #include <lib.h> - - inherit LIB_DAEMON; - - private int LastWar = 0; - private class war War = 0; - - static void create() { - daemon::create(); - SetNoClean(1); - } - - varargs int GetAtWar(object agent, object target) { - string name; - - if( !War ) { - return 0; - } - if( !agent ) { - return 1; - } - name = agent->GetKeyName(); - if( member_array(name, War->aggressor->members) == -1 ) { - if( member_array(name, War->enemy->members) == -1 ) { - return 0; - } - } - if( !target ) { - return 1; - } - name = target->GetKeyName(); - if( member_array(name, War->aggressor->members) == -1 ) { - if( member_array(name, War->enemy->members) == -1 ) { - return 0; - } - } - return 1; - } - - mixed eventDeclareWar(object who, string victim, string reason) { - if( GetAtWar() ) { - return "There is already a war raging between " + - item_list(map(GetEnemies(), (: capitalize :))) + "."; - } - if( !leaderp(who) ) { - return "You do not have the power to declare war."; - } - if( time() - WAR_INTERVAL < LastWar ) { - return "Let the dust settle from the last war!"; - } - obs = filter(users(), function(object ob, string victim) { - if( !leaderp(ob) ) { - return 0; - } - return ob->ClassMember(victim); - }, victim); - obs -= ({ who }); - if( !sizeof(obs) ) { - return "The enemy must have a leader online for a declaration of war."; - } - War = new(class war); - War->start = time(); - War->reason = reason; - War->aggressor = new(class team); - War->aggressor->name = who->GetClass(); // multi-class??? - War->aggressor->leader = who->GetKeyName(); - War->aggressor->points = 0; - War->aggressor->war_chest = 0; - War->aggressor->members = ({ who->GetKeyName() }); - War->enemy = new(class team); - War->enemy->name = victim; - War->enemy->leader = enemy->GetKeyName(); - War->enemy->points = 0; - War->enemy->war_chest = 0; - War->enemy->members = ({ enemy->GetKeyName() }); - users()->eventPrint("%^BOLD%^GREEN%^" + who->GetCapName() + - " has declared war on " + pluralize(victim) + "!"); - } --- 0 ---- diff -c -r --new-file ds1.1/lib/doc/BASICS ds2.0r27/lib/doc/BASICS *** ds1.1/lib/doc/BASICS Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/BASICS Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,56 ---- + Handling Files: the Basics + ^^^^^^^^^^^^^^^^^^^^^^^^^^ + 1) The "more" prompt: + Text generally scrolls with the "more" system, which + reads a page, then prompts you to read further. In Frontiers, + the way to advance to the next page is to hit <return>. + This will take you to the next page of text. To + scroll backward, hit the "b" key, then <return>. + To stop reading the file, + hit the "q" key, and return. + + 2) The file/directory structure: + Information is stored in files. Files are organized in + directories. Directories are organized in other directories. + This text, for example, is in the file + /doc/BASICS + If you wanted to look at this file without the manual, you + could type: more /doc/BASICS + and you would get to read this file again. + + 3) Handling files and directories: + The /domains directory contains a bunch of other directories + which contain more directories and files. This way of organizing + information helps keep similar or related information together. + To look at the contents of the /domains directory, you type: + cd /domains + and then type: + ls + The "ls" command lets you see a list of the contents of the + directory you've specified. To go to your home directory, issue + the "cd" command by itself, then "ls". You will then see the + contents of your own directory. The top level directory of the + mud is accessed through "cd /" without quotations. If you "ls" + then, you'll see the directories in which *everything* in the + mud is kept. You may explore from there. + + 4) Common file/directory commands: + + ls - Lists your current working directory + cd - Changes directory to whatever you specify. If there is + a directory called joe in your current working directory, + "cd joe" without quotations will change your current + working directory to joe, and "ls" will list the contents + of that directory. + cd .. - Moves you up one directory. + more - Displays the contents of a file. Doesn't work with + directories. If schmoe is a file in your current working + directory, then "more schmoe" will display the contents + of that file. If it's a directory, you'll need to "ls". + ed - Lets you edit the specified file, if it belongs to you. + If in your home directory there is a file called + workroom.c, then "ed workroom.c" will allow you to edit + that file and change it to what you want. Read Chapter + 2 of this manual section for details on the editor. + + diff -c -r --new-file ds1.1/lib/doc/CHANGES ds2.0r27/lib/doc/CHANGES *** ds1.1/lib/doc/CHANGES Wed Mar 10 22:17:28 1999 --- ds2.0r27/lib/doc/CHANGES Wed Dec 31 19:00:00 1969 *************** *** 1,30 **** - ---- Version 1.1pre released ---- - 7 added Dvarsks improved Virtual Libs. Who knows we may provide - examples in the next revision. - 6 added ftpd support within the mud. This is courtesy of Dvarsk and - Lima. You must read and comply to the Lima USAGE document. - After you read that document you can start the ftpd using - something like - call /secure/daemon/inet->AddService("ftp", PORT_FTP, - "/secure/lib/net/ftp.c", DATAGRAM) if my feable memory is working. - 5 added /lib/std/story.c (read the lib to find out how to use it) - 4 lib/comp/container GetRadientLight() to GetRadientLight(ambient) - 3 mkdir 0-9 in $MUDHOME/lib/secure/save/postal - 2 in /lib/living.c remove arguments to direct_smell_obj() line 128 - 129 - 1 in /secure/daemon/master.c edit the lines 194-204 to be: - if( (tmp = base_name(ob)) == LIB_PLAYER || tmp == LIB_CREATOR) { - if( !PlayerName ) i = sizeof(stack = ({ob})+previous_object(-1)); - else if( file == DIR_PLAYERS+"/"+PlayerName[0..0]+"/"+ - PlayerName + __SAVE_EXTENSION__ ) - return 1; - else if( file == DIR_CRES+"/"+PlayerName[0..0]+"/"+ - PlayerName + __SAVE_EXTENSION__ ) - return 1; - else i = sizeof(stack = ({ ob })); - } - else if( tmp + __SAVE_EXTENSION__ == file ) return 1; - - ---- Version 1.0 released ---- - This was the orriginal - unversioned version. --- 0 ---- diff -c -r --new-file ds1.1/lib/doc/CREDITS ds2.0r27/lib/doc/CREDITS *** ds1.1/lib/doc/CREDITS Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/CREDITS Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,29 ---- + I'd like to thank the following people for their help, witting or + otherwise, in making the new release of Dead Souls possible: + + Sine qua non: Descartes, the legion of MudOS developers, and + all those coders who toiled at Nightmare, and Lars Pensjö. + Marius for his kind permission to bundle MudOS. + + Direct conributors: Haderach and his clever code and inspiration, Duuk + and his willingness to let me poke through his lib and + filch code. Great thanks to Marajin for his direct and + substantial contribution to the Windows port. + Much gratitude to Saquivor, for whom a town street is + now named, for getting the Windows socket code working. + Thanks also to the following for code donation, + support, and/or contribution: Tim@TimMUD, Manchi, + Brodbane, Ashon, Shadyman, Jonez, Cecil, Daelas. + + Appreciation of: Jayren, Kaylus, Arianrhod, Nosmo, Pyro, Abby, Balmung, + Aten, Metiscus, Garfield, Javelin, Alensin, Daelas, + Zeus, Dastuun, Detah, and Nulvect for their + thoughtful comments and suggestions. + + Also: Xyzzy He Is Cool + + + Cratylus @ Dead Souls + 04 Jan 2006 + updated May 2006 + diff -c -r --new-file ds1.1/lib/doc/README ds2.0r27/lib/doc/README *** ds1.1/lib/doc/README Sun Feb 1 21:45:26 1998 --- ds2.0r27/lib/doc/README Wed Jul 5 00:00:58 2006 *************** *** 1,22 **** The Dead Souls Mud Library ! Released 1 February 1998 ! The Dead Souls Mud Library is a special compilation of files from the ! old Nightmare Mudlib that have been released into the public domain. ! This code is provided as-is without any offering of support or ! guarantees of suitability for any specific use. The existence of this ! code in the public domain pertains only to the code in this ! distribution. It does not imply or suggest permission to use other ! code by the authors of this work or related works by other authors. ! ! This code is known to work with MudOS v22b25. You should download and ! install whatever version of MudOS you desire. Be warned, however, ! that newer versions may or may not work with this release. You may ! have to modify the code in this distribution to get things to work. ! Do not, under any circumstances, email the author of this distribution ! for support. Your email will be deleted unread. If you have ! questions, subscribe to the nightmare-mudlib mailing list by visiting ! http://list.imaginary.com/mailman/listinfo/nightmare-mudlib. ! George Reese ! 1 February 1997 --- 1,38 ---- The Dead Souls Mud Library ! Released 18 December 2005 ! UPGRADE NOTE: If you are upgrading from an older version of ! Dead Souls, you have to copy your old /secure/cfg/mudos.cfg somewhere ! safe first, and then restore it after you upgrade. Alternately ! you may just edit the new mudos.cfg to say what the old one said. ! GENERAL FAQ: http://dead-souls.net/ds-faq.html ! ! ADMIN FAQ: http://dead-souls.net/ds-admin-faq.html ! ! ED TUTORIAL: http://dead-souls.net/editor.html ! ! NEW CREATION SYSTEM: http://dead-souls.net/example.html ! ! Please read /doc/SUPPORT for details on the supportability ! of this software. Note that the Frontiers LPC Foundation does not take ! the responsibility for getting you up and running, or fixing bugs. ! This code is available to you as-is. ! ! Some years ago, Descartes @ Nightmare chose to retire his ! Nightmare mudlib from distribution. Despite various disputes over ! the years, this embargo has stood quite firm. Yet some folks felt ! that it was a fine lib, and many were sorry to see it go. ! ! This mudlib is based on that old warhorse. It is entirely ! free from those copyright problems, and can be shared. ! ! The latest files will be at ! http://sourceforge.net/project/showfiles.php?group_id=148388 ! ! Please review /doc/old/README for more historical background. ! ! Have fun! ! ! - Cratylus @ Frontiers ! 18 December 2005 diff -c -r --new-file ds1.1/lib/doc/RELEASE_NOTES ds2.0r27/lib/doc/RELEASE_NOTES *** ds1.1/lib/doc/RELEASE_NOTES Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/RELEASE_NOTES Wed Jul 5 00:52:42 2006 *************** *** 0 **** --- 1,544 ---- + ---- 2.0r27 --- + - Fixed currency problem in dying NPC's. + - Added commands: env, polyglottize + - Fixed "about" verb. + - Tweaked snoop daemon and snoop objects. + - Added pay-for-lessons feature in language teachers. + - Fixed bug in LIB_EXITS that hosed various things, + including wandering NPC's. + - mv command no longer overwrites an existing destination file. + - Fixed campus rooms with hosed CanReceive()'s that horked logins. + - Turned "move" command into "transfer", to address a conflict with + the "move" verb. - Fixed bug in admintool that prevented assistant admins from + using it. + - Fixed bug in eval that prevented assistant admins from using it. + - i3router: dynamic channel data is now persistent (newly created + channels won't disappear when the router resets). + - i3router: fixed a bug in chanlist-reply that stopped the + channel list being sent to LPUni lib muds. + - Modified install process to handle compiling on Wolfpaw servers. + - Added code example domain that was donated by Daelas @ Moraelinost. + - Added new podium, conference room, and margins command that were + donated by Daelas @ Moraelinost. + - i3router: correct password is now honored. + - Fixed help daemon bug that displayed race help twice. + - QCS: creating an enter no longer wipes exits from an existing + target room. + - Fixed bug in rescue login (Thanks, Nulvect). + - Fixed bug in tell command that mishandled mud name ambiguity. + - Fixed bug in CHAT_D that failed to return remote channel listeners. + - i3router: fixed bug that incorrectly rejected targeted emotes. + - Killing a creature super-ultra-extremely fast no longer + generates multiple corpses. + - QCS: Fixed some money problems with both how much things cost and + how much money they have. + - Modified encumbrance to be rather less cumbersome. + - Mailer default behavior now is to notify you when you receive new + mail. Already created characters do not have this default. + - Fixed opacity problem in worn storage. + - Fixed message board in arch room. + + ---- 2.0r26 --- + - Plugged some serious security holes ( http://dead-souls.net/news.html#16jun06 ) + - Cleaned up some unnecessary call_outs in lib objects. + - Added LIB_PULL. + - Added Virtual Campus domain. + - Fixed qcs problem that screwed LIB_DUMMY. + - Fixed local channel emote problem in RESTRICTED_INTERMUD mode. + - Added sefun: alpha_crypt. + - Added conference room east of the Adventurer's Hall. + - admintool no longer lets you remove the last + currency. + - COMPAT BUSTER: UNIX version now uses MD5 crypt, like the Windows + version. Character files created prior to using this driver + will not work with this driver. + - rwho no longer cares if the issuer of the + command is invisible. + + ---- 2.0r25 --- + - r24 had some unfortunate licensing problems attached. + r25 includes a Win32 native binary that does not depend + on any GPL code to run. + - This release is hereby dedicated to Saquivor, who was + instrumental in getting this binary compiled. + - r25 lib does not differ from r24 or r23. Unless you + need the native Win32 binary, you should skip this + release if you have r23 or r24. + + ---- 2.0r24 --- + - Ran into some trouble when releasing r23. For + technical reasons, it's being re-released as r24. + + ---- 2.0r23 --- + - Fixed a bug that sent local channel data to the i3 + router. Sorry about this, guys. As soon as I found + this, I killed it. It appears to have affected r22 only. + - Fixed a conflict between room SetActions and LIB_FISHING. + - It is no longer possible to fish while asleep. + - Admins can no longer decre themselves. + - Modified MudOS source to compile on IRIX using Nekoware. + - Fixed PK bug. Added PLAYER_KILL to config.h . + - Fixed problem with monitor failures and runaway + snooper generation. + - Fixed gate command, renamed it stargate.c. + - Added Administrator's Guidebook. Initial draft available + at http://dead-souls.net/guide/ + - Added downloads.html to doc pages. + - Added verbs.html to doc pages. + - Added i3who command to list who data on all muds. + - Fixed a germ bug that triggered a combat message. + - Fixed an invalid index bug in STARGATE_D and + in LIB_STARGATE. + + ---- 2.0r22 --- + - Changed UNIX config and start scripts to assume + Bourne shell rather than bash. + - Fixed "look in" bug in transparent containers. + - Added stargate lab east of the Creators' Hall. + - Added sefun: compare_array. + - Fixed divide-by-zero bug in net worth calculator. + - Fixed "look in" bug in opaque containers. + - Fixed snoop and monitoring bugs. + - Added SetAction to rooms, for time-based events. See + /domains/town/room/shore.c for an example. + - Fixed plural limb problem in RACES_D help. + - Worn/wielded items must be removed/unwielded before they can be dropped with "drop all". + - Worn/wielded items must be removed/unwielded before they can be sold with "sell all". + - Consolidated Windows and UNIX distributions into a + single download file. + - Converted class variables in STARGATE_D to mappings, + and fixed "inbound/idle gate" bug, as well as room + message bug. + - Updated FAQs and miscellaneous documentation. + - Fixed bug in RESTRICTED_CHANNELS. + - Cleaned up odd function names in LIB_LEAD. + - Tightened up earmuffing, added muffing of entire muds. + - Fixed a bug in look verb that prevented looking + at dummy items. + - Fixed a few bugs in trainers. Added a SetNoSpells() lfun + to control whether a trainer automatically can teach the + spells she knows. + - Fixed noisy index error in LIB_GERM. + - Fixed CHAT_D bug that prevented talking on some channels. + - Fixed problem in LIB_FISHING that made one's catch disappear. + - Fixed opacity for containers. If an item's opacity is about + 33 or below, its contents are visible on casual examination. + Otherwise, you have to "look in" it. + + ---- 2.0r21 --- + - Fixed a bug in "following" code. + - Fixed a bug in trainer code. + - Fixed latent SNOOP_D bugs. + - Lowered log rotation threshold. + - Corrected stat distortion problem in races.o. + - Added the domaincreate command. + - General minor typo/bugfixes. + - Tidied up interaction between rid, suicide, and + PLAYERS_D. + - Updated FAQs. + - Fixed bug in scan when providing all of the flags: -e -d -i + - Fixed put.c. + - Fixed unusually generous vendors. + - Fixed bug in objects() sefun that interfered + with resets. + - Removed clan inheritance from gstaff.c. + + ---- 2.0r20 --- + - "put all in <thing>" now ignores worn and wielded + items. + - Added commands: switchrouter, domainadmin, + monitor, unmonitor. + - (hopefully) Fixed rare and peculiar bug that hosed + up logins unpredictably. + - Added the Jonez stargate system. + - Container bug fixed. It is now possible to put + amounts of money into containers and onto surfaces. + - Daemonized snoop system. This permits the logging + of snoop data, unmanned snoop logs, and snooping + multiple players at once. Still slightly buggy, so + please report any problems with it. + - The encre and decre of non-logged-on users now + behaves properly. + - Furnaces now destroy objects almost immediately. + - Fixed voting system. + - LIB_GUILD changed to LIB_CLAN. It works, but is + not actually useful. Proper clan functionality + is planned post-2.1. + - Heal command now fixes individual limbs as well. + - Added ENABLE_ENCUMBRANCE define to config.h to + toggle the encumbrance combat modifier. + - Modified combat so it's difficult to fight while + carrying stuff. Anything worn or wielded doesn't + affect combat capability. NPC's are unaffected by this. + - Fixed horrendous carry-capacity leak in all containers. + - Added "every" token to reload verb, enabling the + reload of all loaded objects that inherit the specified + library object, eg "reload every npc". + - Fixed bugs in invisibility. + - Enabled QCS to work in /domains directories for + creators set as domain admins with the + domainadmin command. + - Fixed error in RACES_D that dramatically distorted stats. + - Added sefun: domain_admin. + - Fixed mudlist cache problem. + - Added command: switchrouter, domainadmin. + - Added set_heart_beat to QCS. + - Fixed bugs in commands: banish, anglicize. + - Integrated most packet data with network room. + - Added router room for I3 router debugging. + - Integrated most I3 packets with router room. + + ---- 2.0r19 --- + - Fixed menu item bug in LIB_BARKEEP. + - Fixed Ylsrim pub. + - Added keepalive pinger tool to wiz chest. + - Added commands: anglicize, debug, expel, resetpasswd. + - Fixed first boot problem with /secure/daemon/letters.c. + - Driver: set heart_beat to approximately one per second. + - Driver: added locale workaround to startmud script. + - Added Brodbane's New and Improved cp command. + - Added Brodbane's sefuns: wild_card, remove_dots. + - Elision bug in pager.c fixed by Brodbane. + - Added network troubleshooting room. + - Fixed bug in invisibility. + - Made tricorder and remote control emit warnings, logs, + and errors when used by a non-creator who does not have a + visitor pass. + - Added colon emote behavior to channels, eg, "ds :smile" works + the same as "dsemote smile". + - Tim's I3 router integrated into the lib. Fixes forthcoming. + - Object Properties map variable now persists as well. + - Added Brodbane's dsversion command. + - Fixed bug in LIB_SENTIENT eventReceiveEmote. + - Added Shadyman's fix to the imc2 daemon. + - Added language teacher and schoolhouse to /domains/town. + - Added LIB_TEACHER. + - Tweaked interactive.c to omit null obvious exits. + - Fixed "list" conflict with restricted channels and shops. + - Added SetNativeLanguage to QCS. + - Added PINGING_MUDS, ENGLISH_ONLY and HUMANS_ONLY defines to config.h. + - Added commands: anglicize, debug, expel. + - Added SetNativeLanguage() to LIB_LANGUAGE. + - Added GetEquippedLimbs() to LIB_BODY. + - Visitor's pass now suppresses autosave messages. + - Full cardinal direction aliases added to players (eg "north"). + - Added direction aliases to 'peer' command. + - Player Properties map variable now persists across quits and boots. + This may or may not be a good thing, and could change in + future releases. + - Added sefuns debug(), tell_creators(); + - Fixed socket_address(). + - Added AUTOEXEC_D. + + ---- 2.0r18 --- + - Changed default intermud router to 149.152.218.102 port 23 + - Added a sanity check in telnet room. + - Fixed bug in Newbie Mansion Quest (thx Jonez). + - Added verb: pulsecheck. + - Fixed bug in delete verb that broke when deleting an + item with a relative include defined. + - Fixed a wielding bug that let you wield a two-handed + weapon AND a one-handed weapon. + - Added more damage types. + - Fixed month bug in timestamp.c. + - Fixed light bug in ROOM_VOID. + + ---- 2.0r17 --- + - Fixed bug that prevented assistant admins from shutting down. + - Added Shadyman's emote doc. + - Tweaked timestamp() (thx, Jonez). + - Tweaked "dest" code (thx, Cecil). + - Added convert_ascii() sefun to stringify ascii codes. + - Added get_random_living() sefun. + - QCS now sanely stops when the target is virtual. + - Players can no longer be hosed by being initfixed. + - Fixed bug that returned conflicting messages if + an intermud tell was received while invis with + voicemail enabled. + - timezone.cfg can now be set to blank with admintool. + - Fixed problem in CHAT_D that restricted local channel + emotes when intermud was set to be restricted. + - Fixed a bug in null currency addition in admintool. + - Smushed another apostrophe problem. This is really ridiculous, I + should just fix the real problem, but it's such a dumb + bug, it's easier to pretend it doesn't exist. + - Added SetCustomXP to /lib/combat so that NPC's can have + expee value independent of that calculated from their level. + - Added SetCustomXP to QCS. + - Wrapped users() efun in a sefun to exclude users without + an environment. + - Removed old, counterproductive intermud update event. + - Added log rotation daemon in /secure/daemon/log.c + - Added a log rotation check every 2 hours. + - Format of timestamp() sefun changed to prevent screwing the + mud when running on Windows and logs rotate. + - Fixed bug in update() sefun. + - Prettified devel mud welcome file and added warning about + submitted code being automatically GPL. + - The title and chfn commands now automatically update finger + info with current data. + - *COMPAT BUSTER* RACES_D re-written (Thanks, Ashon). If you've + added your own races, you'll need to re-add them using the new format. + - /www FAQ material updated. + - Fixed Radagast's training skills, fixed QCS trainer creation. + - Modified telnet room to not permit recursive logins on the + development Dead Souls mud. + - Removed nonexistent boards from boards command. + - Added commands: addraces, removeraces, ascii, resetall, flushobs. + + ---- 2.0r16 --- + - Admin email specified at login now gets sent to config.h. + - New FAQ material added to /www + - If a file exists in /doc/help/races for a specified race, + help <race> will display that file instead of the autogenerated + race body data. + + ---- 2.0r15 --- + - Intermud can be disabled entirely by toggling DISABLE_INTERMUD + in /secure/include/config.h. + - *COMPAT BUSTER* Basic framework for race-based skills in + place. Old races.o files will not work with the new race + data file format expected by RACES_D. + - Fleas and lice examples now unbroken. + - Peer command unbroken. + - Fixed miscellaneous i3 services bugs. + - Tweaked the apostrophe workaround. + - "cd here" now works. + - Added intermud link failure/restoration announcement + to arch room. + - Fixed LIB_READ so that receiving a string for a functional's + return of a GetRead makes that string the text to be read. + - Fixed read bug in /lib/bboard.c. + - Fixed a problem with eval that puked on ASSIST members. + - Fixes and updates made to answering machine. Intermud + tell support added. + - Intermud tells now reach the player if she is invisible. The + tell sender's mud receives an "unknown user" error, and the + player receives an "unknowingly tells you" message. + - Intermud channels can be disabled by toggling + RESTRICTED_INTERMUD in /secure/include/config.h. Exceptions + to this restriction can be made by adding users to + the INTERMUD group using admintool. + - Automatic promotion of new characters to creator status can + be enabled by editing /secure/include/config.h and + toggling AUTO_WIZ. + - Update and runtime errors now attempt to display more helpful + messages to the user, if the user is a creator (Thx, Brodbane). + - Error logs now include timestamps. + - Added trainers to QCS. + - *COMPAT BUSTER*: Trainer skills now have to be specified with + an array, not just a series of strings: + RIGHT: AddTrainingSkills( ({ "alpha", "bravo", "charlie" }) ); + WRONG: AddTrainingSkills( "alpha", "bravo", "charlie" ); + - Fixed error message bug in /lib/trainer.c. + - Fixed chat.c bug that allowed emotes from earmuffed players + to be printed. + - Added languages to say verb. + - Added languages to reading. + - Added commands: language, ping. + - Updated/added various help files. + - Added FAQs (/doc/faq...accessed with the faq command). + - Updated Player's Handbook. + - Miscellaneous header fixes. + - Fixed issues in description.c and look.c that interfered with + having multiple Item elements in objects and having arrays + for keys in Item elements in objects. + - Added IDLE_TIMEOUT to /secure/include/config.h + - Added sefuns: imud_privp, find_inheritors, find_deep_inheritors, + securep. + - Overhauled limb and corpse decay. DECAY_D now handles the + callouts, reducing the number of decaying callouts to 1, regardless + of the number of limbs and corpses lying about. + - Limb ID bug fixed. + - Added tweaks to read verb and faq command submitted by Manchi. + + ---- 2.0r14 --- + - Added barkeeps to QCS. + - Added vendors to QCS. + - Barkeeps now properly handle array keys in menu items. See Lars. + - Updated www directory. + - Abbreviated RELEASE_NOTES: dropped pre-v2 data. + - Added commands: consider, whomuffed. + - Fixed QCS bug that hosed room paths. See "room filenames" notes + in chapter 35 of the Creator's Manual. + - Fixed problem with hobbling 4-legged NPC's. + - Additional docs, helpfiles, updated faqs and expanded QCS chapters. + + ---- 2.0r13 --- + - Numerous minor fixes to commands and lib objects. + - Keepalive daemon implemented to detect when the intermud + connection is down and attempts to restart it. + - Intermud services now supports "auth" packets, somewhat. + - The bk command now also works on objects. + - Added commands: kills, chanban, chanunban, earmuff, unmuff. + - Fixed duplicate handbook bug in encre. + - New cres are no longer forced to quit. + - Fixed parser bug when dealing with identical items in different + containers. + - Added sefuns: query_names, answers_to, add_event, remove_event, + update, local_ctime. + - Fixed events system (see *_event sefuns). + - Non-admins now can't use the dest or trans commands on admins. Note that + if a creator really wants to, she could get around using the commands and + trans or dest you anyway. However, now they can't do it "accidentally". + - The bull shark is no longer drinkable. + - Applied workaround to an apostrophe bug. Full fix pending. + - More sefun documentation. + + ---- 2.0r12 --- + - Fixed function conflict that made "scan -i" fail. + - Tightened up "get" lib code. + - Verbified "zap". + - Added atoi sefun. + - Added LIB_WORN_STORAGE to more gracefully handle wearable containers + like backpacks and such, also added it to QCS. + - QCS: fixed a bug that hosed up armor protection settings. + + ---- 2.0r11 --- + - Added findobs sefun and findobj command. + - Fixed "no steal" item property so thieves can't steal such things. + - Android corpses and severed limbs now decay in their own special way. + - Fixed up the sample flu and cold so they don't permanently affect a + a player's stats. Added a very nasty rage virus. + - Ftpd and httpd now work (Thanks to Duuk @ Haven). To enable them, uncomment + inet in /secure/cfg/preload.cfg. They are UNSUPPORTED, and if they ruin + your life, it's not my problem. System security is on you. + - Added valid_link() to master.c so that link() efun works. An interactive, + privileged, nonforced object is required in the previous_object() stack + to avoid abuse. Do NOT use this functionality unless you know EXACTLY + what you're doing. It probably doesn't work the way you think it does. + Be especially careful not to link privileged files to directories that + unprivileged users have write access to. Windows users should just + forget they read any of this. + - Verbified dest command. Peculiar "desting of nonexistent things" bug + should be dead at long last. + - Golems can have their composition specified. As an example, the combat + dummy is now a wood golem. + - Creatures born without limbs are now able to fight while in their + natural prone position. Creatures who used to have limbs and no longer + do have more limited options. + - SetUnique() now does what common sense requires. + + ---- 2.0r10 --- + - Fixed a problem in the death system that allowed creators to + be undead without quite realizing it. + - Fixed miscellaneous minor gotchas in the sample town. + - Added commands: lightme, quests. + - Tweaked miscellaneous commands. + - Fixed germs, added germ testing lab east of the wiz hall. + + ---- 2.0r9 --- + - Added a <death> channel for kills notices. + - Miscellaneous fixes, tweak, etc. + - Fixed channels bug that changed lognames if someone was listening + to a channel. Now both log. + - Encre now forces the new creator to quit. This is necessary in order + to enable certain characteristics of their new body. + - Fixed a truly vile room bug that leaked objects and memory. + - Added reaper daemon to clean up junk from memory. + - Fixed multiple bugs in lighting system. + - Added light meter to creators' chest. + - Removed roommaker from creators' chest. + - Fixed remaining goto command problem. + - Set EXTRA_TIME_OFFSET in /secure/include/config.h to 0. + - Fixed bug in rescue login. Creators now can use it. + - Reorganized efun man pages and added missing efun and sefun docs. + - Added flying system. + - QCS feature add: you can now add includes and inherits. + - QCS fix: modify <thing> delete <directive> now works properly. + - Added numerous new directives to QCS. + - Added lib object check and NoModify checks to QCS verbs. + - Fixed object manipulation: creatures without prehensile appendages can + no longer accept or manipulate objects. If a creator somehow + manages to lose both hands they can use the "heal" command to fully + restore themselves. + - Fixed a variety of body related issues with races, created a + menagerie of sample npc's for testing. + - Fixed stealing system, added thief class. + - Miscellaneous lib object fixes and additions (eg SetAction now + takes mixed arrays, new SetPermitLoad lfun on npc's, some npc move + messages fixed, etc). + + ---- 2.0r8 --- + - Added intermud announcements to arch room (/secure/room/arch). + - Fixed bug in targeted intermud emotes. + - Channels now log without needing to have a player listening. + - Admin channel now logs to /secure/log + - Fixed lib/std/book.c bug that failed horribly if there was a hidden + file in the text source directory. + - Extensive code cleanup of unused variables. + - Miscellaneous tweaks to sample domain. + - Added tighter restriction to "no teleport" property in rooms. + - Miscellaneous fixes of verb code. + - Modified wrap() sefun to output truncated text rather than just + error out when buffer overflows. + - Added arch command. + - Added EXTRA_TIME_OFFSET parameter to /secure/include/config.h to + accommodate OS'es with peculiar timekeeping. + - Changed local_options to avoid excessive warning messages in /log/errors. + This is only useful if doing a new install of Dead Souls, or + if you copy local_options from the full distribution and recompile + the driver. For the Windows version, all that is needed is to + copy the new driver.exe over the old one, if you're doing an upgrade. + - Rescue login feature added. If when you try to log in, everything + goes to hell, try logging in adding "_rescue" to your name, which + in my case is: cratylus_rescue + - For admins, eval now writes the temp file to /secure, to avoid + annoying /realms dir permission conflicts. + - Cleaned up goto and dest command ugliness. + - Modified reload command and reload() sefun not to perform recursive + updates by default. This should speed up QCS response time and cut + down on mud-wide lag. + - Added some directives to QCS. + + ---- 2.0r7 --- + - Added sample virtual forest to town area. + - Added intermud list of Dead Souls muds to arch room ("read screen"). + - Added mudtime and ticktock commands, and tweaked the time system. + - Updated documentation. + - Added Tim's imc2 client. Doesn't quite work yet. Suggestions welcome. + - Created ds intermud channels ds and ds_test. Enabled ds for cres + by default (i3 names: dead_souls, dead_test4). + - Balanced/fixed attack spells a bit. + - Fixed QCS bug that prevented barkeeps from having stuff added + to their inventories. + - Made it harder to join the mages (The game is too hard for a + first level mage). + - Fixed a bug that made Herkimer a cheat. + - Applied workaround for a bug in Clepius. + + ---- 2.0r6 --- + - Added manuals and such to first admin logon. + - Cleaned up miscellaneous login quirks. + - Got rid of that pesky elog message at startup. + - Updated news files. + + ---- 2.0r5 --- + - Fixed problem with loading a working handbook on first login. + - Fixed QCS bug of reloading files instead of objects. + - Added CREDITS file. + + ---- 2.0r4 --- + - Nailed down nasty bug that overwrote rooms when creating an enter. + - Fixed a bug in "give" code that prevented giving of money. + - Fixed door bug that prevented proper setting of SetLocked and SetClosed. + - Updated some minor documentation unclarities. + - Modified reload() sefun and update command, as well as LastLocation + settings to avoid unnecesary teleportation when reloading objects. + - Modified donate verb and lib object to behave more sanely. + - QCS code cleanup and tightening, also added inits to templates. + - Tightened up sample town code. + - Added Players Handbook + + ---- 2.0r3 --- + - Added workaround for Windows time-of-day problem. + - Fixed minor QCS issues. + + ---- 2.0r2 --- + - Many QCS fixes and updates. + - Added doors and meals to QCS. + - Added thorough QCS documentation: /doc/manual/chapter31 and above. + + ---- 2.0r1 --- + - Fixed peculiar "multiple doors in a room" bug. + diff -c -r --new-file ds1.1/lib/doc/SUPPORT ds2.0r27/lib/doc/SUPPORT *** ds1.1/lib/doc/SUPPORT Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/SUPPORT Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,22 ---- + Documentation and Support for Dead Souls 2 + + + As of this writing, the Dead Souls project has received + permission to include the old Nightmare docs we'd been missing. + + You can now browse through the build documentation in + the /doc directory. These docs are also conveniently packaged in + a "manual" format. You can find the Creator's Manual in the + chest in your workroom, and it contains this documentation. + + For your convenience, a telnet room has been added to your + mud that can help you connect to Frontiers, so that you may ask + for help if you run into trouble. Just enter the telnet room + west and north of the wizard hall, and type: connect + + You may ask questions of creators there, but + don't be offended if they are more interested in building + their mud than helping you with yours. + + - Cratylus @ Frontiers + 18 December 2005 diff -c -r --new-file ds1.1/lib/doc/applies/__INIT ds2.0r27/lib/doc/applies/__INIT *** ds1.1/lib/doc/applies/__INIT Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/__INIT Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,9 ---- + __INIT - obsolete apply + + void __INIT(); + + This function used to be called in objects right before create. + global variable initialization is now handled by another function that + cannot be interfered with, so this is no longer called. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/author_file ds2.0r27/lib/doc/applies/author_file *** ds1.1/lib/doc/applies/author_file Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/author_file Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,19 ---- + author_file - determine the author for a given object + + string author_file (string file); + + This routine is only used if PACKAGE_MUDLIB_STATS is used. + + This function must exist in the master object. It is called by the + author statistic functions in the driver to determine what author a + given object should be associated with. This is totally arbitrary and + up to the mudlib designers wishes. It should be noted that the author + that the object is assigned to will receive "credit" for all of the + objects behavior (errors, heart_beats, etc). + + See also: + author_stats, + domain_stats, + domain_file + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/catch_tell ds2.0r27/lib/doc/applies/catch_tell *** ds1.1/lib/doc/applies/catch_tell Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/catch_tell Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,17 ---- + catch_tell - provides an interface to interact with users + + void catch_tell( string message ); + + If INTERACTIVE_CATCH_TELL is defined in options.h, whenever the driver + has something to tell an object due to say(), shout(), tell_object(), etc. + catch_tell in the player object will be called with the message to + be printed. The message can be displayed, discarded, or modified in + any way desired. This is a useful way to have flexible earmuffs, or + to support intelligent clients. + + See also: + message, + receive, + receive_message + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/clean_up ds2.0r27/lib/doc/applies/clean_up *** ds1.1/lib/doc/applies/clean_up Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/clean_up Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,21 ---- + clean_up - periodically called in inactive objects + + int clean_up( int inherited ); + + The clean_up() function is called by the driver on a regular basis in all + objects that have been inactive for the time specified for clean_up() in the + runtime configuration file. One flag is passed to the function, specifying + whether or not the object has been inheritted by anything. If clean_up() + returns 0, clean_up() will never be called again on that object. If it returns + 1, it will be called again when the object remains inactive for the specified + clean_up() delay. + + One thing that might be commonly done by an object in this function is + destructing itself to conserve memory. However, one often does not want + to destruct objects which have been inherited, as this will cause a new + copy to be loaded next time they are inherited again, causing more than + one copy of the code to be in memory. + + See also: destruct + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/compile_object ds2.0r27/lib/doc/applies/compile_object *** ds1.1/lib/doc/applies/compile_object Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/compile_object Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,18 ---- + compile_object - serves as the mudlib interface for the virtual object facility + + object compile_object( string pathname ); + + The driver calls compile_object in the event that the mudlib instructs + the driver to load a file that does not exist. For example, the driver + will call compile_object("/obj/file.r") in master if the mudlib calls + call_other("/obj/file.r", "some_function") or new("/obj/file.r") + and /obj/file.r.c names a file that does not exist. The compile_object() + function is expected to return 0 if the mudlib does not wish to + associate an object with the file name "/obj/file.r". If the mudlib + does wish to associate an object with the filename "/obj/file.r", then + the mudlib should return the object it wishes associated. After an + association is made between an object and a filename, then it will be + as if the file, file.r.c, did exist (to the driver) and when loaded produced + the object that compile_object() returned. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/connect ds2.0r27/lib/doc/applies/connect *** ds1.1/lib/doc/applies/connect Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/connect Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,17 ---- + connect - get an object for a new user + + object connect(int port); + + The driver calls connect() in the master object whenever a new user logs + into the driver. port is the actual port connected to; for example if + you have two login ports defined as 2000 and 3000, either 2000 or 3000 + will be passed to this routine. + + The object returned by connect() is used as the initial + user object. Note that it is possible to change the user object at a later + time (for example, after determining who is logging in) using the exec() + efun. + + See also: logon, exec + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/crash ds2.0r27/lib/doc/applies/crash *** ds1.1/lib/doc/applies/crash Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/crash Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,16 ---- + crash - function in master that is called in the event the driver crashes + + void crash( string crash_message, object command_giver, object current_object ); + + The driver calls crash() in master in the event that the driver crashes + (segmentation fault, bus error, etc). This function offers a way to + shutdown the mudlib (safe players and other important data) before the driver + crashes. It also lets you log various useful information such as what + signal crashed the driver, what object was active, who the current player + was etc. + + See also: + shutdown, + slow_shutdown + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/create ds2.0r27/lib/doc/applies/create *** ds1.1/lib/doc/applies/create Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/create Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,23 ---- + create - object initialization + + void create(...); + + The arguments passed to the function will be the same as those passed to + new() or clone_object() in addition to the filename, if the object was loaded + using either of those efuns. For example, clone_object(file, 3, "hi") will + cause create(3, "hi") to be called in the object after it is created. + + Every object should have a create function defined within it. Within + that function, all initial object initialization should be done. + create() is called on *all* objects. *NOTE* - This behavior is + different than the stock 3.1.2 LPmud driver. In 3.1.2, if an object + is created first by being inherited, then create() wasn't called on + it. In MudOS, this behavior has changed so that it is *always* called + when an object is created. As a result, you may see some odd behavior + if you have a create in a parent object that does a write, you will + see two writes, as if create() had been called twice on the same + object. In reality, create *is* being called twice, but on two + *different* objects: the parent, and the child that is calling + parent::create() manually. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/creator_file ds2.0r27/lib/doc/applies/creator_file *** ds1.1/lib/doc/applies/creator_file Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/creator_file Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,23 ---- + creator_file - specifies the uid to give to a newly created object + + string creator_file(string filename); + + This routine is only used if PACKAGE_UIDS is used. + + The creator_file() function is called in the master object each time a new + object is created. The `filename' of the object is passed as the sole + parameter, and the string that creator_file() returns is set as the new + object's uid. If the AUTO_SETEUID option is enabled at compile-time of the + driver, it is also set as the new object's euid. + .PP + One exception: if the AUTO_TRUST_BACKBONE option is enabled at compile-time of + the driver, and creator_file() returns the backbone uid (as specified by + get_bb_uid() in the master object), the object is given the uid and euid of + the object that loaded it. + + See also: + seteuid, + clone_object, + new + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/domain_file ds2.0r27/lib/doc/applies/domain_file *** ds1.1/lib/doc/applies/domain_file Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/domain_file Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,17 ---- + domain_file - determine the domain for a given object + + string domain_file( string file ); + + This function must exist in the master object. It is called by the + domain statistic functions in the driver to determine what domain a + given object should be associated with. This is totally arbitrary and + up to the mudlib designers wishes. It should be noted that the domain + that the object is assigned to will receive "credit" for all of the + objects behavior (errors, heart_beats, etc). + + See also: + author_stats, + domain_stats, + author_file + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/epilog ds2.0r27/lib/doc/applies/epilog *** ds1.1/lib/doc/applies/epilog Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/epilog Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,16 ---- + epilog - handle initialization + + string array epilog( int load_empty ); + + The driver calls epilog() in master after the master object has been loaded. + Required initialization may be done at this point. If epilog() returns an + array of filenames, the driver will attempt to load those files via the + preload() function. + + The variable 'load_empty' is non-zero if the -e option was specified + when starting up the driver, which has been historically used to mean + no preloads, although the mudlib is free to use another interpretation. + + See also: preload + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/error_handler ds2.0r27/lib/doc/applies/error_handler *** ds1.1/lib/doc/applies/error_handler Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/error_handler Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,42 ---- + error_handler - function in master object to handle errors + + void error_handler( mapping error, int caught ); + + This function is only called if MUDLIB_ERROR_HANDLER is defined. + + This function allows the mudlib to handle runtime errors. + The contents of the 'error' mapping are: + <pre> + ([ + "error" : string, // the error + "program" : string, // the program + "object" : object, // the current object + "line" : int, // the line number + "trace" : mapping array // a trace back + ]) + </pre> + Each line of traceback is a mapping containing the following: + <pre> + ([ + "function" : string, // the function name + "program" : string, // the program + "object" : object, // the object + "file" : string, // the file to which the line number refers + "line" : int, // the line number + "arguments" : array, // function arguments + "locals" : array // local variables + ]) + </pre> + + arguments and local variables are only available if ARGUMENTS_IN_TRACEBACK + and LOCALS_IN_TRACEBACK are defined. + + The 'caught' flag is 1 if the error was trapped by catch(). + + See also: + catch, + error, + throw, + log_error + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/flag ds2.0r27/lib/doc/applies/flag *** ds1.1/lib/doc/applies/flag Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/flag Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,14 ---- + flag - handle mudlib specific flags specified at driver startup + + void flag( string ); + + This master apply is called for each command line + option passed to the driver with the -f flag. For example, invoking the + driver via: + + ./driver -fdebug + + will call flag("debug") in the master object during initialization. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/applies/get_bb_uid ds2.0r27/lib/doc/applies/get_bb_uid *** ds1.1/lib/doc/applies/get_bb_uid Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/get_bb_uid Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,15 ---- + get_bb_uid - get the backbone uid + + string get_bb_uid(); + + This routine is only used if PACKAGE_UIDS is used. + + This master apply is called by the driver on startup, + after it has loaded the master object, to get the + backbone uid defined by the mud. The function should + return a string, eg "BACKBONE" + + See also: + get_root_uid + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/get_root_uid ds2.0r27/lib/doc/applies/get_root_uid *** ds1.1/lib/doc/applies/get_root_uid Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/get_root_uid Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,13 ---- + get_root_uid - get the root uid + + string get_root_uid(); + + This function is only used if PACKAGE_UIDS is used. + + This master apply is called by the driver each time + it loads the master object, to verify that the master + object has loaded, and to get the root uid defined by + the mud. The function should return a string, eg "ROOT" + + See also: + get_bb_uid diff -c -r --new-file ds1.1/lib/doc/applies/get_save_file_name ds2.0r27/lib/doc/applies/get_save_file_name *** ds1.1/lib/doc/applies/get_save_file_name Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/get_save_file_name Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,13 ---- + get_save_file_name - back up editor file on abnormal exit + + string get_save_file_name( string file, object who ); + + This master apply is called by ed() when a player disconnects + while in the editor and editing a file. This function + should return an alternate file name for the file to + be saved, to avoid overwriting the original. + + Note: This apply used to be named get_ed_buffer_save_file_name(). + + See also: + ed diff -c -r --new-file ds1.1/lib/doc/applies/heart_beat ds2.0r27/lib/doc/applies/heart_beat *** ds1.1/lib/doc/applies/heart_beat Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/heart_beat Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,11 ---- + heart_beat - called periodically in objects in which it is enabled + + void heart_beat(); + + If an object has called set_heart_beat(), this function will be called + periodically in that object. + + See also: + set_heart_beat + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/id ds2.0r27/lib/doc/applies/id *** ds1.1/lib/doc/applies/id Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/id Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,12 ---- + id - function called by present() in order to identify an object + + int id( string an_id ); + + The present() efunction calls id() to determine if a given object is named + by a given string. id() should return 1 if the object wishes to be known + by the name in the string anId; it should return 0 otherwise. + + See also: + present + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/init ds2.0r27/lib/doc/applies/init *** ds1.1/lib/doc/applies/init Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/init Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,28 ---- + init - function in an object called by move_object() to initialize verb/actions + + void init(); + + This function is not called if NO_ADD_ACTIONS is defined. + + When the mudlib moves an object "A" inside another object "B", the + driver (the move_object() efunction) does the following: + + <DL> + * if "A" is living, causes "A" to call the init() in "B" + * causes each living object in the inventory of "B" to call init() in + "A". regardless of whether "A" is living or not. + * if "A" is living, causes "A" to call the init() in each object in + the inventory of "B". + </DL> + + Note: an object is considered to be living if enable_commands() has + been called by that object. + + Typically, the init() function in an object is used to call add_action() + for each command that the object offers. + + See also: + move_object, + enable_commands, + living, + add_action diff -c -r --new-file ds1.1/lib/doc/applies/interactive/catch_tell ds2.0r27/lib/doc/applies/interactive/catch_tell *** ds1.1/lib/doc/applies/interactive/catch_tell Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/interactive/catch_tell Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,17 ---- + catch_tell - provides an interface to interact with users + + void catch_tell( string message ); + + If INTERACTIVE_CATCH_TELL is defined in options.h, whenever the driver + has something to tell an object due to say(), shout(), tell_object(), etc. + catch_tell in the player object will be called with the message to + be printed. The message can be displayed, discarded, or modified in + any way desired. This is a useful way to have flexible earmuffs, or + to support intelligent clients. + + See also: + message, + receive, + receive_message + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/interactive/logon ds2.0r27/lib/doc/applies/interactive/logon *** ds1.1/lib/doc/applies/interactive/logon Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/interactive/logon Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + logon - initialize a logon connection + + object logon(); + + This apply is called on the object returned by the connect() master + apply, after that object has been made into an interactive object, + so the object can initiate any logon sequence which is wanted. This + function is no longer required to exist. this_user() will be the + interactive object. + + See also: connect diff -c -r --new-file ds1.1/lib/doc/applies/interactive/net_dead ds2.0r27/lib/doc/applies/interactive/net_dead *** ds1.1/lib/doc/applies/interactive/net_dead Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/interactive/net_dead Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + net_dead - called by the MudOS driver when an interactive object drops its connection + + void net_dead( void ); + + If an interactive object (i.e. a user object) suddenly loses its + connection (i.e. it goes "net dead"), then the driver calls this + function on that object giving it a chance to clean up, notify its + environment etc. Be aware that functions that depend on the object + being interactive will not work as expected. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/interactive/process_input ds2.0r27/lib/doc/applies/interactive/process_input *** ds1.1/lib/doc/applies/interactive/process_input Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/interactive/process_input Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,19 ---- + process_input - inspect (and possibly modify) user input + + mixed process_input( string ); + + If process_input is present in the player object, then the MudOS driver + will send it a copy of each line the player types. If a string is returned, + that string is used as instead of the user input for further processing. + If a non-zero, non-string is returned, no further processing is done. + If zero is returned, processing continues with the original input. + Matching against add_actions is then done. + + Note: If NO_ADD_ACTION is defined, then there is no more processing to be + done after process_input. In this case, the return value is ignored, and + the mudlib is responsible for interpreting the string as a command (or other + user input for non-command based uses). + + See also: add_action + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/interactive/receive_message ds2.0r27/lib/doc/applies/interactive/receive_message *** ds1.1/lib/doc/applies/interactive/receive_message Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/interactive/receive_message Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,17 ---- + receive_message - provides the interface used by the message efun. + + void receive_message( mixed cl, mixed message ); + + The message() efun calls this method in the player object. The cl + parameter is typically used to indicate the class (say, tell, emote, + combat, room description, etc) of the message. The receive_message() + apply together with the message() efun can provide a good mechanism for + interfacing with a "smart" client. + + See also: + catch_tell, + message, + receive, + receive_snoop + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/interactive/receive_snoop ds2.0r27/lib/doc/applies/interactive/receive_snoop *** ds1.1/lib/doc/applies/interactive/receive_snoop Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/interactive/receive_snoop Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + receive_snoop - catch incoming snoop text + + void receive_snoop(string message); + + If RECEIVE_SNOOP is defined in options.h or local_options, + whenever a user is snooping another + user, all snoop text is sent to receive_snoop() in their user object. Inside + of this function, you can do as you wish with the text. A common activity + would be to receive() it. + + See also: + catch_tell, receive + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/interactive/telnet_suboption ds2.0r27/lib/doc/applies/interactive/telnet_suboption *** ds1.1/lib/doc/applies/interactive/telnet_suboption Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/interactive/telnet_suboption Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,17 ---- + telnet_suboption - process telnet suboptions + + void telnet_suboption( string buf ); + + This apply is called on the interactive object with the parameter given + by the SE telnet suboption, for mudlib defined processing. Note that + terminal type responses and window size responses are interpreted and + sent to terminal_type() and window_size() respectively instead of going + through telnet_suboption(). + + The first byte of the buffer is typically a type descriptor, + ie TELOPT_TTYPE. The next byte is a procession option, such + as TELQUAL_IS. Following this is the type dependent data. + + See also: terminal_type, window_size + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/interactive/terminal_type ds2.0r27/lib/doc/applies/interactive/terminal_type *** ds1.1/lib/doc/applies/interactive/terminal_type Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/interactive/terminal_type Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,10 ---- + terminal_type - inform the mudlib of the user's terminal type + + void terminal_type( string term ); + + This apply is called on the interactive object with term set to the + terminal type for the user, as reported by telnet negotiation. If the + user's client never responds (it's not telnet, for example) this will + never be called. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/interactive/window_size ds2.0r27/lib/doc/applies/interactive/window_size *** ds1.1/lib/doc/applies/interactive/window_size Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/interactive/window_size Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,9 ---- + window_size - report the users window size + + void window_size(int width, int height); + + window_size() is called with the user's window size, as reported by telnet + negotiation. If the user's client never responds to the query, this is + never called. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/interactive/write_prompt ds2.0r27/lib/doc/applies/interactive/write_prompt *** ds1.1/lib/doc/applies/interactive/write_prompt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/interactive/write_prompt Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,9 ---- + write_prompt - called when the parser wants a prompt to be written. + + void write_prompt(); + + If write_prompt is present in the player object, the driver will call it + whenever the default prompt would normally be printed. The driver will + not call write_prompt when the player is in input_to or ed. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/log_error ds2.0r27/lib/doc/applies/log_error *** ds1.1/lib/doc/applies/log_error Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/log_error Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,14 ---- + log_error - log errors intelligently + + void log_error( string file, string message ); + + Whenever an error occurs during compilation, the function log_error in + the master object is called with the filename that the error occurred + in and the error message itself. Then, log_error is free to do + whatever it thinks it should do with that information. Usually this + is deciding based on the filename where the error message should be + logged, and then writing it to that file. Warnings also pass through + this routine, and can be detected since they start with "Warning:" + + See also: + error_handler diff -c -r --new-file ds1.1/lib/doc/applies/logon ds2.0r27/lib/doc/applies/logon *** ds1.1/lib/doc/applies/logon Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/logon Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,11 ---- + logon - initialize a logon connection + + object logon(); + + This apply is called on the object returned by the connect() master + apply, after that object has been made into an interactive object, + so the object can initiate any logon sequence which is wanted. This + function is no longer required to exist. this_user() will be the + interactive object. + + See also: connect diff -c -r --new-file ds1.1/lib/doc/applies/make_path_absolute ds2.0r27/lib/doc/applies/make_path_absolute *** ds1.1/lib/doc/applies/make_path_absolute Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/make_path_absolute Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,10 ---- + make_path_absolute - resolve relative path name + + string make_path_absolute( string rel_path ); + + This master apply is called by the ed() efun to + resolve relative path names of a file to read/write, to an absolute path + name. + + See also: + ed diff -c -r --new-file ds1.1/lib/doc/applies/master/author_file ds2.0r27/lib/doc/applies/master/author_file *** ds1.1/lib/doc/applies/master/author_file Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/author_file Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,19 ---- + author_file - determine the author for a given object + + string author_file (string file); + + This routine is only used if PACKAGE_MUDLIB_STATS is used. + + This function must exist in the master object. It is called by the + author statistic functions in the driver to determine what author a + given object should be associated with. This is totally arbitrary and + up to the mudlib designers wishes. It should be noted that the author + that the object is assigned to will receive "credit" for all of the + objects behavior (errors, heart_beats, etc). + + See also: + author_stats, + domain_stats, + domain_file + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/master/compile_object ds2.0r27/lib/doc/applies/master/compile_object *** ds1.1/lib/doc/applies/master/compile_object Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/compile_object Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,18 ---- + compile_object - serves as the mudlib interface for the virtual object facility + + object compile_object( string pathname ); + + The driver calls compile_object in the event that the mudlib instructs + the driver to load a file that does not exist. For example, the driver + will call compile_object("/obj/file.r") in master if the mudlib calls + call_other("/obj/file.r", "some_function") or new("/obj/file.r") + and /obj/file.r.c names a file that does not exist. The compile_object() + function is expected to return 0 if the mudlib does not wish to + associate an object with the file name "/obj/file.r". If the mudlib + does wish to associate an object with the filename "/obj/file.r", then + the mudlib should return the object it wishes associated. After an + association is made between an object and a filename, then it will be + as if the file, file.r.c, did exist (to the driver) and when loaded produced + the object that compile_object() returned. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/master/connect ds2.0r27/lib/doc/applies/master/connect *** ds1.1/lib/doc/applies/master/connect Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/connect Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,17 ---- + connect - get an object for a new user + + object connect(int port); + + The driver calls connect() in the master object whenever a new user logs + into the driver. port is the actual port connected to; for example if + you have two login ports defined as 2000 and 3000, either 2000 or 3000 + will be passed to this routine. + + The object returned by connect() is used as the initial + user object. Note that it is possible to change the user object at a later + time (for example, after determining who is logging in) using the exec() + efun. + + See also: logon, exec + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/master/crash ds2.0r27/lib/doc/applies/master/crash *** ds1.1/lib/doc/applies/master/crash Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/crash Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + crash - function in master that is called in the event the driver crashes + + void crash( string crash_message, object command_giver, object current_object ); + + The driver calls crash() in master in the event that the driver crashes + (segmentation fault, bus error, etc). This function offers a way to + shutdown the mudlib (safe players and other important data) before the driver + crashes. It also lets you log various useful information such as what + signal crashed the driver, what object was active, who the current player + was etc. + + See also: + shutdown, + slow_shutdown + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/master/creator_file ds2.0r27/lib/doc/applies/master/creator_file *** ds1.1/lib/doc/applies/master/creator_file Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/creator_file Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,23 ---- + creator_file - specifies the uid to give to a newly created object + + string creator_file(string filename); + + This routine is only used if PACKAGE_UIDS is used. + + The creator_file() function is called in the master object each time a new + object is created. The `filename' of the object is passed as the sole + parameter, and the string that creator_file() returns is set as the new + object's uid. If the AUTO_SETEUID option is enabled at compile-time of the + driver, it is also set as the new object's euid. + .PP + One exception: if the AUTO_TRUST_BACKBONE option is enabled at compile-time of + the driver, and creator_file() returns the backbone uid (as specified by + get_bb_uid() in the master object), the object is given the uid and euid of + the object that loaded it. + + See also: + seteuid, + clone_object, + new + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/master/domain_file ds2.0r27/lib/doc/applies/master/domain_file *** ds1.1/lib/doc/applies/master/domain_file Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/domain_file Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,17 ---- + domain_file - determine the domain for a given object + + string domain_file( string file ); + + This function must exist in the master object. It is called by the + domain statistic functions in the driver to determine what domain a + given object should be associated with. This is totally arbitrary and + up to the mudlib designers wishes. It should be noted that the domain + that the object is assigned to will receive "credit" for all of the + objects behavior (errors, heart_beats, etc). + + See also: + author_stats, + domain_stats, + author_file + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/master/epilog ds2.0r27/lib/doc/applies/master/epilog *** ds1.1/lib/doc/applies/master/epilog Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/epilog Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + epilog - handle initialization + + string array epilog( int load_empty ); + + The driver calls epilog() in master after the master object has been loaded. + Required initialization may be done at this point. If epilog() returns an + array of filenames, the driver will attempt to load those files via the + preload() function. + + The variable 'load_empty' is non-zero if the -e option was specified + when starting up the driver, which has been historically used to mean + no preloads, although the mudlib is free to use another interpretation. + + See also: preload + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/master/error_handler ds2.0r27/lib/doc/applies/master/error_handler *** ds1.1/lib/doc/applies/master/error_handler Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/error_handler Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,42 ---- + error_handler - function in master object to handle errors + + void error_handler( mapping error, int caught ); + + This function is only called if MUDLIB_ERROR_HANDLER is defined. + + This function allows the mudlib to handle runtime errors. + The contents of the 'error' mapping are: + <pre> + ([ + "error" : string, // the error + "program" : string, // the program + "object" : object, // the current object + "line" : int, // the line number + "trace" : mapping array // a trace back + ]) + </pre> + Each line of traceback is a mapping containing the following: + <pre> + ([ + "function" : string, // the function name + "program" : string, // the program + "object" : object, // the object + "file" : string, // the file to which the line number refers + "line" : int, // the line number + "arguments" : array, // function arguments + "locals" : array // local variables + ]) + </pre> + + arguments and local variables are only available if ARGUMENTS_IN_TRACEBACK + and LOCALS_IN_TRACEBACK are defined. + + The 'caught' flag is 1 if the error was trapped by catch(). + + See also: + catch, + error, + throw, + log_error + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/master/flag ds2.0r27/lib/doc/applies/master/flag *** ds1.1/lib/doc/applies/master/flag Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/flag Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + flag - handle mudlib specific flags specified at driver startup + + void flag( string ); + + This master apply is called for each command line + option passed to the driver with the -f flag. For example, invoking the + driver via: + + ./driver -fdebug + + will call flag("debug") in the master object during initialization. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/applies/master/get_bb_uid ds2.0r27/lib/doc/applies/master/get_bb_uid *** ds1.1/lib/doc/applies/master/get_bb_uid Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/get_bb_uid Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + get_bb_uid - get the backbone uid + + string get_bb_uid(); + + This routine is only used if PACKAGE_UIDS is used. + + This master apply is called by the driver on startup, + after it has loaded the master object, to get the + backbone uid defined by the mud. The function should + return a string, eg "BACKBONE" + + See also: + get_root_uid + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/master/get_root_uid ds2.0r27/lib/doc/applies/master/get_root_uid *** ds1.1/lib/doc/applies/master/get_root_uid Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/get_root_uid Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + get_root_uid - get the root uid + + string get_root_uid(); + + This function is only used if PACKAGE_UIDS is used. + + This master apply is called by the driver each time + it loads the master object, to verify that the master + object has loaded, and to get the root uid defined by + the mud. The function should return a string, eg "ROOT" + + See also: + get_bb_uid diff -c -r --new-file ds1.1/lib/doc/applies/master/get_save_file_name ds2.0r27/lib/doc/applies/master/get_save_file_name *** ds1.1/lib/doc/applies/master/get_save_file_name Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/get_save_file_name Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + get_save_file_name - back up editor file on abnormal exit + + string get_save_file_name( string file, object who ); + + This master apply is called by ed() when a player disconnects + while in the editor and editing a file. This function + should return an alternate file name for the file to + be saved, to avoid overwriting the original. + + Note: This apply used to be named get_ed_buffer_save_file_name(). + + See also: + ed diff -c -r --new-file ds1.1/lib/doc/applies/master/log_error ds2.0r27/lib/doc/applies/master/log_error *** ds1.1/lib/doc/applies/master/log_error Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/log_error Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + log_error - log errors intelligently + + void log_error( string file, string message ); + + Whenever an error occurs during compilation, the function log_error in + the master object is called with the filename that the error occurred + in and the error message itself. Then, log_error is free to do + whatever it thinks it should do with that information. Usually this + is deciding based on the filename where the error message should be + logged, and then writing it to that file. Warnings also pass through + this routine, and can be detected since they start with "Warning:" + + See also: + error_handler diff -c -r --new-file ds1.1/lib/doc/applies/master/make_path_absolute ds2.0r27/lib/doc/applies/master/make_path_absolute *** ds1.1/lib/doc/applies/master/make_path_absolute Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/make_path_absolute Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,10 ---- + make_path_absolute - resolve relative path name + + string make_path_absolute( string rel_path ); + + This master apply is called by the ed() efun to + resolve relative path names of a file to read/write, to an absolute path + name. + + See also: + ed diff -c -r --new-file ds1.1/lib/doc/applies/master/object_name ds2.0r27/lib/doc/applies/master/object_name *** ds1.1/lib/doc/applies/master/object_name Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/object_name Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + object_name - called by the driver to find out an object's name + + string object_name( object ); + + This master apply is called by the sprintf() efun, when + printing the "value" of an object. This function should + return a string corresponding to the name of the object + (eg a user's name). + + See also: + file_name + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/master/parse_command_all_word ds2.0r27/lib/doc/applies/master/parse_command_all_word *** ds1.1/lib/doc/applies/master/parse_command_all_word Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/parse_command_all_word Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,9 ---- + parse_command_all_word - find out what word refers to everything + + string parse_command_all_word(); + + This routine is called in the master object to find out what word should + be considered to refer to everyting. It is used by the parse_command() efun. + + See also: + parse_command diff -c -r --new-file ds1.1/lib/doc/applies/master/parse_command_prepos_list ds2.0r27/lib/doc/applies/master/parse_command_prepos_list *** ds1.1/lib/doc/applies/master/parse_command_prepos_list Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/parse_command_prepos_list Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,10 ---- + parse_command_prepos_list - find out what words are valid prepositions + + string array parse_command_prepos_list(); + + This routine is called in the master object to find out what words should + be considered prepositions. It is used by the parsing package and the + parse_command() efun. + + See also: + parse_command diff -c -r --new-file ds1.1/lib/doc/applies/master/preload ds2.0r27/lib/doc/applies/master/preload *** ds1.1/lib/doc/applies/master/preload Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/preload Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + preload - preload an object into memory + + void preload( string filename ); + + For each string in the array returned by epilog, the driver calls + preload(filename). Note that there is the equivalent of a catch() around + these calls at the driver level, so it is not neccessary for the mudlib + to worry about the sequence being terminated by an error. + + Typical behavoir is to use load_object() to attempt to load the file. + + See also: preload, , + load_object + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/master/privs_file ds2.0r27/lib/doc/applies/master/privs_file *** ds1.1/lib/doc/applies/master/privs_file Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/privs_file Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + privs_file - specifies the privs string to give to a newly created object + + string privs_file( string filename ); + + The privs_file() function is called in the master object when a new file + is created. The `filename' of the object is passed as the argument, and + the string that privs_file() returns is used as the new object's privs + string. + + The privs_file() functionality is only available if the driver is compiled + with the PRIVS option defined. + + See also: + query_privs + set_privs diff -c -r --new-file ds1.1/lib/doc/applies/master/retrieve_ed_setup ds2.0r27/lib/doc/applies/master/retrieve_ed_setup *** ds1.1/lib/doc/applies/master/retrieve_ed_setup Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/retrieve_ed_setup Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,10 ---- + retrieve_ed_setup - retrieve a user's editor setup or configuration settings + + int retrieve_ed_setup( object user ); + + This master apply is called by the ed() efun to retrieve + a user's ed setup/configuration settings. This function + should return the setup (contained in an int). + + See also: + save_ed_setup diff -c -r --new-file ds1.1/lib/doc/applies/master/save_ed_setup ds2.0r27/lib/doc/applies/master/save_ed_setup *** ds1.1/lib/doc/applies/master/save_ed_setup Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/save_ed_setup Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + save_ed_setup - save a user's editor setup or configuration settings + + int save_ed_setup( object user, int config ); + + This master apply is called by the ed() efun to save + a user's ed setup/configuration settings (contained in + an int). This function should return an int for + success (1 or TRUE)/failure (0 or FALSE). + + Seel also: + retrieve_ed_setup diff -c -r --new-file ds1.1/lib/doc/applies/master/slow_shutdown ds2.0r27/lib/doc/applies/master/slow_shutdown *** ds1.1/lib/doc/applies/master/slow_shutdown Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/slow_shutdown Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,18 ---- + slow_shutdown - informs the mud that a slow shutdown is in progress + + int slow_shutdown( int minutes ); + + This master apply is called when the driver can't + allocate any more memory from the heap and had to + use its reserved memory block. This function can + only be called if the "reserved size" config file + setting was set. The minutes remaining to driver + shutdown is passed to this function. If this function + does ont exist, or returns zero, the driver shuts + down immediately. + + See also: + crash, + shutdown + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/master/valid_bind ds2.0r27/lib/doc/applies/master/valid_bind *** ds1.1/lib/doc/applies/master/valid_bind Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/valid_bind Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + valid_bind - determine if it is legal to bind a given function pointer to an object + + int valid_bind(object doer, object owner, object victim); + + This is called when 'doer' tries to use the bind() efun to bind a function + pointer owned by 'owner' to the object 'victim'. If this routine returns + zero, the operation is disallowed. + + See also: + bind + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/master/valid_compile_to_c ds2.0r27/lib/doc/applies/master/valid_compile_to_c *** ds1.1/lib/doc/applies/master/valid_compile_to_c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/valid_compile_to_c Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + valid_compile_to_c - determine whether LPC->C compilation may take place + + int valid_compile_to_c(); + + valid_compile_to_c() is called when the generate_source() efun is used to + generate C files or to do runtime compilation of an object. One might + want to restrict the use of this since the process can be CPU intensive. + + See also: generate_source + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/master/valid_hide ds2.0r27/lib/doc/applies/master/valid_hide *** ds1.1/lib/doc/applies/master/valid_hide Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/valid_hide Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + valid_hide - allows or disallows objects to hide and see hidden objects + + int valid_hide( object ob ); + + Add valid_hide to master.c in order to allow objects to hide themselves, + or see other objects that have hidden themselves. When an object tries to + use the set_hide() efun to hide itself, valid_hide will be called with the + object that is wanting to hide as the sole parameter. It should return 1 + to allow it, or 0 to not allow it. The same call takes place when it needs + to be determined if a certain object should be able to see hidden objects. + + See also: + set_hide + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/master/valid_link ds2.0r27/lib/doc/applies/master/valid_link *** ds1.1/lib/doc/applies/master/valid_link Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/valid_link Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + valid_link - controls the use of the link efun + + int valid_link( string from, string to ); + + The driver calls valid_link(from, to) in the master object from inside the + link(from, to) efunction. If valid_link() returns 0, then the link() + will fail. If valid_link() returns 1, then the link will succeed if + rename() would succeed if called with the same arguments. + + See also: + link + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/master/valid_object ds2.0r27/lib/doc/applies/master/valid_object *** ds1.1/lib/doc/applies/master/valid_object Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/valid_object Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + valid_object - allows control over which objects can be loaded + + int valid_object( object obj ); + + After loading an object, the driver will call valid_object() with the newly + created object as its argument, in the master object. If the function + exists, and returns 0, then the object will be destructed and the efun that + caused it to load will error out. If it does not exist, or returns 1, then + loading will proceed as normal. This is called before the object has a + chance to execute any code, including create(), so not much should be + assumed about the object except that file_name(obj) is valid. + + See also: + valid_override diff -c -r --new-file ds1.1/lib/doc/applies/master/valid_override ds2.0r27/lib/doc/applies/master/valid_override *** ds1.1/lib/doc/applies/master/valid_override Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/valid_override Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,48 ---- + valid_override - controls the use of efun:: + + int valid_override( string file, string efun_name, string mainfile ); + + File will be the actual file the call appears in; mainfile will be the file + being compiled (the two can differ due to #include) + + Add valid_override to master.c in order to control the use of the efun:: + prefix. The valid_override function in master.c will be called each + time the driver attempts to compile a function call that begins with + efun::. If valid_override returns 0, then that compile will fail. Thus + valid_override provides a way to modify the behavior of efuns that isn't + circumventable via the efun:: prefix (by having a simul_efun of the same + name as the efun to be modified and having valid_override disallow that + simul_efun from being overriden). + + If you wish to have the original 3.1.2 efun:: behavior, simply add + a line to master.c that looks like this: + + <pre> + int valid_override(string file, string efun) { return 1; } + </pre> + + Here is an example valid_override that is more restrictive: + <pre> + int + valid_override(string file, string name) + { + if (file == "/adm/obj/simul_efun") { + return 1; + } + if (name == "destruct") + return 0; + if (name == "shutdown") + return 0; + if (name == "snoop") + return 0; + if (name == "exec") + return 0; + return 1; + } + </pre> + + See also: + valid_object, + function_exists + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/master/valid_read ds2.0r27/lib/doc/applies/master/valid_read *** ds1.1/lib/doc/applies/master/valid_read Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/valid_read Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + valid_read - checks if a certain person has read permission on a file + + int valid_read( string file, object user, string func ); + + Every time an object tries to read a file, the driver calls valid_read + in the master object to check if the read should be allowed. The + arguments are the filename, the object making the read, and + the calling function name. If valid_read returns non-zero, the read is + allowed. + + See also: + valid_write + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/master/valid_save_binary ds2.0r27/lib/doc/applies/master/valid_save_binary *** ds1.1/lib/doc/applies/master/valid_save_binary Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/valid_save_binary Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + valid_save_binary - controls whether or not an object can save its loaded program + + int valid_save_binary( string file ); + + This routine is only used when BINARIES are enabled. + + When the driver is compiled with ALWAYS_SAVE_BINARIES, or an object uses + '#pragma save_binary', valid_save_binary is called with the program's filename. + If valid_save_binary returns 1, then the program will be saved to disk for + faster reloading, otherwise it will not be saved, and the next reload will + recompile as usual. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/master/valid_seteuid ds2.0r27/lib/doc/applies/master/valid_seteuid *** ds1.1/lib/doc/applies/master/valid_seteuid Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/valid_seteuid Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,18 ---- + valid_seteuid - secures the use of seteuid + + int valid_seteuid( object obj, string euid ); + + This routine is only used if PACKAGE_UIDS is defined. + + The driver calls valid_seteuid(ob, euid) in the master object from inside the + seteuid(euid) efunction. If valid_seteuid() returns 0, then the seteuid() + call will fail. If valid_seteuid() returns 1, then the seteuid() will + succeed. + + See also: + seteuid, + geteuid, + getuid, + export_uid + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/master/valid_shadow ds2.0r27/lib/doc/applies/master/valid_shadow *** ds1.1/lib/doc/applies/master/valid_shadow Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/valid_shadow Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + valid_shadow - controls which objects can be shadowed + + int valid_shadow( object ob ); + + When an object attempts to shadow `ob' (with the shadow() efun), valid_shadow + in the master object is called. One object parameter is passed, which is the + object that previous_object() is attempting to shadow. valid_shadow() should + return 0 if the shadow should not be permitted, in which case the shadow() call + will return 0 and fail. If valid_shadow() returns 1, the shadow is allowed. + + See also: + shadow, + query_shadowing + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/master/valid_socket ds2.0r27/lib/doc/applies/master/valid_socket *** ds1.1/lib/doc/applies/master/valid_socket Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/valid_socket Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,17 ---- + valid_socket - protects the socket efunctions + + int valid_socket( object caller, string function, mixed array info ); + + Each of the socket efunctions calls valid_socket() prior to executing. + If valid_socket returns 0, then the socket efunction fails. If + valid_socket returns 1, then the socket efunction attempts to succeed. + The first argument 'caller' is the object that called the socket efunction. + The second argument is the name of the socket efunction that is being + called (e.g. socket_write() or socket_bind()). The third argument is + an array of information. The first element of the array (when applicable) + is file descriptor being referenced. The second element of the array + is the owner of the socket (object). The third element of the array is + the address (string) of the remote end of the socket. The fourth element + of the array is the port number associated with the socket. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/master/valid_write ds2.0r27/lib/doc/applies/master/valid_write *** ds1.1/lib/doc/applies/master/valid_write Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/master/valid_write Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + valid_write - checks if a certain object has write permission on a file + + int valid_write( string file, object ob, string func ); + + Every time an object tries to write a file, the driver calls valid_write + in the master object to check if the write should be allowed. The + arguments are the filename, the object making the write, and + the calling function name (usually the name of the efun being used). + If valid_write returns non-zero, the write is allowed. + + See also: + valid_read + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/move_or_destruct ds2.0r27/lib/doc/applies/move_or_destruct *** ds1.1/lib/doc/applies/move_or_destruct Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/move_or_destruct Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,12 ---- + move_or_destruct - ask an object to move to the specified destination + + int move_or_destruct( object dest ); + + If an object's environment is destructed, this apply is called on it's + contents. 'dest' will be the environment of the destructing object, + or zero if it has none. If the object does not move itself out of + the object being destructed, it will be destructed as well. + + See also: + destruct, + move_object diff -c -r --new-file ds1.1/lib/doc/applies/net_dead ds2.0r27/lib/doc/applies/net_dead *** ds1.1/lib/doc/applies/net_dead Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/net_dead Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,11 ---- + net_dead - called by the MudOS driver when an interactive object drops its connection + + void net_dead( void ); + + If an interactive object (i.e. a user object) suddenly loses its + connection (i.e. it goes "net dead"), then the driver calls this + function on that object giving it a chance to clean up, notify its + environment etc. Be aware that functions that depend on the object + being interactive will not work as expected. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/object_name ds2.0r27/lib/doc/applies/object_name *** ds1.1/lib/doc/applies/object_name Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/object_name Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,13 ---- + object_name - called by the driver to find out an object's name + + string object_name( object ); + + This master apply is called by the sprintf() efun, when + printing the "value" of an object. This function should + return a string corresponding to the name of the object + (eg a user's name). + + See also: + file_name + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/parse_command ds2.0r27/lib/doc/applies/parse_command *** ds1.1/lib/doc/applies/parse_command Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/parse_command Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,213 ---- + + parse_command(3) LPC Library Functions parse_command(3) + + NNAAMMEE + parse_command() - try to match a string with a given pat- + tern + + SSYYNNOOPPSSIISS + int parse_command( string command, object env|object *oblist, + string pattern, mixed arg, ... ); + + DDEESSCCRRIIPPTTIIOONN + parse_command() is a piffed up sscanf(3) operating on word + basis. It works similar to sscanf(3) in that it takes a + pattern and a variable set of destination arguments. It is + together with sscanf(3) the only efun to use pass by ref- + erence for other variables than arrays. That is, + parse_command() returns values in its arguments. + + parse_command() returns 1 if 'command' is considered to + have matched + + The 'env' or 'oblist' parameter either holds an object or + a list of objects. If it holds a single object than a list + of objects are automatically created by adding the + deep_inventory of the object, ie this is identical: + + parse_command(cmd, environment(), pattern, arg) + + and + + parse_command( cmd, ({ environment() }) + + deep_inventory(environment()), pattern, arg) + + Example string = " 'get' / 'take' %i " + Syntax: + 'word' obligatory text + [word] optional text + / Alternative marker + %o Single item, object + %l Living objects + %s Any text + %w Any word + %p One of a list (prepositions) + %i Any items + %d Number 0- or tx(0-99) + + The 'arg' list is zero or more arguments. These are the + result variables as in sscanf. Note that one variable is + needed for each %_ + + The return types of different %_ is: + %o Returns an object + %s Returns a string of words + + MudOS 5 Sep 1994 1 + + parse_command(3) LPC Library Functions parse_command(3) + + %w Returns a string of one word + %p Can on entry hold a list of word in array + or an empty variable + Returns: + if empty variable: a string + if array: array[0] = matched word + %i Returns a special array on the form: + [0] = (int) +(wanted) -(order) 0(all) + [1..n] (object) Objectpointers + %l Returns a special array on the form: + [0] = (int) +(wanted) -(order) 0(all) + [1..n] (object) Objectpointers + These are only living objects. + %d Returns a number + + The only types of % that uses all the loaded information + from the objects are %i and %l. These are in fact identi- + cal except that %l filters out all nonliving objects from + the list of objects before trying to parse. + + The return values of %i and %l is also the most complex. + They return an array consisting of first a number and then + all possible objects matching. As the typical string + matched by %i/%l looks like: 'three red roses', of these + numerical constructs was matched: + + if numeral >0 then three, four, five etc were matched + if numeral <0 then second, twentyfirst etc were matched + if numeral==0 then 'all' or a generic plural form such as + 'apples' were matched. + + NOTE! + + The efun makes no semantic implication on the + given numeral. It does + not matter if 'all apples' or 'second apple' is + given. A %i will + return ALL possible objects matching in the + array. It is up to the + caller to decide what 'second' means in a given + context. + Also when given an object and not an explicit + array of objects the + entire recursive inventory of the given object is + searched. It is up + to the caller to decide which of the objects are + actually visible + meaning that 'second' might not at all mean the + second object in + the returned array of objects. + + CCAAVVEEAATT + Patterns of type: "%s %w %i" Might not work as one would + + MudOS 5 Sep 1994 2 + + parse_command(3) LPC Library Functions parse_command(3) + + expect. %w will always succeed so the arg corresponding + to %s will always be empty. + + BBUUGGSS + Patterns of the type: 'word' and [word] The 'word' can not + contain spaces. It must be a single word. This is so + because the pattern is exploded on " " (space) and a pat- + tern element can therefore not contain spaces. + + As another effect of the exploding on space, separate + pieces of a pattern MUST be separated with space, ie not " + 'word'/%i " but " 'word' / %i" + + EXAMPLE: + if (parse_command("spray car",environment(this_player()), + " 'spray' / 'paint' [paint] %i ",items)) + { + /* + If the pattern matched then items holds a return array as + described under 'destargs' %i above. + */ + } + + MUDLIB SUPPORT + + To make the efun useful it must have a certain support + from the mudlib, there is a set of functions that it needs + to call to get relevant information before it can parse in + a sensible manner. + + In earlier versions it used the normal id() lfun in the + LPC objects to find out if a given object was identified + by a certain string. This was highly inefficient as it + could result in hundreds or maybe thousands of calls when + very long commands were parsed. + + The new version relies on the LPC objects to give it three + lists of 'names'. + + 1 - The normal singular names. + 2 - The plural forms of the names. + 3 - The acknowledged adjectives of the object. + + These are fetched by calls to the functions: + + 1 - string *parse_command_id_list(); + 2 - string *parse_command_plural_id_list(); + 3 - string *parse_command_adjectiv_id_list(); + + The only really needed list is the first. If the second + does not exist than the efun will try to create one from + the singluar list. For grammatical reasons it does not + always succeed in a perfect way. This is especially true + + MudOS 5 Sep 1994 3 + + parse_command(3) LPC Library Functions parse_command(3) + + when the 'names' are not single words but phrases. + + The third is very nice to have because it makes constructs + like + + Apart from these functions that should exist in all + objects, and which are therefore best put in the base + mudlib object there is also a set of functions needed in + the master object. These are not absolutely necessary but + they give extra power to the efun. + + Basically these master object lfuns are there to give + default values for the lists of names fetched from each + object. + + The names in these lists are applicable to any and all + objects, the first three are identical to the lfuns in the + objects: + + string *parse_command_id_list() + - Would normally return: ({ "one", "thing" }) + + string *parse_command_plural_id_list() + - Would normally return: ({ "ones", "things", "them" }) + + string *parse_command_adjectiv_id_list() + - Would normally return ({ "iffish" }) + + The last two are the default list of the prepositions and + a single so called + string *parse_command_prepos_list() + - Would normally return: ({ "in", "on", "under" }) + + string parse_command_all_word() + - Would normally return: "all" + + MudOS 5 Sep 1994 4 + diff -c -r --new-file ds1.1/lib/doc/applies/parse_command_adjectiv_id_list ds2.0r27/lib/doc/applies/parse_command_adjectiv_id_list *** ds1.1/lib/doc/applies/parse_command_adjectiv_id_list Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/parse_command_adjectiv_id_list Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,10 ---- + parse_command_adjectiv_id_list - returns a list of names to the parser + + string array parse_command_adjectiv_id_list(); [sic] + + This routine is used to find out what adjectives the object responds to, and is + used by the parsing package and the parse_command() efun. In addition, + anything returned by the master object will work on ANY object. + + See also: + parse_command diff -c -r --new-file ds1.1/lib/doc/applies/parse_command_all_word ds2.0r27/lib/doc/applies/parse_command_all_word *** ds1.1/lib/doc/applies/parse_command_all_word Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/parse_command_all_word Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,9 ---- + parse_command_all_word - find out what word refers to everything + + string parse_command_all_word(); + + This routine is called in the master object to find out what word should + be considered to refer to everyting. It is used by the parse_command() efun. + + See also: + parse_command diff -c -r --new-file ds1.1/lib/doc/applies/parse_command_id_list ds2.0r27/lib/doc/applies/parse_command_id_list *** ds1.1/lib/doc/applies/parse_command_id_list Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/parse_command_id_list Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,10 ---- + parse_command_id_list - returns a list of names to the parser + + string array parse_command_id_list(); + + This routine is used to find out what nouns the object responds to, and is + used by the parsing package and the parse_command() efun. In addition, + anything returned by the master object will work on ANY object. + + See also: + parse_command diff -c -r --new-file ds1.1/lib/doc/applies/parse_command_plural_id_list ds2.0r27/lib/doc/applies/parse_command_plural_id_list *** ds1.1/lib/doc/applies/parse_command_plural_id_list Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/parse_command_plural_id_list Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,10 ---- + parse_command_plural_id_list - returns a list of names to the parser + + string array parse_command_plural_id_list(); + + This routine is used to find out what plural nouns the object responds to, + and is used by the parsing package and the parse_command() efun. In addition, + anything returned by the master object will work on ANY object. + + See also: + parse_command diff -c -r --new-file ds1.1/lib/doc/applies/parse_command_prepos_list ds2.0r27/lib/doc/applies/parse_command_prepos_list *** ds1.1/lib/doc/applies/parse_command_prepos_list Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/parse_command_prepos_list Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,10 ---- + parse_command_prepos_list - find out what words are valid prepositions + + string array parse_command_prepos_list(); + + This routine is called in the master object to find out what words should + be considered prepositions. It is used by the parsing package and the + parse_command() efun. + + See also: + parse_command diff -c -r --new-file ds1.1/lib/doc/applies/parsing/parse_command ds2.0r27/lib/doc/applies/parsing/parse_command *** ds1.1/lib/doc/applies/parsing/parse_command Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/parsing/parse_command Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,213 ---- + + parse_command(3) LPC Library Functions parse_command(3) + + NNAAMMEE + parse_command() - try to match a string with a given pat- + tern + + SSYYNNOOPPSSIISS + int parse_command( string command, object env|object *oblist, + string pattern, mixed arg, ... ); + + DDEESSCCRRIIPPTTIIOONN + parse_command() is a piffed up sscanf(3) operating on word + basis. It works similar to sscanf(3) in that it takes a + pattern and a variable set of destination arguments. It is + together with sscanf(3) the only efun to use pass by ref- + erence for other variables than arrays. That is, + parse_command() returns values in its arguments. + + parse_command() returns 1 if 'command' is considered to + have matched + + The 'env' or 'oblist' parameter either holds an object or + a list of objects. If it holds a single object than a list + of objects are automatically created by adding the + deep_inventory of the object, ie this is identical: + + parse_command(cmd, environment(), pattern, arg) + + and + + parse_command( cmd, ({ environment() }) + + deep_inventory(environment()), pattern, arg) + + Example string = " 'get' / 'take' %i " + Syntax: + 'word' obligatory text + [word] optional text + / Alternative marker + %o Single item, object + %l Living objects + %s Any text + %w Any word + %p One of a list (prepositions) + %i Any items + %d Number 0- or tx(0-99) + + The 'arg' list is zero or more arguments. These are the + result variables as in sscanf. Note that one variable is + needed for each %_ + + The return types of different %_ is: + %o Returns an object + %s Returns a string of words + + MudOS 5 Sep 1994 1 + + parse_command(3) LPC Library Functions parse_command(3) + + %w Returns a string of one word + %p Can on entry hold a list of word in array + or an empty variable + Returns: + if empty variable: a string + if array: array[0] = matched word + %i Returns a special array on the form: + [0] = (int) +(wanted) -(order) 0(all) + [1..n] (object) Objectpointers + %l Returns a special array on the form: + [0] = (int) +(wanted) -(order) 0(all) + [1..n] (object) Objectpointers + These are only living objects. + %d Returns a number + + The only types of % that uses all the loaded information + from the objects are %i and %l. These are in fact identi- + cal except that %l filters out all nonliving objects from + the list of objects before trying to parse. + + The return values of %i and %l is also the most complex. + They return an array consisting of first a number and then + all possible objects matching. As the typical string + matched by %i/%l looks like: 'three red roses', of these + numerical constructs was matched: + + if numeral >0 then three, four, five etc were matched + if numeral <0 then second, twentyfirst etc were matched + if numeral==0 then 'all' or a generic plural form such as + 'apples' were matched. + + NOTE! + + The efun makes no semantic implication on the + given numeral. It does + not matter if 'all apples' or 'second apple' is + given. A %i will + return ALL possible objects matching in the + array. It is up to the + caller to decide what 'second' means in a given + context. + Also when given an object and not an explicit + array of objects the + entire recursive inventory of the given object is + searched. It is up + to the caller to decide which of the objects are + actually visible + meaning that 'second' might not at all mean the + second object in + the returned array of objects. + + CCAAVVEEAATT + Patterns of type: "%s %w %i" Might not work as one would + + MudOS 5 Sep 1994 2 + + parse_command(3) LPC Library Functions parse_command(3) + + expect. %w will always succeed so the arg corresponding + to %s will always be empty. + + BBUUGGSS + Patterns of the type: 'word' and [word] The 'word' can not + contain spaces. It must be a single word. This is so + because the pattern is exploded on " " (space) and a pat- + tern element can therefore not contain spaces. + + As another effect of the exploding on space, separate + pieces of a pattern MUST be separated with space, ie not " + 'word'/%i " but " 'word' / %i" + + EXAMPLE: + if (parse_command("spray car",environment(this_player()), + " 'spray' / 'paint' [paint] %i ",items)) + { + /* + If the pattern matched then items holds a return array as + described under 'destargs' %i above. + */ + } + + MUDLIB SUPPORT + + To make the efun useful it must have a certain support + from the mudlib, there is a set of functions that it needs + to call to get relevant information before it can parse in + a sensible manner. + + In earlier versions it used the normal id() lfun in the + LPC objects to find out if a given object was identified + by a certain string. This was highly inefficient as it + could result in hundreds or maybe thousands of calls when + very long commands were parsed. + + The new version relies on the LPC objects to give it three + lists of 'names'. + + 1 - The normal singular names. + 2 - The plural forms of the names. + 3 - The acknowledged adjectives of the object. + + These are fetched by calls to the functions: + + 1 - string *parse_command_id_list(); + 2 - string *parse_command_plural_id_list(); + 3 - string *parse_command_adjectiv_id_list(); + + The only really needed list is the first. If the second + does not exist than the efun will try to create one from + the singluar list. For grammatical reasons it does not + always succeed in a perfect way. This is especially true + + MudOS 5 Sep 1994 3 + + parse_command(3) LPC Library Functions parse_command(3) + + when the 'names' are not single words but phrases. + + The third is very nice to have because it makes constructs + like + + Apart from these functions that should exist in all + objects, and which are therefore best put in the base + mudlib object there is also a set of functions needed in + the master object. These are not absolutely necessary but + they give extra power to the efun. + + Basically these master object lfuns are there to give + default values for the lists of names fetched from each + object. + + The names in these lists are applicable to any and all + objects, the first three are identical to the lfuns in the + objects: + + string *parse_command_id_list() + - Would normally return: ({ "one", "thing" }) + + string *parse_command_plural_id_list() + - Would normally return: ({ "ones", "things", "them" }) + + string *parse_command_adjectiv_id_list() + - Would normally return ({ "iffish" }) + + The last two are the default list of the prepositions and + a single so called + string *parse_command_prepos_list() + - Would normally return: ({ "in", "on", "under" }) + + string parse_command_all_word() + - Would normally return: "all" + + MudOS 5 Sep 1994 4 + diff -c -r --new-file ds1.1/lib/doc/applies/parsing/parse_command_adjectiv_id_list ds2.0r27/lib/doc/applies/parsing/parse_command_adjectiv_id_list *** ds1.1/lib/doc/applies/parsing/parse_command_adjectiv_id_list Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/parsing/parse_command_adjectiv_id_list Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,10 ---- + parse_command_adjectiv_id_list - returns a list of names to the parser + + string array parse_command_adjectiv_id_list(); [sic] + + This routine is used to find out what adjectives the object responds to, and is + used by the parsing package and the parse_command() efun. In addition, + anything returned by the master object will work on ANY object. + + See also: + parse_command diff -c -r --new-file ds1.1/lib/doc/applies/parsing/parse_command_id_list ds2.0r27/lib/doc/applies/parsing/parse_command_id_list *** ds1.1/lib/doc/applies/parsing/parse_command_id_list Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/parsing/parse_command_id_list Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,10 ---- + parse_command_id_list - returns a list of names to the parser + + string array parse_command_id_list(); + + This routine is used to find out what nouns the object responds to, and is + used by the parsing package and the parse_command() efun. In addition, + anything returned by the master object will work on ANY object. + + See also: + parse_command diff -c -r --new-file ds1.1/lib/doc/applies/parsing/parse_command_plural_id_list ds2.0r27/lib/doc/applies/parsing/parse_command_plural_id_list *** ds1.1/lib/doc/applies/parsing/parse_command_plural_id_list Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/parsing/parse_command_plural_id_list Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,10 ---- + parse_command_plural_id_list - returns a list of names to the parser + + string array parse_command_plural_id_list(); + + This routine is used to find out what plural nouns the object responds to, + and is used by the parsing package and the parse_command() efun. In addition, + anything returned by the master object will work on ANY object. + + See also: + parse_command diff -c -r --new-file ds1.1/lib/doc/applies/preload ds2.0r27/lib/doc/applies/preload *** ds1.1/lib/doc/applies/preload Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/preload Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,15 ---- + preload - preload an object into memory + + void preload( string filename ); + + For each string in the array returned by epilog, the driver calls + preload(filename). Note that there is the equivalent of a catch() around + these calls at the driver level, so it is not neccessary for the mudlib + to worry about the sequence being terminated by an error. + + Typical behavoir is to use load_object() to attempt to load the file. + + See also: preload, , + load_object + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/privs_file ds2.0r27/lib/doc/applies/privs_file *** ds1.1/lib/doc/applies/privs_file Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/privs_file Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,15 ---- + privs_file - specifies the privs string to give to a newly created object + + string privs_file( string filename ); + + The privs_file() function is called in the master object when a new file + is created. The `filename' of the object is passed as the argument, and + the string that privs_file() returns is used as the new object's privs + string. + + The privs_file() functionality is only available if the driver is compiled + with the PRIVS option defined. + + See also: + query_privs + set_privs diff -c -r --new-file ds1.1/lib/doc/applies/process_input ds2.0r27/lib/doc/applies/process_input *** ds1.1/lib/doc/applies/process_input Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/process_input Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,19 ---- + process_input - inspect (and possibly modify) user input + + mixed process_input( string ); + + If process_input is present in the player object, then the MudOS driver + will send it a copy of each line the player types. If a string is returned, + that string is used as instead of the user input for further processing. + If a non-zero, non-string is returned, no further processing is done. + If zero is returned, processing continues with the original input. + Matching against add_actions is then done. + + Note: If NO_ADD_ACTION is defined, then there is no more processing to be + done after process_input. In this case, the return value is ignored, and + the mudlib is responsible for interpreting the string as a command (or other + user input for non-command based uses). + + See also: add_action + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/receive_message ds2.0r27/lib/doc/applies/receive_message *** ds1.1/lib/doc/applies/receive_message Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/receive_message Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,17 ---- + receive_message - provides the interface used by the message efun. + + void receive_message( mixed cl, mixed message ); + + The message() efun calls this method in the player object. The cl + parameter is typically used to indicate the class (say, tell, emote, + combat, room description, etc) of the message. The receive_message() + apply together with the message() efun can provide a good mechanism for + interfacing with a "smart" client. + + See also: + catch_tell, + message, + receive, + receive_snoop + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/receive_snoop ds2.0r27/lib/doc/applies/receive_snoop *** ds1.1/lib/doc/applies/receive_snoop Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/receive_snoop Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,14 ---- + receive_snoop - catch incoming snoop text + + void receive_snoop(string message); + + If RECEIVE_SNOOP is defined in options.h or local_options, + whenever a user is snooping another + user, all snoop text is sent to receive_snoop() in their user object. Inside + of this function, you can do as you wish with the text. A common activity + would be to receive() it. + + See also: + catch_tell, receive + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/reset ds2.0r27/lib/doc/applies/reset *** ds1.1/lib/doc/applies/reset Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/reset Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,13 ---- + reset - allows an object to do self-maintenance + + void reset(); + + After every reset interval (whose exact length is determined on + a mud by mud basis, but averages around every 2 hours), reset() + is called in every object that currently exists. If LAZY_RESETS + is defined in options.h in the driver, reset() will only be called + in objects when they are touched (near players), so unused objects + will not be loaded from the swap file to reset. + + See also: + set_reset diff -c -r --new-file ds1.1/lib/doc/applies/retrieve_ed_setup ds2.0r27/lib/doc/applies/retrieve_ed_setup *** ds1.1/lib/doc/applies/retrieve_ed_setup Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/retrieve_ed_setup Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,10 ---- + retrieve_ed_setup - retrieve a user's editor setup or configuration settings + + int retrieve_ed_setup( object user ); + + This master apply is called by the ed() efun to retrieve + a user's ed setup/configuration settings. This function + should return the setup (contained in an int). + + See also: + save_ed_setup diff -c -r --new-file ds1.1/lib/doc/applies/save_ed_setup ds2.0r27/lib/doc/applies/save_ed_setup *** ds1.1/lib/doc/applies/save_ed_setup Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/save_ed_setup Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,11 ---- + save_ed_setup - save a user's editor setup or configuration settings + + int save_ed_setup( object user, int config ); + + This master apply is called by the ed() efun to save + a user's ed setup/configuration settings (contained in + an int). This function should return an int for + success (1 or TRUE)/failure (0 or FALSE). + + Seel also: + retrieve_ed_setup diff -c -r --new-file ds1.1/lib/doc/applies/slow_shutdown ds2.0r27/lib/doc/applies/slow_shutdown *** ds1.1/lib/doc/applies/slow_shutdown Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/slow_shutdown Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,18 ---- + slow_shutdown - informs the mud that a slow shutdown is in progress + + int slow_shutdown( int minutes ); + + This master apply is called when the driver can't + allocate any more memory from the heap and had to + use its reserved memory block. This function can + only be called if the "reserved size" config file + setting was set. The minutes remaining to driver + shutdown is passed to this function. If this function + does ont exist, or returns zero, the driver shuts + down immediately. + + See also: + crash, + shutdown + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/telnet_suboption ds2.0r27/lib/doc/applies/telnet_suboption *** ds1.1/lib/doc/applies/telnet_suboption Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/telnet_suboption Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,17 ---- + telnet_suboption - process telnet suboptions + + void telnet_suboption( string buf ); + + This apply is called on the interactive object with the parameter given + by the SE telnet suboption, for mudlib defined processing. Note that + terminal type responses and window size responses are interpreted and + sent to terminal_type() and window_size() respectively instead of going + through telnet_suboption(). + + The first byte of the buffer is typically a type descriptor, + ie TELOPT_TTYPE. The next byte is a procession option, such + as TELQUAL_IS. Following this is the type dependent data. + + See also: terminal_type, window_size + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/terminal_type ds2.0r27/lib/doc/applies/terminal_type *** ds1.1/lib/doc/applies/terminal_type Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/terminal_type Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,10 ---- + terminal_type - inform the mudlib of the user's terminal type + + void terminal_type( string term ); + + This apply is called on the interactive object with term set to the + terminal type for the user, as reported by telnet negotiation. If the + user's client never responds (it's not telnet, for example) this will + never be called. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/valid_bind ds2.0r27/lib/doc/applies/valid_bind *** ds1.1/lib/doc/applies/valid_bind Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/valid_bind Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,12 ---- + valid_bind - determine if it is legal to bind a given function pointer to an object + + int valid_bind(object doer, object owner, object victim); + + This is called when 'doer' tries to use the bind() efun to bind a function + pointer owned by 'owner' to the object 'victim'. If this routine returns + zero, the operation is disallowed. + + See also: + bind + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/valid_compile_to_c ds2.0r27/lib/doc/applies/valid_compile_to_c *** ds1.1/lib/doc/applies/valid_compile_to_c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/valid_compile_to_c Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,11 ---- + valid_compile_to_c - determine whether LPC->C compilation may take place + + int valid_compile_to_c(); + + valid_compile_to_c() is called when the generate_source() efun is used to + generate C files or to do runtime compilation of an object. One might + want to restrict the use of this since the process can be CPU intensive. + + See also: generate_source + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/valid_hide ds2.0r27/lib/doc/applies/valid_hide *** ds1.1/lib/doc/applies/valid_hide Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/valid_hide Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,15 ---- + valid_hide - allows or disallows objects to hide and see hidden objects + + int valid_hide( object ob ); + + Add valid_hide to master.c in order to allow objects to hide themselves, + or see other objects that have hidden themselves. When an object tries to + use the set_hide() efun to hide itself, valid_hide will be called with the + object that is wanting to hide as the sole parameter. It should return 1 + to allow it, or 0 to not allow it. The same call takes place when it needs + to be determined if a certain object should be able to see hidden objects. + + See also: + set_hide + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/valid_link ds2.0r27/lib/doc/applies/valid_link *** ds1.1/lib/doc/applies/valid_link Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/valid_link Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,13 ---- + valid_link - controls the use of the link efun + + int valid_link( string from, string to ); + + The driver calls valid_link(from, to) in the master object from inside the + link(from, to) efunction. If valid_link() returns 0, then the link() + will fail. If valid_link() returns 1, then the link will succeed if + rename() would succeed if called with the same arguments. + + See also: + link + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/valid_object ds2.0r27/lib/doc/applies/valid_object *** ds1.1/lib/doc/applies/valid_object Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/valid_object Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,14 ---- + valid_object - allows control over which objects can be loaded + + int valid_object( object obj ); + + After loading an object, the driver will call valid_object() with the newly + created object as its argument, in the master object. If the function + exists, and returns 0, then the object will be destructed and the efun that + caused it to load will error out. If it does not exist, or returns 1, then + loading will proceed as normal. This is called before the object has a + chance to execute any code, including create(), so not much should be + assumed about the object except that file_name(obj) is valid. + + See also: + valid_override diff -c -r --new-file ds1.1/lib/doc/applies/valid_override ds2.0r27/lib/doc/applies/valid_override *** ds1.1/lib/doc/applies/valid_override Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/valid_override Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,48 ---- + valid_override - controls the use of efun:: + + int valid_override( string file, string efun_name, string mainfile ); + + File will be the actual file the call appears in; mainfile will be the file + being compiled (the two can differ due to #include) + + Add valid_override to master.c in order to control the use of the efun:: + prefix. The valid_override function in master.c will be called each + time the driver attempts to compile a function call that begins with + efun::. If valid_override returns 0, then that compile will fail. Thus + valid_override provides a way to modify the behavior of efuns that isn't + circumventable via the efun:: prefix (by having a simul_efun of the same + name as the efun to be modified and having valid_override disallow that + simul_efun from being overriden). + + If you wish to have the original 3.1.2 efun:: behavior, simply add + a line to master.c that looks like this: + + <pre> + int valid_override(string file, string efun) { return 1; } + </pre> + + Here is an example valid_override that is more restrictive: + <pre> + int + valid_override(string file, string name) + { + if (file == "/adm/obj/simul_efun") { + return 1; + } + if (name == "destruct") + return 0; + if (name == "shutdown") + return 0; + if (name == "snoop") + return 0; + if (name == "exec") + return 0; + return 1; + } + </pre> + + See also: + valid_object, + function_exists + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/valid_read ds2.0r27/lib/doc/applies/valid_read *** ds1.1/lib/doc/applies/valid_read Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/valid_read Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,14 ---- + valid_read - checks if a certain person has read permission on a file + + int valid_read( string file, object user, string func ); + + Every time an object tries to read a file, the driver calls valid_read + in the master object to check if the read should be allowed. The + arguments are the filename, the object making the read, and + the calling function name. If valid_read returns non-zero, the read is + allowed. + + See also: + valid_write + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/valid_save_binary ds2.0r27/lib/doc/applies/valid_save_binary *** ds1.1/lib/doc/applies/valid_save_binary Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/valid_save_binary Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,13 ---- + valid_save_binary - controls whether or not an object can save its loaded program + + int valid_save_binary( string file ); + + This routine is only used when BINARIES are enabled. + + When the driver is compiled with ALWAYS_SAVE_BINARIES, or an object uses + '#pragma save_binary', valid_save_binary is called with the program's filename. + If valid_save_binary returns 1, then the program will be saved to disk for + faster reloading, otherwise it will not be saved, and the next reload will + recompile as usual. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/valid_seteuid ds2.0r27/lib/doc/applies/valid_seteuid *** ds1.1/lib/doc/applies/valid_seteuid Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/valid_seteuid Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,18 ---- + valid_seteuid - secures the use of seteuid + + int valid_seteuid( object obj, string euid ); + + This routine is only used if PACKAGE_UIDS is defined. + + The driver calls valid_seteuid(ob, euid) in the master object from inside the + seteuid(euid) efunction. If valid_seteuid() returns 0, then the seteuid() + call will fail. If valid_seteuid() returns 1, then the seteuid() will + succeed. + + See also: + seteuid, + geteuid, + getuid, + export_uid + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/valid_shadow ds2.0r27/lib/doc/applies/valid_shadow *** ds1.1/lib/doc/applies/valid_shadow Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/valid_shadow Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,15 ---- + valid_shadow - controls which objects can be shadowed + + int valid_shadow( object ob ); + + When an object attempts to shadow `ob' (with the shadow() efun), valid_shadow + in the master object is called. One object parameter is passed, which is the + object that previous_object() is attempting to shadow. valid_shadow() should + return 0 if the shadow should not be permitted, in which case the shadow() call + will return 0 and fail. If valid_shadow() returns 1, the shadow is allowed. + + See also: + shadow, + query_shadowing + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/valid_socket ds2.0r27/lib/doc/applies/valid_socket *** ds1.1/lib/doc/applies/valid_socket Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/valid_socket Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,17 ---- + valid_socket - protects the socket efunctions + + int valid_socket( object caller, string function, mixed array info ); + + Each of the socket efunctions calls valid_socket() prior to executing. + If valid_socket returns 0, then the socket efunction fails. If + valid_socket returns 1, then the socket efunction attempts to succeed. + The first argument 'caller' is the object that called the socket efunction. + The second argument is the name of the socket efunction that is being + called (e.g. socket_write() or socket_bind()). The third argument is + an array of information. The first element of the array (when applicable) + is file descriptor being referenced. The second element of the array + is the owner of the socket (object). The third element of the array is + the address (string) of the remote end of the socket. The fourth element + of the array is the port number associated with the socket. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/valid_write ds2.0r27/lib/doc/applies/valid_write *** ds1.1/lib/doc/applies/valid_write Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/valid_write Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,14 ---- + valid_write - checks if a certain object has write permission on a file + + int valid_write( string file, object ob, string func ); + + Every time an object tries to write a file, the driver calls valid_write + in the master object to check if the write should be allowed. The + arguments are the filename, the object making the write, and + the calling function name (usually the name of the efun being used). + If valid_write returns non-zero, the write is allowed. + + See also: + valid_read + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/window_size ds2.0r27/lib/doc/applies/window_size *** ds1.1/lib/doc/applies/window_size Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/window_size Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,9 ---- + window_size - report the users window size + + void window_size(int width, int height); + + window_size() is called with the user's window size, as reported by telnet + negotiation. If the user's client never responds to the query, this is + never called. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/applies/write_prompt ds2.0r27/lib/doc/applies/write_prompt *** ds1.1/lib/doc/applies/write_prompt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/applies/write_prompt Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,9 ---- + write_prompt - called when the parser wants a prompt to be written. + + void write_prompt(); + + If write_prompt is present in the player object, the driver will call it + whenever the default prompt would normally be printed. The driver will + not call write_prompt when the player is in input_to or ed. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/build/Armours ds2.0r27/lib/doc/build/Armours *** ds1.1/lib/doc/build/Armours Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/build/Armours Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,180 ---- + Building Armours + The Nightmare IV LPC Library + written by Descartes of Borg 950430 + + Armour has changed quite a bit from the days of armour class. The + Nightmare IV LPC Library now uses damage types, which means armour that + is great against one attack may be pathetic against another. In fact, + in building armour, it is important that you keep in mind weaknesses. + Fortunately, armour is by default absolutely pathetic. If you go + making it awesome, chances are that it will not make it through the + approval process. This document is designed to get you started + building armour as well introduce you to the features available to + make unique and interesting armour. + + I. Basic Armour + You should be familiar with /doc/build/Items, as armour is just a + special type of item. It therefore has all of the features of regular + items. + + + + The basic armour looks like this: + + #include <lib.h> /* see this everywhere */ + #include <armour_types.h> /* a listing of armour types */ + #include <damage_types.h> /* a listing of damage types */ + + inherit LIB_ARMOUR; /* the armour inheritable */ + + static void create() { + armour::create(); /* call create() in armour.c */ + SetKeyName("rusty helm"); + SetId( ({ "helm", "rusty helm", "a rusty helm" }) ); + SetAdjectives( ({ "rusty" }) ); + SetShort("a rusty helm"); + SetLong("A rusty helmet which will be better than nothing on your head."); + SetMass(75); + SetValue(200); + SetDamagePoints(1000); + SetProtection(BLUNT, 4); /* SetProtection() sets the sort of */ + SetProtection(BLADE, 3); /* protection for a given damage type */ + SetProtection(KNIFE, 3); + SetArmourType(A_HELMET); /* set what kind of armour this is */ + } + + As you can see, there is very little that you have to do specific to + armour. The only armour specific call you MUST make is + SetArmourType(). Everything else is fluff. + + int SetArmourType(int type) + Armour types are found in /include/armour_types.h. The armour type + basically determines where the armour is worn. Each monster, + depending on its race, has for each limb a list of armour types which + may be worn on that limb. For example, most monsters have heads. + Some have two heads. You do not have to worry about this. They know + that they can wear anything that is A_HELMET on their heads. What if + you have something that may not be wearable on all monsters? Like, + for example, you have body armour which should only go on two armed + beings? See SetRestrictLimbs() later. It allows you to restrict + exactly which kinds of limbs can wear the armour. + + int SetProtection(int type, int amount); + Without this call, armour is nothing. Just something you wear. This + allows you to make clothes, which may protect against COLD, but do not + do a thing when struck with a sword. Protection is a number between 0 + and 100. Refer to approval documentation for details on what levels + are appropriate, as well as for information on mass and value levels. + + That's it for the basics! + + II. Advanced Function Calls + The Nightmare IV LPC Library armour object is fairly flexible for + allowing you to do interesting things with your armours. In this + section, you will learn about other function calls you can make to + customize your armour. + + string *SetRestrictLimbs(string *limbs); + Example: + SetRestrictLimbs( ({ "right arm", "left arm", "torso" }) ); + + For armours which can only be on certain body configurations, for + example regular armour (A_ARMOUR) should only be worn on people with + the same number of hands, this function allows you to restrict the + armour to being worn only on the limbs you name. If the person trying + to wear the armour does not have one of those limbs, any attempt to + wear fails. + + int SetFingers(int num); + Example: + SetFingers(5); + + Used for the glove types. If a person has more fingers on the limb on + which they are trying to wear a glove type than the glove has spaces + for, the wear fails. + + mixed SetWear(string | function val); + Examples: + SetWear("The cloak feels all yucky on you."); + SetWear( (: CheckArtrell :) ); + + Allows you to create a special message seen by the person wearing the + item when they wear it if you pass a string. On the other hand, if + you pass a function, it will call that function to see if the person + can wear the item. The function should be of the form: + int WearFunc(); + + For example: + + int CheckArtrell() { + if( (string)this_player()->GetRace() == "artrell" ) { + write("The rusty helm makes you feel safe."); + say((string)this_player()->GetName() + " wears a rusty helm."); + return 1; + } + else { + write("You cannot wear that you bum!"); + return 1; + } + } + + III. Function Overrides + The only function of interest that you might want to override is a + function called eventReceiveDamage(). This function is called every + time the armour is hit to see how much of the damage it absorbs. It + looks like this: + + int eventReceiveDamage(int type, int strength, int unused, mixed limbs); + + This function is called by combat to determine how much damage the + armour absorbs for a given bit of damage being done. It thus should + return how much damage it takes. + + You should always at some point call item::eventReceiveDamage() so + that it can do its processing. You do not want to call it, however, + until you determine how much damage you are absorbing unnaturally. + Here is a sample one for an armour that does extra protection for fighters: + + int eventReceiveDamage(int type, int strength, int blah, mixed limbs) { + object who_is_wearing; + int x; + + if( !(who_is_wearing = environment()) ) /* eek! no one wearing */ + return 0; + if( (int)who_is_wearing->ClassMember("fighter") ) /* reduce strength */ + x = strength - random(5); + if( x < 1 ) return strength; /* protect against all the damage */ + return armour::eventReceiveDamage(type, x, blah, limbs); + } + + Keep in mind what eventReceiveDamage() in armour.c is doing. First, + it is modifying the strength of the blow based on the protections you + set with SetProtection(). Then, it is having the armour take damage + based on how much it absorbed. So you need to call + eventReceiveDamage() in armour at the point where you have a value you + want the armour to do its normal stuff with. In the example above, we + wanted to magically protect fighters against a random(5) points of + damage without having the armour take any damage for that. Then if + there is still strength left in the blow, the armour does its normal + protection. + + What else can you do with this? Imagine an armour that turns all cold + damage back on the attacker? + + int eventReceiveDamage(int type, int strength, int unused, mixed limbs) { + object who_wearing, enemy; + + enemy = (object)(who_wearing = previous_object())->GetCurrentEnemy(); + if( !enemy || !(type & COLD) ) + return armour::eventReceiveDamage(type, strength, unused, limbs); + limbs = enemy->GetTargetLimb(0); + message("environment", "Your anti-cold throws the frost in your " + "enemy's face!", who_wearing); + message("environment", "Your cold attack is turned back upon you!", + enemy); + enemy->eventReceiveDamage(COLD, strength, unused, limbs); + return strength; /* we absorb all of the strength but take no damage */ + } + + Descartes of Borg + borg@imaginary.com diff -c -r --new-file ds1.1/lib/doc/build/Barkeeps ds2.0r27/lib/doc/build/Barkeeps *** ds1.1/lib/doc/build/Barkeeps Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/build/Barkeeps Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,67 ---- + Building Food and Drink Sellers + The Nightmare IV LPC Library + written by Descartes of Borg 950528 + + This document details the building of barkeeps, waiters, and other + such people who sell food and drink. Barkeeps are NPC's, and + therefore everythign which applies to NPC's applies to barkeeps. + + To build a barkeep, you should inherit LIB_BARKEEP. + + Beyond the functions specific to NPC's barkeeps also make use of the + following functions: + + mapping SetMenuItems(mapping menu); + mapping AddMenuItem(string item, string file); + mapping RemoveMenuItem(string item); + mapping GetMenuItems(); + string SetLocalCurrency(string curr); + + When building a barkeep, you must add some mechanism in the room in + which the barkeep is placed for people to view a list of things for + sale. + + ***** + mapping SetMenuItems(mapping menu); + ***** + + Example: SetMenuItems( ([ "coffee" : "/realms/descartes/coffee" ]) ); + + Sets which menu items are found in which file. This is a mapping with + the name of the item as a key and the file in which it is located as + the value. + + ***** + mapping AddMenuItem(string item, string file); + ***** + + Example: AddMenuItem("lobster", "/realms/descartes/lobster"); + + Adds one menu item at a time to the list of menu items. + + ***** + mapping RemoveMenuItem(string item); + ***** + + Example: RemoveMenuItem("coffee"); + + Removes the named item from the menu. + + ***** + mapping GetMenuItems(); + ***** + + Returns all the menu items for this barkeep. Useful in building your + menu list. + + ***** + string SetLocalCurrency(string curr); + ***** + + Example: SetLocalCurrency("khucha"); + + Sets the currency in which the barkeep does business. + + + + diff -c -r --new-file ds1.1/lib/doc/build/Climates ds2.0r27/lib/doc/build/Climates *** ds1.1/lib/doc/build/Climates Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/build/Climates Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,6 ---- + indoors + temperate + arid + arctic + tropical + sub-tropical diff -c -r --new-file ds1.1/lib/doc/build/Doors ds2.0r27/lib/doc/build/Doors *** ds1.1/lib/doc/build/Doors Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/build/Doors Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,262 ---- + Creating Doors between Two Rooms + The Nightmare IV LPC Library + created by Descartes of Borg 950419 + + This document describes how to build door-type objects which link two + rooms. These door-type objects do not need to be doors, but in fact + can be windows or boulders or any other such object. The Nightmare IV + LPC Library door object, unlike the old way of doing doors, is an + object separate from the rooms it connects. In other words, in order + to build a door, you have three objects (just as you would visualize): + two rooms and a door. + + The door object is /lib/door.c. To inherit it, #include <lib.h> and + inherit LIB_DOOR;. An example door may be found in + /domains/Examples/etc/door.c as well as the rooms + /domains/Examples/room/doorroom1.c and /domains/Examples/room/doorroom2.c. + + Setting up the door object + The first thing you must do is create the door object. You must + visualize this door object just like a door connecting two rooms in + real life. You have a room on each side with a single door with two + sides. Technically, a door object may have any number of sides. + Practically speaking, most people using this object will be using it + as a door, which means it will have two sides. + + To create a door object, you simply describe each side of the door. + The easiest way to do this is through the SetSide() function. + + mapping SetSide(string side, mapping mp); + + Example: + + SetSide("east", ([ "id" : "red door", "short" : "a red door", + "long" : "A freshly painted red door.", + "lockable" : 0 ]) ); + + The name of the side is simply the exit used by the room which sees + that side. For example, if in one room the door is at the east exit, + then the side is identified as east. The mapping consists of the + following data: + + "id" + What a person on that side calls the door. For example, you can have a + door blue on one side and red on the other. On one side, you go east + to go through the door, and from that room the door appears red. The + id for that side might be "red door". The id for the other side might + be "blue door". + + "short" + The short description for the door as seen from the side in question. + This can be a function or a string. + + "long" + The long description for the door as seen from the side in question. + Whether the door is open or not will be added to the long if the long + is a string. This can be either a string or function. If it is a + function, you must specify whether the door is open or close on your + own. + + "lockable" + 0 if the door cannot be locked (and unlocked) from that side, 1 if it + can. + + "keys" + An array of id's of objects which can be used to unlock it if it is + lockable. Lockable doors do not need keys. + + II. Setting up the rooms + After you have called SetItems() and SetExits() in the room + (remembering to set the exit for the exit with the door), call the + function SetDoor(). + + string SetDoor(string dir, string doorfile); + + Example: SetDoor("east", "/realms/descartes/doors/red_door"); + + Sets the exit named to be blocked by a door object when that door + object is closed. + + This is all you need to do in the room. Note that the exit name + corresponds to the side name mentioned in the door. + + III. Advanced Door Stuff + At this point, you should know how to do the minimum stuff to build a + door. This section goes into detail about door functions and how you + can do advanced things with doors by manipulating door events. This + section has two parts, door data functions and door events. + + a. Door Data Functions + + ***** + SetSide() + ***** + mapping SetSide(string side, mapping mp); + + As described above. + + ***** + SetClosed() + ***** + static int SetClosed(int x) + + Example: SetClosed(1); + + This function can only be called from inside the door object. + Generally you use it to set the initial state of the door. If you + want to close the door at any other time, or to close it from another + object, use eventClose() or eventOpen(). + + ***** + SetLocked() + ***** + + static int SetLocked(int x) + + Example: SetLocked(1); + + Like SetClosed(), this function should only be used from create() + inside the door object to set the initial state of the door. At other + times, use eventLock() or eventUnlock(). + + ***** + SetLockable() + ***** + + int SetLockable(string side, int x) + + Example: SetLockable("east", 1); + + Sets a side as being able to be locked or unlocked. Since it is done + by sides, this means you can have one side not be lockable with the + other side being lockable. The first argument is the side being set + lockable or not lockable, the second argument is 1 for lockable and 0 + for not lockable. + + ***** + SetId() + ***** + + string SetId(string side, string id) + + Example: SetId("west", "blue door"); + + This is not like your traditional SetId() function. Instead, it sets + a single way of identifying the door from a given side. It is what + the player might use to open the door or look at it. + + ***** + SetShort() + ***** + + mixed SetShort(string side, string | function desc) + + Examples: + SetShort("north", "a red door"); + SetShort("west", (: GetWestShort :) ); + + Sets the short description for a given side of a door. If the second + argument is a function, it gets passed as an argument the name of the + side for which the function serves as a description. That function + should return a string. For the above: + + string GetWestShort(string dir) { + if( query_night() ) return "a shadowy door"; + else return "a red door"; + } + + ***** + SetLong() + ***** + + mixed SetLong(string side, string | function desc) + + Examples: + SetLong("south", "An old, dusty door covered in cobwebs."); + SetLong("east", (: GetEastLong :)) + + This works much like the SetShort() function, except it handles the + long description. It is important to note that if the second argument + is a string, that the state of the door will be added onto the long + description automatically. In other words "It is open." will appear + as the second line. This will *not* be done if you use a function for + your long description. + + ***** + SetKeys() + ***** + + string *SetKeys(string side, string *keys) + + Example: SetKeys("east", ({ "skeleton key", "special key" })); + + Builds an array of id's which can be used to unlock the door if it is + lockable from this side. In other words, a person can only unlock the + door if that person has an object which has one of the id's you + specify for its id. + + b. Events + + ***** + eventOpen() + ***** + + varargs int eventOpen(object by, object agent) + + Examples: + + "/realms/descartes/etc/red_door"->eventOpen(this_object()); + + int eventOpen(object by, object agent) { + if( query_night() ) return 0; /* Can't open it at night */ + else return door::eventOpen(by, agent); + } + + The function that actually allows the door to be opened externally. + It returns 1 if the door is successfully opened. It returns 0 if it + fails. The first argument is the room object from which the door is + being opened. The second argument, which is optional, is the living + thing responsible for opening the door. + + The first example above is an example of what you might do from + reset() inside a room in order to have the door start open at every + reset. + + The second example above is an example of how you might conditionally + prevent the door from opening by overriding the Open event. In this + case, if it is night, you cannot open this door. If it is day, you + can. + + ***** + eventClose() + ***** + + varargs int eventClose(object by, object agent) + + Example: See eventOpen() + + This function works just like eventOpen(), except it does the closing + of the door. + + ***** + eventLock() + ***** + + varargs int eventLock(object by, object agent) + + Example: see eventOpen() + + This function works just like eventOpen(), except that it gets called + for locking the door. + + ***** + eventUnlock() + ***** + + varargs int eventUnlock(object by, object agent) + + Example: See eventOpen() + + This function works just like eventOpen(), except that it gets called + for unlocking the door. + diff -c -r --new-file ds1.1/lib/doc/build/Introduction ds2.0r27/lib/doc/build/Introduction *** ds1.1/lib/doc/build/Introduction Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/build/Introduction Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,146 ---- + Introduction to Building Nightmare Objects + Nightmare IV Object Library + written by Descartes of Borg 951204 + + If you are anything like I was when I became a creator for the first + time, then your knowledge of computers consists of how to write a + paper using WordPerfect and how to play the games you like to play. + It probably seems like a long distance between that and actually + writing programs to run on a computer. And the truth is, many years + ago it was. + + Programming a computer is no longer really programming. It is more + like playing with Legos. Whereas you used to feed into a computer + step by step instructions on how the program is supposed to work, + today instead you fit objects together like pieces of a puzzle and + define their basic characteristics. The object library handles the + rest. + + Of course, that begs the question, what is an object? + + It is easiest to understand the concept if you get out of the computer + mindset. Just think about things like you do in every day life. + Objects simply are things. Your house is an object, your car is an + object, your floor is an object, your cat is an object, and you are an + object. Programming for an LPMud is simply about defining what + objects exist in the world. + + What distinguishes you from your cat? What distinguishes your cat + from your neighbour's cat? Each object has two defining pieces, its + attributes and its behaviour. An attribute is simply something that + is true of the object, for example, your cat has green eyes, while + your neighbours has blue. Things such as name, eye colour, fur + length, tail length, mass, intelligence, etc. are all attributes. In + building on muds, you will often hear attributes referred to as global + variables. + + The other part of an object is its behaviour. In the real world, + things happen to objects, and objects react. Your cat sees a bird. + Seeing the bird causes the cat to salivate. The cat in turn hunts the + bird. The chain of events really goes on and on with no identifiable + beginning or end, except in the way you describe the event. For + example, you could take the cat seeing the bird as being caused by the + bird landing, which was caused by its migration south, which was + caused by the change of seasons... + + The bottom line is that the world is full of objects which behave in + response to events according to their attributes and built-in nature. + Building objects on a mud therefore is about setting the attributes + for specific objects and defining they way they react to certain + events. Fortunately, the LPC language has built-in mechanism to make + this easy. It is called inheritance. + + Going back to the cat example, let's say you were going to build a + cat. You could go and rewrite every piece of behaviour common to your + first cat and your neghbour's cat. If you were going to build ten + cats, that would get tedious. LPC allows you to build a generic cat, + then customize an instance of that generic class and make it your cat. + + The Nightmare Object Library is what its name implies, a library of + objects that object-oriented terminology refers to as "abstract + classes". An abstract class is a type of object you never see running + around the mud. Instead, it is a building block used in the objects + you see running around the mud. In other words, the object library + builds the concept of cat, and you use this to build individual cats. + Another analogy is that of the object library being like a Lego set. + You take the pieces it gives you to build specific objects. + + In building an area, you know understand your task is to build the + objects which make up that area. Building an object simply means + using the abstract classes the object library gives you to create + specific instances of those abstract classes. You do this by defining + the specific attributes of the new objects, and defining new + behaviours. + + You have probably heard me refer to the terms behaviour and event + interchangeably. In philosophy, they are not interchangeable. A + behaviour is a type of event which is defined as being caused by + something that meant to cause the event. In other words, the cat + chasing the bird is behaviour, while the cat seeing the bird is simply + an event. Both are considered events. With respect to objects, you + are really defining events, since some events are actually + unintentional responses to other events. The Nightmare Object Library + therefore refers to what you define in objects as events. + + Writing an event in LPC is nothing more that providing step by step + instructions for what happens when a given event occurs. The LPC term + for an event is a function (sometimes you will hear people refer to + functions as methods). The Nightmare Object Library uses four types of + events: + + #1 MudOS initiated events, sometimes called an "apply" + The names of these events are all lower case. The most common apply + is the create() event. It is caused by the creation of the object. + + #2 Attribute manipulation events + These are the SetXXX() and GetXXX() events. They exist basically to + allow other objects to find out about an object's attributes, or to do + initial setup for an object's attributes. + + #3 Modal events + These are the CanXXX() events. They get called often just prior to a + behaviour type of an event. For example, I am trying to leave a room, + so my leave behaviour asks the room if I can leave. This would be + CanLeave() in the room. If CanLeave() says I can leave, then the + leave event is triggered in the room. + + #4 True events + A true event is identified by eventXXX(). These type of events are + the meat of what is happening in the game. Any given true event is + generally in turn triggered by some other true event. The chain + generally can be traced as starting with a player or NPC command at + some point. + + There are also two other types of functions which are not really + events, but instead simple routines that perform complex operations, + like the absolute_value() function. These functions belong to no + particular object since they are not really events. Instead any + object in the game may refer to them. You will hear them referred to + sefuns (simul efuns) and efuns respectively. + + So, an object in the Nightmare Object Library consists of all of these + events. That sounds like you have a lot to do? Not really. The + object library itself defines almost all of the events needed for any + particular object. Most often, you will be defining only one event + for any object, the creation event (create()). + + The event create() is triggered by MudOS for every single object when + it is first created. This is therefore the ideal place for defining + what the attributes are for an object, so your create() generally ends + up being a series of SetXXX() calls. In addition, if you add any + attributes, you will want to give them values in create(). + + Take for example an NPC. Any NPC you build will have to have a name. + Thus, when it gets created, you want to be sure to set its name. You + do this through the SetKeyName() event. + + The documents in this directory primarily describe for you what + SetXXX() functions exist in objects to allow you to define your own + unique objects. Once you are feeling comfortable with building simple + objects that only have create() behaviours, you can then start adding + other behaviours to objects. For example, one type of behaviour you + can add to some rooms is to respond to someone digging in the room. + You thus define CanDig() and eventDig() events in addition to your + create() event. In the event, whatever events you end up defining, + they end up being nothing more than modifying attributes of the object + in question, or causing events in other objects. diff -c -r --new-file ds1.1/lib/doc/build/Items ds2.0r27/lib/doc/build/Items *** ds1.1/lib/doc/build/Items Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/build/Items Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,367 ---- + Building Any Item + The Nightmare IV LPC Library + written by Descartes of Borg 950430 + + Each object you build has a certain common make-up no matter what type + of object it is. This is because all of your objects actually are + based upon the same object, the object called /lib/object.c. That + object contains functions such as SetShort() and SetLong() which you + use in almost every single object you will build. This document + details how to set up any possible object you will use. The only + exceptions will be for rooms, which do not have key names or id's. + + Beyond that, most of the every day objects you will code like armours, + weapons, drinks, foods, etc. all derive from a common object called + /lib/item.c. This document attempts to detail what is involved in + building any object on the MUD through /lib/item.c and its ancestor + /lib/object.c. + + This document is in three sections + + I. List of Mandatory Function Calls + II. Basic Functions + III. Extras + IV. Events + + ** *************** List of Mandatory Function Calls ************** ** + + SetKeyName("red bag"); + SetId( ({ "bag", "red bag" }) ); + SetAdjectives( ({ "red" }) ); + SetShort("a red bag"); + SetLong("A small red bag with no distinguishing marks."); + SetMass(90); + SetValue(50); + SetVendorType(VT_BAG); + + You also need to include vendor_types.h. + + ** *************** Basic Functions *************** ** + + ***** + SetKeyName() + ***** + + string SetKeyName(string key_name); + + Example: SetKeyName("red bag"); + + Notes: + Mandatory for all objects except rooms. + Not used for rooms. + + The key name is the central name by which the object is referred to in + sentences where no article is required. For example, the sentence + "You pick up your red bag" makes use of the key name to complete the + sentence. This is much like the short description, except the short + description will include an article. For this object, SetShort("a red + bag") would be used. + + ***** + SetId() + ***** + + string *SetId(string *id); + + Example: SetId( ({ "bag", "red bag" }) ); + + Notes: + Mandatory for all objects except rooms. + Not used in rooms. + Must be all lower case. + + The id is an array of strings by which the object may be referred to by a + player. For example, if the player wants to get this bag, the player + can type "get bag" or "get red bag". The id is used purely for + identification purposes, so if you have something you need to sneak in + a unique way of identifying it, you may add an id only you know about. + + ***** + SetAdjectives() + ***** + + string *SetAdjectives(string *adjs); + + Example: SetAdjectives( ({ "red" }) ); + + Notes: + Planned for future use in Zork style command parsing. + Not used in rooms. + + The adjectives are descriptive terms used to describe the object. + This is not currently being used, however, it will be part of the new + style command parsing we will be building. This will allow the player + to type things like "get the red one" and pick up the red bag. Even + though it is not used, it is requested you place it in your objects to + make upgrading down the road a simpler task. + + ***** + SetShort() + ***** + + string SetShort(string description | function desc_func); + + Examples: + SetShort("a red bag"); + SetShort((: DescribeBag :)); + + The short description is a brief description of the object. Only + names and proper nouns should be capitalized, the rest should be lower + case, as if it were appearing in the middle of a sentence. In rooms, + the player sees the short description when in brief mode and when they + glance at the room. For objects, the player sees the short when it is + described in the room or in their inventory. + + If you pass a function instead of a string, then that function is used + to create the description. You can use this to do something like make + the object change its short description depending on who is looking at + it. The function that you build should therefore return a string + that will be used as the short description. For example... + + string DescribeBag() { + if( query_night() ) return "a bag"; + else return "a red bag"; + } + + ***** + SetLong() + ***** + + string SetLong(string description | function desc_func); + + Examples: + SetLong("A red bag with no markings on it whatsoever."); + SetLong((: BagLong :)); + + Creates a verbose way to present the object to the player. You should + be much more descriptive than I have been in the example. Being a + text game, descriptions are 90% of what make the game. The more + creative you are with your descriptions, the more interesting the game + is to players. The long description of a room is seen by players in + verbose mode and when the player uses the "look" command. For + objects, the long description is seen when the player looks at the + object. Functions work in exactly the same fashion as short + functions. + + ***** + SetMass() + ***** + + int SetMass(int mass); + + Example: SetMass(100); + + Notes: + Mandatory for all visible objects. + Not needed for non-tangible objects and rooms. + + Sets the mass for the object. In conjunction with the gravity of the + room it is in, this works to determine the weight of the object. + + ***** + SetValue() + ***** + + int SetValue(int value); + + Example: SetValue(50); + + Notes: + Mandatory for all sellable objects. + Not used in rooms. + + Sets the base economic value of an object. This has no meaning in any + currencies, and in fact the actual value in any given currency may + vary. + + ***** + SetVendorType() + ***** + + int SetVendorType(int vt); + + Example: SetVendorType(VT_BAG); + + Note: + Mandatory for all objects except rooms. + Preset to VT_ARMOUR for objects which inherit LIB_ARMOUR. + Preset to VT_TREASURE for objects which inherit LIB_ITEM. + Preset to VT_LIGHT for objects which inherit LIB_LIGHT. + Not valid for room objects. + Values are found in /include/vendor_types.h. + + You must do: + #include <vendor_types.h> + to use the VT_* macros (i.e. VT_ARMOUR, VT_TREASURE, VT_WEAPON). + + The vendor type determines which shops will buy the item. For + example, things with VT_BAG as the vendor type can be bought and sold + in bag stores. For items which cross the line, for example a flaming + sword, you can combine vendor types in the following manner: + SetVendorType(VT_WEAPON | VT_LIGHT); + + ***** + SetDamagePoints() + ***** + + int SetDamagePoints(int pts); + + Example: SetDamagePoints(500) + + Sets the amount of damage an object can take before descreasing in + value. With armours and weapons, damage is taken quite often. Damage + is more rare with other kinds of objects. With this example object + which has 500 damage points, whenever 500 points has been done to it, + its value is cut in half and eventDeteriorate() is called for the + object. See the events section on using eventDeteriorate(). The + points are then reset to 500 and damage is done from that. + + ** *************** Extras *************** ** + + ***** + SetProperty() + ***** + + mixed SetProperty(string property, mixed value); + + Example: SetProperty("no pick", 1); + + Allows you to store information in an object which may not have been + intended by the designer of the object, or which is fleeting in + nature. See /doc/build/Properties for a list of common properties. + ***** + SetProperties() + ***** + + mapping SetProperties(mapping props); + + Example: SetProperties( ([ "light" : 1, "no attack" : 1 ]) ); + + Allows you to set any properties you want all in one shot. + + ***** + SetDestroyOnSell() + ***** + + int SetDestroyOnSell(int true_or_false); + + Example: SetDestroyOnSell(1); + + For mundane objects, or objects which should not be resold, allows you + to set it so that the object gets destroyed when sold instead of + allowing it to be resold. + + ***** + SetPreventGet() + ***** + + mixed SetPreventGet(mixed val); + + Examples: + SetPreventGet("You cannot get that!"); + SetPreventGet( (: check_get :) ); + + Allows you to make an object un-gettable by a player. If you pass a + string, the player will see that string any time they try to get the + item. If you pass a function, that function will be called to see if + you want to allow the get. Your function gets the person trying to get + the object as an argument: + + int check_get(object who) { + if( (int)who->GetRave() == "ogre" ) { + message("my_action", "Ogres cannot get this thing!", who); + return 0; + } + else return 1; + } + + ***** + SetPreventPut() + ***** + + mixed SetPreventPut(mixed val); + + Examples: + SetPreventPut("You cannot put that in there!"); + SetPreventPut( (: check_put :) ); + + The same as SetPreventGet(), except this is used when the object is + being put into another object. + + ***** + SetPreventDrop() + ***** + + mixed SetPreventDrop(mixed val); + + Examples: + SetPreventDrop("You cannot drop that!"); + SetPreventDrop( (: check_drop :) ); + + The same as SetPreventGet(), except this is used when a player tries + to drop the object. + + + ** *************** General Events ************** ** + + ***** + eventDeteriorate() + ***** + + void eventDeteriorate(int type); + + Example: ob->eventDeteriorate(COLD); + + Notes: + Damage types can be found in /include/damage_types.h + + This function gets called periodically in objects whenever they wear + down a bit. The type passed to the function is the type of damage + which triggered the deterioration. + + ***** + eventMove() + ***** + + int eventMove(mixed dest); + + Example: + ob->eventMove(this_player()); + ob->eventMove("/domains/Praxis/square"); + + The eventMove event is called in an object when it is being moved from + one place to the next. You can either pass it the file name of a room + to which it should be moved or an object into which it should be + moved. It will return true if the object gets moved, false if it + cannot move for some reason. For objects which are being dropped, + gotten, or put, it is generally a good idea to check CanDrop(), + CanClose(), or CanGet() for the object in question since eventMove() + does not know the context of the move and therefore will allow a drop + since it does not check CanDrop(). + + ***** + eventReceiveDamage() + ***** + + varargs int eventReceiveDamage(int type, int amount, int unused, mixed limbs); + + Example: ob->eventReceiveDamage(BLUNT, 30, 0, "right hand"); + + This function gets called in an object whenever any damage is done to + it. Most frequently this gets called in monsters and armour. In + armour you can use it to modify the amount of damage which gets done. + The return value of this function is the amount of damage done to the + object. For example, if you have a piece of armour that absorbs 5 of + the 30 points listed above, then you return 5. + + NOTE: + For monsters there is an extra arg at the front called + agent. The agent is the being responsible for doing + the damage. It may be zero if something like the weather + is causing the damage. It looks like: + + varargs int eventReceiveDamage(object agent, int type, int strength, + int internal, mixed limbs); + + For more detailed information, see /doc/build/NPC. + diff -c -r --new-file ds1.1/lib/doc/build/Meals ds2.0r27/lib/doc/build/Meals *** ds1.1/lib/doc/build/Meals Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/build/Meals Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,150 ---- + Building Food and Drink Objects + The Nightmare IV LPC Library + written by Descartes of Borg 950603 + + This document details the creation of food and drinks using the + Nightmare LPC Library. The creation of barkeeper objects requires you + to be able to build these objects, so make sure you understand what is + going on in here before moving on to barkeepers. + + To create food or drink, you inherit from the standard meal object + /lib/meal.c For example: + + #include <lib.h> + + inherit LIB_MEAL; + + You have access to the same functions you have in generic items when + you build food and drinks. In particular, you should be sure to call + the following: + + SetKeyName() + SetId() + SetShort() + SetLong() + SetMass() + + Note that SetValue() does NOTHING for food and drinks. Value is + automatically determined by the strength of the item. + + The following function calls are specific to "meal" objects: + + int SetMealType(int types); + int SetStrength(int strength); + + mixed *SetMealMessages(function f); + OR + mixed *SetMealmessages(string mymsg, string othermsg); + + string SetEmptyName(string str); + string SetEmptyShort(string str); + string SetEmptyLong(string str); + string SetEmptyItem(string str); + + You must call SetMealType(), SetStrength(), and SetMealMessages(). + If you call SetEmptyItem(), you do not need to call the functions + SetEmptyName(), SetEmptyShort(), SetEmptyLong(). On the other hand, + if you do not call SetEmptyItem(), you do need to set the other three. + + ***** + int SetMealType(int types) + ***** + + Example: SetMealType(MEAL_FOOD); + + For meal objects, you must do: + + #include <meal_types.h> + + This includes all od the definitions for the meal types in + /include/meal_types.h into your food or drink. You need these + definitions when setting what type of meal object this is. The types + are: + + MEAL_FOOD + MEAL_DRINK + MEAL_CAFFEINE + MEAL_ALCOHOL + MEAL_POISON + + In general, almost anything you create will be at least either + MEAL_FOOD or MEAL_DRINK. You can add onto it using the | operator. + For example, to make an alcoholic drink: + + SetMealType(MEAL_DRINK | MEAL_ALCOHOL); + + This makes something a drink and an alcoholic drink. You want to + stick poison in it? + + SetMealType(MEAL_DRINK | MEAL_ALCOHOL | MEAL_POISON); + + ***** + int SetStrength(int x) + ***** + + Example: SetStrength(20); + + This sets how strong your food or drink is. It affects things like + which people can drink or eat it and how much the drink or food costs. + Refer to balance documents to see what is good. + + ***** + varargs mixed *SetMealMessages(function|string, string) + ***** + + Examples: + SetMealMessages((: call_other(find_object("/some/object"),"drink") :)); + SetMealmessages("You drink your beer.", "$N drinks $P beer."); + + You can pass a single argument, which is a function to be called. + This function will be called after the person has drank or eaten the + meal. It gives you a chance to do some bizarre messaging and such. + + If you pass two strings, the first string is used as a message to send + to the player doing the drinking, and the second is what everyone else + sees. To make the message versatile, you can put in the following + place holders: + + $N the name of the drinker/eater + $P his/her/its + + For example: + $N drinks $P beer. + might resolve to: + Descartes drinks his beer. + + ***** + string SetEmptyName(string str) + ***** + + Example: SetEmptyName("bottle"); + + Sets an id from the empty container of drinks. This need not be set + for food. + + ***** + string SetEmptyShort(string str) + ***** + + Example: SetEmptyShort("an empty bottle") + + Sets what the short description of the empty container is for anything + that is of type MEAL_DRINK. + + ***** + string SetEmptyLong(string str) + ***** + + Example: SetEmptyLong("A brown bottle that used to contain beer."); + + Sets the long description for the empty container for drink objects. + + ***** + string SetEmptyItem(string str) + ***** + + Example: SetEmptyItem("/domains/Praxis/etc/empty_bottle") + + Instead of cloning a generic empty object and setting the other empty + functions, you can create a special empty container which gets given + to the player after they drink a drink object. Not relevant to food. diff -c -r --new-file ds1.1/lib/doc/build/NPC ds2.0r27/lib/doc/build/NPC *** ds1.1/lib/doc/build/NPC Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/build/NPC Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,284 ---- + Building Non-Player Characters + The Nightmare IV Object Library + written by Descartes of Borg 951201 + + This document outlines the creation of non-player characters (NPC's). + On other muds, NPC's are sometimes referred to as monsters. Like the + rooms document, this document is divided up into two sections: basic + NPC building and complex NPC building. NPC's are living things which + inherit all the behaviours of living things. Documentation on living + specific functionality may be found in /doc/build/Livings. + + ************************************************ + Part 1: Basic NPC Building + ************************************************ + + ***** + I. The simplest NPC + ***** + + #include <lib.h> + + inherit LIB_NPC; + + static void create() { + npc::create(); + SetKeyName("praxis peasant"); + SetId( ({ "peasant", "praxis peasant" }) ); + SetShort("a local peasant"); + SetLong("Dirty and totally disheveled, this poor inhabitant of Praxis " + "still somehow maintains an air of dignity that nothing can " + "break."); + SetLevel(1); + SetRace("elf"); + SetClass("fighter"); + SetGender("male"); + } + + There are two things you should note. The first is that an NPC is + also a general object, meaning that you have available to you all the + things you can do with general objects, like setting descriptions and + ID's. The second is that a basic NPC does not require a heck of a lot + more. I will cover the NPC specific functions here. + + SetLevel(1) + SetRace("elf") + SetClass("fighter") + Level, race, and class are the three most important settings in any + NPC. Together they determine how powerful the NPC is. You are + absolutely required to set a level and a race. For those who + absolutely do not want to give the NPC a class, you do not have to. + But, you must instead manually set the NPC's skill levels, which is + described in the second part of this document. In general, however, + you always want to set the class. + + Together, the class and race and level determine which skills and + stats are considered important for the monster, and how good at those + skills and stats the monster is. The order in which you call these + functions is irrelevant, as everything is recalculated any time one of + the above changes. + + Also, note that SetRace() may only be called with a race listed in the + mraces command with simple NPC's. If you wish to build an NPC with a + unique race, you need to do some limb manipulation, which is described + in the advanced section. + + SetGender("male") + While not required, you will normally want to give an NPC a gender. + The default is neutral. However, in this world, very little is + neuter. Your choices for this function are male, female, and neuter. + + ***** + II. Other NPC Configuration Functions + ***** + + Function: int SetMorality(int amount); + Example: SetMorality(100); + + This is a number between -2000 and 2000 which determines the morality + of an individual with respect to good and evil. -2000 is absolute + evil, and 2000 is absolute good. The actions of players determine + their morality, and often those actions are relative to a target. + Thus killing an evil being can be considered good, while killing a bad + one evil. + + Function: int SetUnique(int x); + Example: SetUnique(1) + + Marks the NPC as a unique monster. This allows the room which clones + your NPC to use the negative values to SetInventory() (see + /doc/build/Rooms) to make sure the NPC only gets cloned every few + days. + + ************************************************ + Part 2: Advanced NPC Building + ************************************************ + + ***** + I. Functions + ***** + + You may use these functions to make your NPC's a bit more interesting + than the simple variety. + + Function: void SetAction(int chance, mixed val); + Examples: SetAction(5, (: DoSomething :)); + SetAction(5, ({ "!smile", "!frown" })); + SetAction(5, ({ "The peasant looks unhappy." })); + + Sets something to randomly happen every few heart beats while the NPC + is not in combat. In the above examples, the NPC has a 5% chance each + heart beat of performing the action you provided with the second + argument. The action can be a call to a function, a list of potential + commands, or a list of strings to be echoed to the room. + + If you pass a function, that function will be called each time an + action is supposed to occur. If you pass a list of strings, one of + those strings will be randomly chosen as the target action for this + heart beat. If the chosen string begins with a !, it is treated as a + command. Otherwise, it is simply echoed to the room. Note that you + can mix commands and echo strings. + + ***** + + Function: void SetCombatAction(int chance, mixed val); + Examples: SetCombatAction(5, (: DoSomething :)); + SetCombatAction(5, ({ "!missile", "!fireball" })); + SetAction(5, ({ "The peasant looks angry." })); + + This function works exactly the same as SetAction(), except that these + actions only get triggered while the NPC is in combat. This is the + best place to have the NPC cast spells. + + ***** + + Function: varargs void SetCurrency(mixed val, int amount); + Examples: SetCurrency("gold", 100); + SetCurrency( ([ "gold" : 100, "electrum" : 1000 ]) ); + + This function allows you to set how much money an NPC is carrying. + The first syntax allows you to set one currency at a time. The second + allows you to set multiple currencies at once. Not that if you use + the second syntax, it will blow away any currencies the NPC might + already be carrying. + + ***** + + Function: mixed SetDie(mixed val); + Examples: SetDie("The black knight bleeds on you as he drops dead."); + SetDie((: CheckDie :)); + + If you pass a string, that string will be echoed as the NPC's death + message when it dies. If you pass a function, that function gets + called with the agent doing the killing, if any, as an argument. For + example, with the above example, the function that you write: + + int CheckDie(object killer); + + gets called. If you return 1, the NPC goes on to die. If you return + 0, the NPC does not die. In the event you prevent death, you need to + make some arrangements with the NPC's health points and such to make + sure it really is still alive. + + ***** + + Function: mixed SetEncounter(mixed val); + Examples: SetEncounter(40); + SetEncounter( (: CheckDwarf :) ); + SetEncounter( ({ str1, str2 }) ); + + This allows you to set up e behaviour for an NPC upon encountering + another living thing. Note that this behaviour occurrs for both + players and other NPC's. Using the first syntax, the NPC will simply + attack any other living thing with a charisma less than 40. The + second syntax calls the function you specify. You may have it do any + number of things, however, you must also return a 1 or a 0 from that + function. A 1 means that after the function is called, the NPC should + initiate combat against the thing it just encountered. A 0 means + carry on as usual. + + Finally, the third syntax is likely to be used in places other than + the create() funciton in the NPC. This syntax lets you set a list + names which are simply enemies to the NPC. More likely, you will be + using AddEncounter() and RemoveEncounter() for this. + + ***** + + Function: string *AddEncounter(string name); + Example: AddEncounter((string)this_player()->GetKeyName()); + + Adds a name to the list of names an NPC will attack on sight. + + ***** + + Function: string *RemoveEncounter(string name); + Example: RemoveEncounter((string)this_player()->GetKeyName()); + + Removes a name from the list of names an NPC will attack on sight. + + ***** + + Function: SetInventory(mapping inventory); + Examples: + SetInventory( ([ "/domains/Praxis/weapon/sword" : "wield sword" ]) ); + SetInventory( ([ "/domains/Praxix/etc/ruby" : 1 ]) ); + SetInventory( ([ "/domains/Praxis/etc/emerald" : -10 ]) ); + + This functions behaves almost identically to SetInventory() for rooms + (see /doc/build/Rooms). The big difference is that you may pass a + string in addition to a number as the value for any item you want in + the inventory. In the first example above, that string is the command + the NPC issues when the sword is cloned into its inventory. In other + words, if you want an NPC to do something special with an item it has + in its inventory, in this case wield the sword, you pass the command + string as the value instead of a number. + + Note that this means only one of such item will be cloned, and it + cannot be unique. + + ***** + II. Events + ***** + + The following events exist in NPC's. You should have a good grasp of + function overriding before overriding these functions. + + Event: varargs int eventDie(object target); + + This event is triggered any time the NPC is killed. The event returns + 1 if the NPC dies, 0 if it fails to die, and -1 on error. If you + intend to allow the NPC to die, you should call npc::eventDie(target) + and make sure it returns 1. + + ***** + + Event: int eventFollow(object dest, int chance); + + This event is triggered whenever an NPC is following another living + thing and that thing leaves the room. Returnung 1 means that the NPC + successfully followed the other being, and 0 means the NPC did not. + + ***** + 3. Manipulating limbs + ***** + + The basic set of limbs an NPC gets is generally set when you set its + race. You can get a list of supported NPC races through the mraces + command. Occassionally, however, you may want to create NPCs of + unique races, or with unique body structures. Or perhaps you want a + human whose right hand is already amputated. This section deals with + doing those things. + + Amputating a limb is simple. Call RemoveLimb("limb"). Note that that + is not useful for removing a limb that should not be there. Instead, + it is used for amputating a limb that looks amputated. + + If, on the other hand, you wish to remove a limb which simply should + not have been there in the first place, call DestLimb("limb"). + + The most simple case of actual limb manipulation, however, is to + change the basic structure of an individual NPC around for some + reason. For example, perhaps you wanted to add a tail to a human. + For this, you use the AddLimb() function. + + Function: varargs int AddLimb(string limb, string parent, int class, int *armours); + Examples: AddLimb("tail", "torso", 4) + AddLimb("head", "torso", 1, ({ A_HELMET, A_VISOR, A_AMULET })); + + This function adds a new limb to the NPC's body. The first argument + is the name of the limb to be added. The second argument is the name + of the limb to which it is attached. The third argument is the limb + class. Limb class is a number between 1 and 5. The lower the number, + the harder the limb is to remove. A limb class of 1 also means that + removal of the limb is fatal. The fourth, optional argument is a list + of armour types which may be worn on that limb. + + In some cases, you may wish to create a new race from scratch. This + requires adding every single limb manually. You first call SetRace() + with a special second argument to note that you are creating a new + race: + + SetRace("womble", 1); + + Then, you add the limbs for that race one by one. Make sure you call + SetRace() first. diff -c -r --new-file ds1.1/lib/doc/build/Properties ds2.0r27/lib/doc/build/Properties *** ds1.1/lib/doc/build/Properties Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/build/Properties Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,93 ---- + Supported Properties + The Nightmare IV LPC Library + written by Descartes of Borg 950429 + + The Nightmare IV LPC Library allows creators to set dynamic variables in + objects which do not get saved when the object saves. The variables are + called properties. A property is an attribute of an object which is + considered fleeting. This document serves to list the properties + commonly used and their purpose. It is by no means complete, as the + point of having properties is to allow creators to build their own on the + fly. + + Note: All properties are 0 by default unless otherwise stated. + + Property: light + Values: integer between -6 and 6 + Light is a value generally between -6 and 6 which, for rooms, + determines how much light is naturally available in a room in daytime. + For other objects, it determines the degree to which the object is + able to modify the amount of light that exists in the room. If the + room is indoors, the light does not change based on the time of day. + + Property: no attack + Values: 1 to prevent attacks, 0 to allow them + Things cannot begin combat from inside a room with this property. + + Property: no bump + Values: 1 to prevent bumping, 0 to allow it + If a room, then nothing can be bumped from this room. If a living + thing, then it cannot be bumped. + + Property: no steal + Values: 1 to prevent stealing, 0 to allow it + This prevents stealing inside a room with this property. + + Property: no magic + Values: 1 to prevent magic, 0 to allow it + This prevents any magic from being used inside the room if set. + + Property: no paralyze + Values: 1 prevents paralysis from occurring in a room, 0 allows it + Stops any sort of thing which might cause paralysis from occurring in + a room. + + Property: no teleport + Values: 1 if teleporting is prohibited, 0 if allowed + Prevents people from teleporting to or from the room. + + Property: no clear + Values: 1 to prevent clearing, 0 to allow it + If set this prevents an avatar from clearing a wilderness room in + order to build a town. Not relevant to rooms in towns. + + Property: estates + Values: any non-negative number + Sets the number of estates which can be built in an area. No estates + may be built outside of towns. + + Property: magic item + Values: an array of strings describing the magic contained in an object + Allows you to mark specific objects as magic. For example, if a sword + has a magical lighting ability, you might do: + SetProperty("magic item", ({ "light" })); + + Property: lockpicking tool + Values: any integer marking how well lockpicking is enhanced + When picking a lock, the value of this property is calculated for each + object and added to the overall chance to pick the lock. + + Property: keep + Values: the name of whomever the object is kept for + While set, this object may only be picked up by the person whose name + matches the value of this property. If 0, anyone can pick it up + assuming it is normally gettable. + + Property: magic hold + Value: any integer + Is subtracted from the chance of success of anyone trying to pick a + lock. + + Property: enchantment + Value: any integer + Enchants any object to boost (or degrade) its performance of its + natural functions. + + Property: login + Value: a string representing a file name + Sets which room a player should login to at next login if they quit + from the room that has this property. For example, if you have a + treasure room that is protected, and therefore you do not want people + logging into it, you can call: + SetProperty("login", "/file/name/outside/this/room"); + to have the players login to the room outside. diff -c -r --new-file ds1.1/lib/doc/build/Quests ds2.0r27/lib/doc/build/Quests *** ds1.1/lib/doc/build/Quests Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/build/Quests Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,35 ---- + Building Quests + from the Nightmare IV LPC Library + written by Descartes of Borg 950716 + + Unlike previous Nightmare versions, Nightmare IV has no support for + centralized quest administration. This was done under the belief that + coercive questing was among the least favourite features players have + mentioned about the MUDs I have encountered. Nevertheless, the + presence of quests is still an extrememly important part of any MUD. + Since the coercive nature (needing to complete quest X to raise to + level Y) has been removed, other ways to make questing worthwhile need + to be found. + + The first, and most obvious, is to properly reward the player with + money, items, and skill and stat points. The other bit of support is + for a title list. Each quest, or accomplishment, is added to a list + of accomplishments the player has. The player may display any of + those at any time as part of their title. + + The interface to this is simple: + + player_object->AddQuest(string title, string description); + + Example: + + this_player()->AddQuest("the slayer of frogs", + "You viciously slayed the evil frogs of Wernmeister that " + "threatened the peaceful town with warts and unabated fly murder."); + + In the player's biography, they will see the description along with + the date they accomplished the task. From their title list, they will + now be able to choose this title. + + Descartes of Borg + 950716 diff -c -r --new-file ds1.1/lib/doc/build/Rooms ds2.0r27/lib/doc/build/Rooms *** ds1.1/lib/doc/build/Rooms Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/build/Rooms Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,487 ---- + Building Rooms + The Nightmare IV LPC Library + written by Descartes of Borg 950420 + + This document details how to build rooms using the Nightmare IV LPC + Library's inheritable room object. This document is divided into + simple room building and complex room building. The first part + teaches you about basic rooms. The second part tells you what + features are there to allow you to do creative things with the room object. + + ************************************************ + Part 1: Basic Room Building + ************************************************ + + I. The Simple Room + The simple room minimally looks like this: + + #include <lib.h> + + inherit LIB_ROOM; + + static void create() { + room::create(); + SetProperty("light", 2); + SetClimate("indoors"); + SetShort("an empty room"); + SetLong("An empty room with no exits leading anywhere. It is " + "completely barren with nothing to describe."); + } + + #include <lib.h> + This first line is one you need in any object. It defines the exact + location of objects which you inherit. In this case, the object is + LIB_ROOM. It is currently located at /lib/room.c. If we wanted to + change that location, however, we could do it easily since you only + reference LIB_ROOM. So lib.h is a file that says that LIB_ROOM is + "/lib/room". + + inherit LIB_ROOM; + The third line, the inherit line, says that this object will inherit + /lib/room.c. + + static void create() { + The fifth line begins the meat of any object you will write. This is + the beginning of a function. This one is called create(). If you are + curious, the static means no one can use the call command to call the + function. Do not worry about that too much, however, as it is always + something you put there for the create() function. + + The "void" part simply says that you are returning no value from the + function. See the LPC Basics textbook for more information on + functions. + + room::create(); + Inside the create() function are the calls which define what the + object will do. The first call calls the function create() in + /lib/room.c, the object you just inherited. /lib/room.c has its own + create() function which does some things needed in order to set up + your object. You need to make sure it gets called through this line. + + SetProperty("light", 2); + This sets the light in the room to be 2. In outdoors rooms, this is + the average light during day time. In indoor rooms, it is the average + light all the time. + + SetClimate("indoors") + Every room has a climate. An indoors room, among other things, is not + affected by weather or the time of day. + + SetShort("an empty room") + This is the description that the player sees when in brief mode. In + addition, in brief mode, obvious exit abbreviations are automatically + added. This is done through the SetObviousExits() function described + later. However, the short should be phrased in such a way that it + makes sense from something like a scry command which would say + something like: "You see Descartes in an empty room." + + SetLong("An empty room with no exits leading anywhere. It is " + "completely barren with nothing to describe."); + This sets the long description seen by the player when in verbose + mode. Note that items in the room as well as scents and sounds are + added to what the player sees automatically. + + That's it! You now have a room which no one can leave! + + II. Adding items + Approval on any decent MUD will eat you for lunch if you do not + describe your items. This is likely the most tedious part of area + building, however, it is also the part that largely makes the + difference between a dull area and a fun one. You must be sure to + make it so that anything a player might logically want to see in + detail in a room is described in detail. For example, say you have + the following long description for a room: + + You are in Monument Square, once known as Krasna Square. The two main + roads of Praxis intersect here, where all of Nightmare's people gather + in joy and sorrow. The road running north and south is called Centre + Path, while Boc La Road is the name of the road running east and west. + A magnificent monument rises above the square. + + You should have descriptions for the following items placed in your + room: + + square, monument, monument square, krasna square, roads, road, + intersection, people, centre path, boc la road, magnificent monument + + How to do this with a minimum of hassle: + + SetItems( ([ ({ "square", "monument square", "krasna square" }) : + "The central square of Praxis where citizens and adventurers " + "gather to chat and trade. Formerly known as Krasna Square, " + "is now known as Monument Square as thanks to those who helped " + "to build the town", + ({ "monument", "magnificent monument" }) : "A giant monolith " + "rising above Monument Square", + ({ "intersection", "road", "roads" }) : "The two main roads of Praxis " + "intersect in Monument Square. The one to the north and south " + "is called Centre Path, while the other is Boc La Road.", + ({ "people", "adventurers", "citizens" }) : "A varied group of " + "people from countless realms hanging about talking and trading.", + "centre path" : "The main road leading north to the North Forest " + "from Praxis, and south to the sea.", + "boc la road" : "The main east-west road through Praxis, going " + "east towards the jungle, and west towards the Daroq Mountains." ]) ); + + That may seem like a mouthful, but it is easier to break down into + smaller points and see what is going on. The SetItems() prototype + looks like this: + + mapping SetItems(mapping items); + + That means it accepts a data type called a mapping as the argument and + returns a new mapping of items. A mapping is a special data type in + LPC that allows you to associate two values together, for example, to + associate an item with its description. For example, above we wanted + to associate the items "monument" and "magnificent monument" with the + description "A giant monolith rising above Monument Square". To do + that, a mapping looks like this: + + ([ value1 : assoc_value1 ]) + + where assoc_value1 is the value associated with value1. In this case, + we might have something like: + + ([ "monument" : "A giant monolith rising above Monument Square." ]) + + But, we also wanted to associate "magnificent monument" with this + description. One way, which is perfectly legitimate, would be: + + ([ "monument" : "A giant monolith rising above Monument Square", + "magnificent monument" : "A giant monolith rising above Monument Square" ]) + + But that would be damned annoying, especially with long descriptions + or things with a lot of synonyms. You can therefore group values + which have the same description together using array notation: + ({ value1, value2, value3 }) + + And thus, make that mapping look like: + + ([ ({ "monument", "magnificent monument" }) : "A giant monolith rising " + "above Monument Square." ]) + + To complete setting the items, you simply add other item/description + pairs separated by commas: + + ([ ({ "monument", "monument square" }) : "A giant monolith rising " + "above Monument Square.", + "house" : "A little white house with white picket fences." ]) + + Mappings are a rather difficult concept to grasp, but once grasped + they are very powerful. You should take a look at some sample code + from /domains/Examples/room to get a good idea of what proper code + looks like. In addition, there is a chapter in Intermediate LPC + dedicated to the concept. Finally, you can always mail + borg@imaginary.com to ask questions. + + III. Adding Exits and Enters + If you understand the section above, exits and enters are simple. + They too use mappings, but less complicated ones: + + SetExits( ([ "north" : "/domains/Praxis/n_centre1", + "south" : "/domains/Praxis/s_centre1", + "east" : "/domains/Praxis/e_boc_la1", + "west" : "/domains/Praxis/w_boc_la1" ]) ); + + SetEnters( ([ "hall" : "/domains/Praxis/town_hall", + "pub" : "/domains/Praxis/pub" ]) ); + + With an exit mapping, you simply match the direction to the room to + which it leads. With an enter mapping, you match a thing being + entered with the room to which it leads. + + Unlike other LPC Libraries, the Nightmare IV LPC Library distinguishes + between the concept of motion towards and motion into. Motion towards + is exemplified by the "go" command, which is affected by SetExits(). + For example, to go east, you type "go east". You are simply going + towards the east (Note that "go east" is by default aliased to "e"). + + Motion into is exemplified by the "enter" command, which is affected + by SetEnters(). Enter marks anything you enter into, for example a + building or bushes or the like. In the above example, a player would + issue the command "enter pub" to enter the pub. + + IV. Adding Objects + If you want to add physical objects into your room, you use the + SetInventory() function. For example, if you wanted to place a balrog + in the room: + + SetInventory(([ "/domains/Praxis/npc/balrog" : 1 ]); + + Every reset, the room will then check to see if any balrogs are in the + room. If no balrogs are in the room it will clone 1. Again, this is + another function using a mapping. In this case it is associating the + file name of an object with how many of that object should be in the + room at every reset. If you wanted 5 balrogs in the room, you would + have changed the 1 to 5. + + V. Adding Smells, Listens, and Searches + + The functions: + SetSmell() + SetSearch() + SetListen() + + All work identically to the SetItems() function. That is they match + things you can smell, listen, search to descriptions which the player + sees when they smell, listen, search the item. + + For example: + + SetSmell( ([ "monument" : "It smells of obsidian.", + "road" : "It smells dusty.", + ({ "pub", "bar" }) : "It smells of alcohol." ]) ); + + If a player types: + "smell monument" + then they see + "It smells of obsidian." + + One unique thing about these three functions, however, is that you can + use the special thing "default" to set a smell, listen, or search that + occurs when no object is specified. For example, + + SetSmell(([ "default" : "It really stinks here." ]) ); + + Will have the player see "It really stinks here." when they simply + type "smell". In addition, this is the smell the player sees when + they simply walk into a room. + + VI. Miscellaneous stuff + + SetObviousExits("n, s, e") + Sets an obvious exits string which gets seen in brief mode and by + newbies in verbose mode. Generally, this should consist of the + abbreviations for the room's obvious exits only. + + SetTown("Praxis") + For rooms which are considered part of a town, you must specify that + they are part of the town through this function. In this example, the + room is set to be in the town of Praxis. See the document + /doc/build/Towns for more information on towns. + + SetDayLong("The sky lights up the endless fields of wheat which stand " + "before you."); + SetNightLong("You are standing in a pitch black field of wheat."); + Instead of using SetLong(), you can call both of these functions to + give different long descriptions for day and night. + + SetGravity(2.0) + This makes things in the room twice as heavy as normal. + + SetDoor("east", "/domains/Praxis/doors/red_door"); + Sets a door to the east which is the file + "/domains/Praxis/doors/red_door.c". You should have an exit to the + east, and you should do this AFTER you have called SetItems(). See + the document /doc/build/Doors for detailed information on door + building. + + VII. Summary + + Here is a room that uses everything described above: + + #include <lib.h> + + inherit LIB_ROOM; + + static void create() { + room::create(); + SetProperty("light", 2); + SetClimate("temperate"); + SetTown("Praxis"); + SetShort("a peaceful park"); + SetDayLong("The light of the sun shines down upon an open field " + "in the middle of Praxis known as Kronos Park. In spite " + "of the time of day, no one is around. East Boc La " + "Road is to the south."); + SetNightLong("Kronos Park is a poorly lit haven for rogues in the " + "cover of night. It is safest to head back south " + "towards the lights of East Boc La Road"); + SetItems( ([ ({ "field", "park" }) : "A wide open park in the " + "center of Praxis." ]) ); + SetSearch( ([ "field" : "You get dirt all over your hands." ]) ); + SetSmell( ([ "default" : "You smell grass after a fresh rain.", + "dirt" : "It smells like... dirt!" ]) ); + SetExits( ([ "south" : "/domains/Praxis/e_boc_la3" ]) ); + SetInventory( ([ "/domains/Praxis/npc/rogue" : 2 ]) ); + } + + ************************************************ + Part 2: Advanced Room Building + ************************************************ + I. Functionals + MudOS has a data type called a functional. Most room functions take a + functional as an argument instead of a string. What this does is + allow you to specify a function to get called in order to determine + the value rather than set it as a string which cannot be changed. For + example, if you wanted to set a long description that varied depending the + status of a door: + + #include <lib.h> + + inherit LIB_ROOM; + + string CheckDoor(string useless); + + static void create() { + room::create(); + SetProperty("light", 2); + SetClimate("indoors"); + SetShort("an indoor room with a door"); + SetLong( (: CheckDoor :) ); + SetExits( ([ "east" : "/domains/Praxis/east_room" ]) ); + SetDoor("east", "/domains/Praxis/doors/red_door"); + } + + string CheckDoor(string useless) { + string tmp; + + tmp = "You are in a plain indoor room with a door. "; + if( (int)"/domains/Praxis/doors/red_door"->GetOpen() ) + tmp += "The door is open."; + else tmp += "The door is closed."; + return tmp; + } + + In this example, a function called CheckDoor() was written to + determine exactly what the long description should be. This is done + because in create(), you have no idea what the status of the door will + be from moment to moment. Using a function, you can therefore + determine what the long description is at the time it is needed. + + Functionals can reference any function anywhere on the MUD, including + efuns. See /doc/lpc/data_types/functionals for details on them. For + the sake of this document however, you note a functional using smileys + :). + + (: CheckDoor :) means the function CheckDoor() in this object. You + can also specify function in other objects, for example: + (: call_other, this_player(), "GetName" :) would refer to GetName() in + the person who was this_player() AT THE TIME THE FUNCTIONAL WAS + CREATED. + + Notice at the top of the file that CheckDoor() was prototyped. You + must prototype any function you reference inside your objects. The + expression (: CheckDoor :) constitutes as a reference, and thus makes + you need to prototype the function. + + The rest of this portion describes individual function calls using + functionals. The functional prototype part is how your functional + should be declared.: + + SetShort(string | function) + Functional prototype: string ShortFunc(); + Example: SetShort( (: MyShort :) ); + If you pass it a function, then this function gets called to determine + the short description. The function should return a string which will + be used as the short description. + + SetLong(string | function) + Functional prototype: string LongFunc(string unused) + Example: SetLong( (: MyLong :) ); + This function should return a string which will be used as the long + description for the room. The argument "unused" is just that, unused + in this context. It is something used for other objects. + + SetItems(mapping mp); + Functional prototype: string ItemFunc(string item); + Example: SetItems( ([ "house" : (: LookHouse :) ]) ); + This function should return a string to be used for the item + description. The argument is passed the name of the item being looked + at, so you can use the same function for multiple items. + + SetSearch(mapping mp) + Alternate: SetSearch(string item, string | function desc) + Functional prototype: string SearchFunc(string item); + Examples: SetSearch( ([ "grass" : (: SearchGrass :) ]) ); + SetSearch("grass", (: SearchGrass :)); + Note that there are two forms to SetSearch(), useful depending on how + many searches you are setting at once. If you have a search function, + then that function should return a string which is what they will see. + The argument passed is the item being searched. + + SetSmell() + SetListem() + see SetSearch() + + II. Advanced Exits + SetExits() is fairly straight forward. However, there exists another + function for exits called AddExit(). It allows you to add one exit at + a time (useful if say a player searches and finds a new exit) as well + as give functional power to exits. The prototype for AddExit() is: + + varargs mapping AddExit(string dir, string dest, function pre, function post); + + The varargs part of the prototype simply means you can call it using + less than the full number of arguments specified. In this case, the + minimum call is: + + AddExit("east", "/domains/Praxis/square"); + + The last two arguments are called pre-exit functions and post exit + functions. The pre-exit function gets called when a player issues a + command to leave the room, but before the player is allowed to leave. + Depending on the return value of the function, the player is allowed + or denied the right to leave. For example: + + AddExit("north", "/domains/Praxis/square", (: PreExit :)); + + int PreExit(string dir) { + if( !avatarp(this_player()) ) { + write("You are too lowly to go that way!"); + return 0; + } + else return 1; + } + + In other words, if the player is an avatar, they can go north. + Otherwise they cannot. The prototype is: + + int PreExit(string dir); + + where the return value is 1 or 0 for can or cannot leave, and the + argument dir is the direction in which the player is exiting. + + Post exit functions work a little differently since it makes no sense + to prevent someone from leaving once they have left. The prototype + looks like: + + void PostExit(string dir); + + This simply allows you to do processing once the player is gone. If + you wish a post exit without a pre exit, then: + + AddExit("north", "/domains/Praxis/square"", 0, (: PostExit :)); + + Enters work exactly the same way. + + Please read about the events CanReceive() and CanRelease(), as those + may be more appropriate places to do what you want. Remember, this + only prevents a player from using the "go" command to go in that + direction. CanReceive() in the other room would be better if your + desire is to keep non-avatars out of the square at any cost. + + III. Other Functions + + AddExit() + RemoveExit() + AddEnter() + RemoveEnter() + RemoveSearch() + RemoveSmell() + RemoveListen() + AddItem() + RemoveItem() + + All of the above Remove*() functions take a single string argument + specifying what it is that is being removed. For example: + + RemoveExit("east") + + removes the exit to the east. + + AddItem(string item, mixed val) + Adds a single item. Val can be a string or function. + + Descartes of Borg + borg@imaginary.com diff -c -r --new-file ds1.1/lib/doc/build/Sentients ds2.0r27/lib/doc/build/Sentients *** ds1.1/lib/doc/build/Sentients Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/build/Sentients Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,235 ---- + Building Sentient Non-Player Characters + The Nightmare IV Object Library + written by Descartes of Borg 951127 + + One thing most everyone wants to see are monsters that react more + intelligently to user input. The fact is, however, that most monsters + in the game only need a small, basic behaviour set. Nevertheless, in + order to make an area interesting, there should be some monsters which + stand out as unique and purposeful. The problem about building such + monsters is that they use a lot of processing time. + + In order to make sure most monsters which do not need such + intelligence do not waste processing time on such activities, the + Nightmare Object Library separates non-player characters into two + classes: dumb monsters, which are basic mindless automata and + sentients, monsters which react more intelligently to their + environment. + + This document describes sentients. Before looking at this document, + it is highly recommended that you be familiar with the document + /doc/build/NPC which details non-player characters. Sentients are + non-player characters, so everthing which applies to non-player + characters also applies to sentients. + + ***** + + Currently, a few basic behaviours distinguish sentients from normal + npcs. Those behaviours are the ability to intelligently move about + the mud and to react to user speech. Nightmare thus provides the + following functions to allow you to easily have an sentient enact + those behaviours: + + mapping SetTalkResponses(mapping mp); + mixed AddTalkResponse(string str, mixed val); + int RemoveTalkResponse(string str); + + mapping SetCommandResponses(mapping mp); + mixed AddCommandResponse(string str, mixed val); + int RemoveCommandResponse(string str); + + varargs int SetWander(int speed, string *path, int recurse); + string *SetWanderPath(string *path); + + int SetWanderRecurse(int x); + + int SetWanderSpeed(int x); + + ***** + + Making NPCs react to user speech + + You may want to have NPCs react to things players say. To that end, + the following functions exist: + + mapping SetTalkResponses(mapping mp); + mixed AddTalkResponse(string str, mixed val); + int RemoveTalkResponse(string str); + + Function: mapping SetTalkResponses(mapping mp) + Example: SetTalkResponses( ([ "square" : "The square is east of here.", + "house" : "Isn't that an ugly house?" ]) ); + + This function allows you to set a list of responses to given phrases. + For example, if you put this code in a sentient and a player said + "Where is the square?" or "Your frog is certainly square.", your NPC + would have said "The square is east of here.". Note therefore that + the NPC is only looking for the keys you place in there. You could + have restricted it to "where is the square" instead of "square", but + then someone asking "Where's the square" would be missed. + + Also note that phrases should be in lower case. It will match to + upper case words automatically. + + Finally, you can either give a string or a function as the match to a + phrase. If the match is a string, the NPC simply says the string in + the NPC's native tongue. If, however, the match is a function, that + function will get called. + + ***** + + Function: mixed AddTalkResponse(string str, mixed val); + Example: AddTalkResponse("in the house", (: HouseFunc :)); + + Matches an individual phrase to a string or function. As with + SetTalkResponses(), if the match is a string, the NPC simply says the + string in response to the phrase. If it is a function, that function + gets called. + + ***** + + Function: int RemoveTalkResponse(string str); + Example: RemoveTalkResponse("house"); + + Removes the previous set or added talk response from the NPC. + + ***** + + Making NPCs react to user directives + + Nightmare supports a special command, the "ask" command. A player may + use the ask command to ask an NPC to perform a certain task. For + example, "ask the healer to mend my right leg". There is a special + event in NPC's which responds to this called eventAsk(). In order to + make responding to this easier, however, Nightmare has the + CommandResponse functions. The command response functions allow NPC's + to respond based on commands, like "mend". + + ***** + + Function: mapping SetCommandResponses(mapping mp); + Example: SetCommandResponses( ([ "heal", "I cannot heal people" ]) ); + + Allows you to match commands to either strings or functions. Matched + functions get called with the command as the first argument, and + command arguments as the second argument. For example, if you had: + SetCommandResponses("give", (: give :)); + Your give() function would get called with "give" as the first + argument and "me the sword" as the second argument in response to a + player issuing the command "ask the monster to give me the sword". + + ***** + + Function: mixed AddCommandResponse(string str, mixed val); + Example: AddCommandResponse("give", (: give :)); + + This allows you to add to the list of commands to which the NPC + responds. The NPC responds to those commands as outlined for + SetCommandResponses(). + + ***** + + Function: int RemoveCommandResponse(string str); + Example: RemoveCommandResponse("give") + + Removes a previously set command response. + + ***** + + Making NPCs move about the game intelligently + + A sticky subject on most muds is that of wandering monsters. When + done poorly, they can waste resources to a great degree. Nightmare, + however, works to avoid wasting resources while getting the most out + of allowing monsters to move about. + + Nightmare supports two types of wandering monsters: those which have + pre-determined paths and others which are true wanderers. True + wanderers, those who simply randomly choose paths are subject to the + following restrictions: + They may not move into rooms not yet loaded in memory. + They will not try to open closed doors. + The first restriction is the most important to note. This means that + the NPC will not wander into rooms that have not been recently visited + by some player. This avoids the problem NPCs cause on many muds of + uselessly loading rooms that only the monster will ever see. + + Monsters given specific paths to wander are not subject to the above + restrictions. Of course, they cannot wander through closed doors. + But you can make part of their path to open a closed door. In + addition, since such monsters have very specific sets of rooms into + which they can travel, they are not in danger of needlessly loading a + zillion rooms. + + ***** + + Function: varargs int SetWander(int speed, string *path, int recurse); + Examples: + SetWander(5); + SetWander(5, ({ "go north", "open door", "enter hut", "go west" })); + SetWander(5, ({ "go north", "open door", "enter hut", "go west", + "go south" }), 1); + + This is the function you will almost always use in create() to make a + sentient wander. Only one of the three possible arguments is + mandatory, that being the speed. The speed is simply the number of + heart beats between attempts to move. Thus, the higher the number, + the slower the movement of the monster. + + The second argument, if given, is a list of commands which will be + executed in order by the monster. If it is not given, the monster + will be assumed to be a true wanderer. In other words, the first time + the monster tries to wander, the monster will "go north". The second + time, he will "open door". The third, he will "enter hut", etc. + + The third argument is either 1 or 0. If 1, that means once the + monster has completed the path, it will use the first command in the + list the next time it tries to wander. If 0, it will cease to issue + commands once it has cycled through the list. + + You might note that between the time the above monster opens the door + and enters the hut, somebody could come along and shut the door. How + can you deal with that? You could do: + SetWander(5, ({ "go north", ({ "open door", "enter hut" }) })); + You will notice here that the second member of the command array is + itself an array instead of a string. In that case, all members of + that array get executed as part of that wander. In this case it helps + make sure no one closes the door between when the monster tries to + open it and when it tries to pass through the door. + + For even more flexibility, you can make elements of the array into + functions. Instead of executing a command in a wander turn, the + function you provide instead gets called. For example: + SetWander(5, ({ "go north", (: kill_anyone :), "go south" }), 1); + Where the function kill_anyone() has the monster kill any players in + that room. Thus, this monster sits in its room and occasionally pops + its head one room to the north to kill anyone sitting there. + + ***** + + Function: string *SetWanderPath(string *path); + Example: SetWanderPath(({ "go north", "go south" })) + + Allows you to set the monster's wander path independent of other + settings. The wander path will never get executed, however, unless + the monster's wander speed is greater than 0. + + ***** + + Function: int SetWanderRecurse(int x); + Example: SetWanderRecurse(1); + + Allows you to make the monster's wander path recurse independent of + other settings. This is meaningless, however, unless the monster's + wander speed is greater than 0 and a wander path is set for it. + + ***** + + Function: int SetWanderSpeed(int x); + Example: SetWanderSpeed(5); + + Allows you to set the monster's wander speed independent of other + settings. This is NOT the same as SetWander(5). SetWander() will + clear out any previous wander path and wander recurse settings. This + function has no effect on the monster's wander path or wander recurse. + diff -c -r --new-file ds1.1/lib/doc/build/Towns ds2.0r27/lib/doc/build/Towns *** ds1.1/lib/doc/build/Towns Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/build/Towns Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,90 ---- + Building Towns + The Nightmare IV LPC Library + written by Descartes of Borg 950429 + + The Nightmare IV LPC Library contains support for towns, which is in + fact very minimal from the mudlib level. If, however, you wish to + structure your MUD to be centered around the concept as Nightmare LPMud + is, then you need to understand how to build a town. This document + describes the building of towns using the Nightmare IV LPC Library. + + I. What Is a Town? + A town is simply a collection of rooms which have the same value set + for Town. If done poorly, this is all it is. If done right, however, + a town becomes the center of the games' social structure. If you + decide to build a town in your area, the first thing you need to do is + isolate it. All towns should be surrounded by vast, vast areas of + wilderness of some sort. This may mean desert, forest, jungle, or + whatever. You may or may not want to have a road which links it to + the rest of civilization. + + Rooms are considered "wilderness" by default. That is, if you never + set the town in them, they are considered wilderness. To make a room + part of a town, you need to call SetTown() from create() of the room: + + SetTown("Praxis"); + + Capitalize your town name properly. + + Next you need to decide how many estates may be built in the room. + Ideally, towns are expanding and changing things. Upper level players + have the ability to build estates in their home towns. Of course, ten + estates in one room is crowded. Generally you should limit the number + of estates to what would logically fit in a given room. For example, + if you are on a road at the edge of town with nothing about, then + allowing two estates makes sense. On the other hand, in the middle of + an intersection of two roads, there is hardly any room for an estate + to be built. To allow estates to be built in a room: + + SetProperty("estates", 2); + + This allows two estates to be built off of this room. + + As stated above, towns are expanding. This is why they should be + situated far apart. Too close together it is hard for them to expand + without changing the overall map of the game. Therefore, when your + town has gotten as full as can be handled, then you simply move to + outlying rooms and make them part of the town by setting their town. + In addition, give them the capacity for estates. Do not forget to + change room descriptions and allow for needed roads! + + II. What do I put in towns? + The first section described what is minimally needed for a town from a + code point of view. This section describes what sorts of things you + should put in your towns. Most are optional, however, you do need to + add something called an adventurer's hall. An adventurer's hall is + the default start room for the town for anyone who chooses the town as + their home town. In order to make it their home town, they go to the + adventurer's hall and pay a fee (generally determined by approval) to + move to this town. Until that person builds an estate in the town, + the adventurer's hall is their default starting point. + + Beyond that, the only other thing required is a real estate office for + selling estates. This is an inheritable from /lib/sales.c + (LIB_SALES). Approval determines what your local land value is, and + you fill in the descriptions. For information on advanced coding of + sales offices, see the document /doc/build/Sales. + + Nothing else is required. Of course, your land value (the amount + people pay to live and build in your town) is determined by the sorts + of services your town offers. No town should offer all services. And + certainly, the services your town offers should reflect the nature of + the region in which you are building. Are you an isolated, small + town? Then few services will be available. Are you a central, large + town? Then a majority of services should be available. + + Services include: + shops of different types + bars and pubs + restaurants + libraries for learning languages + class halls + town council rooms + + This list will probably expand over time, but it provides a good + starting point for common services. + + Descartes of Borg + borg@imaginary.com + + diff -c -r --new-file ds1.1/lib/doc/build/Vendors ds2.0r27/lib/doc/build/Vendors *** ds1.1/lib/doc/build/Vendors Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/build/Vendors Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,63 ---- + Building Store Vendors + The Nightmare IV LPC Library + written by Descartes of Borg 950528 + + This document details the creation of vendor objects, NPC's which buy + and sell items. Note that vendors are NPC's, so everything in the + document on building NPC's applies to vendors. It is recommended that + you be completely familiar with that document before moving on to this + one. + + Building vendors is actually quite simple, with very little required + beyond the NPC requirements. In fact, only the following function + calls are unique to vendors: + + string SetLocalCurrency(string currency); + string SetStorageRoom(string room); + int SetMaxItems(int num); + int SetVendorType(int vt); + + One special note, however, is that the skill "bargaining" is extremely + important to vendors. Namely, the higher the bargaining, the harder + it is for players to get decent prices. + + ***** + string SetLocalCurrency(string curr); + ***** + + Example: SetLocalCurrency("electrum"); + + Sets the currency which the vendor will use for doing business. The + currencies should be approved by the approval team. + + ***** + string SetStorageRoom(string room); + ***** + + Example: SetStorageRoom("/domains/Praxis/horace_storage"); + + Identifies the file name of the room in which the vendor will be + storing items for sale. This room should never be accessible to + players. + + ***** + int SetMaxItems(int num); + ***** + + Example: SetMaxItems(60); + + Sets the maximum number of items a vendor can keep in storage at any + given time. Refer to approval documentation for proper numbers for + this. + + ***** + int SetVendorType(int type); + ***** + + Examples: + SetVendorType(VT_WEAPON); + SetVendorType(VT_ARMOUR | VT_WEAPON); + + Sets which types of items a vendor will buy and sell. A list of all + vendor types is in /include/vendor_types.h. You may allow a vendor to + sell multiple types using the | operator. diff -c -r --new-file ds1.1/lib/doc/build/Weapons ds2.0r27/lib/doc/build/Weapons *** ds1.1/lib/doc/build/Weapons Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/build/Weapons Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,212 ---- + Building Weapons + The Nightmare IV LPC Library + written by Descartes of Borg 950429 + + All items in the Nightmare LPC Library (descendants of /lib/item.c) + are weapons. A player can, for example, use a can of spam as a + weapon. However, they are set up as extremely pathetic weapons. This + document describes in detail how to make an object into a real weapon. + + I. Basic Stuff + The basic weapon is exactly the same as the basic item. You can do + anything to it that can be done to other items. For details on items, + see /doc/build/Items. The simple weapon should look like this: + + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + + static void create() { + item::create(); + SetKeyName("short sword"); + SetId( ({ "sword", "short sword", "a short sword" }) ); + SetAdjectives( ({ "short" }) ); + SetShort("a short sword"); + SetLong("A rusty short sword with specs of blood on it."); + SetVendorType(VT_WEAPON); + SetDamagePoints(1500); + SetClass(12); + SetValue(150); + SetMass(100); + SetWeaponType("blade"); + SetDamageType(BLADE); + } + + The last part is what differs from regular items. Note the functions: + + SetVendorType() + SetClass() + SetWeaponType() + SetDamageType() + + The available vendor types can be found by reading the file + /include/vendor_types.h. Similarly, damage types may be found by + reading /include/damage_types.h. The vendor type states what sort of + stores can carry this item. VT_WEAPON should almost ALWAYS be the + vendor type you give for weapons. + + SetClass() + The class is the basic weapon strength. It is how much damage gets + done without any modification. This number ranges between 1 and 100, + where 1 is a pathetic weapon (the class for basic items) and 100 is + probably bordering on illegal. + + SetWeaponType() + This sets what sort of attack skill the player needs to use this + weapon. The weapon types are: + blade + knife + blunt + projectile + + SetDamageType() + Damage types, again, are found in /include/damage_types.h. This sets + what type of damage is done by this weapon to its victims. + + II. Wield Functions + + mixed SetWield(string | function) + Examples: + SetWield("The short sword feels dull as you wield it."); + SetWield( (: WieldMe :) ); + + If you pass a string to SetWield(), then the player sees that string + whenever they wield the weapon. If, on the other hand, you pass a + function, then that function will get called just before the weapon is + wielded when the player issues the wield command. The function you + pass should be written in the form of: + + int WieldMe(); + + If the function returns 1, then the player can wield the weapon. If + it returns 0, then the player cannot wield the weapon. Note that if + you have a wield function, you are responsible for all messaging to + the player to let the player know that they can/cannot wield the + weapon. Example: + + int WieldMe() { + if( (int)this_player()->ClassMember("fighter") ) { + write("The short sword gives you power as you wield it."); + say((string)this_player()->GetName() + " wields a short sword."); + return 1; + } + else { + write("You are not worthy of this short sword."); + return 0; + } + } + + + III. Modifying Stats and Skills + A common thing people like to do with weapons is temporarily modify a + player's skills. This is done by making use of the function + AddStatBonus() and AddSkillBonus(). Most of the time this is done + through a SetWield() function. + + void AddStatBonus(string stat, function f); + void AddSkillBonus(string stat, function f); + + Examples: + this_player()->AddStatBonus("wisdom", (: CheckStat :)); + this_player()->AddSkillBonus("blade attack", (: CheckSkill :)); + + The functions then have the format: + + int CheckWhatever(string stat_or_skill); + + NOTE: You should always check whether the bonus is still in effect. + For example, make sure the weapon is still wielded if it results from + wielding the weapon. For example: + + #include <lib.h> + + inherit LIB_ITEM; + + int DoWield() + int CheckBlade(string skill); + + static void create() { + ... + SetWield((: DoWield :)); + ... + } + + int DoWield() { + this_player()->AddSkillBonus("blade attack", (: CheckBlade :) ); + write("You wield the short sword."); + say((string)this_player()->GetName() + " wields a short sword."); + return 1; + } + + int CheckBlade(string skill) { + if( !GetWorn() ) { + previous_object()->RemoveSkillBonus("blade", this_object()); + return 0; + } + else return 5; + } + + + In other words, this weapon will give its wielder a blade attack bonus + of 5. Note that you must use previous_object() in CheckBlade() and + NOT this_player() because there is no way of knowing who this_player() + is at the time. You do know, however, that the object calling + CheckBlade() is always the player for whom the skill bonus is made. + Always remember to remove bonuses. + + IV. Modifying Hits + The Nightmare IV LPC Library uses an event driven combat system. With + respect to weapons, a round of combat is broken down into the + following events: + + 1. The person wielding the weapon uses it. + 2. If they cannot hit a motionless target, the round ends. + 3. If the target dodges the attack, the round ends. + 4. eventStrike() is called in the weapon to determine how much damage + the weapon can do. + 5. eventReceiveDamage() is called in the target object. This in turn: + a. Calls eventReceiveDamage() in all armour objects, which each: + i. Calls eventReceiveDamage() in the weapon + ii. The weapon wears down a bit + b. The armour wears down a bit + c. The amount of armour damage absorbed is returned + d. The target objects loses health points. + f. The amount of damage done is returned. + 6. Skill and stat points are added. + + Note the two important functions which get called in weapon.c: + + int eventStrike(object ob); + int eventReceiveDamage(int type, int amount, int unused, mixed limbs); + + By default, eventStrike() returns the value of GetClass(). However, + you can modify this value by overriding the eventStrike(). For + example: + + int eventStrike(object target) { + if( (string)target->GetRace() != "orc" ) return item::eventStrike(target); + message("environment", "The orc slayer makes a nasty sound!", + environment(target)); + return item::eventStrike(target) + random(10); + } + + NOTE: You should always use item::eventStrike() rather than hard coded + values since weapon class deteriorates over time. + + In this example, a random(10) points of extra damage gets done to + orcs. This would be the orc slayer weapon of ancient fame. + + For those familiar with hit functions in the old Nightmare Mudlibs, + this would be roughly equivalent to that. + + Another place where you can make things happen is in + eventDeteriorate() which gets called by eventReceieveDamage(). This is + where a weapon wears down from the shock which armour has absorbed + from it. For weapons, there is not much which can be done here, but + this document points it out for the creative who feel they might be able to do + somthing with it. + + Descartes of Borg + borg@imaginary.com diff -c -r --new-file ds1.1/lib/doc/efun/all/TODO ds2.0r27/lib/doc/efun/all/TODO *** ds1.1/lib/doc/efun/all/TODO Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/TODO Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + query_ip_port(void|object) [PACKAGE_CONTRIB] + mixed query_notify_fail() [!NO_ADD_ACTION] [PACKAGE_CONTRIB] + int remove_interactive(object) [PACKAGE_CONTRIB] + int remove_shadow(object ob) [!NO_SHADOWS] [PACKAGE_CONTRIB] + int replaceable(object, void | string array) [PACKAGE_CONTRIB] + float array rotate_x(float array, float) [PACKAGE_MATRIX] + float array rotate_y(float array, float) [PACKAGE_MATRIX] + float array rotate_z(float array, float) [PACKAGE_MATRIX] + float array scale(float array, float) [PACKAGE_MATRIX] + void set_this_player(object | int) [NO_ADD_ACTION] + void store_variable(string, mixed) [PACKAGE_CONTRIB] + string terminal_colour(string, mapping) [PACKAGE_CONTRIB] + float array translate(float array, float, float, float) [PACKAGE_MATRIX] + mapping unique_mapping(array, string|function, ...) + string upper_case(string) [PACKAGE_CONTRIB] + string array variables(object, int default: 0); [PACKAGE_CONTRIB] diff -c -r --new-file ds1.1/lib/doc/efun/all/acos ds2.0r27/lib/doc/efun/all/acos *** ds1.1/lib/doc/efun/all/acos Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/acos Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + acos - return the arccosine of a float + + float acos( float f ); + + This efun is available only if PACKAGE_MATH is compiled in to the driver. + + Returns the arccosine of its argument, `f', measured in radians. + + See also: + asin, + atan, + cos, + sin, + tan diff -c -r --new-file ds1.1/lib/doc/efun/all/add_action ds2.0r27/lib/doc/efun/all/add_action *** ds1.1/lib/doc/efun/all/add_action Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/add_action Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,49 ---- + add_action - bind a command verb to a local function + + void add_action( string | function fun, string | string array cmd ); + + void add_action( string | function fun, string | string array cmd, int flag ); + + This efun is only available if NO_ADD_ACTION isn't defined. + + Set up a function 'fun' to be called the a user types the command 'cmd'. + (What is the command is determined by the first 'word' which consists + of all the characters before the first space, with the exception of + verbs that don't need a space; see below). + + If 'cmd' is an array, then that function will be called for any of the + commands in the array. 'fun' can either be a string which is the name + of a function in the object adding the command, or a function pointer. + + Functions called by a user command will get the rest of the command line + as a string. It must then return 0 if it was the wrong command, otherwise 1. + If 1 is returned, no further parsing is done; if 0 is returned, other + commands will be checked (possibly the same command added by a different + object). If no command is found, the default error message will be sent + to the player (traditionally, 'What?' but see also notify_fail()) + + For functions which can be called by more than one command, check query_verb() + to see which command was used. + + Note: add_action() does not add commands globally; it only adds commands to + this_user(), and the object must be 'close' to the user it is adding commands + to. + + Usually add_action() is called only from an init() routine. The object that + defines commands must be 'close' to the user, either being the user, + being carried by the user, being the room around the user, or being an + object in the same room as the user. + + Since init() is called when a user moves 'close' to an object, it is a + convenient time to add such commands. The commands are removed when the + user moves out of range (or the object does). + + If argument 'flag' is 1, then only the leading characters of the command has + to match the verb 'cmd' and the entire verb is returned by query_verb(). If + argument 'flag' is 2, then again, only the leading characters must match, + but query_verb() will only return the characters following 'cmd'. + + See also: + query_verb, + remove_action, + init diff -c -r --new-file ds1.1/lib/doc/efun/all/all_inventory ds2.0r27/lib/doc/efun/all/all_inventory *** ds1.1/lib/doc/efun/all/all_inventory Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/all_inventory Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + all_inventory - return the inventory of an object + + object array all_inventory( object ob ); + + This efun is only available if NO_ENVIRONMENT is not compiled into the driver. + + Returns an array of the objects contained inside of 'ob'. If 'ob' is + omitted, this_object() is used. + + See also: + deep_inventory, + environment + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/all_previous_objects ds2.0r27/lib/doc/efun/all/all_previous_objects *** ds1.1/lib/doc/efun/all/all_previous_objects Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/all_previous_objects Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,17 ---- + all_previous_objects - returns an array of objects that called the current function + + object array all_previous_objects(); + + Returns an array of objects that called current function. + Note that local function calls do not set previous_object() to the current + object, but leave it unchanged. + + The first element of the array is previous_object(), followed by + previous_object(1), etc ... + + See also: + call_other, + origin, + previous_object + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/allocate ds2.0r27/lib/doc/efun/all/allocate *** ds1.1/lib/doc/efun/all/allocate Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/allocate Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + allocate - allocate an array + + array allocate( int size ); + + Allocate an array of <size> elements. The number of elements must be >= 0 + and not bigger than a system maximum (usually ~10000). All elements are + initialized to 0. + + See also: + sizeof, + allocate_mapping + diff -c -r --new-file ds1.1/lib/doc/efun/all/allocate_buffer ds2.0r27/lib/doc/efun/all/allocate_buffer *** ds1.1/lib/doc/efun/all/allocate_buffer Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/allocate_buffer Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,17 ---- + allocate_buffer - allocate a buffer + + buffer allocate_buffer( int size ); + + This efun is only available if DISALLOW_BUFFER_TYPE is not compiled in. + + Allocate a buffer of 'size' elements. The number of elements must be >= 0 + and not bigger than a system maximum (usually ~10000). All elements are + initialized to 0. + + See also: + bufferp, + read_buffer, + write_buffer + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/all/allocate_mapping ds2.0r27/lib/doc/efun/all/allocate_mapping *** ds1.1/lib/doc/efun/all/allocate_mapping Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/allocate_mapping Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,27 ---- + allocate_mapping - pre-allocate space for a mapping + + mapping allocate_mapping( int size ); + + Returns a mapping with space for 'size' elements preallocated. + + For example: + + <pre> + mapping x; + int y = 200; + + x = allocate_mapping(y); + </pre> + + where y is the initial size of the mapping. Using allocate_mapping is + the preferred way to initalize the mapping if you have some idea of how + many elements the map will contain (200 in this case). The reason is that + allocating storage all at once is slightly more efficient. Thus if + you are using mappings to store a soul with 200 entries, the above + initialization would be quite appropriate. Note, that the + above initialization does not restrict you to 200 entries. + + See also: + map_delete + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/arrayp ds2.0r27/lib/doc/efun/all/arrayp *** ds1.1/lib/doc/efun/all/arrayp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/arrayp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,8 ---- + arrayp - determine whether or not a given variable is an array + + int arrayp( mixed arg ); + + Return 1 if `arg' is an array, zero otherwise. + + See also: + typeof diff -c -r --new-file ds1.1/lib/doc/efun/all/asin ds2.0r27/lib/doc/efun/all/asin *** ds1.1/lib/doc/efun/all/asin Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/asin Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + asin - return the arcsine of a float + + float asin( float f ); + + This efun is only available if PACKAGE_MATH is compiled in. + + Returns the arcsine of its argument, `f', measured in radians. + + See also: + acos, + atan, + cos, + sin, + tan diff -c -r --new-file ds1.1/lib/doc/efun/all/atan ds2.0r27/lib/doc/efun/all/atan *** ds1.1/lib/doc/efun/all/atan Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/atan Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + atan - return the tangent of a float + + float atan( float f ); + + This efun is only available if PACKAGE_MATH is not compiled in. + + Returns the arctangent of its argument, `f', measured in radians. + + See also: + acos, + asin, + cos, + sin, + tan diff -c -r --new-file ds1.1/lib/doc/efun/all/author_stats ds2.0r27/lib/doc/efun/all/author_stats *** ds1.1/lib/doc/efun/all/author_stats Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/author_stats Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,43 ---- + author_stats - returns statistics gathered on authors + + mapping author_stats( string domain); + + This efun is only avaiable if PACKAGE_MUDLIB_STATS is compiled in. + + Both domain_stats() and author_stats() return information stored in a + mapping. If no argument is specified, then information is returned on + all domains (or on all authors) with one map entry per domain or author. + If an argument is specified, then a map is returned that corresponds to + that domain or author with keys: moves, cost, errors, heart_beats, + array_size, and objects. Each of these map to integer values. + Moves is the number of objects that have moved into objects in the + given domain. Cost is the number of evaluations (eval_cost) accumulated + by objects with the given domain (or author). Errors is the number of errors + incurred by objects with the given domain. Heart_beats is the number of + heartbeat calls made on objects having the given domain. + Array_size is the size (in bytes) of the arrays allocated by the domain. + Objects is the number of objects created by the given domain. When called + with no arguments, the returned mapping has a form like this: + + <pre> + ([ domain0 : info0, domain1 : info1, ... ]) + </pre> + + while info0 has the form: + + <pre> + ([ "moves" : moves, "cost" : cost, "errors" : errors, + "heart_beats" : heart_beats, "worth" : worth, + "array_size" : array_size, "objects" : objects ]) + </pre> + + When called with an argument, the returned mapping will have the form of + info0. + + See also: + domain_file, + author_file, + set_author + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/all/bind ds2.0r27/lib/doc/efun/all/bind *** ds1.1/lib/doc/efun/all/bind Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/bind Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + bind - bind a function pointer to a new object + + function bind(function, object); + + bind() causes a function to become owned by the new object. This changes + the value of this_object() when the function pointer is evaluated. Functions + that reference global variables or functions in the object that created + them cannot be rebound. Binding a function to the object it is already + bound to will never fail. + + Permission to use this efun is controlled by the valid_bind() master apply. + + See also: + function_owner, + valid_bind diff -c -r --new-file ds1.1/lib/doc/efun/all/bufferp ds2.0r27/lib/doc/efun/all/bufferp *** ds1.1/lib/doc/efun/all/bufferp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/bufferp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,7 ---- + bufferp - determine whether or not a given variable is a buffer + + int bufferp( mixed arg ); + + Return 1 if `arg' is a buffer value and zero otherwise. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/cache_stats ds2.0r27/lib/doc/efun/all/cache_stats *** ds1.1/lib/doc/efun/all/cache_stats Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/cache_stats Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + cache_stats - report various driver and mudlib statistics + + string cache_stats(); + + This efun is only available if CACHE_STATS is defined in options.h at + driver build time. This efun returns a string containing a summary + of the statstics on the call_other() cache hit rate. + + See also: + opcprof, + mud_status + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/call_other ds2.0r27/lib/doc/efun/all/call_other *** ds1.1/lib/doc/efun/all/call_other Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/call_other Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,55 ---- + call_other - call a function in another object + + mixed call_other(mixed ob, string func, ...); + + mixed call_other(mixed ob, array args); + + mixed call_other(array obs, string func, ...); + + mixed call_other(array obs, array args); + + ob is either an object pointer, or a string filename (suitable for + find_object()). obs is an array of object pointers and strings. + Using an array as the first argument does a call_other for each element of + the array, and returns an array of the results. + If the array form is used for args, then the first element is the function + name, and the remainder are the arguments; e.g.: + + call_other(ob, ({ "foo", 1, 3, 5 })) + + and + + call_other(ob, "foo", 1, 3, 5) + + are equivalent. The function foo() is called in the object ob with the + arguments (1, 3, 5). The return value of call_other() is the value + returned from the foo() function. In the case of an array of objects, + the return value of call_other() is an array of the return values. + + There is a much more attractive way to do call_others; + call_other(x, "y", z, ...) is the same as: + + x->y(z, ...) + + ie, + + call_other(ob, "query_name"); + + could be written as: + + ob->query_name(); + + Writing out the call_other call is mainly used when the function name + is in a variable, i.e: + + <pre> + void do_test(string fname, int x) { + call_other(fname, "test_" + x); + } + </pre> + + An example of using an array as the first argument: + + users()->quit(); + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/call_out ds2.0r27/lib/doc/efun/all/call_out *** ds1.1/lib/doc/efun/all/call_out Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/call_out Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,26 ---- + call_out - delayed function call in same object + + int call_out( function fun, int delay, mixed arg, ... ); + + Set up a call to 'fun'. If fun is a string, it is interpreted as the + name of a function in this_object(). The call will take place 'delay' + seconds later, with the arguments 'arg' and following provided. + + Note: + Unless THIS_PLAYER_IN_CALL_OUT is defined, you can't rely on + write() or say() in 'fun' since this_player() is set to 0. + Use tell_object() instead. + + If THIS_PLAYER_IN_CALL_OUT is defined, this_player() is the same as + it was when the call_out() call was scheduled. + + The return value will be a unique integer identifying the call_out, if + CALLOUT_HANDLES is defined. This 'handle' can be passed to + remove_call_out() and find_call_out(). + + See also: + remove_call_out, + call_out_info, + find_call_out + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/call_out_info ds2.0r27/lib/doc/efun/all/call_out_info *** ds1.1/lib/doc/efun/all/call_out_info Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/call_out_info Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,21 ---- + call_out_info - get pending call_out() information + + array call_out_info(); + + Get information about all pending call outs. An array is returned, + where every item in the array consists 3 elements: the object, + the function, and the remaining delay. + + Note: due to security concerns, and the fact that call_outs may now + have an arbitrary number of arguments, the 4th element of the return + value was returned. The security concerns stem from the fact that if + the arguments where types which can be modified (arrays, mappings, + etc), obtaining them would allow them to be modified before the + function was called. It is possible this will be fixed in the + future if there is enough interest. + + See also: + call_out, + remove_call_out + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/call_stack ds2.0r27/lib/doc/efun/all/call_stack *** ds1.1/lib/doc/efun/all/call_stack Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/call_stack Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + call_stack - returns information about the functions involved in calling this function + + array call_stack(int); + + If the int argument is 0, call_stack() returns an array of the names of the + on the call stack, with the first one being the most recent (i.e. the + currently running program). If the int argument is 1, call_stack returns + the objects in which that program is executing. If it is 2, the name + of the functions are returned. If it is 3, the value of origin() in that + frame is returned. + + See also: + previous_object, + origin diff -c -r --new-file ds1.1/lib/doc/efun/all/capitalize ds2.0r27/lib/doc/efun/all/capitalize *** ds1.1/lib/doc/efun/all/capitalize Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/capitalize Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + capitalize - capitalize a string + + string capitalize( string str ); + + Convert the first character in 'str' to upper case, and return the + new string. + + See also: + lower_case + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/catch ds2.0r27/lib/doc/efun/all/catch *** ds1.1/lib/doc/efun/all/catch Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/catch Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,24 ---- + catch - catch an evaluation error + + mixed catch( mixed expr ); + + mixed catch { ... }; + + Note: catch is really a keyword and not an efun. + + The code inside the { ... } or the expression is evaluated. If there + is no error, catch() returns zero. If there is an error, a string (with + a leading '*') will be returned. + + The function throw() can also be used to immediately return any value, + except 0. + + The catch() is somewhat costly, and should not be used just anywhere. + Rather, use it at places where an error would destroy consistency. + + See also: + error, + throw, + error_handler + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/ceil ds2.0r27/lib/doc/efun/all/ceil *** ds1.1/lib/doc/efun/all/ceil Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/ceil Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + ceil - round a float up to the nearest integer + + float ceil( float f ); + + This efun is only available if PACKAGE_MATH is compiled in. + + Returns (as a float) the nearest integer number equal to or greater than f. + + See also: + floor, + to_int, + to_float + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/check_memory ds2.0r27/lib/doc/efun/all/check_memory *** ds1.1/lib/doc/efun/all/check_memory Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/check_memory Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + check_memory - check all allocated blocks + + string check_memory(int flag) + + returns a string describing possible memory allocation problems. If the + optional flag is 1, a summary of allocated memory is printed at the + end. + + This efun is only available if PACKAGE_DEVELOP, DEBUGMALLOC, and + DEBUGMALLOC_EXTENSIONS are defined. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/children ds2.0r27/lib/doc/efun/all/children *** ds1.1/lib/doc/efun/all/children Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/children Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + children - returns an array of objects cloned from a given file + + object array children( string name ); + + This efun returns an array of objects that have been loaded or cloned from + the file named by 'name' (including the object 'name' itself, if loaded). + + See also: + deep_inherit_list, + inherit_list, + objects + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/classp ds2.0r27/lib/doc/efun/all/classp *** ds1.1/lib/doc/efun/all/classp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/classp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,7 ---- + classp - determine whether or not a given variable is a class + + int classp(mixed); + + Return 1 if the argument is a class. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/clear_bit ds2.0r27/lib/doc/efun/all/clear_bit *** ds1.1/lib/doc/efun/all/clear_bit Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/clear_bit Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + clear_bit - zero a bit in a bit string + + string clear_bit( string str, int n ); + + Return the new string where bit 'n' is cleared in string 'str'. Note that + the old string 'str' is not modified. See set_bit() for information on + the format of the string. + + See also: + set_bit, + test_bit + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/clone_object ds2.0r27/lib/doc/efun/all/clone_object *** ds1.1/lib/doc/efun/all/clone_object Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/clone_object Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,18 ---- + clone_object - load a copy of an object + + object clone_object( string name, ... ); + + object new( string name, ... ); + + Create a new object from the file 'name', and give it a new unique + name (by adding #xxx on to the end of the name). Returns the new object. + The object shares the program of the object 'name', but has its own + set of variables. The second and following arguments are passed to + create() + + See also: + destruct, + move_object, + new + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/clonep ds2.0r27/lib/doc/efun/all/clonep *** ds1.1/lib/doc/efun/all/clonep Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/clonep Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,24 ---- + clonep - determine whether or not a given variable points to a cloned object + + int clonep(); + + int clonep(mixed arg); + + Returns true (1) iff the argument is objectp() and the O_CLONE flag is set. + The driver sets the O_CLONE flag for those objects created via new() + (clone_object()). The clonep() efun will not return true when called on + objects that are the blueprint copy (those that are loaded via call_other() + or load_object()). + + Note that if clonep() returns true, then file_name() will return a string + containing a '#'. clonep() defaults to this_object(). + + See also: + objectp, + new, + clone_object, + call_other, + file_name + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/all/command ds2.0r27/lib/doc/efun/all/command *** ds1.1/lib/doc/efun/all/command Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/command Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + command - execute a command as if given by the object + + int command( string str ); + + This efun is only available if NO_ADD_ACTION isn't defined. + + Execute 'str' for the object this_object() as a command (matching against + add_actions and such). The object must have called enable_commands() for + this to have any effect. + In case of failure, 0 is returned, otherwise a numeric value is returned, + which is the LPC "evaluation cost" of the command. Bigger numbers mean + higher cost, but the whole scale is subjective and unreliable. + + See also: + add_action, + enable_commands diff -c -r --new-file ds1.1/lib/doc/efun/all/commands ds2.0r27/lib/doc/efun/all/commands *** ds1.1/lib/doc/efun/all/commands Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/commands Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,17 ---- + commands - returns some information about actions the user can take + + array commands(); + + This efun is only available if NO_ADD_ACTION is not defined. + + Returns an array of an array of 4 items describing the actions that + are available to this_object(). The first item is the command + itself (as passed to add_action()). The second is the set of + flags (passed to add_action as the third argument, often defaulted + to 0). The third is the object that defined the action. The fourth + is the function to be called ("<function>" if it is a function pointer). + + See also: + add_action, + enable_commands, + disable_commands diff -c -r --new-file ds1.1/lib/doc/efun/all/copy ds2.0r27/lib/doc/efun/all/copy *** ds1.1/lib/doc/efun/all/copy Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/copy Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,22 ---- + copy - recursively duplicate a value + + mixed copy(mixed); + + copy() returns a value with exactly the same value as its argument, but with + all reference types (mappings, arrays, etc) duplicated. For example: + + mapping a, b = ({ 1 }); + a = b; + a[0] = 2; + printf("%O %O\n", a, b); + + results in ({ 2 }) and ({ 2 }), while: + + mapping a, b = ({ 1 }); + a = copy(b); + a[0] = 2; + printf("%O %O\n", a, b); + + results in ({ 2 }) and ({ 1 }). + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/cos ds2.0r27/lib/doc/efun/all/cos *** ds1.1/lib/doc/efun/all/cos Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/cos Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + cos - return the cosine of a float + + float cos( float f ); + + This efun is only available if PACKAGE_MATH is compiled into the driver. + + Returns the cosine of its argument, `f', measured in radians. + + See also: + acos, + asin, + atan, + sin, + tan + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/cp ds2.0r27/lib/doc/efun/all/cp *** ds1.1/lib/doc/efun/all/cp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/cp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + cp - copy a file + + int cp(string src, string dst); + + Copies the file 'src' to the file 'dst'. + + Returns 1 for success, returns -1 if the first src is unreadable, -2 if + dst is unreadable, and -3 if an i/o error occurs. + + See also: + rm, + rmdir, + rename, + link + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/crc32 ds2.0r27/lib/doc/efun/all/crc32 *** ds1.1/lib/doc/efun/all/crc32 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/crc32 Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,7 ---- + crc32 - compute the cycle redundancy code for a buffer or string + + int crc32( buffer | string x ); + + Computes and returns the CRC-32 code for the given buffer or string, `x'. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/crypt ds2.0r27/lib/doc/efun/all/crypt *** ds1.1/lib/doc/efun/all/crypt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/crypt Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,10 ---- + crypt - encrypt a string + + string crypt( string str, string seed ); + + Crypt the string 'str' using the first two characters from 'seed' as + a seed. If 'seed' is 0, then random seed is used. + + The result has the first two characters as the seed. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/ctime ds2.0r27/lib/doc/efun/all/ctime *** ds1.1/lib/doc/efun/all/ctime Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/ctime Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + ctime - return a time string + + string ctime( int clock ); + + Gives a nice string with current date and time, with the argument 'clock' + that is the number of seconds since 1970. + + See also: + time, + localtime, + uptime + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/debug_info ds2.0r27/lib/doc/efun/all/debug_info *** ds1.1/lib/doc/efun/all/debug_info Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/debug_info Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,93 ---- + debug_info - display debug information + + string debug_info( int operation, ... ); + + string debug_info( 0, object ob ); + + string debug_info( 1, object ob ); + + string debug_info( 2, object ob ); + + This efun is only available if PACKAGE_DEVELOP is compiled into the driver. + + debug_info() is a general-purpose facility which may be used to debug the + MudOS driver. The debugging information requested is determined by the + first argument. Successive arguments are determine by the operation selected. + + The existing operations (0 , 1 and 2) require a second object type argument, + and may be used to display the various fields of the MudOS object structure. + + The following LPC code was used to generate the sample output: + + <pre> + + create() { + write(debug_info(0, this_object())); + } + </pre> + + gives: + + <pre> + O_HEART_BEAT : FALSE + O_IS_WIZARD : FALSE + O_ENABLE_COMMANDS : FALSE + O_CLONE : FALSE + O_DESTRUCTED : FALSE + O_SWAPPED : FALSE + O_ONCE_INTERACTIVE: FALSE + O_RESET_STATE : FALSE + O_WILL_CLEAN_UP : FALSE + O_WILL_RESET: TRUE + total light : 0 + next_reset : 720300560 + time_of_ref : 720299416 + ref : 2 + swap_num : -1 + name : 'u/c/cynosure/di0' + next_all : OBJ(bin/dev/_update) + This object is the head of the object list. + </pre> + + <hr> + + <pre> + + create() { + write(debug_info(1, this_object())); + } + </pre> + + gives: + + <pre> + program ref's 1 + Name u/c/cynosure/di1.c + program size 10 + num func's 1 (16) + num strings 0 + num vars 0 (0) + num inherits 0 (0) + total size 104 + </pre> + + <hr> + + <pre> + + create() { + write(debug_info(2, this_object())); + } + </pre> + + gives: + + <pre> + x: "foo" + </pre> + + See also: + dump_file_descriptors, + dump_socket_status + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/debugmalloc ds2.0r27/lib/doc/efun/all/debugmalloc *** ds1.1/lib/doc/efun/all/debugmalloc Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/debugmalloc Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + debugmalloc - dumps information on malloc'd memory to a file + + void debugmalloc(string filename, int mask); + + This efun is only available when PACKAGE_DEVELOP, DEBUGMALLOC and DEBUGMALLOC_EXTENSIONS are + both defined in options.h at driver build time. The debugmalloc() efun + will dump information on those chunks of memory allocated by DMALLOC() and + related macros if the bitwise and (&) with the tag supplied by the macro + (i.e. (mask & tag)) is non-zero. Read md.c and config.h in the + driver source for more information. + + See also: + set_malloc_mask + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/deep_inherit_list ds2.0r27/lib/doc/efun/all/deep_inherit_list *** ds1.1/lib/doc/efun/all/deep_inherit_list Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/deep_inherit_list Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + deep_inherit_list - get a list of ancestors of an object + + string array deep_inherit_list( object obj ); + + Returns an array of filenames of all objects inherited (directly and + indirectly) by obj. + + See also: + inherit_list, + inherits + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/deep_inventory ds2.0r27/lib/doc/efun/all/deep_inventory *** ds1.1/lib/doc/efun/all/deep_inventory Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/deep_inventory Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + deep_inventory - return the nested inventory of an object + + object array deep_inventory( object ob ); + + This efun is only available when NO_ENVIRONMENT is not compiled into the + driver. + + Returns an array of the objects contained in the inventory of 'ob' and + also all the objects contained in the inventories of those objects and so on. + + See also: + all_inventory + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/destruct ds2.0r27/lib/doc/efun/all/destruct *** ds1.1/lib/doc/efun/all/destruct Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/destruct Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + destruct - remove an object + + void destruct( object ob ); + + Completely destroy and remove object 'ob'. After the call to destruct(). + If 'ob' is this_object(), execution will continue, but it is best to return + a value immediately. All pointers to the object in any variable or structure + will immediately become zero. move_or_destruct() is called in all the + objects inside of the object being destructed. + + See also: + clone_object, + new, + move_or_destruct + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/disable_commands ds2.0r27/lib/doc/efun/all/disable_commands *** ds1.1/lib/doc/efun/all/disable_commands Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/disable_commands Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,10 ---- + disable_commands - makes a living object non-living + + void disable_commands(); + + This efun is only available if NO_ADD_ACTION is not defined. + + Causes the current object to no longer be able to execute commands. + + See also: + enable_commands diff -c -r --new-file ds1.1/lib/doc/efun/all/disable_wizard ds2.0r27/lib/doc/efun/all/disable_wizard *** ds1.1/lib/doc/efun/all/disable_wizard Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/disable_wizard Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + disable_wizard - remove wizard priveleges from an object + + void disable_wizard(); + + This efun is only available if NO_WIZARDS is not defined. + + The opposite of enable_wizard(). Disables wizard privileges from the + current object. + + See also: + enable_wizard, + wizardp diff -c -r --new-file ds1.1/lib/doc/efun/all/domain_stats ds2.0r27/lib/doc/efun/all/domain_stats *** ds1.1/lib/doc/efun/all/domain_stats Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/domain_stats Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,42 ---- + domain_stats - returns statistics gathered on domains + + mapping domain_stats( string domain ); + + This efun is only available if PACKAGE_MUDLIB_STATS is compiled into the driver. + + Both domain_stats() and author_stats() return information stored in a + mapping. If no argument is specified, then information is returned on + all domains (or on all authors) with one map entry per domain or author. + If an argument is specified, then a map is returned that corresponds to + that domain or author with keys: moves, cost, errors, heart_beats, + array_size, and objects. Each of these map to integer values. + Moves is the number of objects that have moved into objects in the + given domain. Cost is the number of evaluations (eval_cost) accumulated + by objects with the given domain (or author). Errors is the number of errors + incurred by objects with the given domain. Heart_beats is the number of + heartbeat calls made on objects having the given domain. + Array_size is the size (in bytes) of the arrays allocated by the domain. + Objects is the number of objects created by the given domain. When called + with no arguments, the returned mapping has a form like this: + + <pre> + ([ domain0 : info0, domain1 : info1, ... ]) + </pre> + + while info0 has the form: + + <pre> + ([ "moves" : moves, "cost" : cost, "errors" : errors, + "heart_beats" : heart_beats, "worth" : worth, + "array_size" : array_size, "objects" : objects ]) + </pre> + + When called with an argument, the returned mapping will have the form of + info0. + + See also: + domain_file, + author_file, + set_author + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/dump_file_descriptors ds2.0r27/lib/doc/efun/all/dump_file_descriptors *** ds1.1/lib/doc/efun/all/dump_file_descriptors Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/dump_file_descriptors Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,32 ---- + dump_file_descriptors - dump the MudOS process file descriptor table + + string dump_file_descriptors(); + + This function is provided to assist in debugging the MudOS driver and + helps overcome deficiencies in some UN*X implementations which do not + provide equivalent or superior debugging facilities as part of the + operating system itself. The interpretation of the output is very + system-dependent. Each file descriptor is checked to determine whether + it refers to an open file. If so, information is displayed from the + "stat structure" returned by the fstat() system call. + + The following output was produced on Lambda Realms running on a Sequent + DYNIX/ptx system: + + <pre> + Fd Device Number Inode Mode Uid Gid Size + -- ------------- ----- ------ ----- ----- ---------- + 0 3 2 10319 c 666 0 3 0 + 1 79 7 164598 f 644 2862 1 789522 + 2 79 7 164598 f 644 2862 1 789522 + 3 40 33b 6925 c 0 2862 1 0 + 4 40 2a4 6943 c 0 2862 1 0 + 5 79 7 164599 f 600 2862 1 44784 + 6 40 2e2 145996 c 0 2862 1 0 + 7 79 7 164601 f 644 2862 1 506 + </pre> + + See also: + dump_socket_status + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/dump_prog ds2.0r27/lib/doc/efun/all/dump_prog *** ds1.1/lib/doc/efun/all/dump_prog Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/dump_prog Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,21 ---- + dump_prog - dump/disassemble an LPC object + + void dump_prog( object ob, int flags, string file ); + + This efun is only available when PACKAGE_DEVELOP is compiled into the driver. + + dump_prog() dumps information about the program of `obj' to a file, + `file', or "/PROG_DUMP" if `file' is not given. If the current object + does not have write access to the file, it fails. + + Flags can be a combination of the following values: + <DL> + * 1 - include a disassembly of the i-code + * 2 - include line number information + </DL> + + See also: + debug_info, + dumpallobj + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/dump_socket_status ds2.0r27/lib/doc/efun/all/dump_socket_status *** ds1.1/lib/doc/efun/all/dump_socket_status Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/dump_socket_status Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,54 ---- + dump_socket_status - display the status of each LPC socket + + string dump_socket_status(); + + This efun is only available when PACKAGE_SOCKETS is compiled into the driver. + + dump_socket_status() is a diagnostic facility which displays the current + status of all LPC sockets configured into the MudOS driver. It is useful + for debugging LPC sockets applications. Each row in the output corresponds + to a single LPC socket. The first row corresponds to LPC socket descriptor 0, + the second row, 1, etc. The total number of sockets is configured when the + driver is built. + + The first column "Fd" is the operating system file descriptor associated + with the LPC socket. "State" is the current operational state of the LPC + socket. "Mode" is the socket mode, which is passed as an argument to + socket_create(). The local and remote addresses are the Internet address + and port numbers in Internet dot notations. '*' indicates an address or + which is 0. N.B. LPC sockets that are in the CLOSED state are not + currently in use; therefore the data displayed for that socket may be + idiosyncratic. + + The following output was generated on Portals, where the only socket + application running at the time was MWHOD. It indicates that two + sockets are current in use, one is listening for connection requests + on a STREAM mode socket. The other is waiting for incoming data on + a DATAGRAM mode socket. + + <pre> + Fd State Mode Local Address Remote Address + -- --------- -------- ----------------- ------------------ + 13 LISTEN STREAM *.6889 *.* + 14 BOUND DATAGRAM *.6888 *.* + -1 CLOSED MUD *.* *.* + -1 CLOSED MUD *.* *.* + -1 CLOSED MUD *.* *.* + -1 CLOSED MUD *.* *.* + -1 CLOSED MUD *.* *.* + -1 CLOSED MUD *.* *.* + -1 CLOSED MUD *.* *.* + -1 CLOSED MUD *.* *.* + -1 CLOSED MUD *.* *.* + -1 CLOSED MUD *.* *.* + -1 CLOSED MUD *.* *.* + -1 CLOSED MUD *.* *.* + -1 CLOSED MUD *.* *.* + -1 CLOSED MUD *.* *.* + </pre> + + See also: + debug_info, + dump_file_descriptors + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/dumpallobj ds2.0r27/lib/doc/efun/all/dumpallobj *** ds1.1/lib/doc/efun/all/dumpallobj Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/dumpallobj Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + dumpallobj - report various statistics on all objects that have been loaded + + void dumpallobj(); + + void dumpallobj( string ); + + This function dumps a list of statistics on all objects that have been loaded. + If no argument is specified, then the information will be dumped to a file + named /OBJ_DUMP. If an argument is specified, then that name is used as + the filename for the dump. + + See also: + mud_status, + debug_info + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/ed ds2.0r27/lib/doc/efun/all/ed *** ds1.1/lib/doc/efun/all/ed Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/ed Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,39 ---- + ed - edit a file + + This efun is only available if OLD_ED is defined. + + void ed( string file, string exit_fn, int restricted ); + + void ed( string file, string write_fn, string exit_fn, int restricted ); + + This is a funny function. It will start a local editor on an optional + file. This editor is almost UNIX ed compatible. When in the editor + type 'h' for help. + + The 'write_fn' function allows the mudlib to handle file locks and + administrative logging of files modified. When the editor writes to a + file, the driver will callback the 'write_fn' function twice. The first + time, the function is called before the + write takes place -- 'flag' will be 0. If the function returns 1, + the write will continue, + otherwise it will abort. The second time, the function is called + after the write has completed -- 'flag' will be non-zero. + This callback function should have the form: + + int write_fn(string fname, int flag) + + When the editor is exited, the driver will callback the 'exit_fn' + function. This function allows the mudlib to clean up. This + callback function has the form: + + void exit_fn() + + The optional 'restricted' flag limits the editor's + capabilities, such as inserting a file, and saving using an alternate + file name. + + See also: + regexp, + valid_read, + valid_write, + get_save_file_name diff -c -r --new-file ds1.1/lib/doc/efun/all/ed_cmd ds2.0r27/lib/doc/efun/all/ed_cmd *** ds1.1/lib/doc/efun/all/ed_cmd Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/ed_cmd Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + ed_cmd - perform an 'ed' command + + This efun is only available if OLD_ED is not defined. + + string ed_cmd(string cmd); + + Performs the ed command 'cmd'. The result of the command is returned. + Ed must have been started with ed_start() in order to call this efun. + + See also: + ed_start diff -c -r --new-file ds1.1/lib/doc/efun/all/ed_start ds2.0r27/lib/doc/efun/all/ed_start *** ds1.1/lib/doc/efun/all/ed_start Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/ed_start Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,22 ---- + ed_start - start up 'ed' + + This efun is only available if OLD_ED is not defined. + + string ed_start(string file, int flag); + + string ed_start(string file); + + string ed_start(); + + If 'flag' is nonzero, ed is started in restricted mode. See the documentation + for the old efun for information. 'file' is the name of the file to open; + if none is given then no file becomes active. + + ed_start() may not be called when another ed session for the current + object is already active. Any messages generated while starting up ed + are returned by this efun. + + See also: + ed, + ed_cmd, + query_ed_mode diff -c -r --new-file ds1.1/lib/doc/efun/all/enable_commands ds2.0r27/lib/doc/efun/all/enable_commands *** ds1.1/lib/doc/efun/all/enable_commands Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/enable_commands Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,18 ---- + enable_commands - allow object to use 'player' commands + + void enable_commands(); + + This efun is only available if NO_ADD_ACTION is not defined. + + enable_commands() marks this_object() as a living object, and allows + it to use commands added with add_action() (by using command()). + When enable_commands() is called, the driver also looks for the + local function catch_tell(), and if found, it will call it every time + a message (via say() for example) is given to the object. + + See also: + living, + add_action, + command, + catch_tell, + say diff -c -r --new-file ds1.1/lib/doc/efun/all/enable_wizard ds2.0r27/lib/doc/efun/all/enable_wizard *** ds1.1/lib/doc/efun/all/enable_wizard Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/enable_wizard Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,29 ---- + enable_wizard - give wizard priveleges to an object + + void enable_wizard(); + + Available only if NO_WIZARDS isn't defined. + + Any interactive object that calls enable_wizard() will cause wizardp() + to return true if called on that object. enable_wizard() gives three + privileges to the interactive object in question: + + <DL> + * ability to use restricted modes of ed when the RESTRICTED_ED option + is compiled into the driver. + * + privilege of receiving descriptive runtime error messages. + * + privilege of using the trace() and traceprefix() efuns. + <DL> + + If you don't use this, ed() must be explicitly restricted when necessary, + an error_handler should be implemented to give appropriate messages if you + don't want all users to get descriptive error traces, and trace() and + traceprefix() should be restricted via simul_efuns, if necessary. + + See also: + disable_wizard, + wizardp + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/environment ds2.0r27/lib/doc/efun/all/environment *** ds1.1/lib/doc/efun/all/environment Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/environment Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + environment - return the environment of an object + + object environment( object ob ); + + This efun is only available if NO_ENVIRONMENT is not compiled in. + + Return the containing object (environment) of 'ob'. If no argument + is given, 'ob' defaults to this_object(). If the object is not + inside anything, zero is returned. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/error ds2.0r27/lib/doc/efun/all/error *** ds1.1/lib/doc/efun/all/error Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/error Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + error - generate a run-time error + + void error( string err ); + + A run-time error 'err' will be generated when error() is called. Execution + of the current thread will halt, and the trace will be recorded to the + debug log. + + See also: + catch, + throw, + error_handler + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/eval_cost ds2.0r27/lib/doc/efun/all/eval_cost *** ds1.1/lib/doc/efun/all/eval_cost Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/eval_cost Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + eval_cost - returns the evaluation cost remaining + + void eval_cost() + + eval_cost() returns the number of instructions that can be executed + before the driver decides it is in an infinite loop. + + See also: + set_eval_limit, + reset_eval_cost + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/evaluate ds2.0r27/lib/doc/efun/all/evaluate *** ds1.1/lib/doc/efun/all/evaluate Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/evaluate Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,8 ---- + evaluate - evaluate a function pointer + + mixed evaluate(mixed f, ...); + + If f is a function, f is called with the rest of the arguments. + Otherwise, f is returned. evaluate(f, ...) is the same as (*f)(...). + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/exec ds2.0r27/lib/doc/efun/all/exec *** ds1.1/lib/doc/efun/all/exec Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/exec Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,18 ---- + exec - switches a user (interactive) connection from one object to another + + int exec( object to, object from ); + + This efunction allows the interactive link to a given object to be + moved to another object. That is, after a successful exec(to, from) + call, interactive(to) will return 1 and interactive(from) will return 0. + The player that was controlling 'from' will begin controlling 'to' following + the exec() call. Note that this is a powerful function and its use must + be restricted if you wish to attempt to have a secure mud. The proper + way to restrict the use of exec() is to make a simul_efun of the same name + and then use valid_override() to restrict the use of a simul_efun override + (i.e. efun::exec()). The exec() function returns 1 if the switch is + successful (and 0 otherwise). + + See also: + interactive, + valid_override diff -c -r --new-file ds1.1/lib/doc/efun/all/exp ds2.0r27/lib/doc/efun/all/exp *** ds1.1/lib/doc/efun/all/exp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/exp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + exp - find e to the power of a float + + float exp( float f ); + + This efun is only available if PACKAGE_MATH is compiled in. + + exp() returns e^f. + + See also: + log, + pow, + sqrt + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/explode ds2.0r27/lib/doc/efun/all/explode *** ds1.1/lib/doc/efun/all/explode Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/explode Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,20 ---- + explode - break up a string + + string array explode( string str, string del ); + + explode() returns an array of strings, created when the string 'str' + is split into pieces as divided by the delimiter 'del'. + + EXAMPLE: + + explode(str," ") will return as an array all of the words (separated + by spaces) in the string 'str'. + + See also: + implode, + sscanf, + replace_string, + strsrch + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/all/export_uid ds2.0r27/lib/doc/efun/all/export_uid *** ds1.1/lib/doc/efun/all/export_uid Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/export_uid Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + export_uid - set the uid of another object + + int export_uid( object ob ); + + This efun is only available if PACKAGE_UIDS is compiled in. + + Set the uid of 'ob' to the effective uid of this_object(). It is + only possible when 'ob' has an effective uid of 0. + + See also: + seteuid, + getuid, + geteuid, + valid_seteuid + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/external_start ds2.0r27/lib/doc/efun/all/external_start *** ds1.1/lib/doc/efun/all/external_start Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/external_start Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + external_start - start an external command + + int external_start(int which, string args, mixed read_cb, mixed write_cb, mixed close_cb); + + 'which' specifies which of the 5 external commands specified in + the config file to run. 'args' are the arguments to pass to the + command. The driver then starts up the specified command, and sets up + an LPC socket to communicate with the input and output of the command. + The file descriptor of the LPC socket is returned. + + See also: + time, + ctime, + localtime + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/fetch_variable ds2.0r27/lib/doc/efun/all/fetch_variable *** ds1.1/lib/doc/efun/all/fetch_variable Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/fetch_variable Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + fetch_variable - set the value of a variable + + mixed fetch_variable(string); + + Return the value of the variable specified by the argument. + Note that the variable must be defined, and must be defined in this_object(). + + This function requires PACKAGE_CONTRIB to be defined in the options file. + + See also: + restore_variable, + store_variable, + restore_object + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/all/file_length ds2.0r27/lib/doc/efun/all/file_length *** ds1.1/lib/doc/efun/all/file_length Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/file_length Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + file_length - get the number of lines in a file + + int file_length( string file ); + + file_length() returns the number of lines in file 'file'. Size -1 + indicates that 'file' either does not exist, or that it is not + readable. Size -2 indicates that 'file' is a directory. + + Note that this efun is not particularly fast on long files, since + determining the number of lines requires reading the entire file. + + See also: + file_size, + stat, + get_dir diff -c -r --new-file ds1.1/lib/doc/efun/all/file_name ds2.0r27/lib/doc/efun/all/file_name *** ds1.1/lib/doc/efun/all/file_name Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/file_name Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + file_name - get the file name of an object + + string file_name( object ob ); + + file_name() returns the name of the file from which 'ob' was loaded. + If the object is a cloned object, then file_name() will not be an + actual file on disk, but will be the name of the file from which the + object was originally cloned, appended with an octothorpe (#) and the + object instance number. Object instance numbers start at 0 when the + game is booted, and increase by one for each object cloned, hence the + number is unique for each cloned object. 'ob' defaults to this_object() + if not specified. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/file_size ds2.0r27/lib/doc/efun/all/file_size *** ds1.1/lib/doc/efun/all/file_size Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/file_size Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + file_size - get the size of a file + + int file_size( string file ); + + file_size() returns the size of file 'file' in bytes. Size -1 + indicates that 'file' either does not exist, or that it is not + readable. Size -2 indicates that 'file' is a directory. + + See also: + file_length, + stat, + get_dir diff -c -r --new-file ds1.1/lib/doc/efun/all/filter ds2.0r27/lib/doc/efun/all/filter *** ds1.1/lib/doc/efun/all/filter Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/filter Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + filter - select certain elements + + mixed filter(mixed x, string fun, object ob, mixed extra, ...); + + mixed filter(mixed x, function f, mixed extra, ...); + + The (ob, fun) syntax works as if (: call_other, ob, fun :) had been passed as + f. Filter returns a new structure containing only the elements of x for which + the function returns nonzero. Currently, it can be used on arrays and + mappings. In the case of mappings, both the key and the value are passed + to the function. extra and all the following arguments are passed to the + function after the element. For example, filter(arr, fun, 2, 3) will + first call fun(arr[0], 2, 3) then fun(arr[1], 2, 3) etc. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/filter_array ds2.0r27/lib/doc/efun/all/filter_array *** ds1.1/lib/doc/efun/all/filter_array Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/filter_array Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + filter_array - return a selective sub-array + + array filter_array( array arr, string fun, object ob, mixed extra, ... ); + + array filter_array( array arr, function f, mixed extra, ...); + + filter_array() is really the same as the filter() efun. + + See also: + filter + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/filter_mapping ds2.0r27/lib/doc/efun/all/filter_mapping *** ds1.1/lib/doc/efun/all/filter_mapping Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/filter_mapping Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + filter_mapping - return a selective sub-mapping + + mapping filter_mapping(mapping map, string fun, object ob, mixed extra, ...); + + mapping filter_array(mapping map, function f, mixed extra, ...); + + filter_mapping() is really the same as the filter() efun. + + See also: + filter + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/find_call_out ds2.0r27/lib/doc/efun/all/find_call_out *** ds1.1/lib/doc/efun/all/find_call_out Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/find_call_out Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + find_call_out - find a call out scheduled to be called next + + int find_call_out( string func ); + + Find the first call out due to be executed for function 'func' in the + current object, or the call_out() which returned the integer 'handle', + and return the time left. If it is not found, then return -1. + + See also: + call_out, + remove_call_out, + set_heart_beat + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/find_living ds2.0r27/lib/doc/efun/all/find_living *** ds1.1/lib/doc/efun/all/find_living Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/find_living Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,21 ---- + find_living - find a living object matching a given id + + object find_living( string str ); + + This efun is only available if NO_ADD_ACTION is not compiled in. + + Find first the object that is marked as living, and answers to the + id 'str'. A living object is an object that has called + enable_commands(). The object must have set a name with + set_living_name(), so its name will be entered into the hash table + used to speed up the search for living objects. + + See also: + living, + livings, + users, + disable_commands, + enable_commands, + set_living_name + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/find_object ds2.0r27/lib/doc/efun/all/find_object *** ds1.1/lib/doc/efun/all/find_object Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/find_object Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + find_object - find an object by file name + + object find_object( string str ); + + Find the object with the file name 'str'. If the object is a + cloned object, then it can be found using the file name which + would by returned if file_name() was called with it as the + argument. + + See also: + file_name + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/all/find_player ds2.0r27/lib/doc/efun/all/find_player *** ds1.1/lib/doc/efun/all/find_player Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/find_player Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + find_player - find a player by name + + object find_player( string str ); + + This efun is only available when NO_ADD_ACTION is not defined. + + Similar to find_living(), but only searches through objects that are + interactive, or were once interactive. + + See also: + find_living, + livings, + users, + set_living_name diff -c -r --new-file ds1.1/lib/doc/efun/all/first_inventory ds2.0r27/lib/doc/efun/all/first_inventory *** ds1.1/lib/doc/efun/all/first_inventory Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/first_inventory Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + first_inventory - return the first item in an object's inventory + + object first_inventory( mixed ob ); + + This efun is only available if NO_ENVIRONMENT is not compiled in. + + Return the first object in the inventory of 'ob', where 'ob' is + either an object or the file name of an object. + + See also: + file_name, + next_inventory, + all_inventory, + deep_inventory + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/floatp ds2.0r27/lib/doc/efun/all/floatp *** ds1.1/lib/doc/efun/all/floatp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/floatp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,7 ---- + floatp - determine whether or not a given variable is a float + + int floatp( mixed arg ); + + Return 1 if `arg' is a float number and zero (0) otherwise. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/floor ds2.0r27/lib/doc/efun/all/floor *** ds1.1/lib/doc/efun/all/floor Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/floor Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + floor - round a float down to the nearest integer + + float floor( float f ); + + This efun is only available if PACKAGE_MATH is compiled in. + + Returns (as a float) the nearest integer number equal to or smaller than f. + + See also: + ceil, + to_int, + to_float diff -c -r --new-file ds1.1/lib/doc/efun/all/flush_messages ds2.0r27/lib/doc/efun/all/flush_messages *** ds1.1/lib/doc/efun/all/flush_messages Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/flush_messages Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + flush_messages - send all pending messages to a user + + int flush_messages(); + + int flush_messages(object user); + + Normally, messages are queued, then sent all at once to minimize the + number of packets required. This efun forces all pending messages to + be written immediately. If no user is specified, messages for ALL users + are flushed. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/function_exists ds2.0r27/lib/doc/efun/all/function_exists *** ds1.1/lib/doc/efun/all/function_exists Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/function_exists Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,20 ---- + function_exists - find the file containing a given function in an object + + string function_exists( string str, object ob, int flag ); + + Return the file name of the object that defines the function 'str' in + object 'ob'. The returned value can be other than 'file_name(ob)' if the + function is defined by an inherited object. + + 0 is returned if the function was not defined. + + Note that function_exists() does not check shadows. + + If flag is omitted or zero functions that cannot be called are not returned + (e.g. the function is returned only if call_other(ob, str) would succeed). + If the flag is nonzero, static and private functions are returned too. + + See also: + call_other + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/function_owner ds2.0r27/lib/doc/efun/all/function_owner *** ds1.1/lib/doc/efun/all/function_owner Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/function_owner Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + function_owner - return the owner of a given function. + + object function_owner(function); + + function_owner returns the object that owns the function specified by + the argument. + + This function requires PACKAGE_CONTRIB to be defined in the options file. + + See also: + bind diff -c -r --new-file ds1.1/lib/doc/efun/all/function_profile ds2.0r27/lib/doc/efun/all/function_profile *** ds1.1/lib/doc/efun/all/function_profile Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/function_profile Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,27 ---- + function_profile - get function profiling information for an object + + array function_profile( object ob ); + + Returns function profiling information for 'ob', or this_object() if 'ob' + is not specified. This is only available if the driver was compiled + with PROFILE_FUNCTIONS defined. + + An array of mappings is returned, one for each function in 'ob'. The format + of the mapping is: + <pre> + ([ "name" : name_of_the_function, + "calls" : number_of_calls, + + "self" : cpu_time_spent_in self, + "children" : cpu_time_spent_in_children + ]) + </pre> + The usefulness of this is tied to the resolution of the CPU clock--even + though the units are microseconds, the CPU timer resolution is often much + less. + + See also: + rusage, + time_expression + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/functionp ds2.0r27/lib/doc/efun/all/functionp *** ds1.1/lib/doc/efun/all/functionp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/functionp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,49 ---- + functionp - determine whether or not a given variable is a function + pointer + + int functionp( mixed arg ); + + Return nonzero if `arg' is a function pointer and zero (0) otherwise. + Function pointers are variables of type 'function' as indicated in the + documentation for the type 'function', for example: + + f = (: call_other, obj, func :); + + The return value indicates the type of function pointer using the + values given in the driver include file "include/function.h". + + <DL> + * FP_LOCAL - lfun pointer + * FP_EFUN - efun pointer + * FP_SIMUL - simul pointer + * FP_FUNCTIONAL - functional + </DL> + + These values are bit values; the following flags may be added as well: + + <DL> + * FP_HAS_ARGUMENTS - arguments were included in the definition + * FP_OWNER_DESTED - the owner of this function pointer has been destructed + * FP_NOT_BINDABLE - it isn't possible to rebind this function pointer + </DL> + + To test if a function variable is an efun pointer: + + if (functionp(f) & FP_EFUN) ... + + to test if it is an efun or simul_efun: + + if (functionp(f) & (FP_EFUN | FP_SIMUL)) ... + + Try (very hard) to call the function: + + <pre> + if (functionp(f) & FP_OWNER_DESTED) { + if (functionp(f) & FP_NOT_BINDABLE) + error("Function could not be rebound.\n"); + f = bind(f, this_object()); + } + evaluate(f); + </pre> + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/functions ds2.0r27/lib/doc/efun/all/functions *** ds1.1/lib/doc/efun/all/functions Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/functions Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,21 ---- + functions - list all the functions in a given object. + + string array functions(object, int default: 0); + + functions() can return two different things. If the second argument is + 0 (which it is by default) it will return an array containing the names + of all the functions in the object passed as the first argument. If the + second argument is non-zero, more information about each function is + given. For a non-zero second argument, each array element contains + the following: + + ({ function_name, number_of_arguments, return_type, ... }). + + Where the fourth and following elements are the argument types. If + the save_types pragma was not in effect when the function was compiled, + number_of_arguments will be correct, but no types will be available. + + This efun is only available if PACKAGE_CONTRIB is defined in the + options file. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/generate_source ds2.0r27/lib/doc/efun/all/generate_source *** ds1.1/lib/doc/efun/all/generate_source Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/generate_source Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,19 ---- + generate_source - generates the C code corresponding to a give object(s) + + int generate_source(string file); + + int generate_source(string array files); + + This efun is only available if LPC_TO_C is compiled into the driver. + + generate_source() calls the LPC->C compiler to generate the source code + for a given object or objects. If more than one file is passed, a directory + named 'mudlib' is created in the SAVE_BINARIES directory, and that directory + can be copied into the driver source directory and compiled into the driver. + + If one file is given, the C source for that file is compiled, and the driver + attempts to link it into the running executable using the RUNTIME_LOADING + option. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/all/get_char ds2.0r27/lib/doc/efun/all/get_char *** ds1.1/lib/doc/efun/all/get_char Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/get_char Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,28 ---- + get_char - causes next character of input to be sent to a specified function + + varargs void get_char( string | function fun, int flag, ... ); + + Enable next character of user input to be sent to the function `fun' as + an argument. The input character will not be parsed by the driver. + + Note that get_char is non-blocking which means that the object calling + get_char does not pause waiting for input. Instead the object continues + to execute any statements following the get_char. The specified function + `fun' will not be called until the user input has been collected. + + If "get_char()" is called more than once in the same execution, only the + first call has any effect. + + If optional argument `flag' is non-zero, the char given by the player will + not be echoed, and is not seen if snooped (this is useful for collecting + passwords). + + The function `fun' will be called with the user input as its first argument + (a string). Any additional arguments supplied to get_char will be passed on to + `fun' as arguments following the user input. + + See also: + call_out, + input_to + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/get_config ds2.0r27/lib/doc/efun/all/get_config *** ds1.1/lib/doc/efun/all/get_config Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/get_config Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,9 ---- + get_config - query various driver config settings + + mixed get_config( int ); + + This efun is used to query the driver's various config + settings. Please refer to the "runtime_config.h" + include file for a list of currently recognized options. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/get_dir ds2.0r27/lib/doc/efun/all/get_dir *** ds1.1/lib/doc/efun/all/get_dir Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/get_dir Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,26 ---- + get_dir - returns information pertaining to a filesystem directory + + mixed array get_dir(string dir); + + mixed array get_dir(string dir, int flag); + + If `dir' is a filename ('*' and '?' wildcards are supported), an array of + strings is returned containing all filenames that match the specification. + If `dir' is a directory name (ending with a slash--ie: "/u/", "/adm/", etc), + all filenames in that directory are returned. + + If called with a second argument equal to -1, get_dir will return an array + of subarrays, where the format of each subarray is: + + ({ filename, size_of_file, last_time_file_touched }) + + Where filename is a string and last_time_file_touched is an integer being + number of seconds since January 1, 1970 (same format as time()). The + size_of_file element is the same value that is returned by file_size(); the + size of the file in bytes, or -2 if it's a directory. + + See also: + file_size, + stat, + time, + ctime diff -c -r --new-file ds1.1/lib/doc/efun/all/geteuid ds2.0r27/lib/doc/efun/all/geteuid *** ds1.1/lib/doc/efun/all/geteuid Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/geteuid Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,19 ---- + geteuid - return the effective user id of an object or function + + string geteuid( object|function ); + + This efun is only available if PACKAGE_UIDS is compiled into the driver. + + If given an object argument, geteuid returns the effective user id (euid) + of the object. If given an argument of type 'function', it returns the + euid of the object that created that 'function' variable. If the object, + at the time of the function variable's construction, had no euid, the + object's uid is stored instead. + + See also: + seteuid, + getuid, + export_uid, + valid_seteuid + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/getuid ds2.0r27/lib/doc/efun/all/getuid *** ds1.1/lib/doc/efun/all/getuid Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/getuid Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,17 ---- + getuid - return the user id (uid) of an object + + string getuid( object ob ); + + This efun is only available if PACKAGE_UIDS is compiled into the driver. + + Returns the user id of an object. The uid of an object is determined at + object creation by the creator_file() function. + + See also: + seteuid, + geteuid, + export_uid, + valid_seteuid, + creator_file + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/heart_beat_info ds2.0r27/lib/doc/efun/all/heart_beat_info *** ds1.1/lib/doc/efun/all/heart_beat_info Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/heart_beat_info Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + heart_beat_info - return an array of objects with active heartbeats + + object array heart_beat_info(); + + Returns an array of all the objects with active heart_beats. This efun + is only available if COMPAT_32 is defined. + + See also: + heart_beats.html + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/heart_beats ds2.0r27/lib/doc/efun/all/heart_beats *** ds1.1/lib/doc/efun/all/heart_beats Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/heart_beats Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + heart_beats - return an array of objects with active heartbeats + + object array heart_beats(); + + Returns an array of all the objects with active heart_beats. This efun + is only available if PACKAGE_CONTRIB is defined. + + See also: + heart_beat, + set_heart_beat, + query_heart_beat + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/implode ds2.0r27/lib/doc/efun/all/implode *** ds1.1/lib/doc/efun/all/implode Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/implode Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,24 ---- + implode - concatenate strings + + string implode( array arr, string del ); + + mixed implode( array arr, function f); + + mixed implode( array arr, function f, mixed start); + + Concatenate all strings found in array 'arr', with the string 'del' between + each element. Only strings are used from the array. Elements that are not + strings are ignored. + + The second version takes the first and second values of arr and passes them + to f, then passes that result and the third arg to f, et cetera. It returns + the last result of the call to f. + + In the third case, the first call is f(start, arr[0]), then things proceed + as above. + + See also: + explode, + sprintf + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/in_edit ds2.0r27/lib/doc/efun/all/in_edit *** ds1.1/lib/doc/efun/all/in_edit Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/in_edit Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + in_edit() - determine if a player is in the editor + + string in_edit(); + + string in_edit(object ob); + + If the given object is in the editor, the file being edited is + returned, else zero. If no object is given, this_object() is used. + + See also: + ed, + in_input + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/in_input ds2.0r27/lib/doc/efun/all/in_input *** ds1.1/lib/doc/efun/all/in_input Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/in_input Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + in_input() - determines if a player is inputting to an input_to + + int in_input(); + + int in_input(object ob); + + Returns 1 if the object is currently inputting to an input_to or get_char. + If no object is specified, this_object() is assumed. + + See also: + get_char, + input_to + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/all/index ds2.0r27/lib/doc/efun/all/index *** ds1.1/lib/doc/efun/all/index Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/index Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,36 ---- + System efuns + + <DL> + * all_previous_objects + * call_out_info + * check_memory + * ctime + * debug_message + * deep_inherit_list + * error + * eval_cost + * external_start + * find_call_out + * flush_messages + * function_exists + * function_profile + * functions + * inherit_list + * inherits + * localtime + * lpc_info + * max_eval_cost + * memory_summary + * named_livings + * program_info + * reclaim_objects + * replace_program + * reset_eval_cost + * set_eval_limit + * set_reset + * shutdown + * time + * uptime + </DL> + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/inherit_list ds2.0r27/lib/doc/efun/all/inherit_list *** ds1.1/lib/doc/efun/all/inherit_list Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/inherit_list Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + inherit_list - get a list of parents of an object + + string array inherit_list( object obj ); + + Returns an array of filenames of objects inherited by obj. + If COMPAT_32 was compiled in, this behaves like deep_inherit_list(), + otherwise it behaves like shallow_inherit_list(). + + See also: + deep_inherit_list, + shallow_inherit_list, + inherits + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/all/inherits ds2.0r27/lib/doc/efun/all/inherits *** ds1.1/lib/doc/efun/all/inherits Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/inherits Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + inherits - determine if an object inherits a given file + + int inherits( string file, object obj ); + + inherits() returns 0 if obj does not inherit file, 1 if it inherits the + most recent copy of file, and 2 if it inherits an old copy of file. + + See also: + deep_inherit_list, + inherit_list + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/all/input_to ds2.0r27/lib/doc/efun/all/input_to *** ds1.1/lib/doc/efun/all/input_to Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/input_to Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,33 ---- + input_to - causes next line of input to be sent to a specified function + + varargs void input_to( string | function fun, int flag, ... ); + + Enable next line of user input to be sent to the local function 'fun' as + an argument. The input line will not be parsed by the driver. + + Note that input_to is non-blocking which means that the object calling + input_to does not pause waiting for input. Instead the object continues + to execute any statements following the input_to. The specified function + 'fun' will not be called until the user input has been collected. + + If "input_to()" is called more than once in the same execution, only the + first call has any effect. + + If optional argument 'flag' has the 1 bit set, the line given by the player + will not be echoed, and is not seen if snooped (this is useful for collecting + passwords). + + If 'flag' has the 2 bit set, the input_to cannot be bypassed by beginning the + command with '!'. Otherwise, lines which start with '!' drop through to + the normal input handler. + + The function 'fun' will be called with the user input as its first argument + (a string). Any additional arguments supplied to input_to will be passed on to + 'fun' as arguments following the user input. + + See also: + call_other, + call_out, + get_char + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/interactive ds2.0r27/lib/doc/efun/all/interactive *** ds1.1/lib/doc/efun/all/interactive Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/interactive Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + interactive - detects whether or not a given object is an interactive + + int interactive( object ob ); + + Return non-zero if 'ob' is an interactive player. 0 will be returned + if he is link dead. + + See also: + query_ip_number, + query_ip_name, + enable_commands + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/intp ds2.0r27/lib/doc/efun/all/intp *** ds1.1/lib/doc/efun/all/intp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/intp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,7 ---- + intp - determine whether or not a given variable is an integer + + int intp( mixed arg ); + + Return 1 if 'arg' is an integer number and zero (0) otherwise. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/keys ds2.0r27/lib/doc/efun/all/keys *** ds1.1/lib/doc/efun/all/keys Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/keys Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,27 ---- + keys - return an array of the keys from the (key, value) pairs in a mapping + + array keys( mapping m ); + + keys() returns an array of keys (indices) corresponding to the keys in + the (key, value) pairs stored in the mapping m. + + For example, if: + + <pre> + mapping m; + m = (["hp" : 35, "sp" : 42, "mass" : 100]); + </pre> + + then + + <pre> + keys(m) == ({"hp", "sp", "mass"}) + </pre> + + Note: the keys will not be returned in any apparent order. However, they + will be returned in the same order as the corresponding values (returned + by the values() efun). + + See also: + values + diff -c -r --new-file ds1.1/lib/doc/efun/all/link ds2.0r27/lib/doc/efun/all/link *** ds1.1/lib/doc/efun/all/link Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/link Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,18 ---- + link - link a file to another + + void link( string original, string reference ); + + Creates a link 'reference' to the file 'original'. This efun causes + valid_link(original, reference) to be called in the master object. If + valid_link() returns 0, the link() call fails. If valid_link() returns 1 + then the link() suceeds iff rename() would succeed if called with the same + arguments. + + See also: + rm, + rmdir, + rename, + mkdir, + cp + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/living ds2.0r27/lib/doc/efun/all/living *** ds1.1/lib/doc/efun/all/living Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/living Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + living - detects whether or not a given object is "living" + + int living( object ob ); + + This efun is only available if NO_ADD_ACTION is not compiled in. + + Return true if `ob' is a living object (that is, if "enable_commands()" has + been called by `ob'). + + See also: + enable_commands + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/all/livings ds2.0r27/lib/doc/efun/all/livings *** ds1.1/lib/doc/efun/all/livings Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/livings Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + livings - return an array of all living objects + + object array livings(); + + This efun is only available if NO_ADD_ACTION is not compiled in. + + Returns an array of pointers to all living objects (objects that have + had enable_commands() called in them). + + See also: + enable_commands, + find_living, + users + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/load_object ds2.0r27/lib/doc/efun/all/load_object *** ds1.1/lib/doc/efun/all/load_object Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/load_object Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + load_object - find or load an object by file name + + object load_object( string str ); + + Find the object with the file name 'str'. If the object is already + loaded, it is returned (just like find_object()). If the file exists + and the object hasn't been loaded yet, it is loaded first, then the + new object is returned. Otherwise zero is returned. An error is + thrown only if the object has compile errors. + + See also: + file_name, + find_object + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/localtime ds2.0r27/lib/doc/efun/all/localtime *** ds1.1/lib/doc/efun/all/localtime Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/localtime Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,38 ---- + localtime - convert to local time + + array localtime( int time ); + + localtime() converts a time value (as returned by time()) into an array + of values which represents the time locally. In the past time() was used + to get the time in GMT (UTC), and then local definitions were used to + determine the local offset from GMT. This roundabout approach is no + longer necessary. localtime() returns the seconds, minutes and hours, + the day, month and year, day of the week, day of the year, + the name of the local timezone and how far the MUD is from GMT. This + information is retrieved directly from the operating system and made + available to the driver without the use of MUD-specific configuration + files. + + localtime() returns an array containing the values specified above. + The index for each value is defined symbolically in localtime.h. The + following table summarizes the array returned by localtime(). + <pre> + int LT_SEC Seconds after the minute (0..59) + int LT_MIN Minutes after the hour (0..59) + int LT_HOUR Hour since midnight (0..23) + int LT_MDAY Day of the month (1..31) + int LT_MON Months since January (0..11) + int LT_YEAR Year (guarenteed to be >= 1900) + int LT_WDAY Days since Sunday (0..6) + int LT_YDAY Days since January 1 (0..365) + int LT_GMTOFF Seconds after GMT (UTC) + string LT_ZONE Timezone name + </pre> + + See also: + ctime, + time, + time_expression, + uptime + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/log ds2.0r27/lib/doc/efun/all/log *** ds1.1/lib/doc/efun/all/log Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/log Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + log - returns the natural logarithm of a float + + float log( float f ); + + This efun is only available if PACKAGE_MATH is compiled in. + + Returns the natural logarithm of its argument, `f'. `f' must be positive. + + See also: + exp, + pow, + sqrt diff -c -r --new-file ds1.1/lib/doc/efun/all/lower_case ds2.0r27/lib/doc/efun/all/lower_case *** ds1.1/lib/doc/efun/all/lower_case Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/lower_case Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + lower_case - return the lowercase version of a given string + + string lower_case( string str ); + + Return the lowercase version of a given string (original string remains + unchanged). + + See also: + capitalize + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/lpc_info ds2.0r27/lib/doc/efun/all/lpc_info *** ds1.1/lib/doc/efun/all/lpc_info Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/lpc_info Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,8 ---- + lpc_info - return information about LPC->C compiled objects + + string lpc_info(); + + lpc_info() returns a string describing which LPC->C programs are available, + which are loaded, and which are out of date with respect to their source. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/m_delete ds2.0r27/lib/doc/efun/all/m_delete *** ds1.1/lib/doc/efun/all/m_delete Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/m_delete Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,28 ---- + m_delete - remove a key from a mapping + + mapping m_delete(mapping m, mixed element); + + This efun is only available if COMPAT_32 is defined. + + It behaves exactly like map_delete(), except that it returns its first + argument. + + Note: the 3.2 version actually returns a copy of the mapping, + so for strict compatibility the following simul is suggested: + + <pre> + mapping m_delete(mapping m, mixed element) + { + mapping ret = copy(m); + map_delete(ret, element); + return ret; + } + </pre> + + However, this version is significantly faster as it avoids the copy. + + See also: + map_delete + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/all/m_indices ds2.0r27/lib/doc/efun/all/m_indices *** ds1.1/lib/doc/efun/all/m_indices Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/m_indices Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + m_indices - return the keys of a mapping + + array m_indices(mapping); + + This efun is only available if COMPAT_32 is defined. It behaves exactly + the same as keys(). + + See also: + keys + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/m_values ds2.0r27/lib/doc/efun/all/m_values *** ds1.1/lib/doc/efun/all/m_values Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/m_values Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + m_values - return the values of a mapping + + array m_values(mapping); + + This efun is only available if COMPAT_32 is defined. It behaves exactly + the same as values(). + + See also: + values + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/malloc_status ds2.0r27/lib/doc/efun/all/malloc_status *** ds1.1/lib/doc/efun/all/malloc_status Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/malloc_status Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + malloc_status - report various statistics related to memory usage. + + string malloc_status(); + + This function returns memory usage statistics in a string. + This function replaces the hardcoded 'malloc' command in vanilla 3.1.2. + Note that the output produced by malloc_status() depends upon which + memory management package is chosen in options.h when building the driver. + + See also: + mud_status, + dumpallobj, + memory_info + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/all/map ds2.0r27/lib/doc/efun/all/map *** ds1.1/lib/doc/efun/all/map Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/map Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + map - modify an mapping + + mixed map( mixed x, string fun, object ob, mixed extra, ... ); + + mixed map( mixed x, function f, mixed extra, ... ); + + The (ob, fun) syntax works as if (: call_other, ob, fun :) had been passed as + f. Map returns a new structure containing the return values of f being applied + to each element of x. Currently, it can be used on arrays, mappings and + strings. In the case of mappings, both the key and the value are passed + to the function. In the case of strings, the characters are passed to the + function one at a time as ints. extra and all the following arguments are + passed to the function after the element. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/map_array ds2.0r27/lib/doc/efun/all/map_array *** ds1.1/lib/doc/efun/all/map_array Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/map_array Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,10 ---- + map_array - modify an array of elements via application of a function + + array map_array( array arr, string fun, object ob, mixed extra, ... ); + + array map_array( array arr, function f, mixed extra, ... );; + + The map_array() efun is really just an alias for the map() efun. + + See also: + map diff -c -r --new-file ds1.1/lib/doc/efun/all/map_delete ds2.0r27/lib/doc/efun/all/map_delete *** ds1.1/lib/doc/efun/all/map_delete Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/map_delete Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,34 ---- + map_delete - remove a (key, value) pair from a mapping based on the key + + void map_delete( mapping m, mixed element ); + + map_delete removes the (key, value) from the mapping m that has key equal + to element. + + For example, given: + + <pre> + mapping names; + + names = ([]); + names["truilkan"] = "john"; + names["wayfarer"] = "erik"; + names["jacques"] = "dwayne"; + </pre> + + Then: + <pre> + map_delete(names,"truilkan"); + </pre> + + causes the mapping 'names' to be equal to: + <pre> + (["wayfarer" : "erik", "jacques" : "dwayne"]) + </pre> + keys(names) will not contain "truilkan" after map_delete(names,"truilkan") + is called [unless ("truilkan", *) is subsequently added back to the mapping]. + + See also: + allocate_mapping + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/map_mapping ds2.0r27/lib/doc/efun/all/map_mapping *** ds1.1/lib/doc/efun/all/map_mapping Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/map_mapping Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,21 ---- + map_mapping - modify an mapping of elements via application of a function + + mapping map_mapping( mapping map, string fun, object ob, ... ); + + mapping map_mapping( mapping map, function f, ... ); + + Returns an mapping with the same keys as map whose items have been + mapped throught 'ob->fun()' or 'f'. The function is called for each + (key, value) pair in 'map' and the returned mapping has the return value + of the function as its value for each key. + The extra arguments are passed as parameters to the function + after the key and the value. + + See also: + filter_array, + filter, + sort_array, + map_array, + map + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/mapp ds2.0r27/lib/doc/efun/all/mapp *** ds1.1/lib/doc/efun/all/mapp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/mapp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,7 ---- + mapp - determine whether or not a given variable is a mapping + + int mapp( mixed arg ); + + Return 1 if `arg' is a mapping. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/master ds2.0r27/lib/doc/efun/all/master *** ds1.1/lib/doc/efun/all/master Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/master Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,10 ---- + master - returns the master object + + object master(); + + Returns a pointer to the master object. + + See also: + find_object + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/match_path ds2.0r27/lib/doc/efun/all/match_path *** ds1.1/lib/doc/efun/all/match_path Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/match_path Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + match_path - search a mapping for a path + + mixed match_path( mapping m, string str ); + + match_path() searches a mapping for a path. Each key is assumed to be a + string. The value is completely arbitrary. The efun finds the largest + matching path in the mapping. Keys ended in '/' are assumed to match paths + with character that follow the '/', i.e. / is a wildcard for anything below + this directory. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/max_eval_cost ds2.0r27/lib/doc/efun/all/max_eval_cost *** ds1.1/lib/doc/efun/all/max_eval_cost Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/max_eval_cost Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + max_eval_cost - returns the maximum evaluation cost + + void max_eval_cost() + + max_eval_cost() returns the number of instructions that can be executed + before the driver decides it is in an infinite loop. + + See also: + set_eval_limit, + reset_eval_cost + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/member_array ds2.0r27/lib/doc/efun/all/member_array *** ds1.1/lib/doc/efun/all/member_array Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/member_array Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + member_array - returns index of an occurence of a given item in an array or string + + int member_array( mixed item, mixed arr); + + int member_array( mixed item, mixed arr, int start); + + Returns the index of the first occurence of `item' in the array or string + `arr', or the first occurence at or after 'start'. + If the item is not found, then -1 is returned. + + For the purpose of this efun, strings are considered to be arrays of ints. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/memory_info ds2.0r27/lib/doc/efun/all/memory_info *** ds1.1/lib/doc/efun/all/memory_info Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/memory_info Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,18 ---- + memory_info - obtain info on object/overall memory usage + + varargs int memory_info( object ob ); + + If optional argument `ob' is given, memory_info() returns the approximate + amount of memory that `ob' is using. If no argument is given, memory_info() + returns the approximate amount of memory that the entire mud is using. Note + that the amount of memory the mud is using does not necessarily correspond + to the amount of memory actually allocated by the mud from the system, and + that total memory used by all the objects is not additive due to sharing of + certain structures. + + See also: + debug_info, + malloc_status, + mud_status + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/memory_summary ds2.0r27/lib/doc/efun/all/memory_summary *** ds1.1/lib/doc/efun/all/memory_summary Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/memory_summary Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,24 ---- + memory_summary - return a summary of memory usage + + mapping memory_summary(); + + memory_summary() returns a mapping of the form: + + PRE( + ([ + program name : ([ + var name : mem usage, + ... + ]) + ... + ]) + ) + + the memory usage is the memory required to store the value divided by the + number of variables pointing to that particular value. [Due to sharing + of values, giving an exact number for the memory usage of any + value is impossible] + + This efun is only available if PACKAGE_CONTRIB is defined. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/message ds2.0r27/lib/doc/efun/all/message *** ds1.1/lib/doc/efun/all/message Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/message Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,32 ---- + message - deliver messages to "living" objects + + void message( mixed class, mixed message, mixed target, mixed exclude ); + + message() calls receive_message(mixed class, mixed message) in all objects + in the target list excluding those in the exclude list. This basically + tells the object the message. + + Class is the type of message (used for clients and such). An example + would be 'combat', 'shout', 'emergency' etc. Any LPC value can be + passed, though. + + Message is usually a string containing the text to send, though it + can also be any value. + + Target is a list of objects to be sent the message. This can be either a + single object string or object pointer, or may be an array of either. + If a target is non-living all objects in its environment will receive + the message. + + Exclude is a list of objects that should not receive the message. This + can either be one object or an array of objects. + + See also: + receive_message, + say, + write, + shout, + tell_object, + tell_room + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/mkdir ds2.0r27/lib/doc/efun/all/mkdir *** ds1.1/lib/doc/efun/all/mkdir Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/mkdir Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + mkdir - make a directory + + int mkdir( string directory ); + + Creates the specified directory. Returns 1 if successful, 0 if not. + + See also: + rm, + rmdir, + link + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/move_object ds2.0r27/lib/doc/efun/all/move_object *** ds1.1/lib/doc/efun/all/move_object Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/move_object Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,8 ---- + move_object - move current object to another environment + + void move_object( mixed dest ); + + Move the current object into the object `dest'. dest should either be + a filename or an object. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/mud_status ds2.0r27/lib/doc/efun/all/mud_status *** ds1.1/lib/doc/efun/all/mud_status Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/mud_status Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + mud_status - report various driver and mudlib statistics + + string mud_status( int extra ); + + This function returns a string containing driver and mudlib statistics. + If extra is non-zero, then additional information about various internal + tables is included as well. This efun replaces the hardcoded 'status' + and 'status tables' commands in vanilla 3.1.2. + + See also: + debug_info, + dumpallobj, + memory_info, + uptime + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/named_livings ds2.0r27/lib/doc/efun/all/named_livings *** ds1.1/lib/doc/efun/all/named_livings Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/named_livings Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + named_livings - return all living objects with names + + mapping named_livings(); + + named_livings() returns all objects that have called both set_living_name() + and enable_commands(). It is significantly more efficient than livings(). + + named_livings() is available if PACKAGE_CONTRIB is defined, and NO_ADD_ACTION + is not. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/new ds2.0r27/lib/doc/efun/all/new *** ds1.1/lib/doc/efun/all/new Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/new Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + new + + object x = new( string name, ...); + class foo x = new(class foo); + + If given a string, it behaves like clone object. If given a class type, + it creates a new instance of the class type. + + See also: + clone_object, + destruct, + move_object + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/next_bit ds2.0r27/lib/doc/efun/all/next_bit *** ds1.1/lib/doc/efun/all/next_bit Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/next_bit Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + next_bit - find the next bit set in a bitstring + + int next_bit( string str, int n ); + + next_bit() returns the next bit set in a bitstring after 'n', or -1 if + 'n' is the last set bit. + + See also: + set_bit, + test_bit + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/next_inventory ds2.0r27/lib/doc/efun/all/next_inventory *** ds1.1/lib/doc/efun/all/next_inventory Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/next_inventory Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + next_inventory - return the next object in the same inventory + + object next_inventory( object ob ); + + This efun is only available if NO_ENVIRONMENT is not compiled in. + + Return the next object in the same inventory as 'ob'. + + See also: + first_inventory, + all_inventory, + deep_inventory + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/notify_fail ds2.0r27/lib/doc/efun/all/notify_fail *** ds1.1/lib/doc/efun/all/notify_fail Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/notify_fail Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,36 ---- + notify_fail - set the default error message to a specified string + + int notify_fail( string | function str ); + + This efun is only available if NO_ADD_ACTION is not compiled in. + + Store `str' as the error message to be returned instead of the default message + `What?'. The message will be displayed if a 0 is returned from all actions + setup via add_action(). This is the preferred way to display error messages + since it allows other objects a chance to respond to the same verb (command). + Do not use write() to display the error message since this will require you + to return a 1 (unless you want to see the result of the write() in addition to + the 'What?' message). However, if you do return a 1, then no other objects + will get a chance to respond to the user command. + + Note: Getting this right in the presence of multiple failures is tricky, + to say the least. One can use a function pointer instead, and have the + routine resolve the collisions. + + If a function is passed instead of a string, the function is called + instead of printing a message. If the function returns a string, that + string is used as the failure message. Also, this_player() is set + correctly, so write() can be used. + + If "notify_fail()" is called more than once, only the last call will have + an effect. + + The idea behind this function is to allow better error messages than + `What?'. + + As a side note, notify_fail() always returns zero, so return notify_fail(...) + works as expected. + + add_action + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/nullp ds2.0r27/lib/doc/efun/all/nullp *** ds1.1/lib/doc/efun/all/nullp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/nullp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,7 ---- + nullp - determine whether or not a given variable is null + + int nullp( mixed arg ); + + Exactly the same as undefinedp(). Exists for compatibility. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/objectp ds2.0r27/lib/doc/efun/all/objectp *** ds1.1/lib/doc/efun/all/objectp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/objectp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,7 ---- + objectp - determine whether or not a given variable is an object + + int objectp( mixed arg ); + + Return 1 if `arg' is an object. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/objects ds2.0r27/lib/doc/efun/all/objects *** ds1.1/lib/doc/efun/all/objects Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/objects Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,25 ---- + objects - return an array of all loaded objects + + object array objects(); + + object array objects( string func, object ob ); + + object array objects( function f); + + An array of every object loaded on the mud is returned by objects(). Note + that if the system's maximum array size is set too low, objects() will + truncate its array, in which case it might not be too useful. + + If the optional `func' and `ob' parameters are given, then ob->func() + is called with each loaded object as an argument. If the function returns + nonzero, then that object is returned by objects(), otherwise it isn't. + + If 'f' is given, it will be called on all the objects as above. For + example, objects( (: clonep :) ) returns a list of all the clones in + existence. + + See also: + livings, + users + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/opcprof ds2.0r27/lib/doc/efun/all/opcprof *** ds1.1/lib/doc/efun/all/opcprof Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/opcprof Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + opcprof - reports statistics on calling frequencies of various efuns + + void opcprof(); + + void opcprof( string ); + + This function dumps a list of statistics on each efunction and eoperator. + If no argument is specified, then the information will be dumped to files + named /OPCPROF.efun and /OPCPROF.eoper. If an argument is specified, then + that name is used as the filename for the dump. + + See also: + function_profile + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/origin ds2.0r27/lib/doc/efun/all/origin *** ds1.1/lib/doc/efun/all/origin Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/origin Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,18 ---- + origin - determine how the current function was called + + string origin(); + + Returns an string specifying how the current function was called. These + values can be found in the driver include "origin.h". Current values are: + + <DL> + * "driver" - from the driver: applies, heart_beats, etc + * "local" - local function call + * "call_other" - call_other + * "simul" - use of a simul_efun + * "call_out" - via a call_out + * "efun" - from an efun that takes a function pointer (sort_array, etc) + </DL> + + See also: + previous_object diff -c -r --new-file ds1.1/lib/doc/efun/all/pluralize ds2.0r27/lib/doc/efun/all/pluralize *** ds1.1/lib/doc/efun/all/pluralize Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/pluralize Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,10 ---- + pluralize - returns the plural of a given string + + string pluralize( string str ); + + Returns the plural of 'str'. Handles most of the oddities of the English + language. + + This efun is only available if PACKAGE_CONTRIB is defined. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/pointerp ds2.0r27/lib/doc/efun/all/pointerp *** ds1.1/lib/doc/efun/all/pointerp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/pointerp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,8 ---- + pointerp - determine whether or not a given variable is an array + + int pointerp( mixed arg ); + + pointerp() is provided for compatibility; it is the same as the arrayp() efun. + + See also: + arrayp diff -c -r --new-file ds1.1/lib/doc/efun/all/pow ds2.0r27/lib/doc/efun/all/pow *** ds1.1/lib/doc/efun/all/pow Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/pow Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + pow - find an exponent of a float + + float pow( float x, float y ); + + This efun is only available if PACKAGE_MATH is defined. + + pow() returns x to the y power. If x is 0.0, y must be positive. If x is + negative, y must be an integer. + + See also: + exp, + log, + sqrt diff -c -r --new-file ds1.1/lib/doc/efun/all/present ds2.0r27/lib/doc/efun/all/present *** ds1.1/lib/doc/efun/all/present Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/present Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,22 ---- + present - find an object by id + + object present( mixed str); + + object present( mixed str, object ob ); + + This efun is only available if NO_ENVIRONMENT is not compiled in. + + If an object for which id(str) returns true exists, return it. + + `str' can also be an object, in 'str' is searched for, instead of calling + the function id(). + + If `ob' is given, then the search is done in the inventory of `ob', otherwise + the object is searched for in the inventory of the current object, and + in the inventory of the environment of the current object. + + See also: + move_object, + environment + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/previous_object ds2.0r27/lib/doc/efun/all/previous_object *** ds1.1/lib/doc/efun/all/previous_object Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/previous_object Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,19 ---- + previous_object - returns the object(s) that called the current function + + object previous_object(); + mixed previous_object(int x); + + Returns an object pointer to the object, if any, that called current function. + Note that local function calls do not set previous_object() to the current + object, but leave it unchanged. If passed a positive integer, it goes back + the given number of previous objects in the calling chain. + previous_object(0) is the same as previous_object(), previous_object(1) is + the previous object's previous_object(), etc. previous_object(-1) returns + an array containing all of the previous objects. + + See also: + call_other, + call_out, + origin + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/printf ds2.0r27/lib/doc/efun/all/printf *** ds1.1/lib/doc/efun/all/printf Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/printf Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,75 ---- + printf - formatted output conversion + + void printf( string format, ... ); + + The output is sent to this_user(), in the same manner as the write() efun. + Implemented by Lynscar (Sean A Reith). + + This version supports the following as modifiers: + <DL> + * " " - pad positive integers with a space. + * "+" - pad positive integers with a plus sign. + * "-" - left adjusted within field size. + + Note: std (s)printf() defaults to right justification, which is unnatural + in the context of a mainly string based language but has been retained for + "compatability". + * "|" - centered within field size. + * "=" - column mode if strings are greater than field size. This is only + meaningful with strings, all other types ignore this. Columns are + auto-magically word wrapped. + * "#" - table mode, print a list of '\\n' separated 'words' in a + table within the field size. only meaningful with strings. + * a number - + specifies the field size, a '*' specifies to use the corresponding + arg as the field size. If n is prepended with a zero, then is padded + zeros, else it is padded with spaces (or specified pad string). + * "." followed by a number - + precision of n, simple strings truncate after this (if precision is + greater than field size, then field size = precision), tables use + precision to specify the number of columns (if precision not specified + then tables calculate a best fit), all other types ignore this. + * ":" followed by a number - + n specifies the fs _and_ the precision, if n is prepended by a zero + then it is padded with zeros instead of spaces. + * "@" - + the argument is an array. the corresponding format_info (minus the + "@") is applyed to each element of the array. + * "'X'" - + The char(s) between the single-quotes are used to pad to field + size (defaults to space) (if both a zero (in front of field + size) and a pad string are specified, the one specified second + overrules). NOTE: to include "'" in the pad string, you must + use "\'" (as the backslash has to be escaped past the + interpreter), similarly, to include "\" requires "\\\\". + </DL> + + The following are the possible type specifiers. + <DL> + * % - + in which case no arguments are interpreted, and a "%" is inserted, and + all modifiers are ignored. + * O - + the argument is an LPC datatype. The format is suitable for printing any + type (useful for debugging) + * s - + the argument is a string. + * d or i - + the integer arg is printed in decimal. + * c - + the integer arg is to be printed as a character. + * o - + the integer arg is printed in octal. + * x - + the integer arg is printed in hex. + * X - + the integer arg is printed in hex (with A-F in capitals). + * f - + floating point number + </DL> + + See also: + sscanf, + sprintf + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/program_info ds2.0r27/lib/doc/efun/all/program_info *** ds1.1/lib/doc/efun/all/program_info Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/program_info Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + program_info - returns information about program memory usage + + string program_info(); + + string program_info(object ob); + + Returns a summary of the memory usage of the program for a given object. + If no program is specified, a summary of the memory usage of all loaded + programs is returned. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/query_ed_mode ds2.0r27/lib/doc/efun/all/query_ed_mode *** ds1.1/lib/doc/efun/all/query_ed_mode Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/query_ed_mode Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,21 ---- + query_ed_mode - return which mode ed is in + + This efun is only available if OLD_ED is not defined. + + int query_ed_mode(); + + Return value should be interpreted as follows: + + 0 = normal ed prompt + + -1 = not in ed + + -2 = more prompt for help + + positive number = prompt for input for line n + + See also: + ed, + ed_start + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/query_heart_beat ds2.0r27/lib/doc/efun/all/query_heart_beat *** ds1.1/lib/doc/efun/all/query_heart_beat Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/query_heart_beat Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + query_heart_beat() - query the status of an object's heartbeat + + int query_heart_beat( object ); + + Returns the value with which set_heart_beat() has been called with on + 'object'. If object is not given, it defaults to the current object. If + the object has no heart beat, 0 will be returned. + + See also: + heart_beat, + set_heart_beat + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/query_host_name ds2.0r27/lib/doc/efun/all/query_host_name *** ds1.1/lib/doc/efun/all/query_host_name Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/query_host_name Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + query_host_name - return the host name + + string query_host_name(); + + query_host_name() returns the name of the host. + + See also: + resolve, + socket_address, + query_ip_name, + query_ip_number + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/query_idle ds2.0r27/lib/doc/efun/all/query_idle *** ds1.1/lib/doc/efun/all/query_idle Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/query_idle Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + query_idle - determine how many seconds an interactive player has been idle + + int query_idle( object ob ); + + Query how many seconds a player object (ob) has been idling. + + See also: + in_edit, + in_input + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/query_ip_name ds2.0r27/lib/doc/efun/all/query_ip_name *** ds1.1/lib/doc/efun/all/query_ip_name Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/query_ip_name Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + query_ip_name - return the ip name of a given player object. + + string query_ip_name( object ob ); + + Return the IP address for player `ob'. An asynchronous process `addr_server' + is used to find out these name in parallel. If there are any failures to + find the ip-name, then the ip-number is returned instead. + + See also: + query_ip_number, + query_host_name, + resolve, + socket_address + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/query_ip_number ds2.0r27/lib/doc/efun/all/query_ip_number *** ds1.1/lib/doc/efun/all/query_ip_number Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/query_ip_number Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + query_ip_number - return the ip number for a player object + + string query_ip_number( object ob ); + + Return the ip-number (dotted decimal form) for player `ob'. + + See also: + query_ip_name, + query_host_name, + resolve, + socket_address + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/query_ip_port ds2.0r27/lib/doc/efun/all/query_ip_port *** ds1.1/lib/doc/efun/all/query_ip_port Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/query_ip_port Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,18 ---- + query_ip_port - return the ip port of a given player object. + + int query_ip_port(object | void); + + Returns the local port that the argument object used to connect to + the mud. If the argument is void, return the local port that + this_player() used to connect to the mud. Calling this on + non-interactive objects will return 0. + + This function requires PACKAGE_CONTRIB to be defined in the options file. + + See also: + query_ip_name, + query_host_name, + resolve, + socket_address + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/query_load_average ds2.0r27/lib/doc/efun/all/query_load_average *** ds1.1/lib/doc/efun/all/query_load_average Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/query_load_average Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + query_load_average - forces an error to occur in an object + + string query_load_average(); + + This function returns a string which reports two things: 1) user commands + per second, and 2) compiled lines per second. + + See also: + rusage + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/query_notify_fail ds2.0r27/lib/doc/efun/all/query_notify_fail *** ds1.1/lib/doc/efun/all/query_notify_fail Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/query_notify_fail Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,17 ---- + query_notify_fail - Query if an interactive object has a pending notify_fail() + + mixed query_notify_fail(void); + + This function returns whatever this_player()'s notify_fail value + has been set to. This is either a string, or a function, depending + on what it has been set to by the most recent call to notify_fail() + that applied to this_player(). + + This function requires PACKAGE_CONTRIB to be defined in the options file. + This function also requires that the NO_ADD_ACTION option NOT be defined. + + See also: + add_action, + notify_fail + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/query_privs ds2.0r27/lib/doc/efun/all/query_privs *** ds1.1/lib/doc/efun/all/query_privs Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/query_privs Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + query_privs - return the privs string for an object + + string query_privs( object ob ); + + Returns the privs string for an object. The privs string is determined + at compile time via a call to privs_file() in the master object, and changeable + via the set_privs() efun. + + This efun is only available if PRIVS is defined at driver compile time. + + See also: + privs_file, + set_privs + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/all/query_shadowing ds2.0r27/lib/doc/efun/all/query_shadowing *** ds1.1/lib/doc/efun/all/query_shadowing Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/query_shadowing Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + query_shadowing - determine whether or not a given object it shadowing another + + object query_shadowing( object ob ); + + This efun is only available if NO_SHADOWS is not compiled in. + + Returns the object that `ob' is shadowing, or zero (0) if it is not + shadowing any object. + + See also: + shadow, + valid_shadow + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/query_snoop ds2.0r27/lib/doc/efun/all/query_snoop *** ds1.1/lib/doc/efun/all/query_snoop Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/query_snoop Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,10 ---- + query_snoop - return the snooper of an interactive object + + object query_snoop( object ob ); + + If `ob' (an interactive object) is being snooped by another interactive object, + the snooping object is returned. Otherwise, 0 is returned. + + See also: + snoop, + query_snooping diff -c -r --new-file ds1.1/lib/doc/efun/all/query_snooping ds2.0r27/lib/doc/efun/all/query_snooping *** ds1.1/lib/doc/efun/all/query_snooping Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/query_snooping Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + query_snooping - return the object than an object is snooping + + object query_snooping( object ob ); + + If `ob' (an interactive object) is snooping another interactive object, the + snooped object is returned. Otherwise, 0 is returned. + + See also: + snoop, + query_snoop + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/query_verb ds2.0r27/lib/doc/efun/all/query_verb *** ds1.1/lib/doc/efun/all/query_verb Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/query_verb Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + query_verb - return the name of the command currently being executed + + string query_verb(); + + This efun is only available if NO_ADD_ACTION is not compiled in. + + Give the name of the current command, or 0 if not executing from a command. + This function is useful when several commands (verbs) may cause the same + function to execute and it is necessary to determine which verb it was + that invoked the function. + + See also: + add_action + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/random ds2.0r27/lib/doc/efun/all/random *** ds1.1/lib/doc/efun/all/random Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/random Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,7 ---- + random - return a pseudo-random number + + int random( int n ); + + Return a pseudo-random number from the range [0 .. (n -1)] (inclusive). + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/read_buffer ds2.0r27/lib/doc/efun/all/read_buffer *** ds1.1/lib/doc/efun/all/read_buffer Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/read_buffer Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,26 ---- + read_buffer - read from a file and return a buffer + + mixed read_buffer( mixed src, int start, int len); + + This efun is only available if DISALLOW_BUFFER_TYPE is not compiled in. + + If 'src' is a string (filename), then the filename will be read, starting + at byte # 'start', for 'len' bytes, and returned as a buffer. If neither + argument is given, the entire file is read. + + If 'src' is a buffer, then characters are read from the buffer beginning + at byte # 'start' in the buffer, and for 'len' # of bytes, and returned + as a string. + + Note that the maximum number of bytes you can read from a file and into + a buffer is controlled via the 'maximum byte transfer' parameter in the + runtime config file. + + See also: + write_buffer, + allocate_buffer, + bufferp, + read_bytes, + write_bytes + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/read_bytes ds2.0r27/lib/doc/efun/all/read_bytes *** ds1.1/lib/doc/efun/all/read_bytes Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/read_bytes Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + read_bytes - reads a contiguous series of bytes from a file into a string + + string read_bytes( string path, int start, int length ); + + This function reads 'length' bytes beginning at byte # 'start' in the + file named 'path'. The bytes are returned as a string. Note that + (start + length) must not be past the end of the file or else read_bytes + will fail. If the second and third arguments are omitted, the entire file + is returned. + + See also: + read_file, + write_bytes diff -c -r --new-file ds1.1/lib/doc/efun/all/read_file ds2.0r27/lib/doc/efun/all/read_file *** ds1.1/lib/doc/efun/all/read_file Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/read_file Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + read_file - read a file into a string + + string read_file( string file, int start_line, int number_of_lines ); + + Read a line of text from a file into a string. The second and third + arguments are optional. If only the first argument is specified, the + entire file is returned (as a string). + + The start_line is the line number of the line you wish to read. This routine + will return 0 if you try to read past the end of the file, or if you try to + read from a nonpositive line. + + See also: + write_file, + read_buffer diff -c -r --new-file ds1.1/lib/doc/efun/all/receive ds2.0r27/lib/doc/efun/all/receive *** ds1.1/lib/doc/efun/all/receive Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/receive Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + receive - displays a message to the current object + + int receive( string message ); + + This efun is an interface to the add_message() function in the driver. + Its purpose is to display a message to the current object. It returns 1 + if the current object is interactive, 0 otherwise. Often, receive() is + called from within catch_tell() or receive_message(). + + See also: + catch_tell, + receive_message, + message + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/reclaim_objects ds2.0r27/lib/doc/efun/all/reclaim_objects *** ds1.1/lib/doc/efun/all/reclaim_objects Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/reclaim_objects Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + reclaim_objects - reclaim any lingering objects + + int reclaim_objects(); + + Cycles through all objects that are loaded, and frees any lingering objects + that it can. This could result in a sizable amount of memory being freed up, + depending on how the mud is coded. Objects are typically left lingering + when a global variable in more than one object contains a pointer to it, + and the object gets destructed, but the values containing pointers to the + object are never accessed again. This efun returns the number of destructed + objects encountered in variables. + + See also: + destruct + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/refs ds2.0r27/lib/doc/efun/all/refs *** ds1.1/lib/doc/efun/all/refs Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/refs Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + refs - return the number of references to a data structure + + int refs( mixed data ); + + This efun is only available if PACKAGE_DEVELOP is compiled in. + + The number of references to `data' will be returned by refs(). This is + useful for deciding whether or not to make a copy of a data structure + before returning it. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/reg_assoc ds2.0r27/lib/doc/efun/all/reg_assoc *** ds1.1/lib/doc/efun/all/reg_assoc Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/reg_assoc Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,55 ---- + reg_assoc - A regular pattern substring extractor + + array reg_assoc(string str, string array pat_arr, array tok_arr); + + array reg_assoc(string str, string array pat_arr, array tok_arr, mixed def); + + reg_assoc() takes a string and explodes it into substrings matching + the regular expression pattern strings given in pat_arr and associates + them with tokens given in tok_arr. If def (default 0) is given, it + is associated with a non-match. The return value is an array of + two arrays, the 1st being an array of the form + <pre> + ({ non-match1, match1, non-match2, match2, ..., + non-match n, match n, non-match n+1 }) + </pre> + and the 2nd holds the tokens corresponding to the matches in order: + <pre> + ({ def, token corresponding to match1, ...., def, + token corresponding to match n, def }). + </pre> + + pat_arr and tok_arr must be of the same sizes, the ith element in + tok_arr being the corresponding token to the ith element of pat_arr. + pat_arr can only hold strings. + + If pat_arr (and hence tok_arr) has size 0 then the return value is + simply ({ ({ str }), ({ def }) }). + + EXAMPLE + + <pre> + #define STRING_PAT "\e"(\e\e\e\e.|[^\e\e\e"])*\e"" + #define NUM_PAT "[0\-9]+" + + #define F_STRING 1 + #define F_NUM 2 + + reg_assoc("Blah \e"blah\e" test 203 hhh j 308 \e"bacdcd\eb\e"acb", + ({ STRING_PAT, NUM_PAT }), ({ F_STRING, F_NUM }), "no-match") + </pre> + + will return + + <pre> + ({ ({ "Blah ", "\e"blah\e"", " test ", "203", " hhh j ", "308", " ", + "\e"bacdcd\eb\e"", "acb" }), + ({ "no-match", F_STRING, "no-match", F_NUM, "no-match", F_NUM, + "no-match", F_STRING, "no-match" }) }) + </pre> + + See also: + + regexp [for regular expression syntax] + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/regexp ds2.0r27/lib/doc/efun/all/regexp *** ds1.1/lib/doc/efun/all/regexp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/regexp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,93 ---- + regexp - regular expression handler + + int regexp( string str, string pattern); + + string array regexp( string array lines, string pattern); + + string array regexp( string array lines, string pattern, int flag); + + In the first version, regexp() returns true (1) if the string str contains + a substring which matches the regular expression 'pattern'. If a complete + match is wanted, the pattern should begin with ^ and end with $. + + When presented with an array of lines of text and a regular + expression, regexp() returns an array containing those lines which + match the pattern specified by the regular expression. If the (flag & 2) + is nonzero, (flag defaults to zero), then non-matches will be returned + instead of matches. If (flag & 1) is nonzero, the array returned will be of + the form ({ index1 + 1, match1, ..., indexn + 1, matchn }) where indexn + is the index of nth match/non match in the array lines. + + REGULAR EXPRESSION SYNTAX + + A regular expression is zero or more <b>branches</b>, separated by '|'. + It matches anything that matches one of the branches. + + A <b>branch</b> is zero or more <i>pieces</i>, concatenated. + It matches a match for the first, followed by a match for the second, etc. + + A <b>piece</b> is an <i>atom</i> possibly followed by '*', '+', or '?'. + An atom followed by '*' matches a sequence of 0 or more matches of the atom. + An atom followed by '+' matches a sequence of 1 or more matches of the atom. + An atom followed by '?' matches a match of the atom, or the null string. + + An <b>atom</b> is a regular expression in parentheses (matching a match for the + regular expression), a <i>range</i> (see below), '.' + (matching any single character), '^' (matching the null string at the + beginning of the input string), '$' (matching the null string at the + end of the input string), a '\e' followed by a single character (matching + that character), or a single character with no other significance + (matching that character). + + A <b>range</b> is a sequence of characters enclosed in '[]'. + It normally matches any single character from the sequence. + If the sequence begins with '^', + it matches any single character <b>not</b> from the rest of the sequence. + If two characters in the sequence are separated by '-', this is shorthand + for the full list of ASCII characters between them + (e.g. '[0-9]' matches any decimal digit). + To include a literal ']' in the sequence, make it the first character + (following a possible '^'). + To include a literal '-', make it the first or last character. + + AMBIGUITY + + If a regular expression could match two different parts of the input string, + it will match the one which begins earliest. + If both begin in the same place but match different lengths, or match + the same length in different ways, life gets messier, as follows. + + In general, the possibilities in a list of branches are considered in + left-to-right order, the possibilities for '*', '+', and '?' are + considered longest-first, nested constructs are considered from the + outermost in, and concatenated constructs are considered leftmost-first. + The match that will be chosen is the one that uses the earliest + possibility in the first choice that has to be made. + If there is more than one choice, the next will be made in the same manner + (earliest possibility) subject to the decision on the first choice. + And so forth. + + For example, '(ab|a)b*c' could match 'abc' in one of two ways. + The first choice is between 'ab' and 'a'; since 'ab' is earlier, and does + lead to a successful overall match, it is chosen. + Since the 'b' is already spoken for, + the 'b*' must match its last possibility (the empty string) since + it must respect the earlier choice. + + In the particular case where no '|'s are present and there is only one + '*', '+', or '?', the net effect is that the longest possible + match will be chosen. + So 'ab*', presented with 'xabbbby', will match 'abbbb'. + Note that if 'ab*' is tried against 'xabyabbbz', it + will match 'ab' just after 'x', due to the begins-earliest rule. + (In effect, the decision on where to start the match is the first choice + to be made, hence subsequent choices must respect it even if this leads them + to less-preferred alternatives.) + + See also: + + sscanf, + explode, + strsrch + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/reload_object ds2.0r27/lib/doc/efun/all/reload_object *** ds1.1/lib/doc/efun/all/reload_object Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/reload_object Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + reload_object - return an object to its just-loaded state + + void reload_object( object ob ); + + When reload_object() is called on `ob', all the driver-maintained properties + are re-initialized (heart_beat, call_outs, light, shadows, etc), all + variables are re-initialized, and create() is called. It has a similar + effect to destructing/reloading the object, however, no disk access or + parsing is performed. + + See also: + new, + clone_object, + destruct + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/remove_action ds2.0r27/lib/doc/efun/all/remove_action *** ds1.1/lib/doc/efun/all/remove_action Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/remove_action Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,18 ---- + remove_action - unbind a command verb from a local function + + int remove_action( string fun, string cmd ); + + This efun is only available if NO_ADD_ACTION is not compiled in. + + remove_action() unbinds a verb cmd from an object function fun. Basically, + remove_action() is the complement to add_action(). When a + verb is no longer required, it can be unbound with remove_action(). + + remove_action() returns 1 on success and 0 on failure. + + See also: + add_action, + query_verb, + init + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/remove_call_out ds2.0r27/lib/doc/efun/all/remove_call_out *** ds1.1/lib/doc/efun/all/remove_call_out Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/remove_call_out Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + remove_call_out - remove a pending call_out + + int remove_call_out( string fun | int handle ); + + Remove next pending call out for function `fun' in the current object, + or the call_out() which returned the integer 'handle'. + The return value is the time remaining before the callback is to be called. + The returned value is -1 if there were no call out pending to this function. + If fun is zero, all the call_outs of the object are removed. + + See also: + call_out, + call_out_info + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/remove_interactive ds2.0r27/lib/doc/efun/all/remove_interactive *** ds1.1/lib/doc/efun/all/remove_interactive Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/remove_interactive Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + remove_interactive - disconnect an interactive object. + + int remove_interactive(object); + + If the argument object is interactive, and not destructed, cause it to + be disconnected. (i.e lose it's interactive status). Returns 1 if + the operation succeeded, or 0 if it didn't ( object destructed, or not + interactive) + + This function requires PACKAGE_CONTRIB to be defined in the options file. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/remove_shadow ds2.0r27/lib/doc/efun/all/remove_shadow *** ds1.1/lib/doc/efun/all/remove_shadow Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/remove_shadow Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + remove_shadow - clear all the shadows related to an object. + + int remove_shadow(object); + + This function removes ALL shadows associated with the object passed + as the argument. Note this means all shadows ON the object, and all shadows + ORIGINATED by the object. + + This function requires PACKAGE_CONTRIB to be defined in the options file. + This function also requires that the option NO_SHADOWS be undefined. + + See also: + shadow + diff -c -r --new-file ds1.1/lib/doc/efun/all/rename ds2.0r27/lib/doc/efun/all/rename *** ds1.1/lib/doc/efun/all/rename Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/rename Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + rename - rename a file + + int rename( string src, string dst ); + + Renames the file 'src' to 'dst'. + + rename() returns zero (0) to indicate success. Nonzero indicates failure. + + See also: + rm, + rmdir, + cp, + link diff -c -r --new-file ds1.1/lib/doc/efun/all/repeat_string ds2.0r27/lib/doc/efun/all/repeat_string *** ds1.1/lib/doc/efun/all/repeat_string Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/repeat_string Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + repeat_string - repeat a string a specified number of times. + + string repeat_string(string, int); + + repeat_string returns a string that consists of its first argument + repeated n times, where 'n' is repeat_string's second argument. + So repeat_string("foo", 3) would return "foofoofoo". + + This function requires PACKAGE_CONTRIB to be defined in the options file. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/replace_program ds2.0r27/lib/doc/efun/all/replace_program *** ds1.1/lib/doc/efun/all/replace_program Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/replace_program Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,18 ---- + replace_program - replaces the program in this_object() + + void replace_program( string str ); + + replace_program() replaces the program in this_object() with that of an + object it inherits. The string argument is the filename of the object + whose program is to be used. Once the replacement takes place, the current + object effectively becomes a clone of that other object, but with its + current filename and global variable values. The program is not actually + replaced until the current execution is completed. + + Note that one effect of this is that all functions defined in the object + no longer exist, being replaced by the functions in the inherited program, + so this routine should not be called if one of those functions might be + called later (and in particular, create() needs to exist if you intend to + clone from the object). + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/replace_string ds2.0r27/lib/doc/efun/all/replace_string *** ds1.1/lib/doc/efun/all/replace_string Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/replace_string Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,47 ---- + replace_string - replace all instances of a string within a string + + string replace_string( string str, string pattern, string replace ); + + string replace_string( string str, string pattern, string replace, int max ); + + string replace_string( string str, string pattern, string replace, int first, int last ); + + replace_string() returns 'str' with all instances of 'pattern' replaced with + 'replace'. If 'pattern' has zero length then str is returned unmodified. + If the resultant string would exceed the maximum string length then + replace_string() returns an undefinedp(), non-stringp() value. + + replace_string() can be used to remove characters from a string by + specifying a pattern and a zero-length replace parameter. For example, + replace_string(" 1 2 3 ", " ", "") would return "123". replace_string() + executes faster this way then explode()/implode(). + + The 4th and 5th arguments are optional (to retain backward compatibility.) + The extra arguments have the following effect: + + With 4 args: + + The 4th argument specifies the maximum number of replacements + to make (the count starts at 1). A value of 0 implies 'replace all', and + thus, acts as replace_string() with 3 arguments would. E.g., + replace_string("xyxx", "x", "z", 2) would return "zyzx". + + With 5 args: + + The 4th and 5th arguments specify the range of matches to replace + between, with the following constraints: + + <DL> + * first < 1 : change all from the start. + * last == 0, or last > max_matches : change all to end + * first > last : return the unmodified array. + </DL> + + E.g., replace_string("xyxxy", "x", "z", 2, 3) returns "xyzzy". + + See also: + sscanf, + explode, + strsrch + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/replaceable ds2.0r27/lib/doc/efun/all/replaceable *** ds1.1/lib/doc/efun/all/replaceable Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/replaceable Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,23 ---- + replaceable - determine whether any functions are defined in at this level + + int replaceable(object ob); + + int replaceable(object ob, string array fnames); + + In the second form, return 0 if the program for object ob defines any + functions explicitly, as opposed to simply inheriting. Function names + in the array fnames are ignored. If no such functions are defined, 1 + is returned. If the second argument is omitted, it defaults to + ({ "create" }). The purpose of this efun is to assist in making + automatic decisions on whether to call replace_program(). Note that + the default version ignores create(), so it is only safe to replace a + object for which replaceable() returns true if you never intend to + clone from that object. + + See also: + replace_program, + functions, + function_exists, + inherit_list + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/reset_eval_cost ds2.0r27/lib/doc/efun/all/reset_eval_cost *** ds1.1/lib/doc/efun/all/reset_eval_cost Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/reset_eval_cost Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + reset_eval_cost - resets the evaluation cost remaining + + void reset_eval_cost(); + + reset_eval_cost() resets the evaluation cost remaining to the maximum + evaluation cost. + + See also: + eval_cost, + set_eval_limit + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/resolve ds2.0r27/lib/doc/efun/all/resolve *** ds1.1/lib/doc/efun/all/resolve Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/resolve Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,22 ---- + resolve - resolve an internet address to domain name + + int resolve( string address, string callback_func ); + + resolve() resolves `address', which should be an internet address in the form + "127.0.0.1" or a domain name, into its domain name, or internet address. + When the resolve is complete, `callback_func' will be called in the + current object. The form of the callback is: + + void callback(string address, string resolved, int key); + + `key' will match up with the number that the call to resolve() returned. + `address' will be the domain name of the host, and `resolved' the dotted + decimal ip address. The unknown value will be 0 if the lookup failed. + + See also: + query_host_name, + socket_address, + query_ip_name, + query_ip_number + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/restore_object ds2.0r27/lib/doc/efun/all/restore_object *** ds1.1/lib/doc/efun/all/restore_object Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/restore_object Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + restore_object - restore values of variables from a file into an object + + int restore_object( string name, int flag ); + + Restore values of variables for current object from file `name'. If the + optional second argument is 1, then all of the non-static variables are not + zeroed out prior to restore (normally, they are). + + In the case of an error, the affected variable will be left untouched + and an error given. + + See also: + save_object + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/restore_variable ds2.0r27/lib/doc/efun/all/restore_variable *** ds1.1/lib/doc/efun/all/restore_variable Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/restore_variable Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + restore_variable - restore value of a variable from a string + + mixed restore_variable( string value ); + + Restores an LPC value from a string. The format used is the + same format as save/restore_object. + + See also: + save_variable, + restore_object + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/rm ds2.0r27/lib/doc/efun/all/rm *** ds1.1/lib/doc/efun/all/rm Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/rm Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + rm - remove a file + + int rm( string file ); + + Remove file `file'. Returns 0 for failure and 1 for success. + + See also: + mkdir, + rmdir, + link + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/rmdir ds2.0r27/lib/doc/efun/all/rmdir *** ds1.1/lib/doc/efun/all/rmdir Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/rmdir Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + rmdir - remove a directory + + int rmdir( string dir ); + + Remove directory `dir'. + Returns nonzero for success, zero (0) for failure. + + See also: + rm, + mkdir, + link diff -c -r --new-file ds1.1/lib/doc/efun/all/rusage ds2.0r27/lib/doc/efun/all/rusage *** ds1.1/lib/doc/efun/all/rusage Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/rusage Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,35 ---- + rusage - reports information gathered by the getrusage() system call + + mapping rusage(); + + This efun collects information gathered via the getrusage() system + call. Read the getrusage() man page for more information on what information + will be collected. Some systems do not have the getrusage() system call + but do have the times() system call. On those systems, only "utime" + and "stime" will be available. Times are reported in milliseconds. + + Here is an example usage of rusage(): + + <pre> + void + create() + { + mapping info; + + info = rusage(); + write("user time = " + info["utime"] + "ms\\n"); + write("system time = " + info["stime"] + "ms\\n"); + } + </pre> + + The available fields are: + utime, stime, maxrss, ixrss, idrss, isrss, minflt, majflt, nswap, inblock, + oublock, msgsnd, msgrcv, nsignals, nvcsw, nivcsw. + + See also: + time_expression, + function_profile, + time, + uptime + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/save_object ds2.0r27/lib/doc/efun/all/save_object *** ds1.1/lib/doc/efun/all/save_object Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/save_object Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + save_object - save the values of variables in an object into a file + + int save_object( string name, int flag ); + + Save all values of non-static variables in this object in the file 'name'. + valid_write() in the master object determines whether this is allowed. + If the optional second argument is 1, then variables that are zero (0) are also + saved (normally, they aren't). Object variables and function pointers + always save as 0. save_object() returns 1 for success, 0 for failure. + + See also: + restore_object + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/save_variable ds2.0r27/lib/doc/efun/all/save_variable *** ds1.1/lib/doc/efun/all/save_variable Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/save_variable Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,10 ---- + save_variable - save the value of variable into a string + + string save_variable( mixed var ); + + Saves an LPC value into a string. The format is the same as + save/restore_object. + + See also: + restore_variable, + restore_object diff -c -r --new-file ds1.1/lib/doc/efun/all/say ds2.0r27/lib/doc/efun/all/say *** ds1.1/lib/doc/efun/all/say Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/say Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,22 ---- + say - send a message to all users in the same environment + + varargs void say( string str, object | object array ); + + Sends a message to the environment of the originator, all items in the + same environment, and all items inside of the originator. The originator + is this_player(), unless this_player() == 0, in which case, the originator + is this_object(). + + The second argument is optional. If second argument `obj' is specified, + the message is sent to all except `obj'. If `obj' is not an object, but + an array of objects, all those objects are excluded from receiving the + message. + + See also: + message, + write, + shout, + tell_object, + tell_room + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/set_author ds2.0r27/lib/doc/efun/all/set_author *** ds1.1/lib/doc/efun/all/set_author Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/set_author Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,23 ---- + set_author - set the author associated with an object + + void set_author( string author ); + + Every object has both an author and a domain associated with it for + the purposes of tracking statistics for authors and domains. Domains + may only be set in the master object function domain_file(), however + authors are different. They can be initialized to some default value + by author_file() in the master object, but can also be changed using + the set_author efun. + + set_author changes the author of the object that it is called within. + That author will get credit for all future actions of that object that + affect mudlib statistics. + + See also: + author_file, + domain_file, + author_stats, + set_author, + domain_stats + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/set_bit ds2.0r27/lib/doc/efun/all/set_bit *** ds1.1/lib/doc/efun/all/set_bit Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/set_bit Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + set_bit - set a bit in a bitstring + string set_bit( string str, int n ); + + Return the new string where bit 'n' is set in string 'str'. Note that the old string 'str' is not modified. + + The maximum value of 'n' is limited by the value of the 'maximum bits in a bitfield' entry in the driver config file. + + The new string will automatically be extended if needed. + + Bits are packed 6 per byte in printable strings. + + See also: clear_bit , test_bit + + Tim Hollebeek + Beek @ZorkMUD, Lima Bean, IdeaExchange, TMI-2, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/set_debug_level ds2.0r27/lib/doc/efun/all/set_debug_level *** ds1.1/lib/doc/efun/all/set_debug_level Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/set_debug_level Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + set_debug_level - sets the debug level used by the driver's debug() macro + + void set_debug_level( int level ); + + This efun is only available when the driver is compiled with -DDEBUG_MACRO. + The purpose of this efun is to allow the amount and type of debugging + information produced to be controlled from within the mud (while the + driver is running). + + For more information, read the file debug.h which is included with the + driver source. + + See also: + set_malloc_mask + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/set_eval_limit ds2.0r27/lib/doc/efun/all/set_eval_limit *** ds1.1/lib/doc/efun/all/set_eval_limit Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/set_eval_limit Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + set_eval_limit - set the maximum evaluation cost + + void set_eval_limit( int ); + + set_eval_limit(), with a nonzero argument, sets the maximum evaluation + cost that is allowed for any one thread before a runtime error occurs. + With a zero argument, it sets the current evaluation counter to zero, + and the maximum cost is returned. set_eval_limit(-1) returns the + remaining evaluation cost. + + See also: + eval_cost + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/all/set_heart_beat ds2.0r27/lib/doc/efun/all/set_heart_beat *** ds1.1/lib/doc/efun/all/set_heart_beat Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/set_heart_beat Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + set_heart_beat - enable or disable an object's heartbeat + + int set_heart_beat( int flag ); + + Passing 'flag' as 0 disables the object's heart beat. Passing a 'flag' of + 1 will cause heart_beat() to be called in the object once each heart beat + (a variable number defined by your local administrator, usually 2 seconds). + Passing a 'flag' of greater than 1 will usually set the number of heart beats + in between calls to heart_beat(), however your local administrator may have + the system configured to treat any 'flag' above 1 as 1. + + See also: + heart_beat, + query_heart_beat + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/set_hide ds2.0r27/lib/doc/efun/all/set_hide *** ds1.1/lib/doc/efun/all/set_hide Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/set_hide Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + set_hide - set the hide flag on a hidable object + + void set_hide( int flag ); + + Sets the hidden flag of an object to `flag', which should be 0 or 1 + (hide disable, or hide enable, respectively). Only objects for which + `master()->valid_hide(ob)' returns true may make themselves hidden. + When the object is hidden, only other hidable objects will be able to + find the object with find_object(), or multiple-object returning efuns such + as users(), children(), all_inventory(), etc. + + See also: + valid_hide + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/set_light ds2.0r27/lib/doc/efun/all/set_light *** ds1.1/lib/doc/efun/all/set_light Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/set_light Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,17 ---- + set_light - update or query an object's light level + + int set_light( int light_level_adjustment ); + + This efun is only available if NO_LIGHT is not compiled in. + + Passing 'light_level_adjustment' as 0 queries the object's current + light level. A positive number will increase the light level, while + a negative number will decrease the light level. + + Note that the object's current light level includes the light it sees from + other objects. + + This efun is provided mostly for backwards compatibility; it really should + be handled by the mudlib. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/set_living_name ds2.0r27/lib/doc/efun/all/set_living_name *** ds1.1/lib/doc/efun/all/set_living_name Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/set_living_name Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + set_living_name - set a living name for a living object + + void set_living_name( string name ); + + This efun is only available if NO_ADD_ACTION is not compiled in. + + Set a living name on an object that is living. After this has been done, the + object can be found with "find_living()". + + See also: + enable_commands, + find_living, + find_player + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/set_malloc_mask ds2.0r27/lib/doc/efun/all/set_malloc_mask *** ds1.1/lib/doc/efun/all/set_malloc_mask Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/set_malloc_mask Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + set_malloc_mask - sets the mask controlling display of malloc debug info + + void set_malloc_mask( int mask ); + + This efun is only available when PACKAGE_DEVELOP, DEBUGMALLOC and DEBUGMALLOC_EXTENSIONS are + both defined in options.h at driver build time. The mask controls what + memory-related debugging information is displayed as the driver allocates + and deallocates memory. Read md.c in the driver source for more information. + + See also: + debugmalloc + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/set_privs ds2.0r27/lib/doc/efun/all/set_privs *** ds1.1/lib/doc/efun/all/set_privs Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/set_privs Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + set_privs - set the privs string for an object + + void set_privs( object ob, string privs ); + + This efun is only available when PRIVS is compiled in. + + Sets the privs string for 'ob' to 'privs'. + + This efun is only available if PRIVS is defined at driver compile time. + + See also: + privs_file, + query_privs + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/set_reset ds2.0r27/lib/doc/efun/all/set_reset *** ds1.1/lib/doc/efun/all/set_reset Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/set_reset Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,18 ---- + set_reset - modify the time until reset on an object + + varargs void set_reset( object ob, int time ); + + This efun is only available if NO_RESETS is not compiled in. + + Sets the time until reset on 'ob' to 'time' seconds from now. If 'time' + is omitted, the driver's normal reset time setting formula is applied + to 'ob', that is, + <pre> + reset time = current_time + reset_time / 2 + random(reset_time / 2) + </pre> + + See also: + reset + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/all/set_this_player ds2.0r27/lib/doc/efun/all/set_this_player *** ds1.1/lib/doc/efun/all/set_this_player Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/set_this_player Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + set_this_player - change the value of the current command giver. + + void set_this_player(object); + + This function changes the value of what this_player() returns during the + current execution. If the argument is an object, this_player() will return + the argument object. If it is an int, this_player() will return 0. + + This function requires the NO_ADD_ACTION option be defined in the + options file. + + See also: + this_player + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/seteuid ds2.0r27/lib/doc/efun/all/seteuid *** ds1.1/lib/doc/efun/all/seteuid Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/seteuid Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,21 ---- + seteuid - set the effective user id (euid) of an object + + int seteuid( string str ); + + This efun is only available if PACKAGE_UIDS is compiled in. + + Set effective uid to 'str'. valid_seteuid() in master.c controls which + values the euid of an object may be set to. + + When this value is 0, then the current object's uid can be changed by + export_uid(), and only then. + + But, when the value is 0, no objects can be loaded or cloned by this object. + + See also: + export_uid, + getuid, + geteuid, + valid_seteuid + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/shadow ds2.0r27/lib/doc/efun/all/shadow *** ds1.1/lib/doc/efun/all/shadow Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/shadow Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,41 ---- + shadow - shadow one or more functions in some object + + object shadow( object ob, int flag ); + + This efun is only available if NO_SHADOWS is not compiled in. + + If 'flag' is 1 or missing, then current object will shadow 'ob'. If + 'flag' is 0, then either 0 will be returned, or the object that is + already shadowing 'ob'. + + The master object defines the function "valid_shadow()". If it returns 1 + the target object can't be shadowed, and the "shadow()" function will + return 0 instead of 'ob'. + + If an object 'a' shadows an object 'b', then all "call_other(func)" to 'b' + will be redirected to 'a'. If object 'a' has not defined the function, + then the call will be forwarded to 'b' (as if there were no shadow). + There is only one object that can call functions in 'b' with + call_other(), and that is 'a'. Not even object 'b' can "call_other()" + itself. All normal (internal) function calls inside 'b' will however remain + internal to 'b'. + + There are two ways to remove the shadow. Either destruct it, or the object + that was shadowed. In the latter case, the shadow will also be destructed + automatically. Also, there is a efun remove_shadow() in the contrib package. + + The result is that it is possible to hide an object behind another one, + but everything can be totally transparent. The shadow() efunction makes + it possible to change the behavior of an object without changing the + code for the object in question. One possible use for shadow() is to + add special capabilities to various classes of players (thief, fighter, + mage, etc). This usage would make it possible to keep the player object + much simpler than it could be if the code for the various classes had + to be in the player object itself. + + See also: + destruct, + query_shadowing, + valid_shadow + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/shallow_inherit_list ds2.0r27/lib/doc/efun/all/shallow_inherit_list *** ds1.1/lib/doc/efun/all/shallow_inherit_list Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/shallow_inherit_list Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + shallow_inherit_list - get a list of parents of an object + + string array shallow_inherit_list( object obj ); + + Returns an array of filenames of objects inherited by obj. Only directly + inherited files are returned. E.g. if A inherits B which inherits C, + inherit_list(A) will return an array with B, but not C. + + See also: + deep_inherit_list, + inherit_list, + inherits + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/all/shout ds2.0r27/lib/doc/efun/all/shout *** ds1.1/lib/doc/efun/all/shout Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/shout Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + shout - sends a message to all living objects + + void shout( string str ); + + Sends the string `str' to all living objects except this_player(). + + See also: + message, + write, + tell_object, + tell_room, + say + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/all/shutdown ds2.0r27/lib/doc/efun/all/shutdown *** ds1.1/lib/doc/efun/all/shutdown Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/shutdown Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,23 ---- + shutdown - shutdown the driver + + void shutdown( int how ); + + This function shuts down the driver in a controlled fashion (as opposed to + how a crash would shut it down). The 'how' argument specifes what integer + value that driver should pass to exit(). The convention is to pass 'how' + as -1 when the script that restarts the driver should die as well. Thus + a reboot command would use shutdown() while a halt command would use + shutdown(-1). The script must explicitly check the return value to see + if it is -1 if you wish to use this convention. Obviously, shutdown() + is a sensitive function and should be secured. As with exec(), the way + to make it secure is to add a simul_efun of the same name which does + the appropriate security checks. Be sure to set valid_override() up + (in master.c) to protect against efun::shutdown(). + + See also: + crash, + slow_shutdown, + valid_override + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/all/sin ds2.0r27/lib/doc/efun/all/sin *** ds1.1/lib/doc/efun/all/sin Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/sin Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + sin - return the sine of a float + + float sin( float f ); + + This efun is only available if PACKAGE_MATH is compiled in. + + Returns the sine of its argument, `f', measured in radians. + + See also: + acos, + asin, + atan, + cos, + tan + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/sizeof ds2.0r27/lib/doc/efun/all/sizeof *** ds1.1/lib/doc/efun/all/sizeof Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/sizeof Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,10 ---- + sizeof - return the number of elements in an array + + int sizeof( mixed var ); + + Return the number of elements in an array, mapping, string, class or + buffer 'var'. If `var' is not an array, mapping, string, class or + buffer, then zero (0) is returned. + + See also: + strlen diff -c -r --new-file ds1.1/lib/doc/efun/all/snoop ds2.0r27/lib/doc/efun/all/snoop *** ds1.1/lib/doc/efun/all/snoop Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/snoop Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,20 ---- + snoop - snoop an interactive user + + varargs object snoop( object snooper, object snoopee ); + + When both arguments are used, begins snooping of `snoopee' by + `snooper'. If the second argument is omitted, turns off all snooping + by `snoopee'. Security for snoop() is normally controlled by a + simul_efun. snoop() returns `snoopee' if successful in the + two-argument case, and `snooper' if it was successful in the + single-argument case. A return of 0 indicates failure. + The 'snoopee' must be an interactive object; the snooper can be any + object. However, snooping with a non-interactive object is useless + unless the RECEIVE_SNOOP option is enabled, and the object defines + a RECEIVE_SNOOP function. + + See also: + query_snoop, + query_snooping + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/socket_accept ds2.0r27/lib/doc/efun/all/socket_accept *** ds1.1/lib/doc/efun/all/socket_accept Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/socket_accept Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,74 ---- + socket_accept - accept a connection on a socket + + int socket_accept( int s, string | function read_callback, string | function write_callback ); + + This efun is only available if PACKAGE_SOCKETS is compiled in. + + The argument s is a socket that has been created with socket_create(), + bound to an address with socket_bind(), and is listening for connections + after a socket_listen(). socket_accept() extracts the first connection + on the queue of pending connections, creates a new socket with the same + properties of s and allocates a new file descriptor for the socket. If no + pending connections are present on the queue, socket_accept() returns an + error as described below. The accepted socket is used to read and write data + to and from the socket which connected to this one; it is not used to accept + more connections. The original socket s remains open for accepting further + connections. + + The argument read_callback is the function or name of a function + for the driver to call when the new socket (not the accepting socket) + receives data. + + The write callback should follow this format: + + <pre> + void read_callback(int fd) + </pre> + + Where fd is the socket which is ready to accept data. + + The argument write_callback is the name of a function for the driver to + call when the new socket (not the accepting socket) is ready to be + written to. The write callback should follow this format: + + <pre> + void write_callback(int fd) + </pre> + + Where fd is the socket which is ready to be written to. + + Note: The close_callback of the accepting socket (not the new socket) + is called if the new socket closes unexpectedly, i.e. not as the result + of a socket_close() call. The close callback should follow this format: + + <pre> + void close_callback(int fd) + </pre> + + Where fd is the socket which has closed. + + socket_accept() returns a non-negative descriptor for the accepted + socket on success. On failure, it returns a negative value. socket_error() + can be used on the return value to get a text description of the error. + + ERRORS - these definitions are in socket_err.h + + <DL> + * EEFDRANGE Descriptor out of range. + * EEBADF Descriptor is invalid. + * EESECURITY Security violation attempted. + * EEMODENOTSUPP Socket mode not supported. + * EENOTLISTN Socket not listening. + * EEWOULDBLOCK Operation would block. + * EEINTR Interrupted system call. + * EEACCEPT Problem with accept. + * EENOSOCKS No more available efun sockets. + </DL> + + See also: + socket_bind, + socket_connect, + socket_create, + socket_listen + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/socket_acquire ds2.0r27/lib/doc/efun/all/socket_acquire *** ds1.1/lib/doc/efun/all/socket_acquire Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/socket_acquire Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,32 ---- + socket_acquire - assume ownership of a socket + + int socket_acquire( int socket, string | function read_callback, + string | function write_callback, + string | function close_callback ); + + This efun is only available if PACKAGE_SOCKETS is compiled in. + + socket_acquire() is called to complete the handshake begun by socket_release() + for transferring ownership (and control) of a socket to a new object. + socket_release() calls the release callback function within the new owner + object to notify the object that it wishes to pass control of the socket + on. It is the responsibility of the new owner socket to decide whether + it wishes to accept the socket. It it does, then socket_acquire() is + called to complete the transfer. If not, then the callback simply returns + without completing the handshake. + + In the former case the handshake is completed and the new object + becomes the socket owner. The read, write and close callback function + parameters refer to functions within the new object. These are specified + so that the MudOS driver will know which functions to call within the new + object. Decling to acquire the socket will cause socket_release() to + return EESOCKNOTRLSD so the owner can perform appropriate clean-up. + EESOCKNOTRLSD is in "socket_err.h". + + socket_acquire() may only be called within the context of thr release + callback function and only with the socket specified. + + See also: + socket_release + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/socket_address ds2.0r27/lib/doc/efun/all/socket_address *** ds1.1/lib/doc/efun/all/socket_address Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/socket_address Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,27 ---- + socket_address - return the remote address for an efun socket + + string socket_address( int s | object ob ); + + This efun is only available if PACKAGE_SOCKETS is compiled in. + + socket_address() returns the remote address for an efun socket s, or for + an interactive object ob. + + The returned address is of the form: + + "127.0.0.1 23". + + socket_address() returns: + + a string format address on success. + + an empty string on failure. + + See also: + socket_connect, + socket_create, + resolve, + query_host_name, + query_ip_number + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/socket_bind ds2.0r27/lib/doc/efun/all/socket_bind *** ds1.1/lib/doc/efun/all/socket_bind Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/socket_bind Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,36 ---- + socket_bind - bind a name to a socket + + int socket_bind( int s, int port ); + + This efun is only available if PACKAGE_SOCKETS is compiled in. + + socket_bind() assigns a name to an unnamed socket. When a socket is + created with socket_create() it exists in a name space (address family) + but has no name assigned. socket_bind() requests that the port be assigned + to the socket s. + + socket_bind() returns: + + EESUCCESS on success. + + a negative value indicated below on error. + + ERRORS - These errors are in "socket_err.h" + + <DL> + * EEFDRANGE Descriptor out of range. + * EEBADF Descriptor is invalid. + * EESECURITY Security violation attempted. + * EEISBOUND Socket is already bound. + * EEADDRINUSE Address already in use. + * EEBIND Problem with bind. + * EEGETSOCKNAME Problem with getsockname. + </DL> + + See also: + socket_connect. + socket_create, + socket_listen + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/all/socket_close ds2.0r27/lib/doc/efun/all/socket_close *** ds1.1/lib/doc/efun/all/socket_close Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/socket_close Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,27 ---- + socket_close - close a socket + + int socket_close( int s ); + + This efun is only available if PACKAGE_SOCKETS is compiled in. + + socket_close() closes socket s. This frees a socket efun slot for use. + + socket_close() returns: + + EESUCCESS on success. + + a negative value indicated below on error. + + ERRORS - "socket_err.h" + + <DL> + * EEFDRANGE Descriptor out of range. + * EEBADF Descriptor is invalid. + * EESECURITY Security violation attempted. + </DL> + + See also: + socket_accept, + socket_create + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/socket_connect ds2.0r27/lib/doc/efun/all/socket_connect *** ds1.1/lib/doc/efun/all/socket_connect Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/socket_connect Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,63 ---- + socket_connect - initiate a connection on a socket + + int socket_connect( int s, string address, + string read_callback, + string write_callback ); + + This efun is only available if PACKAGE_SOCKETS is compiled in. + + The argument s is a socket. s must be either a STREAM mode or a MUD mode + socket. address is the address to which the socket will attempt to connect. + address is of the form: "127.0.0.1 23" + + The argument read_callback is the name of a function for the driver to + call when the socket gets data from its peer. The read callback should follow + this format: + + <pre> + void read_callback(int fd, mixed message) + </pre> + + Where fd is the socket which received the data, and message is the data + which was received. + + The argument write_callback is the name of a function for the driver to + call when the socket is ready to be written to. The write callback should + follow this format: + + <pre> + void write_callback(int fd) + </pre> + + Where fd is the socket which is ready to be written to. + + socket_connect() returns: + + EESUCCESS on success. + + a negative value indicated below on error. + + ERRORS - these are in "socket_err.h" + + <DL> + * EEFDRANGE Descriptor out of range. + * EEBADF Descriptor is invalid. + * EESECURITY Security violation attempted. + * EEMODENOTSUPP Socket mode not supported. + * EEISLISTEN Socket is listening. + * EEISCONN Socket is already connected. + * EEBADADDR Problem with address format. + * EEINTR Interrupted system call. + * EEADDRINUSE Address already in use. + * EEALREADY Operation already in progress. + * EECONNREFUSED Connection refused. + * EECONNECT Problem with connect. + </DL> + + See also: + socket_accept, + socket_close, + socket_create + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/all/socket_create ds2.0r27/lib/doc/efun/all/socket_create *** ds1.1/lib/doc/efun/all/socket_create Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/socket_create Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,64 ---- + socket_create - create an efun socket + + int socket_create( int mode, string | function read_callback); + + int socket_create( int mode, string | function read_callback, string | function close_callback ); + + This efun is only available if PACKAGE_SOCKETS is compiled in. + + socket_create() creates an efun socket. mode determines which type of + socket is created. Currently supported socket modes are: + + <DL> + * MUD for sending LPC data types using TCP protocol. + * STREAM for sending raw data using TCP protocol. + * DATAGRAM for using UDP protocol. + </DL> + + The argument read_callback is the name of a function for the driver to + call when the socket gets data from its peer. The read callback should follow + this format: + + <pre> + void read_callback(int fd, mixed message) + </pre> + + Where fd is the socket which received the data, and message is the data + which was received. + + The argument close_callback is the name of a function for the driver to + call if the socket closes unexpectedly, i.e. not as the result of a + socket_close() call. The close callback should follow this format: + + <pre> + void close_callback(int fd) + </pre> + + Where fd is the socket which has closed. + NOTE: close_callback is not used with DATAGRAM mode sockets. + + socket_create() returns: + + a non-negative descriptor on success. + + a negative value indicated below on error. + + ERRORS - these are in "socket_err.h" + + <DL> + * EEMODENOTSUPP Socket mode not supported. + * EESOCKET Problem creating socket. + * EESETSOCKOPT Problem with setsockopt. + * EENONBLOCK Problem setting non-blocking mode. + * EENOSOCKS No more available efun sockets. + * EESECURITY Security violation attempted. + + See also: + socket_accept, + socket_bind, + socket_close, + socket_connect, + socket_listen, + socket_write + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/socket_error ds2.0r27/lib/doc/efun/all/socket_error *** ds1.1/lib/doc/efun/all/socket_error Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/socket_error Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,19 ---- + socket_error - return a text description of a socket error + + string socket_error( int error ); + + This efun is only available if PACKAGE_SOCKETS is compiled in. + + socket_error() returns a string describing the error signified by error. + + socket_error() returns: + + a string describing the error on success. + + "socket_error: invalid error number" on bad input. + + See also: + socket_create, + socket_connect + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/socket_listen ds2.0r27/lib/doc/efun/all/socket_listen *** ds1.1/lib/doc/efun/all/socket_listen Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/socket_listen Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,45 ---- + socket_listen - listen for connections on a socket + + int socket_listen( int s, string listen_callback ); + + This efun is only available if PACKAGE_SOCKETS is compiled in. + + To accept connections, a socket is first created with socket_create(), + the socket is them put into listening mode with socket_listen(), and + the connections are accepted with socket_accept(). The socket_listen() call + applies only to sockets of type STREAM or MUD. + + The argument listen_callback is the name of a function for the driver to + call when a connection is requested on the listening socket. The listen + callback should follow this format: + + <pre> + void listen_callback(int fd) + </pre> + + Where fd is the listening socket. + + socket_listen() returns: + + EESUCCESS on success. + + a negative value indicated below on error. + + ERRORS - these are in "socket_err.h" + + <DL> + * EEFDRANGE Descriptor out of range. + * EEBADF Descriptor is invalid. + * EESECURITY Security violation attempted. + * EEMODENOTSUPP Socket mode not supported. + * EENOADDR Socket not bound to an address. + * EEISCONN Socket is already connected. + * EELISTEN Problem with listen. + </DL> + + See also: + socket_accept, + socket_connect, + socket_create + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/socket_release ds2.0r27/lib/doc/efun/all/socket_release *** ds1.1/lib/doc/efun/all/socket_release Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/socket_release Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,35 ---- + socket_release - release ownership of a socket to another object + + int socket_release( int socket, object ob, + string release_callback ); + + This efun is only available if PACKAGE_SOCKETS is compiled in. + + socket_release() is used to change ownership (and control) of a socket + to another object. It is useful in daemon objects (like inetd) which + handle connection set-up and then transfer a connected socket to another + object for further processing. + + Socket ownership transfer involves a handshake between the current owner + object and the socket to which the current owner wishes to transfer the + socket. The handshake is initiated when socket_release() is called. + socket_release() does appropriate security/integrity checking and then + calls the release_callback function in object ob. This function is used + to notify ob that socket ownership is being transferred to it. It is + then ob's responsibility to call socket_acquire() within the release + callback function. If socket_acquire() is called then the handshake is + complete and socket ownership has been successfully transferred to ob. + ob may decline to accept responsibility for the socket by not calling + socket_acquire(), in which case ownership does not change and the + current socket owner must decide how to respond to this. + + If the socket owner is successfully transfered then socket_release() + returns EESUCCESS. If ob does not accept ownership for the socket then + EESOCKNOTRLSD is returned (both in "socket_err.h"). Other errors can be returned based on + security violation, bad socket descriptor vbalues, etc. + + See also: + socket_acquire + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/all/socket_write ds2.0r27/lib/doc/efun/all/socket_write *** ds1.1/lib/doc/efun/all/socket_write Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/socket_write Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,42 ---- + socket_write - send a message from a socket + + int socket_write( int s, mixed message, + void | string address ); + + This efun is only available if PACKAGE_SOCKETS is compiled in. + + socket_write() sends a message on a socket s. If the socket s is of type + STREAM or MUD, the socket must already be connected and the address is not + specified. If the socket is of type DATAGRAM, the address must be specified. + The address is of the form: "127.0.0.1 23". + + socket_write() returns: + + EESUCCESS on success. + + a negative value indicated below on error. + + ERRORS - these are in "socket_err.h" + + <DL> + * EEFDRANGE Descriptor out of range. + * EEBADF Descriptor is invalid. + * EESECURITY Security violation attempted. + * EENOADDR Socket not bound to an address. + * EEBADADDR Problem with address format. + * EENOTCONN Socket not connected. + * EEALREADY Operation already in progress. + * EETYPENOTSUPP Object type not supported. + * EEBADDATA Sending data with too many nested levels. + * EESENDTO Problem with sendto. + * EEMODENOTSUPP Socket mode not supported. + * EEWOULDBLOCK Operation would block. + * EESEND Problem with send. + * EECALLBACK Wait for callback. + </DL> + + See also: + socket_connect, + socket_create + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/sort_array ds2.0r27/lib/doc/efun/all/sort_array *** ds1.1/lib/doc/efun/all/sort_array Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/sort_array Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,29 ---- + sort_array - sort an array + + array sort_array( array arr, string fun, object ob, ... ); + + array sort_array( array arr, function f, ... ); + + array sort_array( array arr, int direction ); + + The (ob, fun) syntax behaves the same as if (: call_other, ob, fun :) + was passed as f. + + In the first two forms, the returned array is sorted with respect to + the comparison function given. The function takes two elements as + arguments, and returns -1 if if first argument is less than the second, + 0 if they are the same, or 1 if the first argument is greater than the + second. Any additional arguments are passed to the comparison function + as the third and following arguments. + + The third form returns an array with the same elements as 'arr', but + quicksorted using built-in sort routines. A 'direction' of 1 or 0 will + quicksort in ascending order, while a 'direction' of -1 will + quicksort in descending order. A limitation of the built-in + sort routines is that the array must be homogeneous, composed entirely + of a single type, where that type is string, int, or float. + Arrays of arrays are sorted by sorting based on the first element, + making database sorts possible. + + See also: + strcmp diff -c -r --new-file ds1.1/lib/doc/efun/all/sprintf ds2.0r27/lib/doc/efun/all/sprintf *** ds1.1/lib/doc/efun/all/sprintf Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/sprintf Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,55 ---- + sprintf - formatted output conversion + + string sprintf( string format, ... ); + + An implementation of sprintf() for LPC, with quite a few extensions + Originally implemented by Lynscar (Sean A Reith). + + This version supports the following as modifiers: + <dl> + * " " - pad positive integers with a space. + * "+" - pad positive integers with a plus sign. + * "-" - left adjusted within field size. + <b>Note:</b> sprintf() defaults to right justification, which is unnatural + in the context of a mainly string based language but has been retained for + "compatability". + * "|" - centered within field size. + * "=" - column mode if width is greater than field size. This is only + meaningful with strings, all other types ignore this. Columns are + auto-magically word wrapped. + * "#" - table mode, print a list of '\\n' separated 'words' in a + table within the field size. only meaningful with strings. + * a number - specifies the field size, a '*' specifies to use the + corresponding arg as the field size. If n is prepended with a zero, then + the field is padded zeros, otherwise it is padded with spaces (or specified pad string; see below). + * "." then a number - precision of n, simple strings truncate after this (if precision is + greater than field size, then field size = precision), tables use + precision to specify the number of columns (if precision not specified + then tables calculate a best fit), all other types ignore this. + * ":" then a number - n specifies the fs _and_ the precision, if n is prepended by a zero then the field is padded with zeros instead of spaces. + * "@" - the argument is an array. the corresponding format_info (minus the "@") is applied to each element of the array. + * "'X'" - The char(s) between the single-quotes are used to pad to + field size (defaults to space) (if both a zero (in front of field + size) and a pad string are specified, the one specified second + overrules). NOTE: to include "'" in the pad string, you must + use "\'" (as the backslash has to be escaped past the + interpreter), similarly, to include "\" requires "\\\\". + </dl> + The following are the possible type specifiers. + <dl> + * % - in which case no arguments are interpreted, and a "%" is + inserted, and all modifiers are ignored. + * O - the argument is an LPC datatype. + * s - the argument is a string. + * d, i - the integer arg is printed in decimal. + * c - the integer arg is to be printed as a character. + * o - the integer arg is printed in octal. + * x - the integer arg is printed in hex. + * X - the integer arg is printed in hex (with A-F in capitals). + * f - floating point number + </dl> + + See also: + sscanf + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/sqrt ds2.0r27/lib/doc/efun/all/sqrt *** ds1.1/lib/doc/efun/all/sqrt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/sqrt Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + sqrt - returns the square root of a float + + float sqrt( float f ); + + This efun is only available if PACKAGE_MATH is compiled in. + + sqrt() returns the non-negative square root of its argument, `f'. The value + of `f' must not be negative. + + See also: + exp, + log, + pow + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/sscanf ds2.0r27/lib/doc/efun/all/sscanf *** ds1.1/lib/doc/efun/all/sscanf Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/sscanf Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,43 ---- + sscanf - match substrings in a string + + int sscanf( string str, string fmt, mixed var1, mixed var2, ... ); + + Parse a string 'str' using the format 'fmt'. The format 'fmt' + consists of text to match against 'str', separated by patterns which + begin with '%'. The following patterns are supported: + + <DL> + * '%%' - matches '%' + * '%x' - matches a hexidecimal number + * '%d' - matches a decimal number + * '%f' - matches a floating point number + * '%(regexp)' - matches anything that matches the regular + expression 'regexp' (see the regexp() efun for details) + * '%s' - matches a string; see below + </DL> + + Note that the third and following arguments are NOT expressions; they + must be valid lvalues (locations which can be assigned to). As + matches are encountered in the string, the corresponding values are + put directly into the third and following arguments. If a problem + is encountered (either some of the text between patterns doesn't + match, or a pattern can't be matched to the corresponding input) + the number of matches so far is returned, and the remaining arguments + are left unchanged. If a '*' comes immediately after the '%' in the + format, then that pattern is matched, but not assigned to a variable. + It is counted in the return value. + + '%s' is handled as follows. If it is followed by text, '%s' matches + up the the next ocurrence of the text. For example, the format + "%sxy%s" will match "fox" to the first %s when used on the string + "foxxybarxyz". If the %s occurs at the end of the string, the + remainder of the string is matched. If it is followed immediately + by another pattern, then %s matches up to the first valid match for + the following pattern. "%s%s" is illegal. + + See also: + explode, + replace_string, + strsrch + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/stat ds2.0r27/lib/doc/efun/all/stat *** ds1.1/lib/doc/efun/all/stat Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/stat Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,17 ---- + stat - returns information pertaining to a file or a directory + + mixed stat(string str); + mixed stat(string str, int x); + + If str is the name of a regular file (not a directory), then stat() + will return an array of information pertaining to that file. The + form of the array is as follows: + + ({ file_size, last_time_file_touched, time_object_loaded }) + + If stat is called on a directory (not a regular file), or with a second + argument of -1, then stat() behaves identically to get_dir(). + + See also: + get_dir, + stat diff -c -r --new-file ds1.1/lib/doc/efun/all/store_variable ds2.0r27/lib/doc/efun/all/store_variable *** ds1.1/lib/doc/efun/all/store_variable Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/store_variable Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,17 ---- + store_variable - set the value of a variable + + void store_variable(string, mixed); + + Set the value of the variable specified by the first argument to the value + specfied by the second argument. Note that the variable must be defined, and + must be defined in this_object(). + + This function requires PACKAGE_CONTRIB to be defined in the options file. + + See also: + restore_variable, + fetch_variable, + save_object + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/all/strcmp ds2.0r27/lib/doc/efun/all/strcmp *** ds1.1/lib/doc/efun/all/strcmp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/strcmp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,18 ---- + strcmp - determines the lexical relationship between two strings + + int strcmp( string one, string two ); + + This implementatin of strcmp() is identical to the one found in C libraries. + If string one lexically precedes string two, then strcmp() returns a number + less than 0. If the two strings have the same value, strcmp() returns 0. + If string two lexically precedes string one, then strcmp() returns a number + greater than 0. This efunction is particularly useful in the compare + functions needed by sort_array(). + + Note that relational operators (<, >, etc) can also be used to compare + strings. + + See also: + sort_array + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/stringp ds2.0r27/lib/doc/efun/all/stringp *** ds1.1/lib/doc/efun/all/stringp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/stringp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,7 ---- + stringp - determine whether or not a given variable is a string + + int stringp( mixed arg ); + + Returns 1 if 'arg' is a string, and zero if not. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/strlen ds2.0r27/lib/doc/efun/all/strlen *** ds1.1/lib/doc/efun/all/strlen Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/strlen Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,10 ---- + strlen - returns the length of a string + + int strlen( string str ); + + strlen() returns the number of characters in the string 'str'. + + See also: + sizeof + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/strsrch ds2.0r27/lib/doc/efun/all/strsrch *** ds1.1/lib/doc/efun/all/strsrch Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/strsrch Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,19 ---- + strsrch - search for substrings in a string + + int strsrch( string str, string substr | int char, int flag ); + + strsrch() searches for the first occurance of the string 'substr' in the + string 'str'. The last occurance of 'substr' can be found by passing '-1' + as the 3rd argument (which is optional). If the second argument is an + integer, that character is found (like C's strchr()/strrchr().) The empty + string or null value cannot be searched for. + + The integer offset of the first (last) match is returned. -1 is returned + if there was no match, or an error occurred (bad args, etc). + + See also: + sscanf, + replace_string, + regexp + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/swap ds2.0r27/lib/doc/efun/all/swap *** ds1.1/lib/doc/efun/all/swap Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/swap Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + swap - swap out a file explicitly + + void swap( object ); + + This efun is only available if the driver is compiled with -DDEBUG. + + This efun should be reserved for debugging only. It + allows an object to be explicitly swapped out. If + enabled, it is strongly recommended that a simul_efun + override (for this efun) be used to prevent abuse. + + Note: objects which have been destructed, already + swapped out, contain a heart beat, cloned, inherited, + or interactive, cannot be swapped out. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/tail ds2.0r27/lib/doc/efun/all/tail *** ds1.1/lib/doc/efun/all/tail Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/tail Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + tail - displays the latter portion of a file + + int tail( string path ); + + This efunction displays the latter portion of the file named by path. + It returns 1 if successful, 0 otherwise (e.g. when the file is protected + against reading). + + See also: + read_file, + read_buffer, + file_size diff -c -r --new-file ds1.1/lib/doc/efun/all/tan ds2.0r27/lib/doc/efun/all/tan *** ds1.1/lib/doc/efun/all/tan Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/tan Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + tan - return the tangent of a float + + float tan( float f ); + + This efun is only available if PACKAGE_MATH is compiled in. + + Returns the tangent of its argument, 'f', measured in radians. + + See also: + acos, + asin, + atan, + cos, + sin diff -c -r --new-file ds1.1/lib/doc/efun/all/tell_object ds2.0r27/lib/doc/efun/all/tell_object *** ds1.1/lib/doc/efun/all/tell_object Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/tell_object Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + tell_object - send a message to an object + + void tell_object( object ob, string str ); + + Send a message 'str' to object 'ob'. If it is an interactive object (a player), + then the message will go to him, otherwise it will go to the local + function "catch_tell()". + + See also: + write, + shout, + say, + tell_room, + catch_tell + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/tell_room ds2.0r27/lib/doc/efun/all/tell_room *** ds1.1/lib/doc/efun/all/tell_room Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/tell_room Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + tell_room - send a message to all objects in a room + + void tell_room( mixed ob, string str, object array exclude ); + + Send a message 'str' to object all objects in the room 'ob'. 'ob' can also + be the filename of the room (string). If 'exclude' is specified, all + objects in the exclude array will not receive the message. + + See also: + write, + shout, + say, + tell_object, + catch_tell + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/terminal_colour ds2.0r27/lib/doc/efun/all/terminal_colour *** ds1.1/lib/doc/efun/all/terminal_colour Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/terminal_colour Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + terminal_colour - replaces codes in a string + + string terminal_colour(string str, mapping m, int wrap, int indent); + + terminal_colour() replaces each occurrence of %^key%^ in str with 'value', + where 'key' and 'value' are the elements in the mapping m. + + 'wrap' is the optional column number to wrap at, and 'indent' is the + amount to indent the second and following lines. Codes are assumed to + change the mode of the terminal and not generate any printable + characters for the purposes of wrapping. + + This efun is only available if PACKAGE_CONTRIB is defined. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/test_bit ds2.0r27/lib/doc/efun/all/test_bit *** ds1.1/lib/doc/efun/all/test_bit Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/test_bit Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + test_bit - test a bit in a bitstring + + int test_bit( string str, int n ); + + Returns 1 if bit 'n' was set in string 'str', and zero otherwise. + + See also: + set_bit, + clear_bit + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/this_interactive ds2.0r27/lib/doc/efun/all/this_interactive *** ds1.1/lib/doc/efun/all/this_interactive Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/this_interactive Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + this_interactive - return the object representing the current player + + object this_interactive(); + + Return the object representing the player that caused the calling function + to be called. This returns what this_player() was originally even if + it changed later due to enable_commands() or command() + + See also: + this_player + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/this_object ds2.0r27/lib/doc/efun/all/this_object *** ds1.1/lib/doc/efun/all/this_object Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/this_object Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + this_object - return the object pointer of the calling object + + object this_object(); + + Return the object pointer of the current object. Useful for passing the + current object to other functions. + + See also: + this_player, + previous_object, + origin + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/this_player ds2.0r27/lib/doc/efun/all/this_player *** ds1.1/lib/doc/efun/all/this_player Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/this_player Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,8 ---- + this_player - return the object representing the current player + + object this_player( int flag ); + + this_player() is exactly the same as this_user(). + + See also: + this_user diff -c -r --new-file ds1.1/lib/doc/efun/all/this_user ds2.0r27/lib/doc/efun/all/this_user *** ds1.1/lib/doc/efun/all/this_user Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/this_user Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + this_user - return the object representing the current interactive + + Return the object representing the user that caused the calling function + to be called. Note that this_user() may return a different value than + this_object() even when called from within a user object. If this_user + is called as this_user(1) then the returned value will be the interactive + that caused the calling function to be called. this_user(1) may return + a different value than this_user() in certain cases (such as when command() + is used by an admin to force a user to perform some command). + + See also: + this_object diff -c -r --new-file ds1.1/lib/doc/efun/all/throw ds2.0r27/lib/doc/efun/all/throw *** ds1.1/lib/doc/efun/all/throw Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/throw Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + throw - forces an error to occur in an object. + + void throw(mixed); + + Throw can be used to send an arbitrary value to an enclosing catch() statement. + If you want to raise a general error message, see error(), as that will + behave better if it is not caught. Control is transfered directly to the + enclosing catch() statement, and the value of the catch() statement is the + value thrown. + + See also: + catch, + error + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/all/time ds2.0r27/lib/doc/efun/all/time *** ds1.1/lib/doc/efun/all/time Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/time Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + debug_message - send a message to the driver's stdout + + void debug_message(string); + + The string argument is printed on the driver's stdout, as well as being added + to the debug.log file. + + See also: + ctime + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/time_expression ds2.0r27/lib/doc/efun/all/time_expression *** ds1.1/lib/doc/efun/all/time_expression Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/time_expression Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,18 ---- + time_expression - return the amount of real time that an expression took + + int time_expression( mixed expr ); + + int time_expression { ... } + + Evaluate <expr> or the specified block of code. The amount of real time + that passes during the evaluation of <expr>, in microseconds, is returned. + The precision of the value is + not necessarily 1 microsecond; in fact, it probably is much less precise. + + See also: + rusage, + function_profile, + time + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/all/to_float ds2.0r27/lib/doc/efun/all/to_float *** ds1.1/lib/doc/efun/all/to_float Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/to_float Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + to_float - convert an int to a float + + float to_float( int i ); + + The to_float() call returns the number of type 'float' that is equivalent to + the int 'i'. + + See also: + to_int, + read_buffer, + sprintf, + sscanf + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/all/to_int ds2.0r27/lib/doc/efun/all/to_int *** ds1.1/lib/doc/efun/all/to_int Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/to_int Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + to_int - convert a float or buffer to an int + + int to_int( float x ); + int to_int( buffer x ); + int to_int( string x ); + + If 'x' is a float, the to_int() call returns the number of type 'int' that is + equivalent to 'x' (with any decimal stripped off). If 'x' is a buffer, the + call returns the integer (in network-byte-order) that is embedded in the + buffer. If 'x' is a string, then the string is converted to an integer. + An undefined value is returned if the string is not a valid number. + + See also: + to_float, + read_buffer diff -c -r --new-file ds1.1/lib/doc/efun/all/trace ds2.0r27/lib/doc/efun/all/trace *** ds1.1/lib/doc/efun/all/trace Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/trace Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,25 ---- + trace - sets trace flags and returns the old ones + + int trace( int traceflags ); + + This efun is only available if TRACE and PACKAGE_DEVELOP are compiled in. + + Sets the trace flags and returns the old trace flags. + When tracing is on a lot of information is printed during execution. + + The trace bits are: + <DL> + * 1 - Trace all function calls to lfuns. + * 2 - Trace all calls to "call_other". + * 4 - Trace all function returns. + * 8 - Print arguments at function calls and return values. + * 16 - Print all executed stack machine instructions (produces a lot of output!). + * 32 - Enable trace in heart beat functions. + * 64 - Trace calls to apply. + * 128 - Show object name in tracing. + </DL> + + See also: + traceprefix + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/traceprefix ds2.0r27/lib/doc/efun/all/traceprefix *** ds1.1/lib/doc/efun/all/traceprefix Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/traceprefix Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + traceprefix - sets the prefix determining which objects to trace + + string traceprefix( string prefix ); + + This efun is only available if TRACE and PACKAGE_DEVELOP are compiled in. + + If the the traceprefix is set (i.e. not 0) tracing will only occur in objects + having a name with the set prefix. + + The old value is returned. + + See also: + trace + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/all/typeof ds2.0r27/lib/doc/efun/all/typeof *** ds1.1/lib/doc/efun/all/typeof Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/typeof Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,20 ---- + typeof - return the type of an expression + + int typeof( mixed var ); + + Return the type of an expression. The return values are given in + the driver include "type.h". They are: + + <pre> + INT "int" + STRING "string" + ARRAY "array" + OBJECT "object" + MAPPING "mapping" + FUNCTION "function" + FLOAT "float" + BUFFER "buffer" + CLASS "class" + </pre> + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/undefinedp ds2.0r27/lib/doc/efun/all/undefinedp *** ds1.1/lib/doc/efun/all/undefinedp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/undefinedp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,18 ---- + undefinedp - determine whether or not a given value is undefined. + + int undefinedp( mixed arg ); + + Return 1 if `arg' is undefined. 'arg' will be undefined in the following + cases: + + <DL> + * it is a variable set equal to the return value of a call_other to a + non-existent method (e.g. arg = call_other(obj, "???")). + * it is a variable set equal to the return value of an access of an + element in a mapping that doesn't exist (e.g. arg = map[not_there]). + * it has not yet been initialized. + * it points to a destructed object. + * it is a function (formal) parameter that corresponds to a missing actual argument. + </DL> + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/unique_array ds2.0r27/lib/doc/efun/all/unique_array *** ds1.1/lib/doc/efun/all/unique_array Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/unique_array Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,33 ---- + unique_array - partitions an array of objects into groups + + array unique_array(object array obarr, string separator); + + array unique_array(object array obarr, string separator, mixed skip); + + array unique_array(array arr, function f); + + array unique_array(array arr, function f, mixed skip); + + Groups objects/values together for which the `separator' function + returns the same value. In the first case, "separator" is a string function + name to try on each object. In the second case, the function f is called + with the element as the argument. If 'skip' is passed, elements for which + the separator function returns the same as 'skip' are omitted from the + return value. + + The return value is an array of arrays of the form: + <pre> + ({ + ({Same1:1, Same1:2, Same1:3, .... Same1:N }), + ({Same2:1, Same2:2, Same2:3, .... Same2:N }), + ({Same3:1, Same3:2, Same3:3, .... Same3:N }), + .... + .... + ({SameM:1, SameM:2, SameM:3, .... SameM:N }), + }) + </pre> + + i.e. an array of arrays, where each of the elements in the sub arrays returned + the same value as the other elements in the same sub array. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/unique_mapping ds2.0r27/lib/doc/efun/all/unique_mapping *** ds1.1/lib/doc/efun/all/unique_mapping Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/unique_mapping Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + unique_mapping - partition an array into groups + + mapping unique_mapping(array arr, string fun, object ob, ...); + + mapping unique_mapping(array arr, function f, ...); + + unique_mapping() evaluates the function 'f' with each element of the + array 'arr', and constructs a mapping with the return values as keys, + and subarrays of elements that returned value value as values. + + See also: + unique_array + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/upper_case ds2.0r27/lib/doc/efun/all/upper_case *** ds1.1/lib/doc/efun/all/upper_case Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/upper_case Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + upper_case - return the uppercase version of a given string + + string upper_case(string); + + Return the uppercase version of a given string (original string remains + unchanged). + + This function requires PACKAGE_CONTRIB to be defined in the options file. + + See also: + capitalize, + lower_case + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/uptime ds2.0r27/lib/doc/efun/all/uptime *** ds1.1/lib/doc/efun/all/uptime Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/uptime Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + uptime - return the number of seconds elapsed since the last driver reboot + + int uptime(); + + This function returns the number of seconds since the last driver reboot. + + See also: + time, + ctime, + localtime, + time_expression + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/userp ds2.0r27/lib/doc/efun/all/userp *** ds1.1/lib/doc/efun/all/userp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/userp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + userp - determine if a given object was once interactive + + int userp( object ); + + Returns 1 if the arg was once interactive. + + See also: + interactive, + users, + living + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/users ds2.0r27/lib/doc/efun/all/users *** ds1.1/lib/doc/efun/all/users Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/users Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + users - return an array of objects containing all interactive players + + object array users(); + + Return an array of objects, containing all interactive players. + + See also: + livings, + children, + objects + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/values ds2.0r27/lib/doc/efun/all/values *** ds1.1/lib/doc/efun/all/values Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/values Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,26 ---- + values - return an array of the values from the (key, value) pairs in a mapping + + array values( mapping m ); + + values() returns an array of values corresponding to the value elements + in the (key, value) pairs stored in the mapping m. + + For example, if: + + <pre> + mapping m; + + m = (["hp" : 35, "sp" : 42, "mass" : 100]); + </pre> + + then + + <pre> + values(m) == ({35, 42, 100}) + </pre> + + Note: the values will be returned in the same order as the corresponding + keys. + + See also: + keys diff -c -r --new-file ds1.1/lib/doc/efun/all/variables ds2.0r27/lib/doc/efun/all/variables *** ds1.1/lib/doc/efun/all/variables Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/variables Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,20 ---- + variables - list all the variables in a given object. + + string array variables(object, int default: 0); + + variables() can return two different things. If the second argument is + 0 (which it is by default) it will return an array containing the names + of all the variables in the object passed as the first argument. If the + second argument is non-zero, more information about each variable is + given. For a non-zero second argument, each array element contains + the following: + + ({ variable_name, variable_type }). + + Where variable_name is the name of the given variable, and variable_type + is the type of the variable, such as "string" or "private int" etc. + + This efun is only available if PACKAGE_CONTRIB is defined in the + options file. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/virtualp ds2.0r27/lib/doc/efun/all/virtualp *** ds1.1/lib/doc/efun/all/virtualp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/virtualp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,9 ---- + virtualp - determine whether or not a given variable points to a virtual object + + int virtualp( object arg ); + + Returns true (1) if the argument is objectp() and the O_VIRTUAL flag is set. + The driver sets the O_VIRTUAL flag for those objects created via the + 'compile_object' function in the master object. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/wizardp ds2.0r27/lib/doc/efun/all/wizardp *** ds1.1/lib/doc/efun/all/wizardp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/wizardp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + wizardp - determines if a given object had enable_wizard() performed in it + + int wizardp( object ); + + This efun is only available if NO_WIZARDS is not compiled in. + + Returns 1 if the arg had enable_wizard() performed on it. + + See also: + disable_wizard, + enable_wizard + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/write ds2.0r27/lib/doc/efun/all/write *** ds1.1/lib/doc/efun/all/write Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/write Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + write() - send a message to current player + + void write( mixed str ); + + Write a message `str' to current player. `str' can also be a number, which + will be translated to a string. + + See also: + message, + tell_object, + tell_room, + shout, + say + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/write_buffer ds2.0r27/lib/doc/efun/all/write_buffer *** ds1.1/lib/doc/efun/all/write_buffer Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/write_buffer Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,17 ---- + write_buffer - write a buffer to a file + + int write_buffer(mixed dest, int start, mixed source ); + + If `dest' is a file, then `source' must be an int (and will be written to + the file in network-byte-order), a buffer, or a string, and `source' will + be written to the file `dest' starting at byte # `start'. + + If `dest' is a buffer, then `source' will be written into the buffer starting + at byte # `start' in the buffer. If `source' is an int, it will be written + in network-byte-order. + + See also: + read_buffer, + allocate_buffer + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/all/write_bytes ds2.0r27/lib/doc/efun/all/write_bytes *** ds1.1/lib/doc/efun/all/write_bytes Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/write_bytes Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,10 ---- + write_bytes - writes a contiguous series of bytes to a file + + int write_bytes( string path, int start, string series ); + + This function writes the bytes in 'series' into the file named by 'path' + beginning at byte # 'start'. It returns zero (0) upon failure, 1 otherwise. + + See also: + write_file, + read_bytes diff -c -r --new-file ds1.1/lib/doc/efun/all/write_file ds2.0r27/lib/doc/efun/all/write_file *** ds1.1/lib/doc/efun/all/write_file Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/all/write_file Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + write_file - appends a string to a file + + int write_file( string file, string str, int flag ); + + Append the string `str' into the file `file'. Returns 0 or 1 for + failure or success. If flag is 1, write_file overwrites instead of + appending. + + See also: + read_file, + write_buffer, + file_size diff -c -r --new-file ds1.1/lib/doc/efun/arrays/allocate ds2.0r27/lib/doc/efun/arrays/allocate *** ds1.1/lib/doc/efun/arrays/allocate Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/arrays/allocate Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + allocate - allocate an array + + array allocate( int size ); + + Allocate an array of <size> elements. The number of elements must be >= 0 + and not bigger than a system maximum (usually ~10000). All elements are + initialized to 0. + + See also: + sizeof, + allocate_mapping + diff -c -r --new-file ds1.1/lib/doc/efun/arrays/filter_array ds2.0r27/lib/doc/efun/arrays/filter_array *** ds1.1/lib/doc/efun/arrays/filter_array Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/arrays/filter_array Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + filter_array - return a selective sub-array + + array filter_array( array arr, string fun, object ob, mixed extra, ... ); + + array filter_array( array arr, function f, mixed extra, ...); + + filter_array() is really the same as the filter() efun. + + See also: + filter + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/arrays/index ds2.0r27/lib/doc/efun/arrays/index *** ds1.1/lib/doc/efun/arrays/index Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/arrays/index Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,17 ---- + Array efuns + + These efuns exist for the manipulation of array values: + + <DL> + * allocate + * arrayp + * filter_array + * map_array + * member_array + * pointerp + * sort_array + * unique_array + </DL> + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/arrays/map_array ds2.0r27/lib/doc/efun/arrays/map_array *** ds1.1/lib/doc/efun/arrays/map_array Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/arrays/map_array Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,10 ---- + map_array - modify an array of elements via application of a function + + array map_array( array arr, string fun, object ob, mixed extra, ... ); + + array map_array( array arr, function f, mixed extra, ... );; + + The map_array() efun is really just an alias for the map() efun. + + See also: + map diff -c -r --new-file ds1.1/lib/doc/efun/arrays/member_array ds2.0r27/lib/doc/efun/arrays/member_array *** ds1.1/lib/doc/efun/arrays/member_array Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/arrays/member_array Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + member_array - returns index of an occurence of a given item in an array or string + + int member_array( mixed item, mixed arr); + + int member_array( mixed item, mixed arr, int start); + + Returns the index of the first occurence of `item' in the array or string + `arr', or the first occurence at or after 'start'. + If the item is not found, then -1 is returned. + + For the purpose of this efun, strings are considered to be arrays of ints. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/arrays/sort_array ds2.0r27/lib/doc/efun/arrays/sort_array *** ds1.1/lib/doc/efun/arrays/sort_array Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/arrays/sort_array Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,29 ---- + sort_array - sort an array + + array sort_array( array arr, string fun, object ob, ... ); + + array sort_array( array arr, function f, ... ); + + array sort_array( array arr, int direction ); + + The (ob, fun) syntax behaves the same as if (: call_other, ob, fun :) + was passed as f. + + In the first two forms, the returned array is sorted with respect to + the comparison function given. The function takes two elements as + arguments, and returns -1 if if first argument is less than the second, + 0 if they are the same, or 1 if the first argument is greater than the + second. Any additional arguments are passed to the comparison function + as the third and following arguments. + + The third form returns an array with the same elements as 'arr', but + quicksorted using built-in sort routines. A 'direction' of 1 or 0 will + quicksort in ascending order, while a 'direction' of -1 will + quicksort in descending order. A limitation of the built-in + sort routines is that the array must be homogeneous, composed entirely + of a single type, where that type is string, int, or float. + Arrays of arrays are sorted by sorting based on the first element, + making database sorts possible. + + See also: + strcmp diff -c -r --new-file ds1.1/lib/doc/efun/arrays/unique_array ds2.0r27/lib/doc/efun/arrays/unique_array *** ds1.1/lib/doc/efun/arrays/unique_array Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/arrays/unique_array Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,33 ---- + unique_array - partitions an array of objects into groups + + array unique_array(object array obarr, string separator); + + array unique_array(object array obarr, string separator, mixed skip); + + array unique_array(array arr, function f); + + array unique_array(array arr, function f, mixed skip); + + Groups objects/values together for which the `separator' function + returns the same value. In the first case, "separator" is a string function + name to try on each object. In the second case, the function f is called + with the element as the argument. If 'skip' is passed, elements for which + the separator function returns the same as 'skip' are omitted from the + return value. + + The return value is an array of arrays of the form: + <pre> + ({ + ({Same1:1, Same1:2, Same1:3, .... Same1:N }), + ({Same2:1, Same2:2, Same2:3, .... Same2:N }), + ({Same3:1, Same3:2, Same3:3, .... Same3:N }), + .... + .... + ({SameM:1, SameM:2, SameM:3, .... SameM:N }), + }) + </pre> + + i.e. an array of arrays, where each of the elements in the sub arrays returned + the same value as the other elements in the same sub array. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/buffers/allocate_buffer ds2.0r27/lib/doc/efun/buffers/allocate_buffer *** ds1.1/lib/doc/efun/buffers/allocate_buffer Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/buffers/allocate_buffer Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,17 ---- + allocate_buffer - allocate a buffer + + buffer allocate_buffer( int size ); + + This efun is only available if DISALLOW_BUFFER_TYPE is not compiled in. + + Allocate a buffer of 'size' elements. The number of elements must be >= 0 + and not bigger than a system maximum (usually ~10000). All elements are + initialized to 0. + + See also: + bufferp, + read_buffer, + write_buffer + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/buffers/crc32 ds2.0r27/lib/doc/efun/buffers/crc32 *** ds1.1/lib/doc/efun/buffers/crc32 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/buffers/crc32 Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,7 ---- + crc32 - compute the cycle redundancy code for a buffer or string + + int crc32( buffer | string x ); + + Computes and returns the CRC-32 code for the given buffer or string, `x'. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/buffers/index ds2.0r27/lib/doc/efun/buffers/index *** ds1.1/lib/doc/efun/buffers/index Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/buffers/index Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + Buffer Efuns + + The following efuns are available for manipulating buffer values: + + <DL> + * allocate_buffer + * bufferp + * crc32 + * read_buffer + * write_buffer + </DL> + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/buffers/read_buffer ds2.0r27/lib/doc/efun/buffers/read_buffer *** ds1.1/lib/doc/efun/buffers/read_buffer Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/buffers/read_buffer Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,26 ---- + read_buffer - read from a file and return a buffer + + mixed read_buffer( mixed src, int start, int len); + + This efun is only available if DISALLOW_BUFFER_TYPE is not compiled in. + + If 'src' is a string (filename), then the filename will be read, starting + at byte # 'start', for 'len' bytes, and returned as a buffer. If neither + argument is given, the entire file is read. + + If 'src' is a buffer, then characters are read from the buffer beginning + at byte # 'start' in the buffer, and for 'len' # of bytes, and returned + as a string. + + Note that the maximum number of bytes you can read from a file and into + a buffer is controlled via the 'maximum byte transfer' parameter in the + runtime config file. + + See also: + write_buffer, + allocate_buffer, + bufferp, + read_bytes, + write_bytes + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/buffers/write_buffer ds2.0r27/lib/doc/efun/buffers/write_buffer *** ds1.1/lib/doc/efun/buffers/write_buffer Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/buffers/write_buffer Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,17 ---- + write_buffer - write a buffer to a file + + int write_buffer(mixed dest, int start, mixed source ); + + If `dest' is a file, then `source' must be an int (and will be written to + the file in network-byte-order), a buffer, or a string, and `source' will + be written to the file `dest' starting at byte # `start'. + + If `dest' is a buffer, then `source' will be written into the buffer starting + at byte # `start' in the buffer. If `source' is an int, it will be written + in network-byte-order. + + See also: + read_buffer, + allocate_buffer + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/calls/call_other ds2.0r27/lib/doc/efun/calls/call_other *** ds1.1/lib/doc/efun/calls/call_other Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/calls/call_other Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,55 ---- + call_other - call a function in another object + + mixed call_other(mixed ob, string func, ...); + + mixed call_other(mixed ob, array args); + + mixed call_other(array obs, string func, ...); + + mixed call_other(array obs, array args); + + ob is either an object pointer, or a string filename (suitable for + find_object()). obs is an array of object pointers and strings. + Using an array as the first argument does a call_other for each element of + the array, and returns an array of the results. + If the array form is used for args, then the first element is the function + name, and the remainder are the arguments; e.g.: + + call_other(ob, ({ "foo", 1, 3, 5 })) + + and + + call_other(ob, "foo", 1, 3, 5) + + are equivalent. The function foo() is called in the object ob with the + arguments (1, 3, 5). The return value of call_other() is the value + returned from the foo() function. In the case of an array of objects, + the return value of call_other() is an array of the return values. + + There is a much more attractive way to do call_others; + call_other(x, "y", z, ...) is the same as: + + x->y(z, ...) + + ie, + + call_other(ob, "query_name"); + + could be written as: + + ob->query_name(); + + Writing out the call_other call is mainly used when the function name + is in a variable, i.e: + + <pre> + void do_test(string fname, int x) { + call_other(fname, "test_" + x); + } + </pre> + + An example of using an array as the first argument: + + users()->quit(); + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/calls/call_out ds2.0r27/lib/doc/efun/calls/call_out *** ds1.1/lib/doc/efun/calls/call_out Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/calls/call_out Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,26 ---- + call_out - delayed function call in same object + + int call_out( function fun, int delay, mixed arg, ... ); + + Set up a call to 'fun'. If fun is a string, it is interpreted as the + name of a function in this_object(). The call will take place 'delay' + seconds later, with the arguments 'arg' and following provided. + + Note: + Unless THIS_PLAYER_IN_CALL_OUT is defined, you can't rely on + write() or say() in 'fun' since this_player() is set to 0. + Use tell_object() instead. + + If THIS_PLAYER_IN_CALL_OUT is defined, this_player() is the same as + it was when the call_out() call was scheduled. + + The return value will be a unique integer identifying the call_out, if + CALLOUT_HANDLES is defined. This 'handle' can be passed to + remove_call_out() and find_call_out(). + + See also: + remove_call_out, + call_out_info, + find_call_out + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/calls/call_stack ds2.0r27/lib/doc/efun/calls/call_stack *** ds1.1/lib/doc/efun/calls/call_stack Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/calls/call_stack Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + call_stack - returns information about the functions involved in calling this function + + array call_stack(int); + + If the int argument is 0, call_stack() returns an array of the names of the + on the call stack, with the first one being the most recent (i.e. the + currently running program). If the int argument is 1, call_stack returns + the objects in which that program is executing. If it is 2, the name + of the functions are returned. If it is 3, the value of origin() in that + frame is returned. + + See also: + previous_object, + origin diff -c -r --new-file ds1.1/lib/doc/efun/calls/catch ds2.0r27/lib/doc/efun/calls/catch *** ds1.1/lib/doc/efun/calls/catch Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/calls/catch Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,24 ---- + catch - catch an evaluation error + + mixed catch( mixed expr ); + + mixed catch { ... }; + + Note: catch is really a keyword and not an efun. + + The code inside the { ... } or the expression is evaluated. If there + is no error, catch() returns zero. If there is an error, a string (with + a leading '*') will be returned. + + The function throw() can also be used to immediately return any value, + except 0. + + The catch() is somewhat costly, and should not be used just anywhere. + Rather, use it at places where an error would destroy consistency. + + See also: + error, + throw, + error_handler + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/calls/index ds2.0r27/lib/doc/efun/calls/index *** ds1.1/lib/doc/efun/calls/index Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/calls/index Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,21 ---- + Call Efuns + + The following efuns deal with making, redirecting, and intercepting various + calls between objects. + + <DL> + * call_other + * call_out + * call_stack + * catch + * origin + * previous_object + * query_shadowing + * remove_call_out + * shadow + * this_object + * throw + </DL> + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/calls/origin ds2.0r27/lib/doc/efun/calls/origin *** ds1.1/lib/doc/efun/calls/origin Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/calls/origin Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,18 ---- + origin - determine how the current function was called + + string origin(); + + Returns an string specifying how the current function was called. These + values can be found in the driver include "origin.h". Current values are: + + <DL> + * "driver" - from the driver: applies, heart_beats, etc + * "local" - local function call + * "call_other" - call_other + * "simul" - use of a simul_efun + * "call_out" - via a call_out + * "efun" - from an efun that takes a function pointer (sort_array, etc) + </DL> + + See also: + previous_object diff -c -r --new-file ds1.1/lib/doc/efun/calls/previous_object ds2.0r27/lib/doc/efun/calls/previous_object *** ds1.1/lib/doc/efun/calls/previous_object Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/calls/previous_object Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,19 ---- + previous_object - returns the object(s) that called the current function + + object previous_object(); + mixed previous_object(int x); + + Returns an object pointer to the object, if any, that called current function. + Note that local function calls do not set previous_object() to the current + object, but leave it unchanged. If passed a positive integer, it goes back + the given number of previous objects in the calling chain. + previous_object(0) is the same as previous_object(), previous_object(1) is + the previous object's previous_object(), etc. previous_object(-1) returns + an array containing all of the previous objects. + + See also: + call_other, + call_out, + origin + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/calls/query_shadowing ds2.0r27/lib/doc/efun/calls/query_shadowing *** ds1.1/lib/doc/efun/calls/query_shadowing Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/calls/query_shadowing Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + query_shadowing - determine whether or not a given object it shadowing another + + object query_shadowing( object ob ); + + This efun is only available if NO_SHADOWS is not compiled in. + + Returns the object that `ob' is shadowing, or zero (0) if it is not + shadowing any object. + + See also: + shadow, + valid_shadow + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/calls/remove_call_out ds2.0r27/lib/doc/efun/calls/remove_call_out *** ds1.1/lib/doc/efun/calls/remove_call_out Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/calls/remove_call_out Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + remove_call_out - remove a pending call_out + + int remove_call_out( string fun | int handle ); + + Remove next pending call out for function `fun' in the current object, + or the call_out() which returned the integer 'handle'. + The return value is the time remaining before the callback is to be called. + The returned value is -1 if there were no call out pending to this function. + If fun is zero, all the call_outs of the object are removed. + + See also: + call_out, + call_out_info + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/calls/remove_shadow ds2.0r27/lib/doc/efun/calls/remove_shadow *** ds1.1/lib/doc/efun/calls/remove_shadow Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/calls/remove_shadow Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + remove_shadow - clear all the shadows related to an object. + + int remove_shadow(object); + + This function removes ALL shadows associated with the object passed + as the argument. Note this means all shadows ON the object, and all shadows + ORIGINATED by the object. + + This function requires PACKAGE_CONTRIB to be defined in the options file. + This function also requires that the option NO_SHADOWS be undefined. + + See also: + shadow + diff -c -r --new-file ds1.1/lib/doc/efun/calls/shadow ds2.0r27/lib/doc/efun/calls/shadow *** ds1.1/lib/doc/efun/calls/shadow Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/calls/shadow Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,41 ---- + shadow - shadow one or more functions in some object + + object shadow( object ob, int flag ); + + This efun is only available if NO_SHADOWS is not compiled in. + + If 'flag' is 1 or missing, then current object will shadow 'ob'. If + 'flag' is 0, then either 0 will be returned, or the object that is + already shadowing 'ob'. + + The master object defines the function "valid_shadow()". If it returns 1 + the target object can't be shadowed, and the "shadow()" function will + return 0 instead of 'ob'. + + If an object 'a' shadows an object 'b', then all "call_other(func)" to 'b' + will be redirected to 'a'. If object 'a' has not defined the function, + then the call will be forwarded to 'b' (as if there were no shadow). + There is only one object that can call functions in 'b' with + call_other(), and that is 'a'. Not even object 'b' can "call_other()" + itself. All normal (internal) function calls inside 'b' will however remain + internal to 'b'. + + There are two ways to remove the shadow. Either destruct it, or the object + that was shadowed. In the latter case, the shadow will also be destructed + automatically. Also, there is a efun remove_shadow() in the contrib package. + + The result is that it is possible to hide an object behind another one, + but everything can be totally transparent. The shadow() efunction makes + it possible to change the behavior of an object without changing the + code for the object in question. One possible use for shadow() is to + add special capabilities to various classes of players (thief, fighter, + mage, etc). This usage would make it possible to keep the player object + much simpler than it could be if the code for the various classes had + to be in the player object itself. + + See also: + destruct, + query_shadowing, + valid_shadow + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/calls/this_object ds2.0r27/lib/doc/efun/calls/this_object *** ds1.1/lib/doc/efun/calls/this_object Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/calls/this_object Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + this_object - return the object pointer of the calling object + + object this_object(); + + Return the object pointer of the current object. Useful for passing the + current object to other functions. + + See also: + this_player, + previous_object, + origin + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/calls/throw ds2.0r27/lib/doc/efun/calls/throw *** ds1.1/lib/doc/efun/calls/throw Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/calls/throw Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + throw - forces an error to occur in an object. + + void throw(mixed); + + Throw can be used to send an arbitrary value to an enclosing catch() statement. + If you want to raise a general error message, see error(), as that will + behave better if it is not caught. Control is transfered directly to the + enclosing catch() statement, and the value of the catch() statement is the + value thrown. + + See also: + catch, + error + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/compile/generate_source ds2.0r27/lib/doc/efun/compile/generate_source *** ds1.1/lib/doc/efun/compile/generate_source Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/compile/generate_source Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,19 ---- + generate_source - generates the C code corresponding to a give object(s) + + int generate_source(string file); + + int generate_source(string array files); + + This efun is only available if LPC_TO_C is compiled into the driver. + + generate_source() calls the LPC->C compiler to generate the source code + for a given object or objects. If more than one file is passed, a directory + named 'mudlib' is created in the SAVE_BINARIES directory, and that directory + can be copied into the driver source directory and compiled into the driver. + + If one file is given, the C source for that file is compiled, and the driver + attempts to link it into the running executable using the RUNTIME_LOADING + option. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/compile/index ds2.0r27/lib/doc/efun/compile/index *** ds1.1/lib/doc/efun/compile/index Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/compile/index Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,9 ---- + Compilation efuns + + The only efun in here currently is the LPC->C one. + + <DL> + * generate_source + </DL> + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/filesystem/cp ds2.0r27/lib/doc/efun/filesystem/cp *** ds1.1/lib/doc/efun/filesystem/cp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/filesystem/cp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + cp - copy a file + + int cp(string src, string dst); + + Copies the file 'src' to the file 'dst'. + + Returns 1 for success, returns -1 if the first src is unreadable, -2 if + dst is unreadable, and -3 if an i/o error occurs. + + See also: + rm, + rmdir, + rename, + link + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/filesystem/file_length ds2.0r27/lib/doc/efun/filesystem/file_length *** ds1.1/lib/doc/efun/filesystem/file_length Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/filesystem/file_length Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + file_length - get the number of lines in a file + + int file_length( string file ); + + file_length() returns the number of lines in file 'file'. Size -1 + indicates that 'file' either does not exist, or that it is not + readable. Size -2 indicates that 'file' is a directory. + + Note that this efun is not particularly fast on long files, since + determining the number of lines requires reading the entire file. + + See also: + file_size, + stat, + get_dir diff -c -r --new-file ds1.1/lib/doc/efun/filesystem/file_size ds2.0r27/lib/doc/efun/filesystem/file_size *** ds1.1/lib/doc/efun/filesystem/file_size Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/filesystem/file_size Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + file_size - get the size of a file + + int file_size( string file ); + + file_size() returns the size of file 'file' in bytes. Size -1 + indicates that 'file' either does not exist, or that it is not + readable. Size -2 indicates that 'file' is a directory. + + See also: + file_length, + stat, + get_dir diff -c -r --new-file ds1.1/lib/doc/efun/filesystem/get_dir ds2.0r27/lib/doc/efun/filesystem/get_dir *** ds1.1/lib/doc/efun/filesystem/get_dir Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/filesystem/get_dir Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,26 ---- + get_dir - returns information pertaining to a filesystem directory + + mixed array get_dir(string dir); + + mixed array get_dir(string dir, int flag); + + If `dir' is a filename ('*' and '?' wildcards are supported), an array of + strings is returned containing all filenames that match the specification. + If `dir' is a directory name (ending with a slash--ie: "/u/", "/adm/", etc), + all filenames in that directory are returned. + + If called with a second argument equal to -1, get_dir will return an array + of subarrays, where the format of each subarray is: + + ({ filename, size_of_file, last_time_file_touched }) + + Where filename is a string and last_time_file_touched is an integer being + number of seconds since January 1, 1970 (same format as time()). The + size_of_file element is the same value that is returned by file_size(); the + size of the file in bytes, or -2 if it's a directory. + + See also: + file_size, + stat, + time, + ctime diff -c -r --new-file ds1.1/lib/doc/efun/filesystem/index ds2.0r27/lib/doc/efun/filesystem/index *** ds1.1/lib/doc/efun/filesystem/index Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/filesystem/index Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,24 ---- + Filesystem Efuns + + These are the efuns which are available for manipulating files. + + <DL> + * cp + * file_length + * file_size + * get_dir + * link + * mkdir + * read_bytes + * read_file + * rename + * rm + * rmdir + * stat + * tail + * write_bytes + * write_file + </DL> + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/filesystem/link ds2.0r27/lib/doc/efun/filesystem/link *** ds1.1/lib/doc/efun/filesystem/link Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/filesystem/link Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,18 ---- + link - link a file to another + + void link( string original, string reference ); + + Creates a link 'reference' to the file 'original'. This efun causes + valid_link(original, reference) to be called in the master object. If + valid_link() returns 0, the link() call fails. If valid_link() returns 1 + then the link() suceeds iff rename() would succeed if called with the same + arguments. + + See also: + rm, + rmdir, + rename, + mkdir, + cp + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/filesystem/mkdir ds2.0r27/lib/doc/efun/filesystem/mkdir *** ds1.1/lib/doc/efun/filesystem/mkdir Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/filesystem/mkdir Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + mkdir - make a directory + + int mkdir( string directory ); + + Creates the specified directory. Returns 1 if successful, 0 if not. + + See also: + rm, + rmdir, + link + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/filesystem/read_bytes ds2.0r27/lib/doc/efun/filesystem/read_bytes *** ds1.1/lib/doc/efun/filesystem/read_bytes Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/filesystem/read_bytes Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + read_bytes - reads a contiguous series of bytes from a file into a string + + string read_bytes( string path, int start, int length ); + + This function reads 'length' bytes beginning at byte # 'start' in the + file named 'path'. The bytes are returned as a string. Note that + (start + length) must not be past the end of the file or else read_bytes + will fail. If the second and third arguments are omitted, the entire file + is returned. + + See also: + read_file, + write_bytes diff -c -r --new-file ds1.1/lib/doc/efun/filesystem/read_file ds2.0r27/lib/doc/efun/filesystem/read_file *** ds1.1/lib/doc/efun/filesystem/read_file Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/filesystem/read_file Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + read_file - read a file into a string + + string read_file( string file, int start_line, int number_of_lines ); + + Read a line of text from a file into a string. The second and third + arguments are optional. If only the first argument is specified, the + entire file is returned (as a string). + + The start_line is the line number of the line you wish to read. This routine + will return 0 if you try to read past the end of the file, or if you try to + read from a nonpositive line. + + See also: + write_file, + read_buffer diff -c -r --new-file ds1.1/lib/doc/efun/filesystem/rename ds2.0r27/lib/doc/efun/filesystem/rename *** ds1.1/lib/doc/efun/filesystem/rename Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/filesystem/rename Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + rename - rename a file + + int rename( string src, string dst ); + + Renames the file 'src' to 'dst'. + + rename() returns zero (0) to indicate success. Nonzero indicates failure. + + See also: + rm, + rmdir, + cp, + link diff -c -r --new-file ds1.1/lib/doc/efun/filesystem/rm ds2.0r27/lib/doc/efun/filesystem/rm *** ds1.1/lib/doc/efun/filesystem/rm Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/filesystem/rm Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + rm - remove a file + + int rm( string file ); + + Remove file `file'. Returns 0 for failure and 1 for success. + + See also: + mkdir, + rmdir, + link + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/filesystem/rmdir ds2.0r27/lib/doc/efun/filesystem/rmdir *** ds1.1/lib/doc/efun/filesystem/rmdir Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/filesystem/rmdir Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + rmdir - remove a directory + + int rmdir( string dir ); + + Remove directory `dir'. + Returns nonzero for success, zero (0) for failure. + + See also: + rm, + mkdir, + link diff -c -r --new-file ds1.1/lib/doc/efun/filesystem/stat ds2.0r27/lib/doc/efun/filesystem/stat *** ds1.1/lib/doc/efun/filesystem/stat Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/filesystem/stat Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,17 ---- + stat - returns information pertaining to a file or a directory + + mixed stat(string str); + mixed stat(string str, int x); + + If str is the name of a regular file (not a directory), then stat() + will return an array of information pertaining to that file. The + form of the array is as follows: + + ({ file_size, last_time_file_touched, time_object_loaded }) + + If stat is called on a directory (not a regular file), or with a second + argument of -1, then stat() behaves identically to get_dir(). + + See also: + get_dir, + stat diff -c -r --new-file ds1.1/lib/doc/efun/filesystem/tail ds2.0r27/lib/doc/efun/filesystem/tail *** ds1.1/lib/doc/efun/filesystem/tail Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/filesystem/tail Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + tail - displays the latter portion of a file + + int tail( string path ); + + This efunction displays the latter portion of the file named by path. + It returns 1 if successful, 0 otherwise (e.g. when the file is protected + against reading). + + See also: + read_file, + read_buffer, + file_size diff -c -r --new-file ds1.1/lib/doc/efun/filesystem/write_bytes ds2.0r27/lib/doc/efun/filesystem/write_bytes *** ds1.1/lib/doc/efun/filesystem/write_bytes Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/filesystem/write_bytes Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,10 ---- + write_bytes - writes a contiguous series of bytes to a file + + int write_bytes( string path, int start, string series ); + + This function writes the bytes in 'series' into the file named by 'path' + beginning at byte # 'start'. It returns zero (0) upon failure, 1 otherwise. + + See also: + write_file, + read_bytes diff -c -r --new-file ds1.1/lib/doc/efun/filesystem/write_file ds2.0r27/lib/doc/efun/filesystem/write_file *** ds1.1/lib/doc/efun/filesystem/write_file Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/filesystem/write_file Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + write_file - appends a string to a file + + int write_file( string file, string str, int flag ); + + Append the string `str' into the file `file'. Returns 0 or 1 for + failure or success. If flag is 1, write_file overwrites instead of + appending. + + See also: + read_file, + write_buffer, + file_size diff -c -r --new-file ds1.1/lib/doc/efun/floats/acos ds2.0r27/lib/doc/efun/floats/acos *** ds1.1/lib/doc/efun/floats/acos Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/floats/acos Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + acos - return the arccosine of a float + + float acos( float f ); + + This efun is available only if PACKAGE_MATH is compiled in to the driver. + + Returns the arccosine of its argument, `f', measured in radians. + + See also: + asin, + atan, + cos, + sin, + tan diff -c -r --new-file ds1.1/lib/doc/efun/floats/asin ds2.0r27/lib/doc/efun/floats/asin *** ds1.1/lib/doc/efun/floats/asin Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/floats/asin Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + asin - return the arcsine of a float + + float asin( float f ); + + This efun is only available if PACKAGE_MATH is compiled in. + + Returns the arcsine of its argument, `f', measured in radians. + + See also: + acos, + atan, + cos, + sin, + tan diff -c -r --new-file ds1.1/lib/doc/efun/floats/atan ds2.0r27/lib/doc/efun/floats/atan *** ds1.1/lib/doc/efun/floats/atan Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/floats/atan Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + atan - return the tangent of a float + + float atan( float f ); + + This efun is only available if PACKAGE_MATH is not compiled in. + + Returns the arctangent of its argument, `f', measured in radians. + + See also: + acos, + asin, + cos, + sin, + tan diff -c -r --new-file ds1.1/lib/doc/efun/floats/ceil ds2.0r27/lib/doc/efun/floats/ceil *** ds1.1/lib/doc/efun/floats/ceil Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/floats/ceil Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + ceil - round a float up to the nearest integer + + float ceil( float f ); + + This efun is only available if PACKAGE_MATH is compiled in. + + Returns (as a float) the nearest integer number equal to or greater than f. + + See also: + floor, + to_int, + to_float + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/floats/cos ds2.0r27/lib/doc/efun/floats/cos *** ds1.1/lib/doc/efun/floats/cos Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/floats/cos Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + cos - return the cosine of a float + + float cos( float f ); + + This efun is only available if PACKAGE_MATH is compiled into the driver. + + Returns the cosine of its argument, `f', measured in radians. + + See also: + acos, + asin, + atan, + sin, + tan + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/floats/exp ds2.0r27/lib/doc/efun/floats/exp *** ds1.1/lib/doc/efun/floats/exp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/floats/exp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + exp - find e to the power of a float + + float exp( float f ); + + This efun is only available if PACKAGE_MATH is compiled in. + + exp() returns e^f. + + See also: + log, + pow, + sqrt + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/floats/floor ds2.0r27/lib/doc/efun/floats/floor *** ds1.1/lib/doc/efun/floats/floor Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/floats/floor Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + floor - round a float down to the nearest integer + + float floor( float f ); + + This efun is only available if PACKAGE_MATH is compiled in. + + Returns (as a float) the nearest integer number equal to or smaller than f. + + See also: + ceil, + to_int, + to_float diff -c -r --new-file ds1.1/lib/doc/efun/floats/index ds2.0r27/lib/doc/efun/floats/index *** ds1.1/lib/doc/efun/floats/index Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/floats/index Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,22 ---- + Float Efuns + + The following efuns provide general math library functions. + + <DL> + * acos + * asin + * atan + * ceil + * cos + * exp + * floatp + * floor + * log + * pow + * sin + * sqrt + * tan + * to_int + </DL> + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/floats/log ds2.0r27/lib/doc/efun/floats/log *** ds1.1/lib/doc/efun/floats/log Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/floats/log Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + log - returns the natural logarithm of a float + + float log( float f ); + + This efun is only available if PACKAGE_MATH is compiled in. + + Returns the natural logarithm of its argument, `f'. `f' must be positive. + + See also: + exp, + pow, + sqrt diff -c -r --new-file ds1.1/lib/doc/efun/floats/pow ds2.0r27/lib/doc/efun/floats/pow *** ds1.1/lib/doc/efun/floats/pow Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/floats/pow Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + pow - find an exponent of a float + + float pow( float x, float y ); + + This efun is only available if PACKAGE_MATH is defined. + + pow() returns x to the y power. If x is 0.0, y must be positive. If x is + negative, y must be an integer. + + See also: + exp, + log, + sqrt diff -c -r --new-file ds1.1/lib/doc/efun/floats/sin ds2.0r27/lib/doc/efun/floats/sin *** ds1.1/lib/doc/efun/floats/sin Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/floats/sin Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + sin - return the sine of a float + + float sin( float f ); + + This efun is only available if PACKAGE_MATH is compiled in. + + Returns the sine of its argument, `f', measured in radians. + + See also: + acos, + asin, + atan, + cos, + tan + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/floats/sqrt ds2.0r27/lib/doc/efun/floats/sqrt *** ds1.1/lib/doc/efun/floats/sqrt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/floats/sqrt Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + sqrt - returns the square root of a float + + float sqrt( float f ); + + This efun is only available if PACKAGE_MATH is compiled in. + + sqrt() returns the non-negative square root of its argument, `f'. The value + of `f' must not be negative. + + See also: + exp, + log, + pow + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/floats/tan ds2.0r27/lib/doc/efun/floats/tan *** ds1.1/lib/doc/efun/floats/tan Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/floats/tan Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + tan - return the tangent of a float + + float tan( float f ); + + This efun is only available if PACKAGE_MATH is compiled in. + + Returns the tangent of its argument, 'f', measured in radians. + + See also: + acos, + asin, + atan, + cos, + sin diff -c -r --new-file ds1.1/lib/doc/efun/floats/to_int ds2.0r27/lib/doc/efun/floats/to_int *** ds1.1/lib/doc/efun/floats/to_int Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/floats/to_int Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + to_int - convert a float or buffer to an int + + int to_int( float x ); + int to_int( buffer x ); + int to_int( string x ); + + If 'x' is a float, the to_int() call returns the number of type 'int' that is + equivalent to 'x' (with any decimal stripped off). If 'x' is a buffer, the + call returns the integer (in network-byte-order) that is embedded in the + buffer. If 'x' is a string, then the string is converted to an integer. + An undefined value is returned if the string is not a valid number. + + See also: + to_float, + read_buffer diff -c -r --new-file ds1.1/lib/doc/efun/functions/bind ds2.0r27/lib/doc/efun/functions/bind *** ds1.1/lib/doc/efun/functions/bind Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/functions/bind Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + bind - bind a function pointer to a new object + + function bind(function, object); + + bind() causes a function to become owned by the new object. This changes + the value of this_object() when the function pointer is evaluated. Functions + that reference global variables or functions in the object that created + them cannot be rebound. Binding a function to the object it is already + bound to will never fail. + + Permission to use this efun is controlled by the valid_bind() master apply. + + See also: + function_owner, + valid_bind diff -c -r --new-file ds1.1/lib/doc/efun/functions/evaluate ds2.0r27/lib/doc/efun/functions/evaluate *** ds1.1/lib/doc/efun/functions/evaluate Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/functions/evaluate Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,8 ---- + evaluate - evaluate a function pointer + + mixed evaluate(mixed f, ...); + + If f is a function, f is called with the rest of the arguments. + Otherwise, f is returned. evaluate(f, ...) is the same as (*f)(...). + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/functions/function_owner ds2.0r27/lib/doc/efun/functions/function_owner *** ds1.1/lib/doc/efun/functions/function_owner Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/functions/function_owner Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + function_owner - return the owner of a given function. + + object function_owner(function); + + function_owner returns the object that owns the function specified by + the argument. + + This function requires PACKAGE_CONTRIB to be defined in the options file. + + See also: + bind diff -c -r --new-file ds1.1/lib/doc/efun/functions/index ds2.0r27/lib/doc/efun/functions/index *** ds1.1/lib/doc/efun/functions/index Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/functions/index Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + Function efuns + + These efuns are for use with function pointers. + + <DL> + * bind + * evaluate + * functionp + </DL> + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/general/copy ds2.0r27/lib/doc/efun/general/copy *** ds1.1/lib/doc/efun/general/copy Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/general/copy Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,22 ---- + copy - recursively duplicate a value + + mixed copy(mixed); + + copy() returns a value with exactly the same value as its argument, but with + all reference types (mappings, arrays, etc) duplicated. For example: + + mapping a, b = ({ 1 }); + a = b; + a[0] = 2; + printf("%O %O\n", a, b); + + results in ({ 2 }) and ({ 2 }), while: + + mapping a, b = ({ 1 }); + a = copy(b); + a[0] = 2; + printf("%O %O\n", a, b); + + results in ({ 2 }) and ({ 1 }). + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/general/fetch_variable ds2.0r27/lib/doc/efun/general/fetch_variable *** ds1.1/lib/doc/efun/general/fetch_variable Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/general/fetch_variable Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + fetch_variable - set the value of a variable + + mixed fetch_variable(string); + + Return the value of the variable specified by the argument. + Note that the variable must be defined, and must be defined in this_object(). + + This function requires PACKAGE_CONTRIB to be defined in the options file. + + See also: + restore_variable, + store_variable, + restore_object + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/general/filter ds2.0r27/lib/doc/efun/general/filter *** ds1.1/lib/doc/efun/general/filter Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/general/filter Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + filter - select certain elements + + mixed filter(mixed x, string fun, object ob, mixed extra, ...); + + mixed filter(mixed x, function f, mixed extra, ...); + + The (ob, fun) syntax works as if (: call_other, ob, fun :) had been passed as + f. Filter returns a new structure containing only the elements of x for which + the function returns nonzero. Currently, it can be used on arrays and + mappings. In the case of mappings, both the key and the value are passed + to the function. extra and all the following arguments are passed to the + function after the element. For example, filter(arr, fun, 2, 3) will + first call fun(arr[0], 2, 3) then fun(arr[1], 2, 3) etc. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/general/index ds2.0r27/lib/doc/efun/general/index *** ds1.1/lib/doc/efun/general/index Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/general/index Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,18 ---- + Efuns for general LPC values + + These efuns act on arbitrary values of various types. + + <DL> + * copy + * fetch_variable + * filter + * map + * restore_variable + * save_variable + * store_variable + * sizeof + * typeof + * undefinedp + </DL> + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/general/map ds2.0r27/lib/doc/efun/general/map *** ds1.1/lib/doc/efun/general/map Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/general/map Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + map - modify an mapping + + mixed map( mixed x, string fun, object ob, mixed extra, ... ); + + mixed map( mixed x, function f, mixed extra, ... ); + + The (ob, fun) syntax works as if (: call_other, ob, fun :) had been passed as + f. Map returns a new structure containing the return values of f being applied + to each element of x. Currently, it can be used on arrays, mappings and + strings. In the case of mappings, both the key and the value are passed + to the function. In the case of strings, the characters are passed to the + function one at a time as ints. extra and all the following arguments are + passed to the function after the element. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/general/restore_variable ds2.0r27/lib/doc/efun/general/restore_variable *** ds1.1/lib/doc/efun/general/restore_variable Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/general/restore_variable Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + restore_variable - restore value of a variable from a string + + mixed restore_variable( string value ); + + Restores an LPC value from a string. The format used is the + same format as save/restore_object. + + See also: + save_variable, + restore_object + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/general/save_variable ds2.0r27/lib/doc/efun/general/save_variable *** ds1.1/lib/doc/efun/general/save_variable Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/general/save_variable Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,10 ---- + save_variable - save the value of variable into a string + + string save_variable( mixed var ); + + Saves an LPC value into a string. The format is the same as + save/restore_object. + + See also: + restore_variable, + restore_object diff -c -r --new-file ds1.1/lib/doc/efun/general/sizeof ds2.0r27/lib/doc/efun/general/sizeof *** ds1.1/lib/doc/efun/general/sizeof Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/general/sizeof Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,10 ---- + sizeof - return the number of elements in an array + + int sizeof( mixed var ); + + Return the number of elements in an array, mapping, string, class or + buffer 'var'. If `var' is not an array, mapping, string, class or + buffer, then zero (0) is returned. + + See also: + strlen diff -c -r --new-file ds1.1/lib/doc/efun/general/store_variable ds2.0r27/lib/doc/efun/general/store_variable *** ds1.1/lib/doc/efun/general/store_variable Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/general/store_variable Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,17 ---- + store_variable - set the value of a variable + + void store_variable(string, mixed); + + Set the value of the variable specified by the first argument to the value + specfied by the second argument. Note that the variable must be defined, and + must be defined in this_object(). + + This function requires PACKAGE_CONTRIB to be defined in the options file. + + See also: + restore_variable, + fetch_variable, + save_object + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/general/typeof ds2.0r27/lib/doc/efun/general/typeof *** ds1.1/lib/doc/efun/general/typeof Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/general/typeof Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,20 ---- + typeof - return the type of an expression + + int typeof( mixed var ); + + Return the type of an expression. The return values are given in + the driver include "type.h". They are: + + <pre> + INT "int" + STRING "string" + ARRAY "array" + OBJECT "object" + MAPPING "mapping" + FUNCTION "function" + FLOAT "float" + BUFFER "buffer" + CLASS "class" + </pre> + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/interactive/add_action ds2.0r27/lib/doc/efun/interactive/add_action *** ds1.1/lib/doc/efun/interactive/add_action Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/add_action Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,49 ---- + add_action - bind a command verb to a local function + + void add_action( string | function fun, string | string array cmd ); + + void add_action( string | function fun, string | string array cmd, int flag ); + + This efun is only available if NO_ADD_ACTION isn't defined. + + Set up a function 'fun' to be called the a user types the command 'cmd'. + (What is the command is determined by the first 'word' which consists + of all the characters before the first space, with the exception of + verbs that don't need a space; see below). + + If 'cmd' is an array, then that function will be called for any of the + commands in the array. 'fun' can either be a string which is the name + of a function in the object adding the command, or a function pointer. + + Functions called by a user command will get the rest of the command line + as a string. It must then return 0 if it was the wrong command, otherwise 1. + If 1 is returned, no further parsing is done; if 0 is returned, other + commands will be checked (possibly the same command added by a different + object). If no command is found, the default error message will be sent + to the player (traditionally, 'What?' but see also notify_fail()) + + For functions which can be called by more than one command, check query_verb() + to see which command was used. + + Note: add_action() does not add commands globally; it only adds commands to + this_user(), and the object must be 'close' to the user it is adding commands + to. + + Usually add_action() is called only from an init() routine. The object that + defines commands must be 'close' to the user, either being the user, + being carried by the user, being the room around the user, or being an + object in the same room as the user. + + Since init() is called when a user moves 'close' to an object, it is a + convenient time to add such commands. The commands are removed when the + user moves out of range (or the object does). + + If argument 'flag' is 1, then only the leading characters of the command has + to match the verb 'cmd' and the entire verb is returned by query_verb(). If + argument 'flag' is 2, then again, only the leading characters must match, + but query_verb() will only return the characters following 'cmd'. + + See also: + query_verb, + remove_action, + init diff -c -r --new-file ds1.1/lib/doc/efun/interactive/command ds2.0r27/lib/doc/efun/interactive/command *** ds1.1/lib/doc/efun/interactive/command Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/command Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + command - execute a command as if given by the object + + int command( string str ); + + This efun is only available if NO_ADD_ACTION isn't defined. + + Execute 'str' for the object this_object() as a command (matching against + add_actions and such). The object must have called enable_commands() for + this to have any effect. + In case of failure, 0 is returned, otherwise a numeric value is returned, + which is the LPC "evaluation cost" of the command. Bigger numbers mean + higher cost, but the whole scale is subjective and unreliable. + + See also: + add_action, + enable_commands diff -c -r --new-file ds1.1/lib/doc/efun/interactive/commands ds2.0r27/lib/doc/efun/interactive/commands *** ds1.1/lib/doc/efun/interactive/commands Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/commands Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,17 ---- + commands - returns some information about actions the user can take + + array commands(); + + This efun is only available if NO_ADD_ACTION is not defined. + + Returns an array of an array of 4 items describing the actions that + are available to this_object(). The first item is the command + itself (as passed to add_action()). The second is the set of + flags (passed to add_action as the third argument, often defaulted + to 0). The third is the object that defined the action. The fourth + is the function to be called ("<function>" if it is a function pointer). + + See also: + add_action, + enable_commands, + disable_commands diff -c -r --new-file ds1.1/lib/doc/efun/interactive/disable_commands ds2.0r27/lib/doc/efun/interactive/disable_commands *** ds1.1/lib/doc/efun/interactive/disable_commands Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/disable_commands Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,10 ---- + disable_commands - makes a living object non-living + + void disable_commands(); + + This efun is only available if NO_ADD_ACTION is not defined. + + Causes the current object to no longer be able to execute commands. + + See also: + enable_commands diff -c -r --new-file ds1.1/lib/doc/efun/interactive/disable_wizard ds2.0r27/lib/doc/efun/interactive/disable_wizard *** ds1.1/lib/doc/efun/interactive/disable_wizard Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/disable_wizard Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + disable_wizard - remove wizard priveleges from an object + + void disable_wizard(); + + This efun is only available if NO_WIZARDS is not defined. + + The opposite of enable_wizard(). Disables wizard privileges from the + current object. + + See also: + enable_wizard, + wizardp diff -c -r --new-file ds1.1/lib/doc/efun/interactive/ed ds2.0r27/lib/doc/efun/interactive/ed *** ds1.1/lib/doc/efun/interactive/ed Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/ed Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,39 ---- + ed - edit a file + + This efun is only available if OLD_ED is defined. + + void ed( string file, string exit_fn, int restricted ); + + void ed( string file, string write_fn, string exit_fn, int restricted ); + + This is a funny function. It will start a local editor on an optional + file. This editor is almost UNIX ed compatible. When in the editor + type 'h' for help. + + The 'write_fn' function allows the mudlib to handle file locks and + administrative logging of files modified. When the editor writes to a + file, the driver will callback the 'write_fn' function twice. The first + time, the function is called before the + write takes place -- 'flag' will be 0. If the function returns 1, + the write will continue, + otherwise it will abort. The second time, the function is called + after the write has completed -- 'flag' will be non-zero. + This callback function should have the form: + + int write_fn(string fname, int flag) + + When the editor is exited, the driver will callback the 'exit_fn' + function. This function allows the mudlib to clean up. This + callback function has the form: + + void exit_fn() + + The optional 'restricted' flag limits the editor's + capabilities, such as inserting a file, and saving using an alternate + file name. + + See also: + regexp, + valid_read, + valid_write, + get_save_file_name diff -c -r --new-file ds1.1/lib/doc/efun/interactive/ed_cmd ds2.0r27/lib/doc/efun/interactive/ed_cmd *** ds1.1/lib/doc/efun/interactive/ed_cmd Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/ed_cmd Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + ed_cmd - perform an 'ed' command + + This efun is only available if OLD_ED is not defined. + + string ed_cmd(string cmd); + + Performs the ed command 'cmd'. The result of the command is returned. + Ed must have been started with ed_start() in order to call this efun. + + See also: + ed_start diff -c -r --new-file ds1.1/lib/doc/efun/interactive/ed_start ds2.0r27/lib/doc/efun/interactive/ed_start *** ds1.1/lib/doc/efun/interactive/ed_start Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/ed_start Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,22 ---- + ed_start - start up 'ed' + + This efun is only available if OLD_ED is not defined. + + string ed_start(string file, int flag); + + string ed_start(string file); + + string ed_start(); + + If 'flag' is nonzero, ed is started in restricted mode. See the documentation + for the old efun for information. 'file' is the name of the file to open; + if none is given then no file becomes active. + + ed_start() may not be called when another ed session for the current + object is already active. Any messages generated while starting up ed + are returned by this efun. + + See also: + ed, + ed_cmd, + query_ed_mode diff -c -r --new-file ds1.1/lib/doc/efun/interactive/enable_commands ds2.0r27/lib/doc/efun/interactive/enable_commands *** ds1.1/lib/doc/efun/interactive/enable_commands Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/enable_commands Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,18 ---- + enable_commands - allow object to use 'player' commands + + void enable_commands(); + + This efun is only available if NO_ADD_ACTION is not defined. + + enable_commands() marks this_object() as a living object, and allows + it to use commands added with add_action() (by using command()). + When enable_commands() is called, the driver also looks for the + local function catch_tell(), and if found, it will call it every time + a message (via say() for example) is given to the object. + + See also: + living, + add_action, + command, + catch_tell, + say diff -c -r --new-file ds1.1/lib/doc/efun/interactive/enable_wizard ds2.0r27/lib/doc/efun/interactive/enable_wizard *** ds1.1/lib/doc/efun/interactive/enable_wizard Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/enable_wizard Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,29 ---- + enable_wizard - give wizard priveleges to an object + + void enable_wizard(); + + Available only if NO_WIZARDS isn't defined. + + Any interactive object that calls enable_wizard() will cause wizardp() + to return true if called on that object. enable_wizard() gives three + privileges to the interactive object in question: + + <DL> + * ability to use restricted modes of ed when the RESTRICTED_ED option + is compiled into the driver. + * + privilege of receiving descriptive runtime error messages. + * + privilege of using the trace() and traceprefix() efuns. + <DL> + + If you don't use this, ed() must be explicitly restricted when necessary, + an error_handler should be implemented to give appropriate messages if you + don't want all users to get descriptive error traces, and trace() and + traceprefix() should be restricted via simul_efuns, if necessary. + + See also: + disable_wizard, + wizardp + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/interactive/exec ds2.0r27/lib/doc/efun/interactive/exec *** ds1.1/lib/doc/efun/interactive/exec Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/exec Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,18 ---- + exec - switches a user (interactive) connection from one object to another + + int exec( object to, object from ); + + This efunction allows the interactive link to a given object to be + moved to another object. That is, after a successful exec(to, from) + call, interactive(to) will return 1 and interactive(from) will return 0. + The player that was controlling 'from' will begin controlling 'to' following + the exec() call. Note that this is a powerful function and its use must + be restricted if you wish to attempt to have a secure mud. The proper + way to restrict the use of exec() is to make a simul_efun of the same name + and then use valid_override() to restrict the use of a simul_efun override + (i.e. efun::exec()). The exec() function returns 1 if the switch is + successful (and 0 otherwise). + + See also: + interactive, + valid_override diff -c -r --new-file ds1.1/lib/doc/efun/interactive/find_player ds2.0r27/lib/doc/efun/interactive/find_player *** ds1.1/lib/doc/efun/interactive/find_player Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/find_player Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + find_player - find a player by name + + object find_player( string str ); + + This efun is only available when NO_ADD_ACTION is not defined. + + Similar to find_living(), but only searches through objects that are + interactive, or were once interactive. + + See also: + find_living, + livings, + users, + set_living_name diff -c -r --new-file ds1.1/lib/doc/efun/interactive/get_char ds2.0r27/lib/doc/efun/interactive/get_char *** ds1.1/lib/doc/efun/interactive/get_char Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/get_char Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,28 ---- + get_char - causes next character of input to be sent to a specified function + + varargs void get_char( string | function fun, int flag, ... ); + + Enable next character of user input to be sent to the function `fun' as + an argument. The input character will not be parsed by the driver. + + Note that get_char is non-blocking which means that the object calling + get_char does not pause waiting for input. Instead the object continues + to execute any statements following the get_char. The specified function + `fun' will not be called until the user input has been collected. + + If "get_char()" is called more than once in the same execution, only the + first call has any effect. + + If optional argument `flag' is non-zero, the char given by the player will + not be echoed, and is not seen if snooped (this is useful for collecting + passwords). + + The function `fun' will be called with the user input as its first argument + (a string). Any additional arguments supplied to get_char will be passed on to + `fun' as arguments following the user input. + + See also: + call_out, + input_to + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/interactive/in_edit ds2.0r27/lib/doc/efun/interactive/in_edit *** ds1.1/lib/doc/efun/interactive/in_edit Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/in_edit Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + in_edit() - determine if a player is in the editor + + string in_edit(); + + string in_edit(object ob); + + If the given object is in the editor, the file being edited is + returned, else zero. If no object is given, this_object() is used. + + See also: + ed, + in_input + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/interactive/in_input ds2.0r27/lib/doc/efun/interactive/in_input *** ds1.1/lib/doc/efun/interactive/in_input Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/in_input Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + in_input() - determines if a player is inputting to an input_to + + int in_input(); + + int in_input(object ob); + + Returns 1 if the object is currently inputting to an input_to or get_char. + If no object is specified, this_object() is assumed. + + See also: + get_char, + input_to + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/interactive/index ds2.0r27/lib/doc/efun/interactive/index *** ds1.1/lib/doc/efun/interactive/index Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/index Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,72 ---- + Interactive efuns + + <H3>These efuns are for dealing with interactive (user) objects:</H3> + + actions and related efuns: (Not available with NO_ADD_ACTION) + + <DL> + * add_action + * command + * commands + * disable_commands + * enable_commands + * find_player + * notify_fail + </DL> + + Archaic wizard functions: (Not available with NO_WIZARDS) + <DL> + * disable_wizard + * enable_wizard + * wizardp + </DL> + + The old ed interface: (#define OLD_ED) + <DL> + * ed + * in_edit + </DL> + + The new one: + <DL> + * ed_cmd + * ed_start + * in_edit + * query_ed_mode + </DL> + + Input handling: + <DL> + * get_char + * input_to + * in_input + * receive + </DL> + + Output handling: + <DL> + * printf + * say + * shout + * snoop + * write + </DL> + + Information about user objects, and miscellaneous utility functions: + <DL> + * exec + * interactive + * message + * query_host_name + * query_idle + * query_ip_name + * query_ip_number + * query_snoop + * query_snooping + * resolve + * this_interactive + * this_player + * userp + * users + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/interactive/input_to ds2.0r27/lib/doc/efun/interactive/input_to *** ds1.1/lib/doc/efun/interactive/input_to Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/input_to Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,33 ---- + input_to - causes next line of input to be sent to a specified function + + varargs void input_to( string | function fun, int flag, ... ); + + Enable next line of user input to be sent to the local function 'fun' as + an argument. The input line will not be parsed by the driver. + + Note that input_to is non-blocking which means that the object calling + input_to does not pause waiting for input. Instead the object continues + to execute any statements following the input_to. The specified function + 'fun' will not be called until the user input has been collected. + + If "input_to()" is called more than once in the same execution, only the + first call has any effect. + + If optional argument 'flag' has the 1 bit set, the line given by the player + will not be echoed, and is not seen if snooped (this is useful for collecting + passwords). + + If 'flag' has the 2 bit set, the input_to cannot be bypassed by beginning the + command with '!'. Otherwise, lines which start with '!' drop through to + the normal input handler. + + The function 'fun' will be called with the user input as its first argument + (a string). Any additional arguments supplied to input_to will be passed on to + 'fun' as arguments following the user input. + + See also: + call_other, + call_out, + get_char + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/interactive/interactive ds2.0r27/lib/doc/efun/interactive/interactive *** ds1.1/lib/doc/efun/interactive/interactive Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/interactive Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + interactive - detects whether or not a given object is an interactive + + int interactive( object ob ); + + Return non-zero if 'ob' is an interactive player. 0 will be returned + if he is link dead. + + See also: + query_ip_number, + query_ip_name, + enable_commands + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/interactive/message ds2.0r27/lib/doc/efun/interactive/message *** ds1.1/lib/doc/efun/interactive/message Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/message Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,32 ---- + message - deliver messages to "living" objects + + void message( mixed class, mixed message, mixed target, mixed exclude ); + + message() calls receive_message(mixed class, mixed message) in all objects + in the target list excluding those in the exclude list. This basically + tells the object the message. + + Class is the type of message (used for clients and such). An example + would be 'combat', 'shout', 'emergency' etc. Any LPC value can be + passed, though. + + Message is usually a string containing the text to send, though it + can also be any value. + + Target is a list of objects to be sent the message. This can be either a + single object string or object pointer, or may be an array of either. + If a target is non-living all objects in its environment will receive + the message. + + Exclude is a list of objects that should not receive the message. This + can either be one object or an array of objects. + + See also: + receive_message, + say, + write, + shout, + tell_object, + tell_room + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/interactive/notify_fail ds2.0r27/lib/doc/efun/interactive/notify_fail *** ds1.1/lib/doc/efun/interactive/notify_fail Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/notify_fail Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,36 ---- + notify_fail - set the default error message to a specified string + + int notify_fail( string | function str ); + + This efun is only available if NO_ADD_ACTION is not compiled in. + + Store `str' as the error message to be returned instead of the default message + `What?'. The message will be displayed if a 0 is returned from all actions + setup via add_action(). This is the preferred way to display error messages + since it allows other objects a chance to respond to the same verb (command). + Do not use write() to display the error message since this will require you + to return a 1 (unless you want to see the result of the write() in addition to + the 'What?' message). However, if you do return a 1, then no other objects + will get a chance to respond to the user command. + + Note: Getting this right in the presence of multiple failures is tricky, + to say the least. One can use a function pointer instead, and have the + routine resolve the collisions. + + If a function is passed instead of a string, the function is called + instead of printing a message. If the function returns a string, that + string is used as the failure message. Also, this_player() is set + correctly, so write() can be used. + + If "notify_fail()" is called more than once, only the last call will have + an effect. + + The idea behind this function is to allow better error messages than + `What?'. + + As a side note, notify_fail() always returns zero, so return notify_fail(...) + works as expected. + + add_action + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/interactive/printf ds2.0r27/lib/doc/efun/interactive/printf *** ds1.1/lib/doc/efun/interactive/printf Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/printf Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,75 ---- + printf - formatted output conversion + + void printf( string format, ... ); + + The output is sent to this_user(), in the same manner as the write() efun. + Implemented by Lynscar (Sean A Reith). + + This version supports the following as modifiers: + <DL> + * " " - pad positive integers with a space. + * "+" - pad positive integers with a plus sign. + * "-" - left adjusted within field size. + + Note: std (s)printf() defaults to right justification, which is unnatural + in the context of a mainly string based language but has been retained for + "compatability". + * "|" - centered within field size. + * "=" - column mode if strings are greater than field size. This is only + meaningful with strings, all other types ignore this. Columns are + auto-magically word wrapped. + * "#" - table mode, print a list of '\\n' separated 'words' in a + table within the field size. only meaningful with strings. + * a number - + specifies the field size, a '*' specifies to use the corresponding + arg as the field size. If n is prepended with a zero, then is padded + zeros, else it is padded with spaces (or specified pad string). + * "." followed by a number - + precision of n, simple strings truncate after this (if precision is + greater than field size, then field size = precision), tables use + precision to specify the number of columns (if precision not specified + then tables calculate a best fit), all other types ignore this. + * ":" followed by a number - + n specifies the fs _and_ the precision, if n is prepended by a zero + then it is padded with zeros instead of spaces. + * "@" - + the argument is an array. the corresponding format_info (minus the + "@") is applyed to each element of the array. + * "'X'" - + The char(s) between the single-quotes are used to pad to field + size (defaults to space) (if both a zero (in front of field + size) and a pad string are specified, the one specified second + overrules). NOTE: to include "'" in the pad string, you must + use "\'" (as the backslash has to be escaped past the + interpreter), similarly, to include "\" requires "\\\\". + </DL> + + The following are the possible type specifiers. + <DL> + * % - + in which case no arguments are interpreted, and a "%" is inserted, and + all modifiers are ignored. + * O - + the argument is an LPC datatype. The format is suitable for printing any + type (useful for debugging) + * s - + the argument is a string. + * d or i - + the integer arg is printed in decimal. + * c - + the integer arg is to be printed as a character. + * o - + the integer arg is printed in octal. + * x - + the integer arg is printed in hex. + * X - + the integer arg is printed in hex (with A-F in capitals). + * f - + floating point number + </DL> + + See also: + sscanf, + sprintf + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/interactive/query_ed_mode ds2.0r27/lib/doc/efun/interactive/query_ed_mode *** ds1.1/lib/doc/efun/interactive/query_ed_mode Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/query_ed_mode Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,21 ---- + query_ed_mode - return which mode ed is in + + This efun is only available if OLD_ED is not defined. + + int query_ed_mode(); + + Return value should be interpreted as follows: + + 0 = normal ed prompt + + -1 = not in ed + + -2 = more prompt for help + + positive number = prompt for input for line n + + See also: + ed, + ed_start + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/interactive/query_host_name ds2.0r27/lib/doc/efun/interactive/query_host_name *** ds1.1/lib/doc/efun/interactive/query_host_name Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/query_host_name Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + query_host_name - return the host name + + string query_host_name(); + + query_host_name() returns the name of the host. + + See also: + resolve, + socket_address, + query_ip_name, + query_ip_number + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/interactive/query_idle ds2.0r27/lib/doc/efun/interactive/query_idle *** ds1.1/lib/doc/efun/interactive/query_idle Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/query_idle Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + query_idle - determine how many seconds an interactive player has been idle + + int query_idle( object ob ); + + Query how many seconds a player object (ob) has been idling. + + See also: + in_edit, + in_input + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/interactive/query_ip_name ds2.0r27/lib/doc/efun/interactive/query_ip_name *** ds1.1/lib/doc/efun/interactive/query_ip_name Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/query_ip_name Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + query_ip_name - return the ip name of a given player object. + + string query_ip_name( object ob ); + + Return the IP address for player `ob'. An asynchronous process `addr_server' + is used to find out these name in parallel. If there are any failures to + find the ip-name, then the ip-number is returned instead. + + See also: + query_ip_number, + query_host_name, + resolve, + socket_address + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/interactive/query_ip_number ds2.0r27/lib/doc/efun/interactive/query_ip_number *** ds1.1/lib/doc/efun/interactive/query_ip_number Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/query_ip_number Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + query_ip_number - return the ip number for a player object + + string query_ip_number( object ob ); + + Return the ip-number (dotted decimal form) for player `ob'. + + See also: + query_ip_name, + query_host_name, + resolve, + socket_address + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/interactive/query_ip_port ds2.0r27/lib/doc/efun/interactive/query_ip_port *** ds1.1/lib/doc/efun/interactive/query_ip_port Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/query_ip_port Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,18 ---- + query_ip_port - return the ip port of a given player object. + + int query_ip_port(object | void); + + Returns the local port that the argument object used to connect to + the mud. If the argument is void, return the local port that + this_player() used to connect to the mud. Calling this on + non-interactive objects will return 0. + + This function requires PACKAGE_CONTRIB to be defined in the options file. + + See also: + query_ip_name, + query_host_name, + resolve, + socket_address + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/interactive/query_notify_fail ds2.0r27/lib/doc/efun/interactive/query_notify_fail *** ds1.1/lib/doc/efun/interactive/query_notify_fail Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/query_notify_fail Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,17 ---- + query_notify_fail - Query if an interactive object has a pending notify_fail() + + mixed query_notify_fail(void); + + This function returns whatever this_player()'s notify_fail value + has been set to. This is either a string, or a function, depending + on what it has been set to by the most recent call to notify_fail() + that applied to this_player(). + + This function requires PACKAGE_CONTRIB to be defined in the options file. + This function also requires that the NO_ADD_ACTION option NOT be defined. + + See also: + add_action, + notify_fail + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/interactive/query_snoop ds2.0r27/lib/doc/efun/interactive/query_snoop *** ds1.1/lib/doc/efun/interactive/query_snoop Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/query_snoop Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,10 ---- + query_snoop - return the snooper of an interactive object + + object query_snoop( object ob ); + + If `ob' (an interactive object) is being snooped by another interactive object, + the snooping object is returned. Otherwise, 0 is returned. + + See also: + snoop, + query_snooping diff -c -r --new-file ds1.1/lib/doc/efun/interactive/query_snooping ds2.0r27/lib/doc/efun/interactive/query_snooping *** ds1.1/lib/doc/efun/interactive/query_snooping Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/query_snooping Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + query_snooping - return the object than an object is snooping + + object query_snooping( object ob ); + + If `ob' (an interactive object) is snooping another interactive object, the + snooped object is returned. Otherwise, 0 is returned. + + See also: + snoop, + query_snoop + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/interactive/receive ds2.0r27/lib/doc/efun/interactive/receive *** ds1.1/lib/doc/efun/interactive/receive Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/receive Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + receive - displays a message to the current object + + int receive( string message ); + + This efun is an interface to the add_message() function in the driver. + Its purpose is to display a message to the current object. It returns 1 + if the current object is interactive, 0 otherwise. Often, receive() is + called from within catch_tell() or receive_message(). + + See also: + catch_tell, + receive_message, + message + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/interactive/remove_action ds2.0r27/lib/doc/efun/interactive/remove_action *** ds1.1/lib/doc/efun/interactive/remove_action Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/remove_action Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,18 ---- + remove_action - unbind a command verb from a local function + + int remove_action( string fun, string cmd ); + + This efun is only available if NO_ADD_ACTION is not compiled in. + + remove_action() unbinds a verb cmd from an object function fun. Basically, + remove_action() is the complement to add_action(). When a + verb is no longer required, it can be unbound with remove_action(). + + remove_action() returns 1 on success and 0 on failure. + + See also: + add_action, + query_verb, + init + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/interactive/remove_interactive ds2.0r27/lib/doc/efun/interactive/remove_interactive *** ds1.1/lib/doc/efun/interactive/remove_interactive Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/remove_interactive Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + remove_interactive - disconnect an interactive object. + + int remove_interactive(object); + + If the argument object is interactive, and not destructed, cause it to + be disconnected. (i.e lose it's interactive status). Returns 1 if + the operation succeeded, or 0 if it didn't ( object destructed, or not + interactive) + + This function requires PACKAGE_CONTRIB to be defined in the options file. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/interactive/resolve ds2.0r27/lib/doc/efun/interactive/resolve *** ds1.1/lib/doc/efun/interactive/resolve Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/resolve Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,22 ---- + resolve - resolve an internet address to domain name + + int resolve( string address, string callback_func ); + + resolve() resolves `address', which should be an internet address in the form + "127.0.0.1" or a domain name, into its domain name, or internet address. + When the resolve is complete, `callback_func' will be called in the + current object. The form of the callback is: + + void callback(string address, string resolved, int key); + + `key' will match up with the number that the call to resolve() returned. + `address' will be the domain name of the host, and `resolved' the dotted + decimal ip address. The unknown value will be 0 if the lookup failed. + + See also: + query_host_name, + socket_address, + query_ip_name, + query_ip_number + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/interactive/say ds2.0r27/lib/doc/efun/interactive/say *** ds1.1/lib/doc/efun/interactive/say Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/say Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,22 ---- + say - send a message to all users in the same environment + + varargs void say( string str, object | object array ); + + Sends a message to the environment of the originator, all items in the + same environment, and all items inside of the originator. The originator + is this_player(), unless this_player() == 0, in which case, the originator + is this_object(). + + The second argument is optional. If second argument `obj' is specified, + the message is sent to all except `obj'. If `obj' is not an object, but + an array of objects, all those objects are excluded from receiving the + message. + + See also: + message, + write, + shout, + tell_object, + tell_room + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/interactive/set_this_player ds2.0r27/lib/doc/efun/interactive/set_this_player *** ds1.1/lib/doc/efun/interactive/set_this_player Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/set_this_player Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + set_this_player - change the value of the current command giver. + + void set_this_player(object); + + This function changes the value of what this_player() returns during the + current execution. If the argument is an object, this_player() will return + the argument object. If it is an int, this_player() will return 0. + + This function requires the NO_ADD_ACTION option be defined in the + options file. + + See also: + this_player + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/interactive/shout ds2.0r27/lib/doc/efun/interactive/shout *** ds1.1/lib/doc/efun/interactive/shout Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/shout Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + shout - sends a message to all living objects + + void shout( string str ); + + Sends the string `str' to all living objects except this_player(). + + See also: + message, + write, + tell_object, + tell_room, + say + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/interactive/snoop ds2.0r27/lib/doc/efun/interactive/snoop *** ds1.1/lib/doc/efun/interactive/snoop Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/snoop Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,20 ---- + snoop - snoop an interactive user + + varargs object snoop( object snooper, object snoopee ); + + When both arguments are used, begins snooping of `snoopee' by + `snooper'. If the second argument is omitted, turns off all snooping + by `snoopee'. Security for snoop() is normally controlled by a + simul_efun. snoop() returns `snoopee' if successful in the + two-argument case, and `snooper' if it was successful in the + single-argument case. A return of 0 indicates failure. + The 'snoopee' must be an interactive object; the snooper can be any + object. However, snooping with a non-interactive object is useless + unless the RECEIVE_SNOOP option is enabled, and the object defines + a RECEIVE_SNOOP function. + + See also: + query_snoop, + query_snooping + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/interactive/this_interactive ds2.0r27/lib/doc/efun/interactive/this_interactive *** ds1.1/lib/doc/efun/interactive/this_interactive Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/this_interactive Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + this_interactive - return the object representing the current player + + object this_interactive(); + + Return the object representing the player that caused the calling function + to be called. This returns what this_player() was originally even if + it changed later due to enable_commands() or command() + + See also: + this_player + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/interactive/this_player ds2.0r27/lib/doc/efun/interactive/this_player *** ds1.1/lib/doc/efun/interactive/this_player Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/this_player Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,8 ---- + this_player - return the object representing the current player + + object this_player( int flag ); + + this_player() is exactly the same as this_user(). + + See also: + this_user diff -c -r --new-file ds1.1/lib/doc/efun/interactive/this_user ds2.0r27/lib/doc/efun/interactive/this_user *** ds1.1/lib/doc/efun/interactive/this_user Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/this_user Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + this_user - return the object representing the current interactive + + Return the object representing the user that caused the calling function + to be called. Note that this_user() may return a different value than + this_object() even when called from within a user object. If this_user + is called as this_user(1) then the returned value will be the interactive + that caused the calling function to be called. this_user(1) may return + a different value than this_user() in certain cases (such as when command() + is used by an admin to force a user to perform some command). + + See also: + this_object diff -c -r --new-file ds1.1/lib/doc/efun/interactive/userp ds2.0r27/lib/doc/efun/interactive/userp *** ds1.1/lib/doc/efun/interactive/userp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/userp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + userp - determine if a given object was once interactive + + int userp( object ); + + Returns 1 if the arg was once interactive. + + See also: + interactive, + users, + living + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/interactive/users ds2.0r27/lib/doc/efun/interactive/users *** ds1.1/lib/doc/efun/interactive/users Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/users Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + users - return an array of objects containing all interactive players + + object array users(); + + Return an array of objects, containing all interactive players. + + See also: + livings, + children, + objects + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/interactive/wizardp ds2.0r27/lib/doc/efun/interactive/wizardp *** ds1.1/lib/doc/efun/interactive/wizardp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/wizardp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + wizardp - determines if a given object had enable_wizard() performed in it + + int wizardp( object ); + + This efun is only available if NO_WIZARDS is not compiled in. + + Returns 1 if the arg had enable_wizard() performed on it. + + See also: + disable_wizard, + enable_wizard + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/interactive/write ds2.0r27/lib/doc/efun/interactive/write *** ds1.1/lib/doc/efun/interactive/write Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/interactive/write Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + write() - send a message to current player + + void write( mixed str ); + + Write a message `str' to current player. `str' can also be a number, which + will be translated to a string. + + See also: + message, + tell_object, + tell_room, + shout, + say + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/internals/cache_stats ds2.0r27/lib/doc/efun/internals/cache_stats *** ds1.1/lib/doc/efun/internals/cache_stats Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/internals/cache_stats Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + cache_stats - report various driver and mudlib statistics + + string cache_stats(); + + This efun is only available if CACHE_STATS is defined in options.h at + driver build time. This efun returns a string containing a summary + of the statstics on the call_other() cache hit rate. + + See also: + opcprof, + mud_status + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/internals/debug_info ds2.0r27/lib/doc/efun/internals/debug_info *** ds1.1/lib/doc/efun/internals/debug_info Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/internals/debug_info Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,93 ---- + debug_info - display debug information + + string debug_info( int operation, ... ); + + string debug_info( 0, object ob ); + + string debug_info( 1, object ob ); + + string debug_info( 2, object ob ); + + This efun is only available if PACKAGE_DEVELOP is compiled into the driver. + + debug_info() is a general-purpose facility which may be used to debug the + MudOS driver. The debugging information requested is determined by the + first argument. Successive arguments are determine by the operation selected. + + The existing operations (0 , 1 and 2) require a second object type argument, + and may be used to display the various fields of the MudOS object structure. + + The following LPC code was used to generate the sample output: + + <pre> + + create() { + write(debug_info(0, this_object())); + } + </pre> + + gives: + + <pre> + O_HEART_BEAT : FALSE + O_IS_WIZARD : FALSE + O_ENABLE_COMMANDS : FALSE + O_CLONE : FALSE + O_DESTRUCTED : FALSE + O_SWAPPED : FALSE + O_ONCE_INTERACTIVE: FALSE + O_RESET_STATE : FALSE + O_WILL_CLEAN_UP : FALSE + O_WILL_RESET: TRUE + total light : 0 + next_reset : 720300560 + time_of_ref : 720299416 + ref : 2 + swap_num : -1 + name : 'u/c/cynosure/di0' + next_all : OBJ(bin/dev/_update) + This object is the head of the object list. + </pre> + + <hr> + + <pre> + + create() { + write(debug_info(1, this_object())); + } + </pre> + + gives: + + <pre> + program ref's 1 + Name u/c/cynosure/di1.c + program size 10 + num func's 1 (16) + num strings 0 + num vars 0 (0) + num inherits 0 (0) + total size 104 + </pre> + + <hr> + + <pre> + + create() { + write(debug_info(2, this_object())); + } + </pre> + + gives: + + <pre> + x: "foo" + </pre> + + See also: + dump_file_descriptors, + dump_socket_status + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/internals/debugmalloc ds2.0r27/lib/doc/efun/internals/debugmalloc *** ds1.1/lib/doc/efun/internals/debugmalloc Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/internals/debugmalloc Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + debugmalloc - dumps information on malloc'd memory to a file + + void debugmalloc(string filename, int mask); + + This efun is only available when PACKAGE_DEVELOP, DEBUGMALLOC and DEBUGMALLOC_EXTENSIONS are + both defined in options.h at driver build time. The debugmalloc() efun + will dump information on those chunks of memory allocated by DMALLOC() and + related macros if the bitwise and (&) with the tag supplied by the macro + (i.e. (mask & tag)) is non-zero. Read md.c and config.h in the + driver source for more information. + + See also: + set_malloc_mask + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/internals/dump_file_descriptors ds2.0r27/lib/doc/efun/internals/dump_file_descriptors *** ds1.1/lib/doc/efun/internals/dump_file_descriptors Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/internals/dump_file_descriptors Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,32 ---- + dump_file_descriptors - dump the MudOS process file descriptor table + + string dump_file_descriptors(); + + This function is provided to assist in debugging the MudOS driver and + helps overcome deficiencies in some UN*X implementations which do not + provide equivalent or superior debugging facilities as part of the + operating system itself. The interpretation of the output is very + system-dependent. Each file descriptor is checked to determine whether + it refers to an open file. If so, information is displayed from the + "stat structure" returned by the fstat() system call. + + The following output was produced on Lambda Realms running on a Sequent + DYNIX/ptx system: + + <pre> + Fd Device Number Inode Mode Uid Gid Size + -- ------------- ----- ------ ----- ----- ---------- + 0 3 2 10319 c 666 0 3 0 + 1 79 7 164598 f 644 2862 1 789522 + 2 79 7 164598 f 644 2862 1 789522 + 3 40 33b 6925 c 0 2862 1 0 + 4 40 2a4 6943 c 0 2862 1 0 + 5 79 7 164599 f 600 2862 1 44784 + 6 40 2e2 145996 c 0 2862 1 0 + 7 79 7 164601 f 644 2862 1 506 + </pre> + + See also: + dump_socket_status + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/internals/dump_prog ds2.0r27/lib/doc/efun/internals/dump_prog *** ds1.1/lib/doc/efun/internals/dump_prog Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/internals/dump_prog Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,21 ---- + dump_prog - dump/disassemble an LPC object + + void dump_prog( object ob, int flags, string file ); + + This efun is only available when PACKAGE_DEVELOP is compiled into the driver. + + dump_prog() dumps information about the program of `obj' to a file, + `file', or "/PROG_DUMP" if `file' is not given. If the current object + does not have write access to the file, it fails. + + Flags can be a combination of the following values: + <DL> + * 1 - include a disassembly of the i-code + * 2 - include line number information + </DL> + + See also: + debug_info, + dumpallobj + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/internals/dump_socket_status ds2.0r27/lib/doc/efun/internals/dump_socket_status *** ds1.1/lib/doc/efun/internals/dump_socket_status Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/internals/dump_socket_status Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,54 ---- + dump_socket_status - display the status of each LPC socket + + string dump_socket_status(); + + This efun is only available when PACKAGE_SOCKETS is compiled into the driver. + + dump_socket_status() is a diagnostic facility which displays the current + status of all LPC sockets configured into the MudOS driver. It is useful + for debugging LPC sockets applications. Each row in the output corresponds + to a single LPC socket. The first row corresponds to LPC socket descriptor 0, + the second row, 1, etc. The total number of sockets is configured when the + driver is built. + + The first column "Fd" is the operating system file descriptor associated + with the LPC socket. "State" is the current operational state of the LPC + socket. "Mode" is the socket mode, which is passed as an argument to + socket_create(). The local and remote addresses are the Internet address + and port numbers in Internet dot notations. '*' indicates an address or + which is 0. N.B. LPC sockets that are in the CLOSED state are not + currently in use; therefore the data displayed for that socket may be + idiosyncratic. + + The following output was generated on Portals, where the only socket + application running at the time was MWHOD. It indicates that two + sockets are current in use, one is listening for connection requests + on a STREAM mode socket. The other is waiting for incoming data on + a DATAGRAM mode socket. + + <pre> + Fd State Mode Local Address Remote Address + -- --------- -------- ----------------- ------------------ + 13 LISTEN STREAM *.6889 *.* + 14 BOUND DATAGRAM *.6888 *.* + -1 CLOSED MUD *.* *.* + -1 CLOSED MUD *.* *.* + -1 CLOSED MUD *.* *.* + -1 CLOSED MUD *.* *.* + -1 CLOSED MUD *.* *.* + -1 CLOSED MUD *.* *.* + -1 CLOSED MUD *.* *.* + -1 CLOSED MUD *.* *.* + -1 CLOSED MUD *.* *.* + -1 CLOSED MUD *.* *.* + -1 CLOSED MUD *.* *.* + -1 CLOSED MUD *.* *.* + -1 CLOSED MUD *.* *.* + -1 CLOSED MUD *.* *.* + </pre> + + See also: + debug_info, + dump_file_descriptors + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/internals/dumpallobj ds2.0r27/lib/doc/efun/internals/dumpallobj *** ds1.1/lib/doc/efun/internals/dumpallobj Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/internals/dumpallobj Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + dumpallobj - report various statistics on all objects that have been loaded + + void dumpallobj(); + + void dumpallobj( string ); + + This function dumps a list of statistics on all objects that have been loaded. + If no argument is specified, then the information will be dumped to a file + named /OBJ_DUMP. If an argument is specified, then that name is used as + the filename for the dump. + + See also: + mud_status, + debug_info + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/internals/get_config ds2.0r27/lib/doc/efun/internals/get_config *** ds1.1/lib/doc/efun/internals/get_config Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/internals/get_config Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,9 ---- + get_config - query various driver config settings + + mixed get_config( int ); + + This efun is used to query the driver's various config + settings. Please refer to the "runtime_config.h" + include file for a list of currently recognized options. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/internals/index ds2.0r27/lib/doc/efun/internals/index *** ds1.1/lib/doc/efun/internals/index Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/internals/index Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,31 ---- + Internal efuns + + Efuns which give internal information about the driver process, or assist + with debugging the driver itself. + + <DL> + * cache_stats + * debug_info + * debugmalloc + * dump_file_descriptors + * dump_prog + * dump_socket_status + * dumpallobj + * get_config + * malloc_status + * memory_info + * mud_status + * opcprof + * query_load_average + * refs + * rusage + * set_debug_level + * set_malloc_mask + * swap + * time_expression + * trace + * traceprefix + </DL> + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/internals/malloc_status ds2.0r27/lib/doc/efun/internals/malloc_status *** ds1.1/lib/doc/efun/internals/malloc_status Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/internals/malloc_status Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + malloc_status - report various statistics related to memory usage. + + string malloc_status(); + + This function returns memory usage statistics in a string. + This function replaces the hardcoded 'malloc' command in vanilla 3.1.2. + Note that the output produced by malloc_status() depends upon which + memory management package is chosen in options.h when building the driver. + + See also: + mud_status, + dumpallobj, + memory_info + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/internals/memory_info ds2.0r27/lib/doc/efun/internals/memory_info *** ds1.1/lib/doc/efun/internals/memory_info Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/internals/memory_info Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,18 ---- + memory_info - obtain info on object/overall memory usage + + varargs int memory_info( object ob ); + + If optional argument `ob' is given, memory_info() returns the approximate + amount of memory that `ob' is using. If no argument is given, memory_info() + returns the approximate amount of memory that the entire mud is using. Note + that the amount of memory the mud is using does not necessarily correspond + to the amount of memory actually allocated by the mud from the system, and + that total memory used by all the objects is not additive due to sharing of + certain structures. + + See also: + debug_info, + malloc_status, + mud_status + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/internals/mud_status ds2.0r27/lib/doc/efun/internals/mud_status *** ds1.1/lib/doc/efun/internals/mud_status Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/internals/mud_status Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + mud_status - report various driver and mudlib statistics + + string mud_status( int extra ); + + This function returns a string containing driver and mudlib statistics. + If extra is non-zero, then additional information about various internal + tables is included as well. This efun replaces the hardcoded 'status' + and 'status tables' commands in vanilla 3.1.2. + + See also: + debug_info, + dumpallobj, + memory_info, + uptime + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/internals/opcprof ds2.0r27/lib/doc/efun/internals/opcprof *** ds1.1/lib/doc/efun/internals/opcprof Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/internals/opcprof Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + opcprof - reports statistics on calling frequencies of various efuns + + void opcprof(); + + void opcprof( string ); + + This function dumps a list of statistics on each efunction and eoperator. + If no argument is specified, then the information will be dumped to files + named /OPCPROF.efun and /OPCPROF.eoper. If an argument is specified, then + that name is used as the filename for the dump. + + See also: + function_profile + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/internals/query_load_average ds2.0r27/lib/doc/efun/internals/query_load_average *** ds1.1/lib/doc/efun/internals/query_load_average Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/internals/query_load_average Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + query_load_average - forces an error to occur in an object + + string query_load_average(); + + This function returns a string which reports two things: 1) user commands + per second, and 2) compiled lines per second. + + See also: + rusage + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/internals/refs ds2.0r27/lib/doc/efun/internals/refs *** ds1.1/lib/doc/efun/internals/refs Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/internals/refs Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + refs - return the number of references to a data structure + + int refs( mixed data ); + + This efun is only available if PACKAGE_DEVELOP is compiled in. + + The number of references to `data' will be returned by refs(). This is + useful for deciding whether or not to make a copy of a data structure + before returning it. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/internals/rusage ds2.0r27/lib/doc/efun/internals/rusage *** ds1.1/lib/doc/efun/internals/rusage Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/internals/rusage Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,35 ---- + rusage - reports information gathered by the getrusage() system call + + mapping rusage(); + + This efun collects information gathered via the getrusage() system + call. Read the getrusage() man page for more information on what information + will be collected. Some systems do not have the getrusage() system call + but do have the times() system call. On those systems, only "utime" + and "stime" will be available. Times are reported in milliseconds. + + Here is an example usage of rusage(): + + <pre> + void + create() + { + mapping info; + + info = rusage(); + write("user time = " + info["utime"] + "ms\\n"); + write("system time = " + info["stime"] + "ms\\n"); + } + </pre> + + The available fields are: + utime, stime, maxrss, ixrss, idrss, isrss, minflt, majflt, nswap, inblock, + oublock, msgsnd, msgrcv, nsignals, nvcsw, nivcsw. + + See also: + time_expression, + function_profile, + time, + uptime + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/internals/set_debug_level ds2.0r27/lib/doc/efun/internals/set_debug_level *** ds1.1/lib/doc/efun/internals/set_debug_level Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/internals/set_debug_level Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + set_debug_level - sets the debug level used by the driver's debug() macro + + void set_debug_level( int level ); + + This efun is only available when the driver is compiled with -DDEBUG_MACRO. + The purpose of this efun is to allow the amount and type of debugging + information produced to be controlled from within the mud (while the + driver is running). + + For more information, read the file debug.h which is included with the + driver source. + + See also: + set_malloc_mask + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/internals/set_malloc_mask ds2.0r27/lib/doc/efun/internals/set_malloc_mask *** ds1.1/lib/doc/efun/internals/set_malloc_mask Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/internals/set_malloc_mask Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + set_malloc_mask - sets the mask controlling display of malloc debug info + + void set_malloc_mask( int mask ); + + This efun is only available when PACKAGE_DEVELOP, DEBUGMALLOC and DEBUGMALLOC_EXTENSIONS are + both defined in options.h at driver build time. The mask controls what + memory-related debugging information is displayed as the driver allocates + and deallocates memory. Read md.c in the driver source for more information. + + See also: + debugmalloc + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/internals/swap ds2.0r27/lib/doc/efun/internals/swap *** ds1.1/lib/doc/efun/internals/swap Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/internals/swap Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + swap - swap out a file explicitly + + void swap( object ); + + This efun is only available if the driver is compiled with -DDEBUG. + + This efun should be reserved for debugging only. It + allows an object to be explicitly swapped out. If + enabled, it is strongly recommended that a simul_efun + override (for this efun) be used to prevent abuse. + + Note: objects which have been destructed, already + swapped out, contain a heart beat, cloned, inherited, + or interactive, cannot be swapped out. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/internals/time_expression ds2.0r27/lib/doc/efun/internals/time_expression *** ds1.1/lib/doc/efun/internals/time_expression Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/internals/time_expression Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,18 ---- + time_expression - return the amount of real time that an expression took + + int time_expression( mixed expr ); + + int time_expression { ... } + + Evaluate <expr> or the specified block of code. The amount of real time + that passes during the evaluation of <expr>, in microseconds, is returned. + The precision of the value is + not necessarily 1 microsecond; in fact, it probably is much less precise. + + See also: + rusage, + function_profile, + time + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/internals/trace ds2.0r27/lib/doc/efun/internals/trace *** ds1.1/lib/doc/efun/internals/trace Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/internals/trace Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,25 ---- + trace - sets trace flags and returns the old ones + + int trace( int traceflags ); + + This efun is only available if TRACE and PACKAGE_DEVELOP are compiled in. + + Sets the trace flags and returns the old trace flags. + When tracing is on a lot of information is printed during execution. + + The trace bits are: + <DL> + * 1 - Trace all function calls to lfuns. + * 2 - Trace all calls to "call_other". + * 4 - Trace all function returns. + * 8 - Print arguments at function calls and return values. + * 16 - Print all executed stack machine instructions (produces a lot of output!). + * 32 - Enable trace in heart beat functions. + * 64 - Trace calls to apply. + * 128 - Show object name in tracing. + </DL> + + See also: + traceprefix + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/internals/traceprefix ds2.0r27/lib/doc/efun/internals/traceprefix *** ds1.1/lib/doc/efun/internals/traceprefix Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/internals/traceprefix Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + traceprefix - sets the prefix determining which objects to trace + + string traceprefix( string prefix ); + + This efun is only available if TRACE and PACKAGE_DEVELOP are compiled in. + + If the the traceprefix is set (i.e. not 0) tracing will only occur in objects + having a name with the set prefix. + + The old value is returned. + + See also: + trace + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/mappings/allocate_mapping ds2.0r27/lib/doc/efun/mappings/allocate_mapping *** ds1.1/lib/doc/efun/mappings/allocate_mapping Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mappings/allocate_mapping Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,27 ---- + allocate_mapping - pre-allocate space for a mapping + + mapping allocate_mapping( int size ); + + Returns a mapping with space for 'size' elements preallocated. + + For example: + + <pre> + mapping x; + int y = 200; + + x = allocate_mapping(y); + </pre> + + where y is the initial size of the mapping. Using allocate_mapping is + the preferred way to initalize the mapping if you have some idea of how + many elements the map will contain (200 in this case). The reason is that + allocating storage all at once is slightly more efficient. Thus if + you are using mappings to store a soul with 200 entries, the above + initialization would be quite appropriate. Note, that the + above initialization does not restrict you to 200 entries. + + See also: + map_delete + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/mappings/filter_mapping ds2.0r27/lib/doc/efun/mappings/filter_mapping *** ds1.1/lib/doc/efun/mappings/filter_mapping Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mappings/filter_mapping Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + filter_mapping - return a selective sub-mapping + + mapping filter_mapping(mapping map, string fun, object ob, mixed extra, ...); + + mapping filter_array(mapping map, function f, mixed extra, ...); + + filter_mapping() is really the same as the filter() efun. + + See also: + filter + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/mappings/index ds2.0r27/lib/doc/efun/mappings/index *** ds1.1/lib/doc/efun/mappings/index Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mappings/index Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + Mapping Efuns + + The following efuns operate on mappings: + + <DL> + * allocate_mapping + * keys + * map_delete + * map_mapping + * mapp + * match_path + * unique_mapping + * values + </DL> + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/mappings/keys ds2.0r27/lib/doc/efun/mappings/keys *** ds1.1/lib/doc/efun/mappings/keys Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mappings/keys Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,27 ---- + keys - return an array of the keys from the (key, value) pairs in a mapping + + array keys( mapping m ); + + keys() returns an array of keys (indices) corresponding to the keys in + the (key, value) pairs stored in the mapping m. + + For example, if: + + <pre> + mapping m; + m = (["hp" : 35, "sp" : 42, "mass" : 100]); + </pre> + + then + + <pre> + keys(m) == ({"hp", "sp", "mass"}) + </pre> + + Note: the keys will not be returned in any apparent order. However, they + will be returned in the same order as the corresponding values (returned + by the values() efun). + + See also: + values + diff -c -r --new-file ds1.1/lib/doc/efun/mappings/m_delete ds2.0r27/lib/doc/efun/mappings/m_delete *** ds1.1/lib/doc/efun/mappings/m_delete Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mappings/m_delete Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,28 ---- + m_delete - remove a key from a mapping + + mapping m_delete(mapping m, mixed element); + + This efun is only available if COMPAT_32 is defined. + + It behaves exactly like map_delete(), except that it returns its first + argument. + + Note: the 3.2 version actually returns a copy of the mapping, + so for strict compatibility the following simul is suggested: + + <pre> + mapping m_delete(mapping m, mixed element) + { + mapping ret = copy(m); + map_delete(ret, element); + return ret; + } + </pre> + + However, this version is significantly faster as it avoids the copy. + + See also: + map_delete + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/mappings/m_indices ds2.0r27/lib/doc/efun/mappings/m_indices *** ds1.1/lib/doc/efun/mappings/m_indices Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mappings/m_indices Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + m_indices - return the keys of a mapping + + array m_indices(mapping); + + This efun is only available if COMPAT_32 is defined. It behaves exactly + the same as keys(). + + See also: + keys + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/mappings/m_values ds2.0r27/lib/doc/efun/mappings/m_values *** ds1.1/lib/doc/efun/mappings/m_values Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mappings/m_values Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + m_values - return the values of a mapping + + array m_values(mapping); + + This efun is only available if COMPAT_32 is defined. It behaves exactly + the same as values(). + + See also: + values + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/mappings/map_delete ds2.0r27/lib/doc/efun/mappings/map_delete *** ds1.1/lib/doc/efun/mappings/map_delete Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mappings/map_delete Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,34 ---- + map_delete - remove a (key, value) pair from a mapping based on the key + + void map_delete( mapping m, mixed element ); + + map_delete removes the (key, value) from the mapping m that has key equal + to element. + + For example, given: + + <pre> + mapping names; + + names = ([]); + names["truilkan"] = "john"; + names["wayfarer"] = "erik"; + names["jacques"] = "dwayne"; + </pre> + + Then: + <pre> + map_delete(names,"truilkan"); + </pre> + + causes the mapping 'names' to be equal to: + <pre> + (["wayfarer" : "erik", "jacques" : "dwayne"]) + </pre> + keys(names) will not contain "truilkan" after map_delete(names,"truilkan") + is called [unless ("truilkan", *) is subsequently added back to the mapping]. + + See also: + allocate_mapping + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/mappings/map_mapping ds2.0r27/lib/doc/efun/mappings/map_mapping *** ds1.1/lib/doc/efun/mappings/map_mapping Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mappings/map_mapping Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,21 ---- + map_mapping - modify an mapping of elements via application of a function + + mapping map_mapping( mapping map, string fun, object ob, ... ); + + mapping map_mapping( mapping map, function f, ... ); + + Returns an mapping with the same keys as map whose items have been + mapped throught 'ob->fun()' or 'f'. The function is called for each + (key, value) pair in 'map' and the returned mapping has the return value + of the function as its value for each key. + The extra arguments are passed as parameters to the function + after the key and the value. + + See also: + filter_array, + filter, + sort_array, + map_array, + map + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/mappings/match_path ds2.0r27/lib/doc/efun/mappings/match_path *** ds1.1/lib/doc/efun/mappings/match_path Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mappings/match_path Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + match_path - search a mapping for a path + + mixed match_path( mapping m, string str ); + + match_path() searches a mapping for a path. Each key is assumed to be a + string. The value is completely arbitrary. The efun finds the largest + matching path in the mapping. Keys ended in '/' are assumed to match paths + with character that follow the '/', i.e. / is a wildcard for anything below + this directory. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/mappings/unique_mapping ds2.0r27/lib/doc/efun/mappings/unique_mapping *** ds1.1/lib/doc/efun/mappings/unique_mapping Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mappings/unique_mapping Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + unique_mapping - partition an array into groups + + mapping unique_mapping(array arr, string fun, object ob, ...); + + mapping unique_mapping(array arr, function f, ...); + + unique_mapping() evaluates the function 'f' with each element of the + array 'arr', and constructs a mapping with the return values as keys, + and subarrays of elements that returned value value as values. + + See also: + unique_array + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/mappings/values ds2.0r27/lib/doc/efun/mappings/values *** ds1.1/lib/doc/efun/mappings/values Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mappings/values Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,26 ---- + values - return an array of the values from the (key, value) pairs in a mapping + + array values( mapping m ); + + values() returns an array of values corresponding to the value elements + in the (key, value) pairs stored in the mapping m. + + For example, if: + + <pre> + mapping m; + + m = (["hp" : 35, "sp" : 42, "mass" : 100]); + </pre> + + then + + <pre> + values(m) == ({35, 42, 100}) + </pre> + + Note: the values will be returned in the same order as the corresponding + keys. + + See also: + keys diff -c -r --new-file ds1.1/lib/doc/efun/mixed/arrayp ds2.0r27/lib/doc/efun/mixed/arrayp *** ds1.1/lib/doc/efun/mixed/arrayp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mixed/arrayp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,8 ---- + arrayp - determine whether or not a given variable is an array + + int arrayp( mixed arg ); + + Return 1 if `arg' is an array, zero otherwise. + + See also: + typeof diff -c -r --new-file ds1.1/lib/doc/efun/mixed/bufferp ds2.0r27/lib/doc/efun/mixed/bufferp *** ds1.1/lib/doc/efun/mixed/bufferp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mixed/bufferp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,7 ---- + bufferp - determine whether or not a given variable is a buffer + + int bufferp( mixed arg ); + + Return 1 if `arg' is a buffer value and zero otherwise. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/mixed/classp ds2.0r27/lib/doc/efun/mixed/classp *** ds1.1/lib/doc/efun/mixed/classp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mixed/classp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,7 ---- + classp - determine whether or not a given variable is a class + + int classp(mixed); + + Return 1 if the argument is a class. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/mixed/floatp ds2.0r27/lib/doc/efun/mixed/floatp *** ds1.1/lib/doc/efun/mixed/floatp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mixed/floatp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,7 ---- + floatp - determine whether or not a given variable is a float + + int floatp( mixed arg ); + + Return 1 if `arg' is a float number and zero (0) otherwise. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/mixed/functionp ds2.0r27/lib/doc/efun/mixed/functionp *** ds1.1/lib/doc/efun/mixed/functionp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mixed/functionp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,49 ---- + functionp - determine whether or not a given variable is a function + pointer + + int functionp( mixed arg ); + + Return nonzero if `arg' is a function pointer and zero (0) otherwise. + Function pointers are variables of type 'function' as indicated in the + documentation for the type 'function', for example: + + f = (: call_other, obj, func :); + + The return value indicates the type of function pointer using the + values given in the driver include file "include/function.h". + + <DL> + * FP_LOCAL - lfun pointer + * FP_EFUN - efun pointer + * FP_SIMUL - simul pointer + * FP_FUNCTIONAL - functional + </DL> + + These values are bit values; the following flags may be added as well: + + <DL> + * FP_HAS_ARGUMENTS - arguments were included in the definition + * FP_OWNER_DESTED - the owner of this function pointer has been destructed + * FP_NOT_BINDABLE - it isn't possible to rebind this function pointer + </DL> + + To test if a function variable is an efun pointer: + + if (functionp(f) & FP_EFUN) ... + + to test if it is an efun or simul_efun: + + if (functionp(f) & (FP_EFUN | FP_SIMUL)) ... + + Try (very hard) to call the function: + + <pre> + if (functionp(f) & FP_OWNER_DESTED) { + if (functionp(f) & FP_NOT_BINDABLE) + error("Function could not be rebound.\n"); + f = bind(f, this_object()); + } + evaluate(f); + </pre> + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/mixed/intp ds2.0r27/lib/doc/efun/mixed/intp *** ds1.1/lib/doc/efun/mixed/intp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mixed/intp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,7 ---- + intp - determine whether or not a given variable is an integer + + int intp( mixed arg ); + + Return 1 if 'arg' is an integer number and zero (0) otherwise. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/mixed/mapp ds2.0r27/lib/doc/efun/mixed/mapp *** ds1.1/lib/doc/efun/mixed/mapp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mixed/mapp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,7 ---- + mapp - determine whether or not a given variable is a mapping + + int mapp( mixed arg ); + + Return 1 if `arg' is a mapping. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/mixed/nullp ds2.0r27/lib/doc/efun/mixed/nullp *** ds1.1/lib/doc/efun/mixed/nullp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mixed/nullp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,7 ---- + nullp - determine whether or not a given variable is null + + int nullp( mixed arg ); + + Exactly the same as undefinedp(). Exists for compatibility. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/mixed/objectp ds2.0r27/lib/doc/efun/mixed/objectp *** ds1.1/lib/doc/efun/mixed/objectp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mixed/objectp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,7 ---- + objectp - determine whether or not a given variable is an object + + int objectp( mixed arg ); + + Return 1 if `arg' is an object. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/mixed/pointerp ds2.0r27/lib/doc/efun/mixed/pointerp *** ds1.1/lib/doc/efun/mixed/pointerp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mixed/pointerp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,8 ---- + pointerp - determine whether or not a given variable is an array + + int pointerp( mixed arg ); + + pointerp() is provided for compatibility; it is the same as the arrayp() efun. + + See also: + arrayp diff -c -r --new-file ds1.1/lib/doc/efun/mixed/stringp ds2.0r27/lib/doc/efun/mixed/stringp *** ds1.1/lib/doc/efun/mixed/stringp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mixed/stringp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,7 ---- + stringp - determine whether or not a given variable is a string + + int stringp( mixed arg ); + + Returns 1 if 'arg' is a string, and zero if not. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/mixed/undefinedp ds2.0r27/lib/doc/efun/mixed/undefinedp *** ds1.1/lib/doc/efun/mixed/undefinedp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mixed/undefinedp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,18 ---- + undefinedp - determine whether or not a given value is undefined. + + int undefinedp( mixed arg ); + + Return 1 if `arg' is undefined. 'arg' will be undefined in the following + cases: + + <DL> + * it is a variable set equal to the return value of a call_other to a + non-existent method (e.g. arg = call_other(obj, "???")). + * it is a variable set equal to the return value of an access of an + element in a mapping that doesn't exist (e.g. arg = map[not_there]). + * it has not yet been initialized. + * it points to a destructed object. + * it is a function (formal) parameter that corresponds to a missing actual argument. + </DL> + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/mudlib/author_stats ds2.0r27/lib/doc/efun/mudlib/author_stats *** ds1.1/lib/doc/efun/mudlib/author_stats Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mudlib/author_stats Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,43 ---- + author_stats - returns statistics gathered on authors + + mapping author_stats( string domain); + + This efun is only avaiable if PACKAGE_MUDLIB_STATS is compiled in. + + Both domain_stats() and author_stats() return information stored in a + mapping. If no argument is specified, then information is returned on + all domains (or on all authors) with one map entry per domain or author. + If an argument is specified, then a map is returned that corresponds to + that domain or author with keys: moves, cost, errors, heart_beats, + array_size, and objects. Each of these map to integer values. + Moves is the number of objects that have moved into objects in the + given domain. Cost is the number of evaluations (eval_cost) accumulated + by objects with the given domain (or author). Errors is the number of errors + incurred by objects with the given domain. Heart_beats is the number of + heartbeat calls made on objects having the given domain. + Array_size is the size (in bytes) of the arrays allocated by the domain. + Objects is the number of objects created by the given domain. When called + with no arguments, the returned mapping has a form like this: + + <pre> + ([ domain0 : info0, domain1 : info1, ... ]) + </pre> + + while info0 has the form: + + <pre> + ([ "moves" : moves, "cost" : cost, "errors" : errors, + "heart_beats" : heart_beats, "worth" : worth, + "array_size" : array_size, "objects" : objects ]) + </pre> + + When called with an argument, the returned mapping will have the form of + info0. + + See also: + domain_file, + author_file, + set_author + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/mudlib/domain_stats ds2.0r27/lib/doc/efun/mudlib/domain_stats *** ds1.1/lib/doc/efun/mudlib/domain_stats Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mudlib/domain_stats Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,42 ---- + domain_stats - returns statistics gathered on domains + + mapping domain_stats( string domain ); + + This efun is only available if PACKAGE_MUDLIB_STATS is compiled into the driver. + + Both domain_stats() and author_stats() return information stored in a + mapping. If no argument is specified, then information is returned on + all domains (or on all authors) with one map entry per domain or author. + If an argument is specified, then a map is returned that corresponds to + that domain or author with keys: moves, cost, errors, heart_beats, + array_size, and objects. Each of these map to integer values. + Moves is the number of objects that have moved into objects in the + given domain. Cost is the number of evaluations (eval_cost) accumulated + by objects with the given domain (or author). Errors is the number of errors + incurred by objects with the given domain. Heart_beats is the number of + heartbeat calls made on objects having the given domain. + Array_size is the size (in bytes) of the arrays allocated by the domain. + Objects is the number of objects created by the given domain. When called + with no arguments, the returned mapping has a form like this: + + <pre> + ([ domain0 : info0, domain1 : info1, ... ]) + </pre> + + while info0 has the form: + + <pre> + ([ "moves" : moves, "cost" : cost, "errors" : errors, + "heart_beats" : heart_beats, "worth" : worth, + "array_size" : array_size, "objects" : objects ]) + </pre> + + When called with an argument, the returned mapping will have the form of + info0. + + See also: + domain_file, + author_file, + set_author + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/mudlib/export_uid ds2.0r27/lib/doc/efun/mudlib/export_uid *** ds1.1/lib/doc/efun/mudlib/export_uid Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mudlib/export_uid Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + export_uid - set the uid of another object + + int export_uid( object ob ); + + This efun is only available if PACKAGE_UIDS is compiled in. + + Set the uid of 'ob' to the effective uid of this_object(). It is + only possible when 'ob' has an effective uid of 0. + + See also: + seteuid, + getuid, + geteuid, + valid_seteuid + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/mudlib/find_living ds2.0r27/lib/doc/efun/mudlib/find_living *** ds1.1/lib/doc/efun/mudlib/find_living Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mudlib/find_living Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,21 ---- + find_living - find a living object matching a given id + + object find_living( string str ); + + This efun is only available if NO_ADD_ACTION is not compiled in. + + Find first the object that is marked as living, and answers to the + id 'str'. A living object is an object that has called + enable_commands(). The object must have set a name with + set_living_name(), so its name will be entered into the hash table + used to speed up the search for living objects. + + See also: + living, + livings, + users, + disable_commands, + enable_commands, + set_living_name + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/mudlib/geteuid ds2.0r27/lib/doc/efun/mudlib/geteuid *** ds1.1/lib/doc/efun/mudlib/geteuid Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mudlib/geteuid Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,19 ---- + geteuid - return the effective user id of an object or function + + string geteuid( object|function ); + + This efun is only available if PACKAGE_UIDS is compiled into the driver. + + If given an object argument, geteuid returns the effective user id (euid) + of the object. If given an argument of type 'function', it returns the + euid of the object that created that 'function' variable. If the object, + at the time of the function variable's construction, had no euid, the + object's uid is stored instead. + + See also: + seteuid, + getuid, + export_uid, + valid_seteuid + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/mudlib/getuid ds2.0r27/lib/doc/efun/mudlib/getuid *** ds1.1/lib/doc/efun/mudlib/getuid Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mudlib/getuid Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,17 ---- + getuid - return the user id (uid) of an object + + string getuid( object ob ); + + This efun is only available if PACKAGE_UIDS is compiled into the driver. + + Returns the user id of an object. The uid of an object is determined at + object creation by the creator_file() function. + + See also: + seteuid, + geteuid, + export_uid, + valid_seteuid, + creator_file + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/mudlib/index ds2.0r27/lib/doc/efun/mudlib/index *** ds1.1/lib/doc/efun/mudlib/index Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mudlib/index Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,23 ---- + Mudlib related efuns + + These efuns do things which probably should be done by the mudlib, but + are kept for backwards compatibility. + + <DL> + * author_stats + * domain_stats + * export_uid + * find_living + * geteuid + * getuid + * living + * livings + * query_privs + * set_author + * set_light + * set_living_name + * set_privs + * seteuid + </DL> + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/mudlib/living ds2.0r27/lib/doc/efun/mudlib/living *** ds1.1/lib/doc/efun/mudlib/living Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mudlib/living Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + living - detects whether or not a given object is "living" + + int living( object ob ); + + This efun is only available if NO_ADD_ACTION is not compiled in. + + Return true if `ob' is a living object (that is, if "enable_commands()" has + been called by `ob'). + + See also: + enable_commands + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/mudlib/livings ds2.0r27/lib/doc/efun/mudlib/livings *** ds1.1/lib/doc/efun/mudlib/livings Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mudlib/livings Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + livings - return an array of all living objects + + object array livings(); + + This efun is only available if NO_ADD_ACTION is not compiled in. + + Returns an array of pointers to all living objects (objects that have + had enable_commands() called in them). + + See also: + enable_commands, + find_living, + users + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/mudlib/query_privs ds2.0r27/lib/doc/efun/mudlib/query_privs *** ds1.1/lib/doc/efun/mudlib/query_privs Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mudlib/query_privs Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + query_privs - return the privs string for an object + + string query_privs( object ob ); + + Returns the privs string for an object. The privs string is determined + at compile time via a call to privs_file() in the master object, and changeable + via the set_privs() efun. + + This efun is only available if PRIVS is defined at driver compile time. + + See also: + privs_file, + set_privs + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/mudlib/set_author ds2.0r27/lib/doc/efun/mudlib/set_author *** ds1.1/lib/doc/efun/mudlib/set_author Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mudlib/set_author Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,23 ---- + set_author - set the author associated with an object + + void set_author( string author ); + + Every object has both an author and a domain associated with it for + the purposes of tracking statistics for authors and domains. Domains + may only be set in the master object function domain_file(), however + authors are different. They can be initialized to some default value + by author_file() in the master object, but can also be changed using + the set_author efun. + + set_author changes the author of the object that it is called within. + That author will get credit for all future actions of that object that + affect mudlib statistics. + + See also: + author_file, + domain_file, + author_stats, + set_author, + domain_stats + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/mudlib/set_light ds2.0r27/lib/doc/efun/mudlib/set_light *** ds1.1/lib/doc/efun/mudlib/set_light Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mudlib/set_light Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,17 ---- + set_light - update or query an object's light level + + int set_light( int light_level_adjustment ); + + This efun is only available if NO_LIGHT is not compiled in. + + Passing 'light_level_adjustment' as 0 queries the object's current + light level. A positive number will increase the light level, while + a negative number will decrease the light level. + + Note that the object's current light level includes the light it sees from + other objects. + + This efun is provided mostly for backwards compatibility; it really should + be handled by the mudlib. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/mudlib/set_living_name ds2.0r27/lib/doc/efun/mudlib/set_living_name *** ds1.1/lib/doc/efun/mudlib/set_living_name Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mudlib/set_living_name Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + set_living_name - set a living name for a living object + + void set_living_name( string name ); + + This efun is only available if NO_ADD_ACTION is not compiled in. + + Set a living name on an object that is living. After this has been done, the + object can be found with "find_living()". + + See also: + enable_commands, + find_living, + find_player + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/mudlib/set_privs ds2.0r27/lib/doc/efun/mudlib/set_privs *** ds1.1/lib/doc/efun/mudlib/set_privs Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mudlib/set_privs Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + set_privs - set the privs string for an object + + void set_privs( object ob, string privs ); + + This efun is only available when PRIVS is compiled in. + + Sets the privs string for 'ob' to 'privs'. + + This efun is only available if PRIVS is defined at driver compile time. + + See also: + privs_file, + query_privs + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/mudlib/seteuid ds2.0r27/lib/doc/efun/mudlib/seteuid *** ds1.1/lib/doc/efun/mudlib/seteuid Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/mudlib/seteuid Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,21 ---- + seteuid - set the effective user id (euid) of an object + + int seteuid( string str ); + + This efun is only available if PACKAGE_UIDS is compiled in. + + Set effective uid to 'str'. valid_seteuid() in master.c controls which + values the euid of an object may be set to. + + When this value is 0, then the current object's uid can be changed by + export_uid(), and only then. + + But, when the value is 0, no objects can be loaded or cloned by this object. + + See also: + export_uid, + getuid, + geteuid, + valid_seteuid + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/numbers/index ds2.0r27/lib/doc/efun/numbers/index *** ds1.1/lib/doc/efun/numbers/index Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/numbers/index Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + Efuns relating to ints + + Pretty trivial stuff here + + <DL> + * intp + * nullp + * random + * to_float + </DL> + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/numbers/random ds2.0r27/lib/doc/efun/numbers/random *** ds1.1/lib/doc/efun/numbers/random Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/numbers/random Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,7 ---- + random - return a pseudo-random number + + int random( int n ); + + Return a pseudo-random number from the range [0 .. (n -1)] (inclusive). + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/numbers/to_float ds2.0r27/lib/doc/efun/numbers/to_float *** ds1.1/lib/doc/efun/numbers/to_float Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/numbers/to_float Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + to_float - convert an int to a float + + float to_float( int i ); + + The to_float() call returns the number of type 'float' that is equivalent to + the int 'i'. + + See also: + to_int, + read_buffer, + sprintf, + sscanf + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/objects/all_inventory ds2.0r27/lib/doc/efun/objects/all_inventory *** ds1.1/lib/doc/efun/objects/all_inventory Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/objects/all_inventory Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + all_inventory - return the inventory of an object + + object array all_inventory( object ob ); + + This efun is only available if NO_ENVIRONMENT is not compiled into the driver. + + Returns an array of the objects contained inside of 'ob'. If 'ob' is + omitted, this_object() is used. + + See also: + deep_inventory, + environment + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/objects/children ds2.0r27/lib/doc/efun/objects/children *** ds1.1/lib/doc/efun/objects/children Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/objects/children Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + children - returns an array of objects cloned from a given file + + object array children( string name ); + + This efun returns an array of objects that have been loaded or cloned from + the file named by 'name' (including the object 'name' itself, if loaded). + + See also: + deep_inherit_list, + inherit_list, + objects + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/objects/clone_object ds2.0r27/lib/doc/efun/objects/clone_object *** ds1.1/lib/doc/efun/objects/clone_object Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/objects/clone_object Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,18 ---- + clone_object - load a copy of an object + + object clone_object( string name, ... ); + + object new( string name, ... ); + + Create a new object from the file 'name', and give it a new unique + name (by adding #xxx on to the end of the name). Returns the new object. + The object shares the program of the object 'name', but has its own + set of variables. The second and following arguments are passed to + create() + + See also: + destruct, + move_object, + new + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/objects/clonep ds2.0r27/lib/doc/efun/objects/clonep *** ds1.1/lib/doc/efun/objects/clonep Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/objects/clonep Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,24 ---- + clonep - determine whether or not a given variable points to a cloned object + + int clonep(); + + int clonep(mixed arg); + + Returns true (1) iff the argument is objectp() and the O_CLONE flag is set. + The driver sets the O_CLONE flag for those objects created via new() + (clone_object()). The clonep() efun will not return true when called on + objects that are the blueprint copy (those that are loaded via call_other() + or load_object()). + + Note that if clonep() returns true, then file_name() will return a string + containing a '#'. clonep() defaults to this_object(). + + See also: + objectp, + new, + clone_object, + call_other, + file_name + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/objects/deep_inventory ds2.0r27/lib/doc/efun/objects/deep_inventory *** ds1.1/lib/doc/efun/objects/deep_inventory Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/objects/deep_inventory Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + deep_inventory - return the nested inventory of an object + + object array deep_inventory( object ob ); + + This efun is only available when NO_ENVIRONMENT is not compiled into the + driver. + + Returns an array of the objects contained in the inventory of 'ob' and + also all the objects contained in the inventories of those objects and so on. + + See also: + all_inventory + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/objects/destruct ds2.0r27/lib/doc/efun/objects/destruct *** ds1.1/lib/doc/efun/objects/destruct Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/objects/destruct Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + destruct - remove an object + + void destruct( object ob ); + + Completely destroy and remove object 'ob'. After the call to destruct(). + If 'ob' is this_object(), execution will continue, but it is best to return + a value immediately. All pointers to the object in any variable or structure + will immediately become zero. move_or_destruct() is called in all the + objects inside of the object being destructed. + + See also: + clone_object, + new, + move_or_destruct + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/objects/environment ds2.0r27/lib/doc/efun/objects/environment *** ds1.1/lib/doc/efun/objects/environment Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/objects/environment Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + environment - return the environment of an object + + object environment( object ob ); + + This efun is only available if NO_ENVIRONMENT is not compiled in. + + Return the containing object (environment) of 'ob'. If no argument + is given, 'ob' defaults to this_object(). If the object is not + inside anything, zero is returned. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/objects/file_name ds2.0r27/lib/doc/efun/objects/file_name *** ds1.1/lib/doc/efun/objects/file_name Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/objects/file_name Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + file_name - get the file name of an object + + string file_name( object ob ); + + file_name() returns the name of the file from which 'ob' was loaded. + If the object is a cloned object, then file_name() will not be an + actual file on disk, but will be the name of the file from which the + object was originally cloned, appended with an octothorpe (#) and the + object instance number. Object instance numbers start at 0 when the + game is booted, and increase by one for each object cloned, hence the + number is unique for each cloned object. 'ob' defaults to this_object() + if not specified. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/objects/find_object ds2.0r27/lib/doc/efun/objects/find_object *** ds1.1/lib/doc/efun/objects/find_object Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/objects/find_object Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + find_object - find an object by file name + + object find_object( string str ); + + Find the object with the file name 'str'. If the object is a + cloned object, then it can be found using the file name which + would by returned if file_name() was called with it as the + argument. + + See also: + file_name + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/objects/first_inventory ds2.0r27/lib/doc/efun/objects/first_inventory *** ds1.1/lib/doc/efun/objects/first_inventory Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/objects/first_inventory Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + first_inventory - return the first item in an object's inventory + + object first_inventory( mixed ob ); + + This efun is only available if NO_ENVIRONMENT is not compiled in. + + Return the first object in the inventory of 'ob', where 'ob' is + either an object or the file name of an object. + + See also: + file_name, + next_inventory, + all_inventory, + deep_inventory + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/objects/heart_beat_info ds2.0r27/lib/doc/efun/objects/heart_beat_info *** ds1.1/lib/doc/efun/objects/heart_beat_info Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/objects/heart_beat_info Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + heart_beat_info - return an array of objects with active heartbeats + + object array heart_beat_info(); + + Returns an array of all the objects with active heart_beats. This efun + is only available if COMPAT_32 is defined. + + See also: + heart_beats.html + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/objects/heart_beats ds2.0r27/lib/doc/efun/objects/heart_beats *** ds1.1/lib/doc/efun/objects/heart_beats Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/objects/heart_beats Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + heart_beats - return an array of objects with active heartbeats + + object array heart_beats(); + + Returns an array of all the objects with active heart_beats. This efun + is only available if PACKAGE_CONTRIB is defined. + + See also: + heart_beat, + set_heart_beat, + query_heart_beat + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/objects/index ds2.0r27/lib/doc/efun/objects/index *** ds1.1/lib/doc/efun/objects/index Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/objects/index Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,51 ---- + Object efuns + + <H3>The efuns are for moving and managing objects:</H3> + + environment related efuns: (Not available with NO_ENVIRONMENT) + + <DL> + * all_inventory + * deep_inventory + * environment + * first_inventory + * move_object + * next_inventory + * present + </DL> + + loading and managing objects: + <DL> + * children + * clone_object + * clonep + * destruct + * file_name + * find_object + * load_object + * master + * new + * objectp + * objects + * reload_object + * restore_object + * save_object + * set_hide + * virtualp + </DL> + + heart_beat related efuns: + <DL> + * query_heart_beat + * set_heart_beat + * heart_beat_info + * heart_beats + </DL> + + message sending efuns: + <DL> + * tell_object + * tell_room + </DL> + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/objects/load_object ds2.0r27/lib/doc/efun/objects/load_object *** ds1.1/lib/doc/efun/objects/load_object Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/objects/load_object Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + load_object - find or load an object by file name + + object load_object( string str ); + + Find the object with the file name 'str'. If the object is already + loaded, it is returned (just like find_object()). If the file exists + and the object hasn't been loaded yet, it is loaded first, then the + new object is returned. Otherwise zero is returned. An error is + thrown only if the object has compile errors. + + See also: + file_name, + find_object + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/objects/master ds2.0r27/lib/doc/efun/objects/master *** ds1.1/lib/doc/efun/objects/master Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/objects/master Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,10 ---- + master - returns the master object + + object master(); + + Returns a pointer to the master object. + + See also: + find_object + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/objects/move_object ds2.0r27/lib/doc/efun/objects/move_object *** ds1.1/lib/doc/efun/objects/move_object Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/objects/move_object Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,8 ---- + move_object - move current object to another environment + + void move_object( mixed dest ); + + Move the current object into the object `dest'. dest should either be + a filename or an object. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/objects/new ds2.0r27/lib/doc/efun/objects/new *** ds1.1/lib/doc/efun/objects/new Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/objects/new Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + new + + object x = new( string name, ...); + class foo x = new(class foo); + + If given a string, it behaves like clone object. If given a class type, + it creates a new instance of the class type. + + See also: + clone_object, + destruct, + move_object + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/objects/next_inventory ds2.0r27/lib/doc/efun/objects/next_inventory *** ds1.1/lib/doc/efun/objects/next_inventory Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/objects/next_inventory Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + next_inventory - return the next object in the same inventory + + object next_inventory( object ob ); + + This efun is only available if NO_ENVIRONMENT is not compiled in. + + Return the next object in the same inventory as 'ob'. + + See also: + first_inventory, + all_inventory, + deep_inventory + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/objects/objects ds2.0r27/lib/doc/efun/objects/objects *** ds1.1/lib/doc/efun/objects/objects Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/objects/objects Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,25 ---- + objects - return an array of all loaded objects + + object array objects(); + + object array objects( string func, object ob ); + + object array objects( function f); + + An array of every object loaded on the mud is returned by objects(). Note + that if the system's maximum array size is set too low, objects() will + truncate its array, in which case it might not be too useful. + + If the optional `func' and `ob' parameters are given, then ob->func() + is called with each loaded object as an argument. If the function returns + nonzero, then that object is returned by objects(), otherwise it isn't. + + If 'f' is given, it will be called on all the objects as above. For + example, objects( (: clonep :) ) returns a list of all the clones in + existence. + + See also: + livings, + users + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/objects/present ds2.0r27/lib/doc/efun/objects/present *** ds1.1/lib/doc/efun/objects/present Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/objects/present Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,22 ---- + present - find an object by id + + object present( mixed str); + + object present( mixed str, object ob ); + + This efun is only available if NO_ENVIRONMENT is not compiled in. + + If an object for which id(str) returns true exists, return it. + + `str' can also be an object, in 'str' is searched for, instead of calling + the function id(). + + If `ob' is given, then the search is done in the inventory of `ob', otherwise + the object is searched for in the inventory of the current object, and + in the inventory of the environment of the current object. + + See also: + move_object, + environment + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/objects/query_heart_beat ds2.0r27/lib/doc/efun/objects/query_heart_beat *** ds1.1/lib/doc/efun/objects/query_heart_beat Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/objects/query_heart_beat Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + query_heart_beat() - query the status of an object's heartbeat + + int query_heart_beat( object ); + + Returns the value with which set_heart_beat() has been called with on + 'object'. If object is not given, it defaults to the current object. If + the object has no heart beat, 0 will be returned. + + See also: + heart_beat, + set_heart_beat + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/objects/reload_object ds2.0r27/lib/doc/efun/objects/reload_object *** ds1.1/lib/doc/efun/objects/reload_object Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/objects/reload_object Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + reload_object - return an object to its just-loaded state + + void reload_object( object ob ); + + When reload_object() is called on `ob', all the driver-maintained properties + are re-initialized (heart_beat, call_outs, light, shadows, etc), all + variables are re-initialized, and create() is called. It has a similar + effect to destructing/reloading the object, however, no disk access or + parsing is performed. + + See also: + new, + clone_object, + destruct + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/objects/restore_object ds2.0r27/lib/doc/efun/objects/restore_object *** ds1.1/lib/doc/efun/objects/restore_object Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/objects/restore_object Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + restore_object - restore values of variables from a file into an object + + int restore_object( string name, int flag ); + + Restore values of variables for current object from file `name'. If the + optional second argument is 1, then all of the non-static variables are not + zeroed out prior to restore (normally, they are). + + In the case of an error, the affected variable will be left untouched + and an error given. + + See also: + save_object + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/objects/save_object ds2.0r27/lib/doc/efun/objects/save_object *** ds1.1/lib/doc/efun/objects/save_object Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/objects/save_object Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + save_object - save the values of variables in an object into a file + + int save_object( string name, int flag ); + + Save all values of non-static variables in this object in the file 'name'. + valid_write() in the master object determines whether this is allowed. + If the optional second argument is 1, then variables that are zero (0) are also + saved (normally, they aren't). Object variables and function pointers + always save as 0. save_object() returns 1 for success, 0 for failure. + + See also: + restore_object + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/objects/set_heart_beat ds2.0r27/lib/doc/efun/objects/set_heart_beat *** ds1.1/lib/doc/efun/objects/set_heart_beat Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/objects/set_heart_beat Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + set_heart_beat - enable or disable an object's heartbeat + + int set_heart_beat( int flag ); + + Passing 'flag' as 0 disables the object's heart beat. Passing a 'flag' of + 1 will cause heart_beat() to be called in the object once each heart beat + (a variable number defined by your local administrator, usually 2 seconds). + Passing a 'flag' of greater than 1 will usually set the number of heart beats + in between calls to heart_beat(), however your local administrator may have + the system configured to treat any 'flag' above 1 as 1. + + See also: + heart_beat, + query_heart_beat + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/objects/set_hide ds2.0r27/lib/doc/efun/objects/set_hide *** ds1.1/lib/doc/efun/objects/set_hide Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/objects/set_hide Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + set_hide - set the hide flag on a hidable object + + void set_hide( int flag ); + + Sets the hidden flag of an object to `flag', which should be 0 or 1 + (hide disable, or hide enable, respectively). Only objects for which + `master()->valid_hide(ob)' returns true may make themselves hidden. + When the object is hidden, only other hidable objects will be able to + find the object with find_object(), or multiple-object returning efuns such + as users(), children(), all_inventory(), etc. + + See also: + valid_hide + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/objects/tell_object ds2.0r27/lib/doc/efun/objects/tell_object *** ds1.1/lib/doc/efun/objects/tell_object Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/objects/tell_object Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + tell_object - send a message to an object + + void tell_object( object ob, string str ); + + Send a message 'str' to object 'ob'. If it is an interactive object (a player), + then the message will go to him, otherwise it will go to the local + function "catch_tell()". + + See also: + write, + shout, + say, + tell_room, + catch_tell + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/objects/tell_room ds2.0r27/lib/doc/efun/objects/tell_room *** ds1.1/lib/doc/efun/objects/tell_room Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/objects/tell_room Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + tell_room - send a message to all objects in a room + + void tell_room( mixed ob, string str, object array exclude ); + + Send a message 'str' to object all objects in the room 'ob'. 'ob' can also + be the filename of the room (string). If 'exclude' is specified, all + objects in the exclude array will not receive the message. + + See also: + write, + shout, + say, + tell_object, + catch_tell + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/objects/virtualp ds2.0r27/lib/doc/efun/objects/virtualp *** ds1.1/lib/doc/efun/objects/virtualp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/objects/virtualp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,9 ---- + virtualp - determine whether or not a given variable points to a virtual object + + int virtualp( object arg ); + + Returns true (1) if the argument is objectp() and the O_VIRTUAL flag is set. + The driver sets the O_VIRTUAL flag for those objects created via the + 'compile_object' function in the master object. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/parsing/TODO ds2.0r27/lib/doc/efun/parsing/TODO *** ds1.1/lib/doc/efun/parsing/TODO Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/parsing/TODO Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + query_ip_port(void|object) [PACKAGE_CONTRIB] + mixed query_notify_fail() [!NO_ADD_ACTION] [PACKAGE_CONTRIB] + int remove_interactive(object) [PACKAGE_CONTRIB] + int remove_shadow(object ob) [!NO_SHADOWS] [PACKAGE_CONTRIB] + int replaceable(object, void | string array) [PACKAGE_CONTRIB] + float array rotate_x(float array, float) [PACKAGE_MATRIX] + float array rotate_y(float array, float) [PACKAGE_MATRIX] + float array rotate_z(float array, float) [PACKAGE_MATRIX] + float array scale(float array, float) [PACKAGE_MATRIX] + void set_this_player(object | int) [NO_ADD_ACTION] + void store_variable(string, mixed) [PACKAGE_CONTRIB] + string terminal_colour(string, mapping) [PACKAGE_CONTRIB] + float array translate(float array, float, float, float) [PACKAGE_MATRIX] + mapping unique_mapping(array, string|function, ...) + string upper_case(string) [PACKAGE_CONTRIB] + string array variables(object, int default: 0); [PACKAGE_CONTRIB] diff -c -r --new-file ds1.1/lib/doc/efun/parsing/index ds2.0r27/lib/doc/efun/parsing/index *** ds1.1/lib/doc/efun/parsing/index Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/parsing/index Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,9 ---- + Parsing efuns + + <H3>Various string parsing efuns:</H3> + + <DL> + * query_verb + </DL> + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/parsing/query_verb ds2.0r27/lib/doc/efun/parsing/query_verb *** ds1.1/lib/doc/efun/parsing/query_verb Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/parsing/query_verb Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + query_verb - return the name of the command currently being executed + + string query_verb(); + + This efun is only available if NO_ADD_ACTION is not compiled in. + + Give the name of the current command, or 0 if not executing from a command. + This function is useful when several commands (verbs) may cause the same + function to execute and it is necessary to determine which verb it was + that invoked the function. + + See also: + add_action + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/sockets/index ds2.0r27/lib/doc/efun/sockets/index *** ds1.1/lib/doc/efun/sockets/index Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/sockets/index Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,21 ---- + Socket efuns + + These efuns allow TCP and UDP sockets to be created, allowing the MUD to + create internet connections other than its login ports. + + <DL> + + * socket_accept + * socket_acquire + * socket_address + * socket_bind + * socket_close + * socket_connect + * socket_create + * socket_error + * socket_listen + * socket_release + * socket_write + </DL> + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/sockets/socket_accept ds2.0r27/lib/doc/efun/sockets/socket_accept *** ds1.1/lib/doc/efun/sockets/socket_accept Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/sockets/socket_accept Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,74 ---- + socket_accept - accept a connection on a socket + + int socket_accept( int s, string | function read_callback, string | function write_callback ); + + This efun is only available if PACKAGE_SOCKETS is compiled in. + + The argument s is a socket that has been created with socket_create(), + bound to an address with socket_bind(), and is listening for connections + after a socket_listen(). socket_accept() extracts the first connection + on the queue of pending connections, creates a new socket with the same + properties of s and allocates a new file descriptor for the socket. If no + pending connections are present on the queue, socket_accept() returns an + error as described below. The accepted socket is used to read and write data + to and from the socket which connected to this one; it is not used to accept + more connections. The original socket s remains open for accepting further + connections. + + The argument read_callback is the function or name of a function + for the driver to call when the new socket (not the accepting socket) + receives data. + + The write callback should follow this format: + + <pre> + void read_callback(int fd) + </pre> + + Where fd is the socket which is ready to accept data. + + The argument write_callback is the name of a function for the driver to + call when the new socket (not the accepting socket) is ready to be + written to. The write callback should follow this format: + + <pre> + void write_callback(int fd) + </pre> + + Where fd is the socket which is ready to be written to. + + Note: The close_callback of the accepting socket (not the new socket) + is called if the new socket closes unexpectedly, i.e. not as the result + of a socket_close() call. The close callback should follow this format: + + <pre> + void close_callback(int fd) + </pre> + + Where fd is the socket which has closed. + + socket_accept() returns a non-negative descriptor for the accepted + socket on success. On failure, it returns a negative value. socket_error() + can be used on the return value to get a text description of the error. + + ERRORS - these definitions are in socket_err.h + + <DL> + * EEFDRANGE Descriptor out of range. + * EEBADF Descriptor is invalid. + * EESECURITY Security violation attempted. + * EEMODENOTSUPP Socket mode not supported. + * EENOTLISTN Socket not listening. + * EEWOULDBLOCK Operation would block. + * EEINTR Interrupted system call. + * EEACCEPT Problem with accept. + * EENOSOCKS No more available efun sockets. + </DL> + + See also: + socket_bind, + socket_connect, + socket_create, + socket_listen + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/sockets/socket_acquire ds2.0r27/lib/doc/efun/sockets/socket_acquire *** ds1.1/lib/doc/efun/sockets/socket_acquire Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/sockets/socket_acquire Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,32 ---- + socket_acquire - assume ownership of a socket + + int socket_acquire( int socket, string | function read_callback, + string | function write_callback, + string | function close_callback ); + + This efun is only available if PACKAGE_SOCKETS is compiled in. + + socket_acquire() is called to complete the handshake begun by socket_release() + for transferring ownership (and control) of a socket to a new object. + socket_release() calls the release callback function within the new owner + object to notify the object that it wishes to pass control of the socket + on. It is the responsibility of the new owner socket to decide whether + it wishes to accept the socket. It it does, then socket_acquire() is + called to complete the transfer. If not, then the callback simply returns + without completing the handshake. + + In the former case the handshake is completed and the new object + becomes the socket owner. The read, write and close callback function + parameters refer to functions within the new object. These are specified + so that the MudOS driver will know which functions to call within the new + object. Decling to acquire the socket will cause socket_release() to + return EESOCKNOTRLSD so the owner can perform appropriate clean-up. + EESOCKNOTRLSD is in "socket_err.h". + + socket_acquire() may only be called within the context of thr release + callback function and only with the socket specified. + + See also: + socket_release + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/sockets/socket_address ds2.0r27/lib/doc/efun/sockets/socket_address *** ds1.1/lib/doc/efun/sockets/socket_address Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/sockets/socket_address Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,27 ---- + socket_address - return the remote address for an efun socket + + string socket_address( int s | object ob ); + + This efun is only available if PACKAGE_SOCKETS is compiled in. + + socket_address() returns the remote address for an efun socket s, or for + an interactive object ob. + + The returned address is of the form: + + "127.0.0.1 23". + + socket_address() returns: + + a string format address on success. + + an empty string on failure. + + See also: + socket_connect, + socket_create, + resolve, + query_host_name, + query_ip_number + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/sockets/socket_bind ds2.0r27/lib/doc/efun/sockets/socket_bind *** ds1.1/lib/doc/efun/sockets/socket_bind Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/sockets/socket_bind Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,36 ---- + socket_bind - bind a name to a socket + + int socket_bind( int s, int port ); + + This efun is only available if PACKAGE_SOCKETS is compiled in. + + socket_bind() assigns a name to an unnamed socket. When a socket is + created with socket_create() it exists in a name space (address family) + but has no name assigned. socket_bind() requests that the port be assigned + to the socket s. + + socket_bind() returns: + + EESUCCESS on success. + + a negative value indicated below on error. + + ERRORS - These errors are in "socket_err.h" + + <DL> + * EEFDRANGE Descriptor out of range. + * EEBADF Descriptor is invalid. + * EESECURITY Security violation attempted. + * EEISBOUND Socket is already bound. + * EEADDRINUSE Address already in use. + * EEBIND Problem with bind. + * EEGETSOCKNAME Problem with getsockname. + </DL> + + See also: + socket_connect. + socket_create, + socket_listen + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/sockets/socket_close ds2.0r27/lib/doc/efun/sockets/socket_close *** ds1.1/lib/doc/efun/sockets/socket_close Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/sockets/socket_close Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,27 ---- + socket_close - close a socket + + int socket_close( int s ); + + This efun is only available if PACKAGE_SOCKETS is compiled in. + + socket_close() closes socket s. This frees a socket efun slot for use. + + socket_close() returns: + + EESUCCESS on success. + + a negative value indicated below on error. + + ERRORS - "socket_err.h" + + <DL> + * EEFDRANGE Descriptor out of range. + * EEBADF Descriptor is invalid. + * EESECURITY Security violation attempted. + </DL> + + See also: + socket_accept, + socket_create + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/sockets/socket_connect ds2.0r27/lib/doc/efun/sockets/socket_connect *** ds1.1/lib/doc/efun/sockets/socket_connect Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/sockets/socket_connect Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,63 ---- + socket_connect - initiate a connection on a socket + + int socket_connect( int s, string address, + string read_callback, + string write_callback ); + + This efun is only available if PACKAGE_SOCKETS is compiled in. + + The argument s is a socket. s must be either a STREAM mode or a MUD mode + socket. address is the address to which the socket will attempt to connect. + address is of the form: "127.0.0.1 23" + + The argument read_callback is the name of a function for the driver to + call when the socket gets data from its peer. The read callback should follow + this format: + + <pre> + void read_callback(int fd, mixed message) + </pre> + + Where fd is the socket which received the data, and message is the data + which was received. + + The argument write_callback is the name of a function for the driver to + call when the socket is ready to be written to. The write callback should + follow this format: + + <pre> + void write_callback(int fd) + </pre> + + Where fd is the socket which is ready to be written to. + + socket_connect() returns: + + EESUCCESS on success. + + a negative value indicated below on error. + + ERRORS - these are in "socket_err.h" + + <DL> + * EEFDRANGE Descriptor out of range. + * EEBADF Descriptor is invalid. + * EESECURITY Security violation attempted. + * EEMODENOTSUPP Socket mode not supported. + * EEISLISTEN Socket is listening. + * EEISCONN Socket is already connected. + * EEBADADDR Problem with address format. + * EEINTR Interrupted system call. + * EEADDRINUSE Address already in use. + * EEALREADY Operation already in progress. + * EECONNREFUSED Connection refused. + * EECONNECT Problem with connect. + </DL> + + See also: + socket_accept, + socket_close, + socket_create + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/sockets/socket_create ds2.0r27/lib/doc/efun/sockets/socket_create *** ds1.1/lib/doc/efun/sockets/socket_create Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/sockets/socket_create Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,64 ---- + socket_create - create an efun socket + + int socket_create( int mode, string | function read_callback); + + int socket_create( int mode, string | function read_callback, string | function close_callback ); + + This efun is only available if PACKAGE_SOCKETS is compiled in. + + socket_create() creates an efun socket. mode determines which type of + socket is created. Currently supported socket modes are: + + <DL> + * MUD for sending LPC data types using TCP protocol. + * STREAM for sending raw data using TCP protocol. + * DATAGRAM for using UDP protocol. + </DL> + + The argument read_callback is the name of a function for the driver to + call when the socket gets data from its peer. The read callback should follow + this format: + + <pre> + void read_callback(int fd, mixed message) + </pre> + + Where fd is the socket which received the data, and message is the data + which was received. + + The argument close_callback is the name of a function for the driver to + call if the socket closes unexpectedly, i.e. not as the result of a + socket_close() call. The close callback should follow this format: + + <pre> + void close_callback(int fd) + </pre> + + Where fd is the socket which has closed. + NOTE: close_callback is not used with DATAGRAM mode sockets. + + socket_create() returns: + + a non-negative descriptor on success. + + a negative value indicated below on error. + + ERRORS - these are in "socket_err.h" + + <DL> + * EEMODENOTSUPP Socket mode not supported. + * EESOCKET Problem creating socket. + * EESETSOCKOPT Problem with setsockopt. + * EENONBLOCK Problem setting non-blocking mode. + * EENOSOCKS No more available efun sockets. + * EESECURITY Security violation attempted. + + See also: + socket_accept, + socket_bind, + socket_close, + socket_connect, + socket_listen, + socket_write + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/sockets/socket_error ds2.0r27/lib/doc/efun/sockets/socket_error *** ds1.1/lib/doc/efun/sockets/socket_error Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/sockets/socket_error Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,19 ---- + socket_error - return a text description of a socket error + + string socket_error( int error ); + + This efun is only available if PACKAGE_SOCKETS is compiled in. + + socket_error() returns a string describing the error signified by error. + + socket_error() returns: + + a string describing the error on success. + + "socket_error: invalid error number" on bad input. + + See also: + socket_create, + socket_connect + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/sockets/socket_listen ds2.0r27/lib/doc/efun/sockets/socket_listen *** ds1.1/lib/doc/efun/sockets/socket_listen Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/sockets/socket_listen Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,45 ---- + socket_listen - listen for connections on a socket + + int socket_listen( int s, string listen_callback ); + + This efun is only available if PACKAGE_SOCKETS is compiled in. + + To accept connections, a socket is first created with socket_create(), + the socket is them put into listening mode with socket_listen(), and + the connections are accepted with socket_accept(). The socket_listen() call + applies only to sockets of type STREAM or MUD. + + The argument listen_callback is the name of a function for the driver to + call when a connection is requested on the listening socket. The listen + callback should follow this format: + + <pre> + void listen_callback(int fd) + </pre> + + Where fd is the listening socket. + + socket_listen() returns: + + EESUCCESS on success. + + a negative value indicated below on error. + + ERRORS - these are in "socket_err.h" + + <DL> + * EEFDRANGE Descriptor out of range. + * EEBADF Descriptor is invalid. + * EESECURITY Security violation attempted. + * EEMODENOTSUPP Socket mode not supported. + * EENOADDR Socket not bound to an address. + * EEISCONN Socket is already connected. + * EELISTEN Problem with listen. + </DL> + + See also: + socket_accept, + socket_connect, + socket_create + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/sockets/socket_release ds2.0r27/lib/doc/efun/sockets/socket_release *** ds1.1/lib/doc/efun/sockets/socket_release Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/sockets/socket_release Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,35 ---- + socket_release - release ownership of a socket to another object + + int socket_release( int socket, object ob, + string release_callback ); + + This efun is only available if PACKAGE_SOCKETS is compiled in. + + socket_release() is used to change ownership (and control) of a socket + to another object. It is useful in daemon objects (like inetd) which + handle connection set-up and then transfer a connected socket to another + object for further processing. + + Socket ownership transfer involves a handshake between the current owner + object and the socket to which the current owner wishes to transfer the + socket. The handshake is initiated when socket_release() is called. + socket_release() does appropriate security/integrity checking and then + calls the release_callback function in object ob. This function is used + to notify ob that socket ownership is being transferred to it. It is + then ob's responsibility to call socket_acquire() within the release + callback function. If socket_acquire() is called then the handshake is + complete and socket ownership has been successfully transferred to ob. + ob may decline to accept responsibility for the socket by not calling + socket_acquire(), in which case ownership does not change and the + current socket owner must decide how to respond to this. + + If the socket owner is successfully transfered then socket_release() + returns EESUCCESS. If ob does not accept ownership for the socket then + EESOCKNOTRLSD is returned (both in "socket_err.h"). Other errors can be returned based on + security violation, bad socket descriptor vbalues, etc. + + See also: + socket_acquire + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/sockets/socket_write ds2.0r27/lib/doc/efun/sockets/socket_write *** ds1.1/lib/doc/efun/sockets/socket_write Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/sockets/socket_write Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,42 ---- + socket_write - send a message from a socket + + int socket_write( int s, mixed message, + void | string address ); + + This efun is only available if PACKAGE_SOCKETS is compiled in. + + socket_write() sends a message on a socket s. If the socket s is of type + STREAM or MUD, the socket must already be connected and the address is not + specified. If the socket is of type DATAGRAM, the address must be specified. + The address is of the form: "127.0.0.1 23". + + socket_write() returns: + + EESUCCESS on success. + + a negative value indicated below on error. + + ERRORS - these are in "socket_err.h" + + <DL> + * EEFDRANGE Descriptor out of range. + * EEBADF Descriptor is invalid. + * EESECURITY Security violation attempted. + * EENOADDR Socket not bound to an address. + * EEBADADDR Problem with address format. + * EENOTCONN Socket not connected. + * EEALREADY Operation already in progress. + * EETYPENOTSUPP Object type not supported. + * EEBADDATA Sending data with too many nested levels. + * EESENDTO Problem with sendto. + * EEMODENOTSUPP Socket mode not supported. + * EEWOULDBLOCK Operation would block. + * EESEND Problem with send. + * EECALLBACK Wait for callback. + </DL> + + See also: + socket_connect, + socket_create + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/strings/capitalize ds2.0r27/lib/doc/efun/strings/capitalize *** ds1.1/lib/doc/efun/strings/capitalize Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/strings/capitalize Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + capitalize - capitalize a string + + string capitalize( string str ); + + Convert the first character in 'str' to upper case, and return the + new string. + + See also: + lower_case + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/strings/clear_bit ds2.0r27/lib/doc/efun/strings/clear_bit *** ds1.1/lib/doc/efun/strings/clear_bit Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/strings/clear_bit Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + clear_bit - zero a bit in a bit string + + string clear_bit( string str, int n ); + + Return the new string where bit 'n' is cleared in string 'str'. Note that + the old string 'str' is not modified. See set_bit() for information on + the format of the string. + + See also: + set_bit, + test_bit + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/strings/crypt ds2.0r27/lib/doc/efun/strings/crypt *** ds1.1/lib/doc/efun/strings/crypt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/strings/crypt Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,10 ---- + crypt - encrypt a string + + string crypt( string str, string seed ); + + Crypt the string 'str' using the first two characters from 'seed' as + a seed. If 'seed' is 0, then random seed is used. + + The result has the first two characters as the seed. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/strings/explode ds2.0r27/lib/doc/efun/strings/explode *** ds1.1/lib/doc/efun/strings/explode Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/strings/explode Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,20 ---- + explode - break up a string + + string array explode( string str, string del ); + + explode() returns an array of strings, created when the string 'str' + is split into pieces as divided by the delimiter 'del'. + + EXAMPLE: + + explode(str," ") will return as an array all of the words (separated + by spaces) in the string 'str'. + + See also: + implode, + sscanf, + replace_string, + strsrch + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/strings/implode ds2.0r27/lib/doc/efun/strings/implode *** ds1.1/lib/doc/efun/strings/implode Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/strings/implode Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,24 ---- + implode - concatenate strings + + string implode( array arr, string del ); + + mixed implode( array arr, function f); + + mixed implode( array arr, function f, mixed start); + + Concatenate all strings found in array 'arr', with the string 'del' between + each element. Only strings are used from the array. Elements that are not + strings are ignored. + + The second version takes the first and second values of arr and passes them + to f, then passes that result and the third arg to f, et cetera. It returns + the last result of the call to f. + + In the third case, the first call is f(start, arr[0]), then things proceed + as above. + + See also: + explode, + sprintf + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/strings/index ds2.0r27/lib/doc/efun/strings/index *** ds1.1/lib/doc/efun/strings/index Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/strings/index Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,28 ---- + String efuns + + The following efuns exist for working with strings: + + <DL> + * capitalize + * clear_bit + * crypt + * explode + * implode + * lower_case + * next_bit + * pluralize + * reg_assoc + * regexp + * replace_string + * set_bit + * sprintf + * sscanf + * strcmp + * stringp + * strlen + * strsrch + * terminal_colour + * test_bit + </DL> + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/strings/lower_case ds2.0r27/lib/doc/efun/strings/lower_case *** ds1.1/lib/doc/efun/strings/lower_case Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/strings/lower_case Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + lower_case - return the lowercase version of a given string + + string lower_case( string str ); + + Return the lowercase version of a given string (original string remains + unchanged). + + See also: + capitalize + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/strings/next_bit ds2.0r27/lib/doc/efun/strings/next_bit *** ds1.1/lib/doc/efun/strings/next_bit Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/strings/next_bit Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + next_bit - find the next bit set in a bitstring + + int next_bit( string str, int n ); + + next_bit() returns the next bit set in a bitstring after 'n', or -1 if + 'n' is the last set bit. + + See also: + set_bit, + test_bit + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/strings/pluralize ds2.0r27/lib/doc/efun/strings/pluralize *** ds1.1/lib/doc/efun/strings/pluralize Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/strings/pluralize Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,10 ---- + pluralize - returns the plural of a given string + + string pluralize( string str ); + + Returns the plural of 'str'. Handles most of the oddities of the English + language. + + This efun is only available if PACKAGE_CONTRIB is defined. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/strings/reg_assoc ds2.0r27/lib/doc/efun/strings/reg_assoc *** ds1.1/lib/doc/efun/strings/reg_assoc Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/strings/reg_assoc Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,55 ---- + reg_assoc - A regular pattern substring extractor + + array reg_assoc(string str, string array pat_arr, array tok_arr); + + array reg_assoc(string str, string array pat_arr, array tok_arr, mixed def); + + reg_assoc() takes a string and explodes it into substrings matching + the regular expression pattern strings given in pat_arr and associates + them with tokens given in tok_arr. If def (default 0) is given, it + is associated with a non-match. The return value is an array of + two arrays, the 1st being an array of the form + <pre> + ({ non-match1, match1, non-match2, match2, ..., + non-match n, match n, non-match n+1 }) + </pre> + and the 2nd holds the tokens corresponding to the matches in order: + <pre> + ({ def, token corresponding to match1, ...., def, + token corresponding to match n, def }). + </pre> + + pat_arr and tok_arr must be of the same sizes, the ith element in + tok_arr being the corresponding token to the ith element of pat_arr. + pat_arr can only hold strings. + + If pat_arr (and hence tok_arr) has size 0 then the return value is + simply ({ ({ str }), ({ def }) }). + + EXAMPLE + + <pre> + #define STRING_PAT "\e"(\e\e\e\e.|[^\e\e\e"])*\e"" + #define NUM_PAT "[0\-9]+" + + #define F_STRING 1 + #define F_NUM 2 + + reg_assoc("Blah \e"blah\e" test 203 hhh j 308 \e"bacdcd\eb\e"acb", + ({ STRING_PAT, NUM_PAT }), ({ F_STRING, F_NUM }), "no-match") + </pre> + + will return + + <pre> + ({ ({ "Blah ", "\e"blah\e"", " test ", "203", " hhh j ", "308", " ", + "\e"bacdcd\eb\e"", "acb" }), + ({ "no-match", F_STRING, "no-match", F_NUM, "no-match", F_NUM, + "no-match", F_STRING, "no-match" }) }) + </pre> + + See also: + + regexp [for regular expression syntax] + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/strings/regexp ds2.0r27/lib/doc/efun/strings/regexp *** ds1.1/lib/doc/efun/strings/regexp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/strings/regexp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,93 ---- + regexp - regular expression handler + + int regexp( string str, string pattern); + + string array regexp( string array lines, string pattern); + + string array regexp( string array lines, string pattern, int flag); + + In the first version, regexp() returns true (1) if the string str contains + a substring which matches the regular expression 'pattern'. If a complete + match is wanted, the pattern should begin with ^ and end with $. + + When presented with an array of lines of text and a regular + expression, regexp() returns an array containing those lines which + match the pattern specified by the regular expression. If the (flag & 2) + is nonzero, (flag defaults to zero), then non-matches will be returned + instead of matches. If (flag & 1) is nonzero, the array returned will be of + the form ({ index1 + 1, match1, ..., indexn + 1, matchn }) where indexn + is the index of nth match/non match in the array lines. + + REGULAR EXPRESSION SYNTAX + + A regular expression is zero or more <b>branches</b>, separated by '|'. + It matches anything that matches one of the branches. + + A <b>branch</b> is zero or more <i>pieces</i>, concatenated. + It matches a match for the first, followed by a match for the second, etc. + + A <b>piece</b> is an <i>atom</i> possibly followed by '*', '+', or '?'. + An atom followed by '*' matches a sequence of 0 or more matches of the atom. + An atom followed by '+' matches a sequence of 1 or more matches of the atom. + An atom followed by '?' matches a match of the atom, or the null string. + + An <b>atom</b> is a regular expression in parentheses (matching a match for the + regular expression), a <i>range</i> (see below), '.' + (matching any single character), '^' (matching the null string at the + beginning of the input string), '$' (matching the null string at the + end of the input string), a '\e' followed by a single character (matching + that character), or a single character with no other significance + (matching that character). + + A <b>range</b> is a sequence of characters enclosed in '[]'. + It normally matches any single character from the sequence. + If the sequence begins with '^', + it matches any single character <b>not</b> from the rest of the sequence. + If two characters in the sequence are separated by '-', this is shorthand + for the full list of ASCII characters between them + (e.g. '[0-9]' matches any decimal digit). + To include a literal ']' in the sequence, make it the first character + (following a possible '^'). + To include a literal '-', make it the first or last character. + + AMBIGUITY + + If a regular expression could match two different parts of the input string, + it will match the one which begins earliest. + If both begin in the same place but match different lengths, or match + the same length in different ways, life gets messier, as follows. + + In general, the possibilities in a list of branches are considered in + left-to-right order, the possibilities for '*', '+', and '?' are + considered longest-first, nested constructs are considered from the + outermost in, and concatenated constructs are considered leftmost-first. + The match that will be chosen is the one that uses the earliest + possibility in the first choice that has to be made. + If there is more than one choice, the next will be made in the same manner + (earliest possibility) subject to the decision on the first choice. + And so forth. + + For example, '(ab|a)b*c' could match 'abc' in one of two ways. + The first choice is between 'ab' and 'a'; since 'ab' is earlier, and does + lead to a successful overall match, it is chosen. + Since the 'b' is already spoken for, + the 'b*' must match its last possibility (the empty string) since + it must respect the earlier choice. + + In the particular case where no '|'s are present and there is only one + '*', '+', or '?', the net effect is that the longest possible + match will be chosen. + So 'ab*', presented with 'xabbbby', will match 'abbbb'. + Note that if 'ab*' is tried against 'xabyabbbz', it + will match 'ab' just after 'x', due to the begins-earliest rule. + (In effect, the decision on where to start the match is the first choice + to be made, hence subsequent choices must respect it even if this leads them + to less-preferred alternatives.) + + See also: + + sscanf, + explode, + strsrch + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/strings/repeat_string ds2.0r27/lib/doc/efun/strings/repeat_string *** ds1.1/lib/doc/efun/strings/repeat_string Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/strings/repeat_string Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + repeat_string - repeat a string a specified number of times. + + string repeat_string(string, int); + + repeat_string returns a string that consists of its first argument + repeated n times, where 'n' is repeat_string's second argument. + So repeat_string("foo", 3) would return "foofoofoo". + + This function requires PACKAGE_CONTRIB to be defined in the options file. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/strings/replace_string ds2.0r27/lib/doc/efun/strings/replace_string *** ds1.1/lib/doc/efun/strings/replace_string Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/strings/replace_string Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,47 ---- + replace_string - replace all instances of a string within a string + + string replace_string( string str, string pattern, string replace ); + + string replace_string( string str, string pattern, string replace, int max ); + + string replace_string( string str, string pattern, string replace, int first, int last ); + + replace_string() returns 'str' with all instances of 'pattern' replaced with + 'replace'. If 'pattern' has zero length then str is returned unmodified. + If the resultant string would exceed the maximum string length then + replace_string() returns an undefinedp(), non-stringp() value. + + replace_string() can be used to remove characters from a string by + specifying a pattern and a zero-length replace parameter. For example, + replace_string(" 1 2 3 ", " ", "") would return "123". replace_string() + executes faster this way then explode()/implode(). + + The 4th and 5th arguments are optional (to retain backward compatibility.) + The extra arguments have the following effect: + + With 4 args: + + The 4th argument specifies the maximum number of replacements + to make (the count starts at 1). A value of 0 implies 'replace all', and + thus, acts as replace_string() with 3 arguments would. E.g., + replace_string("xyxx", "x", "z", 2) would return "zyzx". + + With 5 args: + + The 4th and 5th arguments specify the range of matches to replace + between, with the following constraints: + + <DL> + * first < 1 : change all from the start. + * last == 0, or last > max_matches : change all to end + * first > last : return the unmodified array. + </DL> + + E.g., replace_string("xyxxy", "x", "z", 2, 3) returns "xyzzy". + + See also: + sscanf, + explode, + strsrch + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/strings/set_bit ds2.0r27/lib/doc/efun/strings/set_bit *** ds1.1/lib/doc/efun/strings/set_bit Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/strings/set_bit Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + set_bit - set a bit in a bitstring + string set_bit( string str, int n ); + + Return the new string where bit 'n' is set in string 'str'. Note that the old string 'str' is not modified. + + The maximum value of 'n' is limited by the value of the 'maximum bits in a bitfield' entry in the driver config file. + + The new string will automatically be extended if needed. + + Bits are packed 6 per byte in printable strings. + + See also: clear_bit , test_bit + + Tim Hollebeek + Beek @ZorkMUD, Lima Bean, IdeaExchange, TMI-2, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/strings/sprintf ds2.0r27/lib/doc/efun/strings/sprintf *** ds1.1/lib/doc/efun/strings/sprintf Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/strings/sprintf Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,55 ---- + sprintf - formatted output conversion + + string sprintf( string format, ... ); + + An implementation of sprintf() for LPC, with quite a few extensions + Originally implemented by Lynscar (Sean A Reith). + + This version supports the following as modifiers: + <dl> + * " " - pad positive integers with a space. + * "+" - pad positive integers with a plus sign. + * "-" - left adjusted within field size. + <b>Note:</b> sprintf() defaults to right justification, which is unnatural + in the context of a mainly string based language but has been retained for + "compatability". + * "|" - centered within field size. + * "=" - column mode if width is greater than field size. This is only + meaningful with strings, all other types ignore this. Columns are + auto-magically word wrapped. + * "#" - table mode, print a list of '\\n' separated 'words' in a + table within the field size. only meaningful with strings. + * a number - specifies the field size, a '*' specifies to use the + corresponding arg as the field size. If n is prepended with a zero, then + the field is padded zeros, otherwise it is padded with spaces (or specified pad string; see below). + * "." then a number - precision of n, simple strings truncate after this (if precision is + greater than field size, then field size = precision), tables use + precision to specify the number of columns (if precision not specified + then tables calculate a best fit), all other types ignore this. + * ":" then a number - n specifies the fs _and_ the precision, if n is prepended by a zero then the field is padded with zeros instead of spaces. + * "@" - the argument is an array. the corresponding format_info (minus the "@") is applied to each element of the array. + * "'X'" - The char(s) between the single-quotes are used to pad to + field size (defaults to space) (if both a zero (in front of field + size) and a pad string are specified, the one specified second + overrules). NOTE: to include "'" in the pad string, you must + use "\'" (as the backslash has to be escaped past the + interpreter), similarly, to include "\" requires "\\\\". + </dl> + The following are the possible type specifiers. + <dl> + * % - in which case no arguments are interpreted, and a "%" is + inserted, and all modifiers are ignored. + * O - the argument is an LPC datatype. + * s - the argument is a string. + * d, i - the integer arg is printed in decimal. + * c - the integer arg is to be printed as a character. + * o - the integer arg is printed in octal. + * x - the integer arg is printed in hex. + * X - the integer arg is printed in hex (with A-F in capitals). + * f - floating point number + </dl> + + See also: + sscanf + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/strings/sscanf ds2.0r27/lib/doc/efun/strings/sscanf *** ds1.1/lib/doc/efun/strings/sscanf Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/strings/sscanf Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,43 ---- + sscanf - match substrings in a string + + int sscanf( string str, string fmt, mixed var1, mixed var2, ... ); + + Parse a string 'str' using the format 'fmt'. The format 'fmt' + consists of text to match against 'str', separated by patterns which + begin with '%'. The following patterns are supported: + + <DL> + * '%%' - matches '%' + * '%x' - matches a hexidecimal number + * '%d' - matches a decimal number + * '%f' - matches a floating point number + * '%(regexp)' - matches anything that matches the regular + expression 'regexp' (see the regexp() efun for details) + * '%s' - matches a string; see below + </DL> + + Note that the third and following arguments are NOT expressions; they + must be valid lvalues (locations which can be assigned to). As + matches are encountered in the string, the corresponding values are + put directly into the third and following arguments. If a problem + is encountered (either some of the text between patterns doesn't + match, or a pattern can't be matched to the corresponding input) + the number of matches so far is returned, and the remaining arguments + are left unchanged. If a '*' comes immediately after the '%' in the + format, then that pattern is matched, but not assigned to a variable. + It is counted in the return value. + + '%s' is handled as follows. If it is followed by text, '%s' matches + up the the next ocurrence of the text. For example, the format + "%sxy%s" will match "fox" to the first %s when used on the string + "foxxybarxyz". If the %s occurs at the end of the string, the + remainder of the string is matched. If it is followed immediately + by another pattern, then %s matches up to the first valid match for + the following pattern. "%s%s" is illegal. + + See also: + explode, + replace_string, + strsrch + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/strings/strcmp ds2.0r27/lib/doc/efun/strings/strcmp *** ds1.1/lib/doc/efun/strings/strcmp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/strings/strcmp Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,18 ---- + strcmp - determines the lexical relationship between two strings + + int strcmp( string one, string two ); + + This implementatin of strcmp() is identical to the one found in C libraries. + If string one lexically precedes string two, then strcmp() returns a number + less than 0. If the two strings have the same value, strcmp() returns 0. + If string two lexically precedes string one, then strcmp() returns a number + greater than 0. This efunction is particularly useful in the compare + functions needed by sort_array(). + + Note that relational operators (<, >, etc) can also be used to compare + strings. + + See also: + sort_array + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/strings/strlen ds2.0r27/lib/doc/efun/strings/strlen *** ds1.1/lib/doc/efun/strings/strlen Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/strings/strlen Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,10 ---- + strlen - returns the length of a string + + int strlen( string str ); + + strlen() returns the number of characters in the string 'str'. + + See also: + sizeof + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/strings/strsrch ds2.0r27/lib/doc/efun/strings/strsrch *** ds1.1/lib/doc/efun/strings/strsrch Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/strings/strsrch Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,19 ---- + strsrch - search for substrings in a string + + int strsrch( string str, string substr | int char, int flag ); + + strsrch() searches for the first occurance of the string 'substr' in the + string 'str'. The last occurance of 'substr' can be found by passing '-1' + as the 3rd argument (which is optional). If the second argument is an + integer, that character is found (like C's strchr()/strrchr().) The empty + string or null value cannot be searched for. + + The integer offset of the first (last) match is returned. -1 is returned + if there was no match, or an error occurred (bad args, etc). + + See also: + sscanf, + replace_string, + regexp + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/strings/terminal_colour ds2.0r27/lib/doc/efun/strings/terminal_colour *** ds1.1/lib/doc/efun/strings/terminal_colour Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/strings/terminal_colour Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + terminal_colour - replaces codes in a string + + string terminal_colour(string str, mapping m, int wrap, int indent); + + terminal_colour() replaces each occurrence of %^key%^ in str with 'value', + where 'key' and 'value' are the elements in the mapping m. + + 'wrap' is the optional column number to wrap at, and 'indent' is the + amount to indent the second and following lines. Codes are assumed to + change the mode of the terminal and not generate any printable + characters for the purposes of wrapping. + + This efun is only available if PACKAGE_CONTRIB is defined. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/strings/test_bit ds2.0r27/lib/doc/efun/strings/test_bit *** ds1.1/lib/doc/efun/strings/test_bit Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/strings/test_bit Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + test_bit - test a bit in a bitstring + + int test_bit( string str, int n ); + + Returns 1 if bit 'n' was set in string 'str', and zero otherwise. + + See also: + set_bit, + clear_bit + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/strings/upper_case ds2.0r27/lib/doc/efun/strings/upper_case *** ds1.1/lib/doc/efun/strings/upper_case Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/strings/upper_case Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + upper_case - return the uppercase version of a given string + + string upper_case(string); + + Return the uppercase version of a given string (original string remains + unchanged). + + This function requires PACKAGE_CONTRIB to be defined in the options file. + + See also: + capitalize, + lower_case + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/system/all_previous_objects ds2.0r27/lib/doc/efun/system/all_previous_objects *** ds1.1/lib/doc/efun/system/all_previous_objects Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/all_previous_objects Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,17 ---- + all_previous_objects - returns an array of objects that called the current function + + object array all_previous_objects(); + + Returns an array of objects that called current function. + Note that local function calls do not set previous_object() to the current + object, but leave it unchanged. + + The first element of the array is previous_object(), followed by + previous_object(1), etc ... + + See also: + call_other, + origin, + previous_object + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/system/call_out_info ds2.0r27/lib/doc/efun/system/call_out_info *** ds1.1/lib/doc/efun/system/call_out_info Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/call_out_info Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,21 ---- + call_out_info - get pending call_out() information + + array call_out_info(); + + Get information about all pending call outs. An array is returned, + where every item in the array consists 3 elements: the object, + the function, and the remaining delay. + + Note: due to security concerns, and the fact that call_outs may now + have an arbitrary number of arguments, the 4th element of the return + value was returned. The security concerns stem from the fact that if + the arguments where types which can be modified (arrays, mappings, + etc), obtaining them would allow them to be modified before the + function was called. It is possible this will be fixed in the + future if there is enough interest. + + See also: + call_out, + remove_call_out + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/system/check_memory ds2.0r27/lib/doc/efun/system/check_memory *** ds1.1/lib/doc/efun/system/check_memory Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/check_memory Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + check_memory - check all allocated blocks + + string check_memory(int flag) + + returns a string describing possible memory allocation problems. If the + optional flag is 1, a summary of allocated memory is printed at the + end. + + This efun is only available if PACKAGE_DEVELOP, DEBUGMALLOC, and + DEBUGMALLOC_EXTENSIONS are defined. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/system/ctime ds2.0r27/lib/doc/efun/system/ctime *** ds1.1/lib/doc/efun/system/ctime Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/ctime Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + ctime - return a time string + + string ctime( int clock ); + + Gives a nice string with current date and time, with the argument 'clock' + that is the number of seconds since 1970. + + See also: + time, + localtime, + uptime + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/system/deep_inherit_list ds2.0r27/lib/doc/efun/system/deep_inherit_list *** ds1.1/lib/doc/efun/system/deep_inherit_list Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/deep_inherit_list Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + deep_inherit_list - get a list of ancestors of an object + + string array deep_inherit_list( object obj ); + + Returns an array of filenames of all objects inherited (directly and + indirectly) by obj. + + See also: + inherit_list, + inherits + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/system/error ds2.0r27/lib/doc/efun/system/error *** ds1.1/lib/doc/efun/system/error Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/error Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + error - generate a run-time error + + void error( string err ); + + A run-time error 'err' will be generated when error() is called. Execution + of the current thread will halt, and the trace will be recorded to the + debug log. + + See also: + catch, + throw, + error_handler + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/system/eval_cost ds2.0r27/lib/doc/efun/system/eval_cost *** ds1.1/lib/doc/efun/system/eval_cost Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/eval_cost Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + eval_cost - returns the evaluation cost remaining + + void eval_cost() + + eval_cost() returns the number of instructions that can be executed + before the driver decides it is in an infinite loop. + + See also: + set_eval_limit, + reset_eval_cost + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/system/external_start ds2.0r27/lib/doc/efun/system/external_start *** ds1.1/lib/doc/efun/system/external_start Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/external_start Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,17 ---- + external_start - start an external command + + int external_start(int which, string args, mixed read_cb, mixed write_cb, mixed close_cb); + + 'which' specifies which of the 5 external commands specified in + the config file to run. 'args' are the arguments to pass to the + command. The driver then starts up the specified command, and sets up + an LPC socket to communicate with the input and output of the command. + The file descriptor of the LPC socket is returned. + + See also: + time, + ctime, + localtime + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/system/find_call_out ds2.0r27/lib/doc/efun/system/find_call_out *** ds1.1/lib/doc/efun/system/find_call_out Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/find_call_out Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,14 ---- + find_call_out - find a call out scheduled to be called next + + int find_call_out( string func ); + + Find the first call out due to be executed for function 'func' in the + current object, or the call_out() which returned the integer 'handle', + and return the time left. If it is not found, then return -1. + + See also: + call_out, + remove_call_out, + set_heart_beat + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/system/flush_messages ds2.0r27/lib/doc/efun/system/flush_messages *** ds1.1/lib/doc/efun/system/flush_messages Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/flush_messages Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + flush_messages - send all pending messages to a user + + int flush_messages(); + + int flush_messages(object user); + + Normally, messages are queued, then sent all at once to minimize the + number of packets required. This efun forces all pending messages to + be written immediately. If no user is specified, messages for ALL users + are flushed. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/system/function_exists ds2.0r27/lib/doc/efun/system/function_exists *** ds1.1/lib/doc/efun/system/function_exists Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/function_exists Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,20 ---- + function_exists - find the file containing a given function in an object + + string function_exists( string str, object ob, int flag ); + + Return the file name of the object that defines the function 'str' in + object 'ob'. The returned value can be other than 'file_name(ob)' if the + function is defined by an inherited object. + + 0 is returned if the function was not defined. + + Note that function_exists() does not check shadows. + + If flag is omitted or zero functions that cannot be called are not returned + (e.g. the function is returned only if call_other(ob, str) would succeed). + If the flag is nonzero, static and private functions are returned too. + + See also: + call_other + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/system/function_profile ds2.0r27/lib/doc/efun/system/function_profile *** ds1.1/lib/doc/efun/system/function_profile Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/function_profile Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,27 ---- + function_profile - get function profiling information for an object + + array function_profile( object ob ); + + Returns function profiling information for 'ob', or this_object() if 'ob' + is not specified. This is only available if the driver was compiled + with PROFILE_FUNCTIONS defined. + + An array of mappings is returned, one for each function in 'ob'. The format + of the mapping is: + <pre> + ([ "name" : name_of_the_function, + "calls" : number_of_calls, + + "self" : cpu_time_spent_in self, + "children" : cpu_time_spent_in_children + ]) + </pre> + The usefulness of this is tied to the resolution of the CPU clock--even + though the units are microseconds, the CPU timer resolution is often much + less. + + See also: + rusage, + time_expression + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/system/functions ds2.0r27/lib/doc/efun/system/functions *** ds1.1/lib/doc/efun/system/functions Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/functions Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,21 ---- + functions - list all the functions in a given object. + + string array functions(object, int default: 0); + + functions() can return two different things. If the second argument is + 0 (which it is by default) it will return an array containing the names + of all the functions in the object passed as the first argument. If the + second argument is non-zero, more information about each function is + given. For a non-zero second argument, each array element contains + the following: + + ({ function_name, number_of_arguments, return_type, ... }). + + Where the fourth and following elements are the argument types. If + the save_types pragma was not in effect when the function was compiled, + number_of_arguments will be correct, but no types will be available. + + This efun is only available if PACKAGE_CONTRIB is defined in the + options file. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/system/index ds2.0r27/lib/doc/efun/system/index *** ds1.1/lib/doc/efun/system/index Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/index Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,36 ---- + System efuns + + <DL> + * all_previous_objects + * call_out_info + * check_memory + * ctime + * debug_message + * deep_inherit_list + * error + * eval_cost + * external_start + * find_call_out + * flush_messages + * function_exists + * function_profile + * functions + * inherit_list + * inherits + * localtime + * lpc_info + * max_eval_cost + * memory_summary + * named_livings + * program_info + * reclaim_objects + * replace_program + * reset_eval_cost + * set_eval_limit + * set_reset + * shutdown + * time + * uptime + </DL> + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/system/inherit_list ds2.0r27/lib/doc/efun/system/inherit_list *** ds1.1/lib/doc/efun/system/inherit_list Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/inherit_list Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + inherit_list - get a list of parents of an object + + string array inherit_list( object obj ); + + Returns an array of filenames of objects inherited by obj. + If COMPAT_32 was compiled in, this behaves like deep_inherit_list(), + otherwise it behaves like shallow_inherit_list(). + + See also: + deep_inherit_list, + shallow_inherit_list, + inherits + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/system/inherits ds2.0r27/lib/doc/efun/system/inherits *** ds1.1/lib/doc/efun/system/inherits Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/inherits Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + inherits - determine if an object inherits a given file + + int inherits( string file, object obj ); + + inherits() returns 0 if obj does not inherit file, 1 if it inherits the + most recent copy of file, and 2 if it inherits an old copy of file. + + See also: + deep_inherit_list, + inherit_list + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/system/localtime ds2.0r27/lib/doc/efun/system/localtime *** ds1.1/lib/doc/efun/system/localtime Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/localtime Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,38 ---- + localtime - convert to local time + + array localtime( int time ); + + localtime() converts a time value (as returned by time()) into an array + of values which represents the time locally. In the past time() was used + to get the time in GMT (UTC), and then local definitions were used to + determine the local offset from GMT. This roundabout approach is no + longer necessary. localtime() returns the seconds, minutes and hours, + the day, month and year, day of the week, day of the year, + the name of the local timezone and how far the MUD is from GMT. This + information is retrieved directly from the operating system and made + available to the driver without the use of MUD-specific configuration + files. + + localtime() returns an array containing the values specified above. + The index for each value is defined symbolically in localtime.h. The + following table summarizes the array returned by localtime(). + <pre> + int LT_SEC Seconds after the minute (0..59) + int LT_MIN Minutes after the hour (0..59) + int LT_HOUR Hour since midnight (0..23) + int LT_MDAY Day of the month (1..31) + int LT_MON Months since January (0..11) + int LT_YEAR Year (guarenteed to be >= 1900) + int LT_WDAY Days since Sunday (0..6) + int LT_YDAY Days since January 1 (0..365) + int LT_GMTOFF Seconds after GMT (UTC) + string LT_ZONE Timezone name + </pre> + + See also: + ctime, + time, + time_expression, + uptime + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/system/lpc_info ds2.0r27/lib/doc/efun/system/lpc_info *** ds1.1/lib/doc/efun/system/lpc_info Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/lpc_info Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,8 ---- + lpc_info - return information about LPC->C compiled objects + + string lpc_info(); + + lpc_info() returns a string describing which LPC->C programs are available, + which are loaded, and which are out of date with respect to their source. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/system/max_eval_cost ds2.0r27/lib/doc/efun/system/max_eval_cost *** ds1.1/lib/doc/efun/system/max_eval_cost Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/max_eval_cost Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + max_eval_cost - returns the maximum evaluation cost + + void max_eval_cost() + + max_eval_cost() returns the number of instructions that can be executed + before the driver decides it is in an infinite loop. + + See also: + set_eval_limit, + reset_eval_cost + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/system/memory_summary ds2.0r27/lib/doc/efun/system/memory_summary *** ds1.1/lib/doc/efun/system/memory_summary Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/memory_summary Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,24 ---- + memory_summary - return a summary of memory usage + + mapping memory_summary(); + + memory_summary() returns a mapping of the form: + + PRE( + ([ + program name : ([ + var name : mem usage, + ... + ]) + ... + ]) + ) + + the memory usage is the memory required to store the value divided by the + number of variables pointing to that particular value. [Due to sharing + of values, giving an exact number for the memory usage of any + value is impossible] + + This efun is only available if PACKAGE_CONTRIB is defined. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/system/named_livings ds2.0r27/lib/doc/efun/system/named_livings *** ds1.1/lib/doc/efun/system/named_livings Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/named_livings Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + named_livings - return all living objects with names + + mapping named_livings(); + + named_livings() returns all objects that have called both set_living_name() + and enable_commands(). It is significantly more efficient than livings(). + + named_livings() is available if PACKAGE_CONTRIB is defined, and NO_ADD_ACTION + is not. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/system/program_info ds2.0r27/lib/doc/efun/system/program_info *** ds1.1/lib/doc/efun/system/program_info Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/program_info Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + program_info - returns information about program memory usage + + string program_info(); + + string program_info(object ob); + + Returns a summary of the memory usage of the program for a given object. + If no program is specified, a summary of the memory usage of all loaded + programs is returned. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/system/reclaim_objects ds2.0r27/lib/doc/efun/system/reclaim_objects *** ds1.1/lib/doc/efun/system/reclaim_objects Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/reclaim_objects Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,16 ---- + reclaim_objects - reclaim any lingering objects + + int reclaim_objects(); + + Cycles through all objects that are loaded, and frees any lingering objects + that it can. This could result in a sizable amount of memory being freed up, + depending on how the mud is coded. Objects are typically left lingering + when a global variable in more than one object contains a pointer to it, + and the object gets destructed, but the values containing pointers to the + object are never accessed again. This efun returns the number of destructed + objects encountered in variables. + + See also: + destruct + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/system/replace_program ds2.0r27/lib/doc/efun/system/replace_program *** ds1.1/lib/doc/efun/system/replace_program Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/replace_program Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,18 ---- + replace_program - replaces the program in this_object() + + void replace_program( string str ); + + replace_program() replaces the program in this_object() with that of an + object it inherits. The string argument is the filename of the object + whose program is to be used. Once the replacement takes place, the current + object effectively becomes a clone of that other object, but with its + current filename and global variable values. The program is not actually + replaced until the current execution is completed. + + Note that one effect of this is that all functions defined in the object + no longer exist, being replaced by the functions in the inherited program, + so this routine should not be called if one of those functions might be + called later (and in particular, create() needs to exist if you intend to + clone from the object). + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/system/replaceable ds2.0r27/lib/doc/efun/system/replaceable *** ds1.1/lib/doc/efun/system/replaceable Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/replaceable Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,23 ---- + replaceable - determine whether any functions are defined in at this level + + int replaceable(object ob); + + int replaceable(object ob, string array fnames); + + In the second form, return 0 if the program for object ob defines any + functions explicitly, as opposed to simply inheriting. Function names + in the array fnames are ignored. If no such functions are defined, 1 + is returned. If the second argument is omitted, it defaults to + ({ "create" }). The purpose of this efun is to assist in making + automatic decisions on whether to call replace_program(). Note that + the default version ignores create(), so it is only safe to replace a + object for which replaceable() returns true if you never intend to + clone from that object. + + See also: + replace_program, + functions, + function_exists, + inherit_list + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/system/reset_eval_cost ds2.0r27/lib/doc/efun/system/reset_eval_cost *** ds1.1/lib/doc/efun/system/reset_eval_cost Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/reset_eval_cost Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,12 ---- + reset_eval_cost - resets the evaluation cost remaining + + void reset_eval_cost(); + + reset_eval_cost() resets the evaluation cost remaining to the maximum + evaluation cost. + + See also: + eval_cost, + set_eval_limit + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/system/set_eval_limit ds2.0r27/lib/doc/efun/system/set_eval_limit *** ds1.1/lib/doc/efun/system/set_eval_limit Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/set_eval_limit Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + set_eval_limit - set the maximum evaluation cost + + void set_eval_limit( int ); + + set_eval_limit(), with a nonzero argument, sets the maximum evaluation + cost that is allowed for any one thread before a runtime error occurs. + With a zero argument, it sets the current evaluation counter to zero, + and the maximum cost is returned. set_eval_limit(-1) returns the + remaining evaluation cost. + + See also: + eval_cost + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/system/set_reset ds2.0r27/lib/doc/efun/system/set_reset *** ds1.1/lib/doc/efun/system/set_reset Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/set_reset Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,18 ---- + set_reset - modify the time until reset on an object + + varargs void set_reset( object ob, int time ); + + This efun is only available if NO_RESETS is not compiled in. + + Sets the time until reset on 'ob' to 'time' seconds from now. If 'time' + is omitted, the driver's normal reset time setting formula is applied + to 'ob', that is, + <pre> + reset time = current_time + reset_time / 2 + random(reset_time / 2) + </pre> + + See also: + reset + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/system/shallow_inherit_list ds2.0r27/lib/doc/efun/system/shallow_inherit_list *** ds1.1/lib/doc/efun/system/shallow_inherit_list Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/shallow_inherit_list Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,15 ---- + shallow_inherit_list - get a list of parents of an object + + string array shallow_inherit_list( object obj ); + + Returns an array of filenames of objects inherited by obj. Only directly + inherited files are returned. E.g. if A inherits B which inherits C, + inherit_list(A) will return an array with B, but not C. + + See also: + deep_inherit_list, + inherit_list, + inherits + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/system/shutdown ds2.0r27/lib/doc/efun/system/shutdown *** ds1.1/lib/doc/efun/system/shutdown Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/shutdown Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,23 ---- + shutdown - shutdown the driver + + void shutdown( int how ); + + This function shuts down the driver in a controlled fashion (as opposed to + how a crash would shut it down). The 'how' argument specifes what integer + value that driver should pass to exit(). The convention is to pass 'how' + as -1 when the script that restarts the driver should die as well. Thus + a reboot command would use shutdown() while a halt command would use + shutdown(-1). The script must explicitly check the return value to see + if it is -1 if you wish to use this convention. Obviously, shutdown() + is a sensitive function and should be secured. As with exec(), the way + to make it secure is to add a simul_efun of the same name which does + the appropriate security checks. Be sure to set valid_override() up + (in master.c) to protect against efun::shutdown(). + + See also: + crash, + slow_shutdown, + valid_override + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere + diff -c -r --new-file ds1.1/lib/doc/efun/system/time ds2.0r27/lib/doc/efun/system/time *** ds1.1/lib/doc/efun/system/time Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/time Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,11 ---- + debug_message - send a message to the driver's stdout + + void debug_message(string); + + The string argument is printed on the driver's stdout, as well as being added + to the debug.log file. + + See also: + ctime + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/system/uptime ds2.0r27/lib/doc/efun/system/uptime *** ds1.1/lib/doc/efun/system/uptime Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/uptime Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + uptime - return the number of seconds elapsed since the last driver reboot + + int uptime(); + + This function returns the number of seconds since the last driver reboot. + + See also: + time, + ctime, + localtime, + time_expression + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/efun/system/variables ds2.0r27/lib/doc/efun/system/variables *** ds1.1/lib/doc/efun/system/variables Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/efun/system/variables Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,20 ---- + variables - list all the variables in a given object. + + string array variables(object, int default: 0); + + variables() can return two different things. If the second argument is + 0 (which it is by default) it will return an array containing the names + of all the variables in the object passed as the first argument. If the + second argument is non-zero, more information about each variable is + given. For a non-zero second argument, each array element contains + the following: + + ({ variable_name, variable_type }). + + Where variable_name is the name of the given variable, and variable_type + is the type of the variable, such as "string" or "private int" etc. + + This efun is only available if PACKAGE_CONTRIB is defined in the + options file. + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/faq/admin ds2.0r27/lib/doc/faq/admin *** ds1.1/lib/doc/faq/admin Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/faq/admin Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,778 ---- + Dead Souls Admin FAQ, v2 + + Written by Cratylus @ Frontiers, October 2005 + Updated January 2006 + + %^GREEN%^*** What's this FAQ about? ***%^RESET%^ + + The point of this document is to orient a new admin in + Dead Souls 2. Starting a MUD with a lib that is completely new to + you can be confusing and discouraging. Hopefully this FAQ will + make the experience less difficult. + + + %^GREEN%^*** How do I start?***%^RESET%^ + + Start by reading the Dead Souls FAQ for some background + on where this lib came from and what you can do with it. + + + %^GREEN%^*** What's the QCS?***%^RESET%^ + + Please see the QCS example page for an explanation of this + important Dead Souls system. + + + %^GREEN%^*** Is there a MUD somewhere running Dead Souls I can log into?***%^RESET%^ + + As a convenience to the curious, I have set up a "demo" mud + at dead-souls.net 6666 . To connect, either click on + this link with your browser, or open a terminal window + (or for windows users, Start -> Run ) and + type: telnet dead-souls.net 6666 + + When you log in, the system will read your playerfile for + a few seconds and then it will turn you into a creator. This + is so that you can examine code, try out the QCS, etc. + + Please note that in the regular, non-demo version of the + mud, people are NOT automatically given creator status. + + On the regular non-demo version of the mud, Only + the admin (basically, the first person to log on to the new mud) + gets automatic creatorship. Another difference is that the + demo mud is set to reboot every eight hours or so. The + default reboot interval on the regular version is weeks long. + + After logging in, you will be transported + to your workroom. Some useful commands: + + look + look at me + look at chest + open chest + look in chest + get tricorder from chest + read index in handbook + read chapter 1 in handbook + who + stat + wiz + create new npc generic + look at board + read 1 on board + home + + + %^GREEN%^*** I want to invite my friends to help me code. How do I + promote them to creator status?***%^RESET%^ + + As admin, you have access to the admintool + command. This opens a menu-driven admin system you + can use to manage some basic aspects of your new MUD. + + Everything on admintool can be done with + commands, system calls, or file editing, but until + you get the hang of all that stuff, admintool + is a convenient shortcut. + In this example, you would type: admintool , + then select option 3, then option l (that's a lowercase "L"). + + The oldfashioned way, if the new creator + were named dude, would be: encre dude + + I know. But people like menus, so I made it. + + + %^GREEN%^*** What about intermud? How do I talk on that?***%^RESET%^ + + The intermud3 (or i3) network is available + to you, and you are probably already connected to it. Type + mudlist to see a list of other muds on the network. + + By default, the "Dead Souls intermud channel" is + enabled for creators. Type: ds blah blah + and other Dead Souls muds on the i3 network will see + your message like this: + + You@YourMud <ds> blah blah + + To enable intergossip and intercre, read + /doc/README for instructions. + + Please note that intercre is where you ask coding + and technical questions only. Random chatting is not + tolerated on that channel. Newbie questions that are + Dead Souls specific or that obviously have answers in + Dead Souls documentation will meet a hostile reception on + intercre. + + Conversely, intergossip is mostly chat. Please + be warned that discussions on intergossip are usually + offensive, argumentative, and generally aggressive. + This hostility is especially sharp when you + are identified as a "newbie". You will almost certainly + be mocked and insulted no matter what you say, but + especially if your first messages betray you as + ignorant of intergossip standards and traditions. I + strongly recommend you lurk on this channel for a few + days before saying anything. Really, I recommend you + avoid it entirely. + + + %^GREEN%^*** I talk on intermud but nobody replies. What's up with that?***%^RESET%^ + + I3 uses a hub topology. All muds communicating on intermud + connect to the router to do so. If that router is down all + I3 communication stops, until it comes back up. + + There's also the possibility that nobody who wants to + chat is listening. + + + %^GREEN%^*** What's this about a manual on Frontiers?***%^RESET%^ + + It's no longer relevant. All the docs + we were making available on Frontiers are now included + in Dead Souls, starting from version 1.9r9. + + In your workroom is a chest. Open the + chest and the new Dead Souls Creators Manual is + inside. The text files are in /doc/manual . + + + %^GREEN%^*** How do I add limbs to a race?***%^RESET%^ + + Edit /secure/cfg/races/<race>, then remove the race from the + races daemon, then add re-add the race. If you want players + to be able to play as this race, make sure you add the + numeral 1 on the addrace command. For example: + + addrace jabberwock 1 + + + %^GREEN%^*** How do I make my friend an admin?***%^RESET%^ + + Use the groups menu in admintool, and select + "Modify a group". Select the ASSIST or SECURE group, + and enter the names of all the members it should have. If + I wanted to make xyzzy an assistant admin, I would edit the + ASSIST group and make the contents look like this: + + cratylus:xyzzy + + Xyzzy then needs to log out and log back in. + + Obviously, Xyzzy needs to be a creator for this to be of any use, + so I would have encre'd him first. + + + %^GREEN%^*** I don't like how the who command output looks! How can I change it?***%^RESET%^ + + Believe it or not, I actually get questions like this. I also + get stuff like "my workroom is broken! fix it!" + + If there is something broken about the lib itself, such as + an insta-death bug or a command that crashes the mud, I am + happy and eager to hear about it, so I can implement the fix + in the next lib release. + However, if the problem you're having is that the lib, + by design, behaves in a way not to your liking, this isn't something + I'm likely to "fix" for you. For example, if you want a "who" + command with a cooler look, that's up to you to make. You're + the one coding a mud, so you need to take it upon yourself to + understand the code and modify it to suit your tastes. + Similarly, "orcs are too strong!" or "advancing levels + should increase your eyesight" are issues you need to deal + with on your own, using the coding skills learned from reading the + Creators Manual. + + + %^GREEN%^*** All I did was change one thing in a file, and now it won't update. Help!***%^RESET%^ + + You should make it a habit to make backup copies of files + before editing them. That way, if you screw up the code, you can + just copy the backup to the original filename. + + A convenient way to do this is the bk command. See + the debugging page for an example of its use. + + If you are using Windows, you need to be aware of the + linefeed problem. unix text files and DOS text files have different + formatting. If you edit files in Notepad, then try to update them, + you may find that the file no longer updates, no matter what + you do. The difference is usually invisible to you, so you can't + tell why a file that looks exactly the same as before now won't + work. + + Dead Souls expects unix-formatted text, and if you feed it + something else, the results aren't likely to be to your + satisfaction. Make sure you use an editor that respects unix + text. In Windows 2000, WordPad seems to do a reasonable job of not + completely screwing things. It does, however, add carriage + returns to your lines, so when you look at them in ed, you'll + see a bunch of "^M"'s all over the place. + + If you still have trouble, take a look at the debugging page. + + + The mud editor is confusing the heck out of me. It's too hard to use. + + Check out the MUD Editor tutorial. It should ease the pain a little. + + + %^GREEN%^Can you please make the FAQ easier to read? It's too long and complicated.***%^RESET%^ + + I'm a lib coder, not a web designer. Cut me slack. Or, edit it + for me and show me how it's done. + + + %^GREEN%^*** How can I change the colors of the channel messages?***%^RESET%^ + + The colors are specified in /secure/daemon/chat.c + + + %^GREEN%^*** How do I know what other muds use Dead Souls?***%^RESET%^ + + + Go to the arch room. Type: arch + + Then type: read screen + + This shows a list of muds that used Dead Souls and + joined intermud at some point. To see a list that + also includes obvious test muds, type: read printout + + + %^GREEN%^*** I was hanging out in the Arch room and the loudspeaker went off. WTF?***%^RESET%^ + + Your mud receives all sorts of network requests from the + intermud network, such are remote who (asking who is logged on), + remote finger (info on users), locate (trying to find a user + somewhere on i3), etc. Whenever your mud receives such a request, + it is announced in the Arch room. Note that these are normal, + and do not represent an attempt to undermine your security. + + + %^GREEN%^*** I want to test the intermud channel but I don't want to spam the ds line.***%^RESET%^ + + Type: call me->AddChannel("ds_test") + Then type: ds_test test + + The ds_test channel is specifically for communication + testing so that ds can remain spam free. + + + %^GREEN%^*** The web server and FTP server don't work***%^RESET%^ + + To enable them at mud boot time, uncomment the "inet" line in + /secure/cfg/preload.cfg + + To enable it temporarily, type: update /secure/daemon/inet + + These server do not use the standard ports. The internet standard + http port is 80 and for ftp it is 21. Your mud ftp and web servers + do not use these. + Instead, the network port for your web server is 5 less + than your mud's port, and the ftp port is 1 less. + This means that if your mud is reached by telnetting + to port 6666, your ftp server will be at 6665 and your web server + will be at 6661. + + Please note that the web and ftp server are not supported. They work, + but whatever security risk they pose is entirely on you. + + + %^GREEN%^*** I tried to log in to the FTP server but I can't!***%^RESET%^ + + Make sure you use your mud name and mud password, not the + username and password of the computer you are on. + + + %^GREEN%^*** I can't do anything with FTP. It just hangs there.***%^RESET%^ + + FTP is a funny sort of protocol. If you don't have a direct + connection to an FTP server (for example, you are behind a + firewall), you have to use PASV (or passive) mode. Unfortunately, + at this time, PASV is not implemented in the mud FTP server. + + + %^GREEN%^*** The web server gives me a 404 but I know the directory is there.***%^RESET%^ + + Like the FTP server, the web server is a very simple program. + It does not do directory listings at all. If you request + a directory, and it can't find an "index.html" file, it + just errors out. + + Let me make this point one final, excruciatingly clear time: + If you need a webserver, use apache. The mud www server is available + as a convenience, not as a production-quality standards-compliant + intarweb server. + + + %^GREEN%^*** Where can I get a Dead Souls mud hosted?***%^RESET%^ + + That's a heck of a good question. There are many mud hosting services + out there. I hear good things about Kyndig, but that isn't specific + to Dead Souls. A good host will have a high level of service, shell + and file transfer access, etc, for which you obviously will need + to pay money. There ain't no such thing as a free lunch. + + + %^GREEN%^*** I moved a command from one directory to another. How do I get the new location recognized?***%^RESET%^ + + First, run update on the command in question. + then: + If it's not a verb: update /daemon/command + If it's a verb: update /daemon/verbs + + + %^GREEN%^*** The mudtime is all wrong!***%^RESET%^ + + The mudtime command tells you what time it is in the game, not what time + it is in the real world. + + + %^GREEN%^*** The time of day is all wrong!***%^RESET%^ + + If you used admintool to change your timezone and the time of day is still + wrong, you may be using an OS with timekeeping that Dead Souls doesn't + understand. If this is so, figure out how many hours off you are, and + enter that value into the EXTRA_TIME_OFFSET parameter in /secure/include/config.h + + + %^GREEN%^*** Hey this is supposed to run on Windows but it doesn't!***%^RESET%^ + + There are three main causes for this: + + 1) You are using Windows 98, Me, or below. That's unsupported and won't work. + + 2) You edited secure/cfg/mudos.cfg with a Windows-style editor and now the driver can't read it. + Copy the original mudos.cfg over the hosed one. If you need to change the mud's name, + don't edit mudos.cfg. Use the admintool command. + + 3) You are trying to run Dead Souls in a directory other than c:\ds + + + %^GREEN%^*** What happened to the roommaker and thingmaker?***%^RESET%^ + + They produced code that was often incompatible with QCS. They are no + longer supported. + + + %^GREEN%^*** I keep getting 'Connection to address server (localhost 9999) refused.' ***%^RESET%^ + + This is a harmless error. Dead Souls uses a program called addr_server to + try to resolve hostnames. However, hostname resolution is not important + to running the mud, so it's not automatically configured. If you run + addr_server with a specific port as an argument, and edit mudos.cfg to + point to that port for the addr_server, then reboot the mud, then you + will probably have hostname resolution in your mud. + + However, not all OS'es handle name resolution the same, so this may not + work, even if you do everything exactly right. Either way, it doesn't + affect the mud. + + + %^GREEN%^*** Every now and then I use a QCS command and it fails, then I try again later and it works. WTF?***%^RESET%^ + + This is a rather frustrating issue, because it happens very rarely + and when it does, the error data is limited. Please email me a log + of what happened so I can analyze it. + + + %^GREEN%^*** When I log in, everything is screwed up, and I can't do anything!***%^RESET%^ + + This happens sometimes when you log out while carrying an object + with broken code. If for example, you are wearing a vest, and then you + edit the code for it, but it doesn't work anymore, then you log out, + what happens is the next time you log in the mud will try to restore an + item in your inventory that throws an error, and your login + gets stuck halfway. + + If you find that when you log in things are all screwed up for + you, use the rescue login feature. For me, this means I would + login as cratylus_rescue instead of cratylus. My inventory + will get wiped before my playerfile is loaded, and I'll + be able to log in with no problems. + + + %^GREEN%^*** Can I charge players a fee for playing on my mud?***%^RESET%^ + + NO. + + Dead Souls uses MudOS, and MudOS has a license that specifically + and strictly forbids its use in a commercial way. I don't care how + you use the lib, but if you use it with MudOS, you need to comply + with MudOS licensing. If you were to port Dead Souls to some other + driver that allows commercial use, then you'd be all set. + + %^GREEN%^*** Can people donate money to me for the mud?***%^RESET%^ + + Yes. + + So long as there is no quid-pro-quo, or anything + about the transaction that is legally regarded as "commercial", + receiving money from people for the purpose of running the + mud is ok. However, I am not a lawyer, so read the MudOS + license yourself. + + + %^GREEN%^*** I found a bug. For real. Can you please fix it?***%^RESET%^ + + Email me: <put my name here>@comcast.net + + Please include a detailed description of the bug, and the exact + error text and commands that produced it. A log file or + screencap would be helpful. + + + %^GREEN%^*** How are files organized in Dead Souls?***%^RESET%^ + + cd / and ls to view the top level directory. The + list may be largely meaningless to you, so let's review it here: + + cfg/ + + General configuration files for timezone and such. + + cmds/ + + Main location of commands that don't require special access + privileges. Commands are different from verbs in that they tend + not to manipulate your environment, but rather deal with + the player's relationship to the system and/or files. + + + daemon/ + + Daemons are files that provide access to data files in an + organized way. For example, adding an occupational class + (like, say, assassin) to the game needs to be done in a + precise way in order for it not to break things. By sending + the data to the daemon first, you can be sure that the + new system configuration is entered properly. Daemons also + provide a means to access data, like "how much is silver + worth compared to gold", that is uniform across the mud, and + prevents accidental overwrites of data files by multiple + editors. + + + doc/ + + General documentation. + + + domains/ + + This is where MUD game areas go when they are complete + and ready for general play by the public. Once here, only + admins have write access to the files. + + + ftp/ + + The base for the MUD ftpd. Using the ftpd is probably dangerous + in terms of your system security, and I discourage it, but if + you are determined to have mud ftp access for your creators, + this is one way. See /secure/lib/net for the actual server. It + may or may not work. I won't support it. + + + include/ + + Include files provide a set of constants for your files. For + example, if you include <damage_types.h>, you can specify in + the code for your chainmail that it protects against + the damage type "BLADE" at a certain level. + + + lib/ + + This is the heart of the Dead Souls lib. This is the location + of the files that your objects, be they swords, shoes, or + handguns, will use as their configuration base. + + + log/ + + Log files. + + + news/ + + Announcements are made here. For example, in /news/creator + you can post a notice that you have added a teleportation + spell, and when your creators log on, they will see the message. + + + obj/ + + Contains some important templates, especially some for the QCS. + + open/ + + Legacy directory. Kept for compatibility. Historically this + directory has served as a place where creators can put code + for others to freely modify. + + + realms/ + + This is where creator home directories are. + + + save/ + + Files that describe properties of the MUD's systems live + here. The number of limbs that a bat has, for example, + is in races.o. In classes.o you'll find the skill ranges + for fighters. Do not edit these files. They must be + modified by daemons only, or you risk corrupting them. + + + secure/ + + This directory will be described in a separate section below. + + + shadows/ + + Shadows are a controversial feature of LPC. This directory + is designed for shadow objects, but they should be very + rarely, if ever used. Basically shadow objects are objects + that attach themselves to another object, intercepting + function calls. For obvious reasons this is a security + risk, so unless you really really know what you're doing, + avoid them. + + + spells/ + + Pretty self explanatory. The spells daemon looks for spells here. + + + tmp/ + + A directory anyone can write to. Generally for swapping + data between objects, systems, or people. + + + verbs/ + + Another controversial topic. Verbs are a kind of command. For + example, go and sit and open are verbs. Specifically, verbs + are commands that interact with the user's environment. The + idea is that throw my first red rock at the green goblin + should work, and should work the same everywhere on the + MUD. Verbs are a source of debate among some people, because + to folks accustomed to add_action commands, verbs seem + excessively complex. + + www/ + + Like the ftp directory, but for the MUD webserver. + + + Ok now let's take a quick look at the /secure directory: ls /secure + As you can see, /secure seems to have many of the same directories + that the root filesystem has. + The reason a /secure directory is needed is that + there are files that should not be readable by everyone, and + there are files that must be writable only by a few. The MUD security + system uses the /secure directory as a means to control access to + such files. + For example, the average creator has no business + accessing the player data files of other creators or players. Therefore + /secure/save/creators and /secure/save/players is offlimits to them. + + A directory without a counterpart in / is /secure/sefun. This + is where simulated external functions reside. + + + %^GREEN%^*** What are sefuns and efuns?***%^RESET%^ + + First let me explain that the driver has built-in + functions that are available to the mud. For example, + type eval return find_player("cratylus") , but replace my name + with yours. Your player object pointer will be found and returned + to you (more or less. strictly speaking it's more complicated). + The driver provides this function. Because it is "external" + to the mudlib, that is, it's in the driver and not the lib, + it is called an external function, or more commonly, "efun". The + idea is that certain actions you ask the mud to perform are + so common that they are made available MUD-wide. + + Efuns are ridiculously useful and powerful, and because + they are in the driver as compiled code, very fast. A near-complete + set of efun documentation is available in /doc/efun. + + However, the driver does not contain every possible + MUD-wide function you might want. For example, there is a + tell_object() efun, which lets you send a message to an object + such as a player. The syntax is something like this: + + tell_object(find_player("cratylus"),"Hi."); + + Which doesn't look like much, but believe me, this + kind of stuff adds up. I wanted to make this simpler, so I + used what is called a sefun, or a simulated efun. It is + a function that is available lib-wide, but it isn't in + the driver. Instead it is provided by the lib itself (the + master daemon, specifically). By adding the appropriate code + in /secure/sefun/ I have now made available a tell_player() sefun, + which works like this: + + tell_player("cratylus","Hi.") + + This simplification of code will become more obviously + useful to you as you get more coding under your belt. Most + sefuns are documented in /doc/sefun. + + + + %^GREEN%^*** Whew! Ok now I know where stuff is. What's next?***%^RESET%^ + + You probably want to examine how objects are written. + Type goto /domains/town/room/road and wander around town + a bit. If you want to see the code for something, for example, + the beggar, about beggar should do it, provided the beggar is + in the room. + + To see the filenames of the objects around you, + type scan here, or scan me to scan your own inventory. + + If you've never coded before, this is the hard part. + To understand what you're looking at when you run commands like + more /domains/town/weap/orcslayer.c you need to get comfortable + with LPC. + The brute force way of doing this is copying stuff + and then changing the descriptions, thus making new stuff. + This will work, but you'll waste time looking for examples of + exactly what you want to do..and you may not find them. + Instead, learning LPC will let you create whatever + you want, without relying on templates. + + This means that now you must read the LPC Basic + manual, then the LPC Intermediate manual. As admin, your + creators will expect you to know what's in there. + + On your person or in the chest in your workroom is + the Creators Manual. Read both the Players Handbook and + the Creators Manual from cover to cover. + + + %^GREEN%^*** Oh, man, you're kidding! Those are, like, books! Can't I + just start making stuff?***%^RESET%^ + + Well...ok. But you need to go through the docs + soon, ok? In the meantime, read the QCS chapters in the + Creators Manual to get you quick-started in the creation + process. Remember you need to be holding your Creator + Staff in order to access the QCS commands. + + Other useful tools in your chest are a remote + control and a medical tricorder. + + + %^GREEN%^*** Everything is su-u-u-u-p-e-e-r-r-r s-s-l-o-o-o-o-w-w-w***%^RESET%^ + + First, make sure you are using the latest available version of + Dead Souls (check here or here). Older versions of Dead Souls + are known to have nasty memory leaks. + + Next, see if you have runaway objects. An object can be coded + to do really unpleasant stuff like replicate itself over and + over until it brings the mud to its knees. Find out how many + objects are loaded by typing: eval return sizeof(objects()) + + If the count is in the thousands, and only a few people are + logged on, you've got a runaway. Most often this involves + NPC's doing stuff you didn't expect. Destroy all loaded npc's + with the following command: + eval return filter(objects(), (: inherits("/lib/npc",$1) :))->eventDestruct() + + If the lag clears up, you found the culprit. If not, see if + the callouts list is clogged with the command: callouts + + If all else fails, reboot the mud and ask for help on the ds line. + + Please note that the rage virus (especially if unleashed + in the menagerie) is notorious for redlining the mud. Having + hundreds of NPC's all engaging in simultaneous combat + while infecting each other with a rapidly spreading hostility + virus can be expected to impact overall performance. So please try + to avoid the rage virus unless you are specifically stress testing + your system. + + + %^GREEN%^*** Is Dead Souls secure?***%^RESET%^ + + The short answer is no, nothing I know of is "secure" in the + sense that you don't need to continually pay attention to it. If the + question is "Is Dead Souls particularly unsafe to run?" then the + answer is no. Just like any other Internet program you use, Dead Souls + is not an obvious security risk, so long as it is not used carelessly. + And, obviously, games of any kind, including Dead Souls, should never + be installed on any mission-critical, national security, public + safety, or health care server. + + Dead Souls security involves two separate spheres: + + 1) The binary executable and the system that runs it. + + 2) The mudlib and the code that you use and create. + + The first sphere is probably most important. Presumably + you plan to run a mud on a computer that does other things too, + and you want to keep those things separate from your mud. The + most important thing to do is to avoid running Dead Souls as a + privileged user. In the case of Windows, this means that the + program should not be run by Administrator or anyone in the + Administrator group. + For unix users, this means that the driver should not run + under uid 0 (root). + + The reason for this precaution is that if some genius + hacker manages to exploit some unknown weakness in the program, + it is better that the process they hack doesn't have full admin + privileges to the box. + This caution has little to do with Dead Souls specifically. + It is a warning I'd give to anyone planning to run any kind of network + server. You should take your own security seriously, and + if you do not understand your own security situation, you need to take + a step back and ask yourself if running a mud at all is a good idea. + + Sphere 2 is lib security. In older muds, file and directory + privileges were handled by attributes on the files. If a file's + user id (UID) matched a user's UID, then that user had full access + to it. Such systems often had complex systems that evaluated + effective UID (EUID) based on the file's attributes, its parent + directory, the user's ID, possibly group id, etc. This is an + entirely valid security model, but because of its complexity, + it tended to be exploited easily and often. If you don't + stay 100% on top of such a system (just like any OS), there's + no way to be sure you won't rooted. + + With stack security, privilege management is much, much + easier. A file's privilege is based solely on its location. If + a user doesn't have read access to /foo/bar/ then she can't read + or modify /foo/bar/file.c. If someone with privs to that location + copies the file to somewhere else, then the privs of that new location + are in force on the file. + The "stack" part of stack security comes from the mud + evaluating the privileges of all the objects involved in the + access request. If you're unprivileged and you manage to get a + privileged object to make the access request for you, the access + will fail, because you are unprivileged, and you are still part + of the function call stack (i.e., the list of instructions that + form a chain between the command and the intended event). + + Granular (more detailed) modification of user privileges + can be done by changing files in /secure/cfg to grant + users and groups specific privileges. + + - Cratylus + + Dead Souls Homepage + diff -c -r --new-file ds1.1/lib/doc/faq/ed ds2.0r27/lib/doc/faq/ed *** ds1.1/lib/doc/faq/ed Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/faq/ed Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,518 ---- + The ed Editor + + + This has always been the aspect of coding that new + creators have most trouble with. It's what discourages most + people from creating lots of stuff, in fact. + + With Dead Souls, you can get away with avoiding ed + most of the time, by using the room maker and the thing maker. + + But to add special functions to your code, like + magic items, smart NPC's (aka mobs), traps, hidden objects, + etc, you need to use ed, if you're going to be editing inside + the mud. + + ed is a simple editing program. It is designed to + work on a line-by-line basis, so it is called a "line editor". + + Let's start by looking at, and editing, a small file. + We've coded a sword, and we want to change its description + from "short sword" to "plain sword": + + + + > %^GREEN%^cd /realms/cratylus/area/weap%^RESET%^ I changed my working directory to my area weapons dir + /realms/cratylus/area/weap: + > %^GREEN%^ls%^RESET%^ I listed the contents of that dir: + /realms/cratylus/area/weap/: + 1 dagger.c 1 nco_sword.c~ 1 std_sword.c~ + 1 gsword.c 1 sharpsword.c 1 sword.c + 001 gsword.c~ 1 staff.c + 1 nco_sword.c 1 std_sword.c + + + > %^GREEN%^ed sword.c%^RESET%^ I ran the ed command on the file sword.c. + /realms/cratylus/area/weap/sword.c, 641 bytes + :%^GREEN%^n%^RESET%^ This makes the editor display line numbers next to the lines. + number on, list off + :%^GREEN%^1z%^RESET%^ This lists about 20 lines of text + 1 /* /domains/Examples/weapon/sword.c + 2 * from the Nightmare IV LPC Library + 3 * a simple sword example, nothing fancy + 4 * created by Descartes of Borg 950402 + 5 */ + 6 + 7 #include <lib.h> + 8 #include <damage_types.h> + 9 #include <vendor_types.h> + 10 + 11 inherit LIB_ITEM; + 12 + 13 static void create() { + 14 item::create(); + 15 SetKeyName("short sword"); + 16 SetId( ({ "sword", "short sword" }) ); + 17 SetAdjectives( ({ "short" }) ); + 18 SetShort("a short sword"); + 19 SetLong("A cheap and rather dull short sword."); + 20 SetMass(150); + 21 SetDollarCost(50); + 22 SetVendorType(VT_WEAPON); + :%^GREEN%^z%^RESET%^ + 22 SetVendorType(VT_WEAPON); + 23 SetClass(20); + 24 SetDamageType(BLADE); + 25 SetWeaponType("blade"); + 26 } + :%^GREEN%^15%^RESET%^ I displayed line 15 + 15 SetKeyName("short sword"); + :%^GREEN%^15c%^RESET%^ I used 'c' to replace line 15 + 15. * %^GREEN%^SetKeyName("plain sword");%^RESET%^ I entered my replacement text + 16. * %^GREEN%^.%^RESET%^ I entered a single dot on a blank line + : + 16 SetId( ({ "sword", "short sword" }) ); + :%^GREEN%^1z%^RESET%^ I listed about 20 lines, starting from line 1 + 1 /* /domains/Examples/weapon/sword.c + 2 * from the Nightmare IV LPC Library + 3 * a simple sword example, nothing fancy + 4 * created by Descartes of Borg 950402 + 5 */ + 6 + 7 #include <lib.h> + 8 #include <damage_types.h> + 9 #include <vendor_types.h> + 10 + 11 inherit LIB_ITEM; + 12 + 13 static void create() { + 14 item::create(); + 15 SetKeyName("plain sword"); + 16 SetId( ({ "sword", "short sword" }) ); + 17 SetAdjectives( ({ "short" }) ); + 18 SetShort("a short sword"); + 19 SetLong("A cheap and rather dull short sword."); + 20 SetMass(150); + 21 SetDollarCost(50); + 22 SetVendorType(VT_WEAPON); + :%^GREEN%^18%^RESET%^ I displayed line 18 + 18 SetShort("a short sword"); + :%^GREEN%^18c%^RESET%^ I started the replacement of line 18 + 18. * SetShort("a plain sword"); I entered my replacement text + 19. * . I entered a single dot on a blank line + :%^GREEN%^1z%^RESET%^ I displayed about 20 lines starting from line 1 + 1 /* /domains/Examples/weapon/sword.c + 2 * from the Nightmare IV LPC Library + 3 * a simple sword example, nothing fancy + 4 * created by Descartes of Borg 950402 + 5 */ + 6 + 7 #include <lib.h> + 8 #include <damage_types.h> + 9 #include <vendor_types.h> + 10 + 11 inherit LIB_ITEM; + 12 + 13 static void create() { + 14 item::create(); + 15 SetKeyName("plain sword"); + 16 SetId( ({ "sword", "short sword" }) ); + 17 SetAdjectives( ({ "short" }) ); + 18 SetShort("a plain sword"); + 19 SetLong("A cheap and rather dull short sword."); + 20 SetMass(150); + 21 SetDollarCost(50); + 22 SetVendorType(VT_WEAPON); + :%^GREEN%^x%^RESET%^ I saved and exited + "/realms/cratylus/area/weap/sword.c" 26 lines 633 bytes + Exit from ed. + > %^GREEN%^update sword%^RESET%^ I loaded the file into memory + /realms/cratylus/area/weap/sword: Ok + + + + Let's take this step by step: + + 1) I changed my working directory to my area weapons dir: %^GREEN%^cd /realms/cratylus/area/weap%^RESET%^ + + 2) I listed the contents of that dir: %^GREEN%^ls%^RESET%^ + + 3) I ran the ed command on the file sword.c: %^GREEN%^ed sword.c%^RESET%^ + + 4) Within the editor, I issued the '%^GREEN%^n%^RESET%^' command. This makes the editor + display line numbers next to the lines. + + 5) Within the editor, I issued the '%^GREEN%^1z%^RESET%^' command. What '%^GREEN%^z%^RESET%^' does is display + about 20 lines of the file (the exact number depends on your screen + settings. In my case it's 22). If you happen to be looking at line 1, it + will display lines 1 through to about 20. If you happen to be looking + at line 40, it will display from line 40 to about 60. + If you want to start looking at lines starting at line 15, you + can issue the '%^GREEN%^15z%^RESET%^' command, which basically means "display about 20 + lines starting at line 15". + In this case, I wanted to start from the beginning of the file, + so I issued '%^GREEN%^1z%^RESET%^'. + + 6) '%^GREEN%^1z%^RESET%^' stopped listing the file at line 22, so I entered '%^GREEN%^z%^RESET%^' again to + list the rest. + + 7) Since I want to change "short sword" to "plain sword", I examined each + line to find the word "short". I noticed that line 15 has "short" in it, + so to get a look at that line alone, I entered '%^GREEN%^15%^RESET%^'. + + 8) Now that I'm sure line 15 needs to change, I issue the '%^GREEN%^15c%^RESET%^' command. + '%^GREEN%^c%^RESET%^' indicates that I want to change a line. '%^GREEN%^15c%^RESET%^' means "delete whatever + was in line 15, and replace it with what I am about to type". + + 9) You can see that my editor prompt changed from ":" to "*". What this + means is that I am now in "input mode". Whatever I type now will be + added to the file. Since my last command in "command mode" was '%^GREEN%^15c%^RESET%^', + I am now replacing that line with what I want the line to contain: + %^GREEN%^SetKeyName("plain sword");%^RESET%^ + + 10) Ok, I replaced the line, but I'm still in input mode. To go back to + command mode, I type a single period and enter, like this: + %^GREEN%^.%^RESET%^ + + 11) I'm back in command mode now. When I list the file contents with + '%^GREEN%^1z%^RESET%^' I can see that line 15 now says what I wanted. + + 12) Now I see another line that needs changing, so I enter '18' to + get a closer look. + + 13) Sure enough, 18 needs to change, so I issue '%^GREEN%^18c%^RESET%^'. + + 14) Like I did for line 15, I enter what the line should be. + + 15) To return to command mode, I enter a single period on a blank line. + + 16) I list the file contents, and see that my change was successful. + + 17) I'm finished making my changes, so I issue the '%^GREEN%^x%^RESET%^' command. '%^GREEN%^x%^RESET%^' + means "save the changes I have made, and exit the editor". + + 18) I am now at my regular command prompt. To load my changes to this + file, I type '%^GREEN%^update sword%^RESET%^'. + + + Editor basics, part 2 + + + In the last section you saw what a simple line + replacement looks like in ed. Next we'll talk about some common + ed actions. + + ADDING STUFF: + + Suppose I want to specify that this sword requires only + one hand to wield it: + + + > %^GREEN%^ed sword.c%^RESET%^ started the editor + /realms/cratylus/area/weap/sword.c, 633 bytes + :%^GREEN%^n%^RESET%^ enabled line number printing + number on, list off + :%^GREEN%^15,22%^RESET%^ listed lines 15 to 22 + 15 SetKeyName("plain sword"); + 16 SetId( ({ "sword", "short sword" }) ); + 17 SetAdjectives( ({ "short" }) ); + 18 SetShort("a plain sword"); + 19 SetLong("A cheap and rather dull short sword."); + 20 SetMass(150); + 21 SetDollarCost(50); + 22 SetVendorType(VT_WEAPON); + :%^GREEN%^20a%^RESET%^ appended to the file after line 20 + 21. * %^GREEN%^SetHands(1);%^RESET%^ entered my added text + 22. * %^GREEN%^.%^RESET%^ single dot on a blank line to exit input mode + :%^GREEN%^18,22%^RESET%^ displayed line 18 through 22 + 18 SetShort("a plain sword"); + 19 SetLong("A cheap and rather dull short sword."); + 20 SetMass(150); + 21 SetHands(1); + 22 SetDollarCost(50); + :%^GREEN%^x%^RESET%^ exited editor and saved + "/realms/cratylus/area/weap/sword.c" 27 lines 646 bytes + Exit from ed. + + + + Here you can see that instead of '%^GREEN%^c%^RESET%^', which replaces, I + used '%^GREEN%^a%^RESET%^', which adds. I decided my new line would go after line + 20, so I issued the command '%^GREEN%^20a%^RESET%^'. Once I was done, I typed + a single dot on a blank line to exit "input mode". You'll notice + I didn't use the '%^GREEN%^z%^RESET%^' command. Instead, since I knew where my + changes would go, I decided to list lines 18 through 22 with + the command '%^GREEN%^18,22%^RESET%^'. I then issued the '%^GREEN%^x%^RESET%^' command to save my + changes and exit the editor. + If had I wanted my addition to go in front of line 20, + I could have used the '%^GREEN%^20i%^RESET%^' command. + + DELETING LINES + + Suppose I'm tired of seeing header lines that no + longer apply to this file. We can delete a single line, or + a range of lines, with the '%^GREEN%^d%^RESET%^' commmand: + + > %^GREEN%^ed sword.c%^RESET%^ + + /realms/cratylus/area/weap/sword.c, 646 bytes + :%^GREEN%^n%^RESET%^ enabled line number printing + number on, list off + :%^GREEN%^1,10%^RESET%^ listed lines 1 to 10 + 1 /* /domains/Examples/weapon/sword.c + 2 * from the Nightmare IV LPC Library + 3 * a simple sword example, nothing fancy + 4 * created by Descartes of Borg 950402 + 5 */ + 6 + 7 #include <lib.h> + 8 #include <damage_types.h> + 9 #include <vendor_types.h> + 10 + :%^GREEN%^1,5d%^RESET%^ deleted lines 1 to 5 + :%^GREEN%^1,5%^RESET%^ listed (the new) lines 1 to 5 + 1 + 2 #include <lib.h> + 3 #include <damage_types.h> + 4 #include <vendor_types.h> + 5 + :%^GREEN%^1d%^RESET%^ deleted blank line 1 + :%^GREEN%^1z%^RESET%^ displayed the file starting at line 1 + 1 #include <lib.h> + 2 #include <damage_types.h> + 3 #include <vendor_types.h> + 4 + 5 inherit LIB_ITEM; + 6 + 7 static void create() { + 8 item::create(); + 9 SetKeyName("plain sword"); + 10 SetId( ({ "sword", "short sword" }) ); + 11 SetAdjectives( ({ "short" }) ); + 12 SetShort("a plain sword"); + 13 SetLong("A cheap and rather dull short sword."); + 14 SetMass(150); + 15 SetHands(1); + 16 SetDollarCost(50); + 17 SetVendorType(VT_WEAPON); + 18 SetClass(20); + 19 SetDamageType(BLADE); + 20 SetWeaponType("blade"); + 21 } + :%^GREEN%^x%^RESET%^ exited and saved + "/realms/cratylus/area/weap/sword.c" 21 lines 476 bytes + Exit from ed. + + + + First I deleted lines 1 through 5 with the command '%^GREEN%^1,5d%^RESET%^'. + Then, for good measure, I removed the remaining blank line '%^GREEN%^1d%^RESET%^'. + Voila. Cleaner code. + + REPLACING STRINGS + + Well now I want to replace all instances of "short" with + "plain", and I don't feel like editing each matching line + manually. I can do a search and replace. First I will list which + lines need to change, then I will change them: + + > %^GREEN%^ed sword.c%^RESET%^ + + /realms/cratylus/area/weap/sword.c, 476 bytes + :%^GREEN%^n%^RESET%^ enabled line number printing + number on, list off + :%^GREEN%^g/short/p%^RESET%^ searched for and displayed lines containing "short" + 10 SetId( ({ "sword", "short sword" }) ); + 11 SetAdjectives( ({ "short" }) ); + 13 SetLong("A cheap and rather dull short sword."); + :%^GREEN%^g/short/s/short/plain %^RESET%^ searched for "short" and replaced with "plain" + :%^GREEN%^g/short/p%^RESET%^ searched for "short" again but found none + :%^GREEN%^1z%^RESET%^ listed file from line 1 + 1 #include <lib.h> + 2 #include <damage_types.h> + 3 #include <vendor_types.h> + 4 + 5 inherit LIB_ITEM; + 6 + 7 static void create() { + 8 item::create(); + 9 SetKeyName("plain sword"); + 10 SetId( ({ "sword", "plain sword" }) ); + 11 SetAdjectives( ({ "plain" }) ); + 12 SetShort("a plain sword"); + 13 SetLong("A cheap and rather dull plain sword."); + 14 SetMass(150); + 15 SetHands(1); + 16 SetDollarCost(50); + 17 SetVendorType(VT_WEAPON); + 18 SetClass(20); + 19 SetDamageType(BLADE); + 20 SetWeaponType("blade"); + 21 } + :%^GREEN%^1%^RESET%^ moved to line 1 + 1 #include <lib.h> + :%^GREEN%^I%^RESET%^ ran automatic indentation + Indenting entire code... + Indentation complete. + :%^GREEN%^1z%^RESET%^ listed file from line 1 + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + + static void create() { + item::create(); + SetKeyName("plain sword"); + SetId( ({ "sword", "plain sword" }) ); + SetAdjectives( ({ "plain" }) ); + SetShort("a plain sword"); + SetLong("A cheap and rather dull plain sword."); + SetMass(150); + SetHands(1); + SetDollarCost(50); + SetVendorType(VT_WEAPON); + SetClass(20); + SetDamageType(BLADE); + SetWeaponType("blade"); + } + :%^GREEN%^x%^RESET%^ exited and saved + "/realms/cratylus/area/weap/sword.c" 21 lines 488 bytes + Exit from ed. + + + + The command %^GREEN%^g/short/p%^RESET%^ showed me all the lines + that contained the substring "short". Then I ran the global + search and replace command to substitute "plain" for "short", + :%^GREEN%^g/short/s/short/plain%^RESET%^ + Then I searched again for the string "short" and + nothing came up, because it had been replaced. + + Finally I went to line number 1 and issued the 'I' + command. This auto-indents the code, making it neater and + easier to read. + + + Editor basics, part 3 + + + Now let's look at some common problems: + + + 1) %^CYAN%^Accidental deletion%^RESET%^ + + + If you type %^GREEN%^1,20d%^RESET%^ when you meant to type %^GREEN%^1,2d%^RESET%^ you will end + up with a file 18 lines shorter than you intended. ed does not + have an "undo" command, so those lines will never come back. + However, if you quit the editor *without saving*, then that + deletion will not be committed to the file. You can issue the '%^GREEN%^Q%^RESET%^' + command: + + :%^GREEN%^Q%^RESET%^ + + To force quit without saving. Of course, if those lines + weren't already in the file, this won't help much. + + + 2) %^CYAN%^Can't leave the editor%^RESET%^ + + + You try to write and exit, but get this: + + :%^GREEN%^x%^RESET%^ + File command failed. + + What this means is that for some reason, you can't write + to the file, so you don't exit the editor. What this usually means is that + you tried to edit a file that does not belong to you. Since you do not + have permission to modify the file, ed refuses to commit your changes. + + There are two ways around this. If you don't really care + whether your changes are saved or not, you can just force quit the + editor with '%^GREEN%^Q%^RESET%^': + + :%^GREEN%^Q%^RESET%^ + Exit from ed. + + Your changes will be lost, but you'll be out of the editor. + + If you really want to save this file, you'll have to save it + somewhere other than your current working directory (cwd). You can save + it to your home directory with the 'w' command, then force quit: + + :%^GREEN%^w /realms/cratylus/sword.c%^RESET%^ + "/realms/cratylus/sword.c" 20 lines 478 bytes + :%^GREEN%^Q%^RESET%^ + Exit from ed. + + + 3) %^CYAN%^Indent command fails%^RESET%^ + + + You try to auto-indent your code but get an error like this: + + :%^GREEN%^I%^RESET%^ + Indenting entire code... + Unterminated string in line 13 + Indentation halted. + + This is pretty self explanatory. Indent relies on a certain + amount of coherence in your code, and if your syntax is sufficiently + munged, it can't figure out how to properly do its thing. + Examine the line that indent complains about, and also the + line before it. Sometimes a good line is accused of being bad, just + because it comes after a bad line. + + + 4) %^CYAN%^I need to [something] in ed, but don't know how!%^RESET%^ + + + While in command mode, type '%^GREEN%^h%^RESET%^' and enter. You'll get + a handy list of ed commands available to you. + + + 5)%^CYAN%^ My ability/patience/time is limited. I want not to use ed.%^RESET%^ + + + I feel your pain. The currently available ways around + this are: + + 1) Shell account. If you can get shell, or command line access + to the computer that is running the mud, then you can probably + use an editor local to that computer (like vim) to edit files. + Chances are, though, that if you are a regular rank-and-file + creator, you will not be given shell access. Most system admins + consider giving random people off the net shell access + an abomination. + + 2) Server FTP/SFTP. The server that runs the mud might have an + ftp server or sftpd access. Again, most security-conscious sysadmins + will not permit Just Some Person Off The Internet to have this + kind of access. + + 3) Mud FTP. I don't like this option. Unix FTPD is a security + concern as it is. Using unsupported, un-warrantied mud network code + to provide ftp access to files seems to me to be equivalent to pulling + down your pants, bending over, and whistling for the Internet to + come visit. But...it's an option. + + 4) Client upload. This is actually the most sensible option, if + you are truly allergic to ed. You still need to use ed, but what + you can do is write your code in your favorite local editor, like + notepad or gvim or whatever. Then use your mud client (most of them + have an option to "send text") to send the code by running ed, + entering input mode, copying the code from your editor, and + pasting it into your client. + This is a somewhat awkward system, and ill-suited to + making minor changes. But it has the virtue of working well and + being a widely available option. + + 5) Suck it up. Really, you need to just get used to it. Don't + make me tell you stories about how when I was younger I had to + code using a VT terminal with no cut-and-paste, in an unheated, + locked computer lab 20'x10' in size, at 9600 bps. In a snowstorm. + Uphill both ways. + + diff -c -r --new-file ds1.1/lib/doc/faq/general ds2.0r27/lib/doc/faq/general *** ds1.1/lib/doc/faq/general Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/faq/general Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,180 ---- + Dead Souls FAQ, v2 + + Written by Cratylus @ Frontiers, October 2005 + Updated January 2006 + + %^GREEN%^ What is Dead Souls? %^RESET%^ + + Primarily Dead Souls is a "mudlib". There is also a Dead Souls + MUD, but this is not what people generally mean when they refer to Dead Souls as a + game. It also happens that a book by the Russian author Nikolai Gogol is named Dead + Souls. That book is wholly unrelated to the Dead Souls software. + + %^GREEN%^ What is it for? %^RESET%^ + + It's for building a game. If what you want to do is play a game, + you're looking for something else. + + %^GREEN%^ What is a MUD? %^RESET%^ + + A MUD is a computer program that uses text (very rarely do MUDs + use graphics or sound) to describe virtual environments you can manipulate. + You enter a command, the program tells you how the virtual world responds + around you. Typically there are other people connected to the same program + over the Internet, and you can interact with them as well. A MUD can be mostly + social, or mostly game oriented, with quests and puzzles to solve or + villains to defeat. The name MUD is an acronym that originally stood for + "Multi-User Dungeon", in accord with the "Dungeons and Dragons" style of + many early MUDs. Now it stands for different things to different people, + but the basic concept of operation is the same, whether the game is set + on the moon, in Manhattan, or in Middle Earth. + + %^GREEN%^ What's a mudlib? %^RESET%^ + + Generally there are two main parts to the MUD program. First is the + "driver". This is an executable program file (in Windows, you'd see the driver + has an .EXE extension) that enables the input and output of data, accepts + network connections, performs basic calculations, etc. The other part + is the mudlib, or, more properly, MUD object library. This is usually a + large set of files in plain text that the driver reads and uses as a + basis for the game. Some files provide information about rooms and + environments, some files provide information about objects or creatures, + etc. When players connect, the driver provides them the world that these + files describe. + + %^GREEN%^ When I configure Dead Souls, it says it is a MUD. If it is really a mudlib, + why would that be? %^RESET%^ + + Dead Souls is not intended to be a fully-developed MUD when you + install it. Instead it provides you with the basic framework you need to + make a MUD of your own. After you set up Dead Souls, you should rename it, + and customize the lib (that is, library) files to create your own world. When + you first run Dead Souls, you will have some rooms available to explore. + This is not your mud. It is just a set of sample places and objects to help + you understand how to build a MUD of your own. So in a way, Dead Souls provides + you a kind of "starter" MUD, but since it's just examples, you can't really + consider it a MUD until you change it to suit your creative vision. + + %^GREEN%^ Is Dead Souls really Nightmare in disguise? %^RESET%^ + + Let's break this question down into its components: + + %^GREEN%^ What is Nightmare? %^RESET%^ + + Nightmare was a mud. It was part of a branching of mud development + that occurred early in the days of popularized mudding. Some folks + decided to take MUD library development in a particular direction, + and eventually made available what is now known as the Nightmare mudlib. + Nightmare went through a few major changes, most notably from version 3 + to version IV. By that time, the development of Nightmare was solely + managed by a coder who called himself Descartes. + + %^GREEN%^ What is the relationship between Nightmare and Dead Souls? %^RESET%^ + + It appears that Dead Souls began as a "development" MUD. This means + that while Descartes ran his own MUD, he also worked on improving that MUD's + lib. It is unwise to make major changes to a MUD that people are playing on, + so the Dead Souls development MUD was one which served as a platform to + develop, extend, and improve the Nightmare lib without risking harm to active players. + Sometime after the release of the Nightmare IV mudlib, Descartes decided to + withdraw it from distribution. Based on their interpretation of copyright + law, people now do not distribute the Nightmare mudlib on Internet servers. + However, somewhat inexplicably, Descartes released the mudlib for his + development mud, Dead Souls, into the public domain. This meant that the + Dead Souls mudlib was completely free to be used by anyone in any way they + chose, be it distribution, modification, spindling or folding. Because Dead + Souls was the development mud for Nightmare Mud, which was the base of the + Nightmare mudlib, the relationship between the two is an extremely close one. + + %^GREEN%^ How close? %^RESET%^ + + Frankly, almost identical. A close comparison of the Dead Souls lib + that Descartes released (version 1.1pre) against the last released Nightmare + lib (IVr6) reveals that they are very nearly the same thing, file for file. + The main differences between the two are: + + * A small number of Nightmare library files aren't on Dead Souls. + * Dead Souls doesn't come with the driver or install script the Nightmare had. + * All documentation files were removed from Dead Souls. + * "Nightmare" in file headers was changed to say "Dead Souls" + + This might sound like a lot of difference, but consider this: not counting + documentation, Nightmare IVr6 lib contained 1064 files and directories, and + the Dead Souls 1.1pre lib contains 1082. Dead Souls 1.1pre actually had more + lib material in it than the last release of Nightmare. + + %^GREEN%^ Why mess with Dead Souls, then? %^RESET%^ + + The main problem was that Dead Souls was a bear to set up. Because + driver development had not stopped (the driver is a separate software project), + but lib development had, incompatibilities grew in number over time. Using + the original driver from 1997 created a MUD that lacked important features + of modern muds, and risked instability. Using a modern driver required a + modification of fundamental lib systems that required some expertise to + perform. People stopped using Nightmare because they couldn't get it, and + they didn't use Dead Souls because the damn thing didn't work right. My own + Nightmare lib MUD, Frontiers, continued to chug along, quietly fading into + obscurity along with all other Nightmare IV based MUDs, while scrappy young + newcomers like CoffeeMud lib started elbowing their way into the MUD community. + + Then a funny thing happened. I really got into lib coding. I mean, full-on + lib obsession. I can't really explain it, other than to say that when I was + younger it seemed hard and impenetrable, but now that I've been working in a + technical field for years, I have the mental tools (and patience) required to + disassemble and understand complex systems. I got turned on by analyzing and + understanding stuff that I'd considered over my head in years past. But I + realized I was living in the past. I couldn't share my exciting lib ideas + and discoveries with anyone else, because the Nightmare LPC community was + in the very last stages of extinction. + + I decided to do something about it. Maybe I'd be whistling into the wind, + tilting at windmills, or even worse, just talking to myself. But I decided + I'd make Dead Souls a viable lib for people to use, because it would be fun, + and because it might be nice to have other people to bounce ideas off of and + steal code from. At worst, I'd be doing nothing more pathetic than, say, + building model ships in my basement. At best, I might revive a once-thriving + MUD development community. Either way, it sounded like an enjoyable project, + so I proceeded. + + %^GREEN%^ Fine, but what's so special about Nightmare/Dead Souls? Why are you making such a + big deal of wanting people to use it? It isn't better than everything else, + surely. [insert mudlib name here] is newer and has [insert feature here] and [other feature]! %^RESET%^ + + Yes, that may be. My experience with other libs is limited, and I'm sure + that Dead Souls pales in comparison to others in one feature or another. My only + answer to that is, go ahead and use the lib you're comfortable with. I make no + claims of superiority. Hell, I'll be the first to admit there are still things + to fix and systems to implement. But if you are not sure which lib to pick, + Dead Souls is an excellent choice as a solid, stable, flexible and powerful platform + to build your MUD. You can do anything in a MUD with LPC, and I mean anything. + If you happen to have Nightmare experience, Dead Souls will be a homecoming... + like an old comfortable shoe....but without the holes or the stink. + + %^GREEN%^ What's LPC? %^RESET%^ + + LPC is a kind of programming language. Dead Souls lib files don't + just contain descriptions of places and things: they have a format that describes + their relationships to the driver and permits you to do fancy stuff...pretty much + any text MUD thing you can think of, you can do in LPC. + + %^GREEN%^ How do I get started? %^RESET%^ + + Download the latest version from http://dead-souls.net/ + or http://www.mudmagic.com/codes/download/lpc/mudos/dead_souls and + install it. There are versions available for Windows and for Unix. The main + difference between the two is the driver. The Windows driver is a Windows + executable. The Unix driver is in source code form and must be compiled. + The lib files for both versions are identical. + + Once you log in, read the Players Handbook and the Creators Manual. + + + %^GREEN%^ Anything else? %^RESET%^ + + Read the Dead Souls Admin FAQ. + + + The end. + + Dead Souls Homepage + diff -c -r --new-file ds1.1/lib/doc/faq/lpmud ds2.0r27/lib/doc/faq/lpmud *** ds1.1/lib/doc/faq/lpmud Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/faq/lpmud Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,1814 ---- + + LPMUD FAQ + + Last Modified 95/11/30 + + The LPMud FAQ was originally authored 7 November 1994 by George Reese. + It could not, however, have been completed on the efforts of a single + person. See the credits section for a full list of contributors. To + make comments or suggestions on this FAQ, mail borg@imaginary.com. + + Copyright (c) 1994-1995 George Reese. + _________________________________________________________________ + + This is a list of Frequently Asked Questions asked about LPMuds and + the newsgroup devoted to them, rec.games.mud.lp. This FAQ is posted + twice a month to rec.games.mud.lp, rec.games.mud.announce, + news.answers, and rec.answers. All readers are strongly advised to + read this FAQ before posting questions to the LPMud news group, as + your question may already be answered in here. + + This FAQ is not intended to be a substitute for the general 3 part mud + FAQ's. I strongly recommend people new to muds read those first. This + FAQ deals with a particular class of muds known as LPMuds, and + therefore does not even attempt to cover information important to + other classes of muds. + _________________________________________________________________ + + The LPMud FAQ is divided into four sections: + + * Section I: Introduction + + * Section II: Playing LPMuds + + * Section III: Coding on an LPMud + + * Section IV: Starting Your Own LPMud + + + _________________________________________________________________ + + Section I + + INTRODUCTION + + Contents + 1. What sort of posts belong in rec.games.mud.lp? + 2. What is an LPMud? + 3. Isn't Amylaar an LPMud? + 4. Which is the real LPMud? + 5. How did LPMuds get started? + 6. What do the terms "alpha testing", "beta testing", and "fully + open" mean? + 7. Where are some ftp sites with LPMud stuff? + 8. Is there anything about muds on WWW? + 9. What are some mud related mailing lists? + + + _________________________________________________________________ + + + + What sort of posts belong in rec.games.mud.lp? + + ALMOST anything dealing with LPMuds. Rule number 1 being that the + topic of your posts must someway affect the LPMud community. We do not + care about Dikus and MOOs and so on. They may be very nice servers, + but if we wanted to be reading about them, we would be reading + rec.games.mud.diku and so on. The second rule is to avoid posting on + the following topics: + + * Where is CheeseMUD? I have not been able to connect all day! + If it is going to be down a long time, the admins should post + to rec.games.mud.announce. Otherwise, it is either a short + connection loss or it is just your problem. Do not post these + questions here or anywhere!!! + + * Advertisements for muds + These belong in the newsgroup rec.games.mud.announce + + * FascistMUD's admins are such jerks!!! They ... + Why would you post this? I guarantee you will accomplish + nothing by this. First of all, ALL mud admins have bad days + where they may do something very unfair. It is the nature of + things. So you may be the unfortunate victim of a rare set of + circumstances rather than of a mean admin. Secondly, even if + the mud admin is a jerk, no one on this newsgroup cares. People + will play such muds either because the admin is damn good at + creating a game or because the players are other jerks who like + the atmosphere of lawlessness. Players like you may login from + time to time, but eventually they will figure it out. + + * Do not post mudsex sessions + An individual's sexual activities are not matters for public + derision. How people choose to express themselves sexually is a + private issue as long as only consenting adults are involved. + + + _________________________________________________________________ + + + + What is an LPMud? + + An LPMud is one of many classes of muds, or multi-user domains. A + multi-user domain is defined solely with respect to its ability to + allow multiple real individuals to come together in some sort of + environment. Although the most common environment is a gaming + environment, muds need not be games. In fact, among other uses of MUDs + that I know of, there are virtual colleges, a mud where victims of + abuse can come together in a productive environment, and muds designed + to bring students with disabilities into social contact with one + another and others. The single defining theme for mud is therefore + being a virtual environment where multiple people come in contact. + + An LPMud specifically allows the users to manipulate the environment + through a language called LPC. LPMuds are computer programs which + listens to the internet for people attempting to connect, reads LPC + files, and acts upon those LPC files according to the rules of the LPC + language to create the virtual environment. Currently, I know of 6 + major LPMud servers: + + * CD + + * DGD + + * LPC4 + + * LPMud + + * MudOS + + * Shattered World + + * Urimud + + + + With most other mud games, users do not have access to create in the + language used by the mud. LPC is used not only to give users such an + ability, but it is also designed with both ease and power in mind. + _________________________________________________________________ + + + + Isn't Amylaar an LPMud? + + Amylaar is a person, not an LPMud. He is the primary author and torch + bearer of the LPMud name. Given the generic sound of the term "LPMud" + these days, people often refer to LPMud 3.2 as the Amylaar driver. + _________________________________________________________________ + + + + Which is the real LPMud? + + LPMud 3.2 is the official continuation of the original LPMud server, + however, all servers listed above (with the possible exception of + Urimud) are equally real. All have two traits that make a mud an + LPMud: + 1. The environment is created through files written in LPC. + 2. The environment can change as new files are added and old ones + changes, even while the game is running. + + + _________________________________________________________________ + + + + How did LPMuds get started? + + I am not the greatest historian, and may be wrong on some important + facts here, but this is the first shot at the FAQ, so here goes... + Once upon a time, there was Lars Pensjö (the ö being an o with two + dots over it... to an American, that is roughly pronounced "Penscha"), + who wrote the original LPMud coming from an AberMUD background. If you + play current LPMud's of the LPMud type, you won't really notice much + of a difference from the original. From the coders' point of view + however, LPC is nothing like it was with the original. For a long + time, there was only LPMud run by Lars with patches by everyone under + the sun. The original LPMud run by Lars was called Genesis. Its base + town called Larstown was taken mostly from AberMUD. + + Eventually, others got tired of waiting to see their patches added to + Lars' driver, and Lars was working on version 3.0 of his driver as he + was gradually losing interest in the project altogether. Version 3.0 + turned out to be buggy as hell, and generally unworkable for a real + LPMud. CD, LPC4, LPMud, and MudOS, all derive from this server as + people saw good things in it and began creating working versions of + LPMud 3.0 after their own concepts of mud server design. + + Unlike the others, DGD was created from scratch. It therefore is + missing a lot of the baggage which has come down from the beginning of + time in the other drivers. Urimud, on the other hand, is derived from + LPMud 2.4.5. + _________________________________________________________________ + + + + What do the terms "alpha testing", "beta testing", and "fully open" mean? + + Generally, a mud goes through three basic stages. The first stage, + "alpha testing", is a developmental mode in which players are rarely + allowed access to the mud. Things are in such a disarray or in a + flurry of changes that playing a consistent game is impossible. In the + "beta testing" stage, a mud is generally opened to players solely for + the sake of testing that the mud works. Without actual play testing, + it is impossible to determine if a mud can handle being fully open. + muds in either of the above stages generally will not compensate + players for mishaps due to bugs in the game, and they will often even + purge players from the mud. The purging is done either because old + player objects are no longer compatible with new ones or because the + mud needs to be re-balanced to fit new code. + + In the final stage, "fully open", a mud is just that, fully open. That + means you can expect certain standards from the mud, including such + things as not dying from bugs. Nothing is ever bug free, so generally + fully open muds will compensate players for mishaps which occur + because of a bug. On the flip side, these muds usually also smite + players who gain from bugs in the system. + _________________________________________________________________ + + Where are some ftp sites with LPMud stuff? + + See Section IV: Where can I find all of this stuff? + _________________________________________________________________ + + + + Is there anything about muds on WWW? + + The following is a list of LPMud related WWW URL's, a few of which + are even written in the mud programming language LPC: + + * http://www.bat.org + The BatMUD WWW Server + + * http://www.lostsouls.org + The Lost Souls WWW Server + + * http://www.imaginary.com + The Imaginary WWW Server + + * http://www.pvv.unit.no/viking + The Viking mud WWW Server + + + _________________________________________________________________ + + + + What are some mud related mailing lists? + + The following lists use the majordomo software. To subscribe, mail + majordomo at the sites mentioned with "subscribe list-name" in the + body of your mail. To get more information on the lists below, mail + majordomo at the site mentioned with "info list-name" in the body of + the mail. Naturally, list-name should be replaced with the appropriate + list name. + + For example, to subscribe to the lpc-language mailing list + lpc-language@imaginary.com, you do the following: + 1. mail majordomo@imaginary.com + 2. subject is irrelevant, body says "subscribe lpc-language" + 3. the list will then confirm you have been added by mail + + To mail a post to the mailing list, simply mail + lpc-language@imaginary.com and proceed as you would as if you were + mailing a single person. + + * amylaar-users@ibr.cs.tu-bs.de + The LPMud 3.2 and 3.2.1 Users Mailing List + + * foundation-mudlib@imaginary.com + The Foundation Object Library Mailing List + + * intermud@imaginary.com + The Intermud Protocols Mailing List + + * lima-mudlib@imaginary.com + The LIMA Mudlib Mailing List + + * lpc-language@imaginary.com + The LPC Language Mailing List + + * mudos-bugs@imaginary.com + The MudOS Bug Reporting List + + * mudos-patches@imaginary.com + The MudOS Patch Distribution List + + * nightmare-mudlib@imaginary.com + The Nightmare LPC Library Mailing List + + + + Individual muds may have their own mailing lists as well. Check with + your LPMud for details. For people running lists with an audience + beyond a single mud, please let me know of your list. If you use list + software not listed, I need the name of the list, how to subscribe, + and how to get more information. + _________________________________________________________________ + + + + Section II + + + + PLAYING LPMUDS + + Contents + 1. How do I play an LPMud? + 2. How do I get a list of LPMuds? + 3. Are all LPMuds in English? + 4. Ok, the mud is asking me for a name, what do I do? + 5. They told me I had to register! + 6. Name and password set, what next? + 7. I don't want anyone knowing my email address! + 8. Is it asking me for my gender? + 9. What does it mean by race? + 10. What is a class? What is a guild? + 11. I am in the mud, what do I do? + 12. What are some common commands? + 13. What is an alias? + 14. Why doesn't the mud save my equipment when I quit? + 15. Why is the mud admin ignoring me? + 16. The admins are being unfair, don't I have rights? + 17. What about freedom of speech? + 18. What else is there? + + + _________________________________________________________________ + + + + How do I play an LPMud? + + You must first find the internet address of the mud you wish to play. + Once you find the address, most often people use the "telnet" program + to connect to this address. The mud FAQ has an excellent section on + MUD clients, which are alternatives to the plain vanilla "telnet" + program. However, generally speaking, with "telnet", you can access + the mud of your choice by issuing the command: + + telnet address port + + For example (% is considered your prompt): + + % telnet nightmare.imaginary.com 1701 + % telnet 129.10.114.86 5555 + + And so on. Some telnet programs do not allow you to pass arguments at + the command line. Instead, you get something like this: + + % telnet + telnet> open + (to) nightmare.imaginary.com 1701 + + Once you succeed, you will get a welcoming screen which should say the + name of the LPMud and ask you for a name. A common error people will + make is leaving off the number at the end. If you do that, the telnet + program assumes you mean to go to port 23, and it will give you a + login prompt to the host machine. + + In addition, some VMS telnet programs use the following syntax: + + telnet 199.199.122.10/port=1701 + + + _________________________________________________________________ + + + + How do I get a list of LPMuds? + + I know of no place that lists ONLY LPMud's, however, there is Doran's + Mudlist, which is produced semi-regularly and lists muds by type. You + thus have all your LPMuds grouped together. You can find it posted to + rec.games.mud.announce. + + From the web, you can connect to these sites to get mudlists: + + * http://www.absi.com/mud/ + The mud Connector + + MUDs connected to the Intermud generally have mudlists which they + maintain dynamically based on which muds they are currently talking + to: + + * http://ie.imaginary.com:7885/gateways/mudlist + The Idea Exchange Dynamic Intermud Mudlist + + Keep in mind, however, these dynamic lists hold only LPMuds which + support intermud communication. They are by no means full lists. You + will also find that many muds on this list are in some sort of + developmental stage. + _________________________________________________________________ + + + + Are all LPMuds in English? + + No. To provide a list of such muds is beyond the scope of this FAQ. + Check the mudlists for a full and current listing. However, I would + like to know about other languages which might be supported in the + LPMud world, so please mail me if you have a mud in a language in + other than English, German, or Swedish. Known languages: + + * Chinese + + * Dutch + + * English + + * German + + * Swedish + + + _________________________________________________________________ + + + + Ok, the mud is asking me for a name, what do I do? + + Make up a name. Avoid using your real name or common names, real and + mythical. You want not only to give character to your persona, but you + also do not want everyone saying "Hey! Aren't you Bob from + JustAnotherMUD"? I chose the name Descartes, because I was a + philosophy major in college. In general, it is safe to assume any name + consisting only of more than two characters and less than ten (a to z) + is acceptable on any mud. Some muds allow really long names with + spaces, apostrophes, hyphens, and other marks. Others are in between + the extremes. Try the name you want. If the mud will not allow it, it + will tell you, and it should tell you why. + + After making up a name, one of two things will happen. Either you will + be prompted for a password, meaning you have picked a name someone + else is using, or it will ask you to create a password, meaning you + are a new character. If the first thing happens, just try again with + another name. If the second happens, you are in good shape. + + To create passwords, make up one different than the one you use to + access computers. Although muds encrypt passwords for storage, nothing + prevents an unscrupulous mud admin from intercepting that password and + using it for unethical purposes. It is also recommended that you use a + password with numbers and mixed upper and lower case letters in it. + _________________________________________________________________ + + + + They told me I had to register! + + Some muds require all their players to register before being allowed + to play. Also, it may be the case that someone from the same place as + you has been causing trouble, so the admins of the mud in question + have decided to require only people from that site to register. If + this is the case with the mud you wish to play, simply follow the + instructions they give. In most cases they will give you an email + address where you should send your registration. + + + _________________________________________________________________ + + + + Name and password set, what next? + + This is where you get to see why there is so little in common among + LPMuds from the player's point of view. Some LPMud's will ask you a + series of questions about who you are and what sort of character you + would like. Others ask nothing more. Among the questions you might be + asked are: what is your email address? what is your real name? what + gender would you like to play? what race would you like to be? what + class would you like to be? etc. + _________________________________________________________________ + + + + I don't want anyone knowing my email address! + + MUD Administrators have a legitimate need to know your email address. + No one else does. If a mud requires you to give your email address it + should either offer you the option of keeping it private, or it should + automatically keep the email private. If they do not keep your email + private and you desire privacy, do not play the mud. Do not complain, + however, that they ask for it. + + Note: + There seems to be some difference of opinion on this one, so I decided + to quote one of the comments: + + "Well, I have to disagree with this section: E-mail addresses are + very difficult to verify in bulk, and really not worth the trouble + unless you perform site registration. I believe the only people you + have a legitimate need for an email address from is your wizards. + Other than that, knowing the ip they log in from should be more than + sufficient." -Rust (John Viega) + + + _________________________________________________________________ + + + + Is it asking me for my gender? + + No. The game wants to know what gender you would like your character + to be. This means you can play a character of the opposite gender, + your own gender, or one of the alternate gender types which might be + offered. The other side of the coin to this, however, is that you + should never count on other people in real life being the gender of + the character they play. + _________________________________________________________________ + + + + What does it mean by race? + + Many LPMuds have a feature called character races. The term "race" in + these instances is not the same as the term used in modern society. In + fact, the LPMud term race would more correctly be referred to as + species. In fantasy type LPMuds, you will often see a selection of + "races" like human, orc, artrell, gnome, etc. When you are asked to + choose a race, a list of possible races should be provided for you. + _________________________________________________________________ + + + + What is a class? What is a guild? + + In general, a class is a grouping of players with common abilities. A + guild as well can be said to have the same definition. Many muds, if + they use either of these concepts at all, add some very individual + nuances. To muds which do not have classes or guilds, the concepts are + naturally irrelevant. Those which have one or the other are often + using the terms in an interchangeable fashion. Finally, those muds + which have both often define class in a more generic manner than + guild. For example, on Nightmare, a class is like a profession and the + guild like a particular job. You might have people in the fighter + class who are in the templars guild, and others who are in the rangers + guild. In short, the guild is a way of specializing your class + abilities. + + Other muds allow "multi-classing", which may mean joining multiple + guilds, classes, or both. It is always best to check out the "help + guild" and "help class" command on any given mud to see how it defines + these terms. + _________________________________________________________________ + + + + I am in the mud, what do I do? + + There is no one answer to this question, as the answer will vary from + MUD to mud. No matter what, however, you should see if the mud has a + "faq" command to get a listing of that mud's frequently asked + questions. In addition, you should learn how to use the "help" command + as well as find out about the rules governing that mud. + _________________________________________________________________ + + + + What are some common commands? + + The following commands exist on virtually all LPMuds. () around part + of a command indicate that that part is optional. [] indicates that + the text should not be taken literally. These commands naturally are + not likely to be found on non-English muds. + + * help ([topic]) + Gives you help. If you specify a topic, you get help on that + topic. If you just type help, you will either get help on where + to find other help, or you will be put into a help menu. + + * tell [player] [message] + Sends the string [message] to the player whose name is [player] + anywhere on the mud. Some LPMuds do not allow players to tell + to one another as it is viewed unrealistic. + + * say [message] + Sends [message] to everyone who is in the same mud room as you. + This command is almost always aliased to "'", such that "'hi!" + is the same thing as typing "say hi!". + + * who + Gives you a list of everyone connected to that mud. + + * look + Gives you a description of the mud room in which you are in. + + * look at [object] + Gives you a description of the object in question. + + + _________________________________________________________________ + + + + What is an alias? + + As with UNIX, most LPMuds provide some sort of method for creating + "aliases". An alias is simply a way in which you can have a easy to + type command represent another command. For example, you will often + want to type the phrase "get all from corpse" on any LPMud. It is much + easier to make an alias so that whenever you type "gac", the LPMud + interprets that as "get all from corpse". + + In order to create aliases, you need to know how your particular mud + handles aliasing. Older muds use a device called a quicktyper. Newer + MUDs have alias commands built in. Try issuing "help alias" and "help + quicktyper" commands in order to find out how aliases are handled on + your mud. If your mud uses quicktypers, you will have to go find the + quicktyper object before you can create aliases. Ask any other player + on such a mud where there quicktyper can be found. + _________________________________________________________________ + + + + Why doesn't the mud save my equipment when I quit? + + Balancing a mud so that everyone is not dripping in wealth and that + all players actually have a chance to die is hard work. It is nearly + impossible. One thing that makes it easier on balance admins is the + non-permanance of objects (in other words, objects do not save). For a + mud to save equipment, it requires a complete rethink of the way that + mud is balanced. + + It goes beyond the difficulty of balancing the mud however. There are + MUDs which do save equipment. The character of the game itself however + gets changed by what appears to be a simple change. Therefore asking + your mud admin, "can't you change the game so that it saves equipment" + is not so simple or limited as it might seem. To make such a change to + an existing mud would actually change that mud in such a way as it + would be unfamiliar to you. + + Putting it simply, saving equipment is not an impossible thing. + However, the consequences of doing so are way beyond what most players + are capable of realising unless they have been involved with muds + before. To do so on an existing mud would change it forever. Every now + and then, new muds appear with this feature. In fact, it is becoming + more and more common. Nevertheless, the concept foes have its + downsides. + _________________________________________________________________ + + + + Why is the mud admin ignoring me? + + Admins in particular are prone to a mud disease called "idling". This + means that the lights are on, but nobody is home. An idle person is + simply someone logged in to the game, but who is perhaps not actually + at their computer terminal. That person is thus not really ignoring + your question, since the person is never actually seeing it. + + If the admin is not idling, chances are that person is being + overwhelmed with questions or is actually coding online. Many LPMuds + will tell you that the person to whom you are talking is "idle" or + "editing". If you get that response to a tell, do not expect an answer + back right away. In addition, if it says the admin is editing (or + anyone else for that matter), then it is generally considered rude to + continue telling to that person as it makes it difficult for the + person to edit. + + Many people these days have the ability to be on several muds at the + same time. It is therefore entirely possible that the person to whom + you are trying to talk is in fact looking at another window. To get + that person's attention, it may be ok to "beep" them (by sending a + control-G in a say or tell). Some people do not like others to do this + to them, however, so be careful about doing it too much. + _________________________________________________________________ + + + + The admins are being unfair, don't I have rights? + + The short answer is yes, you have the right not to play the game. The + long answer is much more complex. First off, any reasonable set of + admins who wish to create a game which people will enjoy will + enumerate the sorts of behaviour you can expect from them. In other + words, admins on fun muds will state the rules of the game ahead of + time and will not deviate from those rules. That way you know what to + expect. In addition, if you do not like the rules, you don't get + involved with playing the game. + + What prevents an admin from breaking their own rules? Absolutely + nothing. In one sense, a mud is like someone else's swimming pool. You + have absolutely no right to swim there, and they have the right to + throw you out just because you talk funny or say things they don't + like. Fortunately, there are plenty of muds out there with civil + administrations to make this nothing more than a passing nuisance. + + A common misconception is that mud admins administrate muds for power, + and that arbitrary behaviour is a way of exercising that power. Though + there may be a few misguided individuals out there who do in fact + administrate muds for the sake of power, the fact is that no mud + administrator has any power over you. Remember, the worst thing any + admin can do to you is make you go play somewhere else. + + A final thing to remember is that muds evolve and rules evolve with + the mud. Just because rules change does not mean the admins are being + arbitrary. Arbitrariness is reflected in sometimes applying rules and + sometimes ignoring them, not in creating new rules to fit unforseen + situations. + + + _________________________________________________________________ + + + + What about freedom of speech? + + No, not even freedom of speech. Again, reasonable admins will clarify + in publically available rules what sort of speech (hate speech, + offensive language, or whatever) is not acceptable on that mud. You + may or may not agree with those rules or the political beliefs those + rules represent, but at least you do know where you stand on the mud. + It is thus up to you to decide if you can play under those rules or + not. In the event you encounter an unreasonable mud, there is nothing + much you can do but decide to leave. If it is a commercial mud, + however, deciding to leave can be some sort of leverage. + + A common source of friction between players and admins is where + players decide to criticize admins. Most often, the players are not + really trying to criticize the admins so much as inspire positive + changes to make a game they love even better. In those cases, it is + always good to remember that the admin is a real human who is closely + involved with what the mud is. If you keep that in mind, you can often + help bring positive changes to the mud you play without + unintentionally striking a hidden chord in a sensitive admin. + + + _________________________________________________________________ + + + + What else is there? + + Explore the mud! Most gaming muds have places called "newbie" areas + which are simplistic places for people new to the game to go and get + the hang of things. When you first log in to a new mud, you should ask + the others where the newbie area is. Also, read the login screen and + news which scrolls across your screen at login time, as they contain + important information about characteristics unique to the mud you are + playing. + + Ask people questions. Just make sure you have read the help files + first, or you will be sure to annoy someone. In addition, try not to + choose a single person for your queries. Constantly being asked + questions by the same person can often annoy people as easily as + stupid questions. + _________________________________________________________________ + + + + Section III + + + + CODING ON AN LPMUD + + Contents + 1. What is coding? + 2. What is LPC? + 3. How do I get to code on an LPMud? + 4. How do I learn to code? + 5. What is The Idea Exchange? + 6. How do I learn to code a room/monster/weapon/armou...? + 7. But you said that all LPMuds use LPC! + 8. My code is not working! How do I fix it? + 9. What is an efun? an lfun? a kfun? a sefun?... + 10. Can I take my area from LPMud X to LPMud Y? + 11. Can I code offline? + 12. Why does the mud use ed? Why not have the mud use vi/emacs...? + 13. How do I put my code into the game? + + + _________________________________________________________________ + + + + What is coding? + + Coding is writing files for the computer to read. In the case of + LPMuds, this means writing files in a computer language called LPC. + The LPMud server reads these files and interprets what those files are + telling the computer to do when certain player actions occur. Often + that means things like displaying a description of a room when you + enter it and so on. The LPC files which make up the backbone of any + mud are called the mudlib. Coders use the mudlib code in such a way as + not to have to rewrite many of the most common instructions over and + over again. With most good mudlibs, therefore, there is more creation + involved than coding. + _________________________________________________________________ + + + + What is LPC? + + LPC is an object building language created by the author of the + original LPMud server, standing for Lars Pensjö C. Structurally, it is + much like the more popular programming language C. Designed with LPMud + object building specifically in mind, it puts the power of game + building in the hand of the general user. + _________________________________________________________________ + + + + How do I get to code on an LPMud? + + Policies vary from mud to mud. Some muds require you to make a + certain player level before being allowed to code. Others require you + to pass a test or fillout an application. Still others just let anyone + come on and code. If you really want to get in on things, the best + thing to do is either to talk to the admins of the mud you are + playing, or go to The Idea Exchange (ie.imaginary.com 7890) The Idea + Exchange has a newsgroup for coders looking to code and another for + muds looking for coders. Keep in mind that many muds which are open to + players already have more coders than they need. + _________________________________________________________________ + + + + How do I learn to code? + + There are two parts to learning how to code on your mud: + 1. Learning LPC + 2. Learning your mud's object library (mudlib) + + Each mud should have detailed documentation on part 2. Two LPC + textbooks, a beginner and an intermediate, exist to take care of part + 1. You can get the textbooks via ftp at + ftp://ftp.imaginary.com/pub/LPC/doc. Documentation, however, will + not really do anything without looking at examples, practicing, and + talking to more experienced coders. Examples should be everywhere on + your mud (though they are not necessarily good examples). Practicing + is simply just copying code you do not understand, making small + changes to it to see what they do, and learning from what happens. To + learn more about how to code from others, talk to more experienced + coders on your own mud or visit The Idea Exchange which is designed to + help people learn LPC. + _________________________________________________________________ + + + + What is The Idea Exchange? + + The Idea Exchange is centered around the advancement of LPMud + technology and the promotion of its use. On The Idea Exchange you will + find many of the people responsible for the software commonly used to + build LPMud environments, including the authors of drivers and + mudlibs. It is an excellent place for learning about LPC and + discussing new ideas. + _________________________________________________________________ + + + + How do I code a monster/room/weapon/armour...? + + Read your mud's documentation, as this varies greatly from mud to + mud. + + "Also, questions like that are almost impossible to answer in any + other way than showing an example. Thus, a much better question is: + 'Where can I find an example of how to create a XXX?' or 'I don't + quite understand this part of the example on how to...'" -Drevreck + (Lars Syrstad) + + + _________________________________________________________________ + + + + But you said all LPMuds use LPC! + + Yes, they do. However, they do not all use the same mudlib. The + mudlib is the basic LPC files you make use of then you write your LPC + files. The LPMud server in turn interprets your files and stores them + in memory. Two muds using different mudlibs therefore can be wildly + different from one another. And since the mudlibs are so different, + the files you will write will be equally different. + + An analogy might be that of a human dialect. Quebecois French and + Continental French often use different words and such in order to + express ideas. In spite of this, the language structure is the same. + So, both are still French even though you sometimes need to say + different things in order to mean the same thing. + + In writing an object in LPC, you are almost always using the mudlib's + LPC files rather than totally writing files from scratch. You do this + through something called inheritances. Inherited code which exists on + one mud may not exist on your mud, or may exist differently. Therefore + when you try to use that code, it will not work as you expect even + though both are in LPC. + _________________________________________________________________ + + + + My code is not working! How do I fix it? + + First, determine if the problem is with... + * the object failing to load + * the code causing an error when it runs + * no errors, it is just the expected things do not happen + + Now that you know what "type" of error you have, you need to isolate + it. Isolating it depends on the type of bug... + + the object fails to load + You have the bug isolated for you you in your error file. The + location of the error log depends on the file name of the + object with the error. It also depends on the way your mudlib + logs such errors. Nightmare, for example, logs compile errors + to /log/errors/std for obejcts in /std, etc, and + /log/errors/descartes for objects from /realms/descartes. TMI-2 + would log my errors to /u/d/descartes/log. I am not sure where + they put mudlib errors. I know with MudOSthe driver does + isolate the error for you to a useful degree of certainty. More + on this later. + For LPMud 3.2.1, you can use the: #pragma verbose_errors + preprocessor directive to make compile time errors include a + bit of context in error messages. Some mudlibs turn this + #pragma on by default. + + an error occurs during execution + These are logged in the mud's runtime error logged, and they + ALWAYS reflect the exact line where something happened. On + MudOS muds before 0.9.20, the system runtime log was + /log/debug.log. The mudlib in later versions has the option of + naming it whatever. + + "Brought over from LPMud 3.[01].x , LPMud 3.2 uses + /`hostname`/debug.log. LPMud 3.2.1 allows you to pass the option + --debug_file to change this default. If there is a triple fault + (i.e. an error while the master was processing an error in error + processing), and you compiled the driver with the TRACE_CODE option, + there will also be a trace of the last instructions executed. + Moreover, if the driver is not out of memory, and there is no triple + fault, the apply runtime_error() is called in the master, with the + error message, file name, object name and line number as arguments." + -Amylaar + + Note that for drivers which can compile LPC code to C and then link it + into the driver, no line number information will exist to help + you in debugging. You should therefore debug your LPC code + thoroughly before compiling it to C. + + no errors, you just do not get expected results + These are the hardest to debug. You need to go through the code + and test + + 1. Which code is being executed + 2. The values of the variables in the executed code + + How do you do this? Take the following code with a priveledges bug... + + + /* from /cmds/adm/_rid.c */ + + int cmd_rid(string str) { + if(!archp(previous_object())) return 0; + if(!str || !user_exists(str = lower_case(str))) return 0; + if(!((int)USERS_D->rid_user(str))) return 0; + message("system", "You rid "+capitalize(str)+".", previous_object()); + return 1; + } + + /* EOF */ + + /* /secure/daemon/users.c */ + + int rid_user(string str) { + return rm(DIR_USERS+"/"+str[0..0]+"/"+str+SAVE_EXTENSION); + } + + /* OTHER CODE DELETED FOR BREVITY */ + + This is not real code (as a lot more should exist in such an + operation). However it does serve the point. This code will + load fine and execute without error. However, it will not + delete the save file of any user. If anyone executes it, the + following will happen: + + + > rid weenieplayer + What? + > + + So what do you know? You know you typed "rid weenieplayer", and you + know you got 0 returned. One of the following things happened: + + 1. The "rid" command never got executed + 2. The archp() returned false for the person executing the + command + 3. For some reason, str was equal to 0 + 4. rid_user() in users.c returned 0 to the command + + How do you know if 1 is the problem? put the line... write("rid + command executed") as the first line of the cmd_rid() function + in the rid command. If the rid command is executed, you will + see that it is executed before you see "What?". If it is not, + you will just see "What?". If you do not see that line in + write(), then you know your bug is with you whatever calls the + "rid" command. If you do, then you know you must proceed + further. + + Do the same after each line which returns 0. Make sure each write() + string is unique so you know *which* line is being written out. This + will tell you exactly *which* line is returning 0 in the rid command. + + In this case, it is #4 which is the problem. The users daemon is + returning 0 for for rid_user(). This means that rm() is definitely + returning 0. rm() only returns 0 when an rm fails. rm() only fails + when an object does not have proper access. Therefore, in this case, + you need to fix the bug in your security. + + If for some reason you cannot go editing the files in question (i.e. + they are in the base lib files to which you have no access, changing + them would be even more troublesome, etc), you should consider the + efuns trace() and traceprefix(). + + Do you need to go through all of these tedious steps? No, you can + generally make good guesses as to where to look the more familiar you + become with the code. For example, in this case you pretty much could + have elimited step 1 if that command is an old command which used to + work. After all, it is highly unlikely that the mud would suddenly + stop executing that one command! + + Furthermore, if you had just made a change to the security system, you + would immediately suspect that rm() failed and thus would have checked + that first. + + This is why presenting me with your entier rid command would have been + useless to me. I would have looked at it and said it *looks* ok. But I + have no idea what changes you have recently made to your mud, nor do I + know from looking at the code which of those lines is returning 0. I + can only basically tell you that one of those lines is failing. + + However, if you were to tell me that for some reason your user object + was returning 0 in trying to rm() the user file during the rid + command, I could tell you details about the relevant parts of the + Nightmare LPC Library security to this daemon. And then you could + use that information to debug further and ultimately fix the bug. + _________________________________________________________________ + + + + What is an efun? an lfun? a kfun? an sefun?... + + For any function in LPC, there are three distinct parts... + 1. the prototype + 2. the call + 3. the definition + + Whate differentiates all of these different types of functions is + where they are defined. The definition of the function is the part + which says what it does. + + afun (auto function, DGD only) + the function is defined in the auto object and behaves like and + efun from other drivers. This function is really very special + type of lfun. + + apply + a function defined in the mudlib designed to be called only by + the driver. All applies are also lfuns. Most of the functions + in the DGD's driver object and other's master object are + applies. In addition, the functions create(), init(), and + reset() are also applies for LPMud 3.2 (not 3.2.1), MudOS, CD, + and Urimud. + + efun (external function) + this type of function is defined external with respect to the + mudlib. In other words, in the driver. Since it is defined + inside the driver, it is faster, but the mudlib is left with + little control over what it does. + + kfun (kernel function, DGD only) + This type of function is much like an efun in that it is + defined external to the mudlib in the driver kernel. There are + some ways beyond the scope of this FAQ in which kfuns differ + from efuns, ways which have little bearing to daily coding. + + lfun (local function) + Any function defined inside an object in the mudlib. The + functions you write (like create() or reset()) are lfuns. + + sefun (simulated external function) + lfuns defined in an object known as the simul efun object. Any + object in the mudlib is allowed to use these functions as if + they were efuns (treat them like local calls). + + You might also want to keep in mind the difference between a local + call and a call_other. A local call is a call to a function defined in + your object or to one of the objects it inherits. A call other is a + call to a function defined in another object. Efuns and simul efuns, + though not defined in your object, act like local calls. Afuns and + kfuns are in fact local calls, since all objects inherit the auto + object to which they are local. + _________________________________________________________________ + + + + Can I take my area from LPMud X to LPMud Y? + + Can you? If they use the same mudlib, yes. May you? Often muds have + restrictions against importing code in order to keep the mud unique. + Talk to the administration of both muds for local details. + _________________________________________________________________ + + + + Can I code offline? + + There are many different methods of coding offline, and which one is + available to you depends on your mud. The methods are: + 1. CreRemote + 2. ange-ftp + 3. wizshell + 4. your favourite editor + ftp + 5. cut-and-paste + + Editing offline allows you a faster response time, the ability to + multitask, and the ability not to be bothered by incoming tells + screwing up your edit window. It also allows you to make use of + editing environments which may be much more robust than standard mud + ed. + + CreRemote has both UNIX and Windows versions. This program basically + allows you to edit files on your mud as if they were on your local + machine. You do not have to mess with transferring files, and you can + do things like update the files to see if they load. CreRemote for + UNIX requires: + * any kind of UNIX + * perl 5 or later + * a direct internet connection using TCP/IP + * an RCP server on the host mud + + CreRemote for Windows requires: + * Windows 3.1, Windows 3.11, Win-OS2, Windows NT, or Windows 95 + * Winsock support + * an RCP server on the host mud + + ange-ftp is an emacs mode which allows you to edit files in emacs and + have them automatically ftp'ed to your mud and back. ange-ftp + requires: + * emacs with ange-ftp mode + * an FTP server which gives access to host mud files + + Wizshell is basically a UNIX program which gives your coders limited + access to a UNIX shell. This will not allow access to emacs, since + there is no version of emacs which is secure enough for such a limited + shell. wizshell requires: + * wizshell from ftp://shsibm.shh.fi/pub/Wizshell + * UNIX + + Using a local editor and ftp allows you free choice of which editors + you use, but you have to manually transfer each file. If going from a + DOS environment, you also need to watch for carriage-return/line-feed + translation. FTP requires: + * An FTP server which gives you access to your mud files + + Cut and paste requires no file transfer and allows you to use any + editor which has immediate access to your mud files. For example, you + can edit on your home computer using Notepad, then cut that from + Notepad and paste to your mud window which is likely in ed. Cut and + paste requires: + * The ability to cut and paste from editor to mud window. + + + _________________________________________________________________ + + Why does the mud use ed? Why not have the mud use vi/emacs...? + + See Section IV: How do I get my mud to use vi/emacs instead of ed? + _________________________________________________________________ + + + + How do I put my code into the game? + + A file is considered "in the game" if another file already visible to + players references it. So, to put your stuff in the game, you need to + change code already in the game to reference your code. This action + normally requires the action of mud administrator. Most muds have some + sort of quality control policies which state rules for having your + code reviewed. + _________________________________________________________________ + + + + Section IV + + + + STARTING YOUR OWN LPMUD + + Contents + 1. How do I start my own LPMud? + 2. How do I find a site? + 3. Can I charge players to play my mud? + 4. Why can't I use any of the other servers or mudlibs? + 5. Our system needs upgrading, can't I get donations? + 6. I have a site, now how do I choose a server/library? + 7. Where can I find all this stuff? + 8. Help! I can't get my driver to compile, what should I do? + 9. I have applied patch XXX, and now nothing works any more + 10. How do I do ANSI colours? + 11. Why not just hard code the colours? + 12. How to I make the mud use vi/emacs instead of ed? + 13. Is it possible to connect multiple muds together? + 14. Can a mud server run on DOS? + 15. Can a mud run under AmigaOS? OS2? Windows NT? etc...? + + + _________________________________________________________________ + + + + How do I start my own LPMud? + + + 1. Come up with a unique and interesting idea + 2. Find a site + 3. And do: + 1. Choose a server + 2. Choose an object library + Or: + 1. Choose an object library + 2. Choose a server + Or: + 1. Choose a server + 2. Write your own object library + Or: + 1. Write your own server + 2. Write your own object library + 4. Define administrative policies + 5. Find people to code areas for the mud + 6. Get some areas completed + 7. Open to players (with a beta test stage recommended + + + _________________________________________________________________ + + + + How do I find a site? + + The most common method is to talk to the administrator of the machine + from which you access muds and the rest of the Internet. If the + resources are available, they will often allow you to run your mud + server unless something political like a no-games policy is preventing + it. If you are not running a mud as a game, however, this is not + relevant. + + Never run a mud without talking to your system administrator. LPMuds + take up a lot of system resources, and many places simply cannot spare + those resources on a single project, especially if the project is + non-essential to the functioning of the entity running the machine. + Not only is it just plain wrong to run a mud without permission, it + also predisposes sysadmins to saying no to people who ask them when + the resources are free. + + If you cannot run it on your local machine, post a note to the + ie.sites.wanted newsgroup on The Idea Exchange. Do not post to USENET + newsgroups unless you have a working mud. It does not need to be + complete, but posting notes saying "I have a cool idea, will someone + give me a site" is inappropriate, unless that idea is completely + fleshed out with some sweat in the form of work on paper and such. + + Another avenue of finding a site is talking to local internet access + providers. Often, they have extra small machines on which a mud could + be run (sometimes for a fee). The most expensive route is to buy your + own machine and your own Internet hookup. + _________________________________________________________________ + + + + Can I charge players to play my mud? + + If you write the server from scratch AND you wrote your mudlib from + scratch and you have agreements with the coders who wrote areas on + your mud, the answer, of course, is yes. The above will take roughly + 3-5 years of full-time work to accomplish as well. + + If you do not wish to go through all of that time to write your own + server and object library, then you may only choose from DGD or MudOS + as your server. For both servers, you will need to get express + permission from their copyright holders, Dworkin for DGD and Beek for + MudOS. For DGD, the only object library you may use for such + purposes is LPMoo. Only Nightmare and Foundation may be licensed for + MudOS. + _________________________________________________________________ + + + + Why can't I use any of the other servers or mudlibs? + + They all come with some variation of the same copyright. Since all + drivers except DGD were derived from LPMud 3.0, they all require a + copyright at least as strict as that one, which basically states that + you can use the server as you like, so long as you do not make a + profit off of its use. Most current servers have much more strict and + explicitly copyrights. On top of that, many of the mudlibs which exist + also have similar copyrights. To require money of your players is + therefore a violation of international copyright laws. Although MudOS + was originally derived from LPMud 3.0, Lars has recently suggested + modifying the LPMud 3.0 copyright and has specifically given the + developers of that server the right to work under a modified copyright + given the degree to which MudOS has changed since LPMud 3.0. + _________________________________________________________________ + + + + Our system needs upgrading, can't I get donations? + + Yes, you can request that your players donate money as long as the + end of that money is to run the mud and donations are not a + prerequisite for play on the mud. In other words, they must be + donations, not fees. + + Note: + I am not a lawyer, nor am I the author of all the mud code out + there... Therefore, keep in mind that what I am saying about + copyrights is my interpretation and not binding upon ANY of the server + or mudlib authors out there. For reference to what is binding with + respect to my code, see the copyright notice which accompanies it. + _________________________________________________________________ + + + + I have a site, now how do I choose a server/library? + + Some people have a favourite mudlib, and therefore go at building + their own mud from the angle of using that mudlib. Others have a + favourite server and start from that angle. Others simply want to + start a mud fast, while others want to really tinker with it and make + it their own. The following is a rough guide to what is out there: + + Note: + Also, I only publish software which the authors have somehow made + known to me to be available, or in fact are widely known to be + available. I will not publish information about software which I have + no such verification, since being on a public ftp site is not the same + as being publically available. + + Servers + + CD + Generally considered a slow driver, however it is designed to + work very closely with the CD-lib. Therefore tests showing the + CD driver to be slower are not necessrily fair as sole factors + since they are mudlib-independent tests. The CD-lib is + considered a well designed lib which is often a factor which + leads people to choose this server. To see a CD server mud, + visit Genesis. + + DGD + DGD is built on the belief that small is good. This is absent + of much of the extra baggage which exists in all other drivers + since it was created from scratch. There currently exist two + native mudlibs for DGD, one of which is a MOO simulation. DGD's + documentation is sparse. It does support compile time LPC->C + compiling, meaning that when you compile the driver you can + have some of your LPC files converted to C and compiled with + the driver. In addition, unlike other LPMud servers, it is + disk-based, meaning you can run a huge mud on virtually no RAM. + You therefore never need to reboot or save objects. Dark has + written intermud support for DGD which can be gotten separately + from the driver. + + LPC4 + Maintained by Profezzorn, it supports a scripting feature that + allows you to execute LPC files as atomic programs without + running the mud in the traditional sense. In addition it + features lambda closure types which are actually understandable + to most people. It is designed for speed through the philosophy + of creating large numbers of efuns to perform CPU intensive + work. I know of no muds using this driver in practice. LPC4 + also has socket efuns with TCP support. + + LPMud + Once the fastest of all the drivers, it has lost this crown to + MudOS. Nevertheless, it is an extremely fast driver which + supports the old LPMud 2.4.5 Mudlib. It also supports closures, + though its closure syntax is beyond general ease of + comprehension. There is only one mudlib in wide release which + is native to this server. + + MudOS + The fastest and most feature-filled of the LPMud drivers, this + one comes with TCP support for mudlib objects allowing you + things like WWW, finger, SMTP, USENET, and other such access to + Internet resources from inside the mud. It also comes with a + choice of well-developed mudlibs native to the server. MudOS + allows you to choose between UID support and no-UID support, + which makes it easy to hack a LPMud 2.4.5 mud to work with + MudOS if that is your cup of tea. MudOS supports a new function + pointer syntax which is as functional as LPMud's closures + without LPMud's obscure closure syntax. + + Shattered World + Developed by one of the original LPMuds. I believe this driver + originated from one of the first LPMud releases and has been + heavily customized in such a way as not to be recognizable as + such. + + Urimud + Urimud is descended directly from LPMud 2.4.5, as opposed to + the other LPMud's (except DGD, which is created from scratch), + which are all descended from LPMud 3.0. Its most prominent + feature is that it can handle running multiple muds on a single + process. + + Object Libraries + + CD-lib + I am told this is a very well-designed mudlib. Some features of + it are an enhanced sense of reality through player recognition + (you must make the acquaintance of players before knowing who + they are) and UDP intermud communications. + Runs under: CD (native) + + Discworld + Advanced command parsing system and user interface, as well as + many concepts you will not see in other mudlibs for any server. + Too many frogs and wombles. + Runs under: MudOS 0.9.20 (native) + + Foundation IIr1 + A basic mudlib with nothing extra for people who want a solid + design base from which to design a unique mudlib. No combat or + anything else fancy is included. Nothing about it is + pre-disposed towards fantasy or even game playing for that + matter. On the positive side, there is nothing to deconstruct + in order to build your own mudlib and there is more of a solid + base to work from than something like Lil. The downside is that + you will have to put in a lot of work to make a playable game + from this. + Runs under: MudOS v21.5 (native) + + Heaven 7 + Runs in both compat and native modes with autoconfiguration for + whichever driver you are chosing. Since it runs under 2 + different drivers, you have the advantage of portability. + Security under native mode is questionable, and it does not + take full advantage of any one driver. It also advances very + little beyond LPMud 2.4.5. + Runs under: LPMud 3.1.2 (native), LPMud 3.2 (non-native) + + Lil + A small, essentials only mudlib. Designed basically to give you + examples of files as they must minimally be for the MudOS + driver to run. Only useful if you plan really to write + something totally from scratch. + Runs under: MudOS (native) + + LIMA 0.9r6 pre-alpha + This is a brand new library, featuring the new MudOS natural + language parsing package and a UNIX-like wizard shell with + output redirection and command piping. In addition, it is a + very modular, object-oriented mudlib with stack-based security. + As the name suggests, this mudlib is 'pre-alpha', meaning + documentation is sparse and some bugs are known to exist in the + mudlib. + + Runs under: MudOS v22a3 (native) + + LPMoo + A MOO simulation using LPC. This library allows you to work and + play exactly as if you were using MOO instead of LPC. + Runs under: DGD (native) + + LPMud 2.4.5 + The most well-known mudlib in existence. It is rather simple, + not the best design, but if you know it, it is useful. Also, + the widest range of drivers support it. Good for putting up and + running a mud quickly. It is very ancient and inferior in + design, flexibility, and functionality to modern mudlibs. + Runs under: DGD (non-native), LPMud 3.2 (non-native), LPC4 + (non-native) + + Melville + Extremely minimalist mudlib for DGD. Documentation is sparse + and it has few features. + Runs under: DGD (native) + + Nightmare IVr2.1 + Nightmare IV is a complete rewrite of the Nightmare Mudlib from + scratch, using Foundation II as a base. It has a highly object + oriented design which makes it easy to customize, + multi-classing, limb-oriented combat, and a stack-based + security system which addresses the flaws of UID-based + security. In addition, it uses the MudOS natural language + parsing package. This release is an alpha release, meaning that + some documentation is lacking and known bugs do exist. + Runs under: MudOS v22a6 (native) + + Shattered World + Mudlib to go with the Shattered World driver. It supposedly has + a system for doing detailed economic and predictive analysis. + Other than that, I know absolutely nothing about it. + Runs under: Shattered World (native) + + TMI-2 1.2 + Generic, designed for those who want to tinker around with + their mudlib rather than get a mud up in no-time flat. Designed + to be easily modified and comes with a full-range of intermud + support as well WWW support. Features include the ability to + take over monster bodies. Downside is its poor design and + performance. + Runs under: MudOS v21 (native) + + TubMUD + Very intricate, and, according to Rust, "it is beautiful if you + can figure it out." Intended more for Tub wizards to run at + home than for wide-release. + Runs under: LPMud 3.2 (native) + + If I have missed a lib, or stated something incorrect about your + server or mudlib, or simply ommitted something, don't go flaming me. + Email me the correct information so I can include it in the FAQ. I did + my best to be fair in this, but in simply undertaking this task I have + opened myself up to flames from anyone who I might have gotten wrong + or simply does not like what I said. So please be gentle, and + understand I mean no malice or ill-will anywhere in there! + _________________________________________________________________ + + + + Where can I find all this stuff? + + These first set of sites are generic "goto" sites when looking for + LPMud stuff: + + * ftp.actlab.utexas.edu + + * ftp.bat.org + + * ftp.ccs.neu.edu + + * ftp.imaginary.com + + * ftp.lysator.liu.se + + In addition, the primary site for individual pieces of software: + + * CD (server and library) + ftp://ftp.cd.chalmers.se/pub/lpmud/cdlib + + * DGD (server) + ftp://ftp.lysator.liu.se/pub/lpmud/drivers/dgd + + * Discworld (library) + ftp://ftp.imaginary.com/pub/LPC/lib/Discworld + + * Foundation (library) + ftp://ftp.imaginary.com/pub/LPC/lib/Foundation + + * Heaven 7 (library) + ftp://ftp.ccs.neu.edu/ + + * Lil (library) + ftp://ftp.actlab.utexas.edu + + * LIMA (library) + ftp://ftp.imaginary.com/pub/LPC/lib/LIMA + + * LPC4 (server) + ftp://ftp.lysator.liu.se/pub/lpmud/drivers/profezzorn + + * LPMud 2.4.5 (library) + ftp://ftp.lysator.liu.se + + * LPMoo (library) + ftp://ftp.ccs.neu.edu/pub/mud/mudlibs/lpmoo + + * LPMud 3.2 (server) + ftp://ftp.ibr.cs.tu-bs.de/pub/games/lpmud + + * Melville (library) + ftp://ftp.ccs.neu.edu + + * MudOS (server) + ftp://ftp.imaginary.com/pub/LPC/servers/MudOS + + * Nightmare (library) + ftp://ftp.imaginary.com/pub/LPC/lib/Nightmare + + * Shattered World (server) + ftp://moo.cs.rmit.edu.au/pub/xlpc + + * TMI-2 (library) + ftp://ftp.ccs.neu.edu + + * Urimud (server) + ftp://ftp.netcom.com/pub/urimud + + + _________________________________________________________________ + + + + Help! I can't get my driver to compile, what should I do? + + Thanks to Rust for putting together an answer for this question. + + First of all, learn how to redirect stderror to a file if you don't + already know how, or at least find a computer where you can cut and + paste. Then, you have 3 options for getting these errors to a more + experienced driver person: + + * You can try The Idea Exchange a mud dedicated to mud + development, where people who may be able to solve your + problem, or at the very least you can post it to your target + driver's newsgroup on The Idea Exchange, where they will be + seen by knowlegeable people fairly quickly. In addition, for + Lima specific compile problems, you can visit its support + site Lima Bean (telnet://lima.imaginary.com:7878). + + * You can post it to rec.games.mud.lp, but don't cross post, and + it probably wastes a lot more bandwidth on this newsgroup than + on The Idea Exchange. + + * You can mail the maintainers of your driver: + + + CD: jacob@dd.chalmers.se + + LPC4: hubbe@lysator.liu.se + + LPMud 3.2: amylaar@meolyon.hanse.de + + MudOS: tim@handel.princeton.edu + + Urimud: urimud@netcom.com + + For MudOS or DGD help, you are most likely to get a timely response by + posting to the proper newsgroup on The Idea Exchange (ie.imaginary.com + 7890). For LPC4, your best bet is direct mail, for CD, either direct + mail or visiting Genesis (hamal2.cs.chalmers.se 3011) and mailing + Tintin et al. + _________________________________________________________________ + + + + I have applied patch XXX, and now nothing works any more. + + Answer from Joern Rennecke (Amylaar) + Have you supplied the proper -p option to patch? If not, you might end + up with a patch applied to the wrong file. Check with the appropriate + man page to "patch" for more details. + _________________________________________________________________ + + + + How do I do ANSI colours? + + There are several misconceptions about colours. The first + misconception is that all of the world is an IBM PC using ANSI style + colours. In fact, there are many different sets of escape sequences + which have the same effects depending on terminal emulation. If your + goal is providing colour support to players, then limiting yourself to + just ANSI support is very similar to saying "Only people with IBM + compat's can play my mud." Well, maybe not quite that drastic, but you + get the point. + + Also, you should keep in mind that the term ANSI has nothing to do + with colours. ANSI is a standards organization, and one of the zillion + things for which they have standards is escape sequences and what they + do. Keep in mind that your goal is to have colours. + + Finally, about giving your mud colour support. The Discworld Mudlib + has developed a protocol now supported by at least Foundation, + Nightmare, and TMI-2. There is no reason, however, that other libs + cannot add support this protocol. It enables creators to code to a + single set of codes and have those codes dynamically interpreted into + colours proper to the terminal emulation being used by a given player. + If a certain player has no colour support, that person does not see + the colour codes. For more information on this protocol, stop by The + Idea Exchange at ie.imaginary.com 7890. + _________________________________________________________________ + + + + Why not just hard code the colours? + + There are multiple colour escape sequence protocols. Some players + cannot support colour escape sequences at all. Sending colour escape + sequences to people who cannot handle them, or to people who use + different protocols can mess up their displays severely, making the + game unplayable. + _________________________________________________________________ + + + + How to I make the mud use vi/emacs instead of ed? + + This question gets asked constantly. When you come around to ask it, + think about what exactly you want. Do you want to have vi or emacs on + your mud? Or is it that you really want to have a convenient way of + editing mud files (which ed certainly is not)? In truth, the real + problem is the need for something more convenient than the very + inconvenient ed which muds use. The kneejerk response to this need is + the belief that your UNIX editing tools will solve this need. The fact + is, however, there are better ways to accomplish this goal which are + listed in Section III: Can I code offline? + + Not convinced? There are the technical reasons that people often give, + such as the fact that any visual editor will require character mode, + which is non-trivial in the current batch of muds and very network + intensive. The bottom line as to why this is not generally done is + that it provides nothing, yet costs a lot. + _________________________________________________________________ + + + + Is it possible to connect multiple muds together? + + Is it possible? Yes. + + Why do you want to connect muds? There are two common meanings behind + this: + 1. Distributed mudding + 2. Connecting multiple muds + + Distributed mudding is basically a single mud whose resources are + spread across multiple servers. Distributed anything is generally + required of resource intensive, mission-critical applications. muds + are not, in the scheme of things, resource intensive and they + generally are not mission-critical applications. Distributed computing + basically gives you the ability to expand horizontally rather than + vertically. That means instead of buying yourself a sparc 20 to run + your mud, you can architect it in such a way that two sparc 2 + computers will give the same performance. + + The fact of the matter, however, is that no mud currently in existence + uses the resources which require this kind of scalability. In + addition, most MUDs have a hard enough time finding one site, much + less getting two. + + More commonly, however, people are thinking of the ability to connect + multiple MUDs together. Before deciding this is a good thing, you + should define the problem you want solved by connecting muds. As of + yet, I have not heard a problem which connecting muds solves. The most + vocal reason is to allow a person to have the same character across + multiple muds. At that point, however, you have to define what it is + to be that person. Most people will quickly say that what defines + their character is that they control it. If that is the case, then + connecting muds does not solve this problem. A client which allows the + person to login to multiple muds is what solves this problem. + + The response then might be to have the same level/skills/whatever + across the multiple muds. At this point, however, they cease to be + multiple muds connected, but instead one huge distributed mud. This + would be a poor way to design a distributed mud, and would also lead + to political headaches and a huge waste of creative talent. + _________________________________________________________________ + + + + Can a mud server run on DOS? + + Yes, most of the servers have DOS binaries available. In addition, + most of the mudlibs have had their files arranged and ported so they + fir in the FAT 8.3 naming scheme. If you wish to allow others access + to the mud over modem lines, be sure to get the comdrv17.com file with + your server and mudlib. For those who choose mudlibs with colours in + them, the current batch of drivers was compiled in such a way that the + drivers do not send output through ANSI.SYS (thus no colour). + _________________________________________________________________ + + + + Can a mud run under AmigaOS? OS/2? Windows NT? etc...? + + These are the ports of which I am aware: + + AmigaOS + DGD, LPMud 3.2, 3.2.1, MudOS + + Atari + DGD, LPMud 3.2, 3.2.1 + + System 6 + MacMUD (which is LPMud 3.1.2) + + MacOS + MacMUD, DGD + + OS/2 + LPMud 3.2, 3.2.1, MudOS + + Windows 95 + MudOS + + Windows NT + MudOS + + + _________________________________________________________________ + + Credits + + Credits for information in this FAQ beyond the information provided by + the author: + + Abigail, Stig Bakken, Jose Corrales, Felix Croes, Joshua P. Dady, Lars + Duening, Paul Gregg, Monique Girgis, Pelle Johansson, Andru Luvisi, + Joern Rennecke, Danne A Solli, Christina Sterman-Hack, Lars Syrstad, + Pekka Timonen, Linus Tolke, John Viega, Petri Virkkula + _________________________________________________________________ + + Copyright (c) 1994-1995 George Reese + This document may not be reproduced outside of USENET newsgroups, ftp + archives, electronic mailings, and other similar not for-profit + endeavors without the express written consent of George Reese. + _________________________________________________________________ + + This FAQ is maintained by George Reese, borg@imaginary.com diff -c -r --new-file ds1.1/lib/doc/guide/chapter01 ds2.0r27/lib/doc/guide/chapter01 *** ds1.1/lib/doc/guide/chapter01 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/guide/chapter01 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,36 ---- + chapter 1 "Introduction" + + If you're reading this, you've probably been + successful in installing Dead Souls, and are able + to get around and manipulate stuff within it. + + There are lots of questions that new admins + have at this point. This book is not intended to + answer them. Specific questions about administration + are handled in the Admin FAQ, which you can read + at http://dead-souls.net/ds-admin-faq.html . A + local copy is archived in the /www directory, but + this may be out of date by now, and you'd be best + served by looking at the online version. + + This guidebook isn't about "how to" or "where + is," although such issues may be handled incidentally. + The point of this guidebook is to describe to you + various principles that are important to your + success as a Dead Souls mud admin. + + The tone of these chapters is intended to be + conversational. Because of this, it may sound like + I'm being condescending (that means "talking down + to you"), but that isn't intentional. I'm + assuming that you fully understand I'm not the boss + of you, that you can decide for yourself what is + best for your mud, and that the contents of this + guidebook are thoroughly biased. + + However rambling these pages might be, know that + I claim no authority over What Should Be. I can only + tell you, from my experience, how things look, and + how I *think* things work best. + + diff -c -r --new-file ds1.1/lib/doc/guide/chapter02 ds2.0r27/lib/doc/guide/chapter02 *** ds1.1/lib/doc/guide/chapter02 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/guide/chapter02 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,113 ---- + chapter 2 "The Vision Thing" + + Are you sure you want to run a mud? I mean, are + you *really* sure? + + Most newbie admins have no idea what a difficult + task lays before them. I started my own mud in 1995. + It's still around today, in fact. Back then, I'd + been coding on a mud that had its hosting pulled. I + finagled access to my university's systems and + told the old mud's admin "Hey, let's host it here!" + He didn't want to, so it was just me and my + new Nightmare IV mud. I figured "what the heck, maybe + I can run my own," and the rest is history. + + I hadn't a clue how to manage people, and things + just wouldn't come together. I had literally dozens of + creators come and go, and I could never figure + out why they'd build a few things and leave. The + problem was me, obviously. There was nothing about + the mud people disliked: Nightmare was a very popular + lib at the time. + The problem was that people wanted leadership + from me, and I didn't even know it, much less know + how to provide it. + + Creators ("builders") are your most precious resource. + Without them you don't have a mud, you have a lib. Sure, + you can try building everything yourself...and with + Dead Souls, that's not so farfetched an idea. But + after a few months of toil, you'll see that you have + weaknesses, you are not the perfect builder, and you + will wish for the help and support of others. + If you don't carefully cultivate your relationships + with these people, you will fail. Your mud will be a + failed mud, and your self-expression squelched. + + This is why I ask you if you're *really* sure you + want to run a mud. Running a mud isn't about lording + it over puny mortal players. It isn't about being + the sharpest lib coder logged in. It isn't about + bossing your staff, or making long lists of rules + and job titles and meeting schedules. + + Your job as an administrator is to manage + people, and guide them toward a single vision, over + which you yourself may not have full control. People + will listen to the admin at first because, well, she's + the admin. But if you can't demonstrate the qualities + of leadership they expect, they will stop respecting + you, and they will leave. Or worse, they will hang + around and be difficult. + + What's this about a "vision"? People will work for + a variety of reasons, mostly money, fun, recognition, + etc. Rewards. When your new coders show up, they + will need motivation to work. Since you probably + won't be offering much in the way of money or + recognition, you'll need to find a way to motivate + your coders by making it fun to work with you. + + Obviously I don't mean you need to be jolly and + wear funny hats. In fact, you can be quite boring a + person and still be good to work with. When I mean it + has to be fun for your creators, I mean that they + have to be inspired to do stuff...they have to *want* + to build because they are expressing themselves in + a way they enjoy. + + This means you'd be unwise to start parceling out + "missions" and "assignments". Find out what your new + creator *wants* to do, then do your best to + accommodate them. It's that simple. If they're working + on what they *want* to do, you don't need to actively + motivate them...you just need to make sure they + have what they need, and that they understand what + is expected of them. + + These expectations are the other part of the + individual management of creators. Just as is it + fatal to give creators "homework", it is just as + counterproductive to say "do whatever you want, man, + you're free to do anything." Part of the fun of + work is knowing what the standards are, and how your + work will be judged. If your creator feels like you + don't actually care what she builds, she won't + care much about doing a job that's up to any standards + but her own. After a while of this, she's going to + figure out she might as well just run her *own* mud. + + You therefore have to have a strong sense of what + your mud will look like, and what each creator's role + in that mud will be. If you don't know, or it seems like + you don't know, you'll lose them. + + You don't run the mud because you have the admin + password. You run it because people think you run it. + If they stop thinking it, you stop running it. + + So I ask again. Do you know what you want out of + this mud? Have you planned out what you want people + to be doing? When a talented coder shows up, will + you be prepared to negotiate their proper role, + and persuade them that the mud will succeed? + + Do you *really* want to be a mud admin? Or are + you just looking to be someone's boss? + + First, find your vision. Everything else will be + hard work, but if you know what your mud will be, + and what you need from other people, then you + just might have a chance to succeed. + diff -c -r --new-file ds1.1/lib/doc/guide/chapter03 ds2.0r27/lib/doc/guide/chapter03 *** ds1.1/lib/doc/guide/chapter03 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/guide/chapter03 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,79 ---- + chapter 3 "Getting Started" + + If you've read this far, there's a good chance + you already like the lib and are eager to get + going on this whole mud thing. Whether this is + true or not, this is where you find out for sure. + + Let's assume you're set with the vision thing. + You're going to make a mud with a Dora the Explorer + theme. You can practically hear the music even + now! Let's get this mud written and open! Vamonos! + + The first thing that happens here is you need + to get real familiar with this mud. If you haven't + done so already, when you finish this chapter, + you must do the following: + + 1) Read the Player's Handbook, cover to cover. + + 2) Create a test character. Do *not* use your + admin character's powers to give her any + equipment or money. Using the information from the + Player's Handbook, play this character until she + solves the Orcslayer Quest. Do not use any creator + characters to help her in any way. + + It is very important that you do this. It + is the best way you will know for sure whether you + have made the right lib choice. + + This doesn't mean that I'm asking you if you're + happy with the questing system, or how the items + in your inventory get listed, or whatever. Such + systems and cosmetics can be changed, sometimes with + trivial work. + What you're testing is the feel of the mud, + the parser, and that certain "I don't know what" + that tells you whether this is really a mud lib + you can live with. + + Don't like quest advancement? That can be removed. + Want turns-based combat? That can be arranged (though + not trivially). But if you get a low level discomfort, + and can't shake the feeling that you can't get + anything done, then this is when you'll find out. + + The second advantage to completing the Orcslayer + Quest is that it helps you see how things are + organized. As you proceed along the quest, you should + be using your admin character to examine the + files that compose the rooms, items, and npc's you see. + You will know where there are working samples of + doors, locks, hostile npc's, friendly npc's, spells, + and so on. This information will be valuable to you + in the next step you take. + + If you complete the Orcslayer Quest and decide + you still like the lib, your next step is to create a + small area. Read the Creator's Manual starting from + chapter 31. This provides you a detailed set of + instructions on how to get stuff built quickly and + painlessly. + Build a few rooms. If you can't think of something + to build, create a room just like the one you're + sitting in right now, including desk, door, and + scruffy mud geek sitting on a chair. + Or you might already know exactly what you want + to build. This is a good time to build a few + rooms of Dora's Grandma's House, or the tree house + of Tico the Squirrel. + + It's vitally important that you start using the + building tools, because just like with the Orcslayer + Quest, this is the point where you will discover whether + the build system here is a deal killer. + + Once you're done with your few starter rooms, you'll + be in a position to know whether you've really made + the right mudlib choice. diff -c -r --new-file ds1.1/lib/doc/guide/chapter04 ds2.0r27/lib/doc/guide/chapter04 *** ds1.1/lib/doc/guide/chapter04 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/guide/chapter04 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,70 ---- + chapter 4 "Gaining Experience" + + Now you must prepare for the + technical demands of your creators. + + Your creators will expect you to have + answers to their questions. For the most part, + they'll find these answers in the Creator's FAQ, + at http://dead-souls.net/ds-creator-faq.html . + + But you're going to get questions not on + that FAQ. You'll get stuff like: + + * How many quest points should the Issa Quest award? + + * What's the maximum player level on this mud? + + * Can I make a player class called "Swiper"? + + * What's a good weapon type for The Bouncy Ball? + + These are questions that depend strictly on you + and what your vision for the mud is. Dead Souls is + a starting point. The classes, levels, systems, + *everything*, is open to modification. + + It is normal and natural not to have all of + these answers at first. I suggest you concentrate on + making an "area", perhaps a quest, consisting of + perhaps 15 to 20 rooms and a few npc's, weapons, + pieces of armor and general items. + + Test your weapons and armor in the arena. To + get to the arena, first go to the Creators' Hall + by typing: wiz + + Then go east, then north. + + You can have the dummy wear armor like this: + + give mithril shirt to dummy + force dummy to wear shirt + + And you can test your weapons by beating on the + dummy: + + force fighter to drop sword + clone hammer + give hammer to fighter + force fighter to wield hammer + force fighter to kill dummy + + The dummy will very helpfully blurt out the amount + and type of damage it receives. + + You can get ideas for your npc's by visiting the + menagerie. It is east and south of the Creators' Hall. + + By creating your first quest, and putting test + characters through it, you will gain the experience + you need to be able to tell your players things like: + + "The Issa Quest is supposed to be easy, so make it 2qp." + + "Level 50 explorers are way too strong. I'm capping + player advancement at level 40." + + "No, there is already a thief class." + + "Make it a projectile weapon." diff -c -r --new-file ds1.1/lib/doc/guide/chapter05 ds2.0r27/lib/doc/guide/chapter05 *** ds1.1/lib/doc/guide/chapter05 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/guide/chapter05 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,111 ---- + chapter 5 "Guilds, Classes, and Clans" + + Section I: Classes + ------------------ + + I suspect you are already quite familiar with + the concept of classes. Some people even have very + strong feelings about classes, specifically, they + hate them. + + Dead Souls 1 came with a class system, and + I decided to keep it because it sort of worked, and + many people are familiar with classes and want to + have them on their mud. + + However, you don't have to use them. + + That's right. Using classes is not required. You + can very easily make your Dead Souls mud completely + devoid of classes, if that's what you want. + + The reason for this is that in Dead Souls, the only + thing a class does is confer on a player a class title, + like "Fighter", and load her up with skill settings appropriate + to that class. That's it. Classes do nothing more. + + If you want player X to have all the skills of a + fighter and all the skills of a mage, just make it so. + They don't need to have class to have skills. Add + "kite flying" while you're at it. It doesn't matter. + Dead Souls operates on a skill system. The class system + is incidental to it and can be dispensed with entirely. + + On the other hand, for those folks who appreciate + the role play and tactical elements involved in using + classes, Dead Souls provides you the ability to use + the existing stock classes, and permits you to create + your own. The files in /secure/cfg/classes describe them. + See http://dead-souls.net/ds-creator-faq.html#2.46 + for the exact syntax of these files. + + You'll notice that there is a field for "how important" + a skill is. What this modifier does is determine how + quickly your player's skill levels rise when her player + level rises. A fighter's magical ability does not increase + much when she is promoted a player level, but a mage's + magical ability certainly does. + + For those who find classes distasteful, this kind + of "skill hobbling" is just the reason they hate classes: + they feel they are too restrictive. If you are such + an admin, just dont use classes, and whenever you award + a skill to a player, set the "how important" number + (techninally known as the "skill class" but that's a very + confusing term) to the same for everyone. + + Incidentally, you don't *need* player levels either. + I will leave it as an exercise for the reader to imagine + a scheme where players do not have advancement levels. + + DS1 allowed players to join more than one class. + Unfortunately, the system was buggy enough and stripped + of classes so that it was both meaningless and a bit + of a problem. Multi-classing is by default not permitted + on DS2, but it's easy enough to implement on your own. + Review the header data in the class files to see the + syntax. + + However, since multiclassing isn't something I + am interested in working on right now, I will not be + assisting anyone in getting that to work. + + + Section II: Guilds + ------------------ + + The concept of "guilds" carries some baggage for me. I + learned about mudding by playing on Darker Realms, an LP + mud where a "guild" was effectively a class. There was + the mage's guild, the barbarian guild, etc. There were + also guilds that blurred the distinction between class + and race, like shapeshifters, cyborg, and dragon. + + When I ran into the Dead Souls 1 conception of guilds, + then, I was pretty confused. In DS1, a guild was + kind of a player-run club. There was a guild object + that made some sort of determination about who + was in or out, who was the boss, etc. My presumption is + that in later iterations of Nightmare V, these guilds + were fleshed out and worked properly. I presume this + because in DS1 they didn't, and they seemed to make some + assumptions about the lib that were not correct. + + I decided to change this for DS2, and the way it now + works is that guilds are neither classes nor player-run + clubs. The plan is to have guilds be not-necessarily-class- + based affiliations a player can have with balanced + advantages and disadvantages. As of DS2.0 there is no + working sample of this, but that's the plan for post + 2.1 development. + + + Section III: Clans + ------------------ + + Clans serve the purpose that DS1 guilds did. They are + player-run affiliations, managed by clan objects that + confer identity and status. As of DS2.0 there is no working + sample of this, but that's the plan for post 2.1 development. + + diff -c -r --new-file ds1.1/lib/doc/guide/chapter06 ds2.0r27/lib/doc/guide/chapter06 *** ds1.1/lib/doc/guide/chapter06 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/guide/chapter06 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,50 ---- + chapter 6 "Privacy" + + One of the most powerful and most easily abused tools + in your administrative arsenal is the snoop command. When + you "snoop <person>", you get to see everything they + say and do. + Players usually find this intrusive and objectionable, + and it is ethically shaky to do this without their + knowledge and consent. The only circumstances under which + snooping is unambiguously ethical are: + + * Snooping one of your own test characters. + + * Snooping a player (with their consent) for the purposes of + troubleshooting a bug. + + * Snooping a user (without their consent) to investigate + a legitimate suspicion of malfeasance. + + Secretly snooping people for your personal amusement is + just flat wrong. + + By default, only admins can snoop. Admins are players who + are members of one or both of the groups SECURE and ASSIST. + + An assistant admin *cannot* snoop a full admin. However, + assistant admins have read access to the snoop log directory, + so if global monitoring is enabled, they can read the + contents of a full admin's monitor log. + + The new SNOOP_D system allows for the simultaneous + snooping of multiple people, and allows multiple people to + snoop the same person. It also permits you to enable + monitoring of users without having to snoop, by using the + monitor command to log i/o to /secure/log/adm. + + The GLOBAL_MONITOR parameter in config.h will take one of three + arguments. 0 = monitor nobody. 1 = monitor everyone. 2 = monitor + everyone except admins. After changing it, reboot the mud + to make sure the change takes effect. + + This functionality isn't here for your entertainment. In + fact, I had to think long and hard before sharing my snoop + code with you and putting it in the general lib distribution. + + In the end, though, I believe that the benefits outweigh + the risk of abuse. As an admin, you have the right to know + what's going on in your mud, and as a lib coder, it isn't + my business to interfere with that. + diff -c -r --new-file ds1.1/lib/doc/guide/chapter07 ds2.0r27/lib/doc/guide/chapter07 *** ds1.1/lib/doc/guide/chapter07 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/guide/chapter07 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,167 ---- + chapter 7 "Advanced Topics" + + Section I: Shadows + ------------------ + + Shadows are a problematic topic. My first impulse is to warn + you sternly not to mess with them, they shouldn't be used, etc. In + his legendary LPC text, Descartes goes so far as to say he hasn't + seen a shadow do something that couldn't be done better another way. + + So, be aware that the topic of shadows tends to generate + strong opinions. + + Shadows *are* hazardous pretty much by definition. A shadow + is an object that effectively "wraps" another object, like an + invisible shadow around it. When a call is made to the shadowed + object, the shadow intercepts that call. + + What the shadow does with the call is up to you. It can + do nothing at all, and simply pass the call along to the + shadowed object. It could block that call. It could manipulate + that call and send the modified version to the shadowed + object. + + You can see an example of a shadow in /secure/npc/drone.c . + This is the code that enables you to take control of an npc + with the remote control. The remote control loads /shadows/drone.c + which inherits /secure/npc/drone.c , and attaches that shadow to + the npc that is to be controlled. This is a way of "adding + functions on the fly" to an already-loaded npc. + The drone shadow is in the lib as an example + of how shadows work, and an example of how to get an object to + posess functions it did not have when loaded. It is not + intended to represent shadow advocacy. + + The danger, and the reason some people go ballistic + when they hear the phrase "I think I'll use a shadow for that" + is that a lib that allows unrestricted shadow use + effectively has no security at all. You can have creators + enshadow an arch for example, or enshadow other privileged + objects. + + Dead Souls shadows are pretty tightly restricted. The + master object does not permit a shadow to be created unless its + code is in /shadows . This means creators can't hide their + rootkit shadows in their homedirs and expect them to work. + + Further, because /shadows is outside the /secure dir, + it serves as an obstacle to defeating the stack security + model. + + In any case, I strongly recommend you avoid using them + except in the extremely unusual case of a task that has + no other solution. If your mud starts collecting a bunch + of shadows out of laziness, sadness will likely be the result. + + + Section II: The "class" Data Type + --------------------------------- + + In 1995 Beek added a data type to MudOS: class. + I have to admit that I'm at a bit of a loss to explain classes, + because I am not a C guy, I'm an LPC guy. For people who + grok C, the class data type is a natural and elegant solution + for organizing related sets of variables. + + I have nothing but respect for Beek and the leet programmers + who built MudOS, so please don't go running around saying I'm + dissing them. + + But in my experience, the use of classes generally serves + the purpose of obscuring code and making it more difficult + to debug. + + I've seen newbie LPC coders take to classes like fish to water. + I can't explain it other than to speculate that for some people + the class data type (I've even had people argue at me that it's + really a "data structure", like I have the slightest clue what + the difference is) Just Makes Sense. If you are one of those people, + then bully for you. I'm serious. I don't understand you, but + your thing probably works for you, so, right on. + + However, I do not recommend that the average newbie coder + spend too much time on classes. You'll have plenty of opportunity + when you start dissecting the lib, but my friendly advice to + the noob is to use mappings instead. I've yet to see a class + do something that a mapping couldn't do with greater clarity. + + + Section III: add_action + ----------------------- + + Yet another topic with potential for violence. The passions + can run high on this one, and in fact, the Lima team felt + strongly enough about it that they don't enable it by default. + No add_actions by default. That's hard core. + + add_action is an efun that LP muds originally depended + on for most kinds of user input. If you wanted to be able to + throw a ball, that ball needed an add_action for it. You'd + have that ball provide a user with the throw command whenever + the user came in proximity to the ball. You can see the syntax + for add_action by examining the /lib/shop.c file. + + It's simple. It works. I mean, really, It Just Works, and + it's the fastest way to add functionality to any object. People + used add_action from pretty much the genesis of LP, as far as + I can tell, and it became just a way of life. That was just + how it was done. Yes, that wording was intentional ;) + + However, there were serious problems with this parsing + scheme. Basically it let any creator, regardless of skill + level, define commands for the mud. Joe's throw add_action for + his ball could be poorly coded and worded, and was liable to + behave differently from Jon's version. + + And suppose you held two or three items that had a throw + add_action each? Which one took precedence? What if that + one was bugged? + + Using add_actions for general lib command functionality + is really problematic for this reason. It fosters a lack + of uniformity across the lib that can leave users basically + playing a "guess the syntax" game for any item like this, + and allows for conflicts by incorrectly coded items. The + natural language parser was the MudOS solution to this problem, + implementing the verb system with which you are now so + familiar. + + The controversy boils down to preference. For some people, + add_action is just How It Is Done, and you still have + people starting muds with libs like Skylib and TMI-2 (!!) + that lack an advanced lib-wide parser. For these people, + verbs are an overcomplicated mess that they just don't + have a need to understand. + + Then you have the people who find add_action anathema, and + simply an unacceptable vestige of a more primitive form of + mudding. These people view add_actioners as atavistic knuckle- + draggers, either too dumb or too pig-headed to understand the + beauty and majesty of natural language parsing. + + My view, predictably, is somewhere in the middle. Verbs + *can* be exhausting to accommodate when you're just Trying To + Do One Thing. But add_actions truly are of limited use in + a modern lib, and allowing their proliferation out of + laziness is probably a bad idea. + + That isn't to say there isn't a place for add_actions. Dead + Souls supports them, and you'll see them every now and then. + In fact, technically, every command you issue, verb + or not, is evaluated by an add_action in the mud shell object + (LIB_NMSH). It is nevertheless better to learn to use verbs, because + they eliminate many problems you don't need to reinvent the + wheel for. + + I had one person tell me, as they chose a MudOS lib that + didn't use verbs, that they planned to write their own natural + language parser in the lib. I bade him good luck. I wonder + how he's coming along these days. + + + Section IV: Thoughts on MudOS + ----------------------------- + + Like, wow. MudOS. You know? + diff -c -r --new-file ds1.1/lib/doc/guide/chapter08 ds2.0r27/lib/doc/guide/chapter08 *** ds1.1/lib/doc/guide/chapter08 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/guide/chapter08 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,346 ---- + chapter 8 "Understanding the Lib" + + One of the most common questions I get goes something + like this: "I'd like to change combat so that it is + turns-based, with actions. How would I do this?" Another + example might be "I'm setting up a farming system, with + livestock and stuff. What should I look at?" + + To me, the questions are the same. Translated into + my language, this is the meaning: "I have great ideas that + require advanced knowledge of the lib to implement. How do I do it?" + + I'm usually at a loss when I get one of these, because + I want to set people straight, but I don't want to hurt + their feelings, either. In the FAQ's, my response is + something along the lines of: + + "If there's anything in the Creator's Manual you don't + understand, you aren't ready to try this." + + I hate to say that, because I think it's probably discouraging + to hear. After all, whatever the project, it is very likely + doable. You can make an LP mud do pretty much anything + you want...that's the beauty of the flexibility of LPC. + However, as they say, with great power comes great responsibility, + and in this case, it is your responsibility to understand the + lib, if you want to make major changes to it. Let's take the + example of farming. + + Section I: Verbs + ---------------- + + It is critical to understand how verbs work in order to + do anything in Dead Souls of an advanced nature. Verbs are + basically commands that do something to your environment, + something in your environment, your "body", or something + in your inventory. + + For example, "who" is not a verb. It's a standard command, + which doesn't act on any cloned items. All it does is communicate + with the lib to query the list of users logged on, and displays + it to you in a particular manner. + + Then there's something like "zap". That *is* a verb, and + it takes cloned items as arguments. When you "zap orc" this + has a special meaning to the parsing system. The parser is the + part of the game driver that tries to interpret your input + and attempts to do something useful with it. When the parser + catches a verb at the beginning of your input, it gets to + work on figuring out how the rest of the words in the input + relate to that verb. + + This is done through "rules". You can take a look + at /verbs/creators/zap.c for the specific rules in this case. + If the word or words (for example "first orc", "orcs", "an orc") + match one or more objects in the room, the parser then + sends the arguments to the verb object. The verb object is + the loaded code from /verbs/creators/zap.c in this case. + + Depending on how the verb is coded, your command line will + succeed or fail. + + For your new farming system, you're going to need some new + verbs, so the first thing you need to do is understand verbs. + You're going to have to build new verbs like "plow", and "plant", + and "harvest". Therefore, you'll need to go over the verb + tutorial, which is at http://dead-souls.net/verbs.html + + + Section II: Lib Event Objects + ----------------------------- + + In the verb tutorial, you read that when a verb acts on + an object, the parser requires that the object have a function + that handles that verb. If a chair object lacks a function + like direct_sit() or something similar, the parser will assume + your sit verb doesn't apply to chairs, and the command line + will fail with something like "You can't sit on the chair". + + It would be incredibly tedious to have to code a sit verb + handler in every piece of furniture you create. Similarly, + your farmer's field plow *could* have a plow verb handler + coded in it, but it is much better to create a lib object that + your plow will inherit. That way, other objects can inherit + that functionality without having to reinvent the wheel, and + plowing in general will be a uniform experience across the mud. + + For example, one of the first systems I made when + I started my lib obsession was the inheritable flashlight + system. The original Dead Souls lib had regular old torches + you'd light with a match, but it seemed to me that not every + Dead Souls mud would be Sword & Sandals style, and a modern + illumination system should be available. So I set about + making a "turn" verb, so that once I had flashlights, + you could "turn on the flashlight". + + I then created the lib object /lib/events/turn.c (when + referring to lib objects, I often use the macro name. In + this case, if I'd said LIB_TURN, it would be the same thing + as saying /lib/events/turn.c). The lib object doesn't really + *do* much of anything. That object isn't really where you + need to be checking for validity of commands. What that + object does, almost *all* it does, is to have functions that + correspond to the verb "turn". That's it. It's kind of like + a socket for a plug. The verb is the plug and you're trying + to use it on something. If that something has a socket + that fits your plug, then it'll work. + + Lib event objects come in different flavors, and some + really do perform a bunch of thinking. But for the most part, + for simple verbs, all you need is a lib event object that + says "yes, I understand that verb". + + LIB_TURN is inherited by LIB_FLASHLIGHT. That means + that when you clone an object that inherits LIB_FLASHLIGHT, + it contains all the functions of /lib/flashlight.c plus + all the functions that LIB_FLASHLIGHT inherits from LIB_TURN. + + Because your flashlight inherits LIB_FLASHLIGHT, + which inherits LIB_TURN, when you issue the command line + "turn on flashlight", the parser checks with the + flashlight to see if it knows what you're talking about, + and gets a "yes, I know that verb" response. At that point + the parser says "fine, here's the rest of what this + player thinks he can do with you and the turn verb" and now + it's up to LIB_FLASHLIGHT to figure out whether it has + enough batteries, of the right kind, with sufficient + charge, and so on. + + For your new farming system, you'll need to implement + a similar scheme. Your "plow" and "hoe" verbs will need + lib event objects that can be inherited by the cloned + objects you want to plow and hoe with. + + In this case, LIB_FLASHLIGHT and the turn verb + aren't the best models for your new plowing system. This + is because your plow is something you plow *with*, + as opposed to something that *is plowed*. + + To see how a plowing system might be implemented, + take a look at the "dig" verb, LIB_DIGGING, and + LIB_DIG_WITH. This is what a shovel would use, so + that you can "dig in sand with the shovel". After + studying the dig system, and lots of trial and error, + you will hopefully eventually come up with a + plow system that will let you "plow field with plow", + for example. + + + Section III: Daemons + -------------------- + + So, now you've created a plow verb, and a plow lib + event object, it works, and now you're happily plowing + along. Let's say that the rooms field1.c and field2.c + are plowable rooms. Presumably, you don't want people + to be able to plow here all the time. The fields need + time to do their thing, and constant plowing would + slow down the growth of your tender young corn stalks. + + Normally, you might deal with this by having + a local variable in the room, so that "harvest time is + 50 hours, unless someone plows again, which + makes it take longer", this sort of thing. Let's call + that variable PlowedTimes. + + But, oh noes! The mud rebooted! Now all the rooms + have reset, and the planting and plowing variables + have reset! + You might avoid this problem by just not rebooting, + but even if you manage never ever to reboot your mud, + the mud periodically does resets of unused objects, + retiring them from memory and resetting their values + to zero. + You might avoid *that* problem by setting your + fields to be "NoClean", to avoid resets, but this is + very inelegant. Rather than ensuring the integrity + of your game data, you're just crossing your fingers + and hoping it doesn't go away. + + The solution is to use a daemon. A daemon is an + object loaded into memory that acts like an arbiter + of information. For example, STARGATE_D keeps track + of where stargates are, and which gates are in + what state, and which gates are connected to each + other. It is important to have one location where + this data can be accessed, because a new gate must + be able to know what other valid gates there are, and + it must be able to know what gates are idle and + therefore accessible. STARGATE_D is a central + repository of this data, and serves as a mediator + for connection requests, keeping things working right. + + In this case, the daemon's job would be to + keep track of which fields have been plowed, how + many times, and how long it'll take to get to harvest + time. Dead Souls daemons typically use object + persistence files ( http://dead-souls.net/ds-admin-faq.html#80 ) + to avoid losing information during object reloads or + mud reboots. A FARMING_D is exactly what you need to + keep track of and manage this kind of data. + + + Section IV: Skills + ------------------ + + To what extent should people be able to plow? How + well should they do it? If you care enough about farming + to have come this far, you've probably got ideas about + what good plowing is and what criteria a player should + have for extracting the most from their land. + + This is where skills can play an important role. + What you have to understand about skills is that they + are simply variables in a player's body. Skills don't + have to be gained by joining a class, guild, or being + member of a race. Adding a skill to a player is as + simple as having an object do something like this: + + this_player()->SetSkill("scuba diving",1); + + And if just strapping on a scuba tank does it, then + now that player has that skill. + + Now, *normally* players are granted skills through + something more sensible than just picking up an object. + It makes more sense to have skills granted when a + player is taught something by an npc, or joins a guild, + or whatever, which is why traditionally that's how + it has worked. + + So let's say you have a Farmer's Guild, then. When + you show up and sign the registry, some npc pops out, + "teaches" you the farming skills you need (by simply + adding the skills "farming" and "plowing" and "sowing" + to the player) and now you have the skills. If you + want, you can even create a Farmer class, like Fighters, + but that's up to you and not in the scope of this chapter. + + This plowing skill is totally useless right + now. It does nothing at all, because you haven't yet + coded anything that makes use of it. This is the key + concept of the skills system that you must understand. + + Just giving a player a skill does not mean that + it has any use. For a skill to be useful, there + must be lib verbs and/or objects that evaluate the + skill and perform calculations based on it. + + It is therefore time to add these skill checks to the + objects that need them. For example, suppose our + farmer's plowing skill is at level 5. This doesn't + mean he's a level 5 player necessarily, just that + at plowing, his skill level is 5. + You might have a function in your /verbs/items/plow.c + verb that checks that skill, and determines how long + the field will take to grow based on it. Perhaps + for a level 5 plower, the field will be ready for + harvest in 45 hours. Perhaps for a level 10 plower, + it would be 35. You might have either the plow verb + or the plow lib event object do something like: + + int PlowFunction(string field){ + int skill_level = this_player()->GetSkillLevel("plowing"); + + if(skill_level) skill_level *= 2; + else skill_level = 1; + FARMING_D->eventModHarvestTime(field, skill_level); + return 1; + } + + It's a silly example, but you get the idea. The + "plowing" skill is valuable because the lib uses it + in some way to modify events the player performs. If + the lib doesn't know about it, the skill has no value. + + In the case of, for example, "blade attack", the + lib checks for this if you're wielding a sword and + you're in combat. Based on how good you are at blade + attack, combat.c will modify how much damage you + inflict when you hit your opponent. + + + Section V: Special Abilities + ---------------------------- + + Perhaps "plant" and "sow" are verbs that should + only be available to players with the skills "planting" + and "sowing". + Or, if farming isn't your thing and you want to + enhance combat, you might want Fighters who are members + of the Viking Guild to have a special ability called + "massacre" that can do extra special damage. + + This is best done by simply creating the sow, + plant, and/or massacre verbs, then coding the verbs to + work only for those people you designate. If the player + isn't a Fighter and a Viking, perhaps the massacre + verb would return something like "You have no idea + how to do that." and do no more. + + You are, of course, free to implement a Special + Abilities System along the lines of the existing Dead + Souls spell system. I encourage you to do so, if + you're so inclined, and to share that code with me, + if it works. But it isn't necessary. The existing + verb system is plenty sophisticated enough to + handle such special events. + + + Section IV: Summary + ------------------- + + At this point in my lib coder development, I have + a hard time distinguishing what is easy and what is + hard for new people. I have been surprised by people + who take a long time to grasp simple concepts. I have + been surprised by people who grasp complex concepts + so quickly that I can't answer their questions. + + Where you stand in that continuum I can't say. + What I can say is that if this chapter seems like it + went mostly over your head, you shouldn't worry too + much about it. It took me years of coding experience + and months of obsessed lib analysis to reach my + current level of understanding. You should not expect + yourself to grok everything in this guidebook the + first time around. + + As suggested in the previous chapters, it's best + to start small, slow, and steady. As you build simple + things, more complex things will make more sense, and + you'll eventually reach the level of technical + expertise you need. + + This chapter was not written to make you feel + overwhelmed by what you don't know. It was written so + that you understand what you're asking when you + say "How do I revamp bodies and limbs so they have + knees and elbows you can poke people with?" + + Once you understand the lib, it really really isn't + that hard to do. But if you are a beginner, don't + set yourself up for failure by taking a leap at a + project you don't have the experience to tackle. + diff -c -r --new-file ds1.1/lib/doc/guide/chapter09 ds2.0r27/lib/doc/guide/chapter09 *** ds1.1/lib/doc/guide/chapter09 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/guide/chapter09 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,67 ---- + chapter 9 "The Future" + + In the late 1990's, Descartes @ Nightmare released + a public domain version of the Nightmare lib called + Dead Souls, and pulled the official Nightmare lib from + distribution. They were very similar, but Dead Souls + lacked documentation. + + His final realease of Dead Souls was 1.1. + + As you must know by now, from reading the FAQ's (you + *did* read the FAQ's, right?) at some point I lost my mind + and decided to dust off that old lib, get it working, and + get people using it so that I could have other people to + discuss LPC code with. + + I can honestly say I didn't know what I was getting + myself into. I mean, when I started, it sure *seemed* like + things "mostly worked". The hard part was just getting it + installed, right? + + It's now been slightly over a year since I started + realizing that fixing A broke B, and fixing B broke A + and C, etc, ad nauseam. My guiding principle was "get it + working" with a corollary of "make it work well". My + main aim was bugfixes, but where a feature gap made it + obviously difficult for a beginner, I attempted to address + it with a new system. Hence, admintool, QCS, SNOOP_D, etc. + + In other cases, a new system was trivially easy + to add and its absence was an unreasonable burden, such + as SetAction for rooms. + + Sometimes a new system comes from my desire to have + a tool that makes my own life easier while fixing the + lib, such as the medical tricorder, remote control, and + the laboratory facility east of the Creators' Hall. + + For the most part, though, my main focus has been + fixing stuff, not adding stuff. The intention has been + to release Dead Souls 2.1 as a version that is as free + of pain as possible, as clear of bugs as reasonable, and + as fun and useful as 1.1 should have been. Today it is + May 18 2006, and I think that I am very close + to that landmark. Today I am at the point where the list + of bugs consists of minor annoyances, of the kind that + players would hardly ever take note. + + The future for Dead Souls I see as lots of fun for me. + I yearn to be free of doing nothing but fix fix fix. As + great as Dead Souls is, it needs major new systems to make + it fully competitive with the libs currently out there. + Adding these new systems is the kind of fun challenge + I'd really meant to be doing all along, but suckered + myself out of. + + Post 2.1 I intend to concentrate on things like + mounts, vehicles, naval/vehicle combat, 3d travel, extending + virtual rooms, player-independent world persistence, + and lots of other fun stuff. I'm not in the habit of + making promises about the lib. As the Dead Souls community + knows, I prefer to just *make* a new system than talk + about it. I wanted to share these plans with you, though, + so that you know that Dead Souls development continues + apace, and great things are on the horizon. + + diff -c -r --new-file ds1.1/lib/doc/hbook/chapter01 ds2.0r27/lib/doc/hbook/chapter01 *** ds1.1/lib/doc/hbook/chapter01 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/hbook/chapter01 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,50 ---- + chapter 1 "Introduction" + + If you are unfamiliar with LPC based muds in general or Dead Souls + mudlib in particular, you will find this handbook valuable in + orienting you around what you can do and how you can do it. + + Keep in mind that this handbook describes the features of a mud + running an unmodifed version of the lib. The mud you are on may + differ somewhat, though probably not extremely so. + + To advance a page in a chapter, just hit "return". + + Let's start with just navigating this book. Once you are done + reading this chapter, you can read the next chapter by typing: + + %^GREEN%^read chapter 2 in handbook%^RESET%^ + + Make sure you wait until you are done reading this chapter, + though. The reason you should wait is that you are now in "reading + mode", which means that anything you type and send to the mud + is actually a command to the editing system that is displaying this + text. + + To leave reading mode (or more accurately, pager, or ed mode) + you can hit "return" a bunch of times to complete the chapter, thus + automatically exiting the pager. Another way is to enter the + letter "q" (without the quotes) and then "return". That will also + make you stop reading. + + When you are not in reading mode, you can find out the chapter + titles by typing: + + %^GREEN%^read index in handbook%^RESET%^ + + You really should read the whole thing, but in case you don't, the + chapter titles will help as a reference to find the information you + need. + + Something to watch out for is that if you or your environment + contain another handbook, the mud may not know which one you are + trying to read. If you get a message like "Which of the two handbooks + would you like to read?", you can try one or more of the following: + + %^GREEN%^read index in first handbook%^RESET%^ + + %^GREEN%^read index in my handbook%^RESET%^ + + %^GREEN%^read index in my first player handbook%^RESET%^ + + diff -c -r --new-file ds1.1/lib/doc/hbook/chapter02 ds2.0r27/lib/doc/hbook/chapter02 *** ds1.1/lib/doc/hbook/chapter02 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/hbook/chapter02 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,273 ---- + chapter 2 "Command Syntax: Doing Stuff" + + + Section 1: Manipulating Objects + ---------- + + You've already noticed that Dead Souls, like most modern LP muds, + uses natural-like command syntax, like: + + %^GREEN%^read first handbook%^RESET%^ + + rather than: + + %^GREEN%^read handbook 1%^RESET%^ + + This is because Dead Souls uses a natural language parser. It isn't + perfect, of course. If you try to "put all apples from box in my bag after + opening them" you won't see much success, but this will work: + + %^GREEN%^open box%^RESET%^ + + %^GREEN%^open bag%^RESET%^ + + %^GREEN%^get apples from box%^RESET%^ + + %^GREEN%^put apples in bag%^RESET%^ + + The parser will understand "the first box" or "my second bag", + assuming those objects exist in your inventory or in your environment. + + If you want to know what is in the box, the command is: + + %^GREEN%^look in box%^RESET%^ + + The command "look at box" or "examine box" will usually *not* show + you the contents of that box. This is because normally, boxes are + opaque, and in the real world, just looking at a box is rarely enough + to see what it contains as well. + An exception to this rule are transparent containers (a glass + trophy case, perhaps) whose interior is always visible from the + outside. + + Sometimes looking at an object reveals its contents because of + the nature of the object. A table, for example, can have things on it, + and typing: + + %^GREEN%^look at table %^RESET%^ + + ...will usually let you know what is on it. It is also possible to + see what other players are carrying by just looking at them, + unless what they have is inside a container. + You'll want to remember that while you can "put apple in bag", + if you want to put that apple on a surface like a table, you'll + need to: + + %^GREEN%^put apple on table%^RESET%^ + + You can give things to people, and they will automatically + accept them. However, you may not "take" or "get" things from living + beings. It's theirs, and it's up to them if they want to share. + You can try to "steal sword from fighter" if you dare, but unless + you have trained a lot, this is unlikely to succeed. We'll talk + more about training and skills in a later chapter. + Naturally you may also drop things you no longer need, though + it's nicer to your fellow mudders (and the mud's memory) to put + them in recycling bins so the bits can be reused. + Some other common object manipulation commands are: + + close, donate, attack, eat, drink, listen, smell, search, + shoot, touch, turn. + + There are many others you may find useful, but these will be + the ones you use most often to handle simple objects. + + * A note about articles: + + Dead Souls understands both definite and indefinite articles. + This means that you can refer to a specific apple, like so: + + %^GREEN%^get the apple%^RESET%^ + + But you can also be unspecific. If there are a dozen + apples in a crate and you don't care which one you pick up: + + %^GREEN%^get an apple from the crate%^RESET%^ + + + Section 2: Navigation + --------- + + Moving around here is probably much like any other mud. You + can expect to move mostly in cardinal directions (like north and + northwest), but you may sometimes need to go up, down, or out. + Strictly speaking, the way to do this is: + + %^GREEN%^go south%^RESET%^ + + %^GREEN%^go out%^RESET%^ + + ...and so on, but this can get tedious after a while. Instead + of having to type in "go" plus the entire direction, the mud allows + you to enter shortcuts like "sw" for "go southwest" or "u" for + "go up". + + When you enter a room, very often you will see letters in + brackets above the room description, like this: [n, u, out] + These are the "obvious exits" of that room, and help you + quickly find your way around without having to go through each + description. But remember! Just because a room has obvious exits + doesn't mean those are the only exits. Sometimes a room must + be searched to discover an exit, or there may be an exit available + that just doesn't happen to be very obvious. + If a room is dark, obvious exits may not be visible at all. + + Aside from those ordinary means of travel, there are situations + that require more specific locomotion than just "go". These are + examples of the use of some other commands to get around: + + %^GREEN%^jump onto road%^RESET%^ + + %^GREEN%^enter window%^RESET%^ + + %^GREEN%^climb ladder%^RESET%^ + + %^GREEN%^crawl east%^RESET%^ (if you are lying down and can't get up) + + %^GREEN%^fly up%^RESET%^ + + %^GREEN%^follow thief%^RESET%^ + + %^GREEN%^evade hunter%^RESET%^ + + + Section 3: Armor + ------- + + Now that you can manipulate objects and move around, you'll want + to be able to defend yourself, should the need arise. The special + object categories of "weapons" and "armor" should help. + + Armor is an item that can be worn. That means that a pair of + blue jeans is considered armor, and a suit of chainmail is considered + armor as well. Basically, if you can wear it, it's "armor", because + whether it's a lot or a little, it protects you. + Assuming you are humanoid, you have the following limbs: + + head, neck, torso, right arm, right hand, left arm, + left hand, right leg, right foot, left leg, left foot. + + Properly coded armor must be worn on the corect limbs. Usually + a command like: + + %^GREEN%^wear chainmail%^RESET%^ + + or + + %^GREEN%^wear all%^RESET%^ + + ...will cause you to automatically wear armor where it makes + most sense. However, it is possible to find armor that, + for example, can be worn either on your neck or your torso, like + an amulet. If this is so, you'll need to specify where you want it. + There are various types of armor, like cloak, pants, glove, + etc. Many of them overlap. You can wear a shirt on your torso as + well as a cloak and combat armor, but you may not wear two of + the same type. If you have a robe and a cape that are both cloaks, + you'll have to decide which one is going on. + You will find that shoes and gloves are often for one of your + hands but not the other. Sometimes you will find shoes, or gloves + that don't care which appendage they occupy, but usually these + are simply incorrectly coded. + + If you are of some exotic or non-humanoid race, you may have + additional limbs to consider, and humanoid armor may not work for you. + + + Section 4: Weapons + --------- + + You may be surprised to learn that almost any manipulable object + can be wielded as a weapon, or thrown as a missile. You can wield + a can of Spam and try to kill an orc with it...and you may even succeed, + if you are strong and tough enough. Don't count on it, though, + and instead go for items that are made specifically with personal + security in mind. + + There are four main types of weapons: + + knife: knives, daggers + blade: like swords, and spears + blunt: like clubs, staves, and shillelaghs + projectile: things designed to be thrown, like darts or grenades + + Unless it is a special device or magical item, weapons + must be wielded in order to be of use in combat. Some weapons, + like staves or pikes, may require the use of both hands. If this + is the case, wearing a shield may not be possible at the same time. + Like armor, weapons differ in quality and effectiveness. A + "well-crafted sword" is probably a better choice than a "small + rusty knife", but then again, you never know. Maybe rusty knives + are exactly what some monster is most vulnerable to. + + Note also that, like armor, weapons wear down with use. + Examples of commands that involve weapons or fighting: + + %^GREEN%^wield sword%^RESET%^ + + %^GREEN%^wield hammer in left hand%^RESET%^ + + %^GREEN%^wield staff in left hand and right hand%^RESET%^ + + %^GREEN%^unwield dagger%^RESET%^ + + %^GREEN%^shoot gun at otik%^RESET%^ + + %^GREEN%^throw dart at beggar%^RESET%^ + + %^GREEN%^kill all%^RESET%^ (this makes an enemy of everyone in the room) + + %^GREEN%^ignore first orc%^RESET%^ (lets you concentrate on the other orcs) + + %^GREEN%^ignore all%^RESET%^ (don't fight anyone in the room, even if they are attacking you) + + %^GREEN%^target boss orc%^RESET%^ (this makes you ignore attacks from anyone else) + + %^GREEN%^wimpy 30%^RESET%^ (this makes you run away if your health points drop below 30%) + + + Section 5: Miscellaneous Things to to with Things + --------- + + %^GREEN%^turn on flashlight%^RESET%^ + + %^GREEN%^turn off flashlight%^RESET%^ + + %^GREEN%^strike match%^RESET%^ + + %^GREEN%^light torch with match%^RESET%^ + + %^GREEN%^extinguish match%^RESET%^ + + %^GREEN%^dig hole with shovel%^RESET%^ + + %^GREEN%^move bed%^RESET%^ + + %^GREEN%^search %^RESET%^ (by default searches the room) + + %^GREEN%^search rocks%^RESET%^ + + %^GREEN%^unlock east door with silver key%^RESET%^ + + %^GREEN%^bait pole with worm%^RESET%^ + + %^GREEN%^fish with pole%^RESET%^ + + %^GREEN%^stop fishing%^RESET%^ + + %^GREEN%^drop all%^RESET%^ + + %^GREEN%^donate 2 silver%^RESET%^ + + %^GREEN%^get all%^RESET%^ + + %^GREEN%^get all from corpse%^RESET%^ + + %^GREEN%^sell first right glove to otik%^RESET%^ + + %^GREEN%^sell all to otik%^RESET%^ + + %^GREEN%^buy sword from otik%^RESET%^ + + %^GREEN%^buy 8 from otik%^RESET%^ (get Otik to sell you item number 8) + diff -c -r --new-file ds1.1/lib/doc/hbook/chapter03 ds2.0r27/lib/doc/hbook/chapter03 *** ds1.1/lib/doc/hbook/chapter03 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/hbook/chapter03 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,255 ---- + chapter 3 "Your Health and Abilities" + + In the previous chapter you learned the basics of getting + around and taking care of yourself. It's important also to care + *for* yourself, and this chapter describes the various aspects of + your body's state and what abilities you may have. + + + The command that tells you almost everything you need to + know is "stat". This diplays a whole lot of stuff, perhaps some of + it completely unfamiliar. Let's start at the top, using my output + as an example. + + First line: + ---------- + %^CYAN%^Cratylus aka Cratylus the unaccomplished, level 10 male human Explorer%^RESET%^ + + Here you see my short name, my name with title, my level, my + gender, my race, and my class. Let's go over each. + + * short name: What a person would use to address you. "look at cratylus", + for example. + + * name with title: This displays my title. Creators can have whatever title + they want. Players can only have the titles they earn. As a player, a + title is usually earned when you are promoted a level or complete a + quest, though it is not always so on every mud. + + * level: This is a measure of your overall experience, expertise, and + all-around game status. Being promoted a level means your skills, + health, and vital statistics increase. This often means you can handle + tougher monsters, for example, or tackle more challenging quests, learn + new spells, and so on. + + * gender: This has no effect on your status. It is a cosmetic feature + of your body that is only useful to you in the social context of your + fellow mud players. + + * race: In Dead Souls, race has nothing to do with your local genetic + makeup on planet Earth. In the mud, "race" refers to what one typically + would call "species" in real-life. An example of a race other than human + might be "orc" or "feline". Not all races are available for players. Once + you have chosen a race to play, it is in theory possible to change it, but + there is a nonzero chance you'll hose up your player file and lose your + character forever. Besides, it's up to your local admins whether race + changing is permitted on your mud. Different races have different + abilities. Elves see better in darkness, for example. Orcs are stronger + than some other humanoids, but dumber, too (which does affect gameplay). + + * class: This can be considered an occupational specialty. In the real + world you have plumbers, doctors, soldiers, etc. In the mud world, + we can have explorers, fighters, mages, and the like. Each class brings + its own unique advantages and disadvantages to your gameplay. A fighter + can really kick more butt in melee combat than a mage, but a mage + gets to cast powerful spells. Explorers are a middle of the road class + that gives you a bit of everything without specializing in anything. + + + + Next line: + ---------- + + %^CYAN%^Alive / Awake%^RESET%^ + + It is indeed possible for your virtual body to cease life functions. + When this happens your spirit speeds off to the land of the dead, + where you drift until you decide to "regenerate" and regain your + physical form. Except for some special magical items, anything you + were carrying when you died is with that dead body, so it's a good + idea to rush your new body back to the scene of the fatality and get + your stuff back before someone else grabs it. Death is not only + inconvenient, it also incurs major penalties on your statistics, so it + should be avoided. + It is also possible to sleep. If you are drunk and asleep, your + injuries will heal more quickly. It's magic, don't worry about the + logic behind it. + If you are attacked while sleeping, you will wake up. You can + force yourself awake, too, but it's a bit tedious. + + + Next line: + --------- + + %^CYAN%^Health: 350/350 Magic: 560/560 Stamina: 400/400 Carry: 1184/1300%^RESET%^ + + In each case, the number on the left of the slash indicates the + current level, and the number on the right indicates what the maximum is. + + health: When I am 100% healthy, I have a total of 350 hp. If my hp ever + reach 0 or less (!), I die. Poison and illness can cause hp's to + gradually decrease, and although with time my hp's will normally + return to 350 as I heal, poison and illness can slow down that healing + or even cause me to die. Injury in combat is the most common source + of hp loss, though spells, falls, and other adverse events can cause + you injury or death. + + magic: I cast magic missile! Spell casting takes a toll on your magical + abilities, and mp measure how much magic you've got left in you at + any given point. Like hp, mp gradually grow back to your max if you + avoid spellcasting for a while. + + stamina: Fighting is tough work, and swinging around swords while + getting bashed with hammers really takes a lot out of a guy. Therefore + keep an eye on this stat while you're fighting, because if it gets too + low you will collapse and be unable to do anything for a while. + + carry: Objects have mass, and your body is of limited size and strength. + My carry capacity is 0 when I carry nothing, and 1300 when I can + carry no more. Creators are allowed to exceed their bodies' carry + capacity, but players cannot. + + + Next line: + --------- + + %^CYAN%^Food: 0 Drink: 0 Alcohol: 0 Caffeine: 0 Poison: 0 %^RESET%^ + + These are pretty self-explanatory. Alcohol is good for healing, + bad for fighting. Food and drink also help speed healing. Poison + has the opposite effect. Caffeine can speed up your combat slightly, + but tends to prevent full rest. + You will not die from lack of food or lack of drink, but you + will do better with a body not starved for nutrients. + Your maximum load for any of these is not fixed, and varies + depending on many factors, such as level, endurance, etc. + + + Next line: + --------- + + %^CYAN%^Training Points: 0 Quest Points: 0 Experience Points: 50 %^RESET%^ + + Training points can be cashed in with special NPC's called + trainers, who can help you improve some skills. A trainer that + specializes in fighting might be able to raise your "blade attack" + skill, for example. you earn training points when you are + promoted a level. + + Quest points are awarded when you complete a quest. In + the default version of Dead Souls, you cannot advance past a + certain player level unless you earn some qp's. Read the sign + in the adventurers guild for more details on this. + + Experience points can be awarded for various reasons: completing + a quest, solving a puzzle, winning a contest. Most often you + will receive xp after killing an NPC. The amount of xp awarded + will depend on the level of the NPC. Like qp, xp are needed to + qualify for level advancement. + + + + Limb section: + ------------ + + Remember how wearing armor requires the right body parts? + Well here they are, and this is their health. You can issue the + "body" command for a quicker self-check. + Let's look at what the numbers mean with an example: + + %^CYAN%^left leg (2) 160/160%^RESET%^ + + Obviously the first item identifies the limb in question. + + The (2) is a kind of "importance score", indicating how critical + a body part is. If this number is (1), like the head, it means that + losing that limb causes immediate death. + + The number on the right side of the slash indicates the hit point + damage you may receive on that limb before it is severed. The number + on the left is how many of those hits you have left. + It doesn't mean my leg has 160 of my hitpoints. If that were true, + my hit points would add up to a heck of a lot more than 350. + This means that if I've lost, say, 200hp fighting a troll, and + 159hp of those hits were on my left leg, getting hit there again means I + lose my left leg. + I would then collapse and have to crawl away to seek medical attention. + Wearing armor on your limbs is a great way to minimize the danger of + this happening. + + + Skills section: + -------------- + + Let's review skills by examining one of mine: + + %^CYAN%^blade attack (1) 00% - 20/24%^RESET%^ + + This measures how likely I am to hit an opponent when I + use a blade, and how good a hit it was. The number (1) means + that this is a skill critical to my class. If an explorer can't + swing a sword, he oughta think about another line + of work. + The 00% means I have thus far earned no blade attack + experience toward achieving the next level of this skill. + The 20 is my current proficiency level. + The 24 is the maximum level I can reach at my current + player level and with my current stats. + + What's all this mean? Well, if I practice a lot of blade + attacking, that 00% will gradually climb up to 99, and one more + point causes me to go from a level 20 slicer of things to a + level 21 slicer of things. This increases my likelihood of + hitting my target in the future. + + Meaning, in short, practice a skill, and you'll get + better at it. + + Of course, if my blade attack level reaches 24, I can advance + my blade attack skills no further until my player level rises. + + + Stats section: + ------------- + + Remember these from Dungeons & Dragons? No? Well these vital + statistics measure your general giftedness in that feature of your + body. Let's look at one of mine: + + %^CYAN%^coordination (2) 42/42%^RESET%^ + + Coordination is one of those important stats for fighting and + such. The more coordinated you are, the more likely you are to hit your + target. The (2) indicates that this stat is important to my class, + but not critical. This influences its effect on my skills. + 42/42 means that my coordination is not currently impaired. If + someone cast a "stumble" spell on me, for example, this might look more + like 30/42, and if I were drunk, it would look very shabby indeed. + + Last section: + ------------ + + "Cratylus has amassed a net worth of 11 gold." means that when you + add up the money in my bank accounts and the money I'm carrying, + converted to gold, I have 11 gold to my name. It looks bad, but gold + is actually quite valuable in the default Dead Souls economy. + + "Money on hand: 79 dollars, 34 silver" means that this is the amount of + money I'm carrying. Don't forget that the amount of money you are carrying + affects your overall carry capacity. Gold is an especially heavy + currency. + + + Final notes: + ----------- + + "stat" is a great command to get thorough information about + yourself. It is, however, quite a screenful. Briefer reports can be + viewed with the following commands: + + %^GREEN%^body%^RESET%^ + %^GREEN%^skills%^RESET%^ + %^GREEN%^stats%^RESET%^ + %^GREEN%^score%^RESET%^ + %^GREEN%^status%^RESET%^ + diff -c -r --new-file ds1.1/lib/doc/hbook/chapter04 ds2.0r27/lib/doc/hbook/chapter04 *** ds1.1/lib/doc/hbook/chapter04 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/hbook/chapter04 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,69 ---- + chapter 4 "Quests" + + Some muds don't have quests, and the fun people have is + through role-playing and social activities with other players. + + Other muds prefer to concentrate on killing lots and lots + of monsters, a lot, over and over. + + Quests give you a chance to problems-solve by performing some + series of actions that satisfies a pre-determined requirement. + + For example, Dead Souls' sample town contains a quest called + Orcslayer. Leo the archwizard lives in the basement of the old + abandoned church, and he has lost a powerful magic sword called + "Orcslayer". If you return it to him, he will reward you with + experience points, quest points, and a new title you can use. To + complete the quest, you need to defeat the warrior orcs, penetrate + deep into their lair, defeat the orc shaman, and take Orcslayer from + his corpse, then go to the church basement and give the sword to Leo. + + In this case, if you're a level 1 newbie, the orcs will massacre you + before you get anywhere near the shaman. So either team up with + friends to tackle the orcs together, or raise your level to the + point where you're tough enough to take them on. + + To raise your level, wander around in the newbie mansion, which + is south of the village church. + + There's lots of loot there you can sell at Otik's shop, and with the + cash you can then get some proper weaponry and armor. + + Silver is heavy, so don't try to carry all your money around + all the time. Request an account from Zoe the banker and keep your + money there until you really need it. + + There is a quest in the newbie mansion, and solving it by + finding the secret room will give you experience and quest points too. + (hint, there might be more than one secret room) + + Once you have enough experience and/or points, go to + Dirk in the adventurers hall and "%^GREEN%^ask dirk to advance%^RESET%^". + + Make sure you learn some spells from Herkimer, because if you + go up against a bunch of orcs in their lair, you'll want spells to + shield you from attacks, and spells to recover your strength after + combat. As a non-mage, your spell abilities will be limited at + lower levels, but as you gain levels you'll get better. Also, spells + will rarely work after you first learn them. Keep casting them, + even if you screw them up, so that your magic skills increase. + + Also, save your money. Drinking and sleeping help you heal, + but not fast enough. By the time those natural processes finish + and you're ready for combat again, the orcs may have gotten reinforcements. + So if you can afford it, buy healing slips and use them at Clepius' + healer's guild. His treatment is expensive, but you will heal much + more quickly. + + In the tragic event of the loss of a limb, Clepius can also magically + regenerate a new limb...but obviously at some great cost. + + There. I've just spoiled the Orcslayer quest for you. Normally, + all you'd know about a quest is a cryptic clue, like the one in the + scroll in the adventurers guild. Instead I've just spoiled the quest + for you by telling you all about it. They're more fun when you have to + figure them out on your own, like puzzles. + + Normally, spoiling quests like this is a bannable offense on + a mud, so if you solve a quest, keep it to yourself unless you know + the admins on your mud don't mind. diff -c -r --new-file ds1.1/lib/doc/hbook/chapter05 ds2.0r27/lib/doc/hbook/chapter05 *** ds1.1/lib/doc/hbook/chapter05 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/hbook/chapter05 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,106 ---- + chapter 5 "Communication" + + There are many ways to communicate with other players. If + you're in the same room as your intended listener, you can just + use the "say" command, like this: + + %^GREEN%^say hi, crat%^RESET%^ + + If the message is secret, you can "whisper": + + %^GREEN%^whisper to cratylus are you idle?%^RESET%^ + + If you want to say something that everyone in the mud can + hear, use the "shout" command (at the cost of a lot of stamina): + + %^GREEN%^shout hey crat, wheredya go?%^RESET%^ + + Or, if it's an important secret and the target is not in the + same room as you, you can use the magical "tell" command: + + %^GREEN%^tell cratylus are you mad at me or something?%^RESET%^ + + + There are also special communication lines on the mud that are + class or role-specific. For example, if you type: + + %^GREEN%^newbie does anyone know what's up with cratylus?%^RESET%^ + + All people who are tuned into the newbie line will get + your message. To see what lines are available to you, type: + + %^GREEN%^lines%^RESET%^ + + To see who is listening to the newbie channel: + + %^GREEN%^list newbie%^RESET%^ + + To see who is listening to some other channel on some other mud: + + %^GREEN%^list otherchannel@othermud%^RESET%^ + + + To enable or disable a line, just type the name of it with no message. + + To see a brief history of the past few messages on a line (in + this case, the newbie line), type: + + %^GREEN%^hist newbie%^RESET%^ + + + Spamming lines is rude and probably dangerous to your character, so + be sure you comply with your mud's rules on lines. + + + Your mud may be on the intermud network. To find out, type the + command: + + %^GREEN%^mudlist%^RESET%^ + + If a list of muds comes up, you know your mud is probably + on the intermud3 communication network. Dead Souls by default restricts + players from access to intermud channels, but you can "tell" to + players on other muds, if you want. If you think your friend Xyzzy + is online on a mud on intermud3, you can issue this command: + + %^GREEN%^locate xyzzy%^RESET%^ + + If he's logged into a mud on i3, you will get something like: + + Xyzzy was just located on Frontiers. (idle 00:03:17) [status: inactive] + + You can then tell to him: + + %^GREEN%^tell xyzzy@frontiers dude, what's the deal with crat lately?%^RESET%^ + + + Sometimes a player or NPC does not understand your character's + native tongue. For example, if you are en elf, your native tongue is + not English, it is Edhellen. If someone talks to you in English, you + might see something like this: + + Xyzzy says in English, "leka mifahmam, potong-hwa." + + Since your character doesn't speak English, what you see is gibberish. + If you find a language teacher, your proficiency in the language they + teach you will allow you to understand more of the words you hear. + + Suppose that your elf character is now 100% fluent in English. + If you greet a human player named Xyzzy by typing: + + %^GREEN%^say hello there, xyzzy%^RESET%^ + + Xyzzy will probably see something like: + + Noobie says in Edhellen, "pericolo temak, forshtor." + + Instead, if you want to speak to a human, you'll have to type: + + %^GREEN%^speak in english hello there, xyzzy%^RESET%^ + + + To find out what languages you speak, type: + + %^GREEN%^language%^RESET%^ + + diff -c -r --new-file ds1.1/lib/doc/hbook/chapter06 ds2.0r27/lib/doc/hbook/chapter06 *** ds1.1/lib/doc/hbook/chapter06 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/hbook/chapter06 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,13 ---- + chapter 6 "Note to New Creators" + + You should probably hang on to this book for reference. If + you lose it, pick up a copy at the adventurers hall. + + However, you need to start reading the Creators Manual. If + you don't have one on you, get the one in the chest in your workroom. + + If you're new to coding, start with chapter 31. It'll + get you started with the Quick Creation System, or QCS. + + Cratylus @ Frontiers + 04 Jan 2006 diff -c -r --new-file ds1.1/lib/doc/hbook/chapter07 ds2.0r27/lib/doc/hbook/chapter07 *** ds1.1/lib/doc/hbook/chapter07 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/hbook/chapter07 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,71 ---- + chapter 7 "Hints and tips" + + * The "wimpy" command helps you avoid death due to inattention or + network lag. If you "wimpy 20", you will automatically try to escape + combat if your health goes below 20% of your maximum. + + * "target" and "ignore" are extremely useful when fighting more than + one enemy. You should always target the toughest npc first, and + always ignore any npc who can't get up because their foot or leg + is severed. + But if they collapse due to exhaustion, it's a good idea to keep + beating on them, otherwise they may get back up and get healthy sooner + than you expect. + + * By default, different races speak different languages. If someone + says something to you and you see no words in the same language as + the rest of the mud, it means they are speaking a language you do + not understand. + For example, if you are an elf, and you ask Radagast to teach + magic attack, you might get something like this: + + Radagast exclaims in English, "embleer con boltehe oota goota nehi auch" + + Even though in the real world you may speak English fluently, in + the mud world, you do not speak English fluently. As an elf, your + native tongue is Edhellen, and you may find human speech incomprehensible. + + If you find a trainer to teach you English, your skills in that + language will need time to improve. As you get better at a language, + you will see fewer gibberish words. + + If you are a "newbie", this does not apply to you. A newbie in the + default Dead Souls distribution is a player at level 4 or below. This + definition may be changed by your admin. + Newbies need all the help they can get just to survive, so they + are magically granted understanding of all languages, until they outgrow + their naivete. + + If you are a student of languages in the Real World, you may + recognize many of the "gibberish" words used by Dead Souls to represent + a foreign tongue. Your understanding of these words is not useful in + the context of the game, however, because they are not intended to + convey meaning other than "non-comprehensible words". + + + * Your ability to see is affected by various things: + + - A room's ambient light level + - Time of day + - Local light sources (flashlights, torches, etc) + - Your race's light sensitivity + - Magical effects + - Exposure to an excessive-light event + + It's important to remember that a room may be too dark for + you to see everything in it. You might be able to see the description + of a room with no problem, but it may be necessary for you to + light a torch in order to see the treasure chest there. + + In the same way that darkness can impair vision, brightness + can do the same. For elves, an outdoor area in bright sunlight that + contains additional light sources can be just as hostile to + vision as a dark cave with no torch would be for a human. + Regardless of race, a sufficiently adverse event, such as + a bright flash or special spell, can render you temporarily blind. + + As with languages, newbies have some exemption to light-level + limitations. + + * Mages can wield knives but are pretty much helpless with any other + vind of edged weapon. diff -c -r --new-file ds1.1/lib/doc/help/classes/cleric ds2.0r27/lib/doc/help/classes/cleric *** ds1.1/lib/doc/help/classes/cleric Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/help/classes/cleric Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,27 ---- + Dead Souls LPMud Cleric Class + Originally written 951129 by Descartes of Borg + Last modified 951129 + + The cleric holds the natural world in highest esteem, shunning + violence and things unnatural. They specialize in the healing arts + and defense against magic and blunt weapons. They also have powers of + faith which draw from the gods of the natural world they worship. + + A person who chooses to play a cleric will never fight powerfully. + Instead, people playing clerics + play the class because they enjoy working with teams to accomplish a + task and also because they love helping others. Clerics are most + often seen as doctors or party healers in adventuring groups. + + One exception to the cleric non-violence oath is their power over the + unnatural world of the undead. Their faith bestows upon them the + ability to rid the world of the undead, or to bring the undead back to + the world of the living. + + Primary Skills: + faith + healing + blunt defense + magic defense + + diff -c -r --new-file ds1.1/lib/doc/help/classes/mage ds2.0r27/lib/doc/help/classes/mage *** ds1.1/lib/doc/help/classes/mage Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/help/classes/mage Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,22 ---- + Dead Souls LPMud Mage Class + Originally written 951202 by Descartes of Borg + Last modified 951202 + + Mages are powerful magic users who make their livings through their + magical talents. They are an integral piece to any adventuring group, + as many situations require the use of magic to change the way the die + have been cast. Given so much attention to the magic arts, however, + mages find themselves poorly suited to weapon-based combat. Thus, + when engaged in combat, mages tend to rely instead on their magic + talents to avoid damage and strike at their opponents. + + The mage class is perhaps better suited to the hack-n-slash style of + player, through role-players and socials can likely find attractive + characteristics in a well played mage. + + Primary Skills: + conjuring + magic attack + magic defense + projectile defense + diff -c -r --new-file ds1.1/lib/doc/help/classes/thief ds2.0r27/lib/doc/help/classes/thief *** ds1.1/lib/doc/help/classes/thief Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/help/classes/thief Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,20 ---- + Dead Souls LPMud Thief Class + Originally written 951202 by Descartes of Borg + Last modified 951202 + + Thieves are an extremely varied bunch of scum who spend their days + practicing the less accepted crafts of society. Though skills such as + lock picking are often desired in adventuring parties, skills such as + stealing make people avoid them. + + Thieves are designed for people who like to role-play and adventure in + groups. The role-player will find the unique character of being a + thief challenging, and people who enjoy group adventuring will find + their skills in high demand. + + Primary Skills: + bargaining + stealing + stealth + knife attack + diff -c -r --new-file ds1.1/lib/doc/help/creators/addemote_help ds2.0r27/lib/doc/help/creators/addemote_help *** ds1.1/lib/doc/help/creators/addemote_help Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/help/creators/addemote_help Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,50 ---- + [ Addemote General Help ] + + Note: All examples are from the 'emoter' perspective. + Basic emote: $N smile $A. + - $N is the name of the emoter. $N *must* be used in both + (emote) and (environment) fields to preserve functionality. + This means do not enter 'You smile $A.'. + + - $A field means the user can specify any adverb from the soul's + pool of adverbs. (This also applies to any specific adverbs + (assigned to the emote). If the user does not specify an adverb, + and no default adverb is set, this field is ignored. + + Targeted Emote: $N smile $A at $T + - $T field displays the name of the target (player). If no + target is found, A 'no target' emote will be used in place + of targeted. + + Locations: $N pokes $A $T $X + - $X acts the same as $A, only it searches through a list + of locations assigned to the emote in question. If no + location is specified by user, and a default setting exists, + it will be used automatically. Otherwise, $X is simply ignored. + Note that all locations are prepended with an assigned + preposition (if used). (example: locations set to 'nose, head, + ear', preposition set to 'on the'. + + Extra Field: $N scratch $* + - If the $* field is used, all lefteover arguments will be + put here. + + [ List of valid fields ] + + $N - Name of the 'emoter' + $T - Name of target + $NP - emoter possessive (his) + $TP - target possessive + $NO - emoter objective (him) + $TO - target objective + $NR - emoter reflexive (himself) + $TR - target reflexive + $NA - possessive form (name's) + $TA - target possessive name + $A - display adverb (ignored if + none is specified by user) + $X - display defined location + (prepended with preposition if used) + $* - display any extra arguments passed by user + + diff -c -r --new-file ds1.1/lib/doc/help/creators/admin ds2.0r27/lib/doc/help/creators/admin *** ds1.1/lib/doc/help/creators/admin Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/help/creators/admin Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,43 ---- + Dead Souls Administration + + Being a successful MUD admin is heavily dependent + on how well you can get stuff done. It also depends on + your ability to manage people, resolve conflict, articulate + direction, enforce guidelines, and inspire loyalty. + But those other things I can't help you with. What + I can help you with is having the tools you need to get + stuff done. + + Your most valuable tools will be the Dead Souls FAQs: + + http://dead-souls.net/ds-admin-faq.html + + http://dead-souls.net/ds-creator-faq.html + + Almost everything else will flow from your + familiarity and understanding of the information there. + + Navigate to the /secure/cmds/admins directory. This + is where your commands are. Know them. Understand them. + In particular, pay close attention to the command: + + admintool + + It is a valuable tool for new admins to get important + stuff done before they are 100% familiar with everything + they need. + + Finally, the intermud Dead Souls community is a + vital resource. They are (thus far) friendly and helpful, + and if the Player's Handbook, Creator's Manual, and + the (upcoming) Admin's Guide don't have the answer, use + the <ds> channel to ask for help. + + As to the qualities of leadership, determination, + humility, responsibility, fairness, and selflessness you'll + need to make a successful mud, you are on your own. + + Good luck. + + - Cratylus @ Dead Souls + 05 May 2006 diff -c -r --new-file ds1.1/lib/doc/help/creators/creation ds2.0r27/lib/doc/help/creators/creation *** ds1.1/lib/doc/help/creators/creation Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/help/creators/creation Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,21 ---- + Dead Souls Quick Creation System + + One of the biggest obstacles to creating a large area is the tedious nature + of coding every last detail by hand, using the ed editor. + + This new creation system helps relieve the tedium by providing + a way to quickly create working stuff, which you can then conveniently modify + without having to continually muck about in ed. + + There are still things you need to do with ed, such as searches, complex + exits, and the like, but the bulk of your building will go much more + quickly using the new system. + + A thorough builder's manual on using the new system is in the works. + + In the meantime, take a look below at the commands in actual use, with a + few added comments: + + http://dead-souls.net/example.html + + diff -c -r --new-file ds1.1/lib/doc/help/creators/creator_general ds2.0r27/lib/doc/help/creators/creator_general *** ds1.1/lib/doc/help/creators/creator_general Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/help/creators/creator_general Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,21 ---- + Common Creator commands: + + File commands: + ------------- + cp - copy a file + mv - move or rename a file + cd - change your working directory + ls - list the contents of your directory + ed - edit a file (WARNING: if you get stuck, type a + single period on a blank line, then Q, then enter) + rm - delete a file + more - page through the contents of a file + cat - display the entire contents of a file + update - load a file into memory + + Creation commands (used on objects, not files): + ------------- + create, modify, reload, delete, add, copy + + For more information on a command, type: help <commandname> + See also: help help diff -c -r --new-file ds1.1/lib/doc/help/creators/debug_hints ds2.0r27/lib/doc/help/creators/debug_hints *** ds1.1/lib/doc/help/creators/debug_hints Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/help/creators/debug_hints Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,48 ---- + There is another LPC debugging technique that provides a good supplement + to the debug(x,y) macro provided by debug.h. + + Suppose that your object won't load and the logfile isn't specifying where + the error is. You can use the #if 0 preprocessor directive to selectively + temporarily remove suspect pieces of your code. Note that using #if 0 is much + cleaner than commenting the code out using /* and */. One reason its cleaner + is that it is possible to nest #if directives but not comments. Another + reason is that you can add the code back simply by changing #if 0 to #if 1. + + Suppose you had the following function that was giving you problems: + + void xyz() + { + statement_1(); /* statement 1 does blah blah */ + statement_2(); /* statement 2 does blah blah */ + } + + Suppose you suspected that statement_2() was causing the error. You could + temporarily remove that line by changed xyz to read: + + void xyz() + { + statement_1(); /* statement 1 does blah blah */ + #if 0 + statement_2(); /* statement 2 does blah blah */ + #endif + statement_3(); /* statement 3 does blah blah */ + } + + Suppose that you had used comments instead of #if 0 to remove statement_2(). + + Suppose you tried it like this: + + /* + statement_2(); /* statement 2 does blah blah */ + */ + + This method would cause a compile error because of the nested comments. + + Therefore, it would have to look something like this: + + /* statement_2(); */ /* statement 2 does blah blah */ + + But this method is bad because its a royal pain to insert and remove comments + within a line using the ed line editor (IMHO). + + --Truilkan@TMI diff -c -r --new-file ds1.1/lib/doc/help/creators/debug_macro ds2.0r27/lib/doc/help/creators/debug_macro *** ds1.1/lib/doc/help/creators/debug_macro Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/help/creators/debug_macro Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,44 ---- + The debug.h include file provides a very simple yet suprisingly powerful + debugging mechanism. The benefits provided by debug.h include: + + 1) conditional compilation - meaning that debug(x,y) expands to an empty + statement (;) if DEBUG_MACRO is not #defined. This lets you leave in debug + statements in case something goes wrong at a later time (in which case + you simply #define DEBUG_MACRO once again). + + 2) Lets one define sets of debug statements that are turned on or off as + a group. In the normal course of debugging a program, one adds several write + (or tell) statements in an attempt to track down an current error. After + fixing these errors, the debug statements get deleted and its on to + tracking down the next error in the program (adding a new set of debug + statements). The problem is that sometimes the original error comes back + (under a different set of circumstances) and gee wouldn't it be nice if that original set of debug statements was still there. The debug.h + include file provides a convenient way to do this. Returning to the + concept of turning sets of statements on or off as a group. It is + also possible turn sets of sets on or off as a group. + + debug(x,y) is defined to be something like: + + if (x & _debug_level) write(y); + + Note the use of the bitwise/and operator. This operator is what gives + the debug macro its flexibility. The write statement gets executed only + when one of the bits set in the integer _debug_level is also set in the + variable x (the first argument to debug(x,y)). As an example of how this + might be used: in the early stages of debugging a program you might + set_debug_level(1) and use debug macros of the form debug(1,y). After + a period of debugging you might feel that the debug(1,y) statements have + served their purpose. At that point, you can change the set_debug_level + call to be set_debug_level(2). Now, the debug(1,y) statements will no + longer cause anything to be printed. However, debug(2,y) statements would + be printed. Suppose that an old error crops up because of a new set of + inputs that you didn't encounter before. If the debug(1,y) statements + would again be helpful in debugging this old error, you could + call set_debug_level(3) instead of set_debug_level(2). This would cause + BOTH debug(1,y) and debug(2,y) statements to issue writes. This is because + the binary representaton of three (3) contains a one (1) AND a two (2). + + See /obj/debug.c and /usr/include/debug.h for a concrete example of how + this works. + + --Truilkan@TMI diff -c -r --new-file ds1.1/lib/doc/help/creators/debugging ds2.0r27/lib/doc/help/creators/debugging *** ds1.1/lib/doc/help/creators/debugging Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/help/creators/debugging Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,166 ---- + Debugging in Dead Souls + + So you've made some cool stuff but darn it, it doesn't work. There are various + tools available in the Dead Souls lib to hunt down the source of the problem: + + + %^GREEN%^elog%^RESET%^ + + If the file is somewhere in your home directory, just type: elog + + This will provide you a listing of the last few lines of your personal + error log. Warning lines tell you about code that works but should + be fixed in some way. Lines that don't contain the word "Warning" are + error lines: they indicate something about your code that prevents + it from working. For example: + + > %^GREEN%^update sample_room%^RESET%^ + + --- + *Error in loading object '/realms/cratylus/area/room/sample_room' + Object: /secure/cmds/creators/update at line 148 + + '<function>' at /secure/save/creators/c/cratylus (<function>) at /:0 + 'cmdAll' at /secure/save/creators/c/cratylus (/lib/command.c) at line 84 + 'cmd' at /secure/cmds/creators/update at line 109 + 'eventUpdate' at /secure/cmds/creators/update at line 148 + 'CATCH' at /secure/cmds/creators/update at line 148 + Trace written to /log/catch + /realms/cratylus/area/room/sample_room: Error in update + *Error in loading object '/realms/cratylus/area/room/sample_room' + + + + This output lets you know something is wrong, but + isn't very specific as to exactly what. If you look at your error + log, you probably will see something more detailed and helpful: + + + > %^GREEN%^elog%^RESET%^ + + /log/errors/cratylus: + + /realms/cratylus/area/room/sample_room.c line 10: Undefined variable 'Sample' + /realms/cratylus/area/room/sample_room.c line 10: parse error + + + + Now you can see that the error is my syntax on + line 10. I would then use ed to examine the code, and specifically lines 9 + through 11. It turns out that I forgot to put quotes around the room name, + so the parser tried to use it as a variable, which, of course, it couldn't. + + If the file in question is in /secure, you'd type elog secure , or if + it's in /cmds, elog cmds , and so on. + + + dbxwhere & dbxframe + + Two helpful debugging commands are dbxframe and dbxwhere. Let's + take a look at my broken sample_room.c file. We'll start with dbxwhere, + which lists for us the chain of events that led to the error. The + indivudual steps are called frames. + + > %^GREEN%^dbxwhere%^RESET%^ + *Error in loading object '/realms/cratylus/area/room/sample_room' + Object: /secure/cmds/creators/update at line 148 + + #0: '<function>' at /secure/save/creators/c/cratylus (<function>) at /:0 + #1: 'cmdAll' at /secure/save/creators/c/cratylus (/lib/command.c) at line 84 + #2: 'cmd' at /secure/cmds/creators/update at line 109 + #3: 'eventUpdate' at /secure/cmds/creators/update at line 148 + #4: 'CATCH' at /secure/cmds/creators/update at line 148 + + + The output is similar to the update error we saw above, but in ennumerating the steps, dbxwhere + lets us use dbxframe to get tighter detail on a given error frame: + + > %^GREEN%^dbxframe 4%^RESET%^ + ------ + /secure/cmds/creators/update.c:148 - CATCH(0) + ---------------------------------------------------------------- + if( args == base_name(this_object()) ) { + this_player()->eventPrint("Cannot reload update after destruct.\n" + "It will be reloaded at next reference."); + return 0; + } + => tmp = catch(call_other(args, "???")); + if( !tmp ) { + if(identify(flags ^ U_AUTOMATED) == + "8")this_player()->eventPrint(args + ": Ok"); + return 1; + } else this_player()->eventPrint(args + ": Error in update\n" + tmp); + return 0; + + + We're now looking at the error context for error frame 4. The output of the command shows + us part of the file that was performing the evaluation when the error occurred, and even + points out the offending line using a text arrow: => + + In this particular case, the information is not that helpful. We are being told that + the error occurred while we were using the update command, and it failed at the line + where update does its thing. Duh, we knew that. The elog command was much more helpful. + + Where this kind of tracing comes in handy is when you enounter a runtime error + when you're not updating a file. For example, if I tried to enter that room, rather than + update it, I'd get a big pukey error message and not know why. If you run into an + unexpected error, dbxwhere will help you pinpoint it if elog doesn't provide useful information, + and dbxframe will help detail the source of the problem. + + %^GREEN%^tail%^RESET%^ + + + This is a version of the unix tail command. It displays the last few lines of a file. + This command is important for examining crucial log files: + + %^GREEN%^tail /log/catch%^RESET%^ + %^GREEN%^tail /log/runtime%^RESET%^ + %^GREEN%^tail /log/player_errors%^RESET%^ + + + bk & restore + + These commands aren't so much for debugging as they are for safe coding. Before you + edit a file, it is a very good idea to back it up first. The bk command lets you + quickly and conveniently back up a file before you edit it. When I typed: + + %^GREEN%^bk sample_room%^RESET%^ + + A file with a unique identifying number was created in my bak/ directory. If I + were to type it again, then sample_room.c would get copied again to bak/, with + a new unique number added to the name. + + The number is basically the number of seconds elapsed since January 1, 1970. + Adding this number, we can keep track of which backed up version of a file + is most recent by looking at the name. + + Suppose I edited a file called sample_npc.c. I use bk to back it up, make some changes, + then use bk again, make some more changes, but now it won't update. I don't + feel like debugging, I just need this file working again, so I want to restore from + backup. The sequence of commands would look something like this: + + %^GREEN%^ed sample_npc.c%^RESET%^ + %^GREEN%^bk sample_npc%^RESET%^ + %^GREEN%^ed sample_npc.c%^RESET%^ + %^GREEN%^update sample_npc.c%^RESET%^ + <error occurs here> + %^GREEN%^restore sample_npc%^RESET%^ + + The reason identifying numbers are used is that you can also choose to + restore the second-to-last backup version of a file, and other previous + versions. + The very last backup version is effectively version 0, so it's not + necessary to specify a number. If I wanted to restore the version I backed + up before that one, I would type something like this: + + %^GREEN%^restore sample_npc 1%^RESET%^ + + And if I wanted the version before that one, I'd specify 2 instead of 1, + and so on. + + Please note that this is an intentionally simple system. There are + no menus, no version branches, or diff tracking. The reason for this is + that it is not a versioning system. It is a backup system. It is a convenient + tool to back out of screwups, not a development tool to test file versions. + + diff -c -r --new-file ds1.1/lib/doc/help/creators/ds ds2.0r27/lib/doc/help/creators/ds *** ds1.1/lib/doc/help/creators/ds Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/help/creators/ds Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,39 ---- + The dead_souls intermud channel + + There is an internet communication protocol that + allows muds to send and receive information from each other. This + is called the Intermud network, of which there are several + versions and subnets. + + By default, your mud is connected to the Intermud3 + network, or I3 (see intermud.org for specs). On this + network there are numerous channels available: some are + friendly, some are hostile, some are invitation-only, and + some are open to all. + + Unless your admins have disabled intermud, or you + are tightly firewalled, or channels have been restricted, + you probably are listening to a channel called "dead_souls". + This channel exists to allow creators on Dead Souls muds + on the internet to talk, ask questions, share ideas, etc. + + Random chat is not exactly discouraged, but code + questions and discussions always have priority on this + channel. It can be used socially, but its primary purpose + is as a support system for the Dead Souls community. + Accordingly, muds that spam the channel, or subject it + to malicious data or metadata, are likely to be permanently + banned from it, regardless of whether it was the fault of + just one jerk. Messages of an offensive nature also + qualify as bannable material, and this is at the discretion + of the owner of the channel, which is the Dead Souls mud. + + If you need to perform channel testing, please avoid + using the dead_souls channel ( also known as <ds> ) for + this. A special testing channel has been set up for that + purpose. It is called ds_test, and you can add it to + yourself by typing: + + %^GREEN%^call me->AddChannel("ds_test")%^RESET%^ + + diff -c -r --new-file ds1.1/lib/doc/help/creators/editor ds2.0r27/lib/doc/help/creators/editor *** ds1.1/lib/doc/help/creators/editor Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/help/creators/editor Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,372 ---- + + + The Ed Primer + --or-- + Your Introduction To The Wonderful World Of Programming With Ed! + + 0. A Prelude: + (How to read the author's peculiar notation) + + In all examples: + + Words in angle brackets <like this> are not to be typed literally, but rather + to be substituted for. For example, '<number>p' could be '4p' or '27p', etc. + [Anything in square brackets] is optional. + <x|y> represents <x> OR <y>, but not both. + > is assumed to be the standard lpmud prompt. + : is assumed to be the ed command mode prompt. + * is assumed to be the ed insert mode prompt. + + --The author/editor + + I. A Beginning: + (The 'ed', 'a', 'i', 'w', and 'q' commands) + + First, the command to enter ed from lpmud can take one of two basic forms: + > ed <filename> + or + > ed <dummy filename>. + + The first is used to edit an existing file. The second is used to create a new + file. The dummy filename can be any string that isn't already the name of a + file. Short strings like 'a' work well for this. + + Once you are in ed, your prompt will become ':'. From this prompt you enter + ed commands. If you are beginning a new file, you can use one of two commands + to enter insert mode: 'a' or 'i'. The difference between these two will become + significant later on. In insert mode, your prompt will become '*'. From here + you type in the body of your file. You can leave insert mode at any time by + typing a single '.' on a line by itself. + + Once you are finished entering your text and have returned to command mode + (':' prompt), you can save your file with the 'w' command, specifying a + filename: + + :w myfile.c + + Then you can use 'q' to exit ed, and return to your normal propmt. + + Summary: + + > ed <file | dummy file> takes you into ed. + 'a' and 'i' in command mode begin insert mode. + ---> Implicit assumtion from now on: all commands will be from command mode + ---> unless it is stated otherwise. + '.' in insert mode returns you to command mode. + 'w <file>' saves your file. + 'q' takes you out of ed. + + + II. Editing existing files: + (The 'ed', 'a', 'c', 'd', 'i', 'l', 'p', 'w', 'z', and '=' commands.) + + To edit an existing file (a reminder from section I), use: + + > ed <filename> + + This again puts you in command mode, with the difference from starting a new + file that there are already lines in the buffer. Use the command '.p' to + see the line you are presently on. + + The command 'p' will print out a line or range of lines. Its syntax is this: + 'p' or '.p'* will print out the line you are presently on. '<number>p' will + print out line number <number>. '<number1>,<number2>p' will print out the + range of lines from <number1> to <number2>. In this case, <number1> must be + less than or equal to <number2>. In both cases, all numbered lines must exist, + or the command will fail. The command 'l' is similar to 'p' in most respects, + except that it also makes visible some 'invisible' characters, like newline + (which shows up as $). Tabs become completely invisible. 'z' will display + 21 lines in 'p' fashion (i.e., ctrl characters remain invisible). 'z' can + be prepended by a line number to start at. + + The command <number> will take you to the line of the same number. + + The commands 'i' and 'a' are the commands introduced in section I. The + difference between these two commands now takes on a significance; 'i' starts + inserting before the line you are presently on, while 'a' starts inserting + after the line you are on. (Use '.' or '.p' to display the line you are on.) + Also, 'i' and 'a' can both be prepended by a <number>, ('<number>i' and + '<number>a'), which sets your present line at <number> before beginning insert + mode. + + The command '=' can be used to discover the number of the line you are on. + + The command 'd' deletes the current line you are on. 'd' can, like 'p' and + 'l', be used with a single line number, or a range of them for arguments. + + The command 'c' is used to change lines. It is essentially similar to 'd' + in its usage, except that instead of leaving you in command mode, you are + put into insert mode, inserting text to 'replace' what was removed. + + Finally, 'w' without being followed by '<file>' will save the file under the + name you began editing it as, provided that that file already existed. + + Footnote: * As a number, '.' refers to the present line; '$' refers to the last + line of the file. + + An example encompassing what we've done so far: + > ed a + :a + *This is line 1. + *This is line @. + *This is line 3. + *This is line 5. + *This is too many lines. + *. + :1,3p + This is line 1. + This is line @. + This is line 3. + := + 3 + :5l + This is too many lines.$ + :5d + :1,$p + This is line 1. + This is line @. + This is line 3. + This is line 5. + :2c + *This is line 2. + *. + :1z + This is line 1. + This is line 2. + This is line 3. + This is line 5. + :4i + This is line 4. + :1,$p + This is line 1. + This is line 2. + This is line 3. + This is line 4. + This is line 5. + :w file.txt + :q + > ls + Total 1 + 1 file.txt + > + + Summary: + + 'p' and 'l' are used to display ranges of lines. 'l' displays some invisible + characters. + 'z' displays 21 lines in 'p' format. + '=' displays the current line number. + 'd' deletes a line. + 'c' changes a line by deleting it and putting you into insert mode. + --As numbers, '.' refers to the present line, and '$' to the last line of the + file. + + III. More Advanced Editing: + (The 's' command) + + The 's' command is used for substitutions. The general format is this: + + :[<number1>[,<number2>]]s<delimiter><pattern><delimiter><sub>[<delimiter>gp] + + The command may look intimidating at first, but it turns out to be one of the + most powerful commands in ed. + + An explanation of all the angle-brackets: + <number1> and <number2> are the range of substitution. If ',<number2>' is + omitted, the range of effect is merely line <number1>. If '<number1>' is also + omitted, the substitution defaults to the present line. + + <delimiter> is simply a character used as a separator. Care should be taken + that '<delimiter>' does not occur in either <pattern> or <sub>. The most + common choices for <delimiter> are '/' and '!', although any character can be + used. + + <pattern> is the string that will be changed. <sub> is the string that it will + be changed to. If <pattern> begins with a '^', that is taken to mean 'beginning + of line.' Similarly, if it ends with '$', it signifies 'end of line.' + + The final optional [gp] are used, respectively, to make the substitution global + throughout the line (instead of just affecting the first occurrence), and to + display the newly-changed line immediately afterwards. Note that g must come + before p, if both are used. + + Some examples: + + :. + This is line nubmer 3. + :s/bm/mb/p <--- Note that '/' is used as the delimiter here. + This is line number 3. + : + + :. + Thsi si line 3. + :s!si!is!p <--- The delimiter here is '!'. + This si line 3. <--- Note that only the 1st occurrence of 'si' was changed + : + + :. + Thsi si line number 3. + :s!si!is!gp <--- Here, the delimiter is '!', again. + This is line number 3. + : + + :3,5p + This is lize 3. + This is lize 4. + This is lize 5. + :3,5sqzqnqp <--- Here, to confuse matters, the delimiter is 'q'. + This is line 3. + This is line 4. + This is line 5. + : + + General notes: + For a global substitution, use: + :1,$s/<pattern>/<sub>/g + + Beware of special characters in <pattern>. '.', '(', ')', '&', '*', '|', '[', + '^', and ']' should all be prepended by backslashes ('\') if they are used. + '\' is, although possible to use in <sub> and <pattern>, very tricky to use. + The author recommends beginners use the 'c' command to do sunstitutions for + this character instead. + + Some of these special characters that can be used in <pattern>: + . Match any character. + x* Match any numbers of x (0 or more). + [abc] Match 'a', 'b' or 'c'. + [0-9] Match any digit 0 - 9. + [a-z] Match any lowercase letter. + [^0-9] Match anything except a digit 0 - 9. + + The & can be used in the replacement to represent the text being replaced. + + Example: + :. + This is a lazy line, lying abed. It is also silly; abcd. + :s/ab.d/ABCD/gp + This is a lazy line, lying ABCD. It is also silly; ABCD. + : + + Example: + :. + This is a long line that is being used to demonstrate a silly example. + :s/l.n./&foo/ + This is a longfoo linefoo that is being used to demonstrate a silly example. + + III-I/II. (3.5, for those who can't figure that out.) Author's Interjection: + (The '<range>' notation) + + What was formerly referred to as <number1>,<number2><command> will, from here + on out, be referred to as <range><commmand>, for the author's typing ease. + Thank you. + + Campus. Still More Advanced Commands, and Related Shortcuts: + (The 'e', 'E', 'f', 'j', 'k', 'Q', 'm', 'r', 't', 'x', and '!' commands) + + The 'e', 'E', and 'r' commands can all be used to read external files into the + buffer. 'e <file>' reads <file> into the buffer, deleting everything in the + buffer. Because it is destructive, the exact buffer contents must be saved + before this command can be executed. 'E <file>' works exactly as 'e <file>', + except that it ignores the saved status of the present buffer. + '<number>r <file>' reads in the contents of <file>, placing them after line + <number>. As usual, if <number> is omitted, it defaults to the current line. + + 'Q' and 'x' can, like 'q', be used to exit ed. 'q' can only be used to exit + ed if the exact contents of the buffer are saved. 'Q' can be used to exit + regardless of the saved status of the buffer. 'x' saves the buffer to the + default file name and exits ed. Note that if there is no default file name, + 'x' will fail. + + '<range>j' will join all of the lines in <range> together into one line. + + '<number>k<marker>' will assign <marker> to line <number>. <marker> can be + any lowercase letter. A line marked is referred to as "'<marker>". For + example, the commands: + :5kd + :1,'dp + will mark line 5 as "d" and then print out lines 1-5. + + 'f <file>' sets the default name of the file (used for the 'w' and 'x' + commands) to <file>. + + 't' and 'm' are both used to move sections of text. The format is: + :<range>t|m<number> + where <range> is the text to be moved, and <number> the line it is to be + inserted after. 't' is 'transfer' and leaves a copy of the text to be moved + at the original site; it is basically a 'copy' command. 'm' is 'move' and + moves the text from its original site to its new site. + + '!' is used to execute lpmud commands from within ed, and can be used in either + the command or the insert mode. For example: + :!'Wait, please; I'm in ed. + Guest says: But I want to talk. + :i + *!'I said wait, please. + * + + + A summary: + 'e', 'E', and 'r' are used to retrieve external files to the buffer. + 'Q' is used to exit, regardless of save status. + 'x' is used to save and exit in one step. + 'f' changes the default name of the file. + 'j' joins lines together. + 'k' marks lines. + 't' is used to transfer, or copy lines. + 'm' is used to move lines. + '!' in command and insert modes, is used to execute an lpmud command. + + Campus. Seek, and Ye Shall Find + (The 'g', 'v', '?', and '/' commands) + + '/' and '?' are used to find expressions in the buffer. '/<string>' does a + forward search for <string>, while '?<string>' does a backward search. + '/' and '?' with no arguments default to the previous argument. If no argument + was given prior, an error occurs. + + 'g' and 'v' use similar formats for operation: + :<range>g|v/<string>/<command> + + Both 'g' and 'v' search through <range> for lines that contain <string>. + 'g' executes <command> on all lines in <range> that contain <string>, while + 'v' executes <command> on all lines that do not contain <string>. + + <command> may be one of the following commands: 's', 'l', 'p', 'd', 'm', or + 'r'. Arguments for these commands work normally. + + '/' and '?' may be used similarly to operate on the first occurrence of + <string> found. For example: + :/foo/s/x/ox/gp + + will replace all instances of 'x' on the next line containing + 'foo' with 'ox' and set your current line there. Similarly, + :?bar?= + will give you the + number of the first previous line containing the string 'bar', and set your + current line there. + Exapmles: + + :1,$p + This is a test. + This is line two of the test. + There are more than two lines. + This is the last line. + :1,$g/two/l + This is line two of the test.$ + There are more than two lines.$ + :1,$v/two/d + :1,$p + This is line two of the test. + There are more than two lines. + :?test + This is line two of the test. + :.p + This is line two of the test. + :/There + There are more than two lines. + :Q + > + + --Mishael, author/editor. + David "Mishael" Green + dgreen@jarthur.claremont.edu diff -c -r --new-file ds1.1/lib/doc/help/creators/emotes ds2.0r27/lib/doc/help/creators/emotes *** ds1.1/lib/doc/help/creators/emotes Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/help/creators/emotes Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,122 ---- + Emote Name: A name for the emote (Example, "slap") + + Error Message: An error for emotes that don't match the parse rules (Example, "Slap who?") + + Parse Rule: A rule for the parser to see who to slap (Example, "LVS STR" to allow the user to "slap shadyman hard") + + Verbs: Verbs this applies to (usually just the emote name) + + Message: What gets displayed when the emote happens. (Example, "$agent_name $agent_verb $target_name.") + + Adverbs: One of 4 choices: + 1) Any special adverbs that apply to this emote that don't exist already, in a comma delimited list + 2) '-', to allow only preselected adverbs to be used + 3) 'none', to allow no adverbs to be used + 4) '*', to allow any word to be used + + + Shadyman smiles sweetly at Kira + Emote Name: smile + Error Msg: none + Parse Rule: at LVS,LVS + Verbs: smile + Message: $agent_name $agent_verb $adverb at $target_name. + Adverbs: * + + Once you have that one rule done, you can add more by using "addemote -add" + You can also edit rules for an emote by using "addemote -edit" + You can remove a rule by using "removeemote [emotename] [rulename]" (see "addemote -edit" for rules in the emote, ie: "at LIV STR") + Removing an entire emote is done by "removeemote" + + + <COMMANDS LIST> + + Command You See Target Sees Room Sees + ------- ------- ----------- --------- + $agent_verb smile Smile Smile + $agent_name you Shadyman Shadyman + $agent_nominative you he/she he/she + $agent_objective you him/her/them him/her/them + $agent_possessive_noun your Shadyman's Shadyman's + $agent_possessive your his/hers his/hers + $agent_reflexive yourself himself/herself himself/herself + $target_verb smiles smiles smiles + $target_name Kira you Kira + $target_nominative he/she/they you he/she/they + $target_objective him/her/them you him/her/them + $target_possessive_noun Kira's your Kira's + $target_possessive his/hers/theirs your his/hers/theirs + $target_reflexive him-/her-/themselves yourself him-/her-/themselves + $adverb happily happily happily + + + <SAMPLE EMOTE CREATION> + + Let's add the emote Snicker. Just simply, an emote that says "You snicker" when you type "snicker". + Since it will have no arguments, you don't need to add a parser rule or adverbs. + + > addemote snicker + Enter error message: Snicker at whom? + Enter a parser rule for snicker: + Enter the verbs: snicker + Enter message: $agent_name $agent_verb. + Enter adverbs: + Emote 'snicker' added. + + Now let's add a rule to 'snicker' to make it more useful. Let's add "snicker at [someone]", with a living person as a target. + Since there will still be no adverbs, we'll leave the adverbs blank, but we will be using the parser rule, because we want to snicker AT someone. + + > addemote -add + Enter emote name: snicker + Enter error message: Snicker at whom? + Enter a parser rule for snicker: at LIV + Enter the verbs: snicker + Enter message: $agent_name $agent_verb at $target_name. + Enter adverbs: + Emote 'snicker' added. + + Now let's add the ability to use adverbs with our 'snicker' emotion, like 'snicker at shadyman loudly' and 'snicker loudly at shadyman'. Note we'll be adding two rules at once. + If you want your users to use their own (non-approved) adverbs or strings of text, you should put '*' in the adverbs section. Otherwise, put '-' to use only pre-approved adverbs. + + > addemote -add + Enter emote name: snicker + Enter error message: Snicker at whom? + Enter a parser rule for snicker: at LIV STR,STR at LIV + Enter the verbs: snicker + Enter message: $agent_name $agent_verb at $target_name $adverb. + Enter adverbs: * + Emote 'snicker' added. + + Go ahead and experiment with various types of parsing rules, using LIV, STR, LVS, and prepositions such as 'with', 'as', 'like', etc. + + <SAMPLE EMOTE IN "addemote -edit" MODE> + Emote: boggle + Error Message: Boggle! + Rules: + [1] "LIV STR": $agent_name $agent_verb $adverb at $target_name. + Adverbs: - + + [2] "at LIV": $agent_name $agent_verb at $target_name. + Adverbs: + + [3] "STR at LIV": $agent_name $agent_verb $adverb at $target_name. + Adverbs: - + + [4] "STR": $agent_name $agent_verb $adverb. + Adverbs: - + + [5] "LIV": $agent_name $agent_verb at $target_name. + Adverbs: + + [6] "at LIV STR": $agent_name $agent_verb $adverb at $target_name. + Adverbs: - + + [7] "STR LIV": $agent_name $agent_verb $adverb at $target_name. + Adverbs: - + + [8] "": $agent_name $agent_verb. + Adverbs: + + Revisions: + ---------- + Document Created: [Shadyman, Mar 16, 2006] diff -c -r --new-file ds1.1/lib/doc/help/creators/mappings ds2.0r27/lib/doc/help/creators/mappings *** ds1.1/lib/doc/help/creators/mappings Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/help/creators/mappings Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,60 ---- + Dead Souls and Mappings + + A mapping is an organization of data that makes it possible to associate + data elements together in a human-understandable way. + + For a builder with no coding experience, mappings can be a challenge to + understand. However, you must grasp at least the very basics of this data type in order to be an effective builder. + + The Dead Souls mudlib has three kinds of objects that normally have other + objects inside of them: NPC's, rooms, and containers. When the mud loads + one of these, often they are intended to have stuff inside them already, such + as a teasure chest with jewels, an orc with an axe, or a room with an orc + guarding a treasure chest. + + In such a circumstance, each of these objects is loaded from a file that + contains information about the contents of the object. This is called the + object's inventory, and it is determined by the SetInventory directive in that + file. + + An example of a room's SetInventory directive might look a little like this: + + SetInventory( ([ + "/domains/town/npc/fighter" : 1, + "/domains/town/npc/orc" : "growl", + "/domains/town/obj/chest" : 1, + ]) ); + + You can tell it's a mapping right away from the square brackets: [ ]. + + What this mapping does is identify a fighter, orc, and chest as objects to + be put into the room when it is loaded. If we wanted 2 fighters, we would have + put a 2 instead of a 1 there. + + What the "growl" value does is provide that orc with a command to perform + when it appears. You could just have a number there, to specify the number + of orcs desired. + + That's it. It's that simple. A mapping consists of pairs of data, separated + by a colon (the : symbol). The part to the left is called a key, and the + part to the right is called the value. + + A mapping can contain more than one of these pairs, each separated from + the other by a comma. + + As a non-coding builder, what you need to know is that when the creation system + asks you for a key, it is possible for keys to have multiple values, like + this: + + ({"room","here","area"}) : "This area looks very nice." + + In this example, the mapping element is part of the SetItems directive. + + When you modify a room's description items, you will be asked to enter keys until you are + done. This allows you to enter multiple words that respond in the same + way. For example, "examine wall" and "examine concrete wall" should both + provide the same description. + + However, in the case of inventory, only one key is valid, so make sure you + only enter one. + diff -c -r --new-file ds1.1/lib/doc/help/creators/messaging ds2.0r27/lib/doc/help/creators/messaging *** ds1.1/lib/doc/help/creators/messaging Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/help/creators/messaging Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,122 ---- + The best way to do messaging these days is through a single simul + efun: + send_message() + + varargs void send_message(mixed verb, string message, object agent, + mixed targets, mixed observers, mapping special); + + Example: + + send_message("cast", "$agent_name $agent_verb $agent_possessive pole in " + "order to fish.", this_player(), 0, + environment(this_player())); + + replaces BOTH: + this_player()->eventPrint("You cast your pole in order to fish."); + environment(this_player())->eventPrint(this_player()->GetName() + + " casts " + + possessive(this_player()) + + " pole in order to fish.", + this_player()); + + AND + the write()/say() equivalent. + + First, let's go over the arguments to send_message(): + + * mixed verb + This will normally be a single verb that you want conjugated in the + sentence for different viewers. In the above example, "cast" needed + to be displayed as "cast" for the caster and "casts" for observers. + In some sentences, you made need more than one verb. Take for + example: + "You rock and roll." + "Descartes rocks and rolls." + + This is done by using an array instead of a single string. The rock + and roll example would look like: + send_message(({ "rock", "roll" }), "$agent_name $agent_verb and $agent_verb.", + this_player(), 0, environment(this_player())); + + For each verb mentioned in the message, there must be a corresponding + verb in the verb array. + + The verb should be expressed in second person singular format. + + * string message + A message containing tokens that will be replaced when the message is + displayed. Campusalid tokens are: + $agent_name - replaced with the name of the agent + $agent_nominative - replaced with the nominative pronoun for the + agent (he, she, or it) + $agent_objective - replaced with the objective pronoun for the agent + $agent_possessive - the agent's possessive pronoun + $agent_possessive_noun - the possessive version of the agent's name + $agent_reflexive - the reflexive pronoun for the agent + + For each of the agent tokens, there also exist target tokens: + $target_name, $target_nominative, $target_objective, + $target_possessive, $target_possessive_noun, $target_reflexive + + And finally, $agent_verb and $target_verb. + + You have to associate a verb with a person so that the system knows + how to conjugate the verb for each viewer. Take for example: + + "Horace is struck by Descartes' sword." + "Descartes strikes Horace." + + In both instances, Descartes is the agent. The verb in the first + sentence is "are" and in the second sentence "strike". But the + subject of the sentence in the first sentence is NOT the agent. It is + the target. The corresponding send_message() would look like: + + send_messages("are", "$target_name $target_verb struck by " + "$agent_possessive_noun sword.", this_player(), enemy, + environment(this_player()); + + send_messages("strike", "$agent_name $agent_verb $target_name.", + this_player(), enemy, environment(this_player())); + + Using just this knowledge, you can now send something like: + send_message(({ "miss", "sidestep" }), "$agent_name $agent_verb " + "$target_name as $target_nominative $target_verb " + "$agent_possessive_noun attack.", this_player(), enemy, + environment(this_player())); + This will show me: + "You miss Horace as he sidesteps your attack." + And Horace: + "Descartes misses you as you sidestep Descartes' attack." + And other people in the room: + "Descartes misses Horace as he sidesteps Descartes' attack." + + All done in a single line of code. + + * object agent + The agent is the person who is considered to be doing the action. It + can only be a single object. + + * mixed targets + You can have one or more targets. Traditionally, you will have only + one. The above examples have dealt with a single target. You could + however have: + send_message("get", "$agent_name $agent_verb $target_name.", + this_player(), all_inventory(environment(this_player())), + environment(this_player())); + To show: + "You get two swords and a fish." + And to the room: + "Descartes gets two swords and a fish." + + On a completely uninteresting side-note, the message also gets sent to + the two swords and a fish. + + * mixed observers + Any objects which might be observing this action. It is most often + the room in which the agents and object are located. + + * mapping special + Some library objects may wish to add their own tokens to the token + list for parsing. For examples, spells send ([ "$limb" : "right hand"]) + + You will almost never need that last argument. diff -c -r --new-file ds1.1/lib/doc/help/creators/qcs ds2.0r27/lib/doc/help/creators/qcs *** ds1.1/lib/doc/help/creators/qcs Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/help/creators/qcs Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,824 ---- + %^CYAN%^ What's the QCS? %^RESET%^ + + + QCS stands for Quick Creation System. The QCS is a + series of commands and modules that lets you create stuff + easily and quickly. Before the QCS, if you wanted to make + an orc, you would edit the text file by hand, or copy + a template file and use an editor to manually change the + lines you needed to modify. This could be a tiresome + process, as the standard editor can be a bit awkward, and + making dozens of objects this way could be real torture for + beginners. + + The QCS changes all of that. Rather than use an + editor to meodify files, the QCS gives you commands that + permit you to modify objects on the fly. This means that + orc creation for example could involve just the following + simple steps (please note "npc" is another word for "mob"): + + %^GREEN%^ create npc new_orc %^RESET%^ + + %^GREEN%^ modify npc name orc %^RESET%^ + + %^GREEN%^ modify orc short a mean-looking orc %^RESET%^ + + %^GREEN%^ modify orc long A typical orc: nasty, brutish, and short. %^RESET%^ + + %^GREEN%^ modify orc race orc %^RESET%^ + + And that's it. All your modifications automatically + get written to new_orc.c (usually in your area directory), + and you now have an npc you can add to a room. Adding things + to rooms is just as easy. Creating weapons, armor, and other + objects is done the same way. + + For complete details and examples, read the + QCS chapters in the Creators Manual. The QCS section starts + in chapter 31. + + + This is a log of the creation of some items using the Dead Souls creation system. It has + not been modified in any way except to highlight the command lines and adding comments. + + + + Dead Souls has been up for 2h 25m 38s. + %^GREEN%^ home %^RESET%^ + /realms/testycre/workroom + Testycre's workroom [e,d] + You are standing in the workroom of the mighty Testycre! + You may return to the Creators' Hall by going down. + A sample room is east. + There is a sign here you can read. + There is a sheet here you can read. + A wooden chest is here. + + + %^GREEN%^ e %^RESET%^ + /realms/testycre/area/room/sample_room + Sample Room [w] + This is a room you can use as a template. + A simple table is here. + A fighter is standing here. + + //// This is the standard sample room. We're about to create a new room to the east of it. + %^GREEN%^ create room east test1 %^RESET%^ + It appears you have write access to this area. + It's a null mapping + Indenting file... + "/tmp/indent.1134436511.tmp.dat" 20 lines 330 bytes + Exit from ed. + + You wave your hand, and a new exit appears. + You begin uttering a magical incantation. + Indenting file... + "/tmp/indent.1134436511.tmp.dat" 27 lines 543 bytes + Exit from ed. + + Indenting file... + "/tmp/indent.1134436511.tmp.dat" 27 lines 544 bytes + Exit from ed. + + %^GREEN%^ e %^RESET%^ + /realms/testycre/area/room/test1 + Copy of /realms/testycre/area/room/sample_room.c [w] + This is a room you can use as a template. + A simple table is here. + A fighter is standing here. + + //// We go into the new room and see it is a copy of the old one. Let's change the short description to avoid confusion: + %^GREEN%^ modify here short Room One %^RESET%^ + Indenting file... + "/tmp/indent.1134436526.tmp.dat" 27 lines 515 bytes + Exit from ed. + + //// We don't need the fighter from the other room here, so we remove him from this new room's inventory. + %^GREEN%^ delete fighter %^RESET%^ + Indenting file... + "/tmp/indent.1134436532.tmp.dat" 26 lines 507 bytes + Exit from ed. + + /realms/testycre/area/room/test1: Ok + /realms/testycre/area/room/test1 + Room One [w] + This is a room you can use as a template. + A simple table is here. + + + SetInventory modification complete. + //// Let's make another room. + %^GREEN%^ create room east test2 %^RESET%^ + It appears you have write access to this area. + It's a null mapping + Indenting file... + "/tmp/indent.1134436578.tmp.dat" 20 lines 324 bytes + Exit from ed. + + You wave your hand, and a new exit appears. + You begin uttering a magical incantation. + Indenting file... + "/tmp/indent.1134436578.tmp.dat" 27 lines 557 bytes + Exit from ed. + + Indenting file... + "/tmp/indent.1134436578.tmp.dat" 27 lines 525 bytes + Exit from ed. + + %^GREEN%^ e %^RESET%^ + /realms/testycre/area/room/test2 + Copy of /realms/testycre/area/room/test1.c [w] + This is a room you can use as a template. + A simple table is here. + + + %^GREEN%^ modify here short Room 2 %^RESET%^ + Indenting file... + "/tmp/indent.1134436590.tmp.dat" 26 lines 499 bytes + Exit from ed. + + %^GREEN%^ modify here long This is the second test room. %^RESET%^ + Indenting file... + "/tmp/indent.1134436608.tmp.dat" 26 lines 487 bytes + Exit from ed. + + //// We don't need that table here. + %^GREEN%^ delete table %^RESET%^ + Indenting file... + "/tmp/indent.1134436612.tmp.dat" 25 lines 447 bytes + Exit from ed. + + /realms/testycre/area/room/test2: Ok + /realms/testycre/area/room/test2 + Room 2 [w] + This is the second test room. + SetInventory modification complete. + + //// We look at the file contents to make sure what we're doing really is being written into the room's code: + %^GREEN%^ more here %^RESET%^ + #include <lib.h> + #include "/realms/testycre/customdefs.h" + + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Room 2"); + SetLong("This is the second test room."); + SetExits(([ + "west" : "/realms/testycre/area/room/test1", + ])); + + SetItems( ([ + "template" : "That's what this is.", + ]) ); + + SetInventory(([ + ])); + } + + void init(){ + ::init(); + } + + //// Let's make a new guy. "guy" will be the filename. + %^GREEN%^ create npc guy %^RESET%^ + I'm going to go with the appropriate area directory: + /realms/testycre/area/npc/guy.c + You wave your hand mysteriously and a generic npc materializes! + %^GREEN%^ l %^RESET%^ + /realms/testycre/area/room/test2 + Room 2 [w] + This is the second test room. + A generic npc is standing here. + + //// This is the first thing you should do, in order to avoid confusion. + %^GREEN%^ modify npc name guy %^RESET%^ + Indenting file... + "/tmp/indent.1134436801.tmp.dat" 15 lines 417 bytes + Exit from ed. + + %^GREEN%^ modify npc id %^RESET%^ + This setting takes multiple values. If you have no more values to enter, then + enter a dot on a blank line. To cancel, enter a single q on a blank line. + You may now enter the next value. So far, it is blank. + If you're done entering values, enter a dot on a blank line. + %^GREEN%^ dude %^RESET%^ + You may now enter the next value. So far, we have: ({ "dude" }) + If you're done entering values, enter a dot on a blank line. + %^GREEN%^ fellow %^RESET%^ + You may now enter the next value. So far, we have: ({ "dude", "fellow" }) + If you're done entering values, enter a dot on a blank line. + %^GREEN%^ fella %^RESET%^ + You may now enter the next value. So far, we have: ({ "dude", "fellow", "fella" + }) + If you're done entering values, enter a dot on a blank line. + %^GREEN%^ . %^RESET%^ + Entries complete. Final array is: ({ "dude", "fellow", "fella" }) + Indenting file... + "/tmp/indent.1134436831.tmp.dat" 19 lines 442 bytes + Exit from ed. + + /realms/testycre/tmp/guy1134436805: Ok + /realms/testycre/area/npc/guy: Ok + SetId modification complete. + %^GREEN%^ modify guy short The Dude %^RESET%^ + Indenting file... + "/tmp/indent.1134436855.tmp.dat" 19 lines 437 bytes + Exit from ed. + + %^GREEN%^ modify guy long This is just some random guy. %^RESET%^ + Indenting file... + "/tmp/indent.1134436904.tmp.dat" 19 lines 408 bytes + Exit from ed. + + %^GREEN%^ modify guy adj %^RESET%^ + This setting takes multiple values. If you have no more values to enter, then + enter a dot on a blank line. To cancel, enter a single q on a blank line. + You may now enter the next value. So far, it is blank. + If you're done entering values, enter a dot on a blank line. + %^GREEN%^ just some %^RESET%^ + You may now enter the next value. So far, we have: ({ "just some" }) + If you're done entering values, enter a dot on a blank line. + %^GREEN%^ random %^RESET%^ + You may now enter the next value. So far, we have: ({ "just some", "random" }) + If you're done entering values, enter a dot on a blank line. + %^GREEN%^ some %^RESET%^ + You may now enter the next value. So far, we have: ({ "just some", "random", + "some" }) + If you're done entering values, enter a dot on a blank line. + %^GREEN%^ . %^RESET%^ + Entries complete. Final array is: ({ "just some", "random", "some" }) + Indenting file... + "/tmp/indent.1134436924.tmp.dat" 19 lines 402 bytes + Exit from ed. + + /realms/testycre/tmp/guy1134436912: Ok + /realms/testycre/area/npc/guy: Ok + SetAdjectives modification complete. + %^GREEN%^ l %^RESET%^ + /realms/testycre/area/room/test2 + Room 2 [w] + This is the second test room. + The Dude is standing here. + + + %^GREEN%^ about dude %^RESET%^ + /realms/testycre/area/npc/guy.c + + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("guy"); + SetAdjectives( ({"just some", "random", "some"}) ); + SetId( ({"dude", "fellow", "fella"}) ); + SetShort("The Dude"); + SetLong("This is just some random guy."); + SetLevel(1); + SetRace("human"); + SetClass("explorer"); + SetGender("male"); + } + void init(){ + ::init(); + + //// Now a weapon for our new guy. "hammer" is the filename. + %^GREEN%^ create weapon hammer %^RESET%^ + I'm going to go with the appropriate area directory: + /realms/testycre/area/weap/hammer.c + You wave your hand mysteriously and a generic weapon materializes! + %^GREEN%^ modify weapon id hammer %^RESET%^ + This setting takes multiple values. If you have no more values to enter, then + enter a dot on a blank line. To cancel, enter a single q on a blank line. + You may now enter the next value. So far, we have: ({ "hammer" }) + If you're done entering values, enter a dot on a blank line. + %^GREEN%^ warhammer %^RESET%^ + You may now enter the next value. So far, we have: ({ "hammer", "warhammer" }) + If you're done entering values, enter a dot on a blank line. + %^GREEN%^ . %^RESET%^ + Entries complete. Final array is: ({ "hammer", "warhammer" }) + Indenting file... + "/tmp/indent.1134437181.tmp.dat" 19 lines 453 bytes + Exit from ed. + + /realms/testycre/tmp/hammer1134437165: Ok + /realms/testycre/area/weap/hammer: Ok + SetId modification complete. + %^GREEN%^ modify weapon name hammer %^RESET%^ + There is no weapon here. + %^GREEN%^ l %^RESET%^ + /realms/testycre/area/room/test2 + Room 2 [w] + This is the second test room. + A generic weapon is here. + The Dude is standing here. + + //// I accidentally changed the id before the name. Oops! Easy enough to fix: + %^GREEN%^ modify hammer name hammer %^RESET%^ + Indenting file... + "/tmp/indent.1134437205.tmp.dat" 22 lines 474 bytes + Exit from ed. + + %^GREEN%^ about hammer %^RESET%^ + /realms/testycre/area/weap/hammer.c + + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + + static void create() { + item::create(); + SetKeyName("hammer"); + SetId( ({"hammer", "warhammer"}) ); + SetAdjectives( ({ "generic" })); + SetShort("a generic weapon"); + SetLong("A weapon of indeterminate proportions."); + SetMass(50); + SetVendorType(VT_WEAPON); + SetClass(30); + SetDamageType(BLADE); + SetWeaponType("blade"); + + } + void init(){ + ::init(); + } + %^GREEN%^ modify hammer damagetype blunt %^RESET%^ + Indenting file... + "/tmp/indent.1134437392.tmp.dat" 22 lines 474 bytes + Exit from ed. + + %^GREEN%^ modify hammer weapontype blunt %^RESET%^ + Indenting file... + "/tmp/indent.1134437398.tmp.dat" 22 lines 474 bytes + Exit from ed. + + %^GREEN%^ modify hammer mass 700 %^RESET%^ + Indenting file... + "/tmp/indent.1134437414.tmp.dat" 22 lines 475 bytes + Exit from ed. + + %^GREEN%^ modify hammer hands 2 %^RESET%^ + Indenting file... + "/tmp/indent.1134437422.tmp.dat" 23 lines 492 bytes + Exit from ed. + + //// Let's see if all that stuff really did go into the file: + %^GREEN%^ about hammer %^RESET%^ + /realms/testycre/area/weap/hammer.c + + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + + static void create() { + item::create(); + SetKeyName("hammer"); + SetId( ({"hammer", "warhammer"}) ); + SetAdjectives( ({ "generic" })); + SetShort("a generic weapon"); + SetLong("A weapon of indeterminate proportions."); + SetHands(2); + SetMass(700); + SetVendorType(VT_WEAPON); + SetClass(30); + SetDamageType(BLUNT); + + SetWeaponType("blunt"); + } + void init(){ + ::init(); + } + %^GREEN%^ modify hammer short a heavy war hammer %^RESET%^ + Indenting file... + "/tmp/indent.1134437450.tmp.dat" 23 lines 494 bytes + Exit from ed. + + %^GREEN%^ modify hammer long This is an extremely large and heavy hammer designed to be wielded in both hands and used to hurt people very badly indeed. %^RESET%^ + Indenting file... + "/tmp/indent.1134437509.tmp.dat" 23 lines 579 bytes + Exit from ed. + + %^GREEN%^ modify hammer adj %^RESET%^ + This setting takes multiple values. If you have no more values to enter, then + enter a dot on a blank line. To cancel, enter a single q on a blank line. + You may now enter the next value. So far, it is blank. + If you're done entering values, enter a dot on a blank line. + %^GREEN%^ large %^RESET%^ + You may now enter the next value. So far, we have: ({ "large" }) + If you're done entering values, enter a dot on a blank line. + %^GREEN%^ heavy %^RESET%^ + You may now enter the next value. So far, we have: ({ "large", "heavy" }) + If you're done entering values, enter a dot on a blank line. + %^GREEN%^ war %^RESET%^ + You may now enter the next value. So far, we have: ({ "large", "heavy", "war" }) + If you're done entering values, enter a dot on a blank line. + %^GREEN%^ . %^RESET%^ + Entries complete. Final array is: ({ "large", "heavy", "war" }) + Indenting file... + "/tmp/indent.1134437531.tmp.dat" 23 lines 592 bytes + Exit from ed. + + /realms/testycre/tmp/hammer1134437521: Ok + /realms/testycre/area/weap/hammer: Ok + SetAdjectives modification complete. + %^GREEN%^ about hammer %^RESET%^ + /realms/testycre/area/weap/hammer.c + + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + + static void create() { + item::create(); + SetKeyName("hammer"); + SetAdjectives( ({"large", "heavy", "war"}) ); + SetId( ({"hammer", "warhammer"}) ); + SetShort("a heavy war hammer"); + SetLong("This is an extremely large and heavy hammer designed to be wielded + in both hands and used to hurt people very badly indeed."); + SetHands(2); + SetMass(700); + SetVendorType(VT_WEAPON); + SetClass(30); + SetDamageType(BLUNT); + + SetWeaponType("blunt"); + } + void init(){ + ::init(); + } + + //// It's a pretty heavy hammer, so let's make sure our guy can wield it. + %^GREEN%^ modify guy level 10 %^RESET%^ + Indenting file... + "/tmp/indent.1134437557.tmp.dat" 19 lines 403 bytes + Exit from ed. + + //// With this simple command we add the hammer to the permanent inventory of our guy. + %^GREEN%^ add hammer to guy %^RESET%^ + ob2: /realms/testycre/area/npc/guy.c + ob: /realms/testycre/area/weap/hammer.c + Please enter a command for the NPC to perform with this item. If you have no + such command to enter, enter the number of these items you want to add: + %^GREEN%^ wield hammer %^RESET%^ + Indenting file... + "/tmp/indent.1134437569.tmp.dat" 22 lines 489 bytes + Exit from ed. + + /realms/testycre/area/npc/guy: Ok + Guy wields a heavy war hammer. + SetInventory modification complete. + %^GREEN%^ exa guy %^RESET%^ + This is just some random guy. + The male human is in top condition. + Guy is carrying: + A heavy war hammer (wielded in left hand and right hand) + + %^GREEN%^ about guy %^RESET%^ + /realms/testycre/area/npc/guy.c + + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("guy"); + SetAdjectives( ({"just some", "random", "some"}) ); + SetId( ({"dude", "fellow", "fella"}) ); + SetShort("The Dude"); + SetLong("This is just some random guy."); + SetInventory(([ + "/realms/testycre/area/weap/hammer" : "wield hammer", + ])); + SetLevel(10); + SetRace("human"); + SetClass("explorer"); + SetGender("male"); + + } + void init(){ + ::init(); + } + + //// Making armor is just as easy: + %^GREEN%^ create armor helmet %^RESET%^ + I'm going to go with the appropriate area directory: + /realms/testycre/area/armor/helmet.c + You wave your hand mysteriously and generic armor materializes! + %^GREEN%^ modify armor name helmet %^RESET%^ + Indenting file... + "/tmp/indent.1134437645.tmp.dat" 18 lines 483 bytes + Exit from ed. + + %^GREEN%^ modify helmet id %^RESET%^ + This setting takes multiple values. If you have no more values to enter, then + enter a dot on a blank line. To cancel, enter a single q on a blank line. + You may now enter the next value. So far, it is blank. + If you're done entering values, enter a dot on a blank line. + %^GREEN%^ helm %^RESET%^ + You may now enter the next value. So far, we have: ({ "helm" }) + If you're done entering values, enter a dot on a blank line. + %^GREEN%^ headgear %^RESET%^ + You may now enter the next value. So far, we have: ({ "helm", "headgear" }) + If you're done entering values, enter a dot on a blank line. + %^GREEN%^ cover %^RESET%^ + You may now enter the next value. So far, we have: ({ "helm", "headgear", + "cover" }) + If you're done entering values, enter a dot on a blank line. + %^GREEN%^ . %^RESET%^ + Entries complete. Final array is: ({ "helm", "headgear", "cover" }) + Indenting file... + "/tmp/indent.1134437661.tmp.dat" 22 lines 535 bytes + Exit from ed. + + /realms/testycre/tmp/helmet1134437649: Ok + /realms/testycre/area/armor/helmet: Ok + SetId modification complete. + %^GREEN%^ modify helmet short a horned viking helmet %^RESET%^ + Indenting file... + "/tmp/indent.1134437692.tmp.dat" 22 lines 544 bytes + Exit from ed. + + %^GREEN%^ modify helmet long Vikings didn't really wear horned helmets into combat, but this one does look formidable with its large bull horns and thick iron construction. It should prove very protective. %^RESET%^ + Indenting file... + "/tmp/indent.1134437772.tmp.dat" 22 lines 666 bytes + Exit from ed. + + %^GREEN%^ modify helmet adj %^RESET%^ + This setting takes multiple values. If you have no more values to enter, then + enter a dot on a blank line. To cancel, enter a single q on a blank line. + You may now enter the next value. So far, it is blank. + If you're done entering values, enter a dot on a blank line. + %^GREEN%^ iron %^RESET%^ + You may now enter the next value. So far, we have: ({ "iron" }) + If you're done entering values, enter a dot on a blank line. + %^GREEN%^ thick %^RESET%^ + You may now enter the next value. So far, we have: ({ "iron", "thick" }) + If you're done entering values, enter a dot on a blank line. + %^GREEN%^ viking %^RESET%^ + You may now enter the next value. So far, we have: ({ "iron", "thick", "viking" + }) + If you're done entering values, enter a dot on a blank line. + %^GREEN%^ horned %^RESET%^ + You may now enter the next value. So far, we have: ({ "iron", "thick", "viking", + "horned" }) + If you're done entering values, enter a dot on a blank line. + %^GREEN%^ formidable %^RESET%^ + You may now enter the next value. So far, we have: ({ "iron", "thick", "viking", + "horned", "formidable" }) + If you're done entering values, enter a dot on a blank line. + %^GREEN%^ protective %^RESET%^ + You may now enter the next value. So far, we have: ({ "iron", "thick", "viking", + "horned", "formidable", "protective" }) + If you're done entering values, enter a dot on a blank line. + %^GREEN%^ . %^RESET%^ + Entries complete. Final array is: ({ "iron", "thick", "viking", "horned", + "formidable", "protective" }) + Indenting file... + "/tmp/indent.1134437802.tmp.dat" 22 lines 722 bytes + Exit from ed. + + /realms/testycre/tmp/helmet1134437782: Ok + /realms/testycre/area/armor/helmet: Ok + SetAdjectives modification complete. + %^GREEN%^ about helmet %^RESET%^ + /realms/testycre/area/armor/helmet.c + + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("helmet"); + SetAdjectives( ({"iron", "thick", "viking", "horned", "formidable", + "protective"}) ); + SetId( ({"helm", "headgear", "cover"}) ); + SetShort("a horned viking helmet"); + SetLong("Vikings didn't really wear horned helmets into combat, but this + one does look formidable with its large bull horns and thick iron construction. + It should prove very protective."); + SetMass(50); + SetDamagePoints(100); + SetArmorType(A_BODY_ARMOR); + SetProtection(BLUNT, 20); + SetProtection(BLADE, 20); + SetProtection(KNIFE, 20); + + } + void init(){ + ::init(); + } + %^GREEN%^ modify helmet armortype helmet %^RESET%^ + Indenting file... + "/tmp/indent.1134437818.tmp.dat" 22 lines 718 bytes + Exit from ed. + + %^GREEN%^ modify helmet mass 200 %^RESET%^ + Indenting file... + "/tmp/indent.1134437830.tmp.dat" 22 lines 719 bytes + Exit from ed. + + %^GREEN%^ modify helmet protection %^RESET%^ + Your armor can protect against one or more of the following types of damage: + blunt, blade, knife, water, shock, cold, heat, gas, acid, magic, poison, + disease, trauma, .. + + Please enter which ones your armor should protect from, one at a time. + When you are done, please type a dot on a blank line. + %^GREEN%^ blunt %^RESET%^ + You may now enter the next value. So far, we have: ({ "blunt" }) + If you're done entering values, enter a dot on a blank line. + %^GREEN%^ blade %^RESET%^ + You may now enter the next value. So far, we have: ({ "blunt", "blade" }) + If you're done entering values, enter a dot on a blank line. + %^GREEN%^ knife %^RESET%^ + You may now enter the next value. So far, we have: ({ "blunt", "blade", "knife" + }) + If you're done entering values, enter a dot on a blank line. + %^GREEN%^ trauma %^RESET%^ + You may now enter the next value. So far, we have: ({ "blunt", "blade", "knife", + "trauma" }) + If you're done entering values, enter a dot on a blank line. + %^GREEN%^ . %^RESET%^ + Protections list complete. + Please enter the protection value for: BLUNT + %^GREEN%^ 15 %^RESET%^ + Please enter the protection value for: BLADE + %^GREEN%^ 20 %^RESET%^ + Please enter the protection value for: KNIFE + %^GREEN%^ 25 %^RESET%^ + Please enter the protection value for: TRAUMA + %^GREEN%^ 10 %^RESET%^ + This is where the mapping gets sent somewhere. + ProtectionsMap is: ([ "BLADE" : 20, "BLUNT" : 15, "TRAUMA" : 10, "KNIFE" : 25 ]) + Indenting file... + "/tmp/indent.1134437901.tmp.dat" 23 lines 750 bytes + Exit from ed. + + %^GREEN%^ about helmet %^RESET%^ + /realms/testycre/area/armor/helmet.c + + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("helmet"); + SetAdjectives( ({"iron", "thick", "viking", "horned", "formidable", + "protective"}) ); + SetId( ({"helm", "headgear", "cover"}) ); + SetShort("a horned viking helmet"); + SetLong("Vikings didn't really wear horned helmets into combat, but this + one does look formidable with its large bull horns and thick iron construction. + It should prove very protective."); + SetMass(200); + SetDamagePoints(100); + SetArmorType(A_HELMET); + SetProtection(BLADE, 20); + SetProtection(BLUNT, 15); + SetProtection(TRAUMA, 10); + + SetProtection(KNIFE, 25); + } + void init(){ + ::init(); + } + %^GREEN%^ l %^RESET%^ + /realms/testycre/area/room/test2 + Room 2 [w] + This is the second test room. + A horned viking helmet and a heavy war hammer are here. + The Dude is standing here. + + + %^GREEN%^ exa dude %^RESET%^ + This is just some random guy. + The male human is in top condition. + Guy is carrying: + A heavy war hammer (wielded in left hand and right hand) + + %^GREEN%^ add helmet to dude %^RESET%^ + ob2: /realms/testycre/area/npc/guy.c + ob: /realms/testycre/area/armor/helmet.c + Please enter a command for the NPC to perform with this item. If you have no + such command to enter, enter the number of these items you want to add: + %^GREEN%^ wear helmet %^RESET%^ + Indenting file... + "/tmp/indent.1134437927.tmp.dat" 23 lines 544 bytes + Exit from ed. + + /realms/testycre/area/npc/guy: Ok + Guy wields a heavy war hammer. + Guy wears a horned viking helmet. + SetInventory modification complete. + %^GREEN%^ exa dude %^RESET%^ + This is just some random guy. + The male human is in top condition. + Guy is carrying: + A heavy war hammer (wielded in left hand and right hand) + A horned viking helmet (worn) + + //// Ok our dude is done. Let's clean up the room by updating it: + %^GREEN%^ update %^RESET%^ + Updating environment + /realms/testycre/area/room/test2: Ok + %^GREEN%^ l %^RESET%^ + /realms/testycre/area/room/test2 + Room 2 [w] + This is the second test room. + %^GREEN%^ pwd %^RESET%^ + /realms/testycre: + %^GREEN%^ cd area/npc %^RESET%^ + /realms/testycre/area/npc: + //// We need to have the guy present in order to add him to the room: + %^GREEN%^ clone guy %^RESET%^ + Guy wields a heavy war hammer. + Guy wears a horned viking helmet. + You clone The Dude (/realms/testycre/area/npc/guy.c). + %^GREEN%^ add guy to room %^RESET%^ + ob2: /realms/testycre/area/room/test2.c + ob: /realms/testycre/area/npc/guy.c + Please enter the number of these that you want to add: + %^GREEN%^ 1 %^RESET%^ + Indenting file... + "/tmp/indent.1134437999.tmp.dat" 26 lines 485 bytes + Exit from ed. + + /realms/testycre/area/room/test2: Ok + /realms/testycre/area/room/test2 + Room 2 [w] + This is the second test room. + The Dude is standing here. + + + SetInventory modification complete. + %^GREEN%^ update %^RESET%^ + Updating environment + /realms/testycre/area/room/test2: Ok + //// That's it. Easy, huh? Think of how much slogging through ed this would save you when making a large area. + %^GREEN%^ l %^RESET%^ + /realms/testycre/area/room/test2 + Room 2 [w] + This is the second test room. + The Dude is standing here. + + + %^GREEN%^ exa dude %^RESET%^ + This is just some random guy. + The male human is in top condition. + Guy is carrying: + A heavy war hammer (wielded in left hand and right hand) + A horned viking helmet (worn) + + %^GREEN%^ more here %^RESET%^ + #include <lib.h> + #include "/realms/testycre/customdefs.h" + + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Room 2"); + SetLong("This is the second test room."); + SetExits(([ + "west" : "/realms/testycre/area/room/test1", + ])); + + SetItems( ([ + "template" : "That's what this is.", + ]) ); + + SetInventory(([ + "/realms/testycre/area/npc/guy" : 1, + ])); + } + + void init(){ + ::init(); + } + + %^GREEN%^ quit %^RESET%^ + Please come back another time! + + Obviously you still need to code some LPC in ed for complex stuff. But knocking out rooms and NPC's and objects quickly helps you avoid getting bogged down in mechanics when what you really want to do is build. + + diff -c -r --new-file ds1.1/lib/doc/help/creators/security ds2.0r27/lib/doc/help/creators/security *** ds1.1/lib/doc/help/creators/security Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/help/creators/security Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,74 ---- + Nightmare 3.3/Foundation I Security + Created by Descartes of Borg + + Nightmare 3.3 has moved to a new style of security called stack + security. Stack security differs completely from the old EUID/UID + method. This document attempts to detail stack security. + + Stack security relies on checking an entire call stack for security + operations. With the old style security, the master object would only + check the to see if the object asking for access had access to perform + a certain operation. For example, say object A wanted to write to a + file. No matter how it got to desire to write to that file, the + master object would allow or deny it access based solely on its + merits. A good way, therefore, to defeat the old security system + would be to fake out object A and get it to write to a file using its + priveledges for you. + + With stack security, an object cannot be used to fake out the master + object. Instead, the master object traverse the entire call stack to + be certain that it should allow access. Take a rm command. + + I issue the command rm. The player object calls the command daemon. + The player object then calls the rm command. The rm command tries to + rm the file. So you have 3 objects here on the stack, my player + object two times, and the rm command (the command daemon made no + external calls, so it is not on the stack). In order for the rm + command to succeed, I and the rm command must all have access to rm + the file. As an admin, I have the access, and the rm command as well + has that access, so the command succeeds. If it had been a regular + creator however, perhaps trying to rm the master object, the operation + would have failed. The rm command still would have had access, but + the creator's player object would not have. + + In order to understand how this works, you must understand the + difference between file protection and object access. File protection + is the level of protection a file has from operations of other + objects. File protections are defined in /secure/cfg/read.cfg and + /secure/cfg/write.cfg. File protections must ALWAYS be greater than + or equal to the access an object cloned from that file has. If not, + then you have a security leak. + + File access is defined through the SimulEfun file_privs(). Upon + creation, each object gets a privs string which is a list of privs + separated by a :. Player objects always have their name as part of + their privs string. Privs can never change once set. + + By making protection greater than access, what I mean is this: + Any object which has access to a given file should on its own have + access to any files which an object created from that file would have + access to. For example, /secure has access to everything. Therefore, + only SECURE objects should have access to it. If you allow any priv, + say an admin priv like descartes, to have access to /secure, you are + by default giving SECURE access to that outside priv. So now anything + which can write to my home directory can become SECURE! + + The final key to the stack security system is the unguarded() + SimulEfun. + + mixed unguarded(function f); + + Any object can make an old-style, depend on me only operation by + making that function unguarded. For example, I am a creator that has + a guild object which needs to save to my home directory. My guild + object has write access to my home directory, but players using it + would not. So stack security would make it impossible for you to have + any such object. If, in the guild object, you have the following + call: + + unguarded((: save_object, "/realms/descartes/guild/save/obj" :)); + + The object will saved based SOLELY on the permissions which the guild + object has. If the guild object can write to the directory, then the + operation succeeds regardless of the rest of the stack. If the guild + object can't do it, then the operation fails. diff -c -r --new-file ds1.1/lib/doc/help/creators/staff ds2.0r27/lib/doc/help/creators/staff *** ds1.1/lib/doc/help/creators/staff Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/help/creators/staff Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,25 ---- + Dead Souls Magical Wooden Staff + + The Dead Souls Quick Creation System is a big, complicated mess + for a number of reasons, mostly having to do with the necessity of + interpreting potentially unusual code. + + Among the compromises made to get the system working is that it is + bound to a specific object that must be carried. The original plan + had called for a daemon, but the modular design and need for global + variables meant either a mind-numbingly complex workaround, or individuating + the daemon functions. + + Making the QCS work through a special object simplifies the + interaction between modules, and limits the memory overhead to the + few characters that have a need to use it. + + Thus, in order to use QCS, you must be carrying the creator's staff, + which is /secure/obj/staff.c + + It doesn't have to be a staff. If you prefer it to be a hat, or a + gold watch, or whatever, feel free to make it so. Just remember that + the creation object must inherit the modules that the staff inherits, and + it must answer to the id "tanstaafl". + + diff -c -r --new-file ds1.1/lib/doc/help/players/alias ds2.0r27/lib/doc/help/players/alias *** ds1.1/lib/doc/help/players/alias Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/help/players/alias Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,28 ---- + Syntax: alias <short version> <long version> + alias <short version> <long version> $* + + This command lets you substitute a short command for a long one. + For example, rather than type out "get all from corpse" you + can create this alias: + + %^GREEN%^alias gc get all from corpse%^RESET%^ + + And all you need do is type "gc" to get the same effect. + You can also use a wildcard, like this: + + %^GREEN%^alias gc get all from $* corpse%^RESET%^ + + So that typing: %^GREEN%^gc first%^RESET%^ + Expands out to: %^GREEN%^get all from first corpse%^RESET%^ + + The wildcard is also helpful for channel aliases: + + %^GREEN%^alias ige intergossipemote $*%^RESET%^ + + To see your aliases, type: %^GREEN%^alias%^RESET%^ + + To remove an alias, type alias plus the alias, like so: + + %^GREEN%^alias gc%^RESET%^ + + diff -c -r --new-file ds1.1/lib/doc/help/players/banking ds2.0r27/lib/doc/help/players/banking *** ds1.1/lib/doc/help/players/banking Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/help/players/banking Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,35 ---- + + + Dead Souls Bankers/Tellers + + As with most other non-player characters (NPCs), bank tellers respond + to certain requests players make using the "ask" and "request" + commands. Dead Souls bank tellers respond to at least the following + requests: + + request account from TELLER + request balance from TELLER + ask TELLER to deposit AMOUNT CURRENCY + ask TELLER to withdraw AMOUNT CURRENCY + ask TELLER to exchange AMOUNT CURRENCY for CURRENCY + + examples: + + ask teller to deposit 100 gold + ask teller to withdraw 10 platinum + ask teller to exchange 10 electrum for silver + + notes: + + - All banks require a minimum balance to open an account. + To use any of the bank's services, you must first open an + account with the bank (request account...). + + - Banks may have more than one location. You can bank at any + location once you have opened an account with the named bank. + + - Some banks charge for certain transactions. The charges vary + from bank to bank, but may be influenced by whether or not you + are a local resident in the town the bank resides in. + + diff -c -r --new-file ds1.1/lib/doc/help/players/channels ds2.0r27/lib/doc/help/players/channels *** ds1.1/lib/doc/help/players/channels Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/help/players/channels Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,55 ---- + Channels are an out-of-character (OOC) means for users + to communicate with each other. You may hear the terms + "channel" and "line" used interchangeably. + + There are two main types of channels: local and intermud. + The default Dead Souls distribution uses these channels as + local: + + cre - only creators hear this + gossip - general offtopic stuff + newbie - everyone can hear this unless they turn it off + thief - channel for the thief class + fighter - channel for the fighter class + error - system errors + death - death announcements + mage - channel for the thief class + priest - channel for the thief class + explorer - channel for the thief class + admin - only admins hear this + + The following are intermud channels: + + ds - Dead Souls mud code talk + ds_test - testing testing 1, 2, 3, etc + intergossip - general offtopic stuff + lpuni - LPUniversity discussion + intercre - general technical chatter + + + By default, players do not have access to intermud channels. + Mud admins are asked to maintain some level of adherence to + the channel topics from their users. Muds that violate the + router admin's interpretation of "on-topic" will be asked + politely, if possible, to conform to the channel standards. + + Continued violations subject the offending mud to potential + banning. + + Hate speech is not tolerated, and flaming is frowned + upon, though each mud is expected to police itself and + enforce these standards on their own. + + If you don't like these rules, use a router other than the default. + + For local channels of course, none of this applies. Whatever + local rules are in place, that's what must be obeyed. + + Some tips: + --------- + To turn on/off a channel, type its name by itself, like this: newbie + + To know who is listening to a channel: list newbie + + To see a brief history of channel messages: hist newbie + diff -c -r --new-file ds1.1/lib/doc/help/players/classes ds2.0r27/lib/doc/help/players/classes *** ds1.1/lib/doc/help/players/classes Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/help/players/classes Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,46 ---- + Dead Souls LPMud Character Classes + Originally written by Mikla and Xymox 95111 + Last Modified: 951111 + + As a character on Dead Souls, your learned abilities, also known as + skills, are determined by your class. Before you join a class, you + have no skills and are able to do virtually nothing. It is thus + essential that you join a class as soon as you have determined how you + wish to play Dead Souls. + + How do you wish to play Dead Souls? + Dead Souls can be played towards many different ends, limited only by + your imagination. Each class is designed to fit a different playing + philosophy and experience. For example, some people prefer pure + "hack-n-slash" gaming. Fighters are well suited to this type of + player. Other players, however, prefer socialization and role-playing + over monster killing and adventuring. Fishers are ideally suited + towards this end. + + When you join a class, you will be provided with set of skills both in + which your class excels over others as well as which determine your + success within your class. In addition, you gain an improved ability + for learning, both through training and experience, those skills that are + associated with your class. + + What you choose to do with these skills is up to you. Membership in a + class only suggests that you have certain talents that you tend to + specialize at or that you are simply just naturally good at. Once you + join a class, you are a member for life, and it becomes your primary + source of power. In the reality of Dead Souls, there are four basic + classes of people: + + clerics, fighters, mages, thieves. + + There are help files on each of these. + + Each class has four primary skills, as well as other skills which are + important to them. The primary skills determine your level. Level is + simply a way to measure how good you are at your class. It does not + serve as a method for comparing players of different classes. In + other words, the only thing you can say about a level 10 fighter and a + level 10 mage, is that the mage magicks as well as the fighter + fights. It does not suggest that the fighter should be able to cast spells + as well as the mage, nor that the mage should be able to fight as + well as the fighter. + diff -c -r --new-file ds1.1/lib/doc/help/players/communication ds2.0r27/lib/doc/help/players/communication *** ds1.1/lib/doc/help/players/communication Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/help/players/communication Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,105 ---- + + There are many ways to communicate with other players. If + you're in the same room as your intended listener, you can just + use the "say" command, like this: + + %^GREEN%^say hi, crat%^RESET%^ + + If the message is secret, you can "whisper": + + %^GREEN%^whisper to cratylus are you idle?%^RESET%^ + + If you want to say something that everyone in the mud can + hear, use the "shout" command (at the cost of a lot of stamina): + + %^GREEN%^shout hey crat, wheredya go?%^RESET%^ + + Or, if it's an important secret and the target is not in the + same room as you, you can use the magical "tell" command: + + %^GREEN%^tell cratylus are you mad at me or something?%^RESET%^ + + + There are also special communication lines on the mud that are + class or role-specific. For example, if you type: + + %^GREEN%^newbie does anyone know what's up with cratylus?%^RESET%^ + + All people who are tuned into the newbie line will get + your message. To see what lines are available to you, type: + + %^GREEN%^lines%^RESET%^ + + To see who is listening to the newbie channel: + + %^GREEN%^list newbie%^RESET%^ + + To see who is listening to some other channel on some other mud: + + %^GREEN%^list otherchannel@othermud%^RESET%^ + + + To enable or disable a line, just type the name of it with no message. + + To see a brief history of the past few messages on a line (in + this case, the newbie line), type: + + %^GREEN%^hist newbie%^RESET%^ + + + Spamming lines is rude and probably dangerous to your character, so + be sure you comply with your mud's rules on lines. + + + Your mud may be on the intermud network. To find out, type the + command: + + %^GREEN%^mudlist%^RESET%^ + + If a list of muds comes up, you know your mud is probably + on the intermud3 communication network. Dead Souls by default restricts + players from access to intermud channels, but you can "tell" to + players on other muds, if you want. If you think your friend Xyzzy + is online on a mud on intermud3, you can issue this command: + + %^GREEN%^locate xyzzy%^RESET%^ + + If he's logged into a mud on i3, you will get something like: + + Xyzzy was just located on Frontiers. (idle 00:03:17) [status: inactive] + + You can then tell to him: + + %^GREEN%^tell xyzzy@frontiers dude, what's the deal with crat lately?%^RESET%^ + + + Sometimes a player or NPC does not understand your character's + native tongue. For example, if you are en elf, your native tongue is + not English, it is Edhellen. If someone talks to you in English, you + might see something like this: + + Xyzzy says in English, "leka mifahmam, potong-hwa." + + Since your character doesn't speak English, what you see is gibberish. + If you find a language teacher, your proficiency in the language they + teach you will allow you to understand more of the words you hear. + + Suppose that your elf character is now 100% fluent in English. + If you greet a human player named Xyzzy by typing: + + %^GREEN%^say hello there, xyzzy%^RESET%^ + + Xyzzy will probably see something like: + + Noobie says in Edhellen, "pericolo temak, forshtor." + + Instead, if you want to speak to a human, you'll have to type: + + %^GREEN%^speak in english hello there, xyzzy%^RESET%^ + + + To find out what languages you speak, type: + + %^GREEN%^language%^RESET%^ + + diff -c -r --new-file ds1.1/lib/doc/help/players/languages ds2.0r27/lib/doc/help/players/languages *** ds1.1/lib/doc/help/players/languages Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/help/players/languages Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,39 ---- + Dead Souls Languages + + Languages are essential to the way interaction occurs among players + and non-player characters. Every discussion you will have with an npc + will be done through that npc's native tongue generally (although some + npc's are more aware of other languages). + + When starting as a newbie, you will not much notice this. Newbies are + given full knowledge of all languages. This, however, does not last. + Once you cease to be a newbie, you only know your native language, + which you learn based on your race. + + As time goes on, you may wish to learn new languages. Certain npc's + across Dead Souls specialize in teaching people other languages. In + order to learn a new language, use the "ask" command to ask the npc to + teach you the language. The syntax is <ask LIVING to teach me LANGUAGE>. + For example: + + %^GREEN%^ask the sage to teach me nymal%^RESET%^ + + Not all teachers may know all languages. The teacher must naturally + know the language in order to teach it. + + The teacher will generally start spouting phrases in the language, + asking you to repeat them. It is to your advantage to try and repeat + what the teacher is saying in the language it is being said. + + To know what languages you speak, type: language + + To speak in a language other than your native one, type: + + speak in LANGUAGE MESSAGE + + example: + + %^GREEN%^speak in edhellen hi i speak a little elvish%^RESET%^ + + + See also: ask, shout, speak diff -c -r --new-file ds1.1/lib/doc/help/players/player_general ds2.0r27/lib/doc/help/players/player_general *** ds1.1/lib/doc/help/players/player_general Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/help/players/player_general Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,23 ---- + Basic player commands: + + look - get a view of your environment + inventory - take stock of your possessions + stat - your health and statistics + score - your overall ranking and information + + Dealing with objects: + -------------------- + look at, look in + get, drop, put, give + open, close + read + wield, unwield, wear, remove + + Moving around: + ------------- + n, s, e, w, ne, nw, se, sw, u, d + enter, go out, climb up, climb down, jump down + crawl, fly + + See also: help help + diff -c -r --new-file ds1.1/lib/doc/help/players/points ds2.0r27/lib/doc/help/players/points *** ds1.1/lib/doc/help/players/points Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/help/players/points Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,47 ---- + * Dead Souls Training Points * + Written by Blitz@Dead Souls 960904 + + What are training points? + + Training Points are awarded for achieving a new level. They + are not meant to be a means of advancing in the game, training + points are to be considered an extra bonus. + + How can I see my points? + + Your training points are listed under the "score" command. + + How are points earned? + + As stated above, Training points are earned when you gain + a new and "unique" level. A unique level is defined as a + a level you have never before attained with your character. + + How does death affect points? + + If you happen to lose a level (or levels) upon dying you + will be penalized 4 points per level. This does not apply + to newbies simply because they do not lose levels from + dying. + + For example, player Bob raises to level 6 and earns four + training points. Player Bob dies a horrible death and + finds himself at level 5 once again. Because Bob lost + a level he received -4 points. When our example reaches + level 6 again, he will "technically" earn 4 points to + compensate for the recently lost points. As you can see, + a player can only truly earn points for each "unique" + level gained. + + How do I use my training points? + + Throughout Dead Souls there are a number of NPCs who specialize + in training various skills. Trainers accept the following + commands; "ask <NPC> to help" will list the skills that the + NPC is capable of training. "ask <NPC> to train <SKILL>" + will start the process of training in the named skill. + + Please note that creators (including arches) cannot answer + questions regarding non-technical game play. To find a + trainer, you must search for yourself or ask other players. + diff -c -r --new-file ds1.1/lib/doc/help/players/races ds2.0r27/lib/doc/help/players/races *** ds1.1/lib/doc/help/players/races Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/help/players/races Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,36 ---- + Your race determines your genetic make-up. + + Some races are genetically predisposed to being stronger, sturdier, + more intelligent, more sensitive to light, etc. than other races. + In addition, different races are physically different from others, + having different limbs and other types of body parts. + In real life, you had no choice. You were born human. In the Dead Souls + reality, you do get a choice. Your choice should be based on your + style of playing? Do you want a magical character? Or do you + want to play the game by brute force? Or perhaps deception or + skullduggery? + + What do you prefer to explore? Do you like dark, enclosed areas? Or do + you like well lit castles or the open outdoors? + + Do you wish to have humanoid limbs which can be easily equipped? Or + are you interested in the advantages of having different limbs which + might allow you to wield more than two weapons at a time but are not + so easily equipped? + + All these questions face you now. Whatever choice you make, so long + as it fits the style in which you like to play, will be rewarding. + There is neither a best pick nor a worst pick. There is only what is + best or worst for your style. + + Towards that end, here are some clues: + Intelligence and wisdom make the best magic users. + Strength and constitution make the best fighters. + Dexterity and charisma make the best roguish types. + + Each race has its own help file. For example, to find out about humans, + type "help human". + + Type 'list' to see the selection while in the setter room. + + Type 'pick RACE' (for example, pick human ) to choose a race. diff -c -r --new-file ds1.1/lib/doc/help/players/vendors ds2.0r27/lib/doc/help/players/vendors *** ds1.1/lib/doc/help/players/vendors Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/help/players/vendors Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,35 ---- + Dead Souls Vendors + + As with other non-player characters, vendors respond to certain + requests people make using the "ask" command. Dead Souls vendors + respond to at least the following requests: + + %^GREEN%^ask VENDOR to appraise ITEM %^RESET%^ + %^GREEN%^ask VENDOR to browse%^RESET%^ + %^GREEN%^ask VENDOR to buy ITEM %^RESET%^ (identical to sell ITEM to VENDOR) + %^GREEN%^ask VENDOR to price ITEM%^RESET%^ + %^GREEN%^ask VENDOR to sell ITEM %^RESET%^ (identical to buy ITEM from VENDOR) + %^GREEN%^ask VENDOR to show ITEM%^RESET%^ + + Appraise allows you to get an offer from the vendor for an item you + might wish to sell. + + Browse allows you to browse through what the vendor has to sell. You + may also specify specific types of things to browse, for example: + %^GREEN%^ask VENDOR to browse helms%^RESET%^ + %^GREEN%^ask vendor to browse torches%^RESET%^ + + Buy requests that the vendor buy from you the item you specify. This is + identical to the sell command, so see "help sell". + + Price allows you to get the price of an item that the vendor has to + sell. + + Sell requests that the vendor sell you the specified item. This is + identical to the "buy" command, so see "help buy". + + Show allows you to look at an item which the vendor has for sale. + + See also: ask, buy, sell + + diff -c -r --new-file ds1.1/lib/doc/lpc/basic/Contents ds2.0r27/lib/doc/lpc/basic/Contents *** ds1.1/lib/doc/lpc/basic/Contents Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/basic/Contents Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,13 ---- + LPC Basics + Written by Descartes of Borg + 23 april 1993 + + Introduction + Chapter 1: Introduction to the Coding Environment + Chapter 2: The LPC Program + Chapter 3: LPC Data Types + Chapter 4: Functions + Chapter 5: The Basics of Inheritance + Chapter 6: Variable Handling + Chapter 7: Flow Control + Chapter 8: The Data Type Object diff -c -r --new-file ds1.1/lib/doc/lpc/basic/Introduction ds2.0r27/lib/doc/lpc/basic/Introduction *** ds1.1/lib/doc/lpc/basic/Introduction Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/basic/Introduction Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,104 ---- + LPC Basics + Written by Descartes of Borg + 23 april 1993 + + + INTRODUCTION + This manual, how to use it, and its terms + + I have seen a lot of requests lately on USENET for LPC manuals. In addition, + the immortals on my mud have been telling how good the building documentation + of Nightmare is, but that there was just no adequate explanation of the + LPC programming language. So I decided to try my hand at writing a manual. + Some things you should keep in mind. + LPC is a very easy programming language to learn, and it has real + value in that place most of us know as the real world. I began playing + muds in 1991, and in the space of a month created an unimpressive area + and musician's guild on the original Bates College MUD called Orlith. + After that, I moved to Los Angeles for a year and had no contact with + mudding or computers. In June of 1992, I was back on the internet and + a wizard of Igor. In September of 1992 I began coding the Nightmare + mudlib for our use, and then later decided to distribute it due to there + not being any mudlibs for MudOS at the time that a person could just throw + up a running mud with (now, that of course is not the case :)). + So, I have been doing serious coding for less than a year. As a + Philosophy major in a world of Computer Science majors, I just want to + make clear that it is not at all required that you have ever done anything + with your computer than log into a mud in order for you to really come + to understand LPC coding. This manual makes the following assumptions: + Someone has taught you basic UNIX commands like ls, cd, mkdir, mv, rm, etc. + You know how to enter your mud's editor and write a file. No other + assumptions are made. If you know C, you are handicapped in that LPC + looks a lot like C, but it is not C. Your preconceptions about + modular programming development will be a hinderence you will have to + overcome. If you have never heard of the C programming language (like + me in May of 1991), then you are only missing an understanding of the + simple constructs of C like the flow of program execution and logical + operators and such. So a C guru has no real advantage over you, since + what they know from C which is applicable to LPC is easy to pick up. + The stuff they know about C which makes them a guru is irrelevant to + LPC. + + The chapters of this manual are meant to be read in order. Starting with + the introduction, going sequentially through the chapter numbers as + ordered in the contents file. Each chapter begins with a paragraph or + two explaining what you should have come to understand by that point + in your studies. After those introductory paragraphs, the chapter then + begins to discuss its subject matter in nauseating detail. At the end + of the chapter is a briefly worded summary of what you should understand + from that chapter if I have been successful. Following that may or may + not be some sidenotes relevant to the subject at hand, but not necessary + to its understanding. + + If at any time you get to a chapter intro, and you have read the preceeding + chapters thoroughly and you do not understand what it says you should + understand by that point, please mail me! Clearly, I have failed at that + point and I need to know where it is I have gone wrong so I can revise + it properly. Similarly, if you do not understand what the chapter summary + says you should, please mail me. If your mumud is on the MudOS intermud + system, mail descartes@nightmare. Otherwise mail borg@hebron.connected.com. + + Some basic terms this manual uses: + driver- + This is the C program which is the game. It accepts incoming sockets + (links to other computers), interprets LPC code defined by the mudlib, + keeps mud objects in memory, makes periodic attempts to clean unused + mud objects from memory, makes periodic calls to objects, and so on. + + mudlib- + LPC code which defines the world in which you are in. The driver of itself + is not a game. It is just a program which allows the creation of a + multi-user environment. In some sense, the driver is like an LPC + compiler, and the mudlib is like a compiler's library (a very loose + analogy). The mudlib defines basic objects which will likely be used + over and over again by people creating in the mud world. Examples of + such objects are /std/room (or /room/room), /std/user.c (or /obj/player.c), + and so on. + + area or castle: + Specific creator coded objects which often use a feature of LPC called + inheritance to make use of the properties of basic mudlib objects and + turn them into specific objects to be used by players in the game + + object: + a room, a weapon, a monster, a player, a bag, etc. More importantly, + every individual file with a .c extension is an object. Objects are + used in different ways. Objects like /std/living.c are inherited by + objects like monster.c and user.c. Others are cloned, which means a + duplicate of that code is loaded into memory. And still others are + simply loaded into memory to be referenced by other objects. + + native and compat: + these two terms refer to two popular flavours of drivers. Native mode + mudlibs make use of on the design of LPMud driver 3.0 and later. You may + have a 3.0 driver however, but have a 2.4.5 style mudlib. This is what + is meant by compat mode. Mudlibs which are native mode are any for + MudOS, CD, and LPMud mudlibs that + are listed as native. Compat mudlibs are any LPMud mudlib before 3.0 and + those which are 3.* compat mudlibs. I believe Amylaar's is compat. + + Good Luck! + George Reese + (Descartes of Borg) + 12 july 1993 + borg@hebron.connected.com diff -c -r --new-file ds1.1/lib/doc/lpc/basic/chapter1 ds2.0r27/lib/doc/lpc/basic/chapter1 *** ds1.1/lib/doc/lpc/basic/chapter1 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/basic/chapter1 Wed Jul 5 00:01:10 2006 *************** *** 0 **** --- 1,90 ---- + LPC Basics + Written by Descartes of Borg + first edition: 23 april 1993 + second edition: 25 may 1993 + + CHAPTER 1: Introduction to the Coding Environment + + 1.1 UNIX file structure + LPMuds use basic UNIX commands and its file structure. If you know + UNIX commands already, then note (with a few exceptions) options are + not available to the commands. Like DOS, UNIX is heirarchical. The + root directory of which all directories are sub-directories is called + root(/). And from those sub-directories you may have further + sub-directories. A directory may be referred to in two different ways: + 1) by its full name, or absolute name, or 2) by its relative name. + Absolute name refers to the directory's full path starting from / winding + down the directory tree until you name the directory in question. For + example: + + /players/descartes/obj/monster + + refers to the directory monster which is a sub-directory of obj which + is a sub-directory of descartes which is a sub-directory of players + which is a sudirectory of /. + + The relative name refers to the name relative to another directory. + The above example is called monster relative to /players/descartes/obj, + but it is also called obj/monster relative to /players/descartes, + descartes/obj/monster relative to /players, and finally + players/descartes/obj/monster relative to /. You can tell the + difference between absolute names and relative names because absolute + names always start with /. In order to know exactly which directory + is being named by a relative name, you naturally must know what + directory it is relative to. + + A directory contains sub-directories and files. LPMuds only use text files + inside the mudlib. Like directories, files have both absolute and + relative names. The most basic relative name is often referred to as the file + name, with the rest of the absolute name being referred to as the path. So, + for the file: /players/descartes/castle.c, castle.c is the file name, and + /players/descartes is the path. + + On some muds, a file with a file name beginning with a . (like .plan) is + not visible when you list files with the regular file listing command. + + 1.2 UNIX Commands + Along with the UNIX file structure, LPMuds use many UNIX commands. Typical + UNIX commands on most muds are: + pwd, cd, ls, rm, mv, cp, mkdir, rmdir, more, head, cat, ed + If you have never before seen UNIX commands, you probably are thinking this + is all nonsense. Well, it is, but you got to use them. Before getting + into what they mean though, first a discussion of current directory. + If you know DOS, then you know what a current working directory is. + At any given point, you are considered to be "in" some directory. This + means that any relative file or directory names you give in UNIX commands + are relative to that directory. For example, if my current directory is + /players/descartes and I type "ed castle.c" (ed is the command to edit), + then it assumes I mean the file /players/descartes/castle.c + + pwd: shows you your current working directory + cd: changes your current working directory. You may give either relative + or absolute path names. With no arguments, it changes to your home + directory. + ls: lists all files in the directory named. If no directory is named, + it lists the files of the current working directory + rm: deletes the file named + mv: renames the file named + cp: copies the file named + mkdir: makes a new directory + rmdir: deletes a directory. All files must have been first removed. + more: pages the file named so that the file appears on your screen one + page at a time. + cat: shows the whole file to you at once + head: shows you the first several lines of a file + tail: shows you the last several lines of a file + ed: allows you to edit a file using the mud editor + + 1.3 Chapter Summary + UNIX uses a heirarchical file structure with the root of the tree being + named /. Other directories branch off from that root directory and + in turn have their own sub-directories. All directories may contain + directories and files. Directories and files are referred to either + by their absolute name, which always begins with /, or by their relative + name which gives the file's name relative to a particular directory. + In order to get around in the UNIX files structure, you have the + typical UNIX commands for listing files, your current directory, etc. + On your mud, all of the above commands should have detailed help commands + to help you explore exactly what they do. In addition, there should + be a very detailed file on your mud's editor. If you are unfamiliar + with ed, you should go over this convoluted file. diff -c -r --new-file ds1.1/lib/doc/lpc/basic/chapter2 ds2.0r27/lib/doc/lpc/basic/chapter2 *** ds1.1/lib/doc/lpc/basic/chapter2 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/basic/chapter2 Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,195 ---- + LPC Basics + Written by Descartes of Borg + first edition: 23 april 1993 + second edition: 16 june 1993 + + CHAPTER 2: The LPC Program + + 2.1 About programs + The title of this chapter of the textbook is actually poorly named, since + one does not write programs in LPC. An LPC coder instead writes *objects*. + What is the difference? Well, for our purposes now, the difference is + in the way the file is executed. When you "run" a program, execution + begins at a definite place in the program. In other words, there + is a place in all programs that is noted as the beginning where program + execution starts. In addition, programs have definite end points, + so that when execution reaches that point, the execution of the program + terminates. So, in short, execution of a program runs from a definite + beginning point through to a definite end point. This is not so with + LPC objects. + + With muds, LPC objects are simply distinct parts of the C program which + is running the game (the driver). In other words, execution of the mud + program begins and ends in the driver. But the driver in fact does + very little in the way of creating the world you know when you play + a mud. Instead, the driver relies heavily on the code created in LPC, + executing lines of the objects in the mud as needed. LPC objects thus + have no place that is necessarily the beginning point, nor do they + have a definite ending point. + + Like other programming languages, an LPC "program" may be made up of + one or more files. For an LPC object to get executed, it simple + needs to be loaded into the driver's memory. The driver will call lines + from the object as it needs according to a structure which will be + defined throughout this textbook. The important thing you need to + understand at this point is that there is no "beginning" to an LPC + object in terms of execution, and there is no "end". + + 2.2 Driver-mudlib interaction + As I have mentioned earlier, the driver is the C program that runs on + the host machine. It connects you into the game and processes LPC code. + Note that this is one theory of mud programming, and not necessarily + better than others. It could be that the entire game is written in C. + Such a game would be much faster, but it would be less flexible in + that wizards could not add things to the game while it was running. This + is the theory behind DikuMUDs. Instead, LPMUDs run on the theory that + the driver should in no define the nature of the game, that the nature + of the game is to be decided by the individuals involved, and that + you should be able to add to the game *as it is being played*. This + is why LPMUDs make use of the LPC programming language. It allows + you to define the nature of the game in LPC for the driver to read and + execute as needed. It is also a much simpler language to understand + than C, thus making the process of world creation open to a greater + number of people. + + Once you have written a file in LPC (assuming it is corrent LPC ), it justs + sits there on the host machine's hard drive until something in the game + makes reference to it. When something in the game finally does make + reference to the object, a copy of the file is loaded into memory and + a special *function* of that object is called in order to initialize + the values of the variables in the object. Now, do not be concerned + if that last sentence went right over your head, since someone brand + new to programming would not know what the hell a function or a variable + is. The important thing to understand right now is that a copy of the + object file is taken by the driver from the machine's hard drive and + stored into memory (since it is a copy, multiple versions of that + object may exist). You will later understand what a function is, what + a variable is, and exactly how it is something in the game made reference + to your object. + + 2.3 Loading an object into memory + Although there is no particular place in an object code that must exist + in order for the driver to begin executing it, there is a place for which + the driver will search in order to initialize the object. On compat + drivers, it is the function called reset(). On native muds it is the + function called create(). + + LPC objects are made up of variables (values which can change) and + functions which are used to manipulate those variables. Functions + manipulate variables through the use of LPC grammatical structures, + which include calling other functions, using externally defined + functions (efuns), and basic LPC expressions and flow control + mechanisms. + + Does that sound convoluted? First lets start with a variable. A + variable might be something like: level. It can "vary" from sitation + to situation in value, and different things use the value of the player's + level to make different things happen. For instance, if you are a + level 19 player, the value of the variable level will be 19. Now + if your mud is on the old LPMud 2.4.5 system where levels 1-19 are + players and 20+ are wizards, things can ask for your level value to + see if you can perform wizard type actions. Basically, each object + in LPC is a pile of variables with values which change over time. + Things happen to these objects based on what values its variables + hold. Often, then things that happen cause the variables to change. + + So, whenever an object in LPC is referenced by another object currently + in memory, the driver searches to see what places for values the + object has (but they have no values yet). Once that is done, the driver + calls a function in the object called reset() or create() (depending + on your driver) which will set up the starting values for the object's + variables. It is thus through *calls* to *functions* that variable + values get manipulated. + + But create() or reset() is NOT the starting place of LPC code, although + it is where most LPC code execution does begin. The fact is, those + functions need not exist. If your object does just fine with its + starting values all being NULL pointers (meaning, for our purposes + here, 0), then you do not need a create() or reset() function. Thus + the first bit of execution of the object's code may begin somewhere + completely different. + + Now we get to what this chapter is all about. The question: What + consists a complete LPC object? Well, an LPC object is simply + one or more functions grouped together manipulating 0 or more + variables. The order in which functions are placed in an object + relative to one another is irrelevant. In other words: + + ----- + void init() { add_action("smile", "smile"); } + + void create() { return; } + + int smile(string str) { return 0; } + ----- + + is exactly the same as: + + ----- + void create() { return; } + + int smile(string str) { return 0; } + + void init() { add_action("smile", "smile"); } + _____ + + Also important to note, the object containing only: + + ----- + void nonsense() {} + ----- + + is a valid, but trivial object, although it probably would not interact + properly with other objects on your mud since such an object has no + weight, is invisible, etc.. + + 2.4 Chapter summary + LPC code has no beginning point or ending point, since LPC code is used + to create objects to be used by the driver program rather than create + individual programs. LPC objects consist of one or more functions whose + order in the code is irrelevant, as well as of zero or more variables whose + values are manipulated inside those functions. LPC objects simply sit + on the host machine's hard driver until referenced by another object in + the game (in other words, they do not really exist). Once the object + is referenced, it is loaded into the machine's memory with empty + values for the variables. The function reset() in compat muds or + create() in native muds is called in that object if it exists to allow + the variables to take on initial values. Other functions in the object + are used by the driver and other objects in the game to allow interaction + among objects and the manipulation of the LPC variables. + + A note on reset() and create(): + create() is only used by muds in native mode (see the textbook Introduction + for more information on native mode vs. compat mode). It is only used + to initialize newly referenced objects. + + reset() is used by both muds in compat mode and native mode. In compat + mode, reset() performs two functions. First, it is used to initialize + newly referenced objects. In addition, however, compat mode muds use + reset() to "reset" the object. In other words, return it to its initial + state of affairs. This allows monsters to regenerate in a room and doors + to start back in the shut position, etc.. Native mode muds use reset() + to perform the second function (as its name implies). + + So there are two important things which happen in LP style muds which + cause the driver to make calls to functions in objects. The first is + the creation of the object. At this time, the driver calls a function + to initalize the values in the object. For compat mode muds, this + is performed by the function named reset() (with an argument of 0, + more on this later though). For muds running in native mode, this is + performed by the function create(). + + The second is the returning of the room to some base state of affairs. + This base set of affairs may or may not be different from the initial + state of affairs, and certainly you would not want to take up time + doing redundant things (like resetting variables that never change). + Compat mode muds nevertheless use the same function that was used to + create the object to reset it, that being reset(). Native mode muds, + who use create() to create the room, instead use reset() to reset it. + All is not lost in compat mode though, as there is a way to tell the + difference between creation and resetting. For reset purposes, the + driver passes either 1 or the reset number as an argument to reset() + in compat mode. Now this is meaningless to you now, but just keep in + mind that you can in fact tell the difference in compat mode. Also + keep in mind that the argment in the creation use of reset is 0 and + the argument in the reset use is a nonzero number. diff -c -r --new-file ds1.1/lib/doc/lpc/basic/chapter3 ds2.0r27/lib/doc/lpc/basic/chapter3 *** ds1.1/lib/doc/lpc/basic/chapter3 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/basic/chapter3 Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,185 ---- + LPC Basics + Written by Descartes of Borg + first edition: 23 april 1993 + second edition: 17 june 1993 + + CHAPTER 3: LPC Data Types + + 3.1 What you should know by now + LPC object are made up of zero or more variables manipulated by one or + more functions. The order in which these functions appear in code is + irrelevant. The driver uses the LPC code you write by loading copies of + it into memory whenever it is first referenced and additional copies + through cloning. When each object is loaded into memory, all the variables + initially point to no value. The reset() function in compat muds, and + create() in native muds are used to give initial values to variables in + objects. The function for creation is called immediately after the object + is loaded into memory. However, if you are reading this textbook with no + prior programming experience, you may not know what a function is or how + it gets called. And even if you have programming experience, you may + be wondering how the process of functions calling each other gets started + in newly created objects. Before any of these questions get answered, + however, you need to know more about what it is the functions are + manipulating. You therefore should thouroughly come to know the concept + behind LPC data types. Certainly the most boring subject in this manual, + yet it is the most crucial, as 90% of all errors (excepting misplaced + {} and ()) involve the improper usage of LPC data types. So bear through + this important chapter, because it is my feeling that understanding this + chapter alone can help you find coding much, much easier. + + 3.2 Communicating with the computer + You possibly already know that computers cannot understand the letters + and numbers used by humans. Instead, the "language" spoken by computers + consists of an "alphabet" of 0's and 1's. Certainly you know computers + do not understand natural human languages. But in fact, they do not + understand the computer languages we write for them either. Computer + languages like BASIC, C, C++, Pascal, etc. are all intermediate + languages. They allow you to structure your thoughts more coherently + for translation into the 0's and 1's of the computer's languages. + + There are two methods in which translation is done: compilation and + interpretation. These simply are differences betweem when the + programming language is translated into computer language. With + compiled languages, the programmer writes the code then uses a program + called a compiler to translate the program into the computer's + language. This translation occurs before the program is run. With + interpreted languages however, the process of translation occurs as + the program is being run. Since the translation of the program is + occurring during the time of the program's running in interpreted + languages, interpreted languages make much slower programs than + compiled languages. + + The bottom line is, no matter what language you are writing in, at + some point this has to be changed into 0's and 1's which can be + understood by the computer. But the variables which you store in + memory are not simply 0's and 1's. So you have to have a way in + your programming languages of telling the computer whether or not + the 0's and 1's should be treated as decimal numbers or characters or + strings or anything else. You do this through the use of data types. + + For example, say you have a variable which you call 'x' and you give + it the decimal whole number value 65. In LPC you would do this through + the statement: + + ----- + x = 65; + ----- + + You can later do things like: + + _____ + write(x+"\n"); /* \n is symbolically represents a carriage return */ + y = x + 5; + ----- + + The first line allows you to send 65 and a carriage return to someone's screen. + The second line lets you set the value of y to 70. + The problem for the computer is that it does not know what '65' means when + you tell it x = 65;. What you think of 65, it might think of as: + 00000000000000000000000001000001 + But, also, to the computer, the letter 'A' is represented as: + 00000000000000000000000001000001 + So, whenever you instruct the computer write(x+"\n");, it must have some + way of knowing that you want to see '65' and not 'A'. + + The computer can tell the difference between '65' and 'A' through the use + of data types. A data types simply says what type of data is being stored + by the memory location pointed to by a given variable. Thus, each LPC + variable has a variable type which guides conversions. In the example + given above, you would have had the following line somewhere in the + code *before* the lines shown above: + + ----- + int x; + ----- + + This one line tells the driver that whatever value x points to, it will + be used as the data type "int", which is short for integer, or whole + number. So you have a basic introduction into the reason why data types + exist. They exist so the driver can make sense of the 0's and 1's that + the computer is storing in memory. + + 3.3 The data types of LPC + All LPMud drivers have the following data types: + + void, status, int, string, object, int *, string *, object *, mixed * + + Many drivers, but not all have the following important data types which + are important to discuss: + + float, mapping, float *, mapping * + + And there are a few drivers with the following rarely used data types + which are not important to discuss: + + function, enum, struct, char + + 3.4 Simple data types + This introductory textbook will deal with the data types void, status, + int, float, string, object, mand mixed. You can find out about the + more complex data types like mappings and arrays in the intermediate + textbook. This chapter deals with the two simplest data types (from the + point of view of the LPC coder), int and string. + + An int is any whole number. Thus 1, 42, -17, 0, -10000023 are all type int. + A string is one or more alphanumeric characters. Thus "a", "we are borg", + "42", "This is a string" are all strings. Note that strings are always + enclosed in "" to allow the driver to distinguish between the int 42 and + the string "42" as well as to distinguish between variable names (like x) + and strings by the same names (like "x"). + + When you use a variable in code, you must first let the driver know + what type of data to which that variable points. This process is + called *declaration*. You do this at the beginning of the function + or at the beginning of the object code (outside of functions before all + functions which use it). This is done by placing the name of the data type + before the name of the variable like in the following example: + + ----- + void add_two_and_two() { + int x; + int y; + + x = 2; + y = x + x; + } + ----- + + Now, this is a complete function. The name of the function is + add_two_and_two(). The function begins with the declaration of an + int variable named x followed by the declaration of an in variable + named y. So now, at this point, the driver now has two variables which + point to NULL values, and it expects what ever values end up there to be + of type int. + + A note about the data types void and status: + Void is a trivial data type which points to nothing. It is not used + with respect to variables, but instead with respect to functions. You + will come to understand this better later. For now, you need only + understand that it points to no value. + + The data type status is a boolean data type. That is, it can only have + 1 or 0 as a value. This is often referred to as being true or false. + + 3.5 Chapter summary + For variables, the driver needs to know how the 0's and 1's the computer + stores in memory get converted into the forms in which you intend them + to be used. The simplest LPC data types are void, status, int, and string. + You do not user variables of type void, but the data type does come + into play with respect to functions. In addition to being used for + translation from one form to the next, data types are used in determining + what rules the driver uses for such operations as +, -, etc. For example, + in the expression 5+5, the driver knows to add the values of 5 and 5 + together to make 10. With strings however, the rules for int addition + make no sense. So instead, with "a"+"b", it appends "b" to the string "a" + so that the final string is "ab". Errors can thus result if you mistakenly + try to add "5"+5. Since int addition makes no sense with strings, the + driver will convert the second 5 to "5" and use string addition. The final + result would be "55". If you were looking for 10, you would therefore + have ended up with erroneous code. Keep in mind, however, that in most + instances, the driver will not do something so useful as coming up with + "55". It comes up with "55" cause it has a rule for adding a string + to an int, namely to treat the int as a string. In most cases, if you + use a data type for which an operation or function is not defined + (like if you tried to divide "this is" by "nonsense", "this is"/"nonsense"), + the driver will barf and report an error to you. diff -c -r --new-file ds1.1/lib/doc/lpc/basic/chapter4 ds2.0r27/lib/doc/lpc/basic/chapter4 *** ds1.1/lib/doc/lpc/basic/chapter4 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/basic/chapter4 Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,225 ---- + LPC Basics + Written by Descartes of Borg + first edition: 23 april 1993 + second edition: 22 june 1993 + + CHAPTER 4: Functions + + 4.1 Review + By this point, you should be aware that LPC objects consist of functions + which manipulate variables. The functions manipulate variables when they + are executed, and they get executed through *calls* to those functions. + The order in which the functions are placed in a file does not matter. + Inside a function, the variables get manipulated. They are stored in + computer memory and used by the computer as 0's and 1's which + get translated to and from useable output and input through a device + called data typing. String data types tell the driver that the + data should appear to you and come from you in the form of alphanumeric + characters. Variables of type int are represented to you as whole + number values. Type status is represented to you as either 1 or 0. + And finally type void has no value to you or the machine, and is not + really used with variable data types. + + 4.2 What is a function? + Like math functions, LPC functions take input and return output. + Languages like Pascal distinguish between the concept of proceedure abd + the concept of function. LPC does not, however, it is useful to + understand this distinction. What Pascal calls a proceedure, LPC + calls a function of type void. In other words, a proceedure, or function + of type void returns no output. What Pascal calls a function differs + in that it does return output. In LPC, the most trivial, correct + function is: + + ----- + void do_nothing() { } + ----- + + This function accepts no input, performs no instructions, and returns no + value. + + There are three parts to every properly written LPC function: + 1) The declaration + 2) The definition + 3) The call + + Like with variables, functions must be declared. This will allow the + driver to know 1) what type of data the function is returning as output, + and 2) how many input(s) and of what type those input(s) are. The + more common word for input is parameters. + A function declaration therefore consists of: + type name(parameter1, parameter2, ..., parameterN); + The declaration of a function called drink_water() which accepts a string as + input and an int as output would thus look like this: + + ----- + int drink_water(string str); + ----- + + where str is the name of the input as it will be used inside the function. + + The function definition is the code which describes what the function actually + does with the input sent to it. + The call is any place in other functions which invokes the execution of the + function in question. For two functions write_vals() and add(), you thus + might have the following bit of code: + + ----- + /* First, function declarations. They usually appear at the beginning + of object code. + */ + void write_vals(); + int add(int x, int y); + + /* Next, the definition of the function write_vals(). We assume that + this function is going to be called from outside the object + */ + void write_vals() { + int x; + + /*N Now we assign x the value of the output of add() through a call */ + x = add(2, 2); + write(x+"\n"); + } + + /* Finally, the definition of add() */ + int add(int x, int y) { + return (x + y); + } + ----- + + Remember, it does not matter which function definition appears first in the + code. This is because functions are not executed consecutively. Instead, + functions are executed as called. The only requirement is that the + declaration of a function appear before its definition and before the + definition of any function which makes a call to it. + + 4.3 Efuns + Perhaps you have heard people refer to efuns. They are externally defined + functions. Namely, they are defined by the mud driver. If you have + played around at all with coding in LPC, you have probably found some + expressions you were told to use like this_player(), write(), say(), + this_object(), etc. look a lot like functions. That is because they are + efuns. The value of efuns is that they are much faster than LPC functions, + since they already exist in the binary form the computer understands. + + In the function write_vals() above, two functions calls were made. The first was to + the functions add(), which you declared and defined. The second call, however, + was to a function called write(), and efun. The driver has already declared + and defined this function for you. You needs only to make calls to it. + + Efuns are created to hanldle common, every day function calls, to handle + input/output to the internet sockets, and other matters difficult to be + dealt with in LPC. They are written in C in the game driver and compiled + along with the driver before the mud comes up, making them much faster + in execution. But for your purposes, efun calls are just like calls + made to your functions. Still, it is important to know two things of any + efun: 1) what return type does it have, and 2) what parameters of what + types does it take. + + Information on efuns such as input parameters and return types is often + found in a directory called /doc/efun on your mud. I cannot + detail efuns here, because efuns vary from driver to driver. However, + you can often access this information using the commands "man" or "help" + depending on your mudlib. For instance, the command "man write" would + give you information on the write efun. But if all else fails, + "more /doc/efun/write" should work. + + By looking it up, you will find write is declared as follows: + + ----- + void write(string); + ----- + + This tells you an appropriate call to write expects no return value and + passes a single parameter of type string. + + 4.4 Defining your own functions + Although ordering your functions within the file does not matter, ordering + the code which defines a function is most important. Once a function + has been called, function code is executed in the order it appears + in the function definition. In write_vals() above, the instruction: + + ----- + x = add(2, 2); + ----- + + Must come before the write() efun call if you want to see the appropriate + value of x used in write(). + + With respect to values returned by function, this is done through the "return" + instruction followed by a value of the same data type as the function. In + add() above, the instruction is "return (x+y);", where the value of (x+y) + is the value returned to write_vals() and assigned to x. On a more + general level, "return" halts the execution of a function and returns + code execution to the function which called that function. In addition, + it returns to the calling function the value of any expression that follows. + To stop the execution of a function of type void out of order, use + "return"; without any value following. Once again, remember, the data + type of the value of any expression returned using "return" MUST be the + same as the data type of the function itself. + + 4.5 Chapter Summary + The files which define LPC objects are made of of functions. Functions, in + turn, are made up of three parts: + 1) The declaration + 2) The definition + 3) The call + Function declarations generally appear at the top of the file before any + defintions, although the requirement is that the declaration must appear + before the function definition and before the definition of any function + which calls it. + Function definitions may appear in the file in any order so long as they + come after their declaration. In addition, you may not define one function + inside another function. + Function calls appear inside the definition of other functions where you + want the code to begin execution of your function. They may also appear + within the definition of the function itself, but this is not recommended + for new coders, as it can easily lead to infinite loops. + + The function definition consists of the following in this order: + 1) function return type + 2) function name + 3) opening ( followed by a parameter list and a closing ) + 4) an opening { instructing the driver that execution begins here + 5) declarations of any variables to be used only in that function + 6) instructions, expressions, and calls to other functions as needed + 7) a closing } stating that the function code ends here and, if no + "return" instruction has been given at this point (type void functions + only), execution returns to the calling function as if a r"return" + instruction was given + + The trivial function would thus be: + + ----- + void do_nothing() {} + ----- + + since this function does not accept any input, perform any instructions, or + return any output. + + Any function which is not of type void MUST return a value of a data type + matching the function's data type. + + Each driver has a set of functions already defined for you called efuns + These you need neither need to declare nor define since it has already + been done for you. Furthermore, execution of these functions is faster + than the execution of your functions since efuns are in the driver. + In addition, each mudlib has special functions like efuns in that they + are already defined and declared for you, but different in that they + are defined in the mudlib and in LPC. They are called simul_efuns, or + simulated efuns. You can find out all about each of these as they are + listed in the /doc/efun directory on most muds. In addition many + muds have a command called "man" or a "help" command which allows you + simply to call up the info files on them. + + Note on style: + Some drivers may not require you to declare your functions, and some + may not require you to specify the return type of the function in its + definition. Regardless of this fact, you should never omit this information + for the following reasons: + 1) It is easier for other people (and you at later dates) to read your + code and understand what is meant. This is particularly useful + for debugging, where a large portion of errors (outside of misplaced + parentheses and brackets) involve problems with data types (Ever + gotten "Bad arg 1 to foo() line 32"?). + 2) It is simply considered good coding form. diff -c -r --new-file ds1.1/lib/doc/lpc/basic/chapter5 ds2.0r27/lib/doc/lpc/basic/chapter5 *** ds1.1/lib/doc/lpc/basic/chapter5 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/basic/chapter5 Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,161 ---- + LPC Basics + Written by Descartes of Borg + first edition: 23 april 1993 + second edition: 01 july 1993 + + CHAPTER 5: The Basics of Inheritance + + 5.1 Review + You should now understand the basic workings of functions. You should be + able to declare and call one. In addition, you should be able to recognize + function definitions, although, if this is your first experience with LPC, + it is unlikely that you will as yet be able to define your own functions. + There functions form the basic building blocks of LPC objects. Code + in them is executed when another function makes a call to them. In making + a call, input is passed from the calling function into the execution of + the called one. The called function then executes and returns a value + of a certain data type to the calling function. Functions which return + no value are of type void. + + After examining your workroom code, it might look something like this + (depending on the mudlib): + + ----- + inherit "/std/room"; + + void create() { + ::create(); + SetProperty("light", 2); + SetProperty("indoors", 1); + set("short", "Descartes' Workroom"); + set("long", "This is where Descartes works.\nIt is a cube.\n"); + SetExits( ({ "/domains/standard/square" }), ({ "square" }) ); + } + ----- + + If you understand the entire textbook to this point, you should recognize + of the code the following: + 1) create() is the definition of a function (hey! he did not declare it) + 2) It makes calls to SetProperty(), set(), and SetExits(), none + of which are declared or defined in the code. + 3) There is a line at the top that is no variable or function declaration + nor is it a function definition! + + This chapter will seek to answer the questions that should be in your head + at this point: + 1) Why is there no declaration of create()? + 2) Where are the functions SetProperty(), set(), and SetExits() declared + and defined? + 3) What the hell is that line at the top of the file? + + 5.2 Object oriented programming + Inheritance is one of the properties which define true object oriented + programming (OOP). It allows you to create generic code which can be used + in many different ways by many different programs. What a mudlib does is + create these generalized files (objects) which you use to make very specific + objects. + + If you had to write the code necessary for you to define the workroom above, + you would have to write about 1000 lines of code to get all the functionality + of the room above. Clearly that is a waste of disk space. In addition, + such code does not interact well with players and other rooms since every + creator is making up his or her own functions to perform the functionality + of a room. Thus, what you might use to write out the room's long description, + GetLong(), another wizard might be calling long(). This is the primary + reason mudlibs are not compatible, since they use different protocols for + object interaction. + + OOP overcomes these problems. In the above workroom, you inherit the + functions already defined in a file called "/std/room.c". It has all + the functions which are commonly needed by all rooms defined in it. When + you get to make a specific room, you are taking the general functionality + of that room file and making a unique room by adding your own function, + create(). + + 5.3 How inheritance works + As you might have guessed by now, the line: + + ----- + inherit "/std/room"; + ----- + + has you inherit the functionality of the room "/std/room.c". By inheriting + the functionality, it means that you can use the functions which have + been declared and defined in the file "/std/room.c" In the Nightmare Mudlib, + "/std/room.c" has, among other functions, SetProperty(), set(), and + SetExits() declared and defined. In your function create(), you are + making calls to those functions in order to set values you want your + room to start with. These values make your room different from others, yet + able to interact well with other objects in memory. + + In actual practice, each mudlib is different, and thus requires you to use + a different set of standard functions, often to do the same thing. It is + therefore beyond the scope of this textbook even to describe what + functions exist and what they do. If your mudlib is well documented, + however, then (probably in /doc/build) you will have tutorials on how + to use the inheritable files to create such objects. These tutorials + should tell you what functions exist, what input they take, the data + type of their output, and what they do. + + 5.4 Chapter summary + This is far from a complete explanation of the complex subject of inheritance. + The idea here is for you to be able to understand how to use inheritance in + creating your objects. A full discussion will follow in a later textbook. + Right now you should know the following: + 1) Each mudlib has a library of generic objects with their own general + functions used by creators through inheritance to make coding objects + easier and to make interaction between objects smoother. + 2) The functions in the inheritable files of a mudlib vary from mudlib + to mudlib. There should exist documentation on your mud on how to + use each inheritable file. If you are unaware what functions are + available, then there is simply no way for you to use them. Always + pay special attention to the data types of the input and the data + types of ay output. + 3) You inherit the functionality of another object through the line: + + ----- + inherit "filename"; + ----- + + where filename is the name of the file of the object to be inherited. + This line goes at the beginning of your code. + + Note: + You may see the syntax ::create() or ::init() or ::reset() in places. + You do not need fully to understand at this point the full nuances of this, + but you should have a clue as to what it is. The "::" operator is a way + to call a function specifically in an inherited object (called the scope + resolution operator). For instance, most muds' room.c has a function + called create(). When you inherit room.c and configure it, you are doing + what is called overriding the create() function in room.c. This means + that whenever ANYTHING calls create(), it will call *your* version and not + the one in room.c. However, there may be important stuff in the room.c + version of create(). The :: operator allows you to call the create() in + room.c instead of your create(). + An example: + + ----- + #1 + + inherit "/std/room"; + + void create() { create(); } + ----- + + ----- + #2 + + inherit "/std/room"; + + void create() { ::create(); } + ----- + + Example 1 is a horror. When loaded, the driver calls create(), and then + create() calls create(), which calls create(), which calls create()... + In other words, all create() does is keep calling itself until the driver + detects a too deep recursion and exits. + + Example 2 is basically just a waste of RAM, as it is no different from room.c + functionally. With it, the driver calls its create(), which in turn calls + ::create(), the create() in room.c. Otherwise it is functionally + exactly the same as room.c. diff -c -r --new-file ds1.1/lib/doc/lpc/basic/chapter6 ds2.0r27/lib/doc/lpc/basic/chapter6 *** ds1.1/lib/doc/lpc/basic/chapter6 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/basic/chapter6 Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,333 ---- + LPC Basics + Written by Descartes of Borg + first edition: 23 april 1993 + second edition: july 5 1993 + + CHAPTER 6: Variable Handling + + 6.1 Review + By now you should be able to code some simple objects using your muds standard + object library. Inheritance allows you to use functions defined in those + objects without having to go and define yourself. In addition, + you should know how to declare your own functions. This + chapter will teach you about the basic elements of LPC which will allow you to + define your own functions using the manipulation of variables. + + 6.2 Values and objects + Basically, what makes objects on the mud different are two things: + 1) Some have different functions + 2) All have different values + + Now, all player objects have the same functions. They are therefore + differentiated by the values they hold. For instance, the player + named "Forlock" is different from "Descartes" *at least* in that they + have different values for the variable true_name, those being + "descartes" and "forlock". + + Therefore, changes in the game involve changes in the values of the objects + in the game. Functions are used to name specific process for manipulating + values. For instance, the create() function is the function whose + process is specifically to initialize the values of an object. + Within a function, it is specifically things called instructions which are + responsible for the direct manipulation of variables. + + 6.3 Local and global variables + Like variables in most programming language, LPC variables may be declared + as variables "local" to a specific function, or "globally" available + to all functions. Local variables are declared inside the function which + will use them. No other function knows about their existence, since + the values are only stored in memory while that function is being executed. + A global variable is available to any function which comes after its + declaration in the object code. Since global variables take up RAM for + the entire existence of the object, you should use them only when + you need a value stored for the entire existence of the object. + Have a look at the following 2 bits of code: + + ----- + int x; + + int query_x() { return x; } + + void set_x(int y) { x = y; } + ----- + + ----- + void set_x(int y) { + int x; + + x = y; + write("x is set to x"+x+" and will now be forgotten.\n"); + } + ----- + + In the first example, x is declared outside of any functions, and therefore + will be available to any function declared after it. In that example, + x is a global variable. + In the second example, x is declared inside the function set_x(). It + only exists while the function set_x() is being executed. Afterwards, + it ceases to exist. In that example, x is a local variable. + + 6.4 Manipulating the values of variables + Instructions to the driver are used to manipulate the values of variables. + An example of an instruction would be: + + ----- + x = 5; + ----- + + The above instruction is self-explanatory. It assigns to the variable + x the value 5. However, there are some important concepts in involved + in that instruction which are involved in instructions in general. + The first involves the concept of an expression. An expression is + any series of symbols which have a value. In the above instruction, + the variable x is assigned the value of the expression 5. Constant + values are the simplest forms in which expressions can be put. A constant + is a value that never changes like the int 5 or the string "hello". + The last concept is the concept of an operator. In the above example, + the assignment operator = is used. + + There are however many more operators in LPC, and expressions can get + quite complex. If we go up one level of complexity, we get: + + ----- + y = 5; + x = y +2; + ----- + + The first instruction uses the assignment operator to assign the value + of the constant expression 5 to the variable y. The second one + uses the assignment operator to assign to x the value of the expression + (y+2) which uses the addition operator to come up with a value which + is the sum of the value of y and the value of the constant expression 2. + Sound like a lot of hot air? + + In another manner of speaking, operators can be used to form complex + expressions. In the above example, there are two expressions in the + one instruction x = y + 2;: + 1) the expression y+2 + 2) the expression x = y + 2 + As stated before, all expressions have a value. The expression + y+2 has the value of the sum of y and 2 (here, 7); + The expression x = y + 2 *also* has the value of 7. + So operators have to important tasks: + 1) They *may* act upon input like a function + 2) They evaluate as having a value themselves. + Now, not all operators do what 1 does. The = operators does act upon + the value of 7 on its right by assigning that value to x. The operator + + however does nothing. They both, however, have their own values. + + 6.5 Complex expressions + As you may have noticed above, the expression x = 5 *itself* has a value + of 5. In fact, since LPC operators themselves have value as expressions, + they cal allow you to write some really convoluted looking nonsense like: + i = ( (x=sizeof(tmp=users())) ? --x : sizeof(tmp=children("/std/monster"))-1) + which says basically: + assing to tmp the array returned by the efun users(), then assign to x + the value equal to the number of elements to that array. If the value + of the expression assigning the value to x is true (not 0), then assign + x by 1 and assign the value of x-1 to i. If x is false though, + then set tmp to the array returned by the efun children(), and then + assign to i the value of the number of members in the array tmp -1. + Would you ever use the above statement? I doubt it. However you might + see or use expressions similar to it, since the ability to consolidate + so much information into one single line helps to speed up the execution of + your code. A more often used version of this property of LPC operators + would be something like: + x = sizeof(tmp = users()); + while(i--) write((string)tmp[i]->GetKeyName()+"\n"); + instead of writing something like: + tmp = users(); + x = sizeof(tmp); + for(i=0; i<x; i++) write((string)tmp[i]->GetKeyName()+"\n"); + Things like for(), while(), arrays and such will be explained later. + But the first bit of code is more concise and it executed faster. + + NOTE: A detailed description of all basic LPC operators follows the chapter + summary. + + + 6.6 Chapter Summary + You now know how to declare variables and understand the difference between + declaring and using them globally or locally. Once you become familiar + with your driver's efuns, you can display those values in many different + ways. In addition, through the LPC operators, you know how to change + and evaluate the values contained in variables. This is useful of course + in that it allows you to do something like count how many apples have + been picked from a tree, so that once all apples have been picked, no + players can pick more. Unfortunately, you do not know how to have + code executed in anything other than a linera fashion. In other words, + hold off on that apple until the next chapter, cause you do not know + how to check if the apples picked is equal to the number of apples in the + tree. You also do not know about the special function init() where you + give new commands to players. But you are almost ready to code a nice, + fairly complex area. + + 6.7 LPC operators + This section contains a detailed listing of the simpler LPC operators, + including what they do to the values they use (if anything) and the value + that they have. + + The operators described here are: + = + - * / % += -= *= /= %= + -- ++ == != > < >= <= ! && || + -> ? : + + Those operators are all described in a rather dry manner below, but it is best + to at least look at each one, since some may not behave *exactly* as + you think. But it should make a rather good reference guide. + + = assignment operator: + example: x = 5; + value: the value of the variable on the *left* after its function is done + explanation: It takes the value of any expression on the *right* and + assigns it to the variable on the *left*. Note that you must use + a single variable on the left, as you cannot assign values to + constants or complex expressions. + + + addition operator: + example: x + 7 + value: The sum of the value on the left and the value on the right + exaplanation: It takes the value of the expression on the right and + adds it to the value of the expression on the left. For values + of type int, this means the numerical sum. For strings, + it means that the value on the right is stuck onto the value on + the left ("ab" is the value of "a"+"b"). This operator does not + modify any of the original values (i.e. the variable x from + above retains its old value). + + - subtraction operator: + example: x - 7 + value: the value of the expression on the left reduced by the right + explanation: Same characteristics as addition, except it subtracts. + With strings: "a" is the value of "ab" - "b" + + * multiplication operator: + example: x*7 + value and explanation: same as with adding and subtracting except + this one performs the math of multiplication + + / division operator: + example: x/7 + value and explanation: see above + + += additive assignment operator: + example: x += 5 + value: the same as x + 5 + exaplanation: It takes the value of the variable on the left + and the value of the expression on the right, adds them together + and assigns the sum to the variable on the left. + example: if x = 2... x += 5 assigns the value + 7 to the variable x. The whole expression + has the value of 7. + + -= subtraction assignment operator + example: x-=7 + value: the value of the left value reduced by the right value + examplanation: The same as += except for subtraction. + + *= multiplicative assignment operator + example: x *= 7 + value: the value of the left value multiplied by the right + explanation: Similar to -= and += except for addition. + + /= division assignment operator + example: x /= 7 + value: the value of the variable on the left divided by the right value + explanation: similar to above, except with division + + ++ post/pre-increment operators + examples: i++ or ++i + values: + i++ has the value of i + ++i has the value of i+1 + explanation: ++ changes the value of i by increasing it by 1. + However, the value of the expression depends on where you + place the ++. ++i is the pre-increment operator. This means + that it performs the increment *before* giving a value. + i++ is the post-ncrement operator. It evalutes before incrementing + i. What is the point? Well, it does not much matter to you at + this point, but you should recognize what it means. + + -- post/pre-decrement operators + examples: i-- or --i + values: + i-- the value of i + --i the value of i reduced by 1 + explanation: like ++ except for subtraction + + == equality operator + example: x == 5 + value: true or false (not 0 or 0) + explanation: it does nothing to either value, but + it returns true if the 2 values are the same. + It returns false if they are not equal. + + != inequality operator + example: x != 5 + value: true or false + explanation returns true if the left expression is not equal to the right + expression. It returns fals if they are equal + + > greater than operator + example: x > 5 + value: true or false + explanation: true only if x has a value greater than 5 + false if the value is equal or less + + < less than operator + >= greater than or equal to operator + <= less than or equal to operator + examples: x < y x >= y x <= y + values: true or false + explanation: similar as to > except + < true if left is less than right + >= true if left is greater than *or equal to* right + <= true if the left is less than *or equal to* the right + + && logical and operator + || logical or operator + examples: x && y x || y + values: true or false + explanation: If the right value and left value are non-zero, && is true. + If either are false, then && is false. + For ||, only one of the values must be true for it to evaluate + as true. It is only false if both values indeed + are false + + ! negation operator + example: !x + value: true or false + explanation: If x is true, then !x is false + If x is false, !x is true. + + A pair of more complicated ones that are here just for the sake of being + here. Do not worry if they utterly confuse you. + + -> the call other operator + example: this_player()->GetKeyName() + value: The value returned by the function being called + explanation: It calls the function which is on the right in the object + on the left side of the operator. The left expression *must* be + an object, and the right expression *must* be the name of a function. + If not such function exists in the object, it will return 0 (or + more correctly, undefined). + + ? : conditional operator + example: x ? y : z + values: in the above example, if x is try, the value is y + if x is false, the value of the expression is z + explanation: If the leftmost value is true, it will give the expression as + a whole the value of the middle expression. Else, it will give the + expression as a whole the value of the rightmost expression. + + A note on equality: A very nasty error people make that is VERY difficult + to debug is the error of placing = where you mean ==. Since + operators return values, they both make sense when being evaluated. + In other words, no error occurs. But they have very different values. For example: + if(x == 5) if(x = 5) + The value of x == 5 is true if the value of x is 5, false othewise. + The value of x = 5 is 5 (and therefore always true). + The if statement is looking for the expression in () to be either true or false, + so if you had = and meant ==, you would end up with an expression that is + always true. And you would pull your hair out trying to figure out + why things were not happening like they should :) diff -c -r --new-file ds1.1/lib/doc/lpc/basic/chapter7 ds2.0r27/lib/doc/lpc/basic/chapter7 *** ds1.1/lib/doc/lpc/basic/chapter7 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/basic/chapter7 Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,432 ---- + LPC Basics + Written by Descartes of Borg + first edition: 23 april 1993 + second edition: 10 july 1993 + + CHAPTER 7: Flow Control + + 7.1 Review of variables + Variables may be manipulated by assigning or changing values with the + expressions =, +=, -=, ++, --. Those expressions may be combined with + the expressions -, +, *, /, %. However, so far, you have only been + shown how to use a function to do these in a linear way. For example: + + int hello(int x) { + x--; + write("Hello, x is "+x+".\n"); + return x; + } + + is a function you should know how to write and understand. But what + if you wanted to write the value of x only if x = 1? Or what if + you wanted it to keep writing x over and over until x = 1 before + returning? LPC uses flow control in exactly the same way as C and C++. + + 7.2 The LPC flow control statements + LPC uses the following expressions: + + if(expression) instruction; + + if(expression) instruction; + else instruction; + + if(expression) instruction; + else if(expression) instruction; + else instruction; + + while(expression) instruction; + + do { instruction; } while(expression); + + switch(expression) { + case (expression): instruction; break; + default: instruction; + } + + Before we discuss these, first something on what is meant by expression and + instruction. An expression is anything with a value like a variable, + a comparison (like x>5, where if x is 6 or more, the value is 1, else the + value is 0), or an assignment(like x += 2). An instruction can be any + single line of lpc code like a function call, a value assignment or + modification, etc. + + You should know also the operators &&, ||, ==, !=, and !. These are the + logical operators. They return a nonzero value when true, and 0 when false. + Make note of the values of the following expressions: + + (1 && 1) value: 1 (1 and 1) + (1 && 0) value: 0 (1 and 0) + (1 || 0) value: 1 (1 or 0) + (1 == 1) value: 1 (1 is equal to 1) + (1 != 1) value: 0 (1 is not equal to 1) + (!1) value: 0 (not 1) + (!0) value: 1 (not 0) + + In expressions using &&, if the value of the first item being compared + is 0, the second is never tested even. When using ||, if the first is + true (1), then the second is not tested. + + 7.3 if() + The first expression to look at that alters flow control is if(). Take + a look at the following example: + + 1 void reset() { + 2 int x; + 3 + 4 ::reset(); + 5 x = random(10); + 6 if(x > 50) SetSearch_func("floorboards", "search_floor"); + 7 } + + The line numbers are for reference only. + In line 2, of course we declare a variable of type int called x. Line 3 + is aethetic whitespace to clearly show where the declarations end and the + function code begins. The variable x is only available to the function + reset(). + Line 4 makes a call to the room.c version of reset(). + Line 5 uses the driver efun random() to return a random number between + 0 and the parameter minus 1. So here we are looking for a number between + 0 and 99. + In line 6, we test the value of the expression (x>50) to see if it is true + or false. If it is true, then it makes a call to the room.c function + SetSearch_func(). If it is false, the call to SetSearch_func() is never + executed. + In line 7, the function returns driver control to the calling function + (the driver itself in this case) without returning any value. + + If you had wanted to execute multiple instructions instead of just the one, + you would have done it in the following manner: + + if(x>50) { + SetSearch_func("floorboards", "search_floor"); + if(!present("beggar", this_object())) make_beggar(); + } + + Notice the {} encapsulate the instructions to be executed if the test + expression is true. In the example, again we call the room.c function + which sets a function (search_floor()) that you will later define yourself + to be called when the player types "search floorboards" (NOTE: This is + highly mudlib dependent. Nightmare mudlibs have this function call. + Others may have something similar, while others may not have this feature + under any name). Next, there is another if() expression that tests the + truth of the expression (!present("beggar",this_object())). The ! in the + test expression changes the truth of the expression which follows it. In + this case, it changes the truth of the efun present(), which will return + the object that is a beggar if it is in the room (this_object()), or it + will return 0 if there is no beggar in the room. So if there is a beggar + still living in the room, (present("beggar", this_object())) will have + a value equal to the beggar object (data type object), otherwise it will + be 0. The ! will change a 0 to a 1, or any nonzero value (like the + beggar object) to a 0. Therefore, the expression + (!present("beggar", this_object())) is true if there is no beggar in the + room, and false if there is. So, if there is no beggar in the room, + then it calls the function you define in your room code that makes a + new beggar and puts it in the room. (If there is a beggar in the room, + we do not want to add yet another one :)) + + Of course, if()'s often comes with ands or buts :). In LPC, the formal + reading of the if() statement is: + + if(expression) { set of intructions } + else if(expression) { set of instructions } + else { set of instructions } + + This means: + + If expression is true, then do these instructions. + Otherise, if this second expression is true, do this second set. + And if none of those were true, then do this last set. + + You can have if() alone: + + if(x>5) write("Foo,\n"); + + with an else if(): + + if(x > 5) write("X is greater than 5.\n"); + else if(x >2) write("X is less than 6, but greater than 2.\n"); + + with an else: + + if(x>5) write("X is greater than 5.\n"); + else write("X is less than 6.\n"); + + or the whole lot of them as listed above. You can have any number of + else if()'s in the expression, but you must have one and only one + if() and at most one else. Of course, as with the beggar example, + you may nest if() statements inside if() instructions. (For example, + if(x>5) { + if(x==7) write("Lucky number!\n"); + else write("Roll again.\n"); + } + else write("You lose.\n"); + + 7.4 The statements: while() and do {} while() + Prototype: + while(expression) { set of instructions } + do { set of instructions } while(expression); + + These allow you to create a set of instructions which continue to + execute so long as some expression is true. Suppose you wanted to + set a variable equal to a player's level and keep subtracting random + amounts of either money or hp from a player until that variable equals + 0 (so that player's of higher levels would lose more). You might do it + this way: + + 1 int x; + 2 + 3 x = (int)this_player()->query_level(); /* this has yet to be explained */ + 4 while(x > 0) { + 5 if(random(2)) this_player()->add_money("silver", -random(50)); + 6 else this_player()->add_hp(-(random(10)); + 7 x--; + 8 } + + The expression this_player()->query_level() calIn line 4, we start a loop that executes so long as x is greater than 0. + Another way we could have done this line would be: + while(x) { + The problem with that would be if we later made a change to the funtion + y anywhere between 0 and 49 coins. + In line 6, if instead it returns 0, we call the add_hp() function in the + player which reduces the player's hit points anywhere between 0 and 9 hp. + In line 7, we reduce x by 1. + At line 8, the execution comes to the end of the while() instructions and + goes back up to line 4 to see if x is still greater than 0. This + loop will keep executing until x is finally less than 1. + + You might, however, want to test an expression *after* you execute some + instructions. For instance, in the above, if you wanted to execute + the instructions at least once for everyone, even if their level is + below the test level: + + int x; + + x = (int)this_player()->query_level(); + do { + if(random(2)) this_player()->add_money("silver", -random(50)); + else this_player()->add_hp(-random(10)); + x--; + } while(x > 0); + + This is a rather bizarre example, being as few muds have level 0 players. + And even still, you could have done it using the original loop with + a different test. Nevertheless, it is intended to show how a do{} while() + works. As you see, instead of initiating the test at the beginning of the + loop (which would immediately exclude some values of x), it tests after + the loop has been executed. This assures that the instructions of the loop + get executed at least one time, no matter what x is. + + 7.5 for() loops + Prototype: + for(initialize values ; test expression ; instruction) { instructions } + + initialize values: + This allows you to set starting values of variables which will be used + in the loop. This part is optional. + + test expression: + Same as the expression in if() and while(). The loop is executed + as long as this expression (or expressions) is true. You must have a + test expression. + + instruction: + An expression (or expressions) which is to be executed at the end of each + loop. This is optional. + + Note: + for(;expression;) {} + IS EXACTLY THE SAME AS + while(expression) {} + + Example: + + 1 int x; + 2 + 3 for(x= (int)this_player()->query_level(); x>0; x--) { + 4 if(random(2)) this_player()->add_money("silver", -random(50)); + 5 else this_player()->add_hp(-random(10)); + 6 } + + This for() loop behaves EXACTLY like the while() example. + Additionally, if you wanted to initialize 2 variables: + + for(x=0, y=random(20); x<y; x++) { write(x+"\n"); } + + Here, we initialize 2 variables, x and y, and we separate them by a + comma. You can do the same with any of the 3 parts of the for() + expression. + + 7.6 The statement: switch() + Prototype: + switch(expression) { + case constant: instructions + case constant: instructions + ... + case constant: instructions + default: instructions + } + + This is functionally much like if() expressions, and much nicer to the + CPU, however most rarely used because it looks so damn complicated. + But it is not. + + First off, the expression is not a test. The cases are tests. A English + sounding way to read: + + 1 int x; + 2 + 3 x = random(5); + 4 switch(x) { + 5 case 1: write("X is 1.\n"); + 6 case 2: x++; + 7 default: x--; + 8 } + 9 write(x+"\n"); + + is: + + set variable x to a random number between 0 and 4. + In case 1 of variable x write its value add 1 to it and subtract 1. + In case 2 of variable x, add 1 to its value and then subtract 1. + In other cases subtract 1. + Write the value of x. + + switch(x) basically tells the driver that the variable x is the value + we are trying to match to a case. + Once the driver finds a case which matches, that case *and all following + cases* will be acted upon. You may break out of the switch statement + as well as any other flow control statement with a break instruction in + order only to execute a single case. But that will be explained later. + The default statement is one that will be executed for any value of + x so long as the switch() flow has not been broken. You may use any + data type in a switch statement: + + string name; + + name = (string)this_player()->GetKeyName(); + switch(name) { + case "descartes": write("You borg.\n"); + case "flamme": + case "forlock": + case "shadowwolf": write("You are a Nightmare head arch.\n"); + default: write("You exist.\n"); + } + + For me, I would see: + You borg. + You are a Nightmare head arch. + You exist. + + Flamme, Forlock, or Shadowwolf would see: + You are a Nightmare head arch. + You exist. + + Everyone else would see: + You exist. + + 7.7 Altering the flow of functions and flow control statements + The following instructions: + return continue break + + alter the natural flow of things as described above. + First of all, + return + no matter where it occurs in a function, will cease the execution of that + function and return control to the function which called the one the + return statement is in. If the function is NOT of type void, then a + value must follow the return statement, and that value must be of a + type matching the function. An absolute value function would look + like this: + + int absolute_value(int x) { + if(x>-1) return x; + else return -x; + } + + In the second line, the function ceases execution and returns to the calling + function because the desired value has been found if x is a positive + number. + + continue is most often used in for() and while statements. It serves + to stop the execution of the current loop and send the execution back + to the beginning of the loop. For instance, say you wanted to avoid + division by 0: + + x= 4; + while( x > -5) { + x-- + if(!x) continue; + write((100/x)+"\n"); + } + write("Done.\n") + + You would see the following output: + 33 + 50 + 100 + -100 + -50 + -33 + -25 + Done. + To avoid an error, it checks in each loop to make sure x is not 0. + If x is zero, then it starts back with the test expression without + finishing its current loop. + + In a for() expression + for(x=3; x>-5; x--) { + if(!x) continue; + write((100/x)+"\n"); + } + write("Done.\n"); + It works much the same way. Note this gives exactly the same output + as before. At x=1, it tests to see if x is zero, it is not, so it + writes 100/x, then goes back to the top, subtracts one from x, checks to + see if it is zero again, and it is zero, so it goes back to the top + and subtracts 1 again. + + break + This one ceases the function of a flow control statement. No matter + where you are in the statement, the control of the program will go + to the end of the loop. So, if in the above examples, we had + used break instead of continue, the output would have looked like this: + + 33 + 50 + 100 + Done. + + continue is most often used with the for() and while() statements. + break however is mostly used with switch() + + switch(name) { + case "descartes": write("You are borg.\n"); break; + case "flamme": write("You are flamme.\n"); break; + case "forlock": write("You are forlock.\n"); break; + case "shadowwolf": write("You are shadowwolf.\n"); break; + default: write("You will be assimilated.\n"); + } + + This functions just like: + + if(name == "descartes") write("You are borg.\n"); + else if(name == "flamme") write("You are flamme.\n"); + else if(name == "forlock") write("You are forlock.\n"); + else if(name == "shadowwolf") write("You are shadowwolf.\n"); + else write("You will be assimilated.\n"); + + except the switch statement is much better on the CPU. + If any of these are placed in nested statements, then they alter the + flow of the most immediate statement. + + 7.8 Chapter summary + This chapter covered one hell of a lot, but it was stuff that needed to + be seen all at once. You should now completely understand if() for() + while() do{} while() and switch(), as well as how to alter their flow + using return, continue, and break. Effeciency says if it can be done in + a natural way using switch() instead of a lot of if() else if()'s, then + by all means do it. You were also introduced to the idea of calling + functions in other objects. That however, is a topic to be detailed later. + You now should be completely at ease writing simple rooms (if you have + read your mudlib's room building document), simple monsters, and + other sorts of simple objects. diff -c -r --new-file ds1.1/lib/doc/lpc/basic/chapter8 ds2.0r27/lib/doc/lpc/basic/chapter8 *** ds1.1/lib/doc/lpc/basic/chapter8 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/basic/chapter8 Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,195 ---- + LPC Basics + Written by Descartes of Borg + first edition: 23 april 1993 + second edition: 12 july 1993 + + CHAPTER 8: The data type "object" + + 8.1 Review + You should now be able to do anything so long as you stick to calling + functions within your own object. You should also know, that at the + bare minimum you can get the create() (or reset()) function in your object + called to start just by loading it into memory, and that your reset() + function will be called every now and then so that you may write the + code necessary to refresh your room. Note that neither of these + functions MUST be in your object. The driver checks to see if the + function exists in your object first. If it does not, then it does not + bother. You are also acquainted with the data types void, int, and string. + + 7.2 Objects as data types + In this chapter you will be acquainted with a more complex data type, + object. An object variable points to a real object loaded into the + driver's memory. You declare it in the same manner as other data types: + object ob; + It differs in that you cannot use +, -, +=, -=, *, or / (what would it + mean to divide a monster by another monster?). And since efuns like + say() and write() only want strings or ints, you cannot write() or + say() them (again, what would it mean to say a monster?). + But you can use them with some other of the most important efuns on any + LPMud. + + 8.3 The efun: this_object() + This is an efun which returns an object in which the function being executed + exists. In other words, in a file, this_object() refers to the object your + file is in whether the file gets cloned itself or inherted by another file. + It is often useful when you are writing a file which is getting inherited + by another file. Say you are writing your own living.c which gets + inherited by user.c and monster.c, but never used alone. You want to log + the function set_level() it is a player's level being set (but you do not + care if it is a monster. + You might do this: + + void set_level(int x) { + if(this_object()->is_player()) log_file("levels", "foo\n"); + level = x; + } + + Since is_player() is not defined in living.c or anything it inherits, + just saying if(is_player()) will result in an error since the driver + does not find that function in your file or anything it inherits. + this_object() allows you to access functions which may or may not be + present in any final products because your file is inherited by others + without resulting in an error. + + 8.4 Calling functions in other objects + This of course introduces us to the most important characteristic of + the object data type. It allows us to access functions in other objects. + In previous examples you have been able to find out about a player's level, + reduce the money they have, and how much hp they have. + Calls to functions in other objects may be done in two ways: + + object->function(parameters) + call_other(object, "function", parameters); + + example: + this_player()->add_money("silver", -5); + call_other(this_player(), "add_money", "silver", -5); + + In some (very loose sense), the game is just a chain reaction of function + calls initiated by player commands. When a player initiates a chain of + function calls, that player is the object which is returned by + the efun this_player(). So, since this_player() can change depending + on who initiated the sequence of events, you want to be very careful + as to where you place calls to functions in this_player(). The most common + place you do this is through the last important lfun (we have mentioned + create() and reset()) init(). + + 8.5 The lfun: init() + Any time a living thing encounters an object (enters a new room, or enters + the same room as a certain other object), init() is called in all of + the objects the living being newly encounters. It is at this point + that you can add commands the player can issue in order to act. + Here is a sample init() function in a flower. + + void init() { + ::init(); + add_action("smell_flower", "smell"); + } + + Ito smell_flower(). So you should have smell_flower() look like this: + + 1 int smell_flower(string str); /* action functions are type int */ + 2 + 3 int smell_flower(string str) { + 4 if(str != "flower") return 0; /* it is not the flower being smelled */ + 5 write("You sniff the flower.\n"); + 6 say((string)this_player()->GetName()+" smells the flower.\n"); + 7 this_player()->add_hp(random(5)); + 8 return 1; + 9 } + + In line 1, we have our function declared. + In line 3, smell_flower() begins. str becomes whatever comes after the + players command (not including the first white space). + In line 4, it checks to see if the player had typed "smell flower". If + the player had typed "smell cheese", then str would be "cheese". If + it is not in fact "flower" which is being smelled, then 0 is returned, + letting the driver know that this was not the function which should + have been called. If in fact the player had a piece of cheese as well + which had a smell command to it, the driver would then call the function + for smelling in that object. The driver will keep calling all functions + tied to smell commands until one of them returns 1. If they all return + 0, then the player sees "What?" + In line 5, the efun write() is called. write() prints the string which + is passed to it to this_player(). So whoever typed the command here + sees "You sniff the flower." + In line 6, the efun say() is called. say() prints the string which is + doing the sniffing, we have to call the GetName() function + in this_player(). That way if the player is invis, it will say + "Someone" (or something like that), and it will also be properly + capitalized. + In line 7, we call the add_hp() function in the this_player() object, + since we want to do a little healing for the sniff (Note: do not + code this object on your mud, whoever balances your mud will shoot you). + In line 8, we return control of the game to the driver, returning 1 to + let it know that this was in fact the right function to call. + + 8.6 Adding objects to your rooms + And now, using the data type object, you can add monsters to your rooms: + + void create() { + ::create(); + SetProperty("light", 3); + set("short", "Krasna Square"); + set("long", "Welcome to the Central Square of the town of Praxis.\n"); + SetExits( ({ "/domains/standard/hall" }), ({ "east" }) ); + } + + void reset() { + object ob; + + ::reset(); + if(present("guard")) return; /* Do not want to add a guard if */ + ob = new("/std/monster"); /* one is already here */ + ob->SetKeyName("guard"); + ob->set("id", ({ "guard", "town guard" }) ); + ob->set("short", "Town guard"); + ob->set("long", "He guards Praxis from nothingness.\n"); + ob->SetGender("male"); + ob->set_race("human"); + ob->set_level(10); + ob->set_alignment(200); + ob->set_humanoid(); + ob->set_hp(150); + ob->set_wielding_limbs( ({ "right hand", "left hand" }) ); + ob->eventMove(this_object()); + } + + Now, this will be wildly different on most muds. Some, as noted before, + in that object so you have a uniquely configured monster object. The + last act in native muds is to call eventMove() in the monster object to move + it to this room (this_object()). In compat muds, you call the efun + move_object() which takes two parameters, the object to be moved, and the + object into which it is being moved. + + 8.7 Chapter summary + At this point, you now have enough knowledge to code some really nice + stuff. Of course, as I have been stressing all along, you really need + to read the documents on building for your mud, as they detail which + functions exist in which types of objects for you to call. No matter + what your knowledge of the mudlib is, you have enough know-how to + give a player extra things to do like sniffing flowers or glue or whatever. + At this point you should get busy coding stuff. But the moment things + even look to become tedious, that means it is time for you to move to + the next level and do more. Right now code yourself a small area. + Make extensive use of the special functions coded in your mud's + room.c (search the docs for obscure ones no one else seems to use). + Add lots o' neat actions. Create weapons which have magic powers which + gradually fade away. All of this you should be able to do now. Once + this becomes routine for you, it will be time to move on to intermediate + stuff. Note that few people actually get to the intermediate stuff. + If you have played at all, you notice there are few areas on the mud + which do what I just told you you should be able to do. It is not + because it is hard, but because there is a lot of arrogance out there + on the part of people who have gotten beyond this point, and very little + communicating of that knowledge. The trick is to push yourself and + think of something you want to do that is impossible. If you ask someone + in the know how to do X, and they say that is impossible, find out + youself how to code it by experimenting. + + George Reese + Descartes of Borg + 12 july 1993 + borg@hebron.connected.com + Descartes@Nightmare (intermud) + Descartes@Igor (not intermud) diff -c -r --new-file ds1.1/lib/doc/lpc/concepts/MudOSdriver ds2.0r27/lib/doc/lpc/concepts/MudOSdriver *** ds1.1/lib/doc/lpc/concepts/MudOSdriver Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/concepts/MudOSdriver Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,32 ---- + What is the MudOS driver? + + The MudOS driver is the program (written in C) which + provides the lowlevel support that makes a mud possible. The driver + does many things including: + + <DL> + * accepts connections from remote machines (via a communications port) and + attaches those connections to the login object (/adm/login.c on TMI). + + * provides a set of external functions (efuns) that may be called from + within LPC objects. + + * compiles files into a compact internal tokenized form via the new(filename) + (or clone_object(filename)) efun. + + * interprets (executes) objects represented in the tokenized form. The + two main ways in which code gets executed are as follows: + + <UL> + <LI> a) the driver calls functions in objects based on input received from + users (via the communications port). The specific functions that get + called depend on what associations the objects of the mud have specified + between player-typed commands and functions (via the + add_action(function_name,command_name) efun). The driver also + calls functions in LPC objects from within certain efuns (such as "init", + "create", "clean_up", etc.). + <LI> b) objects can cause the driver to execute code in other objects via + the call_other(object,function_name,args,...) efun. An alternate + form of the call_other efun is object->function_name(args,...). + </UL> + </DT> diff -c -r --new-file ds1.1/lib/doc/lpc/concepts/defines ds2.0r27/lib/doc/lpc/concepts/defines *** ds1.1/lib/doc/lpc/concepts/defines Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/concepts/defines Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,26 ---- + Predefined preprocessor #defines + + Note: additional predefines may be added from the command line using the -D + flag. Also, anything defined in either options.h will be available surrounded + by __; e.g if FOO is defined in options.h, the __FOO__ will be defined in all + objects. + + The following identifiers may be defined: + + <DL> + * MUDOS: always defined + * "2.7.2": a string representing the version of MudOS being run + * __PORT__: archaic; the port number of the first (previously, the only) external port + * __ARCH__: the name of the architecture of the machine + * __COMPILER__: the compiler MudOS was compiled with + * __OPTIMIZATION__: the optimization used + * MUD_NAME: the MUD name from the config file + * HAS_ED: defined if the ed() efun is available + * HAS_PRINTF: defined if the printf() efun is available + * HAS_RUSAGE: defined if the rusage() efun is available + * HAS_DEBUG_LEVEL: defined if the debug_level() efun is available + * "doc/concepts/defines.c": the file being compiled + * __DIR__: the directory the file is in (with the trailing /) + </DL> + + Tim Hollebeek Beek@ZorkMUD, Lima Bean, IdeaExchange, and elsewhere diff -c -r --new-file ds1.1/lib/doc/lpc/concepts/lpc ds2.0r27/lib/doc/lpc/concepts/lpc *** ds1.1/lib/doc/lpc/concepts/lpc Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/concepts/lpc Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,61 ---- + What is LPC? + + LPC is the language in which MudOS (and LPmud) objects are written. + LPC stands for Lars Pensj| C. As one might surmise from the name, + LPC is based on the syntax of C. LPC provides the C while loop, for loop, + if statement, switch statement, a variant of sscanf, and integer data type, + (LPC also provides other data types not in C such as the object and the + mapping). LPC uses C's syntax for defining and calling functions and for + declaring variables. Note that LPC's version of the string datatype is + much different from that provided by C. See the LPC tutorial on syntax + and language constructs for more information. + + Here are some differences between LPC and C: + + There is no need for a function named "main" in LPC objects (although there + is one called "create"). + + The efuns (or system calls) provided by the gamedriver are different than + those typically found in the C library (libc.a). + + There is no malloc(). However, there is an allocate(int value) efun that + lets space be allocated for arrays. Note that the argument to 'allocate' + is not in units of bytes, but rather in units of elements. + + Memory is never explicitly deallocated. The gamedriver keeps track of + how many times a given piece of data has been referenced. When the + reference count goes to zero (when no object has a copy of that variable), + then the space used by the variable is reclaimed (garbage collected). + + The string data type in LPC is closer to that provided by BASIC than that + provided by C. Strings are not declared as arrays of characters but rather + as a basic intrinsic type. Strings may be concatenated using the '+' operator. + + For example, the LPC statements: + + <pre> + string ack; + + ack = foo + bar; + </pre> + + are equivalent to the C statements: + + <pre> + char *ack; + + ack = (char *)malloc(strlen(foo) + 1); + strcpy(ack,foo); + ack = (char *)realloc(strlen(ack) + strlen(bar) + 1); + strcat(ack,bar); + </pre> + + LPC is an interpreted language (however it is compiled into an internal + compact tokenized form before being interpreted). + + sscanf does not work in the same way as in C. arguments to sscanf need not + be pointers (since LPC does not have the explicit pointer data type). Also, + sscanf(arg,"%s %s",str1,str2) does not operate as the C programmer would + expect. In C, the first word of arg would be copied into str1 and the + second word of arg into str2. In LPC, the first word is copied into str1 + and the _remainder_ of arg is copied into str2. diff -c -r --new-file ds1.1/lib/doc/lpc/concepts/message_doc ds2.0r27/lib/doc/lpc/concepts/message_doc *** ds1.1/lib/doc/lpc/concepts/message_doc Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/concepts/message_doc Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,199 ---- + message + + message is a new efun in MudOS designed to make communication efuns more + generic and to provide a standard way of talking to clients intelligently. + + See the message() efun doc for details on how the efun works. + + Probably the most important element of this function is the "class". + If used properly, you could use this field to implement a very simple + version of earmuffs, or to communicate intelligently with a custom + client. The class defines the type of message that the string + contains. Initial simple implementations would have the classes + "shout", "say", "write", "tell_object" (which would be generated by + simul_efuns of the same name that replace the more traditional efuns). + + Given this, let's say that you wanted to implment a quick and easy + earmuff ability. (the ability to mask shouts) In your user (player) + object, you would have the function receive_message. Here's the + simplest implementation possible: + + <pre> + void receive_message (string msg, mixed class) + { + receive(msg); + } + </pre> + + This simply takes all messages generated by the message efun and + displays them to the user. However, you could imagine a simple + earmuffs implementation on top of this: + + <pre> + string *muffle = ({}); + + int muffle_class (string arg) + { + muffle += ({arg}); + } + + void receive_message (string msg, string class) + { + if (member_array(class,string) == -1) + receive(msg); + } + </pre> + + Now you can see, that if a particular class is muffled (say, "shout" + for example), the text never gets displayed, but in other cases it + does. + + However, not all uses of the shout() efun are really shouts, in the + traditional mud sense. For example, let's say that the admin of the + mud wants to send a message to all users telling them that the system + is going to be shut down in 5 minutes. To do this, they might use + echo, which in turn uses the shout() efun. So all users who had + "shout" muffled would miss this important message. This means that a + broader number of classes is really needed to make message() truly + useful. For the example given, let's say we make a new "broadcast" + class. This message class would be used for important announcements + that everyone should hear. Perhaps a restriction could even be made + so that muffle prohibited blocking this class. + + Let's look at another example. What if you're tired of all of the + millions of emotes (soul commands) that clutter your screen? Wouldn't + it be nice to just muffle those? Well, obviously a new "emote" class + is needed that all soul functions use. Now you might be thinking to + yourself "hey... I don't want to have to use this really complex + message() efun every time I write a soul command. write() and say() + are very simple, and I like using those." Well, I couldn't agree with + you more. To combat that problem, I make a simul_efun for each type + of commonly used message class. Like emote for example. I made a new + simul_efun called emote() that in fact made writing soul commands + easier, and used message() with the "emote" class. I won't show you + the code for the emote simul_efun, but here's the basic idea: + + <pre> + varargs int emote (object emoter, string self_message, string + other_message, mixed emotee, string target_message, string modifier); + + emoter - the object doing the emoting + self_message - the message displayed to the emoter + other_message - the message displayed to the whole room + emotee - the target of the emote (i.e. kick huthar) + target_message - the message displayed to the emotee + string modifier - any extra modifier to tack on to the end of the + emote string. (i.e. adverbs: smiles happily, cheerfully, etc.) - only + really complex soul commands need this (if they want to be able to + control multiple modifiers to a single soul command) + </pre> + + At this point, some might be thinking, "ok... so you can do very + powerful selective muffling, big deal. this seems like a lot of work + for nothing." Good point. Muffling was just a simple neat thing you + could do with message now. Most of the real advantages from message + will come a bit down the line when someone gets around to writing a + smart client program. Here's how that will work. + + Basically the idea is to separate all of the messages sent to a user + by the content. So you have a "combat" class, and a "stat" class, and + a "room_description" class, and a "help" class as some examples. + Before I get started, let's write a new version of receive_message(). + + <pre> + int has_smart_client; + + void receive_message (string msg, string class) + { + if (member_array(class,muffle) == -1) { + if (has_smart_client) + receive (class + " : " + msg); + else + receive (msg); + } + } + </pre> + + Ok. Let's look at what this does. If the user object has defined + has_smart_client to be > 0, then it prepends all messages with the + class name as well. So if you were to write a smart client that + parsed messages like that, you could make it redirect room + descriptions into one window, conversation into another, combat into + yet another area, etc. You could make a status line that always kept + your current room name (since it got passed as class "room_name" when + you enetered the room). You could make the heart_beat, pass a class + "status" message which gives a constant readout of your hit points in + your status line. All of this would be transparent to the end user. + It would just work. + + In addition, you could do a simply graphical client using the same + technique. The BSX graphical mud / client could easily be implemented + on top of MudOS using message(). Or you could pass around small + bitmaps rather than the polygon-based line drawings of BSX. The + possibilities are pretty wide open. + + There is at least one major flaw with this argument so far. Since + everyone has to implement this message protocol themselves, and since + nobody has written a smart client to take advantage of the protocol, + then when a client comes out, what's to guarantee that your mudlib + will even work with it? Well, that's actually most of the point to + this document. I'd like to outline a simple protocol that I hope + everyone will adopt, so that when a client finally comes out, it will + work with all mudlibs that adhere to this protocol. + + (Note: It's now several years later, and AFAIK noone uses this protocol. + AMCP also exists and is supported by some mudlibs, but the only client is + very minimal. -Beek) + + The protocol: + + all messages sent to the smart client are in the form + + "class:msg_length:msg" + + msg_len is the length of the msg string. This is put in so that the + client can always know when it has received the entire message, and + when one starts and ends. + + The following list of classes should be used and a client should be + able to parse and use any messages using these classes. + + <pre> + say use of the "say" command or its equivalent + shout use of the "shout" command or its equivalent + tell use of the "tell" command or its equivalent + emote a soul command or emote + broadcast a broadcast message to everyone on the mud + combat generic combat messages + combat_self combat messages generated by the user's own attack + combat_other combat messages generated by others + combat_* all other specific combat messages + room_description a long description of a room or location + room_name a short name for a room or location + inventory what you're carrying + item_description a long description of the item + status generic status messages + status_hp current hit points + status_sp current spell points + status_sobriety current state of drunkeness + status_* all other specific status messages + score generic score messages + score_exp experience points + score_money the amount of coins or other money + developer a broadcast message to all wizards/developers + class_fighter a message to all fighters + class_mage a message to all mages + class_thief a message to all thieves + class_priest a message to all priests + class_* a message to the class specified + race_human a message to all humans + race_elf a message to all elves + race_dwarf a message to all dwarves + race_* a message to the race specified + + *** optional classes to implement *** + bitmap a generic bitmap message + bitmap_* a specific type of bitmap + drawing a generic drawing message + drawing_* a specific type of drawing + </pre> diff -c -r --new-file ds1.1/lib/doc/lpc/concepts/objects ds2.0r27/lib/doc/lpc/concepts/objects *** ds1.1/lib/doc/lpc/concepts/objects Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/concepts/objects Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,16 ---- + objects + + What is an object? + + An object consists of a collection of functions (also called 'methods') + and data (variables) on which the functions operate. The only way to + manipulate the data contained in an object is via one of the functions + defined by the object. + + Every single thing in a mud is an object. Rooms are objects. Weapons + are objects. Even your character is an object (a special kind of object + called "interactive" but still an object in most every respect). Each + object (except possibly virtual objects) in the mud is associated with + some file written in LPC (in the mud's directory structure) that describes + how the object is to interact with the gamedriver and the rest of the objects + in the mud. diff -c -r --new-file ds1.1/lib/doc/lpc/concepts/oop ds2.0r27/lib/doc/lpc/concepts/oop *** ds1.1/lib/doc/lpc/concepts/oop Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/concepts/oop Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,30 ---- + OOP + + OOP stands for "Object-Oriented Programming" + + If you know how to code in C or Pascal or even one of the modern BASICs + (with procedures), then you already have many of the skills you will need + to program effectively in LPC. The main thing you need is a skill in + translating your ideas into a sequential flow of steps (that a computer + can perform). However, LPC is also an object-oriented language. + To effectively use LPC, you would benefit from a knowledge of OOP principles + and concepts. Following are some of the principles of object-oriented + programming (note that LPC doesn't necessarily provide mechanisms + supporting all of these principles): + + <DL> + * systems are modularized on the basis of their data structures. + * objects should be described as implementations of abstract data types. + * unused objects should be deallocated by the underlying language system, + without programmer intervention. + * every non-simple type is a module, and every high-level module is a type. + * a class may be defined as an extension or restriction of another. + * program entities should be allowed to refer to objects of more than + one class, and operations should be permitted to have different realizations + in different classes. + * it should be possible to declare a class as heir to more than one class, + and more than once to the same class. + </DL> + + [These seven principles were taken from the "Object-oriented Software + Construction" book by Bertrand Meyer] diff -c -r --new-file ds1.1/lib/doc/lpc/concepts/preprocessor ds2.0r27/lib/doc/lpc/concepts/preprocessor *** ds1.1/lib/doc/lpc/concepts/preprocessor Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/concepts/preprocessor Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,307 ---- + LPC Preprocessor Manual + + The preprocessor is a front end to the LPC compiler that provides such + handy features as: + + <DL> + * sharing definitions and code (#include) + * macros (#define, #undef) + * conditional compilation (#if, #ifdef, #ifndef, #else, #elif, #endif) + * debugging (#echo) + * compiler specific (#pragma) + * text formatting short cuts (@, @@) + </DL> + + The first three are identical to C usage, so those already familiar with + C may want to just skim the last few sections of this document. + + Note: + For those directives that begin with '#' (such as #include), the + '#' symbol must start in the first column (of the line). + + Sharing Definitions and Code + + This facility is provided through the #include directive. + + Syntax 1: #include <file.h> + + Syntax 2: #include "file.h" + + Notes: + The '#include <file.h>' form looks for the file, 'file.h' in the + system's standard include directories. + (On TMI this is just '/include'.) + + The '#include "file.h"' form looks for the file, 'file.h' in the + same directory as the file that is including it. + + The #include statement is a way to textually include one file into another. + Putting a statement such as '#include "file.h"' in a file gives the same + effect as if the contents of file.h had been directly entered into the file + at the point where the #include statement occurred. Included files are + recompiled each time the object that include's them is recompiled. If the + included file contains variables or functions of the same name as variables + in the file doing the including, then a duplicate-name error will occur at + compile time (in the same way that the error would occur if you simply typed + in file.h rather than using #include). + + Macros + + Macro definitions are used to replace subsequent instances of a given + word with a different sequence of text. Reasons for doing so include + hiding implementation details, reducing the number of keystrokes, and + ease in changing constants. + + Syntax 1: #define identifier token_sequence + + Syntax 2: #define identifier(id_list) token_sequence + + Notes: + As a matter of convention, identifiers are usually capitalized to + emphasize their presence in the code, and defined close to the + start of program, or in a separate header file which you #include. + + The second case allows identifiers in the id_list to be substituted + back into the token_sequence. + + Example: + + <pre> + // Create a 40 cell array of integers and initialize each cell + // to its cell number times 2, + // i.e. stack[0] = 0, stack[1] = 2, stack[2] = 4, etc + + #define STACKSIZE 40 + #define INITCELL(x) 2*x + + int *stack; + + create() { + int i; + + stack = allocate(STACKSIZE); + + for (i = 0; i < STACKSIZE; i++) + stack[i] = INITCELL(i); + } + </pre> + + Lastly, it's sometimes useful to undefine (i.e. make the compiler forget + about) a macro. The following directive is then used: + + Syntax: #undef identifier + + Note: + It's perfectly acceptable to undefine an identifier that hasn't been + defined yet. + + Conditional Compilation + + These directives can add flexibility to your code. Based on whether an + identifier is defined (or not defined), variations of the code can be + produced for different effects. Applications include selective admin + logging and support for multiple drivers (or versions of the same driver). + + <pre> + Syntax: #ifdef <identifier> + #ifndef <identifier> + #if <expression> + #elif <expression> + #else + #endif + </pre> + + Note: + <identifier> refers to an identifier that has been (or could be) defined + by your program, a file you have included, or a symbol predefined by + the driver. + + <expression> is a constant expression that evaluates to a boolean + condition. The expression may contain any legal combination of the + following: + </pre> + operators: ||, &&, >>, <<, + +, -, *, /, %, + &, |, ^, !, ~, + ==, !=, <, >, <=, >=, ?: + </pre> + parentheses for grouping: (, ) + calls of the form: defined(identifier) + and identifiers + + #ifdef identifier + can be considered shorthand for: + #if defined(identifier) + + #ifndef identifier + can be considered shorthand for: + #if !defined(identifier) + + #elif expression + can be considered shorthand for the sequence: + #else + # if expression + # endif + + Example 1: + + <pre> + // Using #if 0 allows you to comment out a block of code that + // contains comments. One reason to do so may be to keep a copy + // of the old code around in case the new code doesn't work. + #if 0 + // In this case, the constant expression evaluates + // (or is) 0, so the code here is not compiled + + write(user_name + " has " + total_coins + " coins\n"); + #else + // This is the alternate case (non-zero), so the code + // here _is_ compiled + + printf("%s has %d coins\n", user_name, total_coins); + #endif + </pre> + + Example 2: + + </pre> + // This example is derived from TMI's /adm/simul_efun/system.c + #ifdef __VERSION + string version() { return "2.7.2"; } + #elif defined(MUDOS_VERSION) + string version() { return MUDOS_VERSION; } + #else + # if defined(VERSION) + string version() { return VERSION; } + # else + string version() { return -1; } + # endif + #endif + </pre> + + Debugging + + The '#echo' directive allows you to print messages to the driver's stderr + (STanDard ERRor) stream. This facility is useful for diagnostics and + debugging. + + Syntax: #echo This is a message + + Note: + The rest of the line (or end-of-file, which ever comes first) is the + message, and is printed verbatim. It's not necessary to enclose text + with quotes. + + Compiler Specific + + This facility performs implementation-dependent actions. + + Syntax: #pragma keyword + + At this time the following control keywords are recognized: + + <DL> + * strict_types + * save_binary + * save_types + * warnings + * optimize + * show_error_context + </DL> + + Notes: + 'strict_types' informs the compiler that extensive type checking should + be done + + 'save_binary' informs the compiler to save the binary object; + loading will go faster after a reboot/shutdown since object has been + precompiled + + 'save_types' is saves the types of function arguments for type checking + in objects that inherit this program + + 'warnings' enables the printing of warnings about things the driver thinks + are dangerous or likely to be incorrect. + + 'optimize' directs the compiler to spend a little extra time generating + better code + + 'show_error_context' adds information about where on the line an error + occured to error messages + + Text Formatting Shortcuts + + This facility makes it easier to format text for help messages, room + descriptions, etc. + + <pre> + Syntax 1: @marker + <... text block ...> + marker + </pre> + + <pre> + Syntax 2: @@marker + <... text block ...> + marker + </pre> + + Notes: + <pre> + @ - produces a string suitable for write() + + @@ - produces an array of strings, suitable for the body pager + </pre> + + These are used by prepending '@' (or '@@') before an end marker word. This + is followed by your formatted text, as you would have it appear to the user. + The text block is terminated by the end marker word, without the '@' + (or '@@'). With '@', the text block is processed as if it were a single + string surrounded by quotes and '\n' (newlines) in between the lines. + With '@@', the text block is processed as it were an array of strings, + with each line being a string surrounded by quotes. + + <pre> + Example 1: + + int help() { + write( @ENDHELP + This is the help text. + It's hopelessly inadequate. + ENDHELP + ); + return 1; + } + + </pre> + Is equivalent to: + + <pre> + int help() { + write( "This is the help text\nIt's hopelessly inadequate.\n" ); + return 1; + } + </pre> + + Example 2: + + <pre> + int help() { + this_player()->more( @@ENDHELP + This is the help text. + It's hopelessly inadequate. + ENDHELP + , 1); + return 1; + } + </pre> + + Is equivalent to: + + <pre> + int help() { + this_player()->more( ({ "This is the help text.", + "It's hopelessly inadequate." }), 1); + return 1; + } + </pre> diff -c -r --new-file ds1.1/lib/doc/lpc/concepts/simul_efun ds2.0r27/lib/doc/lpc/concepts/simul_efun *** ds1.1/lib/doc/lpc/concepts/simul_efun Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/concepts/simul_efun Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,28 ---- + Simulated efunctions + + There is a mechanism to allow the mudlib to simulate efunctions. All + simulated efuns must be defined in a special file (the name and location + of which are to be specified in the config file). + + When compiling an object and a function call (not a call_other) is found that + has not been defined in the object then the driver + will search for that function in the list of simulated efuns. If the + function is found in that list, then the driver sets up a call to + that function (as defined in the simulated efun file). + + Simulated efuns have many uses. One is that it is now possible to make major + changes (and even removals) to the behavior of efuns without modifying + the driver (by making a simul_efun having the same name as an efun). Suppose + you wish to modify the behavior of the move_object() efun. You could do + so by defining a simulated efun having the same name. The simulate efun + could perform various restrictive checks and then call efun::move_object(). + The efun:: prefix is necessary so that the driver will know you wish to call + the move_object efun and not recursively call the simulate_efun within which + the call to move_object is contained. [Note that valid_override() in master.c + can be used to conrol which simul_efuns may be overridden via the efun:: + prefix]. Simulated efuns are also useful for adding functions that many + different objects may need to call but which aren't appropriate for + inclusion in an inherited file. + + Any function in the simulated efun file that is declared static, will + not be callable by functions outside the simulated efun file. diff -c -r --new-file ds1.1/lib/doc/lpc/concepts/socket_efuns ds2.0r27/lib/doc/lpc/concepts/socket_efuns *** ds1.1/lib/doc/lpc/concepts/socket_efuns Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/concepts/socket_efuns Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,804 ---- + MudOS LPC Sockets Tutorial + 1992 October 20 + by Cynosure (Dave Richards) + + Minor update 1994 Sept 16 by Robocoder (Anthon Pang) + + Note: It is now possible to pass a function pointer anywhere a string + function name is mentioned in the following. + + One of the enhancements added to MudOS between 0.8.14 and 0.9.0 was the + inclusion of Internet sockets in LPC. It has been an ongoing dream of + the MudOS and TMI researchers to provide more tightly integrated MUDs + communicating over the Internet. Socket efuns (or LPC sockets) provide + the first level of MUD integration by allowing LPC developers to write + Internet sockets-based applications. For example, LPC objects already + exist for telnet, remote MUD finger, remote MUD tell, inter-MUD mail + delivery, and participation in the MUDWHO system. + + This document is intended as a tutorial on how to use LPC sockets to + write network-based intercommunicating objects. It is intended for + intermediate to advanced LPC programmers, who already understand the + fundementals of LPC programming, and wish to write network-based LPC + services. + + Socket Modes + + There are five different modes of communication, or socket modes: + MUD, STREAM, DATAGRAM, STREAM_BINARY, and DATAGRAM_BINARY. Definitions + for these modes can be obtained by including "socket.h" from the mudlib. + + MUD Mode + + MUD mode is a connection-oriented communication mode where LPC data types + may be passed across the network to another MUD. For example, in MUD mode + one could send structured data, like arrays or mappings, across the network + to another MUD which is using a MUD mode socket. All LPC data types _except_ + "objects" and "functions" may be sent and received using MUD mode. + + STREAM Mode + + STREAM mode is also a connection-oriented communication mode. It differs from + MUD mode however, in that all data is sent and received as strings. So, + using STREAM mode one can send streams of data across the network to other + MUDs. STREAM mode sockets are less powerful in that they do not + transparently send and receive all LPC data types. However, many + applications like telnet, for example, do not need to send data as + integers, or arrays. Instead, telnet views data as a stream of characters + going in each direction. + + MUD mode sockets are effectively implemented as STREAM mode sockets with + special code to send and receive LPC data types. Therefore, it behooves + one to only use MUD mode if the application requires this extra data + abstraction. MUD mode is inherently slower and uses more memory buffer + space than STREAM mode. Note that when using STREAM mode, there is + no guarantee that the string being sent will arrive all at once; + instead, it may arrive in pieces which the receiving side may then have + to reassemble (the pieces will arrive in order). + + DATAGRAM Mode + + Unlike MUD and STREAM modes, DATAGRAM mode is connectionless. No connection + is established between MUDs to transfer data. Instead, each piece of data + is sent to the destination MUD in a message called a datagram. + + Because no connection is estsblished in DATAGRAM mode, it is possible that + the network could lose the DATAGRAM and neither MUD would realize it! For + example, if TMI sent a datagram to Portals using DATAGRAM mode and the network + lost the datagram, Portals would never receive the datagram and would be + ignorant of the datagram ever being sent at all. And TMI won't realize the + datagram was lost because no error is received if the datagram is lost. + + TCP and UDP + + In MUD and STREAM mode, a TCP connection is established between the two MUDs. + TCP is a protocol that will re-transmit data if it detects that data has been + lost. It uses algorithms that send data, measure how long it takes to get a + reply, wait that long and re-transmit the data until an acknowledgement is + received. TCP also guarantees that the data packets arrive in order and + are not spuriously duplicated. (This is a very superficial description of + TCP, but does indicate the sort of work involved in making data transfer + reliable). + + DATAGRAM sockets, on the other hand, use a datagram oriented protocol called + UDP. UDPs send datagrams between MUDs without the overhead of connections, + retransmission, etc. Now, since DATAGRAM mode is unreliable why would one + want to use it? Clearly TCP is better because it guarantees that data is + retransmitted if it doesn't arrive, and it deals with all the ugliness that + a network can throw at it. Simply stated, some applications really don't + care if all data arrives at the other end. Then why send it? Okay, okay. + This is a good question, but now is too soon to talk about it. Just take + it on faith that there is a need for DATAGRAM mode and we can fill in the + details a bit later. + + Creating Sockets + + Ok, so let's start off by creating a MUD mode socket. We can write an + object to do this: + + <pre> + #include "socket.h" + + void + create() + { + int s; + + s = socket_create(MUD, "close_callback"); + if (s < 0) { + write("socket_create: " + socket_error(s) + "\n"); + return; + } + + write("Created socket descriptor " + s + "\n"); + + socket_close(s); + } + + void + close_callback(int s) + { + write("socket " + s + " has closed\n"); + } + </pre> + + Let's analyze this object to see how a socket is created. Be forewarned, + we have a long way to go before we can send data on a socket, and creation is + only one step along this trail. So be patient and be sure to understand + each example before moving. + + The first thing we do is #include "socket.h". All socket definitions + are contained in socket.h, remember? #defines exist, for example, for + MUD, STREAM and DATAGRAM. Although each name maps to a number, a well + written application will use this name instead; partly because the + you mean to do. + + We declare an integer variable s. In many sockets applocations s is used + as an abbreviation for socket. Then we call socket_create() with two + arguments. The first argument is the socket mode (which we discussed above), + and note that we use the synbolic name MUD for MUD mode. The second argument + in the above example is called the close callback function. It is the name + of a function within the object that MudOS will call when the connection is + closed. Callbacks are used often in LPC sockets efuns to notify the + object when important network events occur. Note, by the way, that we could + have passed STREAM or DATAGRAM to socket_create() to create STREAM or + DATAGRAM sockets. + + All socket efuns return an exit status or return value. This value indicates + the completion status of the function. By convention all values less than 0 + indicate errors or warnings. When an error is returned the application must + decide how to respond to it. In many cases there is no possibility for + success unless the MUD administrator makes changes to local config file or + the MudOS driver itself, so in many cases the application may decide to + just return on failure. In the above example, if an error is returned + (s is less than 0) then we use the socket efun socket_error() to write + an error message on the screen. This is useful during debegging, but should + probably be converted to log_file() calls eventually so the errors can be + logged and fixed. + + If socket_create() succeeds, it returns an integer greater than or equal to + 0. This integer is known as a socket, a socket descriptor or a file + descriptor. All three names have their origins in UNIX terminology. If + socket_create() returns a value less than 0 then an error has occurred and + no socket has been created. There really aren't any good reasons for + getting an error. The most common errors would be specifiying an incorrect + socket mode (which should not happen if you use the socket mode definitions + in socket.h) and out of sockets. The MUD administrator can configure the + number of LPC sockets that can be used by MudOS. By default, this number + is 16, but should be changed to fit the MUD's requirements. Increasing this + number will make more LPC sockets available. Note, that each active LPC + socket takes away one socket that could be used to handle a player login + or an open file. If the mud needs to handle many players and many open + sockets simultaneously, the machine adminstrator may need to be convinced + to increase the maximum number of open file descriptors allowed to a process. + + All socket objects should be careful not to "lose" sockets. Sockets + are not like other LPC objects, there are only a finite number of them. + So in the above example, if we were able to create a socket, we close it + afterwards. Losing track of a researce is called "leaking". Socket + leaks occur when object create sockets, use them for a while and then + stop using them without closing them so that they can be used by other + objects. When an object is destructed, all LPC sockets are automatically + closed. One other thought about sockets: each socket in MudOS has it's own + unique socket descriptor (or socket number). So if one object created a + socket, and another created a second socket, neither object would receive + the same socket descriptor. Object may use this knowledge to their advantage. + It is common, for example, to use the socket descriptor as an index into + a mapping that notes various information for each open socket. Remember, + however, that once the socket is closed, it becomes available for re-use + by other socket_create() calls. + + Client/Server Model + + Before continuing with the rest of the socket efuns now is probably a good + time to stop and review some basic networking concepts. Connection-oriented + communication is normally described in terms of the client/server model. In + this model each connection has a client and a server. The client is the + subject that initiates the connection and solicits some sort of service. + The server on the other hand waits for connection requests from a client, + and when they arrive provides the service requested. Ftp, for example, + operates this way. A user initiates a request by connecting to a server. + The server than acts on the requests of the client. A server + is unlike a client however in that is may be serving more than one client + at any point in time. + + MUD and STREAM mode sockets use the client/server model. The client and + server each using slightly different calls to establish a connection. + Later we will discuss the peer-to-peer model when discussing DATAGRAMS, + which is slightly different than the client/server model and uses an + again slightly different method for establishing communication. + + It is possible to have many different services available. Each service is + identified by a "well-known port". A port is simply an integer in the + range 1 to 65535. Most MUDs, however, can only use the range 1025 to + 65535 because the first 1023 are reserved for applications like telnet, + ftp, etc that are standardized. In order for a client and server to + cummunicate the server my first create a socket, bind to a well-known port + and listen for connection requests. The client on the other hand must + create a socket and connect to the well-known port. The client connects + to the same port as the server has bound and listened on. That is why + it is called a "well-known" port. Because clients know the port a priori + and can therefore connect to it. In the Internet Request for Comments + documentation, for example, the port number is actually specified with + the text of the standard. + + We will continue our discussion then in the order that socket efun + calls would normally be executed to establish a connection between the + client and server. The server must do some preperation before the + client can initiate a request, so we will start with the server. + + Binding to a Port + + After the server has created a socket with socket_create() (and has verified + that the return value is greater than or equal to 0) the next logical step + is to bind to a port. This is done with socket_bind(). Let's add some more + code to the example above. First let's declare a new integer variable + called error, which is used to hold the return value from socket_bind(). + + <pre> + int error; + + // Now let's add a call to socket_bind(): + + error = socket_bind(s, 12345); + if (error != EESUCCESS) { + write("socket_bind: " + socket_error(error) + "\n"); + socket_close(s); + return; + } + </pre> + + This should be added above socket_close(s). What does it do? Well + the first argument is no suprise, it's just the socket descriptor we + got back from socket_create(). We will have to pass s into every socket + call from now on so that MudOS knows which socket we are referring to. + Remember servers can and often do service more than one client socket at + one time, so we need to be able to keep them straight. The second argument is + simply the port number. Recall, it should be in the range 1024 to 65535. + (Actually 0 is legal too, but 0 will be discussed a bit later.) + + After calling socket_bind() we check the return value to see if an error + occurred. In this case, however, we compare against EESUCCESS. In most + cases (excluding socket_create()) EESUCCESS indicates that the socket efun + completed successfully. Like socket_create() above, if an error is returned + we call socket_error() to display the error as a string. After writing the + error we simply return, right? Wrong! We discussed leaks above. If we + were to return, then an object would exist that is no longer using a socket + but stops others from using it. If we decided we cannot use the socket + anymore CLOSE IT so others can. Once socket_create() has been called and + until socket_close() has been called the socket remains open. So remember + to be a good socket citizen and close sockets when you are finished. + + socket_bind() is notorious for returning EEADDRINUSE. What does it mean? + If one socket binds to port 12345 and another socket attempts to bind to the + same port (i.e. 12345) the second socket will fail to bind. This is simple + enough to understand. Once a socket binds to a port that socket owns that + port. Other attempts to bind to the same port will fail with EEADDRINUSE. + This is a very common error and can occur if two folks attempt to run the + same server demo, for example. The correct resolution to this problem is + to 1) determine if the same service is being started twice, in which case, + DON'T, once is fine, or 2) more than one developer has chosen the same + port number for multiple services. This won't work. One way to avoid this + is to have one port administrator that assign ports. Unfortunately, since + networks are generally not isolated, this port assignment must be agreed + upon by all MUDs that you intend to communicate with. + + Security + + Before going on and to satiate those with crimical intent we should answer + a few questions about invalid sockets descriptors. What happens if we were + to pass in a bad socket descriptor value, just to be mean? Don't worry MudOS + will catch you doing it and tell you so. For example, if you passed in + a value that was less then 0 or greater or equal to the total number of + possible sockets in the driver, then MudOS would know you were lying though + your teeth and would return EEFDRANGE. Now if you were more sneaky you + might try to pass in a legal socket descriptor but one that was not + currently is use. MudOS would catch you again and would return EBADF. Ok + sneak that you are, you found out about a socket that in use by some other + object. What then? Well there is a 2-level security system built into + LPC sockets. + + The first level of security uses the master object to validate which + objects can and cannot use sockets. It might make sense on some MUDs, for + example, for some developers to have access to LPC sockets and some others + not too. Or perhaps one developer is abusive of network priviledges and + should be banned from socket use. (In the latter case such a developer + should probably asked to leave.) To enforce such a policy, MudOS invokes + a function called valid_socket(). valid_socket() should return 0 or 1 + indicating whether the requested socket operation should be allowed. + If no valid_socket() function exists, then the value 0 is assumed and all + LPC socket access is *denied*. On most MUDs however master.c would + contain the following valid_socket(). + + <pre> + int + valid_socket(object eff_user, string fun, mixed *info) + { + return 1; + } + </pre> + + The 2nd level of security is more rigid and is used to stop one + object from interfering with another object. When a socket is created + the socket becomes "owned" by the object that called socket_create(). + Each time a socket efun is called the calling object is compared to the + owner object. If they are not the same, then the socket efun call is + aborted. Thus, heinous code like: + + <pre> + int s; + + for (s = 0; s < 100; s++) + socket_close(s); + </pre> + + will not succeed in closing all sockets on the MUD. It will close all + sockets owned by that calling object, but all other sockets are + protected by tge 2nd-level security policy. + + In either case if the 1st or 2nd level security policy is violated, then + EESECURITY is returned to the caller indicating that the socket efun was + aborted because of such a violation. If you encounter this error when + writing LPC socket code the mostly like reason would be that you passed in + the incorrect socket descriptor. This happens. + + Listening for Connections + + Once a socket has been created and a port has been bound, a server must + begin listening for connections. This is done with socket_listen(). + Like socket_bind() the first argument is the socket on which to listen. + The second argument is the "listen callback" function. Recall the + close callback function from socket_create()? socket_listen() specifies + a function within the object that will be called when a connection + request is received from a client. Within the listen callback function + a server can either accept the connection from the client or close it. + In most servers there is really no good reason for ever just closing a + connection. It is considered rude and should be avoided. If the + client and server implement some sort of authentication protocol + (i.e. password checking) the server should return some indication as + to why the socket is being closed. This is more a question of style, + of course, but it is difficult to debug a problem with a client or server + when a connection is made then dropped immediately. If you must do this, + be sure to log some indication as to why in a logfile so that an administrator + or developers can determine the cause and resolve the problem. + + The following code starts listening for connection requests on a socket + that has been created and bound to a port. + + <pre> + error = socket_listen(s, "listen_callback"); + if (error != EESUCCESS) { + write("socket_listen: " + socket_error(error) + "\n"); + socket_close(s); + return; + } + </pre> + + It is really just more of the same code, right? We call the socket_listen() + efun, check the return value for success, if an error occurs write an + error message out which includes a description of the specific error, + close the socket because we're done with it and return. In reality much + of the code necessary in sockets applications follow this pattern. + + Now obviously the next thing to do is discuss the listen_callback function, + right? Right. But we won't. Instead we'll change gears here and look at + the client code for a bit. The reason for this is simple. Before a client + can initiate a connection to a server the steps we have discussed now for + the server must have occured. Until the client *does* initiate a connection + though, no more code will be executed within the server. So it makes sense + to digress and discuss the client for a moment. + + Clients + + So far we have discussed a connection from the server's perspective. Now + let's back up and walk through the client. Just like the server a client + must call socket_create() to create a socket. Since a client does not + intend that another client connect to it there is no need to bind the + port to socket. Does this mean that it cannot do so? No. It is possible + for either a client or server to bind to a port. + + But why would a client wish to do so? Well the truth of the matter is this, + every socket must be bound before a connection can be established. Every one. + However, since clients don't really care what port they are bound to, a + special bind is used. It was alluded to above, we're just catching up to it + now. If a client calls socket_bind() with a second argument of 0, this + indicates that the caller doesn't care what port is selected, just pick + any one that is available. And this makes it easy for a client. If the + caller did bind to a specific port, what happens if another client is already + bound to it? The bind fails. So why not let the system do the work of + choosing the port? + + Now there is one more trick up our sleeve, however. The operating system + is pretty smart. It knows whether a sosket is bound or not. It knows when + you do a connect (It knows when you've been bad or good). So, seeing how + common it would be for a client to wish to connect to a server the designers + of the 4.2/4.3BSD networking system put in a neat feature. If you connect + on a socket, and the socket is not yet bound, the system will do a + socket_bind(s, 0) for you automatically! In fact if you read BSD networking + applications you will notice that almost no sockets that are used to + initiate connect requests on ever bother doing the bind call. Laziness is + bliss. + + Initiating a Connect + + Once a client has created a socket with socket_create() and optionally + bound to a port with socket_bind(), can then called socket_connect() to + initiate a connection request. socket_connect() requires four parameter: + 1. the socket on which the connection to be performed, 2. the address and + port to connection to, 3. the read callback function, and 4. the write callback + function. There are several new concepts we need to cover so let's go + slowly and review each argument in tern. + + The first argument is old hat by now. It is just the socket or (socket + descriptor) that was returned from socket_create(). The second argument, + however, is new and exciting. It is a string representating of the address + and port to which we want to connect. Rather than waste your time talking + about Internet standard dot notation, and address classes, etc, lets just + say this about Internet (or IP) addresses. You have probably seem them + before. They are 4-byte addresses, with each byte being separated by a ".". + For example, the Internet address for eng3.sequent.com is 138.96.19.14. + There are many ways to find the IP address for a machine. The mud list + supplies the host name and IP address for the MUD machine (which do change + from time to time). The UNIX ping and nslookup commands can be used, as well. + From this point on, we will just assume you can determine the IP address + for a destination machine. One thing to think about though is that in + general most applications to not embed IP addresses within the code. It is + more common that the user would provide tha address as an argument to the + application, so don't panic. + + We discussed ports above when we talked about binding. The port that + you specify to socket_connect() is the same "well-known" port number that + the server bound to above. That's the whole point, by the way, of binding. + The server and client rendezvous so to speak at the port. So how should + the second argument appear? Let's assume we wanted to connect to + eng3.sequent.com port 12345. We would write the following additional code: + + <pre> + string address; + + address = "138.95.19.14 12345"; + error = socket_connect(s, address, "read_callback", "write_callback"); + if (error != EESUCCESS) { + write("socket_connect: " + socket_error(error) + "\n"); + socket_close(s); + return; + } + </pre> + + Notice the address variable. It is a string and we asssign it the + Internet address and port number with a space in between to seperate + them. This is the format that socket_connect() expects addresses and + ports to be specified. + + So what are the read and write callback functions? Well we have already + talked about callbacks in general. MudOS calls these function when some + network event occurs. In these cases, MudOS calls the applications when + data becomes available to read (i.e. read callback) or that it is now + okay to write data (write callback). We will discuss how these callbacks + should work in just a bit. + + The point is, once socket_connect() is called, the client initiates a + connect request to the server. Because of the way MudOS works this is + all we can do for now. The network has work to do. We have just requested + the network to send a connect request to a remote machine. That remote + machine will then inform the application that a connect request has + been received and that application will decided what to do about it. The + point is, all of this takes time. And while all this is going on MudOS + has other work to do. So rather than stop MudOS from doing useful work, + MudOS simply return EESUCCESS. Does this mean that the connection has + been made? No. Does it mean the remote machine will connect with us? + No. Do we even know if the remote machine is up? No. Do we know + anything? Yes, a little. We know that three possible things can happen + in the near future. 1. the read callback function could be called + indicating the arrival of data from the remote application, 2. the write + callback could be called indicating that it is okay to send data, or 3. the + close callback function (that was provided way back in socket_create()) + could be closed indicating that the remote machine did not accept of + connection request. + + Before going one step further though, make sure this is all clear. + socket_connect() tells TCP to start a connection request. When + socket_connect() returns we don't know anything about the state of + the connection as of yet. MudOS will eventually call back one of the + functions so we know what happened. This sort of programming is called + asynchronuous programming. It's opposite is known as synchronous + programming. In synchronous programming your application would wait + until the connection is either accepted or closed before returning. + But we do not have the leisure of synchronous programming in MUDs because + while we wait for the network, other things are being ignored which should + not be. So to be fair to everyone we use this asynchronous model. Which is + not really that complicated once you get the hang of it. + + Of course, in the above discussion we assume you check the return value + from socket_connect() for EESUCCESS. If socket_connect() does not return + EESUCCESS then the connection request failed and no callbacks will be + called. A common mistake is to forget to check the return value and assume + one of the callbacks will eventually be called. Be careful. As in all cases + above if the connection request fails then be write an error message out to + the display, close the socket so it can be re-used and return. + + Now we wait. Some time in the future either the read, write or close + callback will be called... + + Accepting a Connection + + Meanwhile (back at the server) a connection request is received from the + client. When this occurs our listen callback function will be called. + This function was specified in the socket_listen() function, remember? + MudOS calls the listen callback with a single argument, that being the + socket descriptor of the socket that, socket_create(), socket_bind() and + socket_listen() was done on. This is useful if an object is listening + on multiple sockets at the same time. + + The responsibility of the listen callback function is too either + accept the connection or close it. In general though, as was mentioned + above, we always accept incoming connection requests. The following + code accepts an incoming connection request: + + <pre> + void + listen_callback(int s) + { + int ns; + + ns = socket_accept(s, "read_callback", "write_callback"); + if (ns < 0 && ns != EENOSOCKS) { + write("socket_connect: " + socket_error(error) + "\n"); + return; + } + } + </pre> + + Okay, we know what s is, right? It was passed as an argument to us. + It is the socket on which the connection indication came in on. So what + is ns? Aha! ns is an abbreviation for new socket. When a connection is + established a new socket is created for that connection. So what is s used + for? It is used to accept connections on. s will never be used, for + example, to actually send or receive data. Instead, it is used to tell + the socket application when connection requests arrive. ns, however, is + a socket that can communicate with the client. The server can send and + receive data on it etc. Make sense? + + Now if you recall, we passed read and write callback function names to + the socket_connect() efun. We are doing the same thing here. + We haven't discussed them yet so don't worry, we'll get there. For now + just realize that the read and write callbacks are used for the same + purpose for socket_accept() as they are for socket_connect(). And don't + get too impatient we are almost ready to discuss them in gory detail. + + It's important to note that our error handling is different here than in + other cases. If socket_accept() returns a value greater than or equal to + 0 then the efun succeeded just like socket_create(). This means that the + connection has been established! This is major progress. However if it + did not succeed there is one case that is worth making an exception for. + Recall from way, way back that there are a limited number of sockets that + MudOS can use? Well, what would happen if all sockets are in use when a + connection request arrived? Well simple, stated the connection could not + be accepted because there are no sockets to accept it on. This is a shame + but it can happen. If it does EENOSOCKS is returned. This is more of + a warning than a really bad error. Sure the connection was closed because + not sockets were available, but if some other socket becomes free a new + connection could be established in the future, so this is an example of + a temporary error. In this case, it may make sense to just return. + However, in all other cases, the listen socket is closed. This means that + no new connections can be accepted, until the server is restarted. As + a result be sure to display an error message so an administrator knows + to restart the server! + + <HR> + + Flow Control + + Before talking about data transfer which is sort of the climactic + section anyway, we need to discuss another paradigm. If we were + to look at networking technology today networks run at several orders + of magnitude of difference in performance. FDDI, for example, which is the + fiber opitc network standard of today runs at around 80 million bits per + second, IBM Token Ring runs around 16 million bits per second, Ethernet + around 10 millions bits per second, high-speed syncronous serial runs at + about 56 thousand bits per second and finally consumer asynchronous + modems run from 1.2 thousand to 14.4 thousand bits per second. These are + raw data rates, and one certainly cannot expect to use the entire + bandwidth of the various media. The point is this, if you ever expected + to find a hetrogeneous operating environment, networking is it. The same + protocols operate correctly at various data rates, and with different network + technologies. This is what the Internet model is all about. + + Because of the variety in networks today it is difficult to make assumption + about how long things might take on networks. Recall from about that when + we initiated a connect request from a client we checked to be sure that + socket_connect() return EESUCCESS and then just returned and waited? This + was not just a cute metaphor. In reality we were. On an Ethernet we + probably waited about 3/1000s of a second for a reply, not really all that + long. So short in fact, we could have probably just hung around for the + response and delayed further processing within MudOS. But what if the + reply were to take several seconds, which is is likely to do on a SLIP or + Point-to-Point link? We don't know a priori how long things will take and + so must be prepared for the worst when dealing with networks. + + There really is a point to all of this discussion. Computers are pretty + fast and are getting faster. Desktop computer can runs millions of + instructions per second. At best a similarly priced modem for such a + computer could run at around 19.2 thousand bits per second. That works + out to less than 2 thousand bytes per second. So if we compare the computer + speed to the network speed we find a vast difference in speed. The + conclusion one should reach is this: A computer can generate data much + faster than a network can send it. Therefore I could write a program + that sat in a loop and pounded the network with data, and it's very likely + that I would eventually run into a case where I had data ready to send and + the network is not ready to accept it. What should we do in this situation? + Well if we follow our previous example (i.e. socket_connect()) we would just + wait until the network is ready for more data. And so we do. + + Realizing the difference in speed between computers and networks the + inventor of network software have designed the following kind of interface. + Each socket has a reasonably-sized memory buffer (typically around 4k + bytes of data) that is used to temporary hold data while is waits for the + network to send it. This temporary buffer will eventually fill, of course, + if we were to send data faster than the network can handle. When it does the + socket is said to be "flow controlled". This mean we are told that there is + no more room in this temporary buffer to hold any more data, so we should + stop sending more data. This flow controlled notion affects is directly + when writing sockets code. We have to be smart enough to send when we + can and wait when we cannot send. This may sound complicated; luckily + we can reduce this down to a few very simple rules. + + Remember we said that socket_connect() generates a connection request and + returns immediately without waiting for the reply? This is true it does. + But what we didn't mention back then is that during the connection request + your application cannot send any data. This makes sense right? If the + connection has not been established then how can data be sent. This is + like dialing a phone number and starting to talk while the phone rings! + Well if we cannot send data after socket_connect(), when can we. We talked + about this before, remember? Once the connection is established then + either the read, write or close callback will be called. + + So if we want to send data what should we do? Wait for the write callback + procedure! Simple enough, right? Let's forget about the close callback + for the moment because we know why it gets called and it not important any- + more. Let's just focus on the read and write callback functions. We said + when the connection has been established either the read or write callback + function will be called. Well gee, if we are waiting for the connection + to come up so we can send data and our read callack gets called what should + we do, send the data? No. Because no matter what, once the connection + comes up the write callback is guaranteed to be called at least once. + In other words, there are two directions of communcation the read direction + (data coming across the network towards us) and the write direction (data we + send out the network towards the other MUD). If we stick to our guns + and think of each direction as seperate we will avoid confusion. + + Now remember the term flow-controlled? It means that we cannot send any + more data because we are waiting for the network to catch up. Well + after a connection request (i.e. socket_connect()) we are flow- + controlled. Once the connection has been accepted by the server then + our write callback function is called and we become, not flow-controlled! + This is our cue! Send data! Make sense? + + Ok, so we take our chance and start sending data like mad. The network + sends this, and this, and this too. At some point the buffer inside is + going to fill up and we are going to become flow-controlled again. What do + we do then? Same as before. Wait for our write callback function to be + called again so we can start sending more data. Sending on a network is + like send bits of data in bursts. We send, we wait, we send some more. + A correctly written socket application then is one who keeps track + of whether it can or not. And only sends when MudOS says it can, and + waits when MudOS says it cannot. + + Before you go off and get frustrated with LPC sockets, remember this: the + rules for flow control are not difficult to understand, but violating them + can end in disaster. Make sure you understand this flow control model. It + is fundamental to the asyncrhonous programming model. If it does not make + sense then please re-read this section or ask a sockets-savvy friend for + help, because this is very important. + + Sending data + + Okay, now that we understand the constraints within which we live, it's time + to discuss actually sending data. It's been a long time in coming, but we + have convered a lot of important information along the way. + + After a client's write callback is called the client is no longer + flow-controlled, which means it can begin writing data. What about the + server? Is the server flow-controlled after doing socket_accept()? This + is a good question. The answer is no, it is not. This is another difference + between clients and server. The client must wait for a write callback + before it can begin sending data, the server can begin as soon as the + connection has been accepted. Ignoring this final detail though, there + is no difference between client and servers send and receiving data. Both + client and server use the same socket efuns in the same way. + + So let's do it, let's send a number in MUD mode. + + <pre> + error = socket_write(s, 0); + </pre> + + Incredibly enough that's all it takes to send the LPC integer 0 to + the other MUD. One could do: + + <pre> + error = socket_write(s, "Hello you other MUD1"); + </pre> + + to send a hello message as a string to the other MUD. In fact in MUD mode + you can send any LPC data type except objects. This means arrays, mappings, + integers, etc. This is very powerful indeed! Ok we sent it, but what happened + on the other side so they can receive it? Remember the read callback + function, we specified it in the socket_connect() and socket_accept() + efuns? The read callback function is called when the network delivers to + the data to the socket. For example: + + <pre> + void + read_callback(int s, mixed message) + { + write("Received " + message + "\n"); + } + </pre> + + would write the receive data! The read callback then is used by MudOS + to tell an object when new data arrives. In the above example we used + a second parameter of mixed. This is because in MUD mode any data type + can be sent across the network. It is the object's responsibility to make + sure the object type is correct. In fact, once you are able to send and + receive data correctly, you have solved the immediate problem of communication + and have opened up a whole new problem called protocol engineering. This + involves designing networking protocols that are reliable and can + interoperate with many type of computers, but that unfortunately is far + beyond the scope of the tutorial. Alas. + + So have we finished with socket_write()? I hope you don't think so. + You should have noticed that we didn't check error after calling + socket_write(). Why is this? Well to be blunt, because there are four + different classes of return codes that socket_write() can return and I + figured we'd ease into the nitty gritty details. So here we go. + + There are four things socket_write() can return. 1) because it sent + the data along and everything is just fine, 2) the data has been saved in + a buffer and will eventually be sent, but no more data can be accomodated + at the moment, 3) the data has not been saved in a buffer and will not + be sent since no more data can be accomodated at the moment, and + 4) socket_write() is very confused and doesn't know what to do now. In the + first case, socket_write() has sent the data and is ready for more. It will + not call the write callback function because there is no need to, we are not + flow-controlled. In other words, we should remember that it is still okay + to send data. In the second case the data will be sent, it's sitting in a + memory buffer ready to be sent when the network can send it, but the buffer + is now full. Which means we are now flow-controlled. It would be + inappropriate for us to try to send more at this point, so we should remember + we cannot send any more right now. When the network empties the memory buffer + the write callback function will be called and we can then start sending data + again. In the third case, the data couldn't be sent at that moment, + possibly due to socket traffic or network congestion. We are not flow- + controlled so the write callback function must be called explicitly, to + attempt resending the data. A call_out() is a better choice here over + a direct function call since the delay gives the system a chance to recover, + reduces the possibility of max eval'ing, and better simulates a callback. + In the final case, some error has occurred either on the network connect or + within the operating system such that the write can not be performed. In + that case, however, it is likely nothing can be done to rectify the problem. + In general, the best thing to do is simply close the connection. In general, + this never happens. + + Okay so much for the abstract, let's look at the specifics. socket_write() + returns EESUCCESS in case (1) above. This means that further writes to the + socket are still possible. If socket_write() returns EECALLBACK, this + indicates that the data has been buffered for output, but that further writes + should be suspended until the write callback function is called. Conversely, + if socket_write() returns EEWOULDBLOCK, this indicates that the data has + not been buffered for output, and that the write callback function must be + called again manually (to resend) before further writes are attempted. + EEALREADY means that the object has violated the flow control model, + i.e. a write was done while the socket was flow-controlled. In this event, + the data is *not* buffered and the caller should again wait for the write + callback function. Of course, well written application will not see + EEALREADY. Any other return value should probably be interpreted as a fatal + error and the socket closed. + + <pre> + int socket_write(int, mixed, string|void); + int socket_release(int, object, string); + int socket_acquire(int, string, string, string); + string socket_address(int); + void dump_socket_status(void); + </pre> diff -c -r --new-file ds1.1/lib/doc/lpc/constructs/for ds2.0r27/lib/doc/lpc/constructs/for *** ds1.1/lib/doc/lpc/constructs/for Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/constructs/for Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,28 ---- + * The LPC for loop: + + The LPC for loop is also identical to that provided by C. Syntax is as + follows: + + for (expression0; expression1; expression2) { + statements; + ...; + } + + Expression0 is evaluated once prior to the execution of the loop. Expression1 + is evaluated at the beginning of each iteration of the loop. If expression1 + evaluates to zero, then the loop terminates. Expression2 is evaluated at + the end of each loop iteration. + + A 'break' in the body of the loop will terminate the loop. A 'continue' will + continue the execution from the beginning of the loop (after evaluating + Expression2). + + A typical usage of the for loop is to execute a body of code some + fixed number of times: + + int i; + + for (i = 0; i < 10; i++) { + write("i == " + i + "\n"); + write("10 - i == " + (10 - i) + "\n"); + } diff -c -r --new-file ds1.1/lib/doc/lpc/constructs/function ds2.0r27/lib/doc/lpc/constructs/function *** ds1.1/lib/doc/lpc/constructs/function Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/constructs/function Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,37 ---- + * The LPC function (or method): + + The LPC function is similar but not identical to that provided by C + (it is most similar to that provided by ANSI C). The syntax is as follows: + + return_type function_name(arg1_type arg1, arg2_type arg2, ...) + { + variable_declarations; + ...; + + statements; + ...; + return var0; + } + + Note that var0 must be of return_type. + + If a function doesn't need to return a value, then it should be declared + with a return_type of "void". E.g. + + void function_name(arg1_type arg1, ...) + { + statements; + ...; + } + + Invoke a function as follows: + + function_name(arg1, arg2, arg3, ...); + + You may invoke a function in another object as follows: + + object->function_name(arg1, arg2, arg3, ...); + + or: + + call_other(object, function_name, arg1, arg2, ...); diff -c -r --new-file ds1.1/lib/doc/lpc/constructs/if ds2.0r27/lib/doc/lpc/constructs/if *** ds1.1/lib/doc/lpc/constructs/if Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/constructs/if Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,48 ---- + * The if else statement: + + LPC's if statement is identical to that provided by C. Syntax is as follows: + + if (expression) + statement; + + Alternately: + + if (expression) { + statements; + } + + Alternately: + + if (expression0) { + statements; + } else { + statements1; + } + + Alternately: + + if (expression0) { + statements0; + } else if (expression1) { + statements1; + } + + The number of else clauses is not explicitly limited. + + - - - - - + + Another favorite programming construct is the ? : operator, which also + operates identical to C. The syntax is: + + expression0 ? expression1_if_true : expression2_if_false + + In some cases, ? : is an shorter way of expression constructs such as: + + if (expression0) + var = expression1; + else + var = expression2; + + which can be equivalently translated to: + + var = expression0 ? expression1 : expression; diff -c -r --new-file ds1.1/lib/doc/lpc/constructs/include ds2.0r27/lib/doc/lpc/constructs/include *** ds1.1/lib/doc/lpc/constructs/include Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/constructs/include Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,21 ---- + The LPC #include directive: + + Syntax: #include <file.h> + Alternate: #include "file.h" + + Note: the '#include "file.h"' form looks for file.h in the current directory. + The '#include <file.h>' form looks for file.h in one of the standard + system include directories (on TMI these directories are /include and + /local/include). + + For those that know C, the LPC #include statement is identical to C's + #include statement. For those that don't know C, the #include statement + is a way to textually include one file into another. Putting a statement + '#include "file.h" in a file gives the same effect as if you had simply + typed the contents of file.h directly into the file at the point where you + had the #include statement. Included files are recompiled each time the + object that include's them is recompiled. If the included file contains + variables or functions of the same name as variables in the file doing + the including, then a duplicate-name error will occur at compile time + (in the same way that the error would occur if you simply typed in file.h + rather than using #include). diff -c -r --new-file ds1.1/lib/doc/lpc/constructs/inherit ds2.0r27/lib/doc/lpc/constructs/inherit *** ds1.1/lib/doc/lpc/constructs/inherit Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/constructs/inherit Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,46 ---- + The LPC inherit statement: + + Syntax: inherit pathname; + + where pathname is a full path delimited by quotes (e.g. "/std/Object"). + + The 'inherit' statement provides the inheritance capability (a concept from + object-oriented programming) to LPC objects. Inheritance lets an object + inherit functions and variables from other objects. Because the MudOSdriver + internally stores global data and compiled code separately, many different + objects can use inheritance to share the same piece of compiled code. Each of + these objects will have its own local copy of any global variables defined + by the object. Suppose that two object A and B inherit object C. Recompiling + object either of A or B will not cause C to be recompiled. However, it will + cause any global variables provided by C to lose whatever data they had + (remember that A and B each have their own copy of the global variables + provided by C. Thus updating A will not effect the global variables of B + (even those provided by C) and vice versa). + + Suppose object A inherits object B. Object A may define variables and functions + having the same names as those defined by B. If object A defines a function + of the same name as one defined by B, then the definition provided by A + overrides the definition provided by B. If A wishes to access the definition + provided by B, then it may do so. For example suppose that object A defines + its own function named query_long and yet wishes to call the query_long + function provided by the /std/Object.c object. Then A may refer to the + query_long in Object.c as Object::query_long(). If A defines a variable + of the same name as a global variable defined in B, then the only way that A + can access that variable is via functions provided by B. If B defines + a global variable that is not declared in A, then by default A may use that + global variable as if the global variable were defined in A (assuming B does + not choose to restrict access). Note: if object B is recompiled, object A + will continue to use the old version of object B until object A is also + recompiled. + + Multiple inheritance is allowed. That is, an object may inherit more than + one other object. Suppose special.c inherits weapon.c and armor.c and that + both weapon.c and armor.c each provide their own version of query_long(). + We may assume that special.c wants to sometimes act like a weapon and + sometimes act like armor. When special.c is to look like armor it + can use armor::query_long() and when it is to look like a weapon it + can use weapon::query_long(). + + See the tutorial named 'types/modifiers' for more information on how + inherited objects may hide data and function definitions from objects that + inherit them. diff -c -r --new-file ds1.1/lib/doc/lpc/constructs/prototypes ds2.0r27/lib/doc/lpc/constructs/prototypes *** ds1.1/lib/doc/lpc/constructs/prototypes Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/constructs/prototypes Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,7 ---- + * The function prototype: + + The LPC function prototype is very similar to that of ANSI C. The + function prototype allows for better type checking and can serve as + a kind of 'forward' declaration. + + return_type function_name(arg1_type arg1, arg2_type arg2, ...); diff -c -r --new-file ds1.1/lib/doc/lpc/constructs/switch ds2.0r27/lib/doc/lpc/constructs/switch *** ds1.1/lib/doc/lpc/constructs/switch Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/constructs/switch Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,31 ---- + * The switch statement. The LPC switch statement is nearly identical to + the C switch statement. The only real difference is that the cases of + the LPC switch may be strings as well as integers. Syntax is as follows: + + switch (expression) { + case constant0 : statements0; + break; + case constant1 : statements1; + break; + default : statements2; + break; + } + + The switch is a replacement for the chained if else if else if else + construct. The above switch is equivalent to: + + tmp = expression; + if (tmp == constant0) { + statements0; + ...; + } else if (tmp == constant1) { + statements1; + ...; + } else { + statements2; + ...; + } + + The main difference between the switch and the if statement is that if + the "break;" statement is ommited from the end of a particular case, + then the statements in the next case will be executed as well. diff -c -r --new-file ds1.1/lib/doc/lpc/constructs/while ds2.0r27/lib/doc/lpc/constructs/while *** ds1.1/lib/doc/lpc/constructs/while Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/constructs/while Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,40 ---- + The LPC while loop: + + LPC's while loop is identical to that provided by C. Syntax is as follows: + + while (expression) + statement; + + where statement may be replaced by a block of statements delimited by + matching curly brackets. For example: + + while (expression) { + statement0; + statement1; + } + + The statements inside the body of the while loop will be executed + repeatedly for as long as the test expression evaluates to non-zero. + If the test expression is zero just prior to the execution of the loop, + then the body of the loop will not be executed. A 'break;' statement + in the body of the loop will terminate the loop (skipping any statements + in the loop that remain to be executed). A 'continue;' statement + in the body of the loop will continue the execution from the beginning + of the loop (skipping the remainder of the statements in the loop for + the current iteration). + + int test(int limit) + { + total = 0; + j = 0; + while (j < limit) { + if ((j % 2) != 0) + continue; + total += j; + j++; + } + return total; + } + + The results of this code fragment will be to sum all of the even numbers + from 0 to to limit - 1. diff -c -r --new-file ds1.1/lib/doc/lpc/etc/error_msgs ds2.0r27/lib/doc/lpc/etc/error_msgs *** ds1.1/lib/doc/lpc/etc/error_msgs Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/etc/error_msgs Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,35 ---- + parse error + Variable <str> not declared ! + Illegal LHS + Illegal RHS + Undefined function <str> + Wrong number of arguments to <str> + syntax error + Illegal character (hex 2e) + Illegal character (hex 5c) + Illegal character constant + Redeclaration of function <str> + End of file in string + Function <str> undefined + Newline in string + Illegal terminator + Text block exceeded maximum length + Bad arg 1 to <str> + Return type not matching: <type> + Cannot #include <str> + Could not load description for <str> + Indexing on illegal type + Bad type argument to .+ 16 4 + Casts are only legal for type mixed, or when unknown: <type> + Redefinition of #define <str> + Bad argument number <int> to <str>: <type> + Invalid simulated efunction <str> + Missing type for argument + Bad type for argument <int> ( <type> vs <type> ) + Illegal to redeclare local name + Bad argument 1 type to efun <str> + Illegal to redefine 'nomask' function <str> + Must return a value for a function declared: <type> + Too many arguments to buffer + Internal error in <str> + Divide by zero in constant diff -c -r --new-file ds1.1/lib/doc/lpc/intermediate/Contents ds2.0r27/lib/doc/lpc/intermediate/Contents *** ds1.1/lib/doc/lpc/intermediate/Contents Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/intermediate/Contents Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,15 ---- + Intermediate LPC + Descartes of Borg + November 1993 + + Contents + + 1: Introduction + 2: The LPMud Driver + 3: Complex Data Types + 4: The LPC Pre-Compiler + 5: Advanced String Handling + 6: Intermediate Inheritance + 7: Debugging + + Copyright (c) George Reese 1993 diff -c -r --new-file ds1.1/lib/doc/lpc/intermediate/Copyright ds2.0r27/lib/doc/lpc/intermediate/Copyright *** ds1.1/lib/doc/lpc/intermediate/Copyright Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/intermediate/Copyright Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,62 ---- + Intermediate LPC first edition + + Copyright (c) 1993 George Reese + All rights to this text are retained by the author. + + + Permission is granted to distrubute and display the contents of this + document in full so long as the following conditions are met: + 1) No payment may be received for the redistribution or display of this text, + except to cover the costs for distribution media and and shipping and/or + transmission charges. + 2) The textbook must be distributed or displayed in its entirety in its original + form. Changes may only be made to private, individual copies, except as + outlined below. + + Acceptable changes are defined as the following: + 1) Format changes, such as changing from WordPerfect to Word + 2) Medium changes, such as from electronic copy to paper + 3) Content changes are only acceptable under the following circumstances: + a) In electronic media: none of the original text may be ommitted. + You may add comments + as you feel necessary, so long as comments are enclosed in <* *> + and are accompanied by + the game name or real name of the author of the comments + b) In hard copy: none of the original text may be omitted, but it may + be struck out so long + as the content of the original text is visible. Comments may be made + in any form so long + as they are made in handwriting and they are signed by the author. + Comments which are typed or printed must be made in accordance with the + format for electronic media. + + Practically speaking, this is what I mean: + First, I wrote this mostly for mud admins to put onto their muds for learning + coders to read as they are learning to build realms. I did not do this for + someone else to make a buck. So if you charge money for redistributing it + or allowing someone else to see it, you are in violation of this copyright. + Unless you are simply charging for what it cost you to print up a copy or + what the diskettes and postage cost to mail it. + Second, I wrote this textbook, and I should receive credit/blame for what I + say, and others should receive credit/blame for what they say. For example, + if I said something completely wrong, and you simply corrected it, I would + be getting credit for something I did not do. Yet, if you comment according + to the outline above, you will be properly credited for your comments. + More important to me, however, is the practical effect of having hundreds of + copies of this textbook everywhere. If you change something I had right + without noting it as a comment, I will be blamed for spreading + misinformation. This problem is only compunded if the text is redistributed. + So I prefer my words to remain my own. But, when I make mistakes, or if + something I say does not fit your driver/mudlib, please comment it so people + will know. In addition, having the comments side-by-side allows people to + see other ideas, like how another driver might handle something. + + + I want to please note again, you may display this on your mud (like in /doc). + You do not need to + mail me for permission. I would not mind email, since it is nice to know + people are using it, but that is not required. Also, if you really feel I have + done such a wonderful job that you should pay money to use this, then give + $5 to your local ASPCA (or international equivalent). + + See the file titled Contents for a full list of textbook chapters. diff -c -r --new-file ds1.1/lib/doc/lpc/intermediate/chapter1 ds2.0r27/lib/doc/lpc/intermediate/chapter1 *** ds1.1/lib/doc/lpc/intermediate/chapter1 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/intermediate/chapter1 Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,143 ---- + Intermediate LPC + Descartes of Borg + Novermber 1993 + + Chapter 1: Introduction + + 1.1 LPC Basics + Anyone reading this textbook should either have read the textbook LPC + Basics or be familiar enough with mud realm coding such that not only are + they capable of building rooms and other such objects involved in area + coding, but they also have a good idea of what is going on when the code + they write is executing. If you do not feel you are at this point, then go + back and read LPC Basics before continuing. If you do so, you will find + that what you read here will be much more meaningful to you. + + 1.2 Goals of This Textbook + The introductory textbook was meant to take people new to LPC from + knowing nothing to being able to code a nice realm on any LPMud. There + is naturally much more to LPC and to LPMud building, however, than + building rooms, armours, monsters, and weapons. As you get into more + complicated concepts like guilds, or desire to do more involved things with + your realm, you will find the concepts detailed in LPC Basics to be lacking + in support for these projects. Intermediate LPC is designed to take you + beyond the simple realm building process into a full knowledge of LPC for + functioning as a realm builder on an LPMud. The task of mudlib building + itself is left to a later text. After reading this textbook and working through + it by experimenting with actual code, the reader should be able to code game + objects to fit any design or idea they have in mind, so long as I have been + successful. + + 1.3 An Overview + What more is there? Well many of you are quite aware that LPC supports + mappings and arrays and have been asking me why those were not detailed + in LPC Basics. I felt that those concepts were beyond the scope of what I + was trying to do with that textbook and were more fitting to this textbook. + But new tools are all fine and dandy, what matters, however, is what you + can do with those tools. The goal of LPC Basics was to get you to building + quality LPMud realms. Mappings and arrays are not necessary to do that. + The goal of this book is to allow you to code any idea you might want to + code in your area. That ability requires the knowledge of mappings and + arrays. + + Any idea you want to code in an LPMud is possible. LPC is a language + which is amazingly well suited to this task. All that prevents you from + coding your ideas is your knowledge of LPC or an inadequate mudlib or + your mudÕs theme or administrative policies. This textbook cannot make + the mudlib you are working with any better, and it cannot change the mud + theme or the mudÕs administrative policies. Never once think that LPC is + incapable of doing what you want to do. If your idea is prevented by + administrative policies or themes, then it is simply not an idea for your + current mud. If the mudlib is inadequate, talk to the people in charge of + your mudlib about what can be done at the mudlib level to facilitate it. You + would be surprised by what is actually in the mudlib you did not know + about. More important, after reading this textbook, you should be able to + read all of the mudlib code in your mudÕs mudlib and understand what is + going on at each line in the mudlib code. You may not as yet be able to + reproduce that code on your own, but at least you can understand what is + going on at the mudlib level. + + This textbook starts out with a discussion about what the LPMud driver is + doing. One nice thing about this textbook, in general it is completely driver + and mudlib independent (excepting for the Dworkin Game Driver). The + chapter on the game driver does not get into actual implementation, but + instead deals with what all game drivers basically do in order to run the + mud. + + Next I discuss those magic topics everyone wants to know more about, + arrays and mappings. Mappings may be simultaneously the easiest and + most difficult data type to understand. Since they are sort of complex arrays + in a loose sense, you really need to understand arrays before discussing + them. All the same, once you understand them, they are much easier than + arrays to use in real situations. At any rate, spend most of your time + working with that chapter, because it is probably the most difficult, yet most + useful chapter in the book. + + After that follows a brief chapter on the LPC pre-compiler, a tool you can + use for sorting out how your code will look before it gets sent to the + compiler. Despite my horrid intro to it here, this chapter is perhaps the + easiest chapter in the textbook. I put it after the mappings and arrays + chapter for exactly that reason. + + Strings are re-introduced next, going into more detail with how you can do + such things as advanced command handling by breaking up strings. Once + you understand arrays fairly well, this chapter should be really simple. + + The next chapter is the second most important in the book. It may be the + most important if you ever intend to go beyond the intermediate stage and + dive into mudlib coding. That chapter involves the complex ideas behind + LPC inheritance. Since the goal of this textbook is not to teach mudlib + programming, the chapter is not a detailed discussion on object oriented + programming. Understanding this chapter, however, will give you some + good insights into what is involved with object oriented programming, as + well as allow you to build more complex objects by overriding functions + and defining your own base classes. + + Finally, the textbook ends with a simple discussion of code debugging. + This is not an essential chapter, but instead it is meant as more of an + auxiliary supplement to what the knowledge you have accumulated so far. + + 1.4 Not Appearing in This Textbook + Perhaps what might appear to some as the most glaring omission of this + textbook is largely a political omission, shadows. Never have I ever + encountered an example of where a shadow was either the best or most + effecient manner of doing anything. It does not follow from that, however, + that there are no uses for shadows. My reasoning for omitting shadows + from this textbook is that the learner is best served by learning the concepts + in this textbook first and having spent time with them before dealing with + the subject of shadows. In that way, I feel the person learning LPC will be + better capable of judging the merits of using a shadow down the road. I + will discuss shadows in a future textbook. + + If you are someone who uses shadows some or a lot, please do not take the + above paragraph as a personal attack. There may be some perfectly valid + uses for shadows somewhere which I have yet to encounter. Nevertheless, + they are not the ideal way to accomplish any given task, and therefore they + are not considered for the purposes of this textbook an intermediate coding + tool. + + I have also omitted discussions of security and object oriented + programming. Both are quite obviously mudlib issues. Many people, + however, might take exception with my leaving out a discussion of object + oriented programming. I chose to leave that for a later text, since most area + builders code for the creativity, not for the computer science theory. In both + the intermediate and beginner textbooks, I have chosen only to discuss + theory where it is directly applicable to practical LPC programming. For + people who are starting out green in LPC and want to code the next great + mudlib, perhaps theory would be more useful. But for the purposes of this + book, a discussion of object oriented programming is simply a snoozer. I + do plan to get heavy into theory with the next textbook. + + 1.5 Summary + LPC is not difficult to learn. It is a language which, although pathetic + compared to any other language for performing most computer language + tasks, is incredibly powerful and unequalled for the tasks of building an + area in MUD type games. For the beginner, it allows you to easily jump in + and code useful objects without even knowing what you are doing. For the + intermediate person, it allows you to turn any idea you have into textual + virtual reality. And for the advanced person, itÕs object oriented features + can allow you to build one of the most popular games on the internet. What + you can do is simply limited by how much you know. And learning more + does not require a computer science degree. + + Copyright (c) George Reese 1993 diff -c -r --new-file ds1.1/lib/doc/lpc/intermediate/chapter2 ds2.0r27/lib/doc/lpc/intermediate/chapter2 *** ds1.1/lib/doc/lpc/intermediate/chapter2 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/intermediate/chapter2 Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,223 ---- + Intermediate LPC + Descartes of Borg + Novermber 1993 + + Chapter 2: The LPMud Driver + + 2.1 Review of Basic Driver/Mudlib Interaction + In the LPC Basics textbook, you learned a lot about the way the mudlib + works, specifically in relation to objects you code in order to build your + realm. Not much was discussed about the interaction between the + mudlib and the driver. You should know, however, that the driver + does the following: + 1) When an object is first loaded into memory, the driver will call + create() in native muds and reset() in compat muds. A creator + uses create() or reset() to give initial values to the object. + 2) At an interval setup by the game administrator, the driver calls the + function reset(). This allows the object to regenerate monsters and + such. Notice that in a compat mud, the same function is used to set up + initial values as is used to reset the room. + 3) Any time a living object comes in contact with an object of any sort, + the driver calls init() in the newly encountered object. This allows + newly encountered objects to give living objects commands to execute + through the add_action() efun, as well as perform other actions which + should happen whenever a living thing encounters a given object. + 4) The driver defines a set of functions known as efuns which are + available to all objects in the game. Examples of commonly used efuns + are: this_player(), this_object(), write(), say(), etc. + + 2.2 The Driver Cycle + The driver is a C program which runs the game. Its basic functions are + to accept connections from the outside world so people can login, + interpret the LPC code which defines LPC objects and how they + function in the game, and accept user input and call the appropriate LPC + functions which match the event. In its most simplest essence, it is an + unending loop. + + Once the game has booted up and is properly functioning (the boot up + process will be discussed in a future, advanced LPC textbook), the + driver enters a loop which does not terminate until the shutdown() efun + is legally called or a bug causes the driver program to crash. First off, + the driver handles any new incoming connections and passes control of + the connection to a login object. After that, the driver puts together a + table of commands which have been entered by users since the last cycle + of the driver. After the command table is assembled, all messages + scheduled to be sent to the connection from the last driver cycle are sent + out to the user. At this point, the driver goes through the table of + commands to be executed and executes each set of commands each + object has stored there. The driver ends its cycle by calling the function + heart_beat() in every object with a heart_beat() set and finally + performing all pending call outs. This chapter will not deal with the + handling of connections, but instead will focus on how the driver + handles user commands and heartbeats and call outs. + + 2.3 User Commands + As noted in section 1.2, the driver stores a list of commands for each + user to be executed each cycle. The commands list has the name of the + living object performing the command, the object which gave the living + object that command, and the function which is to be executed in order + to perform the command. The driver refers to the object which typed in + the command as the command giver. It is the command giver which + gets returned as this_player() in most cases. + + The driver starts at the top of the list of living objects with pending + commands, and successively performs each command it typed by calling + the function associated with the command and passing any arguments + the command giver gave as arguments to the function. As the driver + starts with the commands issued by a new living object, the command + giver variable is changed to be equal to the new living object, so that + during the sequence of functions initiated by that command, the efun + this_player() returns the object which issued the command. + + Let's look at the command buffer for an example player. Since the + execution of his last command, Bozo has typed "north" and "tell + descartes when is the next reboot". The command "north" is associated + with the function "Do_Move()" in the room Bozo is in (the command + "north" is automatically setup by the SetExits() efun in that room). The + command "tell" is not specifically listed as a command for the player, + however, in the player object there is a function called "cmd_hook()" + which is associated with the command "", which matches any possible + user input. + + Once the driver gets down to Bozo, the command giver variable is set to + the object which is Bozo. Then, seeing Bozo typed "north" and the + function "north" is associated with, the driver calls Bozo's_Room- + >Do_Move(0). An argument of 0 is passed to the function since Bozo + only typed the command "north" with no arguments. The room + naturally calls some functions it needs, all the while such that the efun + this_player() returns the object which is Bozo. Eventually, the room + object will call eventMoveLiving() in Bozo, which in turn calls the + move_object() efun. This efun is responsible for changing an object's + environment. + + When the environment of an object changes, the commands available to + it from objects in its previous environment as well as from its previous + environment are removed from the object. Once that is done, the driver + calls the efun init() in the new environment as well as in each object in + the new environment. During each of these calls to init(), the object + Bozo is still the command giver. Thus all add_action() efuns from this + move will apply to Bozo. Once all those calls are done, control passes + back from the move_object() efun to the eventMoveLiving() lfun in Bozo. + eventMoveLiving() returns control back to Do_Move() in the old room, + which returns 1 to signify to the driver that the command action was + successful. If the Do_Move() function had returned 0 for some reason, + the driver would have written "What?" (or whatever your driver's + default bad command message is) to Bozo. + + Once the first command returns 1, the driver proceeds on to Bozo's + second command, following much the same structure. Note that with + "tell descartes when is the next reboot", the driver passes "descartes + when is the next reboot" to the function associated with tell. That + function in turn has to decide what to do with that argument. After that + command returns either 1 or 0, the driver then proceeds on to the next + living object with commands pending, and so on until all living objects + with pending commands have had their commands performed. + + 2.4 The Efuns set_heart_beat() and call_out() + Once all commands are performed for objects with commands pending, + the driver then proceeds to call the heart_beat() function in all objects + listed with the driver as having heartbeats. Whenever an object calls the + efun set_heart_beat() with a non-zero argument (depending on your + driver, what non-zero number may be important, but in most cases you + call it with the int 1). The efun set_heart_beat() adds the object which + calls set_heart_beat() to the list of objects with heartbeats. If you call it + with an argument of 0, then it removes the object from the list of objects + with heartbeats. + + The most common use for heartbeats in the mudlib is to heal players and + monsters and perform combat. Once the driver has finished dealing with + the command list, it goes through the heartbeat list calling heart_beat() in + each object in the list. So for a player, for example, the driver will call + heart_beat() in the player which will: + 1) age the player + 2) heal the player according to a heal rate + 3) check to see if there are any hunted, hunting, or attacking objects + around + 4) perform an attack if step 3 returns true. + 5) any other things which need to happen automatically roughly every + second + + Note that the more objects which have heartbeats, the more processing + which has to happen every cycle the mud is up. Objects with heartbeats + are thus known as the major hog of CPU time on muds. + + The call_out() efun is used to perform timed function calls which do not + need to happen as often as heartbeats, or which just happen once. Call + outs let you specify the function in an object you want called. The + general formula for call outs is: + call_out(func, time, args); + The third argument specifying arguments is optional. The first argument + is a string representing the name of the function to be called. The second + argument is how many seconds should pass before the function gets + called. + + Practically speaking, when an object calls call_out(), it is added to a list + of objects with pending call outs with the amount of time of the call out + and the name of the function to be called. Each cycle of the driver, the + time is counted down until it becomes time for the function to be called. + When the time comes, the driver removes the object from the list of + objects with pending call outs and performs the call to the call out + function, passing any special args originally specified by the call out + function. + + If you want a to remove a pending call before it occurs, you need to use + the remove_call_out() efun, passing the name of the function being + called out. The driver will remove the next pending call out to that + function. This means you may have some ambiguity if more than one + call out is pending for the same function. + + In order to make a call out cyclical, you must reissue the call_out() efun + in the function you called out, since the driver automatically removes the + function from the call out table when a call out is performed. Example: + + void foo() { call_out("hello", 10); } + + void hello() { call_out("hello", 10); } + + will set up hello() to be called every 10 seconds after foo() is first called. + There are several things to be careful about here. First, you must watch + to make sure you do not structure your call outs to be recursive in any + unintended fashion. Second, compare what a set_heart_beat() does + when compared directly to what call_out() does. + + set_heart_beat(): + a) Adds this_object() to a table listing objects with heartbeats. + b) The function heart_beat() in this_object() gets called every single + driver cycle. + + call_out(): + a) Adds this_object(), the name of a function in this_object(), a time + delay, and a set of arguments to a table listing functions with pending + call outs. + b) The function named is called only once, and that call comes after the + specified delay. + + As you can see, there is a much greater memory overhead associated + with call outs for part (a), yet that there is a much greater CPU overhead + associated with heartbeats as shown in part (b), assuming that the delay + for the call out is greater than a single driver cycle. + + Clearly, you do not want to be issuing 1 second call outs, for then you + get the worst of both worlds. Similarly, you do not want to be having + heart beats in objects that can perform the same functions with call outs + of a greater duration than 1 second. I personally have heard much talk + about at what point you should use a call out over a heartbeat. What I + have mostly heard is that for single calls or for cycles of a duration + greater than 10 seconds, it is best to use a call out. For repetitive calls of + durations less than 10 seconds, you are better off using heartbeats. I do + not know if this is true, but I do not think following this can do any + harm. + + 2.5 Summary + Basic to a more in depth understanding of LPC is and understanding of + the way in which the driver interacts with the mudlib. You should now + understand the order in which the driver performs functions, as well as a + more detailed knowledge of the efuns this_player(), add_action(), and + move_object() and the lfun init(). In addition to this building upon + knowledge you got from the LPC Basics textbook, this chapter has + introduced call outs and heartbeats and the manner in which the driver + handles them. You should now have a basic understanding of call outs + and heartbeats such that you can experiment with them in your realm + code. + + Copyright (c) George Reese 1993 diff -c -r --new-file ds1.1/lib/doc/lpc/intermediate/chapter3 ds2.0r27/lib/doc/lpc/intermediate/chapter3 *** ds1.1/lib/doc/lpc/intermediate/chapter3 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/intermediate/chapter3 Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,476 ---- + Intermediate LPC + Descartes of Borg + November 1993 + + Chapter 3: Complex Data Types + + 3.1 Simple Data Types + In the textbook LPC Basics, you learned about the common, basic LPC + data types: int, string, object, void. Most important you learned that + many operations and functions behave differently based on the data type + of the variables upon which they are operating. Some operators and + functions will even give errors if you use them with the wrong data + types. For example, "a"+"b" is handled much differently than 1+1. + When you ass "a"+"b", you are adding "b" onto the end of "a" to get + "ab". On the other hand, when you add 1+1, you do not get 11, you get + 2 as you would expect. + + I refer to these data types as simple data types, because they atomic in + that they cannot be broken down into smaller component data types. + The object data type is a sort of exception, but you really cannot refer + individually to the components which make it up, so I refer to it as a + simple data type. + + This chapter introduces the concept of the complex data type, a data type + which is made up of units of simple data types. LPC has two common + complex data types, both kinds of arrays. First, there is the traditional + array which stores values in consecutive elements accessed by a number + representing which element they are stored in. Second is an associative + array called a mapping. A mapping associates to values together to + allow a more natural access to data. + + 3.2 The Values NULL and 0 + Before getting fully into arrays, there first should be a full understanding + of the concept of NULL versus the concept of 0. In LPC, a null value is + represented by the integer 0. Although the integer 0 and NULL are often + freely interchangeable, this interchangeability often leads to some great + confusion when you get into the realm of complex data types. You may + have even encountered such confusion while using strings. + + 0 represents a value which for integers means the value you add to + another value yet still retain the value added. This for any addition + operation on any data type, the ZERO value for that data type is the value + that you can add to any other value and get the original value. Thus: A + plus ZERO equals A where A is some value of a given data type and + ZERO is the ZERO value for that data type. This is not any sort of + official mathematical definition. There exists one, but I am not a + mathematician, so I have no idea what the term is. Thus for integers, 0 + is the ZERO value since 1 + 0 equals 1. + + NULL, on the other hand, is the absence of any value or meaning. The + LPC driver will interpret NULL as an integer 0 if it can make sense of it + in that context. In any context besides integer addition, A plus NULL + causes an error. NULL causes an error because adding valueless fields + in other data types to those data types makes no sense. + + Looking at this from another point of view, we can get the ZERO value + for strings by knowing what added to "a" will give us "a" as a result. + The answer is not 0, but instead "". With integers, interchanging NULL + and 0 was acceptable since 0 represents no value with respect to the + integer data type. This interchangeability is not true for other data types, + since their ZERO values do not represent no value. Namely, "" + represents a string of no length and is very different from 0. + + When you first declare any variable of any type, it has no value. Any + data type except integers therefore must be initialized somehow before + you perform any operation on it. Generally, initialization is done in the + create() function for global variables, or at the top of the local function + for local variables by assigning them some value, often the ZERO value + for that data type. For example, in the following code I want to build a + string with random words: + + string build_nonsense() { + string str; + int i; + + str = ""; /* Here str is initialized to the string + ZERO value */ + for(i=0; i<6; i++) { + switch(random(3)+1) { + case 1: str += "bing"; break; + case 2: str += "borg"; break; + case 3: str += "foo"; break; + } + if(i==5) str += ".\n"; + else str += " "; + } + return capitalize(str); + } + + If we had not initialized the variable str, an error would have resulted + from trying to add a string to a NULL value. Instead, this code first + initializes str to the ZERO value for strings, "". After that, it enters a + loop which makes 6 cycles, each time randomly adding one of three + possible words to the string. For all words except the last, an additional + blank character is added. For the last word, a period and a return + character are added. The function then exits the loop, capitalizes the + nonsense string, then exits. + + 3.3 Arrays in LPC + An array is a powerful complex data type of LPC which allows you to + access multiple values through a single variable. For instance, + Nightmare has an indefinite number of currencies in which players may + do business. Only five of those currencies, however, can be considered + hard currencies. A hard currency for the sake of this example is a + currency which is readily exchangeable for any other hard currency, + whereas a soft currency may only be bought, but not sold. In the bank, + there is a list of hard currencies to allow bank keepers to know which + currencies are in fact hard currencies. With simple data types, we would + have to perform the following nasty operation for every exchange + transaction: + + int exchange(string str) { + string from, to; + int amt; + + if(!str) return 0; + if(sscanf(str, "%d %s for %s", amt, from, to) != 3) + return 0; + if(from != "platinum" && from != "gold" && from != + "silver" && + from != "electrum" && from != "copper") { + notify_fail("We do not buy soft currencies!\n"); + return 0; + } + ... + } + + With five hard currencies, we have a rather simple example. After all it + took only two lines of code to represent the if statement which filtered + out bad currencies. But what if you had to check against all the names + which cannot be used to make characters in the game? There might be + 100 of those; would you want to write a 100 part if statement? + What if you wanted to add a currency to the list of hard currencies? That + means you would have to change every check in the game for hard + currencies to add one more part to the if clauses. Arrays allow you + simple access to groups of related data so that you do not have to deal + with each individual value every time you want to perform a group + operation. + + As a constant, an array might look like this: + ({ "platinum", "gold", "silver", "electrum", "copper" }) + which is an array of type string. Individual data values in arrays are + called elements, or sometimes members. In code, just as constant + strings are represented by surrounding them with "", constant arrays are + represented by being surrounded by ({ }), with individual elements of + the array being separated by a ,. + + You may have arrays of any LPC data type, simple or complex. Arrays + made up of mixes of values are called arrays of mixed type. In most + LPC drivers, you declare an array using a throw-back to C language + syntax for arrays. This syntax is often confusing for LPC coders + because the syntax has a meaning in C that simply does not translate into + LPC. Nevertheless, if we wanted an array of type string, we would + declare it in the following manner: + + string *arr; + + In other words, the data type of the elements it will contain followed by + a space and an asterisk. Remember, however, that this newly declared + string array has a NULL value in it at the time of declaration. + + 3.4 Using Arrays + You now should understand how to declare and recognize an array in + code. In order to understand how they work in code, let's review the + bank code, this time using arrays: + + string *hard_currencies; + + int exchange(string str) { + string from, to; + int amt; + + if(!str) return 0; + if(sscanf(str, "%d %s for %s", amt, from, to) != 3) + return 0; + if(member_array(from, hard_currencies) == -1) { + notify_fail("We do not buy soft currencies!\n"); + return 0; + } + ... + } + + This code assumes hard_currencies is a global variable and is initialized + in create() as: + hard_currencies = ({ "platinum", "gold", "electrum", "silver", + "copper" }); + Ideally, you would have hard currencies as a #define in a header file for + all objects to use, but #define is a topic for a later chapter. + + Once you know what the member_array() efun does, this method + certainly is much easier to read as well as is much more efficient and + easier to code. In fact, you can probably guess what the + member_array() efun does: It tells you if a given value is a member of + the array in question. Specifically here, we want to know if the currency + the player is trying to sell is an element in the hard_curencies array. + What might be confusing to you is, not only does member_array() tell us + if the value is an element in the array, but it in fact tells us which element + of the array the value is. + + How does it tell you which element? It is easier to understand arrays if + you think of the array variable as holding a number. In the value above, + for the sake of argument, we will say that hard_currencies holds the + value 179000. This value tells the driver where to look for the array + hard_currencies represents. Thus, hard_currencies points to a place + where the array values may be found. When someone is talking about + the first element of the array, they want the element located at 179000. + When the object needs the value of the second element of the array, it + looks at 179000 + one value, then 179000 plus two values for the third, + and so on. We can therefore access individual elements of an array by + their index, which is the number of values beyond the starting point of + the array we need to look to find the value. For the array + hard_currencies array: + "platinum" has an index of 0. + "gold" has an index of 1. + "electrum" has an index of 2. + "silver" has an index of 3. + "copper" has an index of 4. + + The efun member_array() thus returns the index of the element being + tested if it is in the array, or -1 if it is not in the array. In order to + reference an individual element in an array, you use its index number in + the following manner: + array_name[index_no] + Example: + hard_currencies[3] + where hard_currencies[3] would refer to "silver". + + So, you now should now several ways in which arrays appear either as + a whole or as individual elements. As a whole, you refer to an array + variable by its name and an array constant by enclosing the array in ({ }) + and separating elements by ,. Individually, you refer to array variables + by the array name followed by the element's index number enclosed in + [], and to array constants in the same way you would refer to simple data + types of the same type as the constant. Examples: + + Whole arrays: + variable: arr + constant: ({ "platinum", "gold", "electrum", "silver", "copper" }) + + Individual members of arrays: + variable: arr[2] + constant: "electrum" + + You can use these means of reference to do all the things you are used to + doing with other data types. You can assign values, use the values in + operations, pass the values as parameters to functions, and use the + values as return types. It is important to remember that when you are + treating an element alone as an individual, the individual element is not + itself an array (unless you are dealing with an array of arrays). In the + example above, the individual elements are strings. So that: + str = arr[3] + " and " + arr[1]; + will create str to equal "silver and gold". Although this seems simple + enough, many people new to arrays start to run into trouble when trying + to add elements to an array. When you are treating an array as a whole + and you wish to add a new element to it, you must do it by adding + another array. + + Note the following example: + string str1, str2; + string *arr; + + str1 = "hi"; + str2 = "bye"; + /* str1 + str2 equals "hibye" */ + arr = ({ str1 }) + ({ str2 }); + /* arr is equal to ({ str1, str2 }) */ + Before going any further, I have to note that this example gives an + extremely horrible way of building an array. You should set it: arr = ({ + str1, str2 }). The point of the example, however, is that you must add + like types together. If you try adding an element to an array as the data + type it is, you will get an error. Instead you have to treat it as an array of + a single element. + + 3.5 Mappings + One of the major advances made in LPMuds since they were created is + the mapping data type. People alternately refer to them as associative + arrays. Practically speaking, a mapping allows you freedom from the + association of a numerical index to a value which arrays require. + Instead, mappings allow you to associate values with indices which + actually have meaning to you, much like a relational database. + + In an array of 5 elements, you access those values solely by their integer + indices which cover the range 0 to 4. Imagine going back to the example + of money again. Players have money of different amounts and different + types. In the player object, you need a way to store the types of money + that exist as well as relate them to the amount of that currency type the + player has. The best way to do this with arrays would have been to + store an array of strings representing money types and an array of + integers representing values in the player object. This would result in + CPU-eating ugly code like this: + + int query_money(string type) { + int i; + + i = member_array(type, currencies); + if(i>-1 && i < sizeof(amounts)) /* sizeof efun + returns # of elements */ + return amounts[i]; + else return 0; + } + + And that is a simple query function. Look at an add function: + + void add_money(string type, int amt) { + string *tmp1; + int * tmp2; + int i, x, j, maxj; + + i = member_array(type, currencies); + if(i >= sizeof(amounts)) /* corrupt data, we are in + a bad way */ + return; + else if(i== -1) { + currencies += ({ type }); + amounts += ({ amt }); + return; + } + else { + amounts[i] += amt; + if(amounts[i] < 1) { + tmp1 = allocate(sizeof(currencies)-1); + tmp2 = allocate(sizeof(amounts)-1); + for(j=0, x =0, maxj=sizeof(tmp1); j < maxj; + j++) { + if(j==i) x = 1; + tmp1[j] = currencies[j+x]; + tmp2[j] = amounts[j+x]; + } + currencies = tmp1; + amounts = tmp2; + } + } + } + + That is really some nasty code to perform the rather simple concept of + adding some money. First, we figure out if the player has any of that + kind of money, and if so, which element of the currencies array it is. + After that, we have to check to see that the integrity of the currency data + has been maintained. If the index of the type in the currencies array is + greater than the highest index of the amounts array, then we have a + problem since the indices are our only way of relating the two arrays. + Once we know our data is in tact, if the currency type is not currently + held by the player, we simply tack on the type as a new element to the + currencies array and the amount as a new element to the amounts array. + Finally, if it is a currency the player currently has, we just add the + amount to the corresponding index in the amounts array. If the money + gets below 1, meaning having no money of that type, we want to clear + the currency out of memory. + + Subtracting an element from an array is no simple matter. Take, for + example, the result of the following: + + string *arr; + + arr = ({ "a", "b", "a" }); + arr -= ({ arr[2] }); + + What do you think the final value of arr is? Well, it is: + ({ "b", "a" }) + Subtracting arr[2] from the original array does not remove the third + element from the array. Instead, it subtracts the value of the third + element of the array from the array. And array subtraction removes the + first instance of the value from the array. Since we do not want to be + forced on counting on the elements of the array as being unique, we are + forced to go through some somersaults to remove the correct element + from both arrays in order to maintain the correspondence of the indices + in the two arrays. + + Mappings provide a better way. They allow you to directly associate the + money type with its value. Some people think of mappings as arrays + where you are not restricted to integers as indices. Truth is, mappings + are an entirely different concept in storing aggregate information. Arrays + force you to choose an index which is meaningful to the machine for + locating the appropriate data. The indices tell the machine how many + elements beyond the first value the value you desire can be found. With + mappings, you choose indices which are meaningful to you without + worrying about how that machine locates and stores it. + + You may recognize mappings in the following forms: + + constant values: + whole: ([ index:value, index:value ]) Ex: ([ "gold":10, "silver":20 ]) + element: 10 + + variable values: + whole: map (where map is the name of a mapping variable) + element: map["gold"] + + So now my monetary functions would look like: + + int query_money(string type) { return money[type]; } + + void add_money(string type, int amt) { + if(!money[type]) money[type] = amt; + else money[type] += amt; + if(money[type] < 1) + map_delete(money, type); /* this is for + MudOS */ + ...OR... + money = m_delete(money, type) /* for some + LPMud 3.* varieties */ + ... OR... + m_delete(money, type); /* for other LPMud 3.* + varieties */ + } + + Please notice first that the efuns for clearing a mapping element from the + mapping vary from driver to driver. Check with your driver's + documentation for the exact name an syntax of the relevant efun. + + As you can see immediately, you do not need to check the integrity of + your data since the values which interest you are inextricably bound to + one another in the mapping. Secondly, getting rid of useless values is a + simple efun call rather than a tricky, CPU-eating loop. Finally, the + query function is made up solely of a return instruction. + + You must declare and initialize any mapping before using it. + Declarations look like: + mapping map; + Whereas common initializations look like: + map = ([]); + map = allocate_mapping(10) ...OR... map = m_allocate(10); + map = ([ "gold": 20, "silver": 15 ]); + + As with other data types, there are rules defining how they work in + common operations like addition and subtraction: + ([ "gold":20, "silver":30 ]) + ([ "electrum":5 ]) + gives: + (["gold":20, "silver":30, "electrum":5]) + Although my demonstration shows a continuity of order, there is in fact + no guarantee of the order in which elements of mappings will stored. + Equivalence tests among mappings are therefore not a good thing. + + 3.6 Summary + Mappings and arrays can be built as complex as you need them to be. + You can have an array of mappings of arrays. Such a thing would be + declared like this: + + mapping *map_of_arrs; + which might look like: + ({ ([ ind1: ({ valA1, valA2}), ind2: ({valB1, valB2}) ]), ([ indX: + ({valX1,valX2}) ]) }) + + Mappings may use any data type as an index, including objects. + Mapping indices are often referred to as keys as well, a term from + databases. Always keep in mind that with any non-integer data type, + you must first initialize a variable before making use of it in common + operations such as addition and subtraction. In spite of the ease and + dynamics added to LPC coding by mappings and arrays, errors caused + by failing to initialize their values can be the most maddening experience + for people new to these data types. I would venture that a very high + percentage of all errors people experimenting with mappings and arrays + for the first time encounter are one of three error messages: + Indexing on illegal type. + Illegal index. + Bad argument 1 to (+ += - -=) /* insert your favourite operator */ + Error messages 1 and 3 are darn near almost always caused by a failure + to initialize the array or mapping in question. Error message 2 is caused + generally when you are trying to use an index in an initialized array + which does not exist. Also, for arrays, often people new to arrays will + get error message 3 because they try to add a single element to an array + by adding the initial array to the single element value instead of adding + an array of the single element to the initial array. Remember, add only + arrays to arrays. + + At this point, you should feel comfortable enough with mappings and + arrays to play with them. Expect to encounter the above error messages + a lot when first playing with these. The key to success with mappings is + in debugging all of these errors and seeing exactly what causes wholes + in your programming which allow you to try to work with uninitialized + mappings and arrays. Finally, go back through the basic room code and + look at things like the SetExits() (or the equivalent on your mudlib) + function. Chances are it makes use of mappings. In some instances, it + will use arrays as well for compatibility with mudlib.n. + + Copyright (c) George Reese 1993 diff -c -r --new-file ds1.1/lib/doc/lpc/intermediate/chapter4 ds2.0r27/lib/doc/lpc/intermediate/chapter4 *** ds1.1/lib/doc/lpc/intermediate/chapter4 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/intermediate/chapter4 Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,182 ---- + Intermediate LPC + Descartes of Borg + November 1993 + + Chapter 4: The LPC Pre-Compiler + + 4.1 Review + The previous chapter was quite heavy, so now I will slow down a bit so + you can digest and play with mappings and arrays by taking on the + rather simple topic of the LPC pre-compiler. By this point, however, + you should well understand how the driver interacts with the mudlib and + be able to code objects which use call outs and heart beats. In addition, + you should be coding simple objects which use mappings and arrays, + noting how these data types perform in objects. It is also a good idea to + start looking in detail at the actual mudlib code that makes up your mud. + See if you understand everything which is going on in your mudlibs + room and monster codes. For things you do not understand, ask the + people on your mud designated to answer creator coding questions. + + Pre-compiler is actually a bit of a misnomer since LPC code is never + truly compiled. Although this is changing with prototypes of newer + LPC drivers, LPC drivers interpret the LPC code written by creators + rather than compile it into binary format. Nevertheless, the LPC pre- + compiler functions still perform much like pre-compilers for compiled + languages in that pre-compiler directives are interpreted before the driver + even starts to look at object code. + + 4.2 Pre-compiler Directives + If you do not know what a pre-compiler is, you really do not need to + worry. With respect to LPC, it is basically a process which happens + before the driver begins to interpret LPC code which allows you to + perform actions upon the entire code found in your file. Since the code + is not yet interpreted, the pre-compiler process is involved before the file + exists as an object and before any LPC functions or instructions are ever + examined. The pre-compiler is thus working at the file level, meaning + that it does not deal with any code in inherited files. + + The pre-compiler searches a file sent to it for pre-compiler directives. + These are little instructions in the file meant only for the pre-compiler + and are not really part of the LPC language. A pre-compiler directive is + any line in a file beginning with a pound (#) sign. Pre-compiler + directives are generally used to construct what the final code of a file will + look at. The most common pre-compiler directives are: + + #define + #undefine + #include + #ifdef + #ifndef + #if + #elseif + #else + #endif + #pragma + + Most realm coders on muds use exclusively the directives #define and + #include. The other directives you may see often and should understand + what they mean even if you never use them. + + The first pair of directives are: + #define + #undefine + + The #define directive sets up a set of characters which will be replaced + any where they exist in the code at precompiler time with their definition. + For example, take: + + #define OB_USER "/std/user" + + This directive has the pre-compiler search the entire file for instances of + OB_USER. Everywhere it sees OB_USER, it replaces with "/std/user". + Note that it does not make OB_USER a variable in the code. The LPC + interpreter never sees the OB_USER label. As stated above, the pre- + compiler is a process which takes place before code interpretation. So + what you wrote as: + + #define OB_USER "/std/user" + + void create() { + if(!file_exists(OB_USER+".c")) write("Merde! No user file!"); + else write("Good! User file still exists!"); + } + + would arrive at the LPC interpreter as: + + void create() { + if(!file_exists("/std/user"+".c")) write("Merde! No user file!"); + else write("Good! User file still exists!"); + } + + Simply put, #define just literally replaces the defined label with whatever + follows it. You may also use #define in a special instance where no + value follows. This is called a binary definition. For example: + + #define __NIGHTMARE + + exists in the config file for the Nightmare Mudlib. This allows for pre- + compiler tests which will be described later in the chapter. + + The other pre-compiler directive you are likely to use often is #include. + As the name implies, #include includes the contents of another file right + into the file being pre-compiled at the point in the file where the directive + is placed. Files made for inclusion into other files are often called header + files. They sometimes contain things like #define directives used by + multiple files and function declarations for the file. The traditional file + extension to header files is .h. + + Include directives follow one of 2 syntax's: + + #include <filename> + #include "filename" + + If you give the absolute name of the file, then which syntax you use is + irrelevant. How you enclose the file name determines how the pre- + compiler searches for the header files. The pre-compiler first searches in + system include directories for files enclosed in <>. For files enclosed in + "", the pre-compiler begins its search in the same directory as the file + going through the pre-compiler. Either way, the pre-compiler will + search the system include directories and the directory of the file for the + header file before giving up. The syntax simply determines the order. + + The simplest pre-compiler directive is the #pragma directive. It is + doubtful you will ever use this one. Basically, you follow the directive + with some keyword which is meaningful to your driver. The only + keyword I have ever seen is strict_types, which simply lets the driver + know you want this file interpreted with strict data typing. I doubt you + will ever need to use this, and you may never even see it. I just included + it in the list in the event you do see it so you do not think it is doing + anything truly meaningful. + + The final group of pre-compiler directives are the conditional pre- + compiler directives. They allow you to pre-compile the file one way + given the truth value of an expression, otherwise pre-compile the file + another way. This is mostly useful for making code portable among + mudlibs, since putting the m_delete() efun in code on a MudOS mud + would normally cause an error, for example. So you might write the + following: + + #ifdef MUDOS + map_delete(map, key); + #else + map = m_delete(map, key); + #endif + + which after being passed through the pre-compiler will appear to the + interpreter as: + + map_delete(map, key); + + on a MudOS mud, and: + + map = m_delete(map, key); + + on other muds. The interpreter never sees the function call that would + cause it to spam out in error. + + Notice that my example made use of a binary definition as described + above. Binary definitions allow you to pass certain code to the + interpreter based on what driver or mudlib you are using, among other + conditions. + + 4.3 Summary + The pre-compiler is a useful LPC tool for maintaining modularity among + your programs. When you have values that might be subject to change, + but are used widely throughout your files, you might stick all of those + values in a header file as #define statements so that any need to make a + future change will cause you to need to change just the #define directive. + A very good example of where this would be useful would be a header + file called money.h which includes the directive: + #define HARD_CURRENCIES ({ "gold", "platinum", "silver", + "electrum", "copper" }) + so that if ever you wanted to add a new hard currency, you only need + change this directive in order to update all files needing to know what the + hard currencies are. + + The LPC pre-compiler also allows you to write code which can be + ported without change among different mudlibs and drivers. Finally, + you should be aware that the pre-compiler only accepts lines ending in + carriage returns. If you want a multiple line pre-compiler directive, you + need to end each incomplete line with a backslash(\). + + Copyright (c) George Reese 1993 diff -c -r --new-file ds1.1/lib/doc/lpc/intermediate/chapter5 ds2.0r27/lib/doc/lpc/intermediate/chapter5 *** ds1.1/lib/doc/lpc/intermediate/chapter5 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/intermediate/chapter5 Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,181 ---- + Intermediate LPC + Descartes of Borg + November 1993 + + Chapter 5: Advanced String Handling + + 5.1 What a String Is + The LPC Basics textbook taught strings as simple data types. LPC + generally deals with strings in such a matter. The underlying driver + program, however, is written in C, which has no string data type. The + driver in fact sees strings as a complex data type made up of an array of + characters, a simple C data type. LPC, on the other hand does not + recognize a character data type (there may actually be a driver or two out + there which do recognize the character as a data type, but in general not). + The net effect is that there are some array-like things you can do with + strings that you cannot do with other LPC data types. + + The first efun regarding strings you should learn is the strlen() efun. + This efun returns the length in characters of an LPC string, and is thus + the string equivalent to sizeof() for arrays. Just from the behaviour of + this efun, you can see that the driver treats a string as if it were made up + of smaller elements. In this chapter, you will learn how to deal with + strings on a more basic level, as characters and sub strings. + + 5.2 Strings as Character Arrays + You can do nearly anything with strings that you can do with arrays, + except assign values on a character basis. At the most basic, you can + actually refer to character constants by enclosing them in '' (single + quotes). 'a' and "a" are therefore very different things in LPC. 'a' + represents a character which cannot be used in assignment statements or + any other operations except comparison evaluations. "a" on the other + hand is a string made up of a single character. You can add and subtract + other strings to it and assign it as a value to a variable. + + With string variables, you can access the individual characters to run + comparisons against character constants using exactly the same syntax + that is used with arrays. In other words, the statement: + if(str[2] == 'a') + is a valid LPC statement comparing the second character in the str string + to the character 'a'. You have to be very careful that you are not + comparing elements of arrays to characters, nor are you comparing + characters of strings to strings. + + LPC also allows you to access several characters together using LPC's + range operator ..: + if(str[0..1] == "ab") + In other words, you can look for the string which is formed by the + characters 0 through 1 in the string str. As with arrays, you must be + careful when using indexing or range operators so that you do not try to + reference an index number larger than the last index. Doing so will + result in an error. + + Now you can see a couple of similarities between strings and arrays: + 1) You may index on both to access the values of individual elements. + a) The individual elements of strings are characters + b) The individual elements of arrays match the data type of the + array. + 2) You may operate on a range of values + a) Ex: "abcdef"[1..3] is the string "bcd" + b) Ex: ({ 1, 2, 3, 4, 5 })[1..3] is the int array ({ 2, 3, 4 }) + + And of course, you should always keep in mind the fundamental + difference: a string is not made up of a more fundamental LPC data type. + In other words, you may not act on the individual characters by + assigning them values. + + 5.3 The Efun sscanf() + You cannot do any decent string handling in LPC without using + sscanf(). Without it, you are left trying to play with the full strings + passed by command statements to the command functions. In other + words, you could not handle a command like: "give sword to leo", since + you would have no way of separating "sword to leo" into its constituent + parts. Commands such as these therefore use this efun in order to use + commands with multiple arguments or to make commands more + "English-like". + + Most people find the manual entries for sscanf() to be rather difficult + reading. The function does not lend itself well to the format used by + manual entries. As I said above, the function is used to take a string and + break it into usable parts. Technically it is supposed to take a string and + scan it into one or more variables of varying types. Take the example + above: + + int give(string str) { + string what, whom; + + if(!str) return notify_fail("Give what to whom?\n"); + if(sscanf(str, "%s to %s", what, whom) != 2) + return notify_fail("Give what to whom?\n"); + ... rest of give code ... + } + + The efun sscanf() takes three or more arguments. The first argument is + the string you want scanned. The second argument is called a control + string. The control string is a model which demonstrates in what form + the original string is written, and how it should be divided up. The rest + of the arguments are variables to which you will assign values based + upon the control string. + + The control string is made up of three different types of elements: 1) + constants, 2) variable arguments to be scanned, and 3) variable + arguments to be discarded. You must have as many of the variable + arguments in sscanf() as you have elements of type 2 in your control + string. In the above example, the control string was "%s to %s", which + is a three element control string made up of one constant part (" to "), + and two variable arguments to be scanned ("%s"). There were no + variables to be discarded. + + The control string basically indicates that the function should find the + string " to " in the string str. Whatever comes before that constant will + be placed into the first variable argument as a string. The same thing + will happen to whatever comes after the constant. + + Variable elements are noted by a "%" sign followed by a code for + decoding them. If the variable element is to be discarded, the "%" sign + is followed by the "*" as well as the code for decoding the variable. + Common codes for variable element decoding are "s" for strings and "d" + for integers. In addition, your mudlib may support other conversion + codes, such as "f" for float. So in the two examples above, the "%s" in + the control string indicates that whatever lies in the original string in the + corresponding place will be scanned into a new variable as a string. + + A simple exercise. How would you turn the string "145" into an + integer? + + Answer: + int x; + sscanf("145", "%d", x); + + After the sscanf() function, x will equal the integer 145. + + Whenever you scan a string against a control string, the function + searches the original string for the first instance of the first constant in + the original string. For example, if your string is "magic attack 100" and + you have the following: + int improve(string str) { + string skill; + int x; + + if(sscanf(str, "%s %d", skill, x) != 2) return 0; + ... + } + you would find that you have come up with the wrong return value for + sscanf() (more on the return values later). The control string, "%s %d", + is made up of to variables to be scanned and one constant. The constant + is " ". So the function searches the original string for the first instance + of " ", placing whatever comes before the " " into skill, and trying to + place whatever comes after the " " into x. This separates "magic attack + 100" into the components "magic" and "attack 100". The function, + however, cannot make heads or tales of "attack 100" as an integer, so it + returns 1, meaning that 1 variable value was successfully scanned + ("magic" into skill). + + Perhaps you guessed from the above examples, but the efun sscanf() + returns an int, which is the number of variables into which values from + the original string were successfully scanned. Some examples with + return values for you to examine: + + sscanf("swo rd descartes", "%s to %s", str1, str2) return: 0 + sscanf("swo rd descartes", "%s %s", str1, str2) return: 2 + sscanf("200 gold to descartes", "%d %s to %s", x, str1, str2) return: 3 + sscanf("200 gold to descartes", "%d %*s to %s", x, str1) return: 2 + where x is an int and str1 and str2 are string + + 5.4 Summary + LPC strings can be thought of as arrays of characters, yet always + keeping in mind that LPC does not have the character data type (with + most, but not all drivers). Since the character is not a true LPC data + type, you cannot act upon individual characters in an LPC string in the + same manner you would act upon different data types. Noticing the + intimate relationship between strings and arrays nevertheless makes it + easier to understand such concepts as the range operator and indexing on + strings. + + There are efuns other than sscanf() which involve advanced string + handling, however, they are not needed nearly as often. You should + check on your mud for man or help files on the efuns: explode(), + implode(), replace_string(), sprintf(). All of these are very valuable + tools, especially if you intend to do coding at the mudlib level. + + Copyright (c) George Reese 1993 diff -c -r --new-file ds1.1/lib/doc/lpc/intermediate/chapter6 ds2.0r27/lib/doc/lpc/intermediate/chapter6 *** ds1.1/lib/doc/lpc/intermediate/chapter6 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/intermediate/chapter6 Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,276 ---- + Intermediate LPC + Descartes of Borg + November 1993 + + Chapter 6: Intermediate Inheritance + + 6.1 Basics of Inheritance + In the textbook LPC Basics, you learned how it is the mudlib maintains + consistency amoung mud objects through inheritance. Inheritance + allows the mud administrators to code the basic functions and such that + all mudlib objects, or all mudlib objects of a certain type must have so + that you can concentrate on creating the functions which make these + objects different. When you build a room, or a weapon, or a monster, + you are taking a set of functions already written for you and inheriting + them into your object. In this way, all objects on the mud can count on + other objects to behave in a certain manner. For instance, player objects + can rely on the fact that all room objects will have a function in them + called GetLong() which describes the room. Inheritance thus keeps + you from having to worry about what the function GetLong() should + look like. + + Naturally, this textbook tries to go beyond this fundamental knowledge + of inheritance to give the coder a better undertstanding of how + inheritance works in LPC programming. Without getting into detail that + the advanced domain coder/beginner mudlib coder simply does not yet + need, this chapter will try to explain exactly what happens when you + inherit an object. + + 6.2 Cloning and Inheritance + Whenever a file is referenced for the first time as an object (as opposed + to reading the contents of the file), the game tries to load the file into + memory and create an object. If the object is successfully loaded into + memory, it becomes as master copy. Master copies of objects may be + cloned but not used as actual game objects. The master copy is used to + support any clone objects in the game. + + The master copy is the source of one of the controversies of mud LPC + coding, that is whether to clone or inherit. With rooms, there is no + question of what you wish to do, since there should only be one instance + of each room object in the game. So you generally use inheritance in + creating rooms. Many mud administrators, including myself, however + encourage creators to clone the standard monster object and configure it + from inside room objects instead of keeping monsters in separate files + which inherit the standard monster object. + + As I stated above, each time a file is referenced to create an object, a + master copy is loaded into memory. When you do something like: + void reset() { + object ob; + ob = new("/std/monster"); + /* clone_object("/std/monster") some places */ + ob->SetKeyName("foo monster"); + ... rest of monster config code followed by moving + it to the room ... + } + the driver searches to see if their is a master object called "/std/monster". + If not, it creates one. If it does exist, or after it has been created, the + driver then creates a clone object called "/std/monster#<number>". If + this is the first time "/std/monster" is being referenced, in effect, two + objects are being created: the master object and the cloned instance. + + On the other hand, let's say you did all your configuring in the create() + of a special monster file which inherits "/std/monster". Instead of + cloning the standard monster object from your room, you clone your + monster file. If the standard monster has not been loaded, it gets loaded + since your monster inherits it. In addition, a master copy of your file + gets loaded into memory. Finally, a clone of your monster is created + and moved into the room, for a total of three objects added to the game. + Note that you cannot make use of the master copy easily to get around + this. If, for example, you were to do: + "/realms/descartes/my_monster"->eventMove(this_object()); + instead of + new("/realms/descartes/my_monster")->eventMove(this_object()); + you would not be able to modify the file "my_monster.c" and update it, + since the update command destroys the current master version of an + object. On some mudlibs it also loads the new version into memory. + Imagine the look on a player's face when their monster disappears in + mid-combat cause you updated the file! + + Cloning is therefore a useful too when you plan on doing just that- + cloning. If you are doing nothing special to a monster which cannot be + done through a few call others, then you will save the mud from getting + loaded with useless master copies. Inheritance, however, is useful if + you plan to add functionality to an object (write your own functions) or + if you have a single configuration that gets used over and over again + (you have an army of orc guards all the same, so you write a special orc + file and clone it). + + 6.3 Inside Inheritance + When objects A and B inherit object C, all three objects have their own + set of data sharing one set of function definitions from object C. In + addition, A and B will have separate functions definitions which were + entered separately into their code. For the sake of example throughout + the rest of the chapter, we will use the following code. Do not be + disturbed if, at this point, some of the code makes no sense: + + STD_ITEM C + private string name, cap_name, short, long; + private int setup; + + void SetKeyName(string str) + nomask string GetKeyName(); + private int query_setup(); + static void unsetup(); + void SetShort(string str); + string GetShort(); + void SetLong(string str); + string GetLong(); + + + void SetKeyName(string str) { + if(!query_setup()) { + name = str; + setup = 1; + } + + nomask string GetKeyName() { return name; } + + private query_setup() { return setup; } + + static void unsetup() { setup = 0; } + + string GetName() { + return (name ? capitalize(name) : ""); } + } + + void SetShort(string str) { short = str; } + + string GetShort() { return short; } + + void SetLong(string str) { long = str; } + + string GetLong() { return str; } + + void create() { seteuid(getuid()); } + + STD_ITEM B + inherit "/std/objectc"; + + private int wc; + + void set_wc(int wc); + int query_wc(); + int wieldweapon(string str); + + void create() { ::create(); } + + void init() { + if(environment(this_object()) == this_player()) + add_action("wieldweapon", "wield"); + } + + void set_wc(int x) { wc = x; } + + int query_wc() { return wc; } + + int wieldweapon(string str) { + ... code for wielding the weapon ... + } + + STD_ITEM A + inherit "/std/objectc"; + + int ghost; + + void create() { ::create(); } + + void change_name(string str) { + if(!((int)this_object()->is_player())) unsetup(); + SetKeyName(str); + } + + string GetName() { + if(ghost) return "A ghost"; + else return ::GetName(); + } + + As you can see, object C is inherited both by object A and object B. + Object C is a representation of a much oversimplified base object, with B + being an equally oversimplified weapon and A being an equally + simplified living object. Only one copy of each function is retained in + memory, even though we have here three objects using the functions. + There are of course, three instances of the variables from Object C in + memory, with one instance of the variables of Object A and Object B in + memory. Each object thus gets its own data. + + 6.4 Function and Variable Labels + Notice that many of the functions above are proceeded with labels which + have not yet appeared in either this text or the beginner text, the labels + static, private, and nomask. These labels define special priveledges + which an object may have to its data and member functions. Functions + you have used up to this point have the default label public. This is + default to such a degree, some drivers do not support the labeling. + + A public variable is available to any object down the inheritance tree + from the object in which the variable is declared. Public variables in + object C may be accessed by both objects A and B. Similarly, public + functions may be called by any object down the inheritance tree from the + object in which they are declared. + + The opposite of public is of course private. A private variable or + function may only be referenced from inside the object which declares it. + If object A or B tried to make any reference to any of the variables in + object C, an error would result, since the variables are said to be out of + scope, or not available to inheriting classes due to their private labels. + Functions, however, provide a unique challenge which variables do not. + External objects in LPC have the ability to call functions in other objects + through call others. The private label does not protect against call + others. + + To protect against call others, functions use the label static. A function + which is static may only be called from inside the complete object or + from the game driver. By complete object, I mean object A can call + static functions in the object C it inherits. The static only protects against + external call others. In addition, this_object()->foo() is considered an + internal call as far as the static label goes. + + Since variables cannot be referenced externally, there is no need for an + equivalent label for them. Somewhere along the line, someone decided + to muddy up the waters and use the static label with variables to have a + completely separate meaning. What is even more maddening is that this + label has nothing to do with what it means in the C programming + language. A static variable is simply a variable that does not get saved to + file through the efun save_object() and does not get restored through + restore_object(). Go figure. + + In general, it is good practice to have private variables with public + functions, using query_*() functions to access the values of inherited + variables, and set_*(), add_*(), and other such functions to change + those values. In realm coding this is not something one really has to + worry a lot about. As a matter of fact, in realm coding you do not have + to know much of anything which is in this chapter. To be come a really + good realm coder, however, you have to be able to read the mudlib + code. And mudlib code is full of these labels. So you should work + around with these labels until you can read code and understand why it + is written that way and what it means to objects which inherit the code. + + The final label is nomask, and it deals with a property of inheritance + which allows you to rewrite functions which have already been defined. + For example, you can see above that object A rewrote the function + GetName(). A rewrite of function is called overriding the + function. The most common override of a function would be in a case + like this, where a condition peculiar to our object (object A) needs to + happen on a call ot the function under certain circumstances. Putting test + code into object C just so object A can be a ghost is plain silly. So + instead, we override GetName() in object A, testing to see if the + object is a ghost. If so, we change what happens when another object + queries for the cap name. If it is not a ghost, then we want the regular + object behaviour to happen. We therefore use the scope resolution + operator (::) to call the inherited version of the GetName() + function and return its value. + + A nomask function is one which cannot be overridden either through + inheritance or through shadowing. Shadowing is a sort of backwards + inheritance which will be detailed in the advanced LPC textbook. In the + example above, neither object A nor object B (nor any other object for + that matter) can override GetKeyName(). Since we want to use + GetKeyName() as a unique identifier of objects, we don't want people + faking us through shadowing or inheritance. The function therefore gets + the nomask label. + + 6.5 Summary + Through inheritance, a coder may make user of functions defined in + other objects in order to reduce the tedium of producing masses of + similar objects and to increase the consistency of object behaviour across + mudlib objects. LPC inheritance allows objects maximum priveledges in + defining how their data can be accessed by external objects as well as + objects inheriting them. This data security is maintained through the + keywords, nomask, private, and static. + + In addition, a coder is able to change the functionality of non-protected + functions by overriding them. Even in the process of overriding a + function, however, an object may access the original function through + the scope resolution operator. + + Copyright (c) George Reese 1993 diff -c -r --new-file ds1.1/lib/doc/lpc/intermediate/chapter7 ds2.0r27/lib/doc/lpc/intermediate/chapter7 *** ds1.1/lib/doc/lpc/intermediate/chapter7 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/intermediate/chapter7 Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,298 ---- + Intermediate LPC + Descartes of Borg + November 1993 + + Chapter 7: Debugging + + 7.1 Types of Errors + By now, you have likely run into errors here, there, and everywhere. In + general, there are three sorts of errors you might see: compile time + errors, run time errors, and malfunctioning code. On most muds you + will find a personal file where your compile time errors are logged. For + the most part, this file can be found either in your home directory as the + file named "log" or ".log", or somewhere in the directory "/log" as a file + with your name.. In addition, muds tend to keep a log of run time errors + which occur while the mud is up. Again, this is generally found in + "/log". On MudOS muds it is called "debug.log". On other muds it may + be called something different like "lpmud.log". Ask your administrators + where compile time and run time errors are each logged if you do not + already know. + + Compile time errors are errors which occur when the driver tries to load + an object into memory. If, when the driver is trying to load an object + into memory, it encounters things which it simply does not understand + with respect to what you wrote, it will fail to load it into memory and log + why it could not load the object into your personal error log. The most + common compile time errors are typos, missing or extra (), {}. [], or "", + and failure to declare properly functions and variables used by the + object. + + Run time errors occur when something wrong happens to an object in + memory while it is executing a statement. For example, the driver + cannot tell whether the statement "x/y" will be valid in all circumstances. + In fact, it is a valid LPC expression. Yet, if the value of y is 0, then a + run time error will occur since you cannot divide by 0. When the driver + runs across an error during the execution of a function, it aborts + execution of the function and logs an error to the game's run time error + log. It will also show the error to this_player(), if defined, if the player + is a creator, or it will show "What?" to players. Most common causes + for run time errors are bad values and trying to perform operations with + data types for which those operations are not defined. + + The most insideous type of error, however, is plain malfunctioning + code. These errors do not log, since the driver never really realizes that + anything is wrong. In short, this error happens when you think the code + says one thing, but in fact it says another thing. People too often + encounter this bug and automatically insist that it must be a mudlib or + driver bug. Everyone makes all types of errors though, and more often + than not when code is not functioning the way you should, it will be + because you misread it. + + 7.2 Debugging Compile Time Errors + Compile time errors are certainly the most common and simplest bugs to + debug. New coders often get frustrated by them due to the obscure + nature of some error messages. Nevertheless, once a person becomes + used to the error messages generated by their driver, debugging compile + time errors becomes utterly routine. + + In your error log, the driver will tell you the type of error and on which + line it finally noticed there was an error. Note that this is not on which + line the actual error necessarily exists. The most common compile time + error, besides the typo, is the missing or superfluous parentheses, + brackets, braces, or quotes. Yet this error is the one that most baffles + new coders, since the driver will not notice the missing or extra piece + until well after the original. Take for example the following code: + + 1 int test(string str) { + 2 int x; + 3 for(x =0; x<10; x++) + 4 write(x+"\n"); + 5 } + 6 write("Done.\n"); + 7 } + + Depending on what you intended, the actual error here is either at line 3 + (meaning you are missing a {) or at line 5 (meaing you have an extra }). + Nevertheless, the driver will report that it found an error when it gets to + line 6. The actual driver message may vary from driver to driver, but no + matter which driver, you will see an error on line 6, since the } in line 5 + is interpreted as ending the function test(). At line 6, the driver sees that + you have a write() sitting outside any function definition, and thus + reports an error. Generally, the driver will also go on to report that it + found an error at line 7 in the form of an extra }. + + The secret to debugging these is coding style. Having closing } match + up vertically with the clauses they close out helps you see where you are + missing them when you are debugging code. Similarly, when using + multiple sets of parentheses, space out different groups like this: + if( (x=sizeof(who=users()) > ( (y+z)/(a-b) + (-(random(7))) ) ) + As you can see, the parentheses for the for() statement, are spaced out + from the rest of the statement. In addition, individual sub-groups are + spaced so they can easily be sorted out in the event of an error. + + Once you have a coding style which aids in picking these out, you learn + which error messages tend to indicate this sort of error. When + debugging this sort of error, you then view a section of code before and + after the line in question. In most all cases, you will catch the bug right + off. + + Another common compile time error is where the driver reports an + unknown identifier. Generally, typos and failure to declare variables + causes this sort of error. Fortunately, the error log will almost always + tell you exactly where the error is. So when debugging it, enter the + editor and find the line in question. If the problem is with a variable and + is not a typo, make sure you declared it properly. On the other hand, if + it is a typo, simply fix it! + + One thing to beware of, however, is that this error will sometimes be + reported in conjunction with a missing parentheses, brackets, or braces + type error. In these situations, your problem with an unknown identifier + is often bogus. The driver misreads the way the {} or whatever are + setup, and thus gets variable declarations confused. Therefore make + sure all other compile time errors are corrected before bothering with + these types of errors. + + In the same class with the above error, is the general syntax error. The + driver generates this error when it simply fails to understand what you + said. Again, this is often caused by typos, but can also be caused by not + properly understanding the syntax of a certain feature like writing a for() + statement: for(x=0, x<10, x++). If you get an error like this which is + not a syntax error, try reviewing the syntax of the statement in which the + error is occurring. + + 7.3 Debugging Run Time Errors + Run time errors are much more complex than their compile time + counterparts. Fortunately these errors do get logged, though many + creators do not realise or they do not know where to look. The error log + for run time errors are also generally much more detailed than compile + time errors, meaning that you can trace the history of the execution train + from where it started to where it went wrong. You therefore can setup + debugging traps using precompiler statements much easier using these + logs. Run time errors, however, tend to result from using more + complex codign techniques than beginners tend to use, which means you + are left with errors which are generally more complicated than simple + compile time errors. + + Run time errors almost always result from misusing LPC data types. + Most commonly, trying to do call others using object variables which are + NULL, indexing on mapping, array, or string variables which are + NULL, or passing bad arguments to functions. We will look at a real + run time error log from Nightmare: + + Bad argument 1 to explode() + program: bin/system/_grep.c, object: bin/system/_grep + line 32 + ' cmd_hook' in ' std/living.c' (' + std/user#4002')line 83 + ' cmd_grep' in ' bin/system/_grep.c' (' + bin/system/_grep')line 32 + Bad argument 2 to message() + program: adm/obj/simul_efun.c, object: adm/obj/simul_efun + line 34 + ' cmd_hook' in ' std/living.c' (' + std/user#4957')line 83 + ' cmd_look' in ' bin/mortal/_look.c' (' + bin/mortal/_look')line 23 + ' examine_object' in ' bin/mortal/_look.c' (' + bin/mortal/_look')line 78 + ' write' in 'adm/obj/simul_efun.c' (' + adm/obj/simul_efun')line 34 + Bad argument 1 to call_other() + program: bin/system/_clone.c, object: bin/system/_clone + line 25 + ' cmd_hook' in ' std/living.c' (' + std/user#3734')line 83 + ' cmd_clone' in ' bin/system/_clone.c' (' + bin/system/_clone')line 25 + Illegal index + program: std/monster.c, object: + wizards/zaknaifen/spy#7205 line 76 + ' heart_beat' in ' std/monster.c' + ('wizards/zaknaifen/spy#7205')line + 76 + + All of the errors, except the last one, involve passing a bad argument to a + function. The first bug, involves passing a bad first arument to the efun + explode(). This efun expects a string as its first argment. In debugging + these kinds of errors, we would therefore go to line 32 in + /bin/system/_grep.c and check to see what the data type of the first + argument being passed in fact is. In this particular case, the value being + passed should be a string. + + If for some reason I has actually passed something else, I would be done + debugging at that point and fix it simply by making sure that I was + passing a string. This situation is more complex. I now need to trace + the actual values contained by the variable being passed to explode, so + that I can see what it is the explode() efun sees that it is being passed. + + The line is question is this: + borg[files[i]] = regexp(explode(read_file(files[i]), "\n"), exp); + where files is an array for strings, i is an integer, and borg is a mapping. + So clearly we need to find out what the value of read_file(files[i]) is. + Well, this efun returns a string unless the file in question does not exist, + the object in question does not have read access to the file in question, or + the file in question is an empty file, in which cases the function will + return NULL. Clearly, our problem is that one of these events must + have happened. In order to see which, we need to look at files[i]. + + Examining the code, the files array gets its value through the get_dir() + efun. This returns all the files in a directory if the object has read access + to the directory. Therefore the problem is neither lack of access or non- + existent files. The file which caused this error then must have been an + empty file. And, in fact, that is exactly what caused this error. To + debug that, we would pass files through the filter() efun and make + sure that only files with a file size greater than 0 were allowed into the + array. + + The key to debugging a run time error is therefore knowing exactly what + the values of all variables in question are at the exact moment where the + bug created. When reading your run time log, be careful to separate the + object from the file in which the bug occurred. For example, the + indexing error above came about in the object /wizards/zaknaifen/spy, + but the error occured while running a function in /std/monster.c, which + the object inherited. + + 7.4 Malfunctioning Code + The nastiest problem to deal with is when your code does not behave the + way you intended it to behave. The object loads fine, and it produces no + run time errors, but things simply do not happen the way they should. + Since the driver does not see a problem with this type of code, no logs + are produced. You therefore need to go through the code line by line + and figure out what is happening. + + Step 1: Locate the last line of code you knew successfully executed + Step 2: Locate the first line of code where you know things are going + wrong + Step 3: Examine the flow of the code from the known successful point to + the first known unsuccessful point. + + More often than not, these problems occurr when you are using if() + statements and not accounting for all possibilities. For example: + + int cmd(string tmp) { + if(stringp(tmp)) return do_a() + else if(intp(tmp)) return do_b() + return 1; + } + + In this code, we find that it compiles and runs fine. Problem is nothing + happens when it is executed. We know for sure that the cmd() function + is getting executed, so we can start there. We also know that a value of + 1 is in fact being returned, since we do not see "What?" when we enter + the command. Immediately, we can see that for some reason the + variable tmp has a value other than string or int. As it turns out, we + issued the command without parameters, so tmp was NULL and failed + all tests. + + The above example is rather simplistic, bordering on silly. + Nevertheless, it gives you an idea of how to examine the flow of the + code when debugging malfunctioning code. Other tools are available as + well to help in debugging code. The most important tool is the use of + the precompiler to debug code. With the code above, we have a clause + checking for integers being passed to cmd(). When we type "cmd 10", + we are expecting do_b() to execute. We need to see what the value of + tmp is before we get into the loop: + + #define DEBUG + int cmd(string tmp) { + #ifdef DEBUG + write(tmp); + #endif + if(stringp(tmp)) return do_a(); + else if(intp(tmp)) return do_b(); + else return 1; + } + + We find out immediately upon issuing the command, that tmp has a + value of "10". Looking back at the code, we slap ourselves silly, + forgetting that we have to change command arguments to integers using + sscanf() before evaluating them as integers. + + 7.5 Summary + The key to debugging any LPC problem is always being aware of what + the values of your variables are at any given step in your code. LPC + execution reduces on the simplest level to changes in variable values, so + bad values are what causes bad things to happen once code has been + loaded into memory. If you get errors about bad arguments to + functions, more likely than not you are passing a NULL value to a + function for that argument. This happens most often with objects, since + people will do one of the following: + 1) use a value that was set to an object that has since destructed + 2) use the return value of this_player() when there is no this_player() + 3) use the return value of this_object() just after this_object() was + destructed + + In addition, people will often run into errors involving illegal indexing or + indexing on illegal types. Most often, this is because the mapping or + array in question was not initialized, and therefore cannot be indexed. + The key is to know exactly what the full value of the array or mapping + should be at the point in question. In addition, watch for using index + numbers larger than the size of given arrays + + Finally, make use of the precompiler to temporarly throw out code, or + introduce code which will show you the values of variables. The + precompiler makes it easy to get rid of debugging code quickly once you + are done. You can simply remove the DEBUG define when you are + done. + + Copyright (c) George Reese 1993 diff -c -r --new-file ds1.1/lib/doc/lpc/types/array.2d ds2.0r27/lib/doc/lpc/types/array.2d *** ds1.1/lib/doc/lpc/types/array.2d Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/types/array.2d Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,33 ---- + 2D arrays can be done in LPC, quite simply. Just treat them as an array of + arrays. For example, + + a = allocate(10); + a[0] = allocate(10); + a[1] = allocate(10); + ...etc... + + Then you can reference array 0, element 0, via + + a[0][0] + + You can't declare an array of more than 1 dimension (using the type * + notation, if you have type checking on), but you can have an array of more + than one dimension. If you have type checking on, you will probably have + to declare them as type mixed. + + This also works: + + mixed a; + a = ({ ({ 1, 2, 3 }), ({ 1, 2, 3 }) }); + + In the above example, a[0] would be ({ 1, 2, 3 }), and a[0][2] would be 3. + + Or this: + + mixed a; + a = ({ 0, 0, 0, 0 }); /* just to get the array to size 4 */ + a[0] = ({ 1, 2, 3 }); + a[1] = ({ 1, 2, 3 }); + ...etc... + + John Price a.k.a. Raistlin diff -c -r --new-file ds1.1/lib/doc/lpc/types/buffer ds2.0r27/lib/doc/lpc/types/buffer *** ds1.1/lib/doc/lpc/types/buffer Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/types/buffer Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,11 ---- + 'buffer' is a cross between the LPC array type and the LPC string type. + 'buffer' is intended as a way to conveniently manipulate binary data. + 'buffer' is not zero-terminated (that is, it has an associated length). A + 'buffer' is an array of bytes that is implemented using one byte per + element. buf[i] = x and x = buf[i] are allowed and do work. sizeof(buf) + works. bufferp(buf) is available. buf[i..j] should work as well. buff = + read_buffer(file_name, ...) (same args as read_bytes). also 'int + write_buffer(string file, int start, mixed source)', buf = buf1 + buf2; + buf += buf1, buf = allocate_buffer(size). The socket efuns have been + modified to accept and return the 'buffer' type. (STREAM_BINARY (3) and + DATAGRAM_BINARY (4) modes.) diff -c -r --new-file ds1.1/lib/doc/lpc/types/float ds2.0r27/lib/doc/lpc/types/float *** ds1.1/lib/doc/lpc/types/float Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/types/float Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,13 ---- + MudOS LPC now provides support for the floating point type. Declare + variables like this: + + float pi; + + In general the same operations are supported for floats as are for integers. + Floating point constants may contain decimal points e.g. + + pi = 3.14159265; + + The LPC float type is based on the single precision floating point type + provided by C. On most machines this will give about seven (7) digits + of precision (in base 10). diff -c -r --new-file ds1.1/lib/doc/lpc/types/function ds2.0r27/lib/doc/lpc/types/function *** ds1.1/lib/doc/lpc/types/function Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/types/function Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,30 ---- + MudOS has a variable type named 'function'. Variables of this type may + be used to point to (object, function) pairs. Here is an example usage: + + void + test(string arg) + { + write(arg + "\n"); + } + + void + create() + { + function f; + + f = (: this_object(), "test" :); + (*f)("hello, world!"); + write("functionp(f) == " + functionp(f) + "\n"); + } + + Note, (*f)(args) is internally translated to obj->func(args) where + f == (: obj, func :). In (: obj, func :), obj and func may be any + type allowed by call_other(obj, func). + + (: "hi" :) makes a function pair that is equivalent to (: this_object(), "hi" :) + + Note that: + + f is the same as (: f[0], f[1] :) + + Author: Truilkan, December 1992 diff -c -r --new-file ds1.1/lib/doc/lpc/types/general ds2.0r27/lib/doc/lpc/types/general *** ds1.1/lib/doc/lpc/types/general Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/types/general Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,131 ---- + Types can be used in four places: + + Declaring type of global variables. + Declaring type of functions. + Declaring type of arguments to functions. + Declaring type of local variables in functions. + + Normally, the type information is completely ignored, and can be regarded + purely as documentation. However, when the basic type of a function is + declared, then a more strict type checking will be enforced inside of that + function. That means that the type of all arguments must be defined, and the + variables can only be used to store values of the declared type. The + function call_other() is defined to return an unknown type, as the compiler + has no way of knowing the return type. This value must be casted (when + strict type checking is enabled). Casting a type is done by putting the type + name inside a pair of '(' and ')'. + + An example when querying the short description of an object: + + (string)call_other(ob, "short"); + ...or... + (string)ob->short(); + + When a function is compiled with strict type testing, it can only call other + functions that are already defined. If they are not yet defined, prototypes + must be used to allow the current function to call them. + + An example of a prototype: + + string func(int arg); + + Note the ';' instead of a body to the function. All arguments must be given + by names, but do not have to have the same names as in the real definition. + All types must of course be the same. + + There are two kinds of types. Basic types, and special types. There can be + at most one basic type, but any number of special types assigned to a + variable/function. + + The strict type checking is only used by the compiler, not at runtime. So, + it is actually possible to store a number in a string variable even when + strict type checking is enabled. + + Why use strict type checking? It is really recommended, because the compiler + will find many errors at compile time, which will save a lot of hard work. It + is in general much harder to trace an error occuring at run time. + + The basic types can be divided into groups. Those that are referenced by + value, and those that are referenced by address. The types int, string, + and float are referenced by value. The types mapping, function, object, + and pointers ('<type> *') are referenced by address. If a value of this type + is assigned to a variable or passed as argument, they will all point to the + same actual data. That means that if the value of an element in an array is + changed, then it can modify all other variables pointing to the same array. + Changing the size of the array will always allocate a new one though. The + comparison operator, ==, will compare the actual value for the group of + value-referenced types above. But for arrays, mappings, etc, it will simply + check if it is the same array, mapping, etc. That has the very important + implication that the expression ({}) == ({}) will evaluate to false because + the array construction operator-pair, ({}) always generates a new array. + + Basic types + + int + An integer number (32 bit). + + float + A floating point number (32 bit). + + string + An unlimited string of characters. + + object + A pointer to an object. + + mapping + A form of associative array, see separate documentation. + + function + A special type that points to (object, function name) pairs, see + separate documentation. + + Arrays + Arrays are declared using a '*' following a basic type. For example, + declaring an array of numbers: int *arr;. Use the type mixed if you want an + array of arrays, or a mixed combination of types. + + void + This type is only usable for functions. It means that the function will not + return any value. The compiler will complain (when type checking is enabled) + if a return value is used. + + mixed + This type is special, in that it is valid to use in any context. Thus, if + everything was declared mixed, then the compiler would never complain. This + is of course not the idea. It is really only supposed to be used when a + variable really is going to contain different types of values. This should + be avoided if possible. It is not good coding practice to allow a function, + for example, to return different types. + + Special types + + There are some special types, which can be given before the basic type. These + special types can also be combined. When using special type T before an + inherit statement, all symbols defined by inheritance will also get the + special type T. The only special case is public--defined symbols, which can + not be redefined as private in a private inheritance statement. + + varargs + A function of this type can be called with a variable number of arguments. + Otherwise, the number of arguments is checked, and can generate an error. + + private + Can be given for both functions and variables. Functions that are private in + object A can not be called through call_other() in another object. They're + also not accessable to any object that inherits A. + + static + This special type behaves different for variables and functions. It is + similar to private for functions, in that they cannot be called from other + objects with call_other(). static variables will be neither saved nor + restored when using save_object() or restore_object(). + + public + A function defined as public will always be accessible from other objects, + even if private inheritance is used. + + nomask + All symbols defined as nomask cannot be redefined by inheritance. They can + still be used and accessed as usual. nomask also blocks functions from + being shadowed with shadow(). diff -c -r --new-file ds1.1/lib/doc/lpc/types/mappings ds2.0r27/lib/doc/lpc/types/mappings *** ds1.1/lib/doc/lpc/types/mappings Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/lpc/types/mappings Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,170 ---- + Mappings usage 1992 September 28 + + Documentation on MudOS's mapping datatype - written by Truilkan@TMI: + + MudOS 0.9 provides a datatype calling the 'mapping'. Mappings are + the equivalent of associative arrays found in other languages (e.g. Perl). + An associative array is similar to a regular array except that associative + arrays can be indexed by any type of data (string, object, int, array, etc) + rather than just integers. In addition, associative arrays are sparse arrays + which means you can have a mapping which has a value for its 1,000,000th + element without having values for any other elements. Two particularly + effective uses for mappings are: 1) databases, and 2) a substitute for the + aggregate type 'struct' (as used in the C language) by representing each + field of the C struct as a key in the mapping. + + A mapping is declared like this: + + mapping x; + + A mapping can be initialized in one of two ways: + + x = ([key0 : value0, key1 : value1, ...]); + + (note: 'x = ([]);' can be used to create an empty mapping) + + Note that a mapping _must_ be initialized before you may assign any elements + to it. This restriction exists because of the way the gamedriver + initializes all variables (regardless of type) to zero (0). If you do not + initialize the mapping, then you'll see an "Indexing on illegal type" error + when you try to assign an element to the mapping. + + New (key, value) pairs may be added to the map in the following way: + + x[key] = value; + + The above statement causes the driver to search the mapping named 'x' for the + specified key. If the mapping contains that key, then the associated value + (in the mapping) is replaced with the value on the right hand side of the + assignment. If the mapping does not already contain that key, then + additional space is automatically allocated (dynamically) and the + (key, value) pair is inserted into the mapping. + + An element of a mapping may be referenced as follows: + + write(x[key] + "\n"); + + An element of a mapping may be deleted as follows: + + map_delete(x, key); + + this deletion will cause the following expression to evaluate to true (1): + + undefinedp(x[key]) + + so that you could write code such as this: + + if (undefinedp(value = x["MudOS"])) { + write("'MudOS' is not used as a key in the mapping 'x'\n"); + } else { + write("the value for the key 'MudOS' is " + value + "\n"); + } + + A list of the keys (indices) may be obtained using the keys() efun, for + example: + + mixed *idx; + map x; + + x = ([ "x" : 3, "y" : 4]); + idx = keys(x); /* idx == ({"x", "y"}) or ({"y", "x"}) */ + + Note that keys() will return the list of indices in an apparently random + order (the order is a side effect of the implementation used to store + the mapping -- in this case, an extensible hash table). + + A list of the values in a mapping may be obtained using the values() + efun, for example: + + idx = values(x); + + causes idx to be equal to ({3, 4}) or ({4, 3}). Note that values() will + return the values in the same order as keys() returns the corresponding + keys. + + The (key, value) pairs in a mapping may be iterated over using the each() + efun. each() returns a null vector when the end of the mapping is reached. + each() returns the (key, value) pairs in the same order as keys() and values() + do. For example: + + mixed *pair; + + while ((pair = each(x)) != ({})) { + write("key = " + pair[0] + "\n"); + write("value = " + pair[1] + "\n"); + } + + Mappings can be two-dimensional (or n-dimensional for that matter) in the same + sense that LPC arrays can be. + + mapping x, y; + + x = ([]); + y = ([]); + + y["a"] = "c"; + x["b"] = y; + + And then x["b"]["a"] == "c" + + Mappings can also be composed using the '*' operator (composed in the + mathematical sense of the word): + + mapping r1, r2, a; + + r1 = ([]); + r2 = ([]); + + r1["driver"] = "mudlib"; + r2["mudlib"] = "castle"; + + so: + + a = r1 * r2 + + defines a to be a map with: a["driver"] == "castle"; + + You may also add two mappings. The sum of two mappings is defined + as the union of the two mappings. + + a = r1 + r2 + + defines a to be a map with a["driver"] == "mudlib" and + a["mudlib"] == "castle" + + The += operator is also supported. Thus you could use: + + a += ([key : value]); + + as a substitute for: + + a[key] = value; + + However, the latter form (a[key] = value) is much more efficient since + the former (in the present implementation) involves the creation of a new + mapping while the latter does not. + + The subtraction operator is not defined for mappings (use map_delete()). + + The sizeof() efun may be used to determine how many (key, value) pairs + are in the mapping. For example, + + write("The mapping 'x' contains " + sizeof(x) + " elements.\n"); + + the implementation: + + MudOS's mappings are implemented using an extensible hash table. The + size of the hash table is always a power of 2. When a certain percentage + of the hash table buckets become full, the size of the hash table is + doubled in order to maintain the efficiency of accesses to the hash + table. + + credits: + + MudOS's mappings were originally implemented by Whiplash@TMI. Parts of + the implementation were later rewritten by Truilkan@TMI (to use an + extensible hash table rather than a binary tree). + + Parts of the data structure used to implement mappings are based on + the hash.c module from the Perl programming language by Larry Wall. + The Perl package is covered under the GNU Copyleft general public license. diff -c -r --new-file ds1.1/lib/doc/manual/chapter01 ds2.0r27/lib/doc/manual/chapter01 *** ds1.1/lib/doc/manual/chapter01 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter01 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,91 ---- + chapter 1 "Introduction to the Coding Environment" + LPC Basics + Written by Descartes of Borg + first edition: 23 april 1993 + second edition: 25 may 1993 + + CHAPTER 1: Introduction to the Coding Environment + + 1.1 UNIX file structure + LPMuds use basic UNIX commands and its file structure. If you know + UNIX commands already, then note (with a few exceptions) options are + not available to the commands. Like DOS, UNIX is heirarchical. The + root directory of which all directories are sub-directories is called + root(/). And from those sub-directories you may have further + sub-directories. A directory may be referred to in two different ways: + 1) by its full name, or absolute name, or 2) by its relative name. + Absolute name refers to the directory's full path starting from / winding + down the directory tree until you name the directory in question. For + example: + + /players/descartes/obj/monster + + refers to the directory monster which is a sub-directory of obj which + is a sub-directory of descartes which is a sub-directory of players + which is a sudirectory of /. + + The relative name refers to the name relative to another directory. + The above example is called monster relative to /players/descartes/obj, + but it is also called obj/monster relative to /players/descartes, + descartes/obj/monster relative to /players, and finally + players/descartes/obj/monster relative to /. You can tell the + difference between absolute names and relative names because absolute + names always start with /. In order to know exactly which directory + is being named by a relative name, you naturally must know what + directory it is relative to. + + A directory contains sub-directories and files. LPMuds only use text files + inside the mudlib. Like directories, files have both absolute and + relative names. The most basic relative name is often referred to as the file + name, with the rest of the absolute name being referred to as the path. So, + for the file: /players/descartes/castle.c, castle.c is the file name, and + /players/descartes is the path. + + On some muds, a file with a file name beginning with a . (like .plan) is + not visible when you list files with the regular file listing command. + + 1.2 UNIX Commands + Along with the UNIX file structure, LPMuds use many UNIX commands. Typical + UNIX commands on most muds are: + pwd, cd, ls, rm, mv, cp, mkdir, rmdir, more, head, cat, ed + If you have never before seen UNIX commands, you probably are thinking this + is all nonsense. Well, it is, but you got to use them. Before getting + into what they mean though, first a discussion of current directory. + If you know DOS, then you know what a current working directory is. + At any given point, you are considered to be "in" some directory. This + means that any relative file or directory names you give in UNIX commands + are relative to that directory. For example, if my current directory is + /players/descartes and I type "ed castle.c" (ed is the command to edit), + then it assumes I mean the file /players/descartes/castle.c + + pwd: shows you your current working directory + cd: changes your current working directory. You may give either relative + or absolute path names. With no arguments, it changes to your home + directory. + ls: lists all files in the directory named. If no directory is named, + it lists the files of the current working directory + rm: deletes the file named + mv: renames the file named + cp: copies the file named + mkdir: makes a new directory + rmdir: deletes a directory. All files must have been first removed. + more: pages the file named so that the file appears on your screen one + page at a time. + cat: shows the whole file to you at once + head: shows you the first several lines of a file + tail: shows you the last several lines of a file + ed: allows you to edit a file using the mud editor + + 1.3 Chapter Summary + UNIX uses a heirarchical file structure with the root of the tree being + named /. Other directories branch off from that root directory and + in turn have their own sub-directories. All directories may contain + directories and files. Directories and files are referred to either + by their absolute name, which always begins with /, or by their relative + name which gives the file's name relative to a particular directory. + In order to get around in the UNIX files structure, you have the + typical UNIX commands for listing files, your current directory, etc. + On your mud, all of the above commands should have detailed help commands + to help you explore exactly what they do. In addition, there should + be a very detailed file on your mud's editor. If you are unfamiliar + with ed, you should go over this convoluted file. diff -c -r --new-file ds1.1/lib/doc/manual/chapter02 ds2.0r27/lib/doc/manual/chapter02 *** ds1.1/lib/doc/manual/chapter02 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter02 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,196 ---- + chapter 2 "The LPC Program" + LPC Basics + Written by Descartes of Borg + first edition: 23 april 1993 + second edition: 16 june 1993 + + CHAPTER 2: The LPC Program + + 2.1 About programs + The title of this chapter of the textbook is actually poorly named, since + one does not write programs in LPC. An LPC coder instead writes *objects*. + What is the difference? Well, for our purposes now, the difference is + in the way the file is executed. When you "run" a program, execution + begins at a definite place in the program. In other words, there + is a place in all programs that is noted as the beginning where program + execution starts. In addition, programs have definite end points, + so that when execution reaches that point, the execution of the program + terminates. So, in short, execution of a program runs from a definite + beginning point through to a definite end point. This is not so with + LPC objects. + + With muds, LPC objects are simply distinct parts of the C program which + is running the game (the driver). In other words, execution of the mud + program begins and ends in the driver. But the driver in fact does + very little in the way of creating the world you know when you play + a mud. Instead, the driver relies heavily on the code created in LPC, + executing lines of the objects in the mud as needed. LPC objects thus + have no place that is necessarily the beginning point, nor do they + have a definite ending point. + + Like other programming languages, an LPC "program" may be made up of + one or more files. For an LPC object to get executed, it simple + needs to be loaded into the driver's memory. The driver will call lines + from the object as it needs according to a structure which will be + defined throughout this textbook. The important thing you need to + understand at this point is that there is no "beginning" to an LPC + object in terms of execution, and there is no "end". + + 2.2 Driver-mudlib interaction + As I have mentioned earlier, the driver is the C program that runs on + the host machine. It connects you into the game and processes LPC code. + Note that this is one theory of mud programming, and not necessarily + better than others. It could be that the entire game is written in C. + Such a game would be much faster, but it would be less flexible in + that wizards could not add things to the game while it was running. This + is the theory behind DikuMUDs. Instead, LPMUDs run on the theory that + the driver should in no define the nature of the game, that the nature + of the game is to be decided by the individuals involved, and that + you should be able to add to the game *as it is being played*. This + is why LPMUDs make use of the LPC programming language. It allows + you to define the nature of the game in LPC for the driver to read and + execute as needed. It is also a much simpler language to understand + than C, thus making the process of world creation open to a greater + number of people. + + Once you have written a file in LPC (assuming it is corrent LPC ), it justs + sits there on the host machine's hard drive until something in the game + makes reference to it. When something in the game finally does make + reference to the object, a copy of the file is loaded into memory and + a special *function* of that object is called in order to initialize + the values of the variables in the object. Now, do not be concerned + if that last sentence went right over your head, since someone brand + new to programming would not know what the hell a function or a variable + is. The important thing to understand right now is that a copy of the + object file is taken by the driver from the machine's hard drive and + stored into memory (since it is a copy, multiple versions of that + object may exist). You will later understand what a function is, what + a variable is, and exactly how it is something in the game made reference + to your object. + + 2.3 Loading an object into memory + Although there is no particular place in an object code that must exist + in order for the driver to begin executing it, there is a place for which + the driver will search in order to initialize the object. On compat + drivers, it is the function called reset(). On native muds it is the + function called create(). + + LPC objects are made up of variables (values which can change) and + functions which are used to manipulate those variables. Functions + manipulate variables through the use of LPC grammatical structures, + which include calling other functions, using externally defined + functions (efuns), and basic LPC expressions and flow control + mechanisms. + + Does that sound convoluted? First lets start with a variable. A + variable might be something like: level. It can "vary" from sitation + to situation in value, and different things use the value of the player's + level to make different things happen. For instance, if you are a + level 19 player, the value of the variable level will be 19. Now + if your mud is on the old LPMud 2.4.5 system where levels 1-19 are + players and 20+ are wizards, things can ask for your level value to + see if you can perform wizard type actions. Basically, each object + in LPC is a pile of variables with values which change over time. + Things happen to these objects based on what values its variables + hold. Often, then things that happen cause the variables to change. + + So, whenever an object in LPC is referenced by another object currently + in memory, the driver searches to see what places for values the + object has (but they have no values yet). Once that is done, the driver + calls a function in the object called reset() or create() (depending + on your driver) which will set up the starting values for the object's + variables. It is thus through *calls* to *functions* that variable + values get manipulated. + + But create() or reset() is NOT the starting place of LPC code, although + it is where most LPC code execution does begin. The fact is, those + functions need not exist. If your object does just fine with its + starting values all being NULL pointers (meaning, for our purposes + here, 0), then you do not need a create() or reset() function. Thus + the first bit of execution of the object's code may begin somewhere + completely different. + + Now we get to what this chapter is all about. The question: What + consists a complete LPC object? Well, an LPC object is simply + one or more functions grouped together manipulating 0 or more + variables. The order in which functions are placed in an object + relative to one another is irrelevant. In other words: + + ----- + void init() { add_action("smile", "smile"); } + + void create() { return; } + + int smile(string str) { return 0; } + ----- + + is exactly the same as: + + ----- + void create() { return; } + + int smile(string str) { return 0; } + + void init() { add_action("smile", "smile"); } + _____ + + Also important to note, the object containing only: + + ----- + void nonsense() {} + ----- + + is a valid, but trivial object, although it probably would not interact + properly with other objects on your mud since such an object has no + weight, is invisible, etc.. + + 2.4 Chapter summary + LPC code has no beginning point or ending point, since LPC code is used + to create objects to be used by the driver program rather than create + individual programs. LPC objects consist of one or more functions whose + order in the code is irrelevant, as well as of zero or more variables whose + values are manipulated inside those functions. LPC objects simply sit + on the host machine's hard driver until referenced by another object in + the game (in other words, they do not really exist). Once the object + is referenced, it is loaded into the machine's memory with empty + values for the variables. The function reset() in compat muds or + create() in native muds is called in that object if it exists to allow + the variables to take on initial values. Other functions in the object + are used by the driver and other objects in the game to allow interaction + among objects and the manipulation of the LPC variables. + + A note on reset() and create(): + create() is only used by muds in native mode (see the textbook Introduction + for more information on native mode vs. compat mode). It is only used + to initialize newly referenced objects. + + reset() is used by both muds in compat mode and native mode. In compat + mode, reset() performs two functions. First, it is used to initialize + newly referenced objects. In addition, however, compat mode muds use + reset() to "reset" the object. In other words, return it to its initial + state of affairs. This allows monsters to regenerate in a room and doors + to start back in the shut position, etc.. Native mode muds use reset() + to perform the second function (as its name implies). + + So there are two important things which happen in LP style muds which + cause the driver to make calls to functions in objects. The first is + the creation of the object. At this time, the driver calls a function + to initalize the values in the object. For compat mode muds, this + is performed by the function named reset() (with an argument of 0, + more on this later though). For muds running in native mode, this is + performed by the function create(). + + The second is the returning of the room to some base state of affairs. + This base set of affairs may or may not be different from the initial + state of affairs, and certainly you would not want to take up time + doing redundant things (like resetting variables that never change). + Compat mode muds nevertheless use the same function that was used to + create the object to reset it, that being reset(). Native mode muds, + who use create() to create the room, instead use reset() to reset it. + All is not lost in compat mode though, as there is a way to tell the + difference between creation and resetting. For reset purposes, the + driver passes either 1 or the reset number as an argument to reset() + in compat mode. Now this is meaningless to you now, but just keep in + mind that you can in fact tell the difference in compat mode. Also + keep in mind that the argment in the creation use of reset is 0 and + the argument in the reset use is a nonzero number. diff -c -r --new-file ds1.1/lib/doc/manual/chapter03 ds2.0r27/lib/doc/manual/chapter03 *** ds1.1/lib/doc/manual/chapter03 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter03 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,186 ---- + chapter 3 "LPC Data Types" + LPC Basics + Written by Descartes of Borg + first edition: 23 april 1993 + second edition: 17 june 1993 + + CHAPTER 3: LPC Data Types + + 3.1 What you should know by now + LPC object are made up of zero or more variables manipulated by one or + more functions. The order in which these functions appear in code is + irrelevant. The driver uses the LPC code you write by loading copies of + it into memory whenever it is first referenced and additional copies + through cloning. When each object is loaded into memory, all the variables + initially point to no value. The reset() function in compat muds, and + create() in native muds are used to give initial values to variables in + objects. The function for creation is called immediately after the object + is loaded into memory. However, if you are reading this textbook with no + prior programming experience, you may not know what a function is or how + it gets called. And even if you have programming experience, you may + be wondering how the process of functions calling each other gets started + in newly created objects. Before any of these questions get answered, + however, you need to know more about what it is the functions are + manipulating. You therefore should thouroughly come to know the concept + behind LPC data types. Certainly the most boring subject in this manual, + yet it is the most crucial, as 90% of all errors (excepting misplaced + {} and ()) involve the improper usage of LPC data types. So bear through + this important chapter, because it is my feeling that understanding this + chapter alone can help you find coding much, much easier. + + 3.2 Communicating with the computer + You possibly already know that computers cannot understand the letters + and numbers used by humans. Instead, the "language" spoken by computers + consists of an "alphabet" of 0's and 1's. Certainly you know computers + do not understand natural human languages. But in fact, they do not + understand the computer languages we write for them either. Computer + languages like BASIC, C, C++, Pascal, etc. are all intermediate + languages. They allow you to structure your thoughts more coherently + for translation into the 0's and 1's of the computer's languages. + + There are two methods in which translation is done: compilation and + interpretation. These simply are differences betweem when the + programming language is translated into computer language. With + compiled languages, the programmer writes the code then uses a program + called a compiler to translate the program into the computer's + language. This translation occurs before the program is run. With + interpreted languages however, the process of translation occurs as + the program is being run. Since the translation of the program is + occurring during the time of the program's running in interpreted + languages, interpreted languages make much slower programs than + compiled languages. + + The bottom line is, no matter what language you are writing in, at + some point this has to be changed into 0's and 1's which can be + understood by the computer. But the variables which you store in + memory are not simply 0's and 1's. So you have to have a way in + your programming languages of telling the computer whether or not + the 0's and 1's should be treated as decimal numbers or characters or + strings or anything else. You do this through the use of data types. + + For example, say you have a variable which you call 'x' and you give + it the decimal whole number value 65. In LPC you would do this through + the statement: + + ----- + x = 65; + ----- + + You can later do things like: + + _____ + write(x+"\n"); /* \n is symbolically represents a carriage return */ + y = x + 5; + ----- + + The first line allows you to send 65 and a carriage return to someone's screen. + The second line lets you set the value of y to 70. + The problem for the computer is that it does not know what '65' means when + you tell it x = 65;. What you think of 65, it might think of as: + 00000000000000000000000001000001 + But, also, to the computer, the letter 'A' is represented as: + 00000000000000000000000001000001 + So, whenever you instruct the computer write(x+"\n");, it must have some + way of knowing that you want to see '65' and not 'A'. + + The computer can tell the difference between '65' and 'A' through the use + of data types. A data types simply says what type of data is being stored + by the memory location pointed to by a given variable. Thus, each LPC + variable has a variable type which guides conversions. In the example + given above, you would have had the following line somewhere in the + code *before* the lines shown above: + + ----- + int x; + ----- + + This one line tells the driver that whatever value x points to, it will + be used as the data type "int", which is short for integer, or whole + number. So you have a basic introduction into the reason why data types + exist. They exist so the driver can make sense of the 0's and 1's that + the computer is storing in memory. + + 3.3 The data types of LPC + All LPMud drivers have the following data types: + + void, status, int, string, object, int *, string *, object *, mixed * + + Many drivers, but not all have the following important data types which + are important to discuss: + + float, mapping, float *, mapping * + + And there are a few drivers with the following rarely used data types + which are not important to discuss: + + function, enum, struct, char + + 3.4 Simple data types + This introductory textbook will deal with the data types void, status, + int, float, string, object, mand mixed. You can find out about the + more complex data types like mappings and arrays in the intermediate + textbook. This chapter deals with the two simplest data types (from the + point of view of the LPC coder), int and string. + + An int is any whole number. Thus 1, 42, -17, 0, -10000023 are all type int. + A string is one or more alphanumeric characters. Thus "a", "we are borg", + "42", "This is a string" are all strings. Note that strings are always + enclosed in "" to allow the driver to distinguish between the int 42 and + the string "42" as well as to distinguish between variable names (like x) + and strings by the same names (like "x"). + + When you use a variable in code, you must first let the driver know + what type of data to which that variable points. This process is + called *declaration*. You do this at the beginning of the function + or at the beginning of the object code (outside of functions before all + functions which use it). This is done by placing the name of the data type + before the name of the variable like in the following example: + + ----- + void add_two_and_two() { + int x; + int y; + + x = 2; + y = x + x; + } + ----- + + Now, this is a complete function. The name of the function is + add_two_and_two(). The function begins with the declaration of an + int variable named x followed by the declaration of an in variable + named y. So now, at this point, the driver now has two variables which + point to NULL values, and it expects what ever values end up there to be + of type int. + + A note about the data types void and status: + Void is a trivial data type which points to nothing. It is not used + with respect to variables, but instead with respect to functions. You + will come to understand this better later. For now, you need only + understand that it points to no value. + + The data type status is a boolean data type. That is, it can only have + 1 or 0 as a value. This is often referred to as being true or false. + + 3.5 Chapter summary + For variables, the driver needs to know how the 0's and 1's the computer + stores in memory get converted into the forms in which you intend them + to be used. The simplest LPC data types are void, status, int, and string. + You do not user variables of type void, but the data type does come + into play with respect to functions. In addition to being used for + translation from one form to the next, data types are used in determining + what rules the driver uses for such operations as +, -, etc. For example, + in the expression 5+5, the driver knows to add the values of 5 and 5 + together to make 10. With strings however, the rules for int addition + make no sense. So instead, with "a"+"b", it appends "b" to the string "a" + so that the final string is "ab". Errors can thus result if you mistakenly + try to add "5"+5. Since int addition makes no sense with strings, the + driver will convert the second 5 to "5" and use string addition. The final + result would be "55". If you were looking for 10, you would therefore + have ended up with erroneous code. Keep in mind, however, that in most + instances, the driver will not do something so useful as coming up with + "55". It comes up with "55" cause it has a rule for adding a string + to an int, namely to treat the int as a string. In most cases, if you + use a data type for which an operation or function is not defined + (like if you tried to divide "this is" by "nonsense", "this is"/"nonsense"), + the driver will barf and report an error to you. diff -c -r --new-file ds1.1/lib/doc/manual/chapter04 ds2.0r27/lib/doc/manual/chapter04 *** ds1.1/lib/doc/manual/chapter04 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter04 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,226 ---- + chapter 4 "Functions" + LPC Basics + Written by Descartes of Borg + first edition: 23 april 1993 + second edition: 22 june 1993 + + CHAPTER 4: Functions + + 4.1 Review + By this point, you should be aware that LPC objects consist of functions + which manipulate variables. The functions manipulate variables when they + are executed, and they get executed through *calls* to those functions. + The order in which the functions are placed in a file does not matter. + Inside a function, the variables get manipulated. They are stored in + computer memory and used by the computer as 0's and 1's which + get translated to and from useable output and input through a device + called data typing. String data types tell the driver that the + data should appear to you and come from you in the form of alphanumeric + characters. Variables of type int are represented to you as whole + number values. Type status is represented to you as either 1 or 0. + And finally type void has no value to you or the machine, and is not + really used with variable data types. + + 4.2 What is a function? + Like math functions, LPC functions take input and return output. + Languages like Pascal distinguish between the concept of proceedure abd + the concept of function. LPC does not, however, it is useful to + understand this distinction. What Pascal calls a proceedure, LPC + calls a function of type void. In other words, a proceedure, or function + of type void returns no output. What Pascal calls a function differs + in that it does return output. In LPC, the most trivial, correct + function is: + + ----- + void do_nothing() { } + ----- + + This function accepts no input, performs no instructions, and returns no + value. + + There are three parts to every properly written LPC function: + 1) The declaration + 2) The definition + 3) The call + + Like with variables, functions must be declared. This will allow the + driver to know 1) what type of data the function is returning as output, + and 2) how many input(s) and of what type those input(s) are. The + more common word for input is parameters. + A function declaration therefore consists of: + type name(parameter1, parameter2, ..., parameterN); + The declaration of a function called drink_water() which accepts a string as + input and an int as output would thus look like this: + + ----- + int drink_water(string str); + ----- + + where str is the name of the input as it will be used inside the function. + + The function definition is the code which describes what the function actually + does with the input sent to it. + The call is any place in other functions which invokes the execution of the + function in question. For two functions write_vals() and add(), you thus + might have the following bit of code: + + ----- + /* First, function declarations. They usually appear at the beginning + of object code. + */ + void write_vals(); + int add(int x, int y); + + /* Next, the definition of the function write_vals(). We assume that + this function is going to be called from outside the object + */ + void write_vals() { + int x; + + /*N Now we assign x the value of the output of add() through a call */ + x = add(2, 2); + write(x+"\n"); + } + + /* Finally, the definition of add() */ + int add(int x, int y) { + return (x + y); + } + ----- + + Remember, it does not matter which function definition appears first in the + code. This is because functions are not executed consecutively. Instead, + functions are executed as called. The only requirement is that the + declaration of a function appear before its definition and before the + definition of any function which makes a call to it. + + 4.3 Efuns + Perhaps you have heard people refer to efuns. They are externally defined + functions. Namely, they are defined by the mud driver. If you have + played around at all with coding in LPC, you have probably found some + expressions you were told to use like this_player(), write(), say(), + this_object(), etc. look a lot like functions. That is because they are + efuns. The value of efuns is that they are much faster than LPC functions, + since they already exist in the binary form the computer understands. + + In the function write_vals() above, two functions calls were made. The first was to + the functions add(), which you declared and defined. The second call, however, + was to a function called write(), and efun. The driver has already declared + and defined this function for you. You needs only to make calls to it. + + Efuns are created to hanldle common, every day function calls, to handle + input/output to the internet sockets, and other matters difficult to be + dealt with in LPC. They are written in C in the game driver and compiled + along with the driver before the mud comes up, making them much faster + in execution. But for your purposes, efun calls are just like calls + made to your functions. Still, it is important to know two things of any + efun: 1) what return type does it have, and 2) what parameters of what + types does it take. + + Information on efuns such as input parameters and return types is often + found in a directory called /doc/efun on your mud. I cannot + detail efuns here, because efuns vary from driver to driver. However, + you can often access this information using the commands "man" or "help" + depending on your mudlib. For instance, the command "man write" would + give you information on the write efun. But if all else fails, + "more /doc/efun/write" should work. + + By looking it up, you will find write is declared as follows: + + ----- + void write(string); + ----- + + This tells you an appropriate call to write expects no return value and + passes a single parameter of type string. + + 4.4 Defining your own functions + Although ordering your functions within the file does not matter, ordering + the code which defines a function is most important. Once a function + has been called, function code is executed in the order it appears + in the function definition. In write_vals() above, the instruction: + + ----- + x = add(2, 2); + ----- + + Must come before the write() efun call if you want to see the appropriate + value of x used in write(). + + With respect to values returned by function, this is done through the "return" + instruction followed by a value of the same data type as the function. In + add() above, the instruction is "return (x+y);", where the value of (x+y) + is the value returned to write_vals() and assigned to x. On a more + general level, "return" halts the execution of a function and returns + code execution to the function which called that function. In addition, + it returns to the calling function the value of any expression that follows. + To stop the execution of a function of type void out of order, use + "return"; without any value following. Once again, remember, the data + type of the value of any expression returned using "return" MUST be the + same as the data type of the function itself. + + 4.5 Chapter Summary + The files which define LPC objects are made of of functions. Functions, in + turn, are made up of three parts: + 1) The declaration + 2) The definition + 3) The call + Function declarations generally appear at the top of the file before any + defintions, although the requirement is that the declaration must appear + before the function definition and before the definition of any function + which calls it. + Function definitions may appear in the file in any order so long as they + come after their declaration. In addition, you may not define one function + inside another function. + Function calls appear inside the definition of other functions where you + want the code to begin execution of your function. They may also appear + within the definition of the function itself, but this is not recommended + for new coders, as it can easily lead to infinite loops. + + The function definition consists of the following in this order: + 1) function return type + 2) function name + 3) opening ( followed by a parameter list and a closing ) + 4) an opening { instructing the driver that execution begins here + 5) declarations of any variables to be used only in that function + 6) instructions, expressions, and calls to other functions as needed + 7) a closing } stating that the function code ends here and, if no + "return" instruction has been given at this point (type void functions + only), execution returns to the calling function as if a r"return" + instruction was given + + The trivial function would thus be: + + ----- + void do_nothing() {} + ----- + + since this function does not accept any input, perform any instructions, or + return any output. + + Any function which is not of type void MUST return a value of a data type + matching the function's data type. + + Each driver has a set of functions already defined for you called efuns + These you need neither need to declare nor define since it has already + been done for you. Furthermore, execution of these functions is faster + than the execution of your functions since efuns are in the driver. + In addition, each mudlib has special functions like efuns in that they + are already defined and declared for you, but different in that they + are defined in the mudlib and in LPC. They are called simul_efuns, or + simulated efuns. You can find out all about each of these as they are + listed in the /doc/efun directory on most muds. In addition many + muds have a command called "man" or a "help" command which allows you + simply to call up the info files on them. + + Note on style: + Some drivers may not require you to declare your functions, and some + may not require you to specify the return type of the function in its + definition. Regardless of this fact, you should never omit this information + for the following reasons: + 1) It is easier for other people (and you at later dates) to read your + code and understand what is meant. This is particularly useful + for debugging, where a large portion of errors (outside of misplaced + parentheses and brackets) involve problems with data types (Ever + gotten "Bad arg 1 to foo() line 32"?). + 2) It is simply considered good coding form. diff -c -r --new-file ds1.1/lib/doc/manual/chapter05 ds2.0r27/lib/doc/manual/chapter05 *** ds1.1/lib/doc/manual/chapter05 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter05 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,162 ---- + chapter 5 "The Basics of Inheritance" + LPC Basics + Written by Descartes of Borg + first edition: 23 april 1993 + second edition: 01 july 1993 + + CHAPTER 5: The Basics of Inheritance + + 5.1 Review + You should now understand the basic workings of functions. You should be + able to declare and call one. In addition, you should be able to recognize + function definitions, although, if this is your first experience with LPC, + it is unlikely that you will as yet be able to define your own functions. + There functions form the basic building blocks of LPC objects. Code + in them is executed when another function makes a call to them. In making + a call, input is passed from the calling function into the execution of + the called one. The called function then executes and returns a value + of a certain data type to the calling function. Functions which return + no value are of type void. + + After examining your workroom code, it might look something like this + (depending on the mudlib): + + ----- + inherit "/std/room"; + + void create() { + ::create(); + SetProperty("light", 2); + SetProperty("indoors", 1); + set("short", "Descartes' Workroom"); + set("long", "This is where Descartes works.\nIt is a cube.\n"); + SetExits( ({ "/domains/standard/square" }), ({ "square" }) ); + } + ----- + + If you understand the entire textbook to this point, you should recognize + of the code the following: + 1) create() is the definition of a function (hey! he did not declare it) + 2) It makes calls to SetProperty(), set(), and SetExits(), none + of which are declared or defined in the code. + 3) There is a line at the top that is no variable or function declaration + nor is it a function definition! + + This chapter will seek to answer the questions that should be in your head + at this point: + 1) Why is there no declaration of create()? + 2) Where are the functions SetProperty(), set(), and SetExits() declared + and defined? + 3) What the hell is that line at the top of the file? + + 5.2 Object oriented programming + Inheritance is one of the properties which define true object oriented + programming (OOP). It allows you to create generic code which can be used + in many different ways by many different programs. What a mudlib does is + create these generalized files (objects) which you use to make very specific + objects. + + If you had to write the code necessary for you to define the workroom above, + you would have to write about 1000 lines of code to get all the functionality + of the room above. Clearly that is a waste of disk space. In addition, + such code does not interact well with players and other rooms since every + creator is making up his or her own functions to perform the functionality + of a room. Thus, what you might use to write out the room's long description, + GetLong(), another wizard might be calling long(). This is the primary + reason mudlibs are not compatible, since they use different protocols for + object interaction. + + OOP overcomes these problems. In the above workroom, you inherit the + functions already defined in a file called "/std/room.c". It has all + the functions which are commonly needed by all rooms defined in it. When + you get to make a specific room, you are taking the general functionality + of that room file and making a unique room by adding your own function, + create(). + + 5.3 How inheritance works + As you might have guessed by now, the line: + + ----- + inherit "/std/room"; + ----- + + has you inherit the functionality of the room "/std/room.c". By inheriting + the functionality, it means that you can use the functions which have + been declared and defined in the file "/std/room.c" In the Nightmare Mudlib, + "/std/room.c" has, among other functions, SetProperty(), set(), and + SetExits() declared and defined. In your function create(), you are + making calls to those functions in order to set values you want your + room to start with. These values make your room different from others, yet + able to interact well with other objects in memory. + + In actual practice, each mudlib is different, and thus requires you to use + a different set of standard functions, often to do the same thing. It is + therefore beyond the scope of this textbook even to describe what + functions exist and what they do. If your mudlib is well documented, + however, then (probably in /doc/build) you will have tutorials on how + to use the inheritable files to create such objects. These tutorials + should tell you what functions exist, what input they take, the data + type of their output, and what they do. + + 5.4 Chapter summary + This is far from a complete explanation of the complex subject of inheritance. + The idea here is for you to be able to understand how to use inheritance in + creating your objects. A full discussion will follow in a later textbook. + Right now you should know the following: + 1) Each mudlib has a library of generic objects with their own general + functions used by creators through inheritance to make coding objects + easier and to make interaction between objects smoother. + 2) The functions in the inheritable files of a mudlib vary from mudlib + to mudlib. There should exist documentation on your mud on how to + use each inheritable file. If you are unaware what functions are + available, then there is simply no way for you to use them. Always + pay special attention to the data types of the input and the data + types of ay output. + 3) You inherit the functionality of another object through the line: + + ----- + inherit "filename"; + ----- + + where filename is the name of the file of the object to be inherited. + This line goes at the beginning of your code. + + Note: + You may see the syntax ::create() or ::init() or ::reset() in places. + You do not need fully to understand at this point the full nuances of this, + but you should have a clue as to what it is. The "::" operator is a way + to call a function specifically in an inherited object (called the scope + resolution operator). For instance, most muds' room.c has a function + called create(). When you inherit room.c and configure it, you are doing + what is called overriding the create() function in room.c. This means + that whenever ANYTHING calls create(), it will call *your* version and not + the one in room.c. However, there may be important stuff in the room.c + version of create(). The :: operator allows you to call the create() in + room.c instead of your create(). + An example: + + ----- + #1 + + inherit "/std/room"; + + void create() { create(); } + ----- + + ----- + #2 + + inherit "/std/room"; + + void create() { ::create(); } + ----- + + Example 1 is a horror. When loaded, the driver calls create(), and then + create() calls create(), which calls create(), which calls create()... + In other words, all create() does is keep calling itself until the driver + detects a too deep recursion and exits. + + Example 2 is basically just a waste of RAM, as it is no different from room.c + functionally. With it, the driver calls its create(), which in turn calls + ::create(), the create() in room.c. Otherwise it is functionally + exactly the same as room.c. diff -c -r --new-file ds1.1/lib/doc/manual/chapter06 ds2.0r27/lib/doc/manual/chapter06 *** ds1.1/lib/doc/manual/chapter06 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter06 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,334 ---- + chapter 6 "Variable Handling" + LPC Basics + Written by Descartes of Borg + first edition: 23 april 1993 + second edition: july 5 1993 + + CHAPTER 6: Variable Handling + + 6.1 Review + By now you should be able to code some simple objects using your muds standard + object library. Inheritance allows you to use functions defined in those + objects without having to go and define yourself. In addition, + you should know how to declare your own functions. This + chapter will teach you about the basic elements of LPC which will allow you to + define your own functions using the manipulation of variables. + + 6.2 Values and objects + Basically, what makes objects on the mud different are two things: + 1) Some have different functions + 2) All have different values + + Now, all player objects have the same functions. They are therefore + differentiated by the values they hold. For instance, the player + named "Forlock" is different from "Descartes" *at least* in that they + have different values for the variable true_name, those being + "descartes" and "forlock". + + Therefore, changes in the game involve changes in the values of the objects + in the game. Functions are used to name specific process for manipulating + values. For instance, the create() function is the function whose + process is specifically to initialize the values of an object. + Within a function, it is specifically things called instructions which are + responsible for the direct manipulation of variables. + + 6.3 Local and global variables + Like variables in most programming language, LPC variables may be declared + as variables "local" to a specific function, or "globally" available + to all functions. Local variables are declared inside the function which + will use them. No other function knows about their existence, since + the values are only stored in memory while that function is being executed. + A global variable is available to any function which comes after its + declaration in the object code. Since global variables take up RAM for + the entire existence of the object, you should use them only when + you need a value stored for the entire existence of the object. + Have a look at the following 2 bits of code: + + ----- + int x; + + int query_x() { return x; } + + void set_x(int y) { x = y; } + ----- + + ----- + void set_x(int y) { + int x; + + x = y; + write("x is set to x"+x+" and will now be forgotten.\n"); + } + ----- + + In the first example, x is declared outside of any functions, and therefore + will be available to any function declared after it. In that example, + x is a global variable. + In the second example, x is declared inside the function set_x(). It + only exists while the function set_x() is being executed. Afterwards, + it ceases to exist. In that example, x is a local variable. + + 6.4 Manipulating the values of variables + Instructions to the driver are used to manipulate the values of variables. + An example of an instruction would be: + + ----- + x = 5; + ----- + + The above instruction is self-explanatory. It assigns to the variable + x the value 5. However, there are some important concepts in involved + in that instruction which are involved in instructions in general. + The first involves the concept of an expression. An expression is + any series of symbols which have a value. In the above instruction, + the variable x is assigned the value of the expression 5. Constant + values are the simplest forms in which expressions can be put. A constant + is a value that never changes like the int 5 or the string "hello". + The last concept is the concept of an operator. In the above example, + the assignment operator = is used. + + There are however many more operators in LPC, and expressions can get + quite complex. If we go up one level of complexity, we get: + + ----- + y = 5; + x = y +2; + ----- + + The first instruction uses the assignment operator to assign the value + of the constant expression 5 to the variable y. The second one + uses the assignment operator to assign to x the value of the expression + (y+2) which uses the addition operator to come up with a value which + is the sum of the value of y and the value of the constant expression 2. + Sound like a lot of hot air? + + In another manner of speaking, operators can be used to form complex + expressions. In the above example, there are two expressions in the + one instruction x = y + 2;: + 1) the expression y+2 + 2) the expression x = y + 2 + As stated before, all expressions have a value. The expression + y+2 has the value of the sum of y and 2 (here, 7); + The expression x = y + 2 *also* has the value of 7. + So operators have to important tasks: + 1) They *may* act upon input like a function + 2) They evaluate as having a value themselves. + Now, not all operators do what 1 does. The = operators does act upon + the value of 7 on its right by assigning that value to x. The operator + + however does nothing. They both, however, have their own values. + + 6.5 Complex expressions + As you may have noticed above, the expression x = 5 *itself* has a value + of 5. In fact, since LPC operators themselves have value as expressions, + they cal allow you to write some really convoluted looking nonsense like: + i = ( (x=sizeof(tmp=users())) ? --x : sizeof(tmp=children("/std/monster"))-1) + which says basically: + assing to tmp the array returned by the efun users(), then assign to x + the value equal to the number of elements to that array. If the value + of the expression assigning the value to x is true (not 0), then assign + x by 1 and assign the value of x-1 to i. If x is false though, + then set tmp to the array returned by the efun children(), and then + assign to i the value of the number of members in the array tmp -1. + Would you ever use the above statement? I doubt it. However you might + see or use expressions similar to it, since the ability to consolidate + so much information into one single line helps to speed up the execution of + your code. A more often used version of this property of LPC operators + would be something like: + x = sizeof(tmp = users()); + while(i--) write((string)tmp[i]->GetKeyName()+"\n"); + instead of writing something like: + tmp = users(); + x = sizeof(tmp); + for(i=0; i<x; i++) write((string)tmp[i]->GetKeyName()+"\n"); + Things like for(), while(), arrays and such will be explained later. + But the first bit of code is more concise and it executed faster. + + NOTE: A detailed description of all basic LPC operators follows the chapter + summary. + + + 6.6 Chapter Summary + You now know how to declare variables and understand the difference between + declaring and using them globally or locally. Once you become familiar + with your driver's efuns, you can display those values in many different + ways. In addition, through the LPC operators, you know how to change + and evaluate the values contained in variables. This is useful of course + in that it allows you to do something like count how many apples have + been picked from a tree, so that once all apples have been picked, no + players can pick more. Unfortunately, you do not know how to have + code executed in anything other than a linera fashion. In other words, + hold off on that apple until the next chapter, cause you do not know + how to check if the apples picked is equal to the number of apples in the + tree. You also do not know about the special function init() where you + give new commands to players. But you are almost ready to code a nice, + fairly complex area. + + 6.7 LPC operators + This section contains a detailed listing of the simpler LPC operators, + including what they do to the values they use (if anything) and the value + that they have. + + The operators described here are: + = + - * / % += -= *= /= %= + -- ++ == != > < >= <= ! && || + -> ? : + + Those operators are all described in a rather dry manner below, but it is best + to at least look at each one, since some may not behave *exactly* as + you think. But it should make a rather good reference guide. + + = assignment operator: + example: x = 5; + value: the value of the variable on the *left* after its function is done + explanation: It takes the value of any expression on the *right* and + assigns it to the variable on the *left*. Note that you must use + a single variable on the left, as you cannot assign values to + constants or complex expressions. + + + addition operator: + example: x + 7 + value: The sum of the value on the left and the value on the right + exaplanation: It takes the value of the expression on the right and + adds it to the value of the expression on the left. For values + of type int, this means the numerical sum. For strings, + it means that the value on the right is stuck onto the value on + the left ("ab" is the value of "a"+"b"). This operator does not + modify any of the original values (i.e. the variable x from + above retains its old value). + + - subtraction operator: + example: x - 7 + value: the value of the expression on the left reduced by the right + explanation: Same characteristics as addition, except it subtracts. + With strings: "a" is the value of "ab" - "b" + + * multiplication operator: + example: x*7 + value and explanation: same as with adding and subtracting except + this one performs the math of multiplication + + / division operator: + example: x/7 + value and explanation: see above + + += additive assignment operator: + example: x += 5 + value: the same as x + 5 + exaplanation: It takes the value of the variable on the left + and the value of the expression on the right, adds them together + and assigns the sum to the variable on the left. + example: if x = 2... x += 5 assigns the value + 7 to the variable x. The whole expression + has the value of 7. + + -= subtraction assignment operator + example: x-=7 + value: the value of the left value reduced by the right value + examplanation: The same as += except for subtraction. + + *= multiplicative assignment operator + example: x *= 7 + value: the value of the left value multiplied by the right + explanation: Similar to -= and += except for addition. + + /= division assignment operator + example: x /= 7 + value: the value of the variable on the left divided by the right value + explanation: similar to above, except with division + + ++ post/pre-increment operators + examples: i++ or ++i + values: + i++ has the value of i + ++i has the value of i+1 + explanation: ++ changes the value of i by increasing it by 1. + However, the value of the expression depends on where you + place the ++. ++i is the pre-increment operator. This means + that it performs the increment *before* giving a value. + i++ is the post-ncrement operator. It evalutes before incrementing + i. What is the point? Well, it does not much matter to you at + this point, but you should recognize what it means. + + -- post/pre-decrement operators + examples: i-- or --i + values: + i-- the value of i + --i the value of i reduced by 1 + explanation: like ++ except for subtraction + + == equality operator + example: x == 5 + value: true or false (not 0 or 0) + explanation: it does nothing to either value, but + it returns true if the 2 values are the same. + It returns false if they are not equal. + + != inequality operator + example: x != 5 + value: true or false + explanation returns true if the left expression is not equal to the right + expression. It returns fals if they are equal + + > greater than operator + example: x > 5 + value: true or false + explanation: true only if x has a value greater than 5 + false if the value is equal or less + + < less than operator + >= greater than or equal to operator + <= less than or equal to operator + examples: x < y x >= y x <= y + values: true or false + explanation: similar as to > except + < true if left is less than right + >= true if left is greater than *or equal to* right + <= true if the left is less than *or equal to* the right + + && logical and operator + || logical or operator + examples: x && y x || y + values: true or false + explanation: If the right value and left value are non-zero, && is true. + If either are false, then && is false. + For ||, only one of the values must be true for it to evaluate + as true. It is only false if both values indeed + are false + + ! negation operator + example: !x + value: true or false + explanation: If x is true, then !x is false + If x is false, !x is true. + + A pair of more complicated ones that are here just for the sake of being + here. Do not worry if they utterly confuse you. + + -> the call other operator + example: this_player()->GetKeyName() + value: The value returned by the function being called + explanation: It calls the function which is on the right in the object + on the left side of the operator. The left expression *must* be + an object, and the right expression *must* be the name of a function. + If not such function exists in the object, it will return 0 (or + more correctly, undefined). + + ? : conditional operator + example: x ? y : z + values: in the above example, if x is try, the value is y + if x is false, the value of the expression is z + explanation: If the leftmost value is true, it will give the expression as + a whole the value of the middle expression. Else, it will give the + expression as a whole the value of the rightmost expression. + + A note on equality: A very nasty error people make that is VERY difficult + to debug is the error of placing = where you mean ==. Since + operators return values, they both make sense when being evaluated. + In other words, no error occurs. But they have very different values. For example: + if(x == 5) if(x = 5) + The value of x == 5 is true if the value of x is 5, false othewise. + The value of x = 5 is 5 (and therefore always true). + The if statement is looking for the expression in () to be either true or false, + so if you had = and meant ==, you would end up with an expression that is + always true. And you would pull your hair out trying to figure out + why things were not happening like they should :) diff -c -r --new-file ds1.1/lib/doc/manual/chapter07 ds2.0r27/lib/doc/manual/chapter07 *** ds1.1/lib/doc/manual/chapter07 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter07 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,433 ---- + chapter 7 "Flow Control" + LPC Basics + Written by Descartes of Borg + first edition: 23 april 1993 + second edition: 10 july 1993 + + CHAPTER 7: Flow Control + + 7.1 Review of variables + Variables may be manipulated by assigning or changing values with the + expressions =, +=, -=, ++, --. Those expressions may be combined with + the expressions -, +, *, /, %. However, so far, you have only been + shown how to use a function to do these in a linear way. For example: + + int hello(int x) { + x--; + write("Hello, x is "+x+".\n"); + return x; + } + + is a function you should know how to write and understand. But what + if you wanted to write the value of x only if x = 1? Or what if + you wanted it to keep writing x over and over until x = 1 before + returning? LPC uses flow control in exactly the same way as C and C++. + + 7.2 The LPC flow control statements + LPC uses the following expressions: + + if(expression) instruction; + + if(expression) instruction; + else instruction; + + if(expression) instruction; + else if(expression) instruction; + else instruction; + + while(expression) instruction; + + do { instruction; } while(expression); + + switch(expression) { + case (expression): instruction; break; + default: instruction; + } + + Before we discuss these, first something on what is meant by expression and + instruction. An expression is anything with a value like a variable, + a comparison (like x>5, where if x is 6 or more, the value is 1, else the + value is 0), or an assignment(like x += 2). An instruction can be any + single line of lpc code like a function call, a value assignment or + modification, etc. + + You should know also the operators &&, ||, ==, !=, and !. These are the + logical operators. They return a nonzero value when true, and 0 when false. + Make note of the values of the following expressions: + + (1 && 1) value: 1 (1 and 1) + (1 && 0) value: 0 (1 and 0) + (1 || 0) value: 1 (1 or 0) + (1 == 1) value: 1 (1 is equal to 1) + (1 != 1) value: 0 (1 is not equal to 1) + (!1) value: 0 (not 1) + (!0) value: 1 (not 0) + + In expressions using &&, if the value of the first item being compared + is 0, the second is never tested even. When using ||, if the first is + true (1), then the second is not tested. + + 7.3 if() + The first expression to look at that alters flow control is if(). Take + a look at the following example: + + 1 void reset() { + 2 int x; + 3 + 4 ::reset(); + 5 x = random(10); + 6 if(x > 50) SetSearch_func("floorboards", "search_floor"); + 7 } + + The line numbers are for reference only. + In line 2, of course we declare a variable of type int called x. Line 3 + is aethetic whitespace to clearly show where the declarations end and the + function code begins. The variable x is only available to the function + reset(). + Line 4 makes a call to the room.c version of reset(). + Line 5 uses the driver efun random() to return a random number between + 0 and the parameter minus 1. So here we are looking for a number between + 0 and 99. + In line 6, we test the value of the expression (x>50) to see if it is true + or false. If it is true, then it makes a call to the room.c function + SetSearch_func(). If it is false, the call to SetSearch_func() is never + executed. + In line 7, the function returns driver control to the calling function + (the driver itself in this case) without returning any value. + + If you had wanted to execute multiple instructions instead of just the one, + you would have done it in the following manner: + + if(x>50) { + SetSearch_func("floorboards", "search_floor"); + if(!present("beggar", this_object())) make_beggar(); + } + + Notice the {} encapsulate the instructions to be executed if the test + expression is true. In the example, again we call the room.c function + which sets a function (search_floor()) that you will later define yourself + to be called when the player types "search floorboards" (NOTE: This is + highly mudlib dependent. Nightmare mudlibs have this function call. + Others may have something similar, while others may not have this feature + under any name). Next, there is another if() expression that tests the + truth of the expression (!present("beggar",this_object())). The ! in the + test expression changes the truth of the expression which follows it. In + this case, it changes the truth of the efun present(), which will return + the object that is a beggar if it is in the room (this_object()), or it + will return 0 if there is no beggar in the room. So if there is a beggar + still living in the room, (present("beggar", this_object())) will have + a value equal to the beggar object (data type object), otherwise it will + be 0. The ! will change a 0 to a 1, or any nonzero value (like the + beggar object) to a 0. Therefore, the expression + (!present("beggar", this_object())) is true if there is no beggar in the + room, and false if there is. So, if there is no beggar in the room, + then it calls the function you define in your room code that makes a + new beggar and puts it in the room. (If there is a beggar in the room, + we do not want to add yet another one :)) + + Of course, if()'s often comes with ands or buts :). In LPC, the formal + reading of the if() statement is: + + if(expression) { set of intructions } + else if(expression) { set of instructions } + else { set of instructions } + + This means: + + If expression is true, then do these instructions. + Otherise, if this second expression is true, do this second set. + And if none of those were true, then do this last set. + + You can have if() alone: + + if(x>5) write("Foo,\n"); + + with an else if(): + + if(x > 5) write("X is greater than 5.\n"); + else if(x >2) write("X is less than 6, but greater than 2.\n"); + + with an else: + + if(x>5) write("X is greater than 5.\n"); + else write("X is less than 6.\n"); + + or the whole lot of them as listed above. You can have any number of + else if()'s in the expression, but you must have one and only one + if() and at most one else. Of course, as with the beggar example, + you may nest if() statements inside if() instructions. (For example, + if(x>5) { + if(x==7) write("Lucky number!\n"); + else write("Roll again.\n"); + } + else write("You lose.\n"); + + 7.4 The statements: while() and do {} while() + Prototype: + while(expression) { set of instructions } + do { set of instructions } while(expression); + + These allow you to create a set of instructions which continue to + execute so long as some expression is true. Suppose you wanted to + set a variable equal to a player's level and keep subtracting random + amounts of either money or hp from a player until that variable equals + 0 (so that player's of higher levels would lose more). You might do it + this way: + + 1 int x; + 2 + 3 x = (int)this_player()->query_level(); /* this has yet to be explained */ + 4 while(x > 0) { + 5 if(random(2)) this_player()->add_money("silver", -random(50)); + 6 else this_player()->add_hp(-(random(10)); + 7 x--; + 8 } + + The expression this_player()->query_level() calIn line 4, we start a loop that executes so long as x is greater than 0. + Another way we could have done this line would be: + while(x) { + The problem with that would be if we later made a change to the funtion + y anywhere between 0 and 49 coins. + In line 6, if instead it returns 0, we call the add_hp() function in the + player which reduces the player's hit points anywhere between 0 and 9 hp. + In line 7, we reduce x by 1. + At line 8, the execution comes to the end of the while() instructions and + goes back up to line 4 to see if x is still greater than 0. This + loop will keep executing until x is finally less than 1. + + You might, however, want to test an expression *after* you execute some + instructions. For instance, in the above, if you wanted to execute + the instructions at least once for everyone, even if their level is + below the test level: + + int x; + + x = (int)this_player()->query_level(); + do { + if(random(2)) this_player()->add_money("silver", -random(50)); + else this_player()->add_hp(-random(10)); + x--; + } while(x > 0); + + This is a rather bizarre example, being as few muds have level 0 players. + And even still, you could have done it using the original loop with + a different test. Nevertheless, it is intended to show how a do{} while() + works. As you see, instead of initiating the test at the beginning of the + loop (which would immediately exclude some values of x), it tests after + the loop has been executed. This assures that the instructions of the loop + get executed at least one time, no matter what x is. + + 7.5 for() loops + Prototype: + for(initialize values ; test expression ; instruction) { instructions } + + initialize values: + This allows you to set starting values of variables which will be used + in the loop. This part is optional. + + test expression: + Same as the expression in if() and while(). The loop is executed + as long as this expression (or expressions) is true. You must have a + test expression. + + instruction: + An expression (or expressions) which is to be executed at the end of each + loop. This is optional. + + Note: + for(;expression;) {} + IS EXACTLY THE SAME AS + while(expression) {} + + Example: + + 1 int x; + 2 + 3 for(x= (int)this_player()->query_level(); x>0; x--) { + 4 if(random(2)) this_player()->add_money("silver", -random(50)); + 5 else this_player()->add_hp(-random(10)); + 6 } + + This for() loop behaves EXACTLY like the while() example. + Additionally, if you wanted to initialize 2 variables: + + for(x=0, y=random(20); x<y; x++) { write(x+"\n"); } + + Here, we initialize 2 variables, x and y, and we separate them by a + comma. You can do the same with any of the 3 parts of the for() + expression. + + 7.6 The statement: switch() + Prototype: + switch(expression) { + case constant: instructions + case constant: instructions + ... + case constant: instructions + default: instructions + } + + This is functionally much like if() expressions, and much nicer to the + CPU, however most rarely used because it looks so damn complicated. + But it is not. + + First off, the expression is not a test. The cases are tests. A English + sounding way to read: + + 1 int x; + 2 + 3 x = random(5); + 4 switch(x) { + 5 case 1: write("X is 1.\n"); + 6 case 2: x++; + 7 default: x--; + 8 } + 9 write(x+"\n"); + + is: + + set variable x to a random number between 0 and 4. + In case 1 of variable x write its value add 1 to it and subtract 1. + In case 2 of variable x, add 1 to its value and then subtract 1. + In other cases subtract 1. + Write the value of x. + + switch(x) basically tells the driver that the variable x is the value + we are trying to match to a case. + Once the driver finds a case which matches, that case *and all following + cases* will be acted upon. You may break out of the switch statement + as well as any other flow control statement with a break instruction in + order only to execute a single case. But that will be explained later. + The default statement is one that will be executed for any value of + x so long as the switch() flow has not been broken. You may use any + data type in a switch statement: + + string name; + + name = (string)this_player()->GetKeyName(); + switch(name) { + case "descartes": write("You borg.\n"); + case "flamme": + case "forlock": + case "shadowwolf": write("You are a Nightmare head arch.\n"); + default: write("You exist.\n"); + } + + For me, I would see: + You borg. + You are a Nightmare head arch. + You exist. + + Flamme, Forlock, or Shadowwolf would see: + You are a Nightmare head arch. + You exist. + + Everyone else would see: + You exist. + + 7.7 Altering the flow of functions and flow control statements + The following instructions: + return continue break + + alter the natural flow of things as described above. + First of all, + return + no matter where it occurs in a function, will cease the execution of that + function and return control to the function which called the one the + return statement is in. If the function is NOT of type void, then a + value must follow the return statement, and that value must be of a + type matching the function. An absolute value function would look + like this: + + int absolute_value(int x) { + if(x>-1) return x; + else return -x; + } + + In the second line, the function ceases execution and returns to the calling + function because the desired value has been found if x is a positive + number. + + continue is most often used in for() and while statements. It serves + to stop the execution of the current loop and send the execution back + to the beginning of the loop. For instance, say you wanted to avoid + division by 0: + + x= 4; + while( x > -5) { + x-- + if(!x) continue; + write((100/x)+"\n"); + } + write("Done.\n") + + You would see the following output: + 33 + 50 + 100 + -100 + -50 + -33 + -25 + Done. + To avoid an error, it checks in each loop to make sure x is not 0. + If x is zero, then it starts back with the test expression without + finishing its current loop. + + In a for() expression + for(x=3; x>-5; x--) { + if(!x) continue; + write((100/x)+"\n"); + } + write("Done.\n"); + It works much the same way. Note this gives exactly the same output + as before. At x=1, it tests to see if x is zero, it is not, so it + writes 100/x, then goes back to the top, subtracts one from x, checks to + see if it is zero again, and it is zero, so it goes back to the top + and subtracts 1 again. + + break + This one ceases the function of a flow control statement. No matter + where you are in the statement, the control of the program will go + to the end of the loop. So, if in the above examples, we had + used break instead of continue, the output would have looked like this: + + 33 + 50 + 100 + Done. + + continue is most often used with the for() and while() statements. + break however is mostly used with switch() + + switch(name) { + case "descartes": write("You are borg.\n"); break; + case "flamme": write("You are flamme.\n"); break; + case "forlock": write("You are forlock.\n"); break; + case "shadowwolf": write("You are shadowwolf.\n"); break; + default: write("You will be assimilated.\n"); + } + + This functions just like: + + if(name == "descartes") write("You are borg.\n"); + else if(name == "flamme") write("You are flamme.\n"); + else if(name == "forlock") write("You are forlock.\n"); + else if(name == "shadowwolf") write("You are shadowwolf.\n"); + else write("You will be assimilated.\n"); + + except the switch statement is much better on the CPU. + If any of these are placed in nested statements, then they alter the + flow of the most immediate statement. + + 7.8 Chapter summary + This chapter covered one hell of a lot, but it was stuff that needed to + be seen all at once. You should now completely understand if() for() + while() do{} while() and switch(), as well as how to alter their flow + using return, continue, and break. Effeciency says if it can be done in + a natural way using switch() instead of a lot of if() else if()'s, then + by all means do it. You were also introduced to the idea of calling + functions in other objects. That however, is a topic to be detailed later. + You now should be completely at ease writing simple rooms (if you have + read your mudlib's room building document), simple monsters, and + other sorts of simple objects. diff -c -r --new-file ds1.1/lib/doc/manual/chapter08 ds2.0r27/lib/doc/manual/chapter08 *** ds1.1/lib/doc/manual/chapter08 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter08 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,196 ---- + chapter 8 "LPC Basics" + LPC Basics + Written by Descartes of Borg + first edition: 23 april 1993 + second edition: 12 july 1993 + + CHAPTER 8: The data type "object" + + 8.1 Review + You should now be able to do anything so long as you stick to calling + functions within your own object. You should also know, that at the + bare minimum you can get the create() (or reset()) function in your object + called to start just by loading it into memory, and that your reset() + function will be called every now and then so that you may write the + code necessary to refresh your room. Note that neither of these + functions MUST be in your object. The driver checks to see if the + function exists in your object first. If it does not, then it does not + bother. You are also acquainted with the data types void, int, and string. + + 7.2 Objects as data types + In this chapter you will be acquainted with a more complex data type, + object. An object variable points to a real object loaded into the + driver's memory. You declare it in the same manner as other data types: + object ob; + It differs in that you cannot use +, -, +=, -=, *, or / (what would it + mean to divide a monster by another monster?). And since efuns like + say() and write() only want strings or ints, you cannot write() or + say() them (again, what would it mean to say a monster?). + But you can use them with some other of the most important efuns on any + LPMud. + + 8.3 The efun: this_object() + This is an efun which returns an object in which the function being executed + exists. In other words, in a file, this_object() refers to the object your + file is in whether the file gets cloned itself or inherted by another file. + It is often useful when you are writing a file which is getting inherited + by another file. Say you are writing your own living.c which gets + inherited by user.c and monster.c, but never used alone. You want to log + the function set_level() it is a player's level being set (but you do not + care if it is a monster. + You might do this: + + void set_level(int x) { + if(this_object()->is_player()) log_file("levels", "foo\n"); + level = x; + } + + Since is_player() is not defined in living.c or anything it inherits, + just saying if(is_player()) will result in an error since the driver + does not find that function in your file or anything it inherits. + this_object() allows you to access functions which may or may not be + present in any final products because your file is inherited by others + without resulting in an error. + + 8.4 Calling functions in other objects + This of course introduces us to the most important characteristic of + the object data type. It allows us to access functions in other objects. + In previous examples you have been able to find out about a player's level, + reduce the money they have, and how much hp they have. + Calls to functions in other objects may be done in two ways: + + object->function(parameters) + call_other(object, "function", parameters); + + example: + this_player()->add_money("silver", -5); + call_other(this_player(), "add_money", "silver", -5); + + In some (very loose sense), the game is just a chain reaction of function + calls initiated by player commands. When a player initiates a chain of + function calls, that player is the object which is returned by + the efun this_player(). So, since this_player() can change depending + on who initiated the sequence of events, you want to be very careful + as to where you place calls to functions in this_player(). The most common + place you do this is through the last important lfun (we have mentioned + create() and reset()) init(). + + 8.5 The lfun: init() + Any time a living thing encounters an object (enters a new room, or enters + the same room as a certain other object), init() is called in all of + the objects the living being newly encounters. It is at this point + that you can add commands the player can issue in order to act. + Here is a sample init() function in a flower. + + void init() { + ::init(); + add_action("smell_flower", "smell"); + } + + Ito smell_flower(). So you should have smell_flower() look like this: + + 1 int smell_flower(string str); /* action functions are type int */ + 2 + 3 int smell_flower(string str) { + 4 if(str != "flower") return 0; /* it is not the flower being smelled */ + 5 write("You sniff the flower.\n"); + 6 say((string)this_player()->GetName()+" smells the flower.\n"); + 7 this_player()->add_hp(random(5)); + 8 return 1; + 9 } + + In line 1, we have our function declared. + In line 3, smell_flower() begins. str becomes whatever comes after the + players command (not including the first white space). + In line 4, it checks to see if the player had typed "smell flower". If + the player had typed "smell cheese", then str would be "cheese". If + it is not in fact "flower" which is being smelled, then 0 is returned, + letting the driver know that this was not the function which should + have been called. If in fact the player had a piece of cheese as well + which had a smell command to it, the driver would then call the function + for smelling in that object. The driver will keep calling all functions + tied to smell commands until one of them returns 1. If they all return + 0, then the player sees "What?" + In line 5, the efun write() is called. write() prints the string which + is passed to it to this_player(). So whoever typed the command here + sees "You sniff the flower." + In line 6, the efun say() is called. say() prints the string which is + doing the sniffing, we have to call the GetName() function + in this_player(). That way if the player is invis, it will say + "Someone" (or something like that), and it will also be properly + capitalized. + In line 7, we call the add_hp() function in the this_player() object, + since we want to do a little healing for the sniff (Note: do not + code this object on your mud, whoever balances your mud will shoot you). + In line 8, we return control of the game to the driver, returning 1 to + let it know that this was in fact the right function to call. + + 8.6 Adding objects to your rooms + And now, using the data type object, you can add monsters to your rooms: + + void create() { + ::create(); + SetProperty("light", 3); + set("short", "Krasna Square"); + set("long", "Welcome to the Central Square of the town of Praxis.\n"); + SetExits( ({ "/domains/standard/hall" }), ({ "east" }) ); + } + + void reset() { + object ob; + + ::reset(); + if(present("guard")) return; /* Do not want to add a guard if */ + ob = new("/std/monster"); /* one is already here */ + ob->SetKeyName("guard"); + ob->set("id", ({ "guard", "town guard" }) ); + ob->set("short", "Town guard"); + ob->set("long", "He guards Praxis from nothingness.\n"); + ob->SetGender("male"); + ob->set_race("human"); + ob->set_level(10); + ob->set_alignment(200); + ob->set_humanoid(); + ob->set_hp(150); + ob->set_wielding_limbs( ({ "right hand", "left hand" }) ); + ob->eventMove(this_object()); + } + + Now, this will be wildly different on most muds. Some, as noted before, + in that object so you have a uniquely configured monster object. The + last act in native muds is to call eventMove() in the monster object to move + it to this room (this_object()). In compat muds, you call the efun + move_object() which takes two parameters, the object to be moved, and the + object into which it is being moved. + + 8.7 Chapter summary + At this point, you now have enough knowledge to code some really nice + stuff. Of course, as I have been stressing all along, you really need + to read the documents on building for your mud, as they detail which + functions exist in which types of objects for you to call. No matter + what your knowledge of the mudlib is, you have enough know-how to + give a player extra things to do like sniffing flowers or glue or whatever. + At this point you should get busy coding stuff. But the moment things + even look to become tedious, that means it is time for you to move to + the next level and do more. Right now code yourself a small area. + Make extensive use of the special functions coded in your mud's + room.c (search the docs for obscure ones no one else seems to use). + Add lots o' neat actions. Create weapons which have magic powers which + gradually fade away. All of this you should be able to do now. Once + this becomes routine for you, it will be time to move on to intermediate + stuff. Note that few people actually get to the intermediate stuff. + If you have played at all, you notice there are few areas on the mud + which do what I just told you you should be able to do. It is not + because it is hard, but because there is a lot of arrogance out there + on the part of people who have gotten beyond this point, and very little + communicating of that knowledge. The trick is to push yourself and + think of something you want to do that is impossible. If you ask someone + in the know how to do X, and they say that is impossible, find out + youself how to code it by experimenting. + + George Reese + Descartes of Borg + 12 july 1993 + borg@hebron.connected.com + Descartes@Nightmare (intermud) + Descartes@Igor (not intermud) diff -c -r --new-file ds1.1/lib/doc/manual/chapter09 ds2.0r27/lib/doc/manual/chapter09 *** ds1.1/lib/doc/manual/chapter09 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter09 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,144 ---- + chapter 9 "Introduction to Intermediate LPC" + Intermediate LPC + Descartes of Borg + Novermber 1993 + + Chapter 1: Introduction + + 1.1 LPC Basics + Anyone reading this textbook should either have read the textbook LPC + Basics or be familiar enough with mud realm coding such that not only are + they capable of building rooms and other such objects involved in area + coding, but they also have a good idea of what is going on when the code + they write is executing. If you do not feel you are at this point, then go + back and read LPC Basics before continuing. If you do so, you will find + that what you read here will be much more meaningful to you. + + 1.2 Goals of This Textbook + The introductory textbook was meant to take people new to LPC from + knowing nothing to being able to code a nice realm on any LPMud. There + is naturally much more to LPC and to LPMud building, however, than + building rooms, armours, monsters, and weapons. As you get into more + complicated concepts like guilds, or desire to do more involved things with + your realm, you will find the concepts detailed in LPC Basics to be lacking + in support for these projects. Intermediate LPC is designed to take you + beyond the simple realm building process into a full knowledge of LPC for + functioning as a realm builder on an LPMud. The task of mudlib building + itself is left to a later text. After reading this textbook and working through + it by experimenting with actual code, the reader should be able to code game + objects to fit any design or idea they have in mind, so long as I have been + successful. + + 1.3 An Overview + What more is there? Well many of you are quite aware that LPC supports + mappings and arrays and have been asking me why those were not detailed + in LPC Basics. I felt that those concepts were beyond the scope of what I + was trying to do with that textbook and were more fitting to this textbook. + But new tools are all fine and dandy, what matters, however, is what you + can do with those tools. The goal of LPC Basics was to get you to building + quality LPMud realms. Mappings and arrays are not necessary to do that. + The goal of this book is to allow you to code any idea you might want to + code in your area. That ability requires the knowledge of mappings and + arrays. + + Any idea you want to code in an LPMud is possible. LPC is a language + which is amazingly well suited to this task. All that prevents you from + coding your ideas is your knowledge of LPC or an inadequate mudlib or + your mudÕs theme or administrative policies. This textbook cannot make + the mudlib you are working with any better, and it cannot change the mud + theme or the mudÕs administrative policies. Never once think that LPC is + incapable of doing what you want to do. If your idea is prevented by + administrative policies or themes, then it is simply not an idea for your + current mud. If the mudlib is inadequate, talk to the people in charge of + your mudlib about what can be done at the mudlib level to facilitate it. You + would be surprised by what is actually in the mudlib you did not know + about. More important, after reading this textbook, you should be able to + read all of the mudlib code in your mudÕs mudlib and understand what is + going on at each line in the mudlib code. You may not as yet be able to + reproduce that code on your own, but at least you can understand what is + going on at the mudlib level. + + This textbook starts out with a discussion about what the LPMud driver is + doing. One nice thing about this textbook, in general it is completely driver + and mudlib independent (excepting for the Dworkin Game Driver). The + chapter on the game driver does not get into actual implementation, but + instead deals with what all game drivers basically do in order to run the + mud. + + Next I discuss those magic topics everyone wants to know more about, + arrays and mappings. Mappings may be simultaneously the easiest and + most difficult data type to understand. Since they are sort of complex arrays + in a loose sense, you really need to understand arrays before discussing + them. All the same, once you understand them, they are much easier than + arrays to use in real situations. At any rate, spend most of your time + working with that chapter, because it is probably the most difficult, yet most + useful chapter in the book. + + After that follows a brief chapter on the LPC pre-compiler, a tool you can + use for sorting out how your code will look before it gets sent to the + compiler. Despite my horrid intro to it here, this chapter is perhaps the + easiest chapter in the textbook. I put it after the mappings and arrays + chapter for exactly that reason. + + Strings are re-introduced next, going into more detail with how you can do + such things as advanced command handling by breaking up strings. Once + you understand arrays fairly well, this chapter should be really simple. + + The next chapter is the second most important in the book. It may be the + most important if you ever intend to go beyond the intermediate stage and + dive into mudlib coding. That chapter involves the complex ideas behind + LPC inheritance. Since the goal of this textbook is not to teach mudlib + programming, the chapter is not a detailed discussion on object oriented + programming. Understanding this chapter, however, will give you some + good insights into what is involved with object oriented programming, as + well as allow you to build more complex objects by overriding functions + and defining your own base classes. + + Finally, the textbook ends with a simple discussion of code debugging. + This is not an essential chapter, but instead it is meant as more of an + auxiliary supplement to what the knowledge you have accumulated so far. + + 1.4 Not Appearing in This Textbook + Perhaps what might appear to some as the most glaring omission of this + textbook is largely a political omission, shadows. Never have I ever + encountered an example of where a shadow was either the best or most + effecient manner of doing anything. It does not follow from that, however, + that there are no uses for shadows. My reasoning for omitting shadows + from this textbook is that the learner is best served by learning the concepts + in this textbook first and having spent time with them before dealing with + the subject of shadows. In that way, I feel the person learning LPC will be + better capable of judging the merits of using a shadow down the road. I + will discuss shadows in a future textbook. + + If you are someone who uses shadows some or a lot, please do not take the + above paragraph as a personal attack. There may be some perfectly valid + uses for shadows somewhere which I have yet to encounter. Nevertheless, + they are not the ideal way to accomplish any given task, and therefore they + are not considered for the purposes of this textbook an intermediate coding + tool. + + I have also omitted discussions of security and object oriented + programming. Both are quite obviously mudlib issues. Many people, + however, might take exception with my leaving out a discussion of object + oriented programming. I chose to leave that for a later text, since most area + builders code for the creativity, not for the computer science theory. In both + the intermediate and beginner textbooks, I have chosen only to discuss + theory where it is directly applicable to practical LPC programming. For + people who are starting out green in LPC and want to code the next great + mudlib, perhaps theory would be more useful. But for the purposes of this + book, a discussion of object oriented programming is simply a snoozer. I + do plan to get heavy into theory with the next textbook. + + 1.5 Summary + LPC is not difficult to learn. It is a language which, although pathetic + compared to any other language for performing most computer language + tasks, is incredibly powerful and unequalled for the tasks of building an + area in MUD type games. For the beginner, it allows you to easily jump in + and code useful objects without even knowing what you are doing. For the + intermediate person, it allows you to turn any idea you have into textual + virtual reality. And for the advanced person, itÕs object oriented features + can allow you to build one of the most popular games on the internet. What + you can do is simply limited by how much you know. And learning more + does not require a computer science degree. + + Copyright (c) George Reese 1993 diff -c -r --new-file ds1.1/lib/doc/manual/chapter10 ds2.0r27/lib/doc/manual/chapter10 *** ds1.1/lib/doc/manual/chapter10 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter10 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,224 ---- + chapter 10 "The LPMud Driver" + Intermediate LPC + Descartes of Borg + Novermber 1993 + + Chapter 2: The LPMud Driver + + 2.1 Review of Basic Driver/Mudlib Interaction + In the LPC Basics textbook, you learned a lot about the way the mudlib + works, specifically in relation to objects you code in order to build your + realm. Not much was discussed about the interaction between the + mudlib and the driver. You should know, however, that the driver + does the following: + 1) When an object is first loaded into memory, the driver will call + create() in native muds and reset() in compat muds. A creator + uses create() or reset() to give initial values to the object. + 2) At an interval setup by the game administrator, the driver calls the + function reset(). This allows the object to regenerate monsters and + such. Notice that in a compat mud, the same function is used to set up + initial values as is used to reset the room. + 3) Any time a living object comes in contact with an object of any sort, + the driver calls init() in the newly encountered object. This allows + newly encountered objects to give living objects commands to execute + through the add_action() efun, as well as perform other actions which + should happen whenever a living thing encounters a given object. + 4) The driver defines a set of functions known as efuns which are + available to all objects in the game. Examples of commonly used efuns + are: this_player(), this_object(), write(), say(), etc. + + 2.2 The Driver Cycle + The driver is a C program which runs the game. Its basic functions are + to accept connections from the outside world so people can login, + interpret the LPC code which defines LPC objects and how they + function in the game, and accept user input and call the appropriate LPC + functions which match the event. In its most simplest essence, it is an + unending loop. + + Once the game has booted up and is properly functioning (the boot up + process will be discussed in a future, advanced LPC textbook), the + driver enters a loop which does not terminate until the shutdown() efun + is legally called or a bug causes the driver program to crash. First off, + the driver handles any new incoming connections and passes control of + the connection to a login object. After that, the driver puts together a + table of commands which have been entered by users since the last cycle + of the driver. After the command table is assembled, all messages + scheduled to be sent to the connection from the last driver cycle are sent + out to the user. At this point, the driver goes through the table of + commands to be executed and executes each set of commands each + object has stored there. The driver ends its cycle by calling the function + heart_beat() in every object with a heart_beat() set and finally + performing all pending call outs. This chapter will not deal with the + handling of connections, but instead will focus on how the driver + handles user commands and heartbeats and call outs. + + 2.3 User Commands + As noted in section 1.2, the driver stores a list of commands for each + user to be executed each cycle. The commands list has the name of the + living object performing the command, the object which gave the living + object that command, and the function which is to be executed in order + to perform the command. The driver refers to the object which typed in + the command as the command giver. It is the command giver which + gets returned as this_player() in most cases. + + The driver starts at the top of the list of living objects with pending + commands, and successively performs each command it typed by calling + the function associated with the command and passing any arguments + the command giver gave as arguments to the function. As the driver + starts with the commands issued by a new living object, the command + giver variable is changed to be equal to the new living object, so that + during the sequence of functions initiated by that command, the efun + this_player() returns the object which issued the command. + + Let's look at the command buffer for an example player. Since the + execution of his last command, Bozo has typed "north" and "tell + descartes when is the next reboot". The command "north" is associated + with the function "Do_Move()" in the room Bozo is in (the command + "north" is automatically setup by the SetExits() efun in that room). The + command "tell" is not specifically listed as a command for the player, + however, in the player object there is a function called "cmd_hook()" + which is associated with the command "", which matches any possible + user input. + + Once the driver gets down to Bozo, the command giver variable is set to + the object which is Bozo. Then, seeing Bozo typed "north" and the + function "north" is associated with, the driver calls Bozo's_Room- + >Do_Move(0). An argument of 0 is passed to the function since Bozo + only typed the command "north" with no arguments. The room + naturally calls some functions it needs, all the while such that the efun + this_player() returns the object which is Bozo. Eventually, the room + object will call eventMoveLiving() in Bozo, which in turn calls the + move_object() efun. This efun is responsible for changing an object's + environment. + + When the environment of an object changes, the commands available to + it from objects in its previous environment as well as from its previous + environment are removed from the object. Once that is done, the driver + calls the efun init() in the new environment as well as in each object in + the new environment. During each of these calls to init(), the object + Bozo is still the command giver. Thus all add_action() efuns from this + move will apply to Bozo. Once all those calls are done, control passes + back from the move_object() efun to the eventMoveLiving() lfun in Bozo. + eventMoveLiving() returns control back to Do_Move() in the old room, + which returns 1 to signify to the driver that the command action was + successful. If the Do_Move() function had returned 0 for some reason, + the driver would have written "What?" (or whatever your driver's + default bad command message is) to Bozo. + + Once the first command returns 1, the driver proceeds on to Bozo's + second command, following much the same structure. Note that with + "tell descartes when is the next reboot", the driver passes "descartes + when is the next reboot" to the function associated with tell. That + function in turn has to decide what to do with that argument. After that + command returns either 1 or 0, the driver then proceeds on to the next + living object with commands pending, and so on until all living objects + with pending commands have had their commands performed. + + 2.4 The Efuns set_heart_beat() and call_out() + Once all commands are performed for objects with commands pending, + the driver then proceeds to call the heart_beat() function in all objects + listed with the driver as having heartbeats. Whenever an object calls the + efun set_heart_beat() with a non-zero argument (depending on your + driver, what non-zero number may be important, but in most cases you + call it with the int 1). The efun set_heart_beat() adds the object which + calls set_heart_beat() to the list of objects with heartbeats. If you call it + with an argument of 0, then it removes the object from the list of objects + with heartbeats. + + The most common use for heartbeats in the mudlib is to heal players and + monsters and perform combat. Once the driver has finished dealing with + the command list, it goes through the heartbeat list calling heart_beat() in + each object in the list. So for a player, for example, the driver will call + heart_beat() in the player which will: + 1) age the player + 2) heal the player according to a heal rate + 3) check to see if there are any hunted, hunting, or attacking objects + around + 4) perform an attack if step 3 returns true. + 5) any other things which need to happen automatically roughly every + second + + Note that the more objects which have heartbeats, the more processing + which has to happen every cycle the mud is up. Objects with heartbeats + are thus known as the major hog of CPU time on muds. + + The call_out() efun is used to perform timed function calls which do not + need to happen as often as heartbeats, or which just happen once. Call + outs let you specify the function in an object you want called. The + general formula for call outs is: + call_out(func, time, args); + The third argument specifying arguments is optional. The first argument + is a string representing the name of the function to be called. The second + argument is how many seconds should pass before the function gets + called. + + Practically speaking, when an object calls call_out(), it is added to a list + of objects with pending call outs with the amount of time of the call out + and the name of the function to be called. Each cycle of the driver, the + time is counted down until it becomes time for the function to be called. + When the time comes, the driver removes the object from the list of + objects with pending call outs and performs the call to the call out + function, passing any special args originally specified by the call out + function. + + If you want a to remove a pending call before it occurs, you need to use + the remove_call_out() efun, passing the name of the function being + called out. The driver will remove the next pending call out to that + function. This means you may have some ambiguity if more than one + call out is pending for the same function. + + In order to make a call out cyclical, you must reissue the call_out() efun + in the function you called out, since the driver automatically removes the + function from the call out table when a call out is performed. Example: + + void foo() { call_out("hello", 10); } + + void hello() { call_out("hello", 10); } + + will set up hello() to be called every 10 seconds after foo() is first called. + There are several things to be careful about here. First, you must watch + to make sure you do not structure your call outs to be recursive in any + unintended fashion. Second, compare what a set_heart_beat() does + when compared directly to what call_out() does. + + set_heart_beat(): + a) Adds this_object() to a table listing objects with heartbeats. + b) The function heart_beat() in this_object() gets called every single + driver cycle. + + call_out(): + a) Adds this_object(), the name of a function in this_object(), a time + delay, and a set of arguments to a table listing functions with pending + call outs. + b) The function named is called only once, and that call comes after the + specified delay. + + As you can see, there is a much greater memory overhead associated + with call outs for part (a), yet that there is a much greater CPU overhead + associated with heartbeats as shown in part (b), assuming that the delay + for the call out is greater than a single driver cycle. + + Clearly, you do not want to be issuing 1 second call outs, for then you + get the worst of both worlds. Similarly, you do not want to be having + heart beats in objects that can perform the same functions with call outs + of a greater duration than 1 second. I personally have heard much talk + about at what point you should use a call out over a heartbeat. What I + have mostly heard is that for single calls or for cycles of a duration + greater than 10 seconds, it is best to use a call out. For repetitive calls of + durations less than 10 seconds, you are better off using heartbeats. I do + not know if this is true, but I do not think following this can do any + harm. + + 2.5 Summary + Basic to a more in depth understanding of LPC is and understanding of + the way in which the driver interacts with the mudlib. You should now + understand the order in which the driver performs functions, as well as a + more detailed knowledge of the efuns this_player(), add_action(), and + move_object() and the lfun init(). In addition to this building upon + knowledge you got from the LPC Basics textbook, this chapter has + introduced call outs and heartbeats and the manner in which the driver + handles them. You should now have a basic understanding of call outs + and heartbeats such that you can experiment with them in your realm + code. + + Copyright (c) George Reese 1993 diff -c -r --new-file ds1.1/lib/doc/manual/chapter11 ds2.0r27/lib/doc/manual/chapter11 *** ds1.1/lib/doc/manual/chapter11 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter11 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,477 ---- + chapter 11 "Complex Data Types" + Intermediate LPC + Descartes of Borg + November 1993 + + Chapter 3: Complex Data Types + + 3.1 Simple Data Types + In the textbook LPC Basics, you learned about the common, basic LPC + data types: int, string, object, void. Most important you learned that + many operations and functions behave differently based on the data type + of the variables upon which they are operating. Some operators and + functions will even give errors if you use them with the wrong data + types. For example, "a"+"b" is handled much differently than 1+1. + When you ass "a"+"b", you are adding "b" onto the end of "a" to get + "ab". On the other hand, when you add 1+1, you do not get 11, you get + 2 as you would expect. + + I refer to these data types as simple data types, because they atomic in + that they cannot be broken down into smaller component data types. + The object data type is a sort of exception, but you really cannot refer + individually to the components which make it up, so I refer to it as a + simple data type. + + This chapter introduces the concept of the complex data type, a data type + which is made up of units of simple data types. LPC has two common + complex data types, both kinds of arrays. First, there is the traditional + array which stores values in consecutive elements accessed by a number + representing which element they are stored in. Second is an associative + array called a mapping. A mapping associates to values together to + allow a more natural access to data. + + 3.2 The Values NULL and 0 + Before getting fully into arrays, there first should be a full understanding + of the concept of NULL versus the concept of 0. In LPC, a null value is + represented by the integer 0. Although the integer 0 and NULL are often + freely interchangeable, this interchangeability often leads to some great + confusion when you get into the realm of complex data types. You may + have even encountered such confusion while using strings. + + 0 represents a value which for integers means the value you add to + another value yet still retain the value added. This for any addition + operation on any data type, the ZERO value for that data type is the value + that you can add to any other value and get the original value. Thus: A + plus ZERO equals A where A is some value of a given data type and + ZERO is the ZERO value for that data type. This is not any sort of + official mathematical definition. There exists one, but I am not a + mathematician, so I have no idea what the term is. Thus for integers, 0 + is the ZERO value since 1 + 0 equals 1. + + NULL, on the other hand, is the absence of any value or meaning. The + LPC driver will interpret NULL as an integer 0 if it can make sense of it + in that context. In any context besides integer addition, A plus NULL + causes an error. NULL causes an error because adding valueless fields + in other data types to those data types makes no sense. + + Looking at this from another point of view, we can get the ZERO value + for strings by knowing what added to "a" will give us "a" as a result. + The answer is not 0, but instead "". With integers, interchanging NULL + and 0 was acceptable since 0 represents no value with respect to the + integer data type. This interchangeability is not true for other data types, + since their ZERO values do not represent no value. Namely, "" + represents a string of no length and is very different from 0. + + When you first declare any variable of any type, it has no value. Any + data type except integers therefore must be initialized somehow before + you perform any operation on it. Generally, initialization is done in the + create() function for global variables, or at the top of the local function + for local variables by assigning them some value, often the ZERO value + for that data type. For example, in the following code I want to build a + string with random words: + + string build_nonsense() { + string str; + int i; + + str = ""; /* Here str is initialized to the string + ZERO value */ + for(i=0; i<6; i++) { + switch(random(3)+1) { + case 1: str += "bing"; break; + case 2: str += "borg"; break; + case 3: str += "foo"; break; + } + if(i==5) str += ".\n"; + else str += " "; + } + return capitalize(str); + } + + If we had not initialized the variable str, an error would have resulted + from trying to add a string to a NULL value. Instead, this code first + initializes str to the ZERO value for strings, "". After that, it enters a + loop which makes 6 cycles, each time randomly adding one of three + possible words to the string. For all words except the last, an additional + blank character is added. For the last word, a period and a return + character are added. The function then exits the loop, capitalizes the + nonsense string, then exits. + + 3.3 Arrays in LPC + An array is a powerful complex data type of LPC which allows you to + access multiple values through a single variable. For instance, + Nightmare has an indefinite number of currencies in which players may + do business. Only five of those currencies, however, can be considered + hard currencies. A hard currency for the sake of this example is a + currency which is readily exchangeable for any other hard currency, + whereas a soft currency may only be bought, but not sold. In the bank, + there is a list of hard currencies to allow bank keepers to know which + currencies are in fact hard currencies. With simple data types, we would + have to perform the following nasty operation for every exchange + transaction: + + int exchange(string str) { + string from, to; + int amt; + + if(!str) return 0; + if(sscanf(str, "%d %s for %s", amt, from, to) != 3) + return 0; + if(from != "platinum" && from != "gold" && from != + "silver" && + from != "electrum" && from != "copper") { + notify_fail("We do not buy soft currencies!\n"); + return 0; + } + ... + } + + With five hard currencies, we have a rather simple example. After all it + took only two lines of code to represent the if statement which filtered + out bad currencies. But what if you had to check against all the names + which cannot be used to make characters in the game? There might be + 100 of those; would you want to write a 100 part if statement? + What if you wanted to add a currency to the list of hard currencies? That + means you would have to change every check in the game for hard + currencies to add one more part to the if clauses. Arrays allow you + simple access to groups of related data so that you do not have to deal + with each individual value every time you want to perform a group + operation. + + As a constant, an array might look like this: + ({ "platinum", "gold", "silver", "electrum", "copper" }) + which is an array of type string. Individual data values in arrays are + called elements, or sometimes members. In code, just as constant + strings are represented by surrounding them with "", constant arrays are + represented by being surrounded by ({ }), with individual elements of + the array being separated by a ,. + + You may have arrays of any LPC data type, simple or complex. Arrays + made up of mixes of values are called arrays of mixed type. In most + LPC drivers, you declare an array using a throw-back to C language + syntax for arrays. This syntax is often confusing for LPC coders + because the syntax has a meaning in C that simply does not translate into + LPC. Nevertheless, if we wanted an array of type string, we would + declare it in the following manner: + + string *arr; + + In other words, the data type of the elements it will contain followed by + a space and an asterisk. Remember, however, that this newly declared + string array has a NULL value in it at the time of declaration. + + 3.4 Using Arrays + You now should understand how to declare and recognize an array in + code. In order to understand how they work in code, let's review the + bank code, this time using arrays: + + string *hard_currencies; + + int exchange(string str) { + string from, to; + int amt; + + if(!str) return 0; + if(sscanf(str, "%d %s for %s", amt, from, to) != 3) + return 0; + if(member_array(from, hard_currencies) == -1) { + notify_fail("We do not buy soft currencies!\n"); + return 0; + } + ... + } + + This code assumes hard_currencies is a global variable and is initialized + in create() as: + hard_currencies = ({ "platinum", "gold", "electrum", "silver", + "copper" }); + Ideally, you would have hard currencies as a #define in a header file for + all objects to use, but #define is a topic for a later chapter. + + Once you know what the member_array() efun does, this method + certainly is much easier to read as well as is much more efficient and + easier to code. In fact, you can probably guess what the + member_array() efun does: It tells you if a given value is a member of + the array in question. Specifically here, we want to know if the currency + the player is trying to sell is an element in the hard_curencies array. + What might be confusing to you is, not only does member_array() tell us + if the value is an element in the array, but it in fact tells us which element + of the array the value is. + + How does it tell you which element? It is easier to understand arrays if + you think of the array variable as holding a number. In the value above, + for the sake of argument, we will say that hard_currencies holds the + value 179000. This value tells the driver where to look for the array + hard_currencies represents. Thus, hard_currencies points to a place + where the array values may be found. When someone is talking about + the first element of the array, they want the element located at 179000. + When the object needs the value of the second element of the array, it + looks at 179000 + one value, then 179000 plus two values for the third, + and so on. We can therefore access individual elements of an array by + their index, which is the number of values beyond the starting point of + the array we need to look to find the value. For the array + hard_currencies array: + "platinum" has an index of 0. + "gold" has an index of 1. + "electrum" has an index of 2. + "silver" has an index of 3. + "copper" has an index of 4. + + The efun member_array() thus returns the index of the element being + tested if it is in the array, or -1 if it is not in the array. In order to + reference an individual element in an array, you use its index number in + the following manner: + array_name[index_no] + Example: + hard_currencies[3] + where hard_currencies[3] would refer to "silver". + + So, you now should now several ways in which arrays appear either as + a whole or as individual elements. As a whole, you refer to an array + variable by its name and an array constant by enclosing the array in ({ }) + and separating elements by ,. Individually, you refer to array variables + by the array name followed by the element's index number enclosed in + [], and to array constants in the same way you would refer to simple data + types of the same type as the constant. Examples: + + Whole arrays: + variable: arr + constant: ({ "platinum", "gold", "electrum", "silver", "copper" }) + + Individual members of arrays: + variable: arr[2] + constant: "electrum" + + You can use these means of reference to do all the things you are used to + doing with other data types. You can assign values, use the values in + operations, pass the values as parameters to functions, and use the + values as return types. It is important to remember that when you are + treating an element alone as an individual, the individual element is not + itself an array (unless you are dealing with an array of arrays). In the + example above, the individual elements are strings. So that: + str = arr[3] + " and " + arr[1]; + will create str to equal "silver and gold". Although this seems simple + enough, many people new to arrays start to run into trouble when trying + to add elements to an array. When you are treating an array as a whole + and you wish to add a new element to it, you must do it by adding + another array. + + Note the following example: + string str1, str2; + string *arr; + + str1 = "hi"; + str2 = "bye"; + /* str1 + str2 equals "hibye" */ + arr = ({ str1 }) + ({ str2 }); + /* arr is equal to ({ str1, str2 }) */ + Before going any further, I have to note that this example gives an + extremely horrible way of building an array. You should set it: arr = ({ + str1, str2 }). The point of the example, however, is that you must add + like types together. If you try adding an element to an array as the data + type it is, you will get an error. Instead you have to treat it as an array of + a single element. + + 3.5 Mappings + One of the major advances made in LPMuds since they were created is + the mapping data type. People alternately refer to them as associative + arrays. Practically speaking, a mapping allows you freedom from the + association of a numerical index to a value which arrays require. + Instead, mappings allow you to associate values with indices which + actually have meaning to you, much like a relational database. + + In an array of 5 elements, you access those values solely by their integer + indices which cover the range 0 to 4. Imagine going back to the example + of money again. Players have money of different amounts and different + types. In the player object, you need a way to store the types of money + that exist as well as relate them to the amount of that currency type the + player has. The best way to do this with arrays would have been to + store an array of strings representing money types and an array of + integers representing values in the player object. This would result in + CPU-eating ugly code like this: + + int query_money(string type) { + int i; + + i = member_array(type, currencies); + if(i>-1 && i < sizeof(amounts)) /* sizeof efun + returns # of elements */ + return amounts[i]; + else return 0; + } + + And that is a simple query function. Look at an add function: + + void add_money(string type, int amt) { + string *tmp1; + int * tmp2; + int i, x, j, maxj; + + i = member_array(type, currencies); + if(i >= sizeof(amounts)) /* corrupt data, we are in + a bad way */ + return; + else if(i== -1) { + currencies += ({ type }); + amounts += ({ amt }); + return; + } + else { + amounts[i] += amt; + if(amounts[i] < 1) { + tmp1 = allocate(sizeof(currencies)-1); + tmp2 = allocate(sizeof(amounts)-1); + for(j=0, x =0, maxj=sizeof(tmp1); j < maxj; + j++) { + if(j==i) x = 1; + tmp1[j] = currencies[j+x]; + tmp2[j] = amounts[j+x]; + } + currencies = tmp1; + amounts = tmp2; + } + } + } + + That is really some nasty code to perform the rather simple concept of + adding some money. First, we figure out if the player has any of that + kind of money, and if so, which element of the currencies array it is. + After that, we have to check to see that the integrity of the currency data + has been maintained. If the index of the type in the currencies array is + greater than the highest index of the amounts array, then we have a + problem since the indices are our only way of relating the two arrays. + Once we know our data is in tact, if the currency type is not currently + held by the player, we simply tack on the type as a new element to the + currencies array and the amount as a new element to the amounts array. + Finally, if it is a currency the player currently has, we just add the + amount to the corresponding index in the amounts array. If the money + gets below 1, meaning having no money of that type, we want to clear + the currency out of memory. + + Subtracting an element from an array is no simple matter. Take, for + example, the result of the following: + + string *arr; + + arr = ({ "a", "b", "a" }); + arr -= ({ arr[2] }); + + What do you think the final value of arr is? Well, it is: + ({ "b", "a" }) + Subtracting arr[2] from the original array does not remove the third + element from the array. Instead, it subtracts the value of the third + element of the array from the array. And array subtraction removes the + first instance of the value from the array. Since we do not want to be + forced on counting on the elements of the array as being unique, we are + forced to go through some somersaults to remove the correct element + from both arrays in order to maintain the correspondence of the indices + in the two arrays. + + Mappings provide a better way. They allow you to directly associate the + money type with its value. Some people think of mappings as arrays + where you are not restricted to integers as indices. Truth is, mappings + are an entirely different concept in storing aggregate information. Arrays + force you to choose an index which is meaningful to the machine for + locating the appropriate data. The indices tell the machine how many + elements beyond the first value the value you desire can be found. With + mappings, you choose indices which are meaningful to you without + worrying about how that machine locates and stores it. + + You may recognize mappings in the following forms: + + constant values: + whole: ([ index:value, index:value ]) Ex: ([ "gold":10, "silver":20 ]) + element: 10 + + variable values: + whole: map (where map is the name of a mapping variable) + element: map["gold"] + + So now my monetary functions would look like: + + int query_money(string type) { return money[type]; } + + void add_money(string type, int amt) { + if(!money[type]) money[type] = amt; + else money[type] += amt; + if(money[type] < 1) + map_delete(money, type); /* this is for + MudOS */ + ...OR... + money = m_delete(money, type) /* for some + LPMud 3.* varieties */ + ... OR... + m_delete(money, type); /* for other LPMud 3.* + varieties */ + } + + Please notice first that the efuns for clearing a mapping element from the + mapping vary from driver to driver. Check with your driver's + documentation for the exact name an syntax of the relevant efun. + + As you can see immediately, you do not need to check the integrity of + your data since the values which interest you are inextricably bound to + one another in the mapping. Secondly, getting rid of useless values is a + simple efun call rather than a tricky, CPU-eating loop. Finally, the + query function is made up solely of a return instruction. + + You must declare and initialize any mapping before using it. + Declarations look like: + mapping map; + Whereas common initializations look like: + map = ([]); + map = allocate_mapping(10) ...OR... map = m_allocate(10); + map = ([ "gold": 20, "silver": 15 ]); + + As with other data types, there are rules defining how they work in + common operations like addition and subtraction: + ([ "gold":20, "silver":30 ]) + ([ "electrum":5 ]) + gives: + (["gold":20, "silver":30, "electrum":5]) + Although my demonstration shows a continuity of order, there is in fact + no guarantee of the order in which elements of mappings will stored. + Equivalence tests among mappings are therefore not a good thing. + + 3.6 Summary + Mappings and arrays can be built as complex as you need them to be. + You can have an array of mappings of arrays. Such a thing would be + declared like this: + + mapping *map_of_arrs; + which might look like: + ({ ([ ind1: ({ valA1, valA2}), ind2: ({valB1, valB2}) ]), ([ indX: + ({valX1,valX2}) ]) }) + + Mappings may use any data type as an index, including objects. + Mapping indices are often referred to as keys as well, a term from + databases. Always keep in mind that with any non-integer data type, + you must first initialize a variable before making use of it in common + operations such as addition and subtraction. In spite of the ease and + dynamics added to LPC coding by mappings and arrays, errors caused + by failing to initialize their values can be the most maddening experience + for people new to these data types. I would venture that a very high + percentage of all errors people experimenting with mappings and arrays + for the first time encounter are one of three error messages: + Indexing on illegal type. + Illegal index. + Bad argument 1 to (+ += - -=) /* insert your favourite operator */ + Error messages 1 and 3 are darn near almost always caused by a failure + to initialize the array or mapping in question. Error message 2 is caused + generally when you are trying to use an index in an initialized array + which does not exist. Also, for arrays, often people new to arrays will + get error message 3 because they try to add a single element to an array + by adding the initial array to the single element value instead of adding + an array of the single element to the initial array. Remember, add only + arrays to arrays. + + At this point, you should feel comfortable enough with mappings and + arrays to play with them. Expect to encounter the above error messages + a lot when first playing with these. The key to success with mappings is + in debugging all of these errors and seeing exactly what causes wholes + in your programming which allow you to try to work with uninitialized + mappings and arrays. Finally, go back through the basic room code and + look at things like the SetExits() (or the equivalent on your mudlib) + function. Chances are it makes use of mappings. In some instances, it + will use arrays as well for compatibility with mudlib.n. + + Copyright (c) George Reese 1993 diff -c -r --new-file ds1.1/lib/doc/manual/chapter12 ds2.0r27/lib/doc/manual/chapter12 *** ds1.1/lib/doc/manual/chapter12 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter12 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,183 ---- + chapter 12 "The LPC Pre-Compiler" + Intermediate LPC + Descartes of Borg + November 1993 + + Chapter 4: The LPC Pre-Compiler + + 4.1 Review + The previous chapter was quite heavy, so now I will slow down a bit so + you can digest and play with mappings and arrays by taking on the + rather simple topic of the LPC pre-compiler. By this point, however, + you should well understand how the driver interacts with the mudlib and + be able to code objects which use call outs and heart beats. In addition, + you should be coding simple objects which use mappings and arrays, + noting how these data types perform in objects. It is also a good idea to + start looking in detail at the actual mudlib code that makes up your mud. + See if you understand everything which is going on in your mudlibs + room and monster codes. For things you do not understand, ask the + people on your mud designated to answer creator coding questions. + + Pre-compiler is actually a bit of a misnomer since LPC code is never + truly compiled. Although this is changing with prototypes of newer + LPC drivers, LPC drivers interpret the LPC code written by creators + rather than compile it into binary format. Nevertheless, the LPC pre- + compiler functions still perform much like pre-compilers for compiled + languages in that pre-compiler directives are interpreted before the driver + even starts to look at object code. + + 4.2 Pre-compiler Directives + If you do not know what a pre-compiler is, you really do not need to + worry. With respect to LPC, it is basically a process which happens + before the driver begins to interpret LPC code which allows you to + perform actions upon the entire code found in your file. Since the code + is not yet interpreted, the pre-compiler process is involved before the file + exists as an object and before any LPC functions or instructions are ever + examined. The pre-compiler is thus working at the file level, meaning + that it does not deal with any code in inherited files. + + The pre-compiler searches a file sent to it for pre-compiler directives. + These are little instructions in the file meant only for the pre-compiler + and are not really part of the LPC language. A pre-compiler directive is + any line in a file beginning with a pound (#) sign. Pre-compiler + directives are generally used to construct what the final code of a file will + look at. The most common pre-compiler directives are: + + #define + #undefine + #include + #ifdef + #ifndef + #if + #elseif + #else + #endif + #pragma + + Most realm coders on muds use exclusively the directives #define and + #include. The other directives you may see often and should understand + what they mean even if you never use them. + + The first pair of directives are: + #define + #undefine + + The #define directive sets up a set of characters which will be replaced + any where they exist in the code at precompiler time with their definition. + For example, take: + + #define OB_USER "/std/user" + + This directive has the pre-compiler search the entire file for instances of + OB_USER. Everywhere it sees OB_USER, it replaces with "/std/user". + Note that it does not make OB_USER a variable in the code. The LPC + interpreter never sees the OB_USER label. As stated above, the pre- + compiler is a process which takes place before code interpretation. So + what you wrote as: + + #define OB_USER "/std/user" + + void create() { + if(!file_exists(OB_USER+".c")) write("Merde! No user file!"); + else write("Good! User file still exists!"); + } + + would arrive at the LPC interpreter as: + + void create() { + if(!file_exists("/std/user"+".c")) write("Merde! No user file!"); + else write("Good! User file still exists!"); + } + + Simply put, #define just literally replaces the defined label with whatever + follows it. You may also use #define in a special instance where no + value follows. This is called a binary definition. For example: + + #define __NIGHTMARE + + exists in the config file for the Nightmare Mudlib. This allows for pre- + compiler tests which will be described later in the chapter. + + The other pre-compiler directive you are likely to use often is #include. + As the name implies, #include includes the contents of another file right + into the file being pre-compiled at the point in the file where the directive + is placed. Files made for inclusion into other files are often called header + files. They sometimes contain things like #define directives used by + multiple files and function declarations for the file. The traditional file + extension to header files is .h. + + Include directives follow one of 2 syntax's: + + #include <filename> + #include "filename" + + If you give the absolute name of the file, then which syntax you use is + irrelevant. How you enclose the file name determines how the pre- + compiler searches for the header files. The pre-compiler first searches in + system include directories for files enclosed in <>. For files enclosed in + "", the pre-compiler begins its search in the same directory as the file + going through the pre-compiler. Either way, the pre-compiler will + search the system include directories and the directory of the file for the + header file before giving up. The syntax simply determines the order. + + The simplest pre-compiler directive is the #pragma directive. It is + doubtful you will ever use this one. Basically, you follow the directive + with some keyword which is meaningful to your driver. The only + keyword I have ever seen is strict_types, which simply lets the driver + know you want this file interpreted with strict data typing. I doubt you + will ever need to use this, and you may never even see it. I just included + it in the list in the event you do see it so you do not think it is doing + anything truly meaningful. + + The final group of pre-compiler directives are the conditional pre- + compiler directives. They allow you to pre-compile the file one way + given the truth value of an expression, otherwise pre-compile the file + another way. This is mostly useful for making code portable among + mudlibs, since putting the m_delete() efun in code on a MudOS mud + would normally cause an error, for example. So you might write the + following: + + #ifdef MUDOS + map_delete(map, key); + #else + map = m_delete(map, key); + #endif + + which after being passed through the pre-compiler will appear to the + interpreter as: + + map_delete(map, key); + + on a MudOS mud, and: + + map = m_delete(map, key); + + on other muds. The interpreter never sees the function call that would + cause it to spam out in error. + + Notice that my example made use of a binary definition as described + above. Binary definitions allow you to pass certain code to the + interpreter based on what driver or mudlib you are using, among other + conditions. + + 4.3 Summary + The pre-compiler is a useful LPC tool for maintaining modularity among + your programs. When you have values that might be subject to change, + but are used widely throughout your files, you might stick all of those + values in a header file as #define statements so that any need to make a + future change will cause you to need to change just the #define directive. + A very good example of where this would be useful would be a header + file called money.h which includes the directive: + #define HARD_CURRENCIES ({ "gold", "platinum", "silver", + "electrum", "copper" }) + so that if ever you wanted to add a new hard currency, you only need + change this directive in order to update all files needing to know what the + hard currencies are. + + The LPC pre-compiler also allows you to write code which can be + ported without change among different mudlibs and drivers. Finally, + you should be aware that the pre-compiler only accepts lines ending in + carriage returns. If you want a multiple line pre-compiler directive, you + need to end each incomplete line with a backslash(\). + + Copyright (c) George Reese 1993 diff -c -r --new-file ds1.1/lib/doc/manual/chapter13 ds2.0r27/lib/doc/manual/chapter13 *** ds1.1/lib/doc/manual/chapter13 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter13 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,182 ---- + chapter 13 "Advanced String Handling" + Intermediate LPC + Descartes of Borg + November 1993 + + Chapter 5: Advanced String Handling + + 5.1 What a String Is + The LPC Basics textbook taught strings as simple data types. LPC + generally deals with strings in such a matter. The underlying driver + program, however, is written in C, which has no string data type. The + driver in fact sees strings as a complex data type made up of an array of + characters, a simple C data type. LPC, on the other hand does not + recognize a character data type (there may actually be a driver or two out + there which do recognize the character as a data type, but in general not). + The net effect is that there are some array-like things you can do with + strings that you cannot do with other LPC data types. + + The first efun regarding strings you should learn is the strlen() efun. + This efun returns the length in characters of an LPC string, and is thus + the string equivalent to sizeof() for arrays. Just from the behaviour of + this efun, you can see that the driver treats a string as if it were made up + of smaller elements. In this chapter, you will learn how to deal with + strings on a more basic level, as characters and sub strings. + + 5.2 Strings as Character Arrays + You can do nearly anything with strings that you can do with arrays, + except assign values on a character basis. At the most basic, you can + actually refer to character constants by enclosing them in '' (single + quotes). 'a' and "a" are therefore very different things in LPC. 'a' + represents a character which cannot be used in assignment statements or + any other operations except comparison evaluations. "a" on the other + hand is a string made up of a single character. You can add and subtract + other strings to it and assign it as a value to a variable. + + With string variables, you can access the individual characters to run + comparisons against character constants using exactly the same syntax + that is used with arrays. In other words, the statement: + if(str[2] == 'a') + is a valid LPC statement comparing the second character in the str string + to the character 'a'. You have to be very careful that you are not + comparing elements of arrays to characters, nor are you comparing + characters of strings to strings. + + LPC also allows you to access several characters together using LPC's + range operator ..: + if(str[0..1] == "ab") + In other words, you can look for the string which is formed by the + characters 0 through 1 in the string str. As with arrays, you must be + careful when using indexing or range operators so that you do not try to + reference an index number larger than the last index. Doing so will + result in an error. + + Now you can see a couple of similarities between strings and arrays: + 1) You may index on both to access the values of individual elements. + a) The individual elements of strings are characters + b) The individual elements of arrays match the data type of the + array. + 2) You may operate on a range of values + a) Ex: "abcdef"[1..3] is the string "bcd" + b) Ex: ({ 1, 2, 3, 4, 5 })[1..3] is the int array ({ 2, 3, 4 }) + + And of course, you should always keep in mind the fundamental + difference: a string is not made up of a more fundamental LPC data type. + In other words, you may not act on the individual characters by + assigning them values. + + 5.3 The Efun sscanf() + You cannot do any decent string handling in LPC without using + sscanf(). Without it, you are left trying to play with the full strings + passed by command statements to the command functions. In other + words, you could not handle a command like: "give sword to leo", since + you would have no way of separating "sword to leo" into its constituent + parts. Commands such as these therefore use this efun in order to use + commands with multiple arguments or to make commands more + "English-like". + + Most people find the manual entries for sscanf() to be rather difficult + reading. The function does not lend itself well to the format used by + manual entries. As I said above, the function is used to take a string and + break it into usable parts. Technically it is supposed to take a string and + scan it into one or more variables of varying types. Take the example + above: + + int give(string str) { + string what, whom; + + if(!str) return notify_fail("Give what to whom?\n"); + if(sscanf(str, "%s to %s", what, whom) != 2) + return notify_fail("Give what to whom?\n"); + ... rest of give code ... + } + + The efun sscanf() takes three or more arguments. The first argument is + the string you want scanned. The second argument is called a control + string. The control string is a model which demonstrates in what form + the original string is written, and how it should be divided up. The rest + of the arguments are variables to which you will assign values based + upon the control string. + + The control string is made up of three different types of elements: 1) + constants, 2) variable arguments to be scanned, and 3) variable + arguments to be discarded. You must have as many of the variable + arguments in sscanf() as you have elements of type 2 in your control + string. In the above example, the control string was "%s to %s", which + is a three element control string made up of one constant part (" to "), + and two variable arguments to be scanned ("%s"). There were no + variables to be discarded. + + The control string basically indicates that the function should find the + string " to " in the string str. Whatever comes before that constant will + be placed into the first variable argument as a string. The same thing + will happen to whatever comes after the constant. + + Variable elements are noted by a "%" sign followed by a code for + decoding them. If the variable element is to be discarded, the "%" sign + is followed by the "*" as well as the code for decoding the variable. + Common codes for variable element decoding are "s" for strings and "d" + for integers. In addition, your mudlib may support other conversion + codes, such as "f" for float. So in the two examples above, the "%s" in + the control string indicates that whatever lies in the original string in the + corresponding place will be scanned into a new variable as a string. + + A simple exercise. How would you turn the string "145" into an + integer? + + Answer: + int x; + sscanf("145", "%d", x); + + After the sscanf() function, x will equal the integer 145. + + Whenever you scan a string against a control string, the function + searches the original string for the first instance of the first constant in + the original string. For example, if your string is "magic attack 100" and + you have the following: + int improve(string str) { + string skill; + int x; + + if(sscanf(str, "%s %d", skill, x) != 2) return 0; + ... + } + you would find that you have come up with the wrong return value for + sscanf() (more on the return values later). The control string, "%s %d", + is made up of to variables to be scanned and one constant. The constant + is " ". So the function searches the original string for the first instance + of " ", placing whatever comes before the " " into skill, and trying to + place whatever comes after the " " into x. This separates "magic attack + 100" into the components "magic" and "attack 100". The function, + however, cannot make heads or tales of "attack 100" as an integer, so it + returns 1, meaning that 1 variable value was successfully scanned + ("magic" into skill). + + Perhaps you guessed from the above examples, but the efun sscanf() + returns an int, which is the number of variables into which values from + the original string were successfully scanned. Some examples with + return values for you to examine: + + sscanf("swo rd descartes", "%s to %s", str1, str2) return: 0 + sscanf("swo rd descartes", "%s %s", str1, str2) return: 2 + sscanf("200 gold to descartes", "%d %s to %s", x, str1, str2) return: 3 + sscanf("200 gold to descartes", "%d %*s to %s", x, str1) return: 2 + where x is an int and str1 and str2 are string + + 5.4 Summary + LPC strings can be thought of as arrays of characters, yet always + keeping in mind that LPC does not have the character data type (with + most, but not all drivers). Since the character is not a true LPC data + type, you cannot act upon individual characters in an LPC string in the + same manner you would act upon different data types. Noticing the + intimate relationship between strings and arrays nevertheless makes it + easier to understand such concepts as the range operator and indexing on + strings. + + There are efuns other than sscanf() which involve advanced string + handling, however, they are not needed nearly as often. You should + check on your mud for man or help files on the efuns: explode(), + implode(), replace_string(), sprintf(). All of these are very valuable + tools, especially if you intend to do coding at the mudlib level. + + Copyright (c) George Reese 1993 diff -c -r --new-file ds1.1/lib/doc/manual/chapter14 ds2.0r27/lib/doc/manual/chapter14 *** ds1.1/lib/doc/manual/chapter14 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter14 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,277 ---- + chapter 14 "Intermediate Inheritance" + Intermediate LPC + Descartes of Borg + November 1993 + + Chapter 6: Intermediate Inheritance + + 6.1 Basics of Inheritance + In the textbook LPC Basics, you learned how it is the mudlib maintains + consistency amoung mud objects through inheritance. Inheritance + allows the mud administrators to code the basic functions and such that + all mudlib objects, or all mudlib objects of a certain type must have so + that you can concentrate on creating the functions which make these + objects different. When you build a room, or a weapon, or a monster, + you are taking a set of functions already written for you and inheriting + them into your object. In this way, all objects on the mud can count on + other objects to behave in a certain manner. For instance, player objects + can rely on the fact that all room objects will have a function in them + called GetLong() which describes the room. Inheritance thus keeps + you from having to worry about what the function GetLong() should + look like. + + Naturally, this textbook tries to go beyond this fundamental knowledge + of inheritance to give the coder a better undertstanding of how + inheritance works in LPC programming. Without getting into detail that + the advanced domain coder/beginner mudlib coder simply does not yet + need, this chapter will try to explain exactly what happens when you + inherit an object. + + 6.2 Cloning and Inheritance + Whenever a file is referenced for the first time as an object (as opposed + to reading the contents of the file), the game tries to load the file into + memory and create an object. If the object is successfully loaded into + memory, it becomes as master copy. Master copies of objects may be + cloned but not used as actual game objects. The master copy is used to + support any clone objects in the game. + + The master copy is the source of one of the controversies of mud LPC + coding, that is whether to clone or inherit. With rooms, there is no + question of what you wish to do, since there should only be one instance + of each room object in the game. So you generally use inheritance in + creating rooms. Many mud administrators, including myself, however + encourage creators to clone the standard monster object and configure it + from inside room objects instead of keeping monsters in separate files + which inherit the standard monster object. + + As I stated above, each time a file is referenced to create an object, a + master copy is loaded into memory. When you do something like: + void reset() { + object ob; + ob = new("/std/monster"); + /* clone_object("/std/monster") some places */ + ob->SetKeyName("foo monster"); + ... rest of monster config code followed by moving + it to the room ... + } + the driver searches to see if their is a master object called "/std/monster". + If not, it creates one. If it does exist, or after it has been created, the + driver then creates a clone object called "/std/monster#<number>". If + this is the first time "/std/monster" is being referenced, in effect, two + objects are being created: the master object and the cloned instance. + + On the other hand, let's say you did all your configuring in the create() + of a special monster file which inherits "/std/monster". Instead of + cloning the standard monster object from your room, you clone your + monster file. If the standard monster has not been loaded, it gets loaded + since your monster inherits it. In addition, a master copy of your file + gets loaded into memory. Finally, a clone of your monster is created + and moved into the room, for a total of three objects added to the game. + Note that you cannot make use of the master copy easily to get around + this. If, for example, you were to do: + "/realms/descartes/my_monster"->eventMove(this_object()); + instead of + new("/realms/descartes/my_monster")->eventMove(this_object()); + you would not be able to modify the file "my_monster.c" and update it, + since the update command destroys the current master version of an + object. On some mudlibs it also loads the new version into memory. + Imagine the look on a player's face when their monster disappears in + mid-combat cause you updated the file! + + Cloning is therefore a useful too when you plan on doing just that- + cloning. If you are doing nothing special to a monster which cannot be + done through a few call others, then you will save the mud from getting + loaded with useless master copies. Inheritance, however, is useful if + you plan to add functionality to an object (write your own functions) or + if you have a single configuration that gets used over and over again + (you have an army of orc guards all the same, so you write a special orc + file and clone it). + + 6.3 Inside Inheritance + When objects A and B inherit object C, all three objects have their own + set of data sharing one set of function definitions from object C. In + addition, A and B will have separate functions definitions which were + entered separately into their code. For the sake of example throughout + the rest of the chapter, we will use the following code. Do not be + disturbed if, at this point, some of the code makes no sense: + + STD_ITEM C + private string name, cap_name, short, long; + private int setup; + + void SetKeyName(string str) + nomask string GetKeyName(); + private int query_setup(); + static void unsetup(); + void SetShort(string str); + string GetShort(); + void SetLong(string str); + string GetLong(); + + + void SetKeyName(string str) { + if(!query_setup()) { + name = str; + setup = 1; + } + + nomask string GetKeyName() { return name; } + + private query_setup() { return setup; } + + static void unsetup() { setup = 0; } + + string GetName() { + return (name ? capitalize(name) : ""); } + } + + void SetShort(string str) { short = str; } + + string GetShort() { return short; } + + void SetLong(string str) { long = str; } + + string GetLong() { return str; } + + void create() { seteuid(getuid()); } + + STD_ITEM B + inherit "/std/objectc"; + + private int wc; + + void set_wc(int wc); + int query_wc(); + int wieldweapon(string str); + + void create() { ::create(); } + + void init() { + if(environment(this_object()) == this_player()) + add_action("wieldweapon", "wield"); + } + + void set_wc(int x) { wc = x; } + + int query_wc() { return wc; } + + int wieldweapon(string str) { + ... code for wielding the weapon ... + } + + STD_ITEM A + inherit "/std/objectc"; + + int ghost; + + void create() { ::create(); } + + void change_name(string str) { + if(!((int)this_object()->is_player())) unsetup(); + SetKeyName(str); + } + + string GetName() { + if(ghost) return "A ghost"; + else return ::GetName(); + } + + As you can see, object C is inherited both by object A and object B. + Object C is a representation of a much oversimplified base object, with B + being an equally oversimplified weapon and A being an equally + simplified living object. Only one copy of each function is retained in + memory, even though we have here three objects using the functions. + There are of course, three instances of the variables from Object C in + memory, with one instance of the variables of Object A and Object B in + memory. Each object thus gets its own data. + + 6.4 Function and Variable Labels + Notice that many of the functions above are proceeded with labels which + have not yet appeared in either this text or the beginner text, the labels + static, private, and nomask. These labels define special priveledges + which an object may have to its data and member functions. Functions + you have used up to this point have the default label public. This is + default to such a degree, some drivers do not support the labeling. + + A public variable is available to any object down the inheritance tree + from the object in which the variable is declared. Public variables in + object C may be accessed by both objects A and B. Similarly, public + functions may be called by any object down the inheritance tree from the + object in which they are declared. + + The opposite of public is of course private. A private variable or + function may only be referenced from inside the object which declares it. + If object A or B tried to make any reference to any of the variables in + object C, an error would result, since the variables are said to be out of + scope, or not available to inheriting classes due to their private labels. + Functions, however, provide a unique challenge which variables do not. + External objects in LPC have the ability to call functions in other objects + through call others. The private label does not protect against call + others. + + To protect against call others, functions use the label static. A function + which is static may only be called from inside the complete object or + from the game driver. By complete object, I mean object A can call + static functions in the object C it inherits. The static only protects against + external call others. In addition, this_object()->foo() is considered an + internal call as far as the static label goes. + + Since variables cannot be referenced externally, there is no need for an + equivalent label for them. Somewhere along the line, someone decided + to muddy up the waters and use the static label with variables to have a + completely separate meaning. What is even more maddening is that this + label has nothing to do with what it means in the C programming + language. A static variable is simply a variable that does not get saved to + file through the efun save_object() and does not get restored through + restore_object(). Go figure. + + In general, it is good practice to have private variables with public + functions, using query_*() functions to access the values of inherited + variables, and set_*(), add_*(), and other such functions to change + those values. In realm coding this is not something one really has to + worry a lot about. As a matter of fact, in realm coding you do not have + to know much of anything which is in this chapter. To be come a really + good realm coder, however, you have to be able to read the mudlib + code. And mudlib code is full of these labels. So you should work + around with these labels until you can read code and understand why it + is written that way and what it means to objects which inherit the code. + + The final label is nomask, and it deals with a property of inheritance + which allows you to rewrite functions which have already been defined. + For example, you can see above that object A rewrote the function + GetName(). A rewrite of function is called overriding the + function. The most common override of a function would be in a case + like this, where a condition peculiar to our object (object A) needs to + happen on a call ot the function under certain circumstances. Putting test + code into object C just so object A can be a ghost is plain silly. So + instead, we override GetName() in object A, testing to see if the + object is a ghost. If so, we change what happens when another object + queries for the cap name. If it is not a ghost, then we want the regular + object behaviour to happen. We therefore use the scope resolution + operator (::) to call the inherited version of the GetName() + function and return its value. + + A nomask function is one which cannot be overridden either through + inheritance or through shadowing. Shadowing is a sort of backwards + inheritance which will be detailed in the advanced LPC textbook. In the + example above, neither object A nor object B (nor any other object for + that matter) can override GetKeyName(). Since we want to use + GetKeyName() as a unique identifier of objects, we don't want people + faking us through shadowing or inheritance. The function therefore gets + the nomask label. + + 6.5 Summary + Through inheritance, a coder may make user of functions defined in + other objects in order to reduce the tedium of producing masses of + similar objects and to increase the consistency of object behaviour across + mudlib objects. LPC inheritance allows objects maximum priveledges in + defining how their data can be accessed by external objects as well as + objects inheriting them. This data security is maintained through the + keywords, nomask, private, and static. + + In addition, a coder is able to change the functionality of non-protected + functions by overriding them. Even in the process of overriding a + function, however, an object may access the original function through + the scope resolution operator. + + Copyright (c) George Reese 1993 diff -c -r --new-file ds1.1/lib/doc/manual/chapter15 ds2.0r27/lib/doc/manual/chapter15 *** ds1.1/lib/doc/manual/chapter15 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter15 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,299 ---- + chapter 15 "Debugging" + Intermediate LPC + Descartes of Borg + November 1993 + + Chapter 7: Debugging + + 7.1 Types of Errors + By now, you have likely run into errors here, there, and everywhere. In + general, there are three sorts of errors you might see: compile time + errors, run time errors, and malfunctioning code. On most muds you + will find a personal file where your compile time errors are logged. For + the most part, this file can be found either in your home directory as the + file named "log" or ".log", or somewhere in the directory "/log" as a file + with your name.. In addition, muds tend to keep a log of run time errors + which occur while the mud is up. Again, this is generally found in + "/log". On MudOS muds it is called "debug.log". On other muds it may + be called something different like "lpmud.log". Ask your administrators + where compile time and run time errors are each logged if you do not + already know. + + Compile time errors are errors which occur when the driver tries to load + an object into memory. If, when the driver is trying to load an object + into memory, it encounters things which it simply does not understand + with respect to what you wrote, it will fail to load it into memory and log + why it could not load the object into your personal error log. The most + common compile time errors are typos, missing or extra (), {}. [], or "", + and failure to declare properly functions and variables used by the + object. + + Run time errors occur when something wrong happens to an object in + memory while it is executing a statement. For example, the driver + cannot tell whether the statement "x/y" will be valid in all circumstances. + In fact, it is a valid LPC expression. Yet, if the value of y is 0, then a + run time error will occur since you cannot divide by 0. When the driver + runs across an error during the execution of a function, it aborts + execution of the function and logs an error to the game's run time error + log. It will also show the error to this_player(), if defined, if the player + is a creator, or it will show "What?" to players. Most common causes + for run time errors are bad values and trying to perform operations with + data types for which those operations are not defined. + + The most insideous type of error, however, is plain malfunctioning + code. These errors do not log, since the driver never really realizes that + anything is wrong. In short, this error happens when you think the code + says one thing, but in fact it says another thing. People too often + encounter this bug and automatically insist that it must be a mudlib or + driver bug. Everyone makes all types of errors though, and more often + than not when code is not functioning the way you should, it will be + because you misread it. + + 7.2 Debugging Compile Time Errors + Compile time errors are certainly the most common and simplest bugs to + debug. New coders often get frustrated by them due to the obscure + nature of some error messages. Nevertheless, once a person becomes + used to the error messages generated by their driver, debugging compile + time errors becomes utterly routine. + + In your error log, the driver will tell you the type of error and on which + line it finally noticed there was an error. Note that this is not on which + line the actual error necessarily exists. The most common compile time + error, besides the typo, is the missing or superfluous parentheses, + brackets, braces, or quotes. Yet this error is the one that most baffles + new coders, since the driver will not notice the missing or extra piece + until well after the original. Take for example the following code: + + 1 int test(string str) { + 2 int x; + 3 for(x =0; x<10; x++) + 4 write(x+"\n"); + 5 } + 6 write("Done.\n"); + 7 } + + Depending on what you intended, the actual error here is either at line 3 + (meaning you are missing a {) or at line 5 (meaing you have an extra }). + Nevertheless, the driver will report that it found an error when it gets to + line 6. The actual driver message may vary from driver to driver, but no + matter which driver, you will see an error on line 6, since the } in line 5 + is interpreted as ending the function test(). At line 6, the driver sees that + you have a write() sitting outside any function definition, and thus + reports an error. Generally, the driver will also go on to report that it + found an error at line 7 in the form of an extra }. + + The secret to debugging these is coding style. Having closing } match + up vertically with the clauses they close out helps you see where you are + missing them when you are debugging code. Similarly, when using + multiple sets of parentheses, space out different groups like this: + if( (x=sizeof(who=users()) > ( (y+z)/(a-b) + (-(random(7))) ) ) + As you can see, the parentheses for the for() statement, are spaced out + from the rest of the statement. In addition, individual sub-groups are + spaced so they can easily be sorted out in the event of an error. + + Once you have a coding style which aids in picking these out, you learn + which error messages tend to indicate this sort of error. When + debugging this sort of error, you then view a section of code before and + after the line in question. In most all cases, you will catch the bug right + off. + + Another common compile time error is where the driver reports an + unknown identifier. Generally, typos and failure to declare variables + causes this sort of error. Fortunately, the error log will almost always + tell you exactly where the error is. So when debugging it, enter the + editor and find the line in question. If the problem is with a variable and + is not a typo, make sure you declared it properly. On the other hand, if + it is a typo, simply fix it! + + One thing to beware of, however, is that this error will sometimes be + reported in conjunction with a missing parentheses, brackets, or braces + type error. In these situations, your problem with an unknown identifier + is often bogus. The driver misreads the way the {} or whatever are + setup, and thus gets variable declarations confused. Therefore make + sure all other compile time errors are corrected before bothering with + these types of errors. + + In the same class with the above error, is the general syntax error. The + driver generates this error when it simply fails to understand what you + said. Again, this is often caused by typos, but can also be caused by not + properly understanding the syntax of a certain feature like writing a for() + statement: for(x=0, x<10, x++). If you get an error like this which is + not a syntax error, try reviewing the syntax of the statement in which the + error is occurring. + + 7.3 Debugging Run Time Errors + Run time errors are much more complex than their compile time + counterparts. Fortunately these errors do get logged, though many + creators do not realise or they do not know where to look. The error log + for run time errors are also generally much more detailed than compile + time errors, meaning that you can trace the history of the execution train + from where it started to where it went wrong. You therefore can setup + debugging traps using precompiler statements much easier using these + logs. Run time errors, however, tend to result from using more + complex codign techniques than beginners tend to use, which means you + are left with errors which are generally more complicated than simple + compile time errors. + + Run time errors almost always result from misusing LPC data types. + Most commonly, trying to do call others using object variables which are + NULL, indexing on mapping, array, or string variables which are + NULL, or passing bad arguments to functions. We will look at a real + run time error log from Nightmare: + + Bad argument 1 to explode() + program: bin/system/_grep.c, object: bin/system/_grep + line 32 + ' cmd_hook' in ' std/living.c' (' + std/user#4002')line 83 + ' cmd_grep' in ' bin/system/_grep.c' (' + bin/system/_grep')line 32 + Bad argument 2 to message() + program: adm/obj/simul_efun.c, object: adm/obj/simul_efun + line 34 + ' cmd_hook' in ' std/living.c' (' + std/user#4957')line 83 + ' cmd_look' in ' bin/mortal/_look.c' (' + bin/mortal/_look')line 23 + ' examine_object' in ' bin/mortal/_look.c' (' + bin/mortal/_look')line 78 + ' write' in 'adm/obj/simul_efun.c' (' + adm/obj/simul_efun')line 34 + Bad argument 1 to call_other() + program: bin/system/_clone.c, object: bin/system/_clone + line 25 + ' cmd_hook' in ' std/living.c' (' + std/user#3734')line 83 + ' cmd_clone' in ' bin/system/_clone.c' (' + bin/system/_clone')line 25 + Illegal index + program: std/monster.c, object: + wizards/zaknaifen/spy#7205 line 76 + ' heart_beat' in ' std/monster.c' + ('wizards/zaknaifen/spy#7205')line + 76 + + All of the errors, except the last one, involve passing a bad argument to a + function. The first bug, involves passing a bad first arument to the efun + explode(). This efun expects a string as its first argment. In debugging + these kinds of errors, we would therefore go to line 32 in + /bin/system/_grep.c and check to see what the data type of the first + argument being passed in fact is. In this particular case, the value being + passed should be a string. + + If for some reason I has actually passed something else, I would be done + debugging at that point and fix it simply by making sure that I was + passing a string. This situation is more complex. I now need to trace + the actual values contained by the variable being passed to explode, so + that I can see what it is the explode() efun sees that it is being passed. + + The line is question is this: + borg[files[i]] = regexp(explode(read_file(files[i]), "\n"), exp); + where files is an array for strings, i is an integer, and borg is a mapping. + So clearly we need to find out what the value of read_file(files[i]) is. + Well, this efun returns a string unless the file in question does not exist, + the object in question does not have read access to the file in question, or + the file in question is an empty file, in which cases the function will + return NULL. Clearly, our problem is that one of these events must + have happened. In order to see which, we need to look at files[i]. + + Examining the code, the files array gets its value through the get_dir() + efun. This returns all the files in a directory if the object has read access + to the directory. Therefore the problem is neither lack of access or non- + existent files. The file which caused this error then must have been an + empty file. And, in fact, that is exactly what caused this error. To + debug that, we would pass files through the filter() efun and make + sure that only files with a file size greater than 0 were allowed into the + array. + + The key to debugging a run time error is therefore knowing exactly what + the values of all variables in question are at the exact moment where the + bug created. When reading your run time log, be careful to separate the + object from the file in which the bug occurred. For example, the + indexing error above came about in the object /wizards/zaknaifen/spy, + but the error occured while running a function in /std/monster.c, which + the object inherited. + + 7.4 Malfunctioning Code + The nastiest problem to deal with is when your code does not behave the + way you intended it to behave. The object loads fine, and it produces no + run time errors, but things simply do not happen the way they should. + Since the driver does not see a problem with this type of code, no logs + are produced. You therefore need to go through the code line by line + and figure out what is happening. + + Step 1: Locate the last line of code you knew successfully executed + Step 2: Locate the first line of code where you know things are going + wrong + Step 3: Examine the flow of the code from the known successful point to + the first known unsuccessful point. + + More often than not, these problems occurr when you are using if() + statements and not accounting for all possibilities. For example: + + int cmd(string tmp) { + if(stringp(tmp)) return do_a() + else if(intp(tmp)) return do_b() + return 1; + } + + In this code, we find that it compiles and runs fine. Problem is nothing + happens when it is executed. We know for sure that the cmd() function + is getting executed, so we can start there. We also know that a value of + 1 is in fact being returned, since we do not see "What?" when we enter + the command. Immediately, we can see that for some reason the + variable tmp has a value other than string or int. As it turns out, we + issued the command without parameters, so tmp was NULL and failed + all tests. + + The above example is rather simplistic, bordering on silly. + Nevertheless, it gives you an idea of how to examine the flow of the + code when debugging malfunctioning code. Other tools are available as + well to help in debugging code. The most important tool is the use of + the precompiler to debug code. With the code above, we have a clause + checking for integers being passed to cmd(). When we type "cmd 10", + we are expecting do_b() to execute. We need to see what the value of + tmp is before we get into the loop: + + #define DEBUG + int cmd(string tmp) { + #ifdef DEBUG + write(tmp); + #endif + if(stringp(tmp)) return do_a(); + else if(intp(tmp)) return do_b(); + else return 1; + } + + We find out immediately upon issuing the command, that tmp has a + value of "10". Looking back at the code, we slap ourselves silly, + forgetting that we have to change command arguments to integers using + sscanf() before evaluating them as integers. + + 7.5 Summary + The key to debugging any LPC problem is always being aware of what + the values of your variables are at any given step in your code. LPC + execution reduces on the simplest level to changes in variable values, so + bad values are what causes bad things to happen once code has been + loaded into memory. If you get errors about bad arguments to + functions, more likely than not you are passing a NULL value to a + function for that argument. This happens most often with objects, since + people will do one of the following: + 1) use a value that was set to an object that has since destructed + 2) use the return value of this_player() when there is no this_player() + 3) use the return value of this_object() just after this_object() was + destructed + + In addition, people will often run into errors involving illegal indexing or + indexing on illegal types. Most often, this is because the mapping or + array in question was not initialized, and therefore cannot be indexed. + The key is to know exactly what the full value of the array or mapping + should be at the point in question. In addition, watch for using index + numbers larger than the size of given arrays + + Finally, make use of the precompiler to temporarly throw out code, or + introduce code which will show you the values of variables. The + precompiler makes it easy to get rid of debugging code quickly once you + are done. You can simply remove the DEBUG define when you are + done. + + Copyright (c) George Reese 1993 diff -c -r --new-file ds1.1/lib/doc/manual/chapter16 ds2.0r27/lib/doc/manual/chapter16 *** ds1.1/lib/doc/manual/chapter16 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter16 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,181 ---- + chapter 16 "Armor" + Building Armours + The Nightmare IV LPC Library + written by Descartes of Borg 950430 + + Armour has changed quite a bit from the days of armour class. The + Nightmare IV LPC Library now uses damage types, which means armour that + is great against one attack may be pathetic against another. In fact, + in building armour, it is important that you keep in mind weaknesses. + Fortunately, armour is by default absolutely pathetic. If you go + making it awesome, chances are that it will not make it through the + approval process. This document is designed to get you started + building armour as well introduce you to the features available to + make unique and interesting armour. + + I. Basic Armour + You should be familiar with /doc/build/Items, as armour is just a + special type of item. It therefore has all of the features of regular + items. + + + + The basic armour looks like this: + + #include <lib.h> /* see this everywhere */ + #include <armour_types.h> /* a listing of armour types */ + #include <damage_types.h> /* a listing of damage types */ + + inherit LIB_ARMOUR; /* the armour inheritable */ + + static void create() { + armour::create(); /* call create() in armour.c */ + SetKeyName("rusty helm"); + SetId( ({ "helm", "rusty helm", "a rusty helm" }) ); + SetAdjectives( ({ "rusty" }) ); + SetShort("a rusty helm"); + SetLong("A rusty helmet which will be better than nothing on your head."); + SetMass(75); + SetValue(200); + SetDamagePoints(1000); + SetProtection(BLUNT, 4); /* SetProtection() sets the sort of */ + SetProtection(BLADE, 3); /* protection for a given damage type */ + SetProtection(KNIFE, 3); + SetArmourType(A_HELMET); /* set what kind of armour this is */ + } + + As you can see, there is very little that you have to do specific to + armour. The only armour specific call you MUST make is + SetArmourType(). Everything else is fluff. + + int SetArmourType(int type) + Armour types are found in /include/armour_types.h. The armour type + basically determines where the armour is worn. Each monster, + depending on its race, has for each limb a list of armour types which + may be worn on that limb. For example, most monsters have heads. + Some have two heads. You do not have to worry about this. They know + that they can wear anything that is A_HELMET on their heads. What if + you have something that may not be wearable on all monsters? Like, + for example, you have body armour which should only go on two armed + beings? See SetRestrictLimbs() later. It allows you to restrict + exactly which kinds of limbs can wear the armour. + + int SetProtection(int type, int amount); + Without this call, armour is nothing. Just something you wear. This + allows you to make clothes, which may protect against COLD, but do not + do a thing when struck with a sword. Protection is a number between 0 + and 100. Refer to approval documentation for details on what levels + are appropriate, as well as for information on mass and value levels. + + That's it for the basics! + + II. Advanced Function Calls + The Nightmare IV LPC Library armour object is fairly flexible for + allowing you to do interesting things with your armours. In this + section, you will learn about other function calls you can make to + customize your armour. + + string *SetRestrictLimbs(string *limbs); + Example: + SetRestrictLimbs( ({ "right arm", "left arm", "torso" }) ); + + For armours which can only be on certain body configurations, for + example regular armour (A_ARMOUR) should only be worn on people with + the same number of hands, this function allows you to restrict the + armour to being worn only on the limbs you name. If the person trying + to wear the armour does not have one of those limbs, any attempt to + wear fails. + + int SetFingers(int num); + Example: + SetFingers(5); + + Used for the glove types. If a person has more fingers on the limb on + which they are trying to wear a glove type than the glove has spaces + for, the wear fails. + + mixed SetWear(string | function val); + Examples: + SetWear("The cloak feels all yucky on you."); + SetWear( (: CheckArtrell :) ); + + Allows you to create a special message seen by the person wearing the + item when they wear it if you pass a string. On the other hand, if + you pass a function, it will call that function to see if the person + can wear the item. The function should be of the form: + int WearFunc(); + + For example: + + int CheckArtrell() { + if( (string)this_player()->GetRace() == "artrell" ) { + write("The rusty helm makes you feel safe."); + say((string)this_player()->GetName() + " wears a rusty helm."); + return 1; + } + else { + write("You cannot wear that you bum!"); + return 1; + } + } + + III. Function Overrides + The only function of interest that you might want to override is a + function called eventReceiveDamage(). This function is called every + time the armour is hit to see how much of the damage it absorbs. It + looks like this: + + int eventReceiveDamage(int type, int strength, int unused, mixed limbs); + + This function is called by combat to determine how much damage the + armour absorbs for a given bit of damage being done. It thus should + return how much damage it takes. + + You should always at some point call item::eventReceiveDamage() so + that it can do its processing. You do not want to call it, however, + until you determine how much damage you are absorbing unnaturally. + Here is a sample one for an armour that does extra protection for fighters: + + int eventReceiveDamage(int type, int strength, int blah, mixed limbs) { + object who_is_wearing; + int x; + + if( !(who_is_wearing = environment()) ) /* eek! no one wearing */ + return 0; + if( (int)who_is_wearing->ClassMember("fighter") ) /* reduce strength */ + x = strength - random(5); + if( x < 1 ) return strength; /* protect against all the damage */ + return armour::eventReceiveDamage(type, x, blah, limbs); + } + + Keep in mind what eventReceiveDamage() in armour.c is doing. First, + it is modifying the strength of the blow based on the protections you + set with SetProtection(). Then, it is having the armour take damage + based on how much it absorbed. So you need to call + eventReceiveDamage() in armour at the point where you have a value you + want the armour to do its normal stuff with. In the example above, we + wanted to magically protect fighters against a random(5) points of + damage without having the armour take any damage for that. Then if + there is still strength left in the blow, the armour does its normal + protection. + + What else can you do with this? Imagine an armour that turns all cold + damage back on the attacker? + + int eventReceiveDamage(int type, int strength, int unused, mixed limbs) { + object who_wearing, enemy; + + enemy = (object)(who_wearing = previous_object())->GetCurrentEnemy(); + if( !enemy || !(type & COLD) ) + return armour::eventReceiveDamage(type, strength, unused, limbs); + limbs = enemy->GetTargetLimb(0); + message("environment", "Your anti-cold throws the frost in your " + "enemy's face!", who_wearing); + message("environment", "Your cold attack is turned back upon you!", + enemy); + enemy->eventReceiveDamage(COLD, strength, unused, limbs); + return strength; /* we absorb all of the strength but take no damage */ + } + + Descartes of Borg + borg@imaginary.com diff -c -r --new-file ds1.1/lib/doc/manual/chapter17 ds2.0r27/lib/doc/manual/chapter17 *** ds1.1/lib/doc/manual/chapter17 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter17 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,68 ---- + chapter 17 "Barkeeps" + Building Food and Drink Sellers + The Nightmare IV LPC Library + written by Descartes of Borg 950528 + + This document details the building of barkeeps, waiters, and other + such people who sell food and drink. Barkeeps are NPC's, and + therefore everythign which applies to NPC's applies to barkeeps. + + To build a barkeep, you should inherit LIB_BARKEEP. + + Beyond the functions specific to NPC's barkeeps also make use of the + following functions: + + mapping SetMenuItems(mapping menu); + mapping AddMenuItem(string item, string file); + mapping RemoveMenuItem(string item); + mapping GetMenuItems(); + string SetLocalCurrency(string curr); + + When building a barkeep, you must add some mechanism in the room in + which the barkeep is placed for people to view a list of things for + sale. + + ***** + mapping SetMenuItems(mapping menu); + ***** + + Example: SetMenuItems( ([ "coffee" : "/realms/descartes/coffee" ]) ); + + Sets which menu items are found in which file. This is a mapping with + the name of the item as a key and the file in which it is located as + the value. + + ***** + mapping AddMenuItem(string item, string file); + ***** + + Example: AddMenuItem("lobster", "/realms/descartes/lobster"); + + Adds one menu item at a time to the list of menu items. + + ***** + mapping RemoveMenuItem(string item); + ***** + + Example: RemoveMenuItem("coffee"); + + Removes the named item from the menu. + + ***** + mapping GetMenuItems(); + ***** + + Returns all the menu items for this barkeep. Useful in building your + menu list. + + ***** + string SetLocalCurrency(string curr); + ***** + + Example: SetLocalCurrency("khucha"); + + Sets the currency in which the barkeep does business. + + + + diff -c -r --new-file ds1.1/lib/doc/manual/chapter18 ds2.0r27/lib/doc/manual/chapter18 *** ds1.1/lib/doc/manual/chapter18 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter18 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,8 ---- + chapter 18 "Valid climates" + + indoors + temperate + arid + arctic + tropical + sub-tropical diff -c -r --new-file ds1.1/lib/doc/manual/chapter19 ds2.0r27/lib/doc/manual/chapter19 *** ds1.1/lib/doc/manual/chapter19 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter19 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,263 ---- + chapter 19 "Doors" + Creating Doors between Two Rooms + The Nightmare IV LPC Library + created by Descartes of Borg 950419 + + This document describes how to build door-type objects which link two + rooms. These door-type objects do not need to be doors, but in fact + can be windows or boulders or any other such object. The Nightmare IV + LPC Library door object, unlike the old way of doing doors, is an + object separate from the rooms it connects. In other words, in order + to build a door, you have three objects (just as you would visualize): + two rooms and a door. + + The door object is /lib/door.c. To inherit it, #include <lib.h> and + inherit LIB_DOOR;. An example door may be found in + /domains/Examples/etc/door.c as well as the rooms + /domains/Examples/room/doorroom1.c and /domains/Examples/room/doorroom2.c. + + Setting up the door object + The first thing you must do is create the door object. You must + visualize this door object just like a door connecting two rooms in + real life. You have a room on each side with a single door with two + sides. Technically, a door object may have any number of sides. + Practically speaking, most people using this object will be using it + as a door, which means it will have two sides. + + To create a door object, you simply describe each side of the door. + The easiest way to do this is through the SetSide() function. + + mapping SetSide(string side, mapping mp); + + Example: + + SetSide("east", ([ "id" : "red door", "short" : "a red door", + "long" : "A freshly painted red door.", + "lockable" : 0 ]) ); + + The name of the side is simply the exit used by the room which sees + that side. For example, if in one room the door is at the east exit, + then the side is identified as east. The mapping consists of the + following data: + + "id" + What a person on that side calls the door. For example, you can have a + door blue on one side and red on the other. On one side, you go east + to go through the door, and from that room the door appears red. The + id for that side might be "red door". The id for the other side might + be "blue door". + + "short" + The short description for the door as seen from the side in question. + This can be a function or a string. + + "long" + The long description for the door as seen from the side in question. + Whether the door is open or not will be added to the long if the long + is a string. This can be either a string or function. If it is a + function, you must specify whether the door is open or close on your + own. + + "lockable" + 0 if the door cannot be locked (and unlocked) from that side, 1 if it + can. + + "keys" + An array of id's of objects which can be used to unlock it if it is + lockable. Lockable doors do not need keys. + + II. Setting up the rooms + After you have called SetItems() and SetExits() in the room + (remembering to set the exit for the exit with the door), call the + function SetDoor(). + + string SetDoor(string dir, string doorfile); + + Example: SetDoor("east", "/realms/descartes/doors/red_door"); + + Sets the exit named to be blocked by a door object when that door + object is closed. + + This is all you need to do in the room. Note that the exit name + corresponds to the side name mentioned in the door. + + III. Advanced Door Stuff + At this point, you should know how to do the minimum stuff to build a + door. This section goes into detail about door functions and how you + can do advanced things with doors by manipulating door events. This + section has two parts, door data functions and door events. + + a. Door Data Functions + + ***** + SetSide() + ***** + mapping SetSide(string side, mapping mp); + + As described above. + + ***** + SetClosed() + ***** + static int SetClosed(int x) + + Example: SetClosed(1); + + This function can only be called from inside the door object. + Generally you use it to set the initial state of the door. If you + want to close the door at any other time, or to close it from another + object, use eventClose() or eventOpen(). + + ***** + SetLocked() + ***** + + static int SetLocked(int x) + + Example: SetLocked(1); + + Like SetClosed(), this function should only be used from create() + inside the door object to set the initial state of the door. At other + times, use eventLock() or eventUnlock(). + + ***** + SetLockable() + ***** + + int SetLockable(string side, int x) + + Example: SetLockable("east", 1); + + Sets a side as being able to be locked or unlocked. Since it is done + by sides, this means you can have one side not be lockable with the + other side being lockable. The first argument is the side being set + lockable or not lockable, the second argument is 1 for lockable and 0 + for not lockable. + + ***** + SetId() + ***** + + string SetId(string side, string id) + + Example: SetId("west", "blue door"); + + This is not like your traditional SetId() function. Instead, it sets + a single way of identifying the door from a given side. It is what + the player might use to open the door or look at it. + + ***** + SetShort() + ***** + + mixed SetShort(string side, string | function desc) + + Examples: + SetShort("north", "a red door"); + SetShort("west", (: GetWestShort :) ); + + Sets the short description for a given side of a door. If the second + argument is a function, it gets passed as an argument the name of the + side for which the function serves as a description. That function + should return a string. For the above: + + string GetWestShort(string dir) { + if( query_night() ) return "a shadowy door"; + else return "a red door"; + } + + ***** + SetLong() + ***** + + mixed SetLong(string side, string | function desc) + + Examples: + SetLong("south", "An old, dusty door covered in cobwebs."); + SetLong("east", (: GetEastLong :)) + + This works much like the SetShort() function, except it handles the + long description. It is important to note that if the second argument + is a string, that the state of the door will be added onto the long + description automatically. In other words "It is open." will appear + as the second line. This will *not* be done if you use a function for + your long description. + + ***** + SetKeys() + ***** + + string *SetKeys(string side, string *keys) + + Example: SetKeys("east", ({ "skeleton key", "special key" })); + + Builds an array of id's which can be used to unlock the door if it is + lockable from this side. In other words, a person can only unlock the + door if that person has an object which has one of the id's you + specify for its id. + + b. Events + + ***** + eventOpen() + ***** + + varargs int eventOpen(object by, object agent) + + Examples: + + "/realms/descartes/etc/red_door"->eventOpen(this_object()); + + int eventOpen(object by, object agent) { + if( query_night() ) return 0; /* Can't open it at night */ + else return door::eventOpen(by, agent); + } + + The function that actually allows the door to be opened externally. + It returns 1 if the door is successfully opened. It returns 0 if it + fails. The first argument is the room object from which the door is + being opened. The second argument, which is optional, is the living + thing responsible for opening the door. + + The first example above is an example of what you might do from + reset() inside a room in order to have the door start open at every + reset. + + The second example above is an example of how you might conditionally + prevent the door from opening by overriding the Open event. In this + case, if it is night, you cannot open this door. If it is day, you + can. + + ***** + eventClose() + ***** + + varargs int eventClose(object by, object agent) + + Example: See eventOpen() + + This function works just like eventOpen(), except it does the closing + of the door. + + ***** + eventLock() + ***** + + varargs int eventLock(object by, object agent) + + Example: see eventOpen() + + This function works just like eventOpen(), except that it gets called + for locking the door. + + ***** + eventUnlock() + ***** + + varargs int eventUnlock(object by, object agent) + + Example: See eventOpen() + + This function works just like eventOpen(), except that it gets called + for unlocking the door. + diff -c -r --new-file ds1.1/lib/doc/manual/chapter20 ds2.0r27/lib/doc/manual/chapter20 *** ds1.1/lib/doc/manual/chapter20 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter20 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,368 ---- + chapter 20 "Items" + Building Any Item + The Nightmare IV LPC Library + written by Descartes of Borg 950430 + + Each object you build has a certain common make-up no matter what type + of object it is. This is because all of your objects actually are + based upon the same object, the object called /lib/object.c. That + object contains functions such as SetShort() and SetLong() which you + use in almost every single object you will build. This document + details how to set up any possible object you will use. The only + exceptions will be for rooms, which do not have key names or id's. + + Beyond that, most of the every day objects you will code like armours, + weapons, drinks, foods, etc. all derive from a common object called + /lib/item.c. This document attempts to detail what is involved in + building any object on the MUD through /lib/item.c and its ancestor + /lib/object.c. + + This document is in three sections + + I. List of Mandatory Function Calls + II. Basic Functions + III. Extras + IV. Events + + ** *************** List of Mandatory Function Calls ************** ** + + SetKeyName("red bag"); + SetId( ({ "bag", "red bag" }) ); + SetAdjectives( ({ "red" }) ); + SetShort("a red bag"); + SetLong("A small red bag with no distinguishing marks."); + SetMass(90); + SetValue(50); + SetVendorType(VT_BAG); + + You also need to include vendor_types.h. + + ** *************** Basic Functions *************** ** + + ***** + SetKeyName() + ***** + + string SetKeyName(string key_name); + + Example: SetKeyName("red bag"); + + Notes: + Mandatory for all objects except rooms. + Not used for rooms. + + The key name is the central name by which the object is referred to in + sentences where no article is required. For example, the sentence + "You pick up your red bag" makes use of the key name to complete the + sentence. This is much like the short description, except the short + description will include an article. For this object, SetShort("a red + bag") would be used. + + ***** + SetId() + ***** + + string *SetId(string *id); + + Example: SetId( ({ "bag", "red bag" }) ); + + Notes: + Mandatory for all objects except rooms. + Not used in rooms. + Must be all lower case. + + The id is an array of strings by which the object may be referred to by a + player. For example, if the player wants to get this bag, the player + can type "get bag" or "get red bag". The id is used purely for + identification purposes, so if you have something you need to sneak in + a unique way of identifying it, you may add an id only you know about. + + ***** + SetAdjectives() + ***** + + string *SetAdjectives(string *adjs); + + Example: SetAdjectives( ({ "red" }) ); + + Notes: + Planned for future use in Zork style command parsing. + Not used in rooms. + + The adjectives are descriptive terms used to describe the object. + This is not currently being used, however, it will be part of the new + style command parsing we will be building. This will allow the player + to type things like "get the red one" and pick up the red bag. Even + though it is not used, it is requested you place it in your objects to + make upgrading down the road a simpler task. + + ***** + SetShort() + ***** + + string SetShort(string description | function desc_func); + + Examples: + SetShort("a red bag"); + SetShort((: DescribeBag :)); + + The short description is a brief description of the object. Only + names and proper nouns should be capitalized, the rest should be lower + case, as if it were appearing in the middle of a sentence. In rooms, + the player sees the short description when in brief mode and when they + glance at the room. For objects, the player sees the short when it is + described in the room or in their inventory. + + If you pass a function instead of a string, then that function is used + to create the description. You can use this to do something like make + the object change its short description depending on who is looking at + it. The function that you build should therefore return a string + that will be used as the short description. For example... + + string DescribeBag() { + if( query_night() ) return "a bag"; + else return "a red bag"; + } + + ***** + SetLong() + ***** + + string SetLong(string description | function desc_func); + + Examples: + SetLong("A red bag with no markings on it whatsoever."); + SetLong((: BagLong :)); + + Creates a verbose way to present the object to the player. You should + be much more descriptive than I have been in the example. Being a + text game, descriptions are 90% of what make the game. The more + creative you are with your descriptions, the more interesting the game + is to players. The long description of a room is seen by players in + verbose mode and when the player uses the "look" command. For + objects, the long description is seen when the player looks at the + object. Functions work in exactly the same fashion as short + functions. + + ***** + SetMass() + ***** + + int SetMass(int mass); + + Example: SetMass(100); + + Notes: + Mandatory for all visible objects. + Not needed for non-tangible objects and rooms. + + Sets the mass for the object. In conjunction with the gravity of the + room it is in, this works to determine the weight of the object. + + ***** + SetValue() + ***** + + int SetValue(int value); + + Example: SetValue(50); + + Notes: + Mandatory for all sellable objects. + Not used in rooms. + + Sets the base economic value of an object. This has no meaning in any + currencies, and in fact the actual value in any given currency may + vary. + + ***** + SetVendorType() + ***** + + int SetVendorType(int vt); + + Example: SetVendorType(VT_BAG); + + Note: + Mandatory for all objects except rooms. + Preset to VT_ARMOUR for objects which inherit LIB_ARMOUR. + Preset to VT_TREASURE for objects which inherit LIB_ITEM. + Preset to VT_LIGHT for objects which inherit LIB_LIGHT. + Not valid for room objects. + Values are found in /include/vendor_types.h. + + You must do: + #include <vendor_types.h> + to use the VT_* macros (i.e. VT_ARMOUR, VT_TREASURE, VT_WEAPON). + + The vendor type determines which shops will buy the item. For + example, things with VT_BAG as the vendor type can be bought and sold + in bag stores. For items which cross the line, for example a flaming + sword, you can combine vendor types in the following manner: + SetVendorType(VT_WEAPON | VT_LIGHT); + + ***** + SetDamagePoints() + ***** + + int SetDamagePoints(int pts); + + Example: SetDamagePoints(500) + + Sets the amount of damage an object can take before descreasing in + value. With armours and weapons, damage is taken quite often. Damage + is more rare with other kinds of objects. With this example object + which has 500 damage points, whenever 500 points has been done to it, + its value is cut in half and eventDeteriorate() is called for the + object. See the events section on using eventDeteriorate(). The + points are then reset to 500 and damage is done from that. + + ** *************** Extras *************** ** + + ***** + SetProperty() + ***** + + mixed SetProperty(string property, mixed value); + + Example: SetProperty("no pick", 1); + + Allows you to store information in an object which may not have been + intended by the designer of the object, or which is fleeting in + nature. See /doc/build/Properties for a list of common properties. + ***** + SetProperties() + ***** + + mapping SetProperties(mapping props); + + Example: SetProperties( ([ "light" : 1, "no attack" : 1 ]) ); + + Allows you to set any properties you want all in one shot. + + ***** + SetDestroyOnSell() + ***** + + int SetDestroyOnSell(int true_or_false); + + Example: SetDestroyOnSell(1); + + For mundane objects, or objects which should not be resold, allows you + to set it so that the object gets destroyed when sold instead of + allowing it to be resold. + + ***** + SetPreventGet() + ***** + + mixed SetPreventGet(mixed val); + + Examples: + SetPreventGet("You cannot get that!"); + SetPreventGet( (: check_get :) ); + + Allows you to make an object un-gettable by a player. If you pass a + string, the player will see that string any time they try to get the + item. If you pass a function, that function will be called to see if + you want to allow the get. Your function gets the person trying to get + the object as an argument: + + int check_get(object who) { + if( (int)who->GetRave() == "ogre" ) { + message("my_action", "Ogres cannot get this thing!", who); + return 0; + } + else return 1; + } + + ***** + SetPreventPut() + ***** + + mixed SetPreventPut(mixed val); + + Examples: + SetPreventPut("You cannot put that in there!"); + SetPreventPut( (: check_put :) ); + + The same as SetPreventGet(), except this is used when the object is + being put into another object. + + ***** + SetPreventDrop() + ***** + + mixed SetPreventDrop(mixed val); + + Examples: + SetPreventDrop("You cannot drop that!"); + SetPreventDrop( (: check_drop :) ); + + The same as SetPreventGet(), except this is used when a player tries + to drop the object. + + + ** *************** General Events ************** ** + + ***** + eventDeteriorate() + ***** + + void eventDeteriorate(int type); + + Example: ob->eventDeteriorate(COLD); + + Notes: + Damage types can be found in /include/damage_types.h + + This function gets called periodically in objects whenever they wear + down a bit. The type passed to the function is the type of damage + which triggered the deterioration. + + ***** + eventMove() + ***** + + int eventMove(mixed dest); + + Example: + ob->eventMove(this_player()); + ob->eventMove("/domains/Praxis/square"); + + The eventMove event is called in an object when it is being moved from + one place to the next. You can either pass it the file name of a room + to which it should be moved or an object into which it should be + moved. It will return true if the object gets moved, false if it + cannot move for some reason. For objects which are being dropped, + gotten, or put, it is generally a good idea to check CanDrop(), + CanClose(), or CanGet() for the object in question since eventMove() + does not know the context of the move and therefore will allow a drop + since it does not check CanDrop(). + + ***** + eventReceiveDamage() + ***** + + varargs int eventReceiveDamage(int type, int amount, int unused, mixed limbs); + + Example: ob->eventReceiveDamage(BLUNT, 30, 0, "right hand"); + + This function gets called in an object whenever any damage is done to + it. Most frequently this gets called in monsters and armour. In + armour you can use it to modify the amount of damage which gets done. + The return value of this function is the amount of damage done to the + object. For example, if you have a piece of armour that absorbs 5 of + the 30 points listed above, then you return 5. + + NOTE: + For monsters there is an extra arg at the front called + agent. The agent is the being responsible for doing + the damage. It may be zero if something like the weather + is causing the damage. It looks like: + + varargs int eventReceiveDamage(object agent, int type, int strength, + int internal, mixed limbs); + + For more detailed information, see /doc/build/NPC. + diff -c -r --new-file ds1.1/lib/doc/manual/chapter21 ds2.0r27/lib/doc/manual/chapter21 *** ds1.1/lib/doc/manual/chapter21 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter21 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,151 ---- + chapter 21 "Meals" + Building Food and Drink Objects + The Nightmare IV LPC Library + written by Descartes of Borg 950603 + + This document details the creation of food and drinks using the + Nightmare LPC Library. The creation of barkeeper objects requires you + to be able to build these objects, so make sure you understand what is + going on in here before moving on to barkeepers. + + To create food or drink, you inherit from the standard meal object + /lib/meal.c For example: + + #include <lib.h> + + inherit LIB_MEAL; + + You have access to the same functions you have in generic items when + you build food and drinks. In particular, you should be sure to call + the following: + + SetKeyName() + SetId() + SetShort() + SetLong() + SetMass() + + Note that SetValue() does NOTHING for food and drinks. Value is + automatically determined by the strength of the item. + + The following function calls are specific to "meal" objects: + + int SetMealType(int types); + int SetStrength(int strength); + + mixed *SetMealMessages(function f); + OR + mixed *SetMealmessages(string mymsg, string othermsg); + + string SetEmptyName(string str); + string SetEmptyShort(string str); + string SetEmptyLong(string str); + string SetEmptyItem(string str); + + You must call SetMealType(), SetStrength(), and SetMealMessages(). + If you call SetEmptyItem(), you do not need to call the functions + SetEmptyName(), SetEmptyShort(), SetEmptyLong(). On the other hand, + if you do not call SetEmptyItem(), you do need to set the other three. + + ***** + int SetMealType(int types) + ***** + + Example: SetMealType(MEAL_FOOD); + + For meal objects, you must do: + + #include <meal_types.h> + + This includes all od the definitions for the meal types in + /include/meal_types.h into your food or drink. You need these + definitions when setting what type of meal object this is. The types + are: + + MEAL_FOOD + MEAL_DRINK + MEAL_CAFFEINE + MEAL_ALCOHOL + MEAL_POISON + + In general, almost anything you create will be at least either + MEAL_FOOD or MEAL_DRINK. You can add onto it using the | operator. + For example, to make an alcoholic drink: + + SetMealType(MEAL_DRINK | MEAL_ALCOHOL); + + This makes something a drink and an alcoholic drink. You want to + stick poison in it? + + SetMealType(MEAL_DRINK | MEAL_ALCOHOL | MEAL_POISON); + + ***** + int SetStrength(int x) + ***** + + Example: SetStrength(20); + + This sets how strong your food or drink is. It affects things like + which people can drink or eat it and how much the drink or food costs. + Refer to balance documents to see what is good. + + ***** + varargs mixed *SetMealMessages(function|string, string) + ***** + + Examples: + SetMealMessages((: call_other(find_object("/some/object"),"drink") :)); + SetMealmessages("You drink your beer.", "$N drinks $P beer."); + + You can pass a single argument, which is a function to be called. + This function will be called after the person has drank or eaten the + meal. It gives you a chance to do some bizarre messaging and such. + + If you pass two strings, the first string is used as a message to send + to the player doing the drinking, and the second is what everyone else + sees. To make the message versatile, you can put in the following + place holders: + + $N the name of the drinker/eater + $P his/her/its + + For example: + $N drinks $P beer. + might resolve to: + Descartes drinks his beer. + + ***** + string SetEmptyName(string str) + ***** + + Example: SetEmptyName("bottle"); + + Sets an id from the empty container of drinks. This need not be set + for food. + + ***** + string SetEmptyShort(string str) + ***** + + Example: SetEmptyShort("an empty bottle") + + Sets what the short description of the empty container is for anything + that is of type MEAL_DRINK. + + ***** + string SetEmptyLong(string str) + ***** + + Example: SetEmptyLong("A brown bottle that used to contain beer."); + + Sets the long description for the empty container for drink objects. + + ***** + string SetEmptyItem(string str) + ***** + + Example: SetEmptyItem("/domains/Praxis/etc/empty_bottle") + + Instead of cloning a generic empty object and setting the other empty + functions, you can create a special empty container which gets given + to the player after they drink a drink object. Not relevant to food. diff -c -r --new-file ds1.1/lib/doc/manual/chapter22 ds2.0r27/lib/doc/manual/chapter22 *** ds1.1/lib/doc/manual/chapter22 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter22 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,285 ---- + chapter 22 "NPCs" + Building Non-Player Characters + The Nightmare IV Object Library + written by Descartes of Borg 951201 + + This document outlines the creation of non-player characters (NPC's). + On other muds, NPC's are sometimes referred to as monsters. Like the + rooms document, this document is divided up into two sections: basic + NPC building and complex NPC building. NPC's are living things which + inherit all the behaviours of living things. Documentation on living + specific functionality may be found in /doc/build/Livings. + + ************************************************ + Part 1: Basic NPC Building + ************************************************ + + ***** + I. The simplest NPC + ***** + + #include <lib.h> + + inherit LIB_NPC; + + static void create() { + npc::create(); + SetKeyName("praxis peasant"); + SetId( ({ "peasant", "praxis peasant" }) ); + SetShort("a local peasant"); + SetLong("Dirty and totally disheveled, this poor inhabitant of Praxis " + "still somehow maintains an air of dignity that nothing can " + "break."); + SetLevel(1); + SetRace("elf"); + SetClass("fighter"); + SetGender("male"); + } + + There are two things you should note. The first is that an NPC is + also a general object, meaning that you have available to you all the + things you can do with general objects, like setting descriptions and + ID's. The second is that a basic NPC does not require a heck of a lot + more. I will cover the NPC specific functions here. + + SetLevel(1) + SetRace("elf") + SetClass("fighter") + Level, race, and class are the three most important settings in any + NPC. Together they determine how powerful the NPC is. You are + absolutely required to set a level and a race. For those who + absolutely do not want to give the NPC a class, you do not have to. + But, you must instead manually set the NPC's skill levels, which is + described in the second part of this document. In general, however, + you always want to set the class. + + Together, the class and race and level determine which skills and + stats are considered important for the monster, and how good at those + skills and stats the monster is. The order in which you call these + functions is irrelevant, as everything is recalculated any time one of + the above changes. + + Also, note that SetRace() may only be called with a race listed in the + mraces command with simple NPC's. If you wish to build an NPC with a + unique race, you need to do some limb manipulation, which is described + in the advanced section. + + SetGender("male") + While not required, you will normally want to give an NPC a gender. + The default is neutral. However, in this world, very little is + neuter. Your choices for this function are male, female, and neuter. + + ***** + II. Other NPC Configuration Functions + ***** + + Function: int SetMorality(int amount); + Example: SetMorality(100); + + This is a number between -2000 and 2000 which determines the morality + of an individual with respect to good and evil. -2000 is absolute + evil, and 2000 is absolute good. The actions of players determine + their morality, and often those actions are relative to a target. + Thus killing an evil being can be considered good, while killing a bad + one evil. + + Function: int SetUnique(int x); + Example: SetUnique(1) + + Marks the NPC as a unique monster. This allows the room which clones + your NPC to use the negative values to SetInventory() (see + /doc/build/Rooms) to make sure the NPC only gets cloned every few + days. + + ************************************************ + Part 2: Advanced NPC Building + ************************************************ + + ***** + I. Functions + ***** + + You may use these functions to make your NPC's a bit more interesting + than the simple variety. + + Function: void SetAction(int chance, mixed val); + Examples: SetAction(5, (: DoSomething :)); + SetAction(5, ({ "!smile", "!frown" })); + SetAction(5, ({ "The peasant looks unhappy." })); + + Sets something to randomly happen every few heart beats while the NPC + is not in combat. In the above examples, the NPC has a 5% chance each + heart beat of performing the action you provided with the second + argument. The action can be a call to a function, a list of potential + commands, or a list of strings to be echoed to the room. + + If you pass a function, that function will be called each time an + action is supposed to occur. If you pass a list of strings, one of + those strings will be randomly chosen as the target action for this + heart beat. If the chosen string begins with a !, it is treated as a + command. Otherwise, it is simply echoed to the room. Note that you + can mix commands and echo strings. + + ***** + + Function: void SetCombatAction(int chance, mixed val); + Examples: SetCombatAction(5, (: DoSomething :)); + SetCombatAction(5, ({ "!missile", "!fireball" })); + SetAction(5, ({ "The peasant looks angry." })); + + This function works exactly the same as SetAction(), except that these + actions only get triggered while the NPC is in combat. This is the + best place to have the NPC cast spells. + + ***** + + Function: varargs void SetCurrency(mixed val, int amount); + Examples: SetCurrency("gold", 100); + SetCurrency( ([ "gold" : 100, "electrum" : 1000 ]) ); + + This function allows you to set how much money an NPC is carrying. + The first syntax allows you to set one currency at a time. The second + allows you to set multiple currencies at once. Not that if you use + the second syntax, it will blow away any currencies the NPC might + already be carrying. + + ***** + + Function: mixed SetDie(mixed val); + Examples: SetDie("The black knight bleeds on you as he drops dead."); + SetDie((: CheckDie :)); + + If you pass a string, that string will be echoed as the NPC's death + message when it dies. If you pass a function, that function gets + called with the agent doing the killing, if any, as an argument. For + example, with the above example, the function that you write: + + int CheckDie(object killer); + + gets called. If you return 1, the NPC goes on to die. If you return + 0, the NPC does not die. In the event you prevent death, you need to + make some arrangements with the NPC's health points and such to make + sure it really is still alive. + + ***** + + Function: mixed SetEncounter(mixed val); + Examples: SetEncounter(40); + SetEncounter( (: CheckDwarf :) ); + SetEncounter( ({ str1, str2 }) ); + + This allows you to set up e behaviour for an NPC upon encountering + another living thing. Note that this behaviour occurrs for both + players and other NPC's. Using the first syntax, the NPC will simply + attack any other living thing with a charisma less than 40. The + second syntax calls the function you specify. You may have it do any + number of things, however, you must also return a 1 or a 0 from that + function. A 1 means that after the function is called, the NPC should + initiate combat against the thing it just encountered. A 0 means + carry on as usual. + + Finally, the third syntax is likely to be used in places other than + the create() funciton in the NPC. This syntax lets you set a list + names which are simply enemies to the NPC. More likely, you will be + using AddEncounter() and RemoveEncounter() for this. + + ***** + + Function: string *AddEncounter(string name); + Example: AddEncounter((string)this_player()->GetKeyName()); + + Adds a name to the list of names an NPC will attack on sight. + + ***** + + Function: string *RemoveEncounter(string name); + Example: RemoveEncounter((string)this_player()->GetKeyName()); + + Removes a name from the list of names an NPC will attack on sight. + + ***** + + Function: SetInventory(mapping inventory); + Examples: + SetInventory( ([ "/domains/Praxis/weapon/sword" : "wield sword" ]) ); + SetInventory( ([ "/domains/Praxix/etc/ruby" : 1 ]) ); + SetInventory( ([ "/domains/Praxis/etc/emerald" : -10 ]) ); + + This functions behaves almost identically to SetInventory() for rooms + (see /doc/build/Rooms). The big difference is that you may pass a + string in addition to a number as the value for any item you want in + the inventory. In the first example above, that string is the command + the NPC issues when the sword is cloned into its inventory. In other + words, if you want an NPC to do something special with an item it has + in its inventory, in this case wield the sword, you pass the command + string as the value instead of a number. + + Note that this means only one of such item will be cloned, and it + cannot be unique. + + ***** + II. Events + ***** + + The following events exist in NPC's. You should have a good grasp of + function overriding before overriding these functions. + + Event: varargs int eventDie(object target); + + This event is triggered any time the NPC is killed. The event returns + 1 if the NPC dies, 0 if it fails to die, and -1 on error. If you + intend to allow the NPC to die, you should call npc::eventDie(target) + and make sure it returns 1. + + ***** + + Event: int eventFollow(object dest, int chance); + + This event is triggered whenever an NPC is following another living + thing and that thing leaves the room. Returnung 1 means that the NPC + successfully followed the other being, and 0 means the NPC did not. + + ***** + 3. Manipulating limbs + ***** + + The basic set of limbs an NPC gets is generally set when you set its + race. You can get a list of supported NPC races through the mraces + command. Occassionally, however, you may want to create NPCs of + unique races, or with unique body structures. Or perhaps you want a + human whose right hand is already amputated. This section deals with + doing those things. + + Amputating a limb is simple. Call RemoveLimb("limb"). Note that that + is not useful for removing a limb that should not be there. Instead, + it is used for amputating a limb that looks amputated. + + If, on the other hand, you wish to remove a limb which simply should + not have been there in the first place, call DestLimb("limb"). + + The most simple case of actual limb manipulation, however, is to + change the basic structure of an individual NPC around for some + reason. For example, perhaps you wanted to add a tail to a human. + For this, you use the AddLimb() function. + + Function: varargs int AddLimb(string limb, string parent, int class, int *armours); + Examples: AddLimb("tail", "torso", 4) + AddLimb("head", "torso", 1, ({ A_HELMET, A_VISOR, A_AMULET })); + + This function adds a new limb to the NPC's body. The first argument + is the name of the limb to be added. The second argument is the name + of the limb to which it is attached. The third argument is the limb + class. Limb class is a number between 1 and 5. The lower the number, + the harder the limb is to remove. A limb class of 1 also means that + removal of the limb is fatal. The fourth, optional argument is a list + of armour types which may be worn on that limb. + + In some cases, you may wish to create a new race from scratch. This + requires adding every single limb manually. You first call SetRace() + with a special second argument to note that you are creating a new + race: + + SetRace("womble", 1); + + Then, you add the limbs for that race one by one. Make sure you call + SetRace() first. diff -c -r --new-file ds1.1/lib/doc/manual/chapter23 ds2.0r27/lib/doc/manual/chapter23 *** ds1.1/lib/doc/manual/chapter23 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter23 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,94 ---- + chapter 23 "Properties" + Supported Properties + The Nightmare IV LPC Library + written by Descartes of Borg 950429 + + The Nightmare IV LPC Library allows creators to set dynamic variables in + objects which do not get saved when the object saves. The variables are + called properties. A property is an attribute of an object which is + considered fleeting. This document serves to list the properties + commonly used and their purpose. It is by no means complete, as the + point of having properties is to allow creators to build their own on the + fly. + + Note: All properties are 0 by default unless otherwise stated. + + Property: light + Values: integer between -6 and 6 + Light is a value generally between -6 and 6 which, for rooms, + determines how much light is naturally available in a room in daytime. + For other objects, it determines the degree to which the object is + able to modify the amount of light that exists in the room. If the + room is indoors, the light does not change based on the time of day. + + Property: no attack + Values: 1 to prevent attacks, 0 to allow them + Things cannot begin combat from inside a room with this property. + + Property: no bump + Values: 1 to prevent bumping, 0 to allow it + If a room, then nothing can be bumped from this room. If a living + thing, then it cannot be bumped. + + Property: no steal + Values: 1 to prevent stealing, 0 to allow it + This prevents stealing inside a room with this property. + + Property: no magic + Values: 1 to prevent magic, 0 to allow it + This prevents any magic from being used inside the room if set. + + Property: no paralyze + Values: 1 prevents paralysis from occurring in a room, 0 allows it + Stops any sort of thing which might cause paralysis from occurring in + a room. + + Property: no teleport + Values: 1 if teleporting is prohibited, 0 if allowed + Prevents people from teleporting to or from the room. + + Property: no clear + Values: 1 to prevent clearing, 0 to allow it + If set this prevents an avatar from clearing a wilderness room in + order to build a town. Not relevant to rooms in towns. + + Property: estates + Values: any non-negative number + Sets the number of estates which can be built in an area. No estates + may be built outside of towns. + + Property: magic item + Values: an array of strings describing the magic contained in an object + Allows you to mark specific objects as magic. For example, if a sword + has a magical lighting ability, you might do: + SetProperty("magic item", ({ "light" })); + + Property: lockpicking tool + Values: any integer marking how well lockpicking is enhanced + When picking a lock, the value of this property is calculated for each + object and added to the overall chance to pick the lock. + + Property: keep + Values: the name of whomever the object is kept for + While set, this object may only be picked up by the person whose name + matches the value of this property. If 0, anyone can pick it up + assuming it is normally gettable. + + Property: magic hold + Value: any integer + Is subtracted from the chance of success of anyone trying to pick a + lock. + + Property: enchantment + Value: any integer + Enchants any object to boost (or degrade) its performance of its + natural functions. + + Property: login + Value: a string representing a file name + Sets which room a player should login to at next login if they quit + from the room that has this property. For example, if you have a + treasure room that is protected, and therefore you do not want people + logging into it, you can call: + SetProperty("login", "/file/name/outside/this/room"); + to have the players login to the room outside. diff -c -r --new-file ds1.1/lib/doc/manual/chapter24 ds2.0r27/lib/doc/manual/chapter24 *** ds1.1/lib/doc/manual/chapter24 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter24 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,36 ---- + chapter 24 "Quests" + Building Quests + from the Nightmare IV LPC Library + written by Descartes of Borg 950716 + + Unlike previous Nightmare versions, Nightmare IV has no support for + centralized quest administration. This was done under the belief that + coercive questing was among the least favourite features players have + mentioned about the MUDs I have encountered. Nevertheless, the + presence of quests is still an extrememly important part of any MUD. + Since the coercive nature (needing to complete quest X to raise to + level Y) has been removed, other ways to make questing worthwhile need + to be found. + + The first, and most obvious, is to properly reward the player with + money, items, and skill and stat points. The other bit of support is + for a title list. Each quest, or accomplishment, is added to a list + of accomplishments the player has. The player may display any of + those at any time as part of their title. + + The interface to this is simple: + + player_object->AddQuest(string title, string description); + + Example: + + this_player()->AddQuest("the slayer of frogs", + "You viciously slayed the evil frogs of Wernmeister that " + "threatened the peaceful town with warts and unabated fly murder."); + + In the player's biography, they will see the description along with + the date they accomplished the task. From their title list, they will + now be able to choose this title. + + Descartes of Borg + 950716 diff -c -r --new-file ds1.1/lib/doc/manual/chapter25 ds2.0r27/lib/doc/manual/chapter25 *** ds1.1/lib/doc/manual/chapter25 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter25 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,488 ---- + chapter 25 "Rooms" + Building Rooms + The Nightmare IV LPC Library + written by Descartes of Borg 950420 + + This document details how to build rooms using the Nightmare IV LPC + Library's inheritable room object. This document is divided into + simple room building and complex room building. The first part + teaches you about basic rooms. The second part tells you what + features are there to allow you to do creative things with the room object. + + ************************************************ + Part 1: Basic Room Building + ************************************************ + + I. The Simple Room + The simple room minimally looks like this: + + #include <lib.h> + + inherit LIB_ROOM; + + static void create() { + room::create(); + SetProperty("light", 2); + SetClimate("indoors"); + SetShort("an empty room"); + SetLong("An empty room with no exits leading anywhere. It is " + "completely barren with nothing to describe."); + } + + #include <lib.h> + This first line is one you need in any object. It defines the exact + location of objects which you inherit. In this case, the object is + LIB_ROOM. It is currently located at /lib/room.c. If we wanted to + change that location, however, we could do it easily since you only + reference LIB_ROOM. So lib.h is a file that says that LIB_ROOM is + "/lib/room". + + inherit LIB_ROOM; + The third line, the inherit line, says that this object will inherit + /lib/room.c. + + static void create() { + The fifth line begins the meat of any object you will write. This is + the beginning of a function. This one is called create(). If you are + curious, the static means no one can use the call command to call the + function. Do not worry about that too much, however, as it is always + something you put there for the create() function. + + The "void" part simply says that you are returning no value from the + function. See the LPC Basics textbook for more information on + functions. + + room::create(); + Inside the create() function are the calls which define what the + object will do. The first call calls the function create() in + /lib/room.c, the object you just inherited. /lib/room.c has its own + create() function which does some things needed in order to set up + your object. You need to make sure it gets called through this line. + + SetProperty("light", 2); + This sets the light in the room to be 2. In outdoors rooms, this is + the average light during day time. In indoor rooms, it is the average + light all the time. + + SetClimate("indoors") + Every room has a climate. An indoors room, among other things, is not + affected by weather or the time of day. + + SetShort("an empty room") + This is the description that the player sees when in brief mode. In + addition, in brief mode, obvious exit abbreviations are automatically + added. This is done through the SetObviousExits() function described + later. However, the short should be phrased in such a way that it + makes sense from something like a scry command which would say + something like: "You see Descartes in an empty room." + + SetLong("An empty room with no exits leading anywhere. It is " + "completely barren with nothing to describe."); + This sets the long description seen by the player when in verbose + mode. Note that items in the room as well as scents and sounds are + added to what the player sees automatically. + + That's it! You now have a room which no one can leave! + + II. Adding items + Approval on any decent MUD will eat you for lunch if you do not + describe your items. This is likely the most tedious part of area + building, however, it is also the part that largely makes the + difference between a dull area and a fun one. You must be sure to + make it so that anything a player might logically want to see in + detail in a room is described in detail. For example, say you have + the following long description for a room: + + You are in Monument Square, once known as Krasna Square. The two main + roads of Praxis intersect here, where all of Nightmare's people gather + in joy and sorrow. The road running north and south is called Centre + Path, while Boc La Road is the name of the road running east and west. + A magnificent monument rises above the square. + + You should have descriptions for the following items placed in your + room: + + square, monument, monument square, krasna square, roads, road, + intersection, people, centre path, boc la road, magnificent monument + + How to do this with a minimum of hassle: + + SetItems( ([ ({ "square", "monument square", "krasna square" }) : + "The central square of Praxis where citizens and adventurers " + "gather to chat and trade. Formerly known as Krasna Square, " + "is now known as Monument Square as thanks to those who helped " + "to build the town", + ({ "monument", "magnificent monument" }) : "A giant monolith " + "rising above Monument Square", + ({ "intersection", "road", "roads" }) : "The two main roads of Praxis " + "intersect in Monument Square. The one to the north and south " + "is called Centre Path, while the other is Boc La Road.", + ({ "people", "adventurers", "citizens" }) : "A varied group of " + "people from countless realms hanging about talking and trading.", + "centre path" : "The main road leading north to the North Forest " + "from Praxis, and south to the sea.", + "boc la road" : "The main east-west road through Praxis, going " + "east towards the jungle, and west towards the Daroq Mountains." ]) ); + + That may seem like a mouthful, but it is easier to break down into + smaller points and see what is going on. The SetItems() prototype + looks like this: + + mapping SetItems(mapping items); + + That means it accepts a data type called a mapping as the argument and + returns a new mapping of items. A mapping is a special data type in + LPC that allows you to associate two values together, for example, to + associate an item with its description. For example, above we wanted + to associate the items "monument" and "magnificent monument" with the + description "A giant monolith rising above Monument Square". To do + that, a mapping looks like this: + + ([ value1 : assoc_value1 ]) + + where assoc_value1 is the value associated with value1. In this case, + we might have something like: + + ([ "monument" : "A giant monolith rising above Monument Square." ]) + + But, we also wanted to associate "magnificent monument" with this + description. One way, which is perfectly legitimate, would be: + + ([ "monument" : "A giant monolith rising above Monument Square", + "magnificent monument" : "A giant monolith rising above Monument Square" ]) + + But that would be damned annoying, especially with long descriptions + or things with a lot of synonyms. You can therefore group values + which have the same description together using array notation: + ({ value1, value2, value3 }) + + And thus, make that mapping look like: + + ([ ({ "monument", "magnificent monument" }) : "A giant monolith rising " + "above Monument Square." ]) + + To complete setting the items, you simply add other item/description + pairs separated by commas: + + ([ ({ "monument", "monument square" }) : "A giant monolith rising " + "above Monument Square.", + "house" : "A little white house with white picket fences." ]) + + Mappings are a rather difficult concept to grasp, but once grasped + they are very powerful. You should take a look at some sample code + from /domains/Examples/room to get a good idea of what proper code + looks like. In addition, there is a chapter in Intermediate LPC + dedicated to the concept. Finally, you can always mail + borg@imaginary.com to ask questions. + + III. Adding Exits and Enters + If you understand the section above, exits and enters are simple. + They too use mappings, but less complicated ones: + + SetExits( ([ "north" : "/domains/Praxis/n_centre1", + "south" : "/domains/Praxis/s_centre1", + "east" : "/domains/Praxis/e_boc_la1", + "west" : "/domains/Praxis/w_boc_la1" ]) ); + + SetEnters( ([ "hall" : "/domains/Praxis/town_hall", + "pub" : "/domains/Praxis/pub" ]) ); + + With an exit mapping, you simply match the direction to the room to + which it leads. With an enter mapping, you match a thing being + entered with the room to which it leads. + + Unlike other LPC Libraries, the Nightmare IV LPC Library distinguishes + between the concept of motion towards and motion into. Motion towards + is exemplified by the "go" command, which is affected by SetExits(). + For example, to go east, you type "go east". You are simply going + towards the east (Note that "go east" is by default aliased to "e"). + + Motion into is exemplified by the "enter" command, which is affected + by SetEnters(). Enter marks anything you enter into, for example a + building or bushes or the like. In the above example, a player would + issue the command "enter pub" to enter the pub. + + IV. Adding Objects + If you want to add physical objects into your room, you use the + SetInventory() function. For example, if you wanted to place a balrog + in the room: + + SetInventory(([ "/domains/Praxis/npc/balrog" : 1 ]); + + Every reset, the room will then check to see if any balrogs are in the + room. If no balrogs are in the room it will clone 1. Again, this is + another function using a mapping. In this case it is associating the + file name of an object with how many of that object should be in the + room at every reset. If you wanted 5 balrogs in the room, you would + have changed the 1 to 5. + + V. Adding Smells, Listens, and Searches + + The functions: + SetSmell() + SetSearch() + SetListen() + + All work identically to the SetItems() function. That is they match + things you can smell, listen, search to descriptions which the player + sees when they smell, listen, search the item. + + For example: + + SetSmell( ([ "monument" : "It smells of obsidian.", + "road" : "It smells dusty.", + ({ "pub", "bar" }) : "It smells of alcohol." ]) ); + + If a player types: + "smell monument" + then they see + "It smells of obsidian." + + One unique thing about these three functions, however, is that you can + use the special thing "default" to set a smell, listen, or search that + occurs when no object is specified. For example, + + SetSmell(([ "default" : "It really stinks here." ]) ); + + Will have the player see "It really stinks here." when they simply + type "smell". In addition, this is the smell the player sees when + they simply walk into a room. + + VI. Miscellaneous stuff + + SetObviousExits("n, s, e") + Sets an obvious exits string which gets seen in brief mode and by + newbies in verbose mode. Generally, this should consist of the + abbreviations for the room's obvious exits only. + + SetTown("Praxis") + For rooms which are considered part of a town, you must specify that + they are part of the town through this function. In this example, the + room is set to be in the town of Praxis. See the document + /doc/build/Towns for more information on towns. + + SetDayLong("The sky lights up the endless fields of wheat which stand " + "before you."); + SetNightLong("You are standing in a pitch black field of wheat."); + Instead of using SetLong(), you can call both of these functions to + give different long descriptions for day and night. + + SetGravity(2.0) + This makes things in the room twice as heavy as normal. + + SetDoor("east", "/domains/Praxis/doors/red_door"); + Sets a door to the east which is the file + "/domains/Praxis/doors/red_door.c". You should have an exit to the + east, and you should do this AFTER you have called SetItems(). See + the document /doc/build/Doors for detailed information on door + building. + + VII. Summary + + Here is a room that uses everything described above: + + #include <lib.h> + + inherit LIB_ROOM; + + static void create() { + room::create(); + SetProperty("light", 2); + SetClimate("temperate"); + SetTown("Praxis"); + SetShort("a peaceful park"); + SetDayLong("The light of the sun shines down upon an open field " + "in the middle of Praxis known as Kronos Park. In spite " + "of the time of day, no one is around. East Boc La " + "Road is to the south."); + SetNightLong("Kronos Park is a poorly lit haven for rogues in the " + "cover of night. It is safest to head back south " + "towards the lights of East Boc La Road"); + SetItems( ([ ({ "field", "park" }) : "A wide open park in the " + "center of Praxis." ]) ); + SetSearch( ([ "field" : "You get dirt all over your hands." ]) ); + SetSmell( ([ "default" : "You smell grass after a fresh rain.", + "dirt" : "It smells like... dirt!" ]) ); + SetExits( ([ "south" : "/domains/Praxis/e_boc_la3" ]) ); + SetInventory( ([ "/domains/Praxis/npc/rogue" : 2 ]) ); + } + + ************************************************ + Part 2: Advanced Room Building + ************************************************ + I. Functionals + MudOS has a data type called a functional. Most room functions take a + functional as an argument instead of a string. What this does is + allow you to specify a function to get called in order to determine + the value rather than set it as a string which cannot be changed. For + example, if you wanted to set a long description that varied depending the + status of a door: + + #include <lib.h> + + inherit LIB_ROOM; + + string CheckDoor(string useless); + + static void create() { + room::create(); + SetProperty("light", 2); + SetClimate("indoors"); + SetShort("an indoor room with a door"); + SetLong( (: CheckDoor :) ); + SetExits( ([ "east" : "/domains/Praxis/east_room" ]) ); + SetDoor("east", "/domains/Praxis/doors/red_door"); + } + + string CheckDoor(string useless) { + string tmp; + + tmp = "You are in a plain indoor room with a door. "; + if( (int)"/domains/Praxis/doors/red_door"->GetOpen() ) + tmp += "The door is open."; + else tmp += "The door is closed."; + return tmp; + } + + In this example, a function called CheckDoor() was written to + determine exactly what the long description should be. This is done + because in create(), you have no idea what the status of the door will + be from moment to moment. Using a function, you can therefore + determine what the long description is at the time it is needed. + + Functionals can reference any function anywhere on the MUD, including + efuns. See /doc/lpc/data_types/functionals for details on them. For + the sake of this document however, you note a functional using smileys + :). + + (: CheckDoor :) means the function CheckDoor() in this object. You + can also specify function in other objects, for example: + (: call_other, this_player(), "GetName" :) would refer to GetName() in + the person who was this_player() AT THE TIME THE FUNCTIONAL WAS + CREATED. + + Notice at the top of the file that CheckDoor() was prototyped. You + must prototype any function you reference inside your objects. The + expression (: CheckDoor :) constitutes as a reference, and thus makes + you need to prototype the function. + + The rest of this portion describes individual function calls using + functionals. The functional prototype part is how your functional + should be declared.: + + SetShort(string | function) + Functional prototype: string ShortFunc(); + Example: SetShort( (: MyShort :) ); + If you pass it a function, then this function gets called to determine + the short description. The function should return a string which will + be used as the short description. + + SetLong(string | function) + Functional prototype: string LongFunc(string unused) + Example: SetLong( (: MyLong :) ); + This function should return a string which will be used as the long + description for the room. The argument "unused" is just that, unused + in this context. It is something used for other objects. + + SetItems(mapping mp); + Functional prototype: string ItemFunc(string item); + Example: SetItems( ([ "house" : (: LookHouse :) ]) ); + This function should return a string to be used for the item + description. The argument is passed the name of the item being looked + at, so you can use the same function for multiple items. + + SetSearch(mapping mp) + Alternate: SetSearch(string item, string | function desc) + Functional prototype: string SearchFunc(string item); + Examples: SetSearch( ([ "grass" : (: SearchGrass :) ]) ); + SetSearch("grass", (: SearchGrass :)); + Note that there are two forms to SetSearch(), useful depending on how + many searches you are setting at once. If you have a search function, + then that function should return a string which is what they will see. + The argument passed is the item being searched. + + SetSmell() + SetListem() + see SetSearch() + + II. Advanced Exits + SetExits() is fairly straight forward. However, there exists another + function for exits called AddExit(). It allows you to add one exit at + a time (useful if say a player searches and finds a new exit) as well + as give functional power to exits. The prototype for AddExit() is: + + varargs mapping AddExit(string dir, string dest, function pre, function post); + + The varargs part of the prototype simply means you can call it using + less than the full number of arguments specified. In this case, the + minimum call is: + + AddExit("east", "/domains/Praxis/square"); + + The last two arguments are called pre-exit functions and post exit + functions. The pre-exit function gets called when a player issues a + command to leave the room, but before the player is allowed to leave. + Depending on the return value of the function, the player is allowed + or denied the right to leave. For example: + + AddExit("north", "/domains/Praxis/square", (: PreExit :)); + + int PreExit(string dir) { + if( !avatarp(this_player()) ) { + write("You are too lowly to go that way!"); + return 0; + } + else return 1; + } + + In other words, if the player is an avatar, they can go north. + Otherwise they cannot. The prototype is: + + int PreExit(string dir); + + where the return value is 1 or 0 for can or cannot leave, and the + argument dir is the direction in which the player is exiting. + + Post exit functions work a little differently since it makes no sense + to prevent someone from leaving once they have left. The prototype + looks like: + + void PostExit(string dir); + + This simply allows you to do processing once the player is gone. If + you wish a post exit without a pre exit, then: + + AddExit("north", "/domains/Praxis/square"", 0, (: PostExit :)); + + Enters work exactly the same way. + + Please read about the events CanReceive() and CanRelease(), as those + may be more appropriate places to do what you want. Remember, this + only prevents a player from using the "go" command to go in that + direction. CanReceive() in the other room would be better if your + desire is to keep non-avatars out of the square at any cost. + + III. Other Functions + + AddExit() + RemoveExit() + AddEnter() + RemoveEnter() + RemoveSearch() + RemoveSmell() + RemoveListen() + AddItem() + RemoveItem() + + All of the above Remove*() functions take a single string argument + specifying what it is that is being removed. For example: + + RemoveExit("east") + + removes the exit to the east. + + AddItem(string item, mixed val) + Adds a single item. Val can be a string or function. + + Descartes of Borg + borg@imaginary.com diff -c -r --new-file ds1.1/lib/doc/manual/chapter26 ds2.0r27/lib/doc/manual/chapter26 *** ds1.1/lib/doc/manual/chapter26 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter26 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,236 ---- + chapter 26 "Sentients" + Building Sentient Non-Player Characters + The Nightmare IV Object Library + written by Descartes of Borg 951127 + + One thing most everyone wants to see are monsters that react more + intelligently to user input. The fact is, however, that most monsters + in the game only need a small, basic behaviour set. Nevertheless, in + order to make an area interesting, there should be some monsters which + stand out as unique and purposeful. The problem about building such + monsters is that they use a lot of processing time. + + In order to make sure most monsters which do not need such + intelligence do not waste processing time on such activities, the + Nightmare Object Library separates non-player characters into two + classes: dumb monsters, which are basic mindless automata and + sentients, monsters which react more intelligently to their + environment. + + This document describes sentients. Before looking at this document, + it is highly recommended that you be familiar with the document + /doc/build/NPC which details non-player characters. Sentients are + non-player characters, so everthing which applies to non-player + characters also applies to sentients. + + ***** + + Currently, a few basic behaviours distinguish sentients from normal + npcs. Those behaviours are the ability to intelligently move about + the mud and to react to user speech. Nightmare thus provides the + following functions to allow you to easily have an sentient enact + those behaviours: + + mapping SetTalkResponses(mapping mp); + mixed AddTalkResponse(string str, mixed val); + int RemoveTalkResponse(string str); + + mapping SetCommandResponses(mapping mp); + mixed AddCommandResponse(string str, mixed val); + int RemoveCommandResponse(string str); + + varargs int SetWander(int speed, string *path, int recurse); + string *SetWanderPath(string *path); + + int SetWanderRecurse(int x); + + int SetWanderSpeed(int x); + + ***** + + Making NPCs react to user speech + + You may want to have NPCs react to things players say. To that end, + the following functions exist: + + mapping SetTalkResponses(mapping mp); + mixed AddTalkResponse(string str, mixed val); + int RemoveTalkResponse(string str); + + Function: mapping SetTalkResponses(mapping mp) + Example: SetTalkResponses( ([ "square" : "The square is east of here.", + "house" : "Isn't that an ugly house?" ]) ); + + This function allows you to set a list of responses to given phrases. + For example, if you put this code in a sentient and a player said + "Where is the square?" or "Your frog is certainly square.", your NPC + would have said "The square is east of here.". Note therefore that + the NPC is only looking for the keys you place in there. You could + have restricted it to "where is the square" instead of "square", but + then someone asking "Where's the square" would be missed. + + Also note that phrases should be in lower case. It will match to + upper case words automatically. + + Finally, you can either give a string or a function as the match to a + phrase. If the match is a string, the NPC simply says the string in + the NPC's native tongue. If, however, the match is a function, that + function will get called. + + ***** + + Function: mixed AddTalkResponse(string str, mixed val); + Example: AddTalkResponse("in the house", (: HouseFunc :)); + + Matches an individual phrase to a string or function. As with + SetTalkResponses(), if the match is a string, the NPC simply says the + string in response to the phrase. If it is a function, that function + gets called. + + ***** + + Function: int RemoveTalkResponse(string str); + Example: RemoveTalkResponse("house"); + + Removes the previous set or added talk response from the NPC. + + ***** + + Making NPCs react to user directives + + Nightmare supports a special command, the "ask" command. A player may + use the ask command to ask an NPC to perform a certain task. For + example, "ask the healer to mend my right leg". There is a special + event in NPC's which responds to this called eventAsk(). In order to + make responding to this easier, however, Nightmare has the + CommandResponse functions. The command response functions allow NPC's + to respond based on commands, like "mend". + + ***** + + Function: mapping SetCommandResponses(mapping mp); + Example: SetCommandResponses( ([ "heal", "I cannot heal people" ]) ); + + Allows you to match commands to either strings or functions. Matched + functions get called with the command as the first argument, and + command arguments as the second argument. For example, if you had: + SetCommandResponses("give", (: give :)); + Your give() function would get called with "give" as the first + argument and "me the sword" as the second argument in response to a + player issuing the command "ask the monster to give me the sword". + + ***** + + Function: mixed AddCommandResponse(string str, mixed val); + Example: AddCommandResponse("give", (: give :)); + + This allows you to add to the list of commands to which the NPC + responds. The NPC responds to those commands as outlined for + SetCommandResponses(). + + ***** + + Function: int RemoveCommandResponse(string str); + Example: RemoveCommandResponse("give") + + Removes a previously set command response. + + ***** + + Making NPCs move about the game intelligently + + A sticky subject on most muds is that of wandering monsters. When + done poorly, they can waste resources to a great degree. Nightmare, + however, works to avoid wasting resources while getting the most out + of allowing monsters to move about. + + Nightmare supports two types of wandering monsters: those which have + pre-determined paths and others which are true wanderers. True + wanderers, those who simply randomly choose paths are subject to the + following restrictions: + They may not move into rooms not yet loaded in memory. + They will not try to open closed doors. + The first restriction is the most important to note. This means that + the NPC will not wander into rooms that have not been recently visited + by some player. This avoids the problem NPCs cause on many muds of + uselessly loading rooms that only the monster will ever see. + + Monsters given specific paths to wander are not subject to the above + restrictions. Of course, they cannot wander through closed doors. + But you can make part of their path to open a closed door. In + addition, since such monsters have very specific sets of rooms into + which they can travel, they are not in danger of needlessly loading a + zillion rooms. + + ***** + + Function: varargs int SetWander(int speed, string *path, int recurse); + Examples: + SetWander(5); + SetWander(5, ({ "go north", "open door", "enter hut", "go west" })); + SetWander(5, ({ "go north", "open door", "enter hut", "go west", + "go south" }), 1); + + This is the function you will almost always use in create() to make a + sentient wander. Only one of the three possible arguments is + mandatory, that being the speed. The speed is simply the number of + heart beats between attempts to move. Thus, the higher the number, + the slower the movement of the monster. + + The second argument, if given, is a list of commands which will be + executed in order by the monster. If it is not given, the monster + will be assumed to be a true wanderer. In other words, the first time + the monster tries to wander, the monster will "go north". The second + time, he will "open door". The third, he will "enter hut", etc. + + The third argument is either 1 or 0. If 1, that means once the + monster has completed the path, it will use the first command in the + list the next time it tries to wander. If 0, it will cease to issue + commands once it has cycled through the list. + + You might note that between the time the above monster opens the door + and enters the hut, somebody could come along and shut the door. How + can you deal with that? You could do: + SetWander(5, ({ "go north", ({ "open door", "enter hut" }) })); + You will notice here that the second member of the command array is + itself an array instead of a string. In that case, all members of + that array get executed as part of that wander. In this case it helps + make sure no one closes the door between when the monster tries to + open it and when it tries to pass through the door. + + For even more flexibility, you can make elements of the array into + functions. Instead of executing a command in a wander turn, the + function you provide instead gets called. For example: + SetWander(5, ({ "go north", (: kill_anyone :), "go south" }), 1); + Where the function kill_anyone() has the monster kill any players in + that room. Thus, this monster sits in its room and occasionally pops + its head one room to the north to kill anyone sitting there. + + ***** + + Function: string *SetWanderPath(string *path); + Example: SetWanderPath(({ "go north", "go south" })) + + Allows you to set the monster's wander path independent of other + settings. The wander path will never get executed, however, unless + the monster's wander speed is greater than 0. + + ***** + + Function: int SetWanderRecurse(int x); + Example: SetWanderRecurse(1); + + Allows you to make the monster's wander path recurse independent of + other settings. This is meaningless, however, unless the monster's + wander speed is greater than 0 and a wander path is set for it. + + ***** + + Function: int SetWanderSpeed(int x); + Example: SetWanderSpeed(5); + + Allows you to set the monster's wander speed independent of other + settings. This is NOT the same as SetWander(5). SetWander() will + clear out any previous wander path and wander recurse settings. This + function has no effect on the monster's wander path or wander recurse. + diff -c -r --new-file ds1.1/lib/doc/manual/chapter27 ds2.0r27/lib/doc/manual/chapter27 *** ds1.1/lib/doc/manual/chapter27 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter27 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,91 ---- + chapter 27 "Towns" + Building Towns + The Nightmare IV LPC Library + written by Descartes of Borg 950429 + + The Nightmare IV LPC Library contains support for towns, which is in + fact very minimal from the mudlib level. If, however, you wish to + structure your MUD to be centered around the concept as Nightmare LPMud + is, then you need to understand how to build a town. This document + describes the building of towns using the Nightmare IV LPC Library. + + I. What Is a Town? + A town is simply a collection of rooms which have the same value set + for Town. If done poorly, this is all it is. If done right, however, + a town becomes the center of the games' social structure. If you + decide to build a town in your area, the first thing you need to do is + isolate it. All towns should be surrounded by vast, vast areas of + wilderness of some sort. This may mean desert, forest, jungle, or + whatever. You may or may not want to have a road which links it to + the rest of civilization. + + Rooms are considered "wilderness" by default. That is, if you never + set the town in them, they are considered wilderness. To make a room + part of a town, you need to call SetTown() from create() of the room: + + SetTown("Praxis"); + + Capitalize your town name properly. + + Next you need to decide how many estates may be built in the room. + Ideally, towns are expanding and changing things. Upper level players + have the ability to build estates in their home towns. Of course, ten + estates in one room is crowded. Generally you should limit the number + of estates to what would logically fit in a given room. For example, + if you are on a road at the edge of town with nothing about, then + allowing two estates makes sense. On the other hand, in the middle of + an intersection of two roads, there is hardly any room for an estate + to be built. To allow estates to be built in a room: + + SetProperty("estates", 2); + + This allows two estates to be built off of this room. + + As stated above, towns are expanding. This is why they should be + situated far apart. Too close together it is hard for them to expand + without changing the overall map of the game. Therefore, when your + town has gotten as full as can be handled, then you simply move to + outlying rooms and make them part of the town by setting their town. + In addition, give them the capacity for estates. Do not forget to + change room descriptions and allow for needed roads! + + II. What do I put in towns? + The first section described what is minimally needed for a town from a + code point of view. This section describes what sorts of things you + should put in your towns. Most are optional, however, you do need to + add something called an adventurer's hall. An adventurer's hall is + the default start room for the town for anyone who chooses the town as + their home town. In order to make it their home town, they go to the + adventurer's hall and pay a fee (generally determined by approval) to + move to this town. Until that person builds an estate in the town, + the adventurer's hall is their default starting point. + + Beyond that, the only other thing required is a real estate office for + selling estates. This is an inheritable from /lib/sales.c + (LIB_SALES). Approval determines what your local land value is, and + you fill in the descriptions. For information on advanced coding of + sales offices, see the document /doc/build/Sales. + + Nothing else is required. Of course, your land value (the amount + people pay to live and build in your town) is determined by the sorts + of services your town offers. No town should offer all services. And + certainly, the services your town offers should reflect the nature of + the region in which you are building. Are you an isolated, small + town? Then few services will be available. Are you a central, large + town? Then a majority of services should be available. + + Services include: + shops of different types + bars and pubs + restaurants + libraries for learning languages + class halls + town council rooms + + This list will probably expand over time, but it provides a good + starting point for common services. + + Descartes of Borg + borg@imaginary.com + + diff -c -r --new-file ds1.1/lib/doc/manual/chapter28 ds2.0r27/lib/doc/manual/chapter28 *** ds1.1/lib/doc/manual/chapter28 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter28 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,64 ---- + chapter 28 "Vendors" + Building Store Vendors + The Nightmare IV LPC Library + written by Descartes of Borg 950528 + + This document details the creation of vendor objects, NPC's which buy + and sell items. Note that vendors are NPC's, so everything in the + document on building NPC's applies to vendors. It is recommended that + you be completely familiar with that document before moving on to this + one. + + Building vendors is actually quite simple, with very little required + beyond the NPC requirements. In fact, only the following function + calls are unique to vendors: + + string SetLocalCurrency(string currency); + string SetStorageRoom(string room); + int SetMaxItems(int num); + int SetVendorType(int vt); + + One special note, however, is that the skill "bargaining" is extremely + important to vendors. Namely, the higher the bargaining, the harder + it is for players to get decent prices. + + ***** + string SetLocalCurrency(string curr); + ***** + + Example: SetLocalCurrency("electrum"); + + Sets the currency which the vendor will use for doing business. The + currencies should be approved by the approval team. + + ***** + string SetStorageRoom(string room); + ***** + + Example: SetStorageRoom("/domains/Praxis/horace_storage"); + + Identifies the file name of the room in which the vendor will be + storing items for sale. This room should never be accessible to + players. + + ***** + int SetMaxItems(int num); + ***** + + Example: SetMaxItems(60); + + Sets the maximum number of items a vendor can keep in storage at any + given time. Refer to approval documentation for proper numbers for + this. + + ***** + int SetVendorType(int type); + ***** + + Examples: + SetVendorType(VT_WEAPON); + SetVendorType(VT_ARMOUR | VT_WEAPON); + + Sets which types of items a vendor will buy and sell. A list of all + vendor types is in /include/vendor_types.h. You may allow a vendor to + sell multiple types using the | operator. diff -c -r --new-file ds1.1/lib/doc/manual/chapter29 ds2.0r27/lib/doc/manual/chapter29 *** ds1.1/lib/doc/manual/chapter29 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter29 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,213 ---- + chapter 29 "Weapons" + Building Weapons + The Nightmare IV LPC Library + written by Descartes of Borg 950429 + + All items in the Nightmare LPC Library (descendants of /lib/item.c) + are weapons. A player can, for example, use a can of spam as a + weapon. However, they are set up as extremely pathetic weapons. This + document describes in detail how to make an object into a real weapon. + + I. Basic Stuff + The basic weapon is exactly the same as the basic item. You can do + anything to it that can be done to other items. For details on items, + see /doc/build/Items. The simple weapon should look like this: + + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + + static void create() { + item::create(); + SetKeyName("short sword"); + SetId( ({ "sword", "short sword", "a short sword" }) ); + SetAdjectives( ({ "short" }) ); + SetShort("a short sword"); + SetLong("A rusty short sword with specs of blood on it."); + SetVendorType(VT_WEAPON); + SetDamagePoints(1500); + SetClass(12); + SetValue(150); + SetMass(100); + SetWeaponType("blade"); + SetDamageType(BLADE); + } + + The last part is what differs from regular items. Note the functions: + + SetVendorType() + SetClass() + SetWeaponType() + SetDamageType() + + The available vendor types can be found by reading the file + /include/vendor_types.h. Similarly, damage types may be found by + reading /include/damage_types.h. The vendor type states what sort of + stores can carry this item. VT_WEAPON should almost ALWAYS be the + vendor type you give for weapons. + + SetClass() + The class is the basic weapon strength. It is how much damage gets + done without any modification. This number ranges between 1 and 100, + where 1 is a pathetic weapon (the class for basic items) and 100 is + probably bordering on illegal. + + SetWeaponType() + This sets what sort of attack skill the player needs to use this + weapon. The weapon types are: + blade + knife + blunt + projectile + + SetDamageType() + Damage types, again, are found in /include/damage_types.h. This sets + what type of damage is done by this weapon to its victims. + + II. Wield Functions + + mixed SetWield(string | function) + Examples: + SetWield("The short sword feels dull as you wield it."); + SetWield( (: WieldMe :) ); + + If you pass a string to SetWield(), then the player sees that string + whenever they wield the weapon. If, on the other hand, you pass a + function, then that function will get called just before the weapon is + wielded when the player issues the wield command. The function you + pass should be written in the form of: + + int WieldMe(); + + If the function returns 1, then the player can wield the weapon. If + it returns 0, then the player cannot wield the weapon. Note that if + you have a wield function, you are responsible for all messaging to + the player to let the player know that they can/cannot wield the + weapon. Example: + + int WieldMe() { + if( (int)this_player()->ClassMember("fighter") ) { + write("The short sword gives you power as you wield it."); + say((string)this_player()->GetName() + " wields a short sword."); + return 1; + } + else { + write("You are not worthy of this short sword."); + return 0; + } + } + + + III. Modifying Stats and Skills + A common thing people like to do with weapons is temporarily modify a + player's skills. This is done by making use of the function + AddStatBonus() and AddSkillBonus(). Most of the time this is done + through a SetWield() function. + + void AddStatBonus(string stat, function f); + void AddSkillBonus(string stat, function f); + + Examples: + this_player()->AddStatBonus("wisdom", (: CheckStat :)); + this_player()->AddSkillBonus("blade attack", (: CheckSkill :)); + + The functions then have the format: + + int CheckWhatever(string stat_or_skill); + + NOTE: You should always check whether the bonus is still in effect. + For example, make sure the weapon is still wielded if it results from + wielding the weapon. For example: + + #include <lib.h> + + inherit LIB_ITEM; + + int DoWield() + int CheckBlade(string skill); + + static void create() { + ... + SetWield((: DoWield :)); + ... + } + + int DoWield() { + this_player()->AddSkillBonus("blade attack", (: CheckBlade :) ); + write("You wield the short sword."); + say((string)this_player()->GetName() + " wields a short sword."); + return 1; + } + + int CheckBlade(string skill) { + if( !GetWorn() ) { + previous_object()->RemoveSkillBonus("blade", this_object()); + return 0; + } + else return 5; + } + + + In other words, this weapon will give its wielder a blade attack bonus + of 5. Note that you must use previous_object() in CheckBlade() and + NOT this_player() because there is no way of knowing who this_player() + is at the time. You do know, however, that the object calling + CheckBlade() is always the player for whom the skill bonus is made. + Always remember to remove bonuses. + + IV. Modifying Hits + The Nightmare IV LPC Library uses an event driven combat system. With + respect to weapons, a round of combat is broken down into the + following events: + + 1. The person wielding the weapon uses it. + 2. If they cannot hit a motionless target, the round ends. + 3. If the target dodges the attack, the round ends. + 4. eventStrike() is called in the weapon to determine how much damage + the weapon can do. + 5. eventReceiveDamage() is called in the target object. This in turn: + a. Calls eventReceiveDamage() in all armour objects, which each: + i. Calls eventReceiveDamage() in the weapon + ii. The weapon wears down a bit + b. The armour wears down a bit + c. The amount of armour damage absorbed is returned + d. The target objects loses health points. + f. The amount of damage done is returned. + 6. Skill and stat points are added. + + Note the two important functions which get called in weapon.c: + + int eventStrike(object ob); + int eventReceiveDamage(int type, int amount, int unused, mixed limbs); + + By default, eventStrike() returns the value of GetClass(). However, + you can modify this value by overriding the eventStrike(). For + example: + + int eventStrike(object target) { + if( (string)target->GetRace() != "orc" ) return item::eventStrike(target); + message("environment", "The orc slayer makes a nasty sound!", + environment(target)); + return item::eventStrike(target) + random(10); + } + + NOTE: You should always use item::eventStrike() rather than hard coded + values since weapon class deteriorates over time. + + In this example, a random(10) points of extra damage gets done to + orcs. This would be the orc slayer weapon of ancient fame. + + For those familiar with hit functions in the old Nightmare Mudlibs, + this would be roughly equivalent to that. + + Another place where you can make things happen is in + eventDeteriorate() which gets called by eventReceieveDamage(). This is + where a weapon wears down from the shock which armour has absorbed + from it. For weapons, there is not much which can be done here, but + this document points it out for the creative who feel they might be able to do + somthing with it. + + Descartes of Borg + borg@imaginary.com diff -c -r --new-file ds1.1/lib/doc/manual/chapter30 ds2.0r27/lib/doc/manual/chapter30 *** ds1.1/lib/doc/manual/chapter30 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter30 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,205 ---- + chapter 30 "The Natural Language Parser" + The Natural Language Parser + + The Problem + A gut reaction to this entire system is to be overwhelmed by its apparent complexity, comparing it to the good-old days of using add_action(). A discussion of the natural language parsing system therefore needs to start by answering the question, "Why bother?". + + The old way of handling user input was to define commands and tie them to functions using add_action. Each user object kept track which commands it had available to it, and of which functions each command would trigger. The list of commands changed each time the player object (really, any object which had enable_commands() called in it) moved. In addition, each time an object moved inside the player object or left its inventory, this list changed. + + This led to two basic problems: + + 1. The same command might have slightly different uses in different parts of the mud. Or worse, the player could have two similar objects which define the same command in slightly different ways. + 2. The complexity of syntax varied based on creator abilities and was limited by CPU. + + For example, one creator could have created a rock in their area that added the 'throw' command. This creator is a newbie creator, and thus simply put the following code in their throw_rock() function: + + int throw_rock(string str) { + object ob; + + if( !str ) return 0; + ob = present(str, this_player()); + if( !ob ) { + notify_fail("You have no rock!"); + return 0; + } + if( ob != this_object() ) return 0; + if( (int)ob->move(environment(this_player())) != MOVE_OK ) { + write("You cannot throw it for some reason."); + return 1; + } + write("You throw the rock."); + say((string)this_player()->query_cap_name() + " throws the rock."); + return 1; + } + + In this case, "throw rock" will work, but "throw the granite rock at tommy" will not. But another creator also defined a throw command in their spear. This creator however, is a good coder and codes their throw_spear() command to handle 'throw the red spear at tommy' as well as 'throw spear'. Explain to a player why both syntaxes only work for the spear, and not for the rock. Then explain to that player why 'throw rock' for a rock built in yet another area yields 'What?'. + + An early attempt to get around this problem was the parse_command(). Unfortunately it was buggy spaghetti that was way too complex for anyone to understand. The MudOS attempt to solve this problem is its new natural language command parser. The parser is based on the following assumptions: + + All commands should behave in a consistent manner across the mud. + Similar objects should respond as expected to the same command line. + A player should only see 'What?' (or its equivalent) when they make a typo. + It should enable creators to handle the complex command processing required by the above assumption. + + Overview of the MudOS System + The MudOS natural language parser is based on a philosophy of centralized command parsing. In other words, creators have no control over which commands exist nor over what syntax rules existing commands follow. Instead, creators are tasked with defining what those commands mean to their objects. Unlike with add_action() where commands are registered to the driver, the MudOS system registers verbs (the command) and rules with the driver. In this example, a simple "smile" verb is registered with a single rule, "at LIV". + + With the old way of doing things, commands were executed either when a player entered in a command or when the command() efun was called. With this new system, a command may be executed at any time via either the parse_sentence() or parse_my_rules() efuns. + + When one of those efuns is called, the driver searches through the list of verbs for a verb and rule which matches the command string. In order to do that, however, it needs to make several calls of all the objects involved to determine what the sentence means. For any given command string, the following objects are relevant to the parsing of that command string: + + the verb handler + This object contains the functions used to see if the command is valid and to execute it. It is also the one that creates the rules for the verb. + + the subject + This is the object from which parse_sentence() is called, or the object mentioned as the first argument in parse_my_rules(). It is the object considered to be executing the command in questin, the logical subject of the sentence. + + the master object + This object keeps track of global information, such was what literals (mistakenly referred to as prepositions) exist across the mud. In general, a literal is a preposition. + + the direct object + This is not the logical direct object of the sentence. Rather, this is the first object at which the verb action is targetted. + + the indirect object + Again, this is not the logical indirect object of the sentence. Rather, it is the second object at which the verb action is targetted. For example, in "give the book to the elf", the elf will be both the logical indirect object and the parser indirect object. But if you allow "give the elf the book", the elf naturally still remains the logical indirect object, but the book is the indirect object to the parser since it is the second object targetted by the verb (the first being the elf). + + Each object involved in he parsing of a sentence, except the subject, is responsible for handling certain driver applies that help the driver in parsing the sentence. The subject, unlike the other objects, is responsible for initiating the command. Although this document treats all of these objects as if they were completely distinct, it is possible to have the same object performing multiple roles for the same command. For example, your subject could also be direct object and verb handler. The next section discusses the objects and the applies they are responsible for in detail. + + The Objects + Before studying each object in detail, it is important to keep in mind that each object which can be involved in any role must call parse_init() before doing anything related to verb parsing. The only exception is the master object. + + The subject + The subject is simply the initiator of a command. A command is typically initiated by a call to parse_sentence() inside the object's process_input() apply. This example shows how a player object might use parse_sentence() to initiate a command. This efun will return 1 if the command successfully matched a known verb and rule and successfully executed it. If it found the verb in question, but it did not match any rule, then 0 is returned. If it found the verb in question and matched a rule, but the execution of the rule failed, it will return an errorstring describing why it failed. Finally, if no verb matched the command, then -1 is returned. + + Take for example a mud with this one rule: + + parse_add_rule("smile", "at LIV") + + The efun parse_sentence() would return the following values for the following command lines: + + smile at descartes + Returns: 1 + smile happily + Returns: 0 + smile at the red box + Returns: "The Box is not a living thing!" + eat the red box + Returns: -1 + + The master object + The master object is responsible for a single apply, parse_command_prepos_list(). This apply returns a list of literal strings which may be used in a rule. A literal string is simply one that appears in the rule exactly as a player types it. In the smile example above, "at" is a literal. In most all cases, literals are prepositions, thus the name of the apply. + + The verb handler + The verb handler object is responsible for setting up the rules for a verb and handling the test and execution of those rules. This example demonstrates a simple verb handler for the smile verb described above. As you can see, each rule is divided up into three parts: + + 1. initialization + 2. testing + 3. execution + + The intialization is the call to parse_add_rule(). This associates a rule with a verb. The first argument is the verb (this verb may have spaces in it, like "look at") and the second argument is one of the rules being handled by this verb handler. This list defines the valid tokens for a rule. + + The testing portion is a "can" apply. In testing a rule, the driver calls the applies can_<verb_rule> to determine if the execution of the verb even makes sense in this situation. The test apply is called when the driver has valid arguments to a rule, but it wants to see if those valid arguments make sense right now. For example, you might check a player here to see if they have enough magic points for casting the spell this verb/rule represents. If not, you might return "You are too tired right now.". If the rule match up in question makes completely no sense at all, like for example, they tried to throw a house for the ("throw", "OBJ") rule, you should return 0. The parser will guess well an error message from the situation. In this case, it will have parse_sentence() return "You cannot throw the thing.". + + Finally execution is where the verb actually happens. You know you have a verb/rule match and you know all the arguments to it are valid. Now it is time to do something. You almost always want to return 1 from this function except in extreme circumstances. + + The direct and indirect objects + As stated above, the directness or indirectness of an object has nothing to do with the linguistic meaning of those terms. Instead it has to do with what position in the token list the object takes. The direct object is the first object in the token list, and the indirect object is the second object in the token list. + + These objects basically answer the question "Can I be the direct/indirect object for this verb and rule?". Like the testing and execution applies for verb handlers, the applies that answer this question may return 1, 0, or an error string. Also like the testing and execution applies for the verb handler, these come in the form of (in)direct_<verb>_<rule>(). This example is from somewhere inside the living object heirarchy. Note the is_living() apply which lets the parser know that the object matches a LIV token. + + Inventory visibility + Some objects are subjects, direct objects, or indirect objects of verbs which require access to things in their inventory. For example, living things, bags, chests, etc. all need to allow other things access to their inventories for some commands. Two applies handle this situation: + + 1. inventory_accessible() + 2. inventory_visible() + + The first returns 1 if verbs can have access to an object's inventory, the second returns 1 if verbs simply can take into account an object's inventory. An example of the difference might be a glass chest. When closed, you want its inventory to be visible, but not accessible. + + It is important to remember that is the return value for any of these special applies, including is_living(), you need to make an explicit call to the parse_refresh() efun. Unless the parse_refresh() efun is called, these special applies are only called once with no guarantee as to when that one call will actually occur. + + Creating a New Verb + Currently, the Lima and Nightmare mudlibs use this parser system. Both mudlibs provide inheritable objects which make it simpler to interface with the MudOS parser system. Nightmare specifically has the inheritable LIB_VERB with methods for defining a new verb. + + This verb example comes from the Nightmare mudlib. The simple Nightmare verb requires the following steps: + + 1. Name the verb + 2. State the verb rules + 3. Name any synonyms + 4. Set an error message for display when the command is wrongly used + 5. Create help text for the command + + Naming the verb is done through the SetVerb() method. You simply specify the name of the verb. + + The rules are passed to the SetRules() method. You may specify as many rules as are needed for the verb. + + Like rules, synonyms are set as a list for the SetSynonyms() method. A synonym is simply any verb which is exactly synonymous with any possible rule for the verb in question. The player is able to access help for the verb and get error messages for the verb through the verb or any of its synonyms. + + The error message is a string displayed to the user when they use the verb in an incorrect manner. For example, if I typed 'eat' when the rule is 'eat OBJ', the error message would be 'Eat what?'. + + Finally, like with any object, the help text can be set through the SetHelp() method. Help is very important for verbs. + + All of these methods only are able to take care of verb initalization. It is up to the verb creator to give meaning to a new verb. This is done first off by writing can_*() and do_*() applies in the verb handler. These methods should be very simplistic in nature. For example, a can method almost always simply returns 1. A do method generally finds its target and triggers some sort of event in that object. The event does the real command handling. + + In addition to can and do applies, you need also to write any direct and indirect applies in approperiate objects. Nightmare centralizes this sort of processing through inheritables geared towards responding to particular verbs. A good example of this is LIB_PRESS which responds to the "press" command. Thus any object which should be pressable needs only to inherit this object to become a pressable object. + + The can, do, direct, and indirect applies all have the same argument set for the same verb/rule pair, but it is important to know when the parser knows certan things. Take for example the verb/rule "press OBJ on OBJ". The parser takes the following actions: + + 1. Call can_press_obj_on_obj() in verb handler + 2. Call direct_press_obj_on_obj() in all accessible and visible objects + 3. Call indirect_press_obj_on_obj() in all accessible and visible objects + 4. Call do_press_obj_on_obj() in the verb handler + + The arguments to all methods called in this process are: + + 1. object direct_object + 2. object indirect_object + 3. string direct_object_as_entered_on_command_line + 4. string indirect_object_as_entered_on_command_line + + But how can can_press_obj_on_obj() know what the direct and indirect objects are if they have not been identified yet? The answer is that it cannot. For the command "push the button on the wall", in a room with me and you in it and we carry nothing, the sequence looks like this (return in parens): + + 1. verb->can_press_obj_on_obj(0, 0, "the button", "the wall"); (1) + 2. me->direct_press_obj_on_obj(0, 0, "the button", the wall"); (0) + 3. you->direct_press_obj_on_obj(0, 0, "the button", "the wall"); (0) + 4. room->direct_press_obj_on_obj(0, 0, "the button", "the wall"); (1) + 5. me->indirect_press_obj_on_obj(room, 0, "the button", "the wall"); (0) + 6. you->indirect_press_obj_on_obj(room, 0, "the button", "the wall"); (0) + 7. room->indirect_press_obj_on_obj(room, 0, "the button", "the wall"); (1) + 8. verb->do_press_obj_on_obj(room, room, "the buton", "the wall"); (1) + + This assumes, of course, that the room responds positively with the id's "button" and "wall". + + People familiar with the parser might say, "Hey, wait, there is a lot more that happens than just that." In fact, there are many more possible permutations of this sequence. The most interesting is the ability to simply ignore the difference between prepositions like "in" and "into" which are often used interchangeably in colloquial speech. For example, if you had "put OBJ in OBJ" and "put OBJ into OBJ" verb/rules, you could handle them in a single place for each of the applies respectively liek this: + + can_put_obj_word_obj() + direct_put_obj_word_obj() + indirect_put_obj_word_obj() + do_put_obj_word_obj() + + If the parser found no can_put_obj_in_obj() defined, it then searches for a more generic handler, can_put_obj_word_obj(). In fact the real order it searches for a can handler is: + + 1. can_put_obj_in_obj() + 2. can_put_obj_word_obj() + 3. can_put_rule() + 4. can_verb_rule() + --------------------- + + Last example: + + static void create() { + parse_init(); + parse_add_rule("smile", "at LIV"); + } + + mixed can_smile_at_liv(object target) { + return 1; + } + + mixed do_smile_at_liv(object target) { + previous_object()->eventPrint("You smile at " + + (string)target->GetName() + "."); + target->eventPrint((string)previous_object()->GetName() + + " smiles at you."); + return 1; + } + diff -c -r --new-file ds1.1/lib/doc/manual/chapter31 ds2.0r27/lib/doc/manual/chapter31 *** ds1.1/lib/doc/manual/chapter31 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter31 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,47 ---- + chapter 31 "Overview of the Quick Creation System" + + First, let me clarify that the QCS is not intended to replace + good coding habits. It is also not designed to handle every possible + need of a builder. The QCS is just a handy tool for making the + most tedious parts of building easier. + + The amount of time it takes to hand-code an area of 100 rooms + (a small area, that is), with all the appropriate descriptions and + monsters and weapons and such is just mind-boggling. As a grown-up, + I just don't have time for building stuff line by excruciating line + in raw LPC, because I also need to work, maintain my house, say hello + to my family on occasion, etc. + + At the same time, I would need a team of dedicated LPC code + fetishists to make a creation system that covers every last possible + thing you could do in LPC. The QCS is somewhere in between those + two extremes. + + Therefore please view the QCS as a quick way to get bulk building + done, and not as a be-all end-all solution. You still need to learn + LPC to do really cool stuff. But to hammer out an area with a quest, + QCS lets you sail through the process of thingmaking with little hassle. + + The design philosophy of the system itself involves object files + stored in /secure/modules. These files are inherited by an object which + you need to carry with you in order to use the QCS system. The code + for these creation modules is fairly messy and inelegant, but the + result is clean, indented code that compiles, so let's keep the + mockery to a minimum, shall we? + + It is important to keep in mind the QCS isn't an editing system. + It's real live on-line modification, meaning that to modify a thing, + it actually has to be in the same room you are in, or it has to be that + room itself. + Once you modify something, it will typically update, so that if + you change the name of an npc, you're going to need to use the new name + to modify it further. + + The next few chapters in this manual are nominally QCS specific, + but in reality this is pretty much my only chance to document some + of the changes in Dead Souls since version 1, so even if you never + intend to use QCS, it's worth poking through these chapters. + + - Cratylus @ Frontiers + 2 January 2006 + diff -c -r --new-file ds1.1/lib/doc/manual/chapter32 ds2.0r27/lib/doc/manual/chapter32 *** ds1.1/lib/doc/manual/chapter32 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter32 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,50 ---- + chapter 32 "QCS: Commands" + + What with muds being text only, QCS has no fancy windowing system. + Using a menu-driven creation system was ruled out quickly due to the + vast complexity of the menus that would be required. Instead, QCS + relies on a few powerful commands. + + create + This is the command that gets the ball rolling. This command + is what lets you bring a new thing into existence. The things you can + create can be seen by typing "help create". Examples are rooms, weapons, + doors, and so on. We will be reviewing each of those in later chapters. + When you issue this command a generic version of the item you + wish to create appears (or, in the case of a room, appears in the + direction you specify). Once that generic copy materializes, you can + change it to suit your needs using the "modify" command. + + modify + I tend to regard this command as the heart and soul of QCS. It's + this tool that lets you make your world your own. Your new generic + things are not useful or fun until you modify them. A "generic weapon" + isn't very interesting, but a "mithrilite poleaxe" might be just the + thing to deal with a pesky dragon. + + add + Creatures, rooms, and containers are capable of storing other + things. Once you make an ogre, you may want to give him a hammer to + wield. After you make that hammer, you use the add command to let + the ogre have that wepon in his permanent inventory. + + delete + On the other hand, you may be tired of that ogre after a while. If + he is a part of the permanent inventory of a room, you can use the + delete command to remove him permanently. Or if you'd rather he have + a Kill-O-Zap Frogstar blaster rather than a hammer, get rid of the + hammer in his inventory with this command. + + copy + This is a room-specific command. Rather than write multiple, + nearly identical rooms for large areas, you can use the copy command to + make the room you are almost exactly like any other room you choose, + except for the exits, which remain the same. Handy for big forests, + cell-blocks, twisty mazes of little passages, etc. + + initfix + If a thing isn't working right, try to initfix it. "init()" is + an object function that many items need in order to work properly. If + you've run into something that is behaving unexpectedly, run initfix on + it. The trouble just might clear up. + diff -c -r --new-file ds1.1/lib/doc/manual/chapter33 ds2.0r27/lib/doc/manual/chapter33 *** ds1.1/lib/doc/manual/chapter33 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter33 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,93 ---- + chapter 33 "QCS: Creation" + + Creation breaks down into three categories. "Things", rooms, and + doors. Let's look at things first: + + Thing creation: + --------------- + In this category we're including NPC's, weapon, armor, unspecial items, + tables, furniture, books and containers. Basically things that actually show + up somewhere. A door is a very special sort of object and does not fall + under this category. + + To make a new thing, the syntax looks like this: + + create THING FILENAME + + The THING is the category of item we are creating. The FILENAME is + the name of the file that will contain this item's configuration data. + You may enter an absolute path, or you may simply enter a filename. If + you enter a filename, QCS will attempt to figure out the best place + for this file. If your current working directory has a name QCS understands + as being compatible with the type of object you are making (for example, + your cwd is /realms/you/npc and you are making an NPC) it will use that. + Otherwise it will search parent and children directories for a + directory name it understands this way. Finally, if it can find no + compatible directories for your file near your cwd, it will put it in + the appropriate directory in your home area (in this case, + /realms/you/area/npc ). + Avoid a relative path. It probably won't work the way you think. + + When the command completes, FILENAME will be a file containing the + data for your generic thing, and a copy of that generic thing will appear + in the room you are in. + If, for example, you entered: + + %^GREEN%^create npc cowboy%^RESET%^ + + The room you are in will contain a generic NPC which *does not* + answer to the id of "cowboy". This NPC is just a generic NPC whose + filename is (probably) /realms/you/npc/cowboy.c and isn't yet a real + cowboy. You'll need to use the "modify" command to make a proper + cowboy out of him. + + + Room creation + ------------- + + Naturally, if you create a room, a new room will not appear inside + your current environment. Instead, the syntax of the "create" command + is different when you want to create a new room. + + You may have noticed that you can't use the "create" command to make + a new room adjacent to your workroom. This is for your protection and + my sanity. Files which contain the directive "SetNoModify(1)" are + immune to QCS manipulation. + Rooms like your workroom, the default start room, the void room, etc, + are set nomodify. This is because if you screw it up, you will be + sorry, and I just don't want to hear it. + So, suppose then that you're in your sample room (one room east + of your workroom) and you want to make a new room. You might issue + the following command: + + %^GREEN%^create room south testroom1%^RESET%^ + + What this does is copy the room you are in (in this case, + /realms/you/area/sample_room.c) to a new location (perhaps + /realms/you/area/testroom1.c). But the neat thing is, this new room + does not have the same exits as the room you are in. The new room + has just one exit, leading back to where you are. + The net effect of all this is that when you issue this command, + you make a new room in the direction you specify, and this + new room looks just like the room you're in, only the exits are such + that you can travel back and forth between the rooms. + + + Door creation + ------------- + + Doors are funny things. In Dead Souls, they aren't objects in the + conventional sense of a thing which occupies a room you're in. Rather, + they are really daemons which attach to adjoining rooms. If that doesn't + make sense to you, don't worry. You're not alone. + + The syntax for door creation is much like that for room creation. + After you create that room south of your sample room, you can now create + a door between them: + + %^GREEN%^create door south sample_door%^RESET%^ + + This brings into existence a generic door (closed by default) which + is between the two rooms. + + diff -c -r --new-file ds1.1/lib/doc/manual/chapter34 ds2.0r27/lib/doc/manual/chapter34 *** ds1.1/lib/doc/manual/chapter34 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter34 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,328 ---- + chapter 34 "QCS: Modification of NPC's" + + In the previous chapter we learned how to make a generic object. + Now that we have it, what to do with it? + + It's important to keep in mind that the generic thing now in + front of you isn't just a clone from a template file. If the command + you used was "create npc cowboy", there is now a file (probably) + called /realms/you/area/npc/cowboy.c that contains the code for the + creature in front of you. + However, this poor beast has the most uninteresting of features. + It is in fact so boring that it responds only to its generic type. + Such that "examine cowboy" or "kill tex" won't work. You'll need to + "look at npc". + + Accordingly, any modification commands need to be made referring + to the new thing with an it responds to, until such a time as you + change the id to suit your tastes. Let's carry on with the example + of our generic npc. To make a cowboy out of him, we can either + change his name, or his id, or both. Let's start with his name: + + %^GREEN%^modify npc name cowboy%^RESET%^ + + This makes the SetKeyName() directive in cowboy.c use "cowboy" + as its argument, effectively allowing you to address this npc as "cowboy" + from now on. Now you can "look at cowboy" with some results. + Obviously our NPC isn't *just* a cowboy. He's also a human, a dude, + and his name is Tex. How do we make him respond to all of these nouns? + + %^GREEN%^modify cowboy id%^RESET%^ + + You'll notice there are no arguments following the word "id". Setting + a thing's id is different from most other settings. If you'll think back + to the LPC datatypes chapter of this manual (you did read the LPC + chapters, didn't you?) you'll remember that some information about + objects is in the form of strings ("cowboy"), some is in the form of + integers (the cowboy's health points, for example) and some is in the + form of arrays, which are a group of data points. In this example we + want the cowboy's id to be an array, because of the many ways we might + want to address him. Therefore, we want the SetId directive in his + file to look like this: + + SetId( ({"human", "dude", "tex" }) ); + + You might think that QCS should be able to accept multiple values + like this on a line, perhaps with "modify cowboy id human dude tex" as + the command. + But what if you want this npc to be a "Boy Named Sue"? How would + you accommodate id's that contain spaces? In designing QCS, I considered + having escape characters to allow for such things, but ultimately + reasoned that this was just way too much mess. Instead, SetId, and + other directives that take arrays as arguments, are handled by entering + a query session. Below is an example of what it might look like. The + example is necessarily messy because I am including both the queries + and the responses. + + --------------------------------------------------- + > %^GREEN%^modify npc name cowboy%^RESET%^ + Indenting file... + "/tmp/indent.1136206130.tmp.dat" 15 lines 420 bytes + Exit from ed. + + > %^GREEN%^modify cowboy id%^RESET%^ + This setting takes multiple values. If you have no more values to enter, then + enter a dot on a blank line. To cancel, enter a single q on a blank line. + You may now enter the next value. So far, it is blank. + If you're done entering values, enter a dot on a blank line. + %^GREEN%^dude%^RESET%^ + You may now enter the next value. So far, we have: ({ "dude" }) + If you're done entering values, enter a dot on a blank line. + %^GREEN%^human%^RESET%^ + You may now enter the next value. So far, we have: ({ "dude", "human" }) + If you're done entering values, enter a dot on a blank line. + %^GREEN%^tex%^RESET%^ + You may now enter the next value. So far, we have: ({ "dude", "human", "tex" }) + If you're done entering values, enter a dot on a blank line. + %^GREEN%^boy named sue%^RESET%^ + You may now enter the next value. So far, we have: ({ "dude", "human", "tex", + "boy named sue" }) + If you're done entering values, enter a dot on a blank line. + %^GREEN%^.%^RESET%^ + Entries complete. Final array is: ({ "dude", "human", "tex", "boy named sue" }) + Indenting file... + "/tmp/indent.1136206156.tmp.dat" 19 lines 459 bytes + Exit from ed. + + /open/1136206138: Ok + /realms/cratylus/area/npc/cowboy: Ok + SetId modification complete. + > %^GREEN%^exa tex%^RESET%^ + Other than being human, this npc is entirely unremarkable. + The male human is in top condition. + --------------------------------------------------- + + If you were now to examine Tex's code (with the command "about tex") + you'd see that his SetId directive now looks like this: + + SetId( ({"dude", "human", "tex", "boy named sue"}) ); + + Other NPC features take arrays also. SetAdjectives is one. You + might enter this (mud output omitted for clarity): + + %^GREEN%^modify tex adjectives%^RESET%^ + %^GREEN%^dusty%^RESET%^ + %^GREEN%^hardy%^RESET%^ + %^GREEN%^.%^RESET%^ + %^GREEN%^look at dusty cowboy%^RESET%^ + + There are two other directives that require queries. Things and + NPC's can be looked at, but they can also be smelled and listened + to, if you add SetSmell and SetListen. The syntax is: + + %^GREEN%^modify tex smell%^RESET%^ + + And you will then be asked a question about keys and mappings. + Understanding mappings is important, but for now you just need to + understand that you are being asked *two* separate questions: + 1) What on the cowboy is being smelled/listened to? + 2) What is the smell/sound? + + What this means is that your input will look something like + this: + + %^GREEN%^modify tex smell%^RESET%^ + %^GREEN%^default%^RESET%^ + %^GREEN%^.%^RESET%^ + Tex smells of sweat and manure. + + What happens is this: + - You enter the modify command. + - You enter the word "default" to indicate this is Tex's general smell. + - You enter a dot to indicate that you are done specifying what + part of Tex is being smelled. + - You then specify the smell. + + This may seem odd until you realize you can also add smells/listens to + parts of things. Not on NPC's, though. We'll look at this more closely in + later chapters. For now, just use the syntax as shown above. For adding + a listen to the cowboy, it works the same way: + + %^GREEN%^modify tex listen%^RESET%^ + %^GREEN%^default%^RESET%^ + %^GREEN%^.%^RESET%^ + Tex seems to be humming a jaunty melody. + + Other features of an NPC do not take arrays, so one-line commands + will do. For example: + + %^GREEN%^modify cowboy long This is a cowboy who calls himself Tex, but is in fact a Boy Named Sue.%^RESET%^ + + %^GREEN%^modify cowboy short a cowboy%^RESET%^ + + %^GREEN%^modify cowboy level 5%^RESET%^ + + %^GREEN%^modify cowboy class fighter%^RESET%^ + + %^GREEN%^modify tex currency gold 1%^RESET%^ + + %^GREEN%^modify tex currency silver 12%^RESET%^ + + %^GREEN%^modify tex skill bargaining 5%^RESET%^ + + %^GREEN%^modify tex skill projectile attack 7%^RESET%^ + + %^GREEN%^modify tex stat strength 33%^RESET%^ + + %^GREEN%^modify tex property nice guy 1%^RESET%^ + + %^GREEN%^modify tex healthpoints 150%^RESET%^ + + %^GREEN%^modify tex maxhealthpoints 170%^RESET%^ + + %^GREEN%^modify tex melee 0%^RESET%^ + + %^GREEN%^modify tex unique 1%^RESET%^ + + If you now issue the "about tex" command you will see that all + the changes you made have been put into the file. + + You may have noticed the "melee" keyword. Dead Souls 2 NPC's come + in various shapes and sizes, and some of them shouldn't wield weapons. A + wolf with a battle axe would be a strange sight indeed. However, the + default combat system makes unarmed creatures extremely vulnerable in + combat. + To make an NPC combat-capable without weapons, use the new SetMelee + directive. SetMelee(1) makes the NPC capable of proper unarmed combat. + SetMelee(0) makes the NPC a weak opponent if unarmed. + NPC's will generally try to bite during unarmed combat. If this + is beneath the capability or dignity of your NPC, you can prevent + this with: + + %^GREEN%^modify tex canbite 0%^RESET%^ + + If your NPC should try to escape when the battle isn't going + his way, the wimpy settings should do: + + %^GREEN%^modify tex wimpy 30%^RESET%^ + + %^GREEN%^modify tex wimpycommand climb ladder%^RESET%^ + + If you don't specify a wimpy command, Tex will leave the + room through a random exit. In this case, when Tex's health + is down to 30% and he is in combat, he will try to climb a ladder. + + Some NPC's are designed to travel about. To enable this + feature, use the wanderspeed directive: + + %^GREEN%^modify tex wanderspeed 5%^RESET%^ + + If you want him to travel more quickly, use a + lower number. By default, wandering NPC's only wander in rooms + that have already been loaded into memory. They avoid loading + rooms because loading a bunch of rooms that only the NPC + will ever see is a waste of your mud's resources. + However, if you *do* want your NPC to wander in an + unrestricted manner, regardless of whether a room is loaded, + use the permitload directive: + + %^GREEN%^modify tex permitload 1%^RESET%^ + + By default, NPC's stand up when they can. This is + so that if they collapse during combat, they try to + get back up once they are able to do so. + If you prefer that your NPC maintain some other + posture, you can set that posture, then disable + autostanding like this: + + %^GREEN%^modify tex posture lying%^RESET%^ + + %^GREEN%^modify tex autostand 0%^RESET%^ + + If he's especially lazy, you can have him take + a nap this way: + + %^GREEN%^modify tex sleeping 10%^RESET%^ + + Which will have him wake up after about a minute. + However, note that if you've disabled autostanding, + he will remain lying down after he wakes up. + + If the NPC should be hostile, that is, he should + attack any creatures that it sees enter a room, + SetEncounter should do it: + + %^GREEN%^modify tex encounter 100%^RESET%^ + + This means that if the creature it sees has a + charisma score of less than 100 (which should pretty + much be always true), Tex will try to kill it. You + can do some fancy stuff with SetEncounter, such + as only attacking orcs, or actually doing something + friendly, but to do so you can't use QCS. Read + the NPC and Sentients chapter in the Creator's + Manual for details on how to code such stuff. + + If the NPC is a golem or other such non-biological + creature, it may be useful to specify what they are + made of. The SetComposition setting for a clay + golem might look like this: + + %^GREEN%^modify golem composition clay%^RESET%^ + + If it happens to be a golem that does not believe + in violence as a solution to problems, you can + make refuse to hurt others with the following: + + %^GREEN%^modify golem pacifist 1%^RESET%^ + + + Vendors: + ------- + + Vendors are a special kind of NPC that can sell stuff. + Along with the standard NPC settings, vendors have + the following: + + SetStorageRoom specifies where the vendor's stock + is stored. If a valid room is specified, anything + in that room can be sold by the vendor. + + SetLocalCurrency specifies the type of currency, + such as gold or silver, that the vendor accepts. + + SetMaxItems is the maximum number of items in + the storeroom that the vendor is permitted to sell. + + SetVendorType specifies the kind of stuff the vendor can + trade in. "all" allows him to buy and sell whatever. + But if he is a weapon vendor, he can't trade in armor, + etc. See /include/vendor_types.h for the available + vendor types. To have a "multi-type" vendor, you'll have to + code it by hand. The result of that looks something + like this: + + SetVendorType( VT_TREASURE | VT_ARMOR | VT_HERBS ); + + + Barkeeps: + -------- + + Like vendors, barkeeps sell stuff, but they are + limited to selling food and drink. + + Unlike vendors, barkeeps have no limitation on + the amount of stuff they can sell. They also do + not have a storeroom. The stuff they can sell is + specified in their SetMenu directive, like this: + + %^GREEN%^clone woody%^RESET%^ + You clone a generic barkeep (/realms/temujin/area/npc/woody.c). + %^GREEN%^modify woody menu%^RESET%^ + If you don't understand these questions, type the letter q on a blank line and hit enter. + + Please enter the first key element for this mapping: + + %^GREEN%^bourbon%^RESET%^ + Please enter the next key element, or enter a single dot to finish entering key elements. + %^GREEN%^whiskey%^RESET%^ + Please enter the next key element, or enter a single dot to finish entering key elements. + %^GREEN%^.%^RESET%^ + Please enter the value for key ({ "bourbon", "whiskey" }): + + %^GREEN%^/domains/town/meals/bourbon%^RESET%^ + + Barkeeps also have the SetLocalCurrency directive + to specify the currency they accept. + + diff -c -r --new-file ds1.1/lib/doc/manual/chapter35 ds2.0r27/lib/doc/manual/chapter35 *** ds1.1/lib/doc/manual/chapter35 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter35 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,224 ---- + chapter 35 "QCS: Modifying rooms" + + Suppose you are in your sample room and you issued the + command: + + %^GREEN%^create room south testroom1%^RESET%^ + + You then travel south and see that you are in a room that is + almost exactly like the sample room except for the exits. Well, + probably you don't want to have a mud with nothing but identical + rooms, so let's modify it: + + %^GREEN%^modify here short Test Room One%^RESET%^ + + %^GREEN%^modify here long This is the first test room. The walls are rather blank.%^RESET%^ + + %^GREEN%^modify here climate indoors%^RESET%^ + + %^GREEN%^modify here light 30%^RESET%^ + + + Ok, so far so good. Standard interior. However, a good mud has + rooms with details. Let's add some detail to this room. + I've omitted the system output for clarity. This is just what you + would input. + + + %^GREEN%^modify here item%^RESET%^ + + %^GREEN%^wall%^RESET%^ + + %^GREEN%^walls%^RESET%^ + + %^GREEN%^blank wall%^RESET%^ + + %^GREEN%^blank walls%^RESET%^ + + %^GREEN%^.%^RESET%^ + + %^GREEN%^These are just blank walls.%^RESET%^ + + + Let's review what we've done here: + 1) You issued the modify command specifying your current room as the + target, and the SetItems directive as the argument. + 2) You entered a query session, and were asked to enter each element + of the item's key. + 3) You entered a single dot to indicate you were done entering + key elements. + 4) You entered the value for the key, which is the description of the + item. + + The result of all this is that now you can issue these commands: + + %^GREEN%^exa wall%^RESET%^ + %^GREEN%^look at blank walls%^RESET%^ + %^GREEN%^examine walls%^RESET%^ + + And the output will be: + + These are just blank walls. + + Let's add a floor while we're at it: + + %^GREEN%^modify here item%^RESET%^ + + %^GREEN%^floor%^RESET%^ + + %^GREEN%^.%^RESET%^ + + %^GREEN%^A floor like any other.%^RESET%^ + + In this case, you didn't feel like adding extra synonyms for "floor", + so you entered the final dot rather than entering another key element. + Then you added the description, and now if you "exa floor", you'll get + that description. + "about here" will display to you the file you have modified. + + Well, that's enough fun with indoor rooms. There's not much more + to them. Let's go outdoors now: + + %^GREEN%^create room south exterior_room%^RESET%^ + + %^GREEN%^create door south test_door%^RESET%^ + + %^GREEN%^open door%^RESET%^ + + %^GREEN%^go south%^RESET%^ + + %^GREEN%^modify here short a small lawn%^RESET%^ + + %^GREEN%^modify here daylong A small, well groomed lawn on a lovely sunny day. There is a small building north of here.%^RESET%^ + + %^GREEN%^modify here nightlong This is a small lawn. Stars twinkle in the night sky above, and some light is coming from a small building to the north.%^RESET%^ + + %^GREEN%^modify here daylight 30%^RESET%^ + + %^GREEN%^modify here nightlight 20%^RESET%^ + + %^GREEN%^modify here light delete%^RESET%^ + + %^GREEN%^modify here long delete%^RESET%^ + + %^GREEN%^modify here items delete%^RESET%^ + + %^GREEN%^modify here items%^RESET%^ + + %^GREEN%^building%^RESET%^ + + %^GREEN%^small building%^RESET%^ + + %^GREEN%^.%^RESET%^ + + %^GREEN%^A small building, rather ramshackle as if hastily put together.%^RESET%^ + + %^GREEN%^modify here climate temperate%^RESET%^ + + Ok! A few new things here. A neat thing about outdoor rooms is that + typically they are subject to the time of day. A SetClimate directive + that indicates an exterior environment causes the room to receive + messages about the sun setting, rising, etc. + The SetDayLong and SetNightLong directives allow you to more + sensibly describe the area depending on the time of day. To avoid + confusion, I deleted the SetLong directive. It is not mandatory to + have different day and night descriptions, but players appreciate the + effort. + It is also possible to have differing ambient light levels depending + on the time of day, so we've added SetDayLight and SetNightLight, and + we deleted the SetAmbientLight directive. + + Let's continue to add detail: + + %^GREEN%^modify here item%^RESET%^ + + %^GREEN%^lawn%^RESET%^ + + %^GREEN%^grass%^RESET%^ + + %^GREEN%^.%^RESET%^ + + %^GREEN%^Healthy, well groomed and freshly cut grass.%^RESET%^ + + %^GREEN%^modify here smell%^RESET%^ + + %^GREEN%^default%^RESET%^ + + %^GREEN%^.%^RESET%^ + + %^GREEN%^You can smell the refreshing scent of freshly cut grass.%^RESET%^ + + %^GREEN%^modify here smell%^RESET%^ + + %^GREEN%^lawn%^RESET%^ + + %^GREEN%^grass%^RESET%^ + + %^GREEN%^.%^RESET%^ + + %^GREEN%^Yep, it's got that new lawn smell.%^RESET%^ + + %^GREEN%^modify here listen%^RESET%^ + + %^GREEN%^building%^RESET%^ + + %^GREEN%^.%^RESET%^ + + %^GREEN%^Sounds like someone's fumbling about in there, making a mess. New creators can be so noisy.%^RESET%^ + + %^GREEN%^modify here item%^RESET%^ + + %^GREEN%^garden%^RESET%^ + + %^GREEN%^.%^RESET%^ + + %^GREEN%^You may enter the garden from here.%^RESET%^ + + %^GREEN%^create room garden garden_room%^RESET%^ + + + + You now have a room with lots of charm and detail. You can "smell grass" + and "listen to small building", if you like. Neat, huh? But there's something + very important to keep in mind: + + Enters, listens and smells don't work properly if there is no item defined + for that smell. For example, if you want to be able to listen to the sea, + you must "modify here item" and add a "sea" item. Otherwise, "listen + to the sea" will respond with "There is no sea here." + The only exception to this rule is the "default" smell. + + Enters behave similarly. If you want to be able to "enter" something, + you'll need to create the corresponding item first, as in the example above. + + You can use the SetProperties directive to make the room + conform to some presets, like: + + %^GREEN%^modify here property no attack 1%^RESET%^ + + Read chapter 23 in the Creator's Manual for details on room properties. + + Also, please note that indoor rooms can also have differing + descriptions and light levels for night and day. It's just that + indoor rooms don't get notification of daytime changes. + + Finally, the SetTown directive allows the room to participate in + area-wide events, and is useful for security purposes as well: + + %^GREEN%^modify here town MyTown%^RESET%^ + + + Notes on room filenames: + ----------------------- + By default, a filename without a leading path creates a room + in your area room directory, which in my case would be + "/realms/cratylus/area/room". However, you can specify a different + location for the new room. + + To create a room in your current working directory: + %^GREEN%^create room east ./newroom%^RESET%^ + + To create a room in a specific directory: + %^GREEN%^create room east /realms/cratylus/testrooms/newroom%^RESET%^ + + diff -c -r --new-file ds1.1/lib/doc/manual/chapter36 ds2.0r27/lib/doc/manual/chapter36 *** ds1.1/lib/doc/manual/chapter36 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter36 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,67 ---- + chapter 36 "QCS: Modifying weapons" + + Remember that the QCS chapters are supposed to be read in + sequence. This is important because as we progress, I will not make + explanations about directives and concepts explained previously. + + Weapons are different from rooms and NPC's in that they can + be handled, sold, thrown, etc. They are manipulable objects. As such, + we will see new directives: + + %^GREEN%^create weapon hammer%^RESET%^ + + You may be familiar with this example from the example webpage. + Let's go ahead and plow through the commands: + + %^GREEN%^modify weapon id hammer%^RESET%^ + + %^GREEN%^warhammer%^RESET%^ + + %^GREEN%^.%^RESET%^ + + %^GREEN%^modify hammer name hammer%^RESET%^ + + %^GREEN%^modify hammer damagetype blunt%^RESET%^ + + %^GREEN%^modify hammer weapontype blunt%^RESET%^ + + %^GREEN%^modify hammer mass 700%^RESET%^ + + %^GREEN%^modify hammer hands 2%^RESET%^ + + %^GREEN%^modify hammer short a heavy war hammer%^RESET%^ + + %^GREEN%^modify hammer long This is an extremely large and heavy hammer designed to be wielded in both hands and used to hurt people very badly indeed.%^RESET%^ + + %^GREEN%^modify hammer adj%^RESET%^ + + %^GREEN%^large%^RESET%^ + + %^GREEN%^heavy%^RESET%^ + + %^GREEN%^war%^RESET%^ + + %^GREEN%^.%^RESET%^ + + %^GREEN%^modify hammer basecost silver 750%^RESET%^ + + %^GREEN%^about hammer%^RESET%^ + + + Like a room and unlike an NPC, you can also modify the SetItems on + manipulable objects like weapons, so you could do something like this: + + %^GREEN%^modify hammer item%^RESET%^ + + %^GREEN%^shaft%^RESET%^ + + %^GREEN%^handle%^RESET%^ + + %^GREEN%^.%^RESET%^ + + %^GREEN%^A thick, reinforced steel shaft with leather bands for a strong grip.%^RESET%^ + + %^GREEN%^exa shaft on hammer%^RESET%^ + + + diff -c -r --new-file ds1.1/lib/doc/manual/chapter37 ds2.0r27/lib/doc/manual/chapter37 *** ds1.1/lib/doc/manual/chapter37 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter37 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,130 ---- + chapter 37 "QCS: Modifying things and stuff" + + You should have a firm grasp now on how QCS works + in relation to manipulable objects. Let's look at the + settings for a few special kinds of items: + + chairs + ------ + + %^GREEN%^modify stool maxsitters 1%^RESET%^ + + %^GREEN%^modify stool setmaxcarry 200%^RESET%^ + + + beds + ---- + + %^GREEN%^modify sofa maxsitters 2%^RESET%^ + + %^GREEN%^modify sofa maxliers 1%^RESET%^ + + %^GREEN%^modify sofa maxcarry 400%^RESET%^ + + + containers + ---------- + + %^GREEN%^modify box canclose 1%^RESET%^ + + %^GREEN%^modify box closed 1%^RESET%^ + + %^GREEN%^modify box locked 1%^RESET%^ + + %^GREEN%^modify box key magic_skeleton_key%^RESET%^ + + %^GREEN%^modify box maxcarry 200%^RESET%^ + + %^GREEN%^modify box setmoney gold 15%^RESET%^ + + + tables + ------ + + %^GREEN%^modify altar maxcarry 300%^RESET%^ + + %^GREEN%^modify altar maxliers 1%^RESET%^ + + + meals/drinks + ------------ + + %^GREEN%^modify burger mealtype food%^RESET%^ + + %^GREEN%^modify schlitz mealtype alcohol%^RESET%^ + + %^GREEN%^modify apple mealstrength 10%^RESET%^ + + + books + ----- + + %^GREEN%^modify journal title The Orc Within%^RESET%^ + + %^GREEN%^modify journal source /domains/Orcland/etc/books/journal%^RESET%^ + + + Readable things: + ---------------- + + If you want to be able to "read thing", for example, "read sign": + + %^GREEN%^modify sign defaultread This is a message written on the sign.%^RESET%^ + + If you want to make a thing on a thing readable, as in + "read inscription on ring": + + %^GREEN%^modify ring item%^RESET%^ + + %^GREEN%^inscription%^RESET%^ + + %^GREEN%^.%^RESET%^ + + %^GREEN%^This is an inscription on the ring. Try 'read inscription on ring'%^RESET%^ + + %^GREEN%^modify ring read%^RESET%^ + + %^GREEN%^inscription%^RESET%^ + + %^GREEN%^.%^RESET%^ + + %^GREEN%^So! We, the spear-Danes%^RESET%^ + + By default, readabale items are readable by anyone, regardless + of the languages they know. If, however, your item should + only be readable by someone who understands the elvish tongue: + + %^GREEN%^modify ring language edhellen%^RESET%^ + + + Miscellaneous: + -------------- + + To make a key have a 50% chance of breaking when it's used: + + %^GREEN%^modify golden key disablechance 50%^RESET%^ + + + To make a room or object immune to resets: + + %^GREEN%^modify sentry noclean 1%^RESET%^ + + + To make sure there is only one instance of an object or + NPC loaded at any given time: + + %^GREEN%^modify tiamat unique 1%^RESET%^ + + + To make a thing or room immune to the QCS (except for this + command): + + %^GREEN%^modify workroom nomodify 1%^RESET%^ + + + To specify what kind of vendor should be allowed to traffic + in this item: + + %^GREEN%^modify necklace vendortype treasure%^RESET%^ + + diff -c -r --new-file ds1.1/lib/doc/manual/chapter38 ds2.0r27/lib/doc/manual/chapter38 *** ds1.1/lib/doc/manual/chapter38 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter38 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,70 ---- + chapter 38 "QCS: Adding and deleting" + + Rooms, containers and NPC's all are capable of holding + items, and often it is convenient to have them already holding certain + items upon creation. + The SetInventory directive in an object's file provides us with + a list of that object's "permanent inventory". To modify an object's + inventory, we use the add and delete commands. + + Let's say that we want our cowboy to be wielding a + hammer when he appears... + + %^GREEN%^clone cowboy%^RESET%^ + + %^GREEN%^cd ../weap%^RESET%^ + + %^GREEN%^clone hammer%^RESET%^ + + %^GREEN%^add hammer to cowboy%^RESET%^ + + %^GREEN%^wield hammer%^RESET%^ + + Believe it or not, it's that simple. The add command will ask + you a question after you issue it. What it wants to know is if you + want the NPC to do anything special when the hammer appears on him. + In this case, yes, we wanted him to wield it. + However, if you want to add something to an NPC and don't + have anything interesting for him to do with it, respond to the + question with the number of items that you want to appear. For + example, if I want the cowboy to be carrying a key: + + %^GREEN%^cd ../obj%^RESET%^ + + %^GREEN%^clone key%^RESET%^ + + %^GREEN%^add key to cowboy%^RESET%^ + + %^GREEN%^1%^RESET%^ + + And that's it. Now if I want the cowboy to be a permanent + resident of this room: + + %^GREEN%^add cowboy%^RESET%^ + + %^GREEN%^1%^RESET%^ + + The add command understands that if you don't specify a + target argument, you must mean the room. You can also be specific: + + %^GREEN%^add cowboy to room%^RESET%^ + + %^GREEN%^1%^RESET%^ + + The delete command works the opposite way. It removes items from + an object's permanent inventory: + + %^GREEN%^delete hammer from cowboy%^RESET%^ + + %^GREEN%^delete cowboy%^RESET%^ + + The delete command is also the way to get rid of rooms. You won't + be removing the file from disk, you'll just be deleting that exit + from the room: + + %^GREEN%^delete exit garden%^RESET%^ + + NOTE: When you delete an exit, only the connection from your room to + the other room is removed. The connection from the other room to + your room remains. This is not a bug, it's a feature. There are plenty + of circumstances where one-way travel is desirable. diff -c -r --new-file ds1.1/lib/doc/manual/chapter39 ds2.0r27/lib/doc/manual/chapter39 *** ds1.1/lib/doc/manual/chapter39 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter39 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,90 ---- + chapter 39 "QCS: Final notes" + + * Remember that QCS commands work on objects, not files. To + load a file into memory, use the update command. To reload an + already existing object, like a cloned orc or a book, use + the reload command. To use modify, delete, and add, you have + to specify a cloned object that is on you or in your environment. + + I think you're getting the idea of how this works. Here's + an example of armor creation: + + %^GREEN%^create armor jeans%^RESET%^ + + %^GREEN%^modify jeans id%^RESET%^ + + %^GREEN%^pants%^RESET%^ + + %^GREEN%^trousers%^RESET%^ + + %^GREEN%^.%^RESET%^ + + %^GREEN%^modify jeans short a pair of denim jeans%^RESET%^ + + %^GREEN%^modify jeans long Worn jeans, frayed and stained.%^RESET%^ + + %^GREEN%^modify jeans adj%^RESET%^ + + %^GREEN%^pair of%^RESET%^ + + %^GREEN%^denim%^RESET%^ + + %^GREEN%^frayed%^RESET%^ + + %^GREEN%^worn%^RESET%^ + + %^GREEN%^stained%^RESET%^ + + %^GREEN%^.%^RESET%^ + + + To know what directives QCS can change on an object, type: + + %^GREEN%^help modify%^RESET%^ + + This provides a list of modifiable things and the directives + that can be modified on them. + + Ultimately the Quick Creation System generates LPC code, so + you'll want to review the earlier chapters of this handbook to + get a base of understanding of the code that comprises your new + creations. + + Some notes and tips: + + * The SetNoCondition directive makes it so an item does not report + its physical status when examined. Weapons and armor wear down in + combat, and most objects let you know their condition when you + examine them. However, in some cases (a sandwich for example) + this is inappropriate, so the SetNoCondition directive may be + useful. + + * Doors aren't like normal objects. They have to be modified *twice*. + Once for each side of the door. If this sounds unnecessarily + tedious, remember that a door leading south is also a door + leading north from the other room. + + * Doors generally are not visible in the same way that regular + objects are. To make a door especially obvious and noticeable, + do something like: + %^GREEN%^modify door sethiddendoor 0%^RESET%^ + + * SetCurrency is for adding money to NPC's. SetMoney is for adding + money to non-living containers (bags, etc). + + * Item subtypes are listed in /include. To know what kinds of vendors + are available, for example, look in /include/vendor_types.h + + * Books need a "source directory", which must contain one file per + chapter. The SetSource for this manual, for example, is /doc/manual + The first line of each file must follow the same format as + the files you see in /doc/manual + + * SetObviousExits is usually no longer needed: rooms report + obvious exits automatically. However, if you don't want an exit + to show up by default, use the SetObviousExits directive + to specify only those that you want seen. This will override the + room's default exit display. + + + diff -c -r --new-file ds1.1/lib/doc/manual/chapter40 ds2.0r27/lib/doc/manual/chapter40 *** ds1.1/lib/doc/manual/chapter40 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/manual/chapter40 Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,152 ---- + chapter 40 "Useful Creator Commands" + + Moving around: + ------------- + + * To go to your workroom: + %^GREEN%^home%^RESET%^ + + * To go to someone else's workroom, "home <person>", for example: + %^GREEN%^home cratylus%^RESET%^ + + * To go to the town pub: + %^GREEN%^goto /domains/town/room/tavern%^RESET%^ + + * Or: + %^GREEN%^cd /domains/town/room%^RESET%^ + %^GREEN%^goto tavern%^RESET%^ + + * To return to where you were before you went somewhere else: + %^GREEN%^return%^RESET%^ + + * To bring someone to you, "trans <person>". For example: + %^GREEN%^trans cratylus%^RESET%^ + + * To send them back when you're done with them: + %^GREEN%^return cratylus%^RESET%^ + + + Dealing with living beings: + --------------------------- + + * To force everyone in a room to stop fighting: + %^GREEN%^quell%^RESET%^ + + * To let them resume combat: + %^GREEN%^unquell%^RESET%^ + + * To insta-kill a living being, "zap <thing>". For example: + %^GREEN%^zap orc%^RESET%^ + + * To bring to life a player who somehow left the death + room without regenerating, "resurrect <person>", For example: + %^GREEN%^resurrect cratylus%^RESET%^ + + * To make a living being do something you want, "force <thing> + <command>". For example: + %^GREEN%^force thief drop towel%^RESET%^ + %^GREEN%^force thief go west%^RESET%^ + + * For complex management of a living being's vital statistics, + skills, health, score, and satiety levels, use the medical + tricorder in the chest in your workroom. + + * For a detailed report of a living being's physical status: + %^GREEN%^stat orc%^RESET%^ + %^GREEN%^stat cratylus%^RESET%^ + + + Handling objects in general: + --------------------------- + + * To destroy an object, "dest <thing>". Note that the object's + inventory will probably move to the room it was occupying. + For example, if you: + + %^GREEN%^dest fighter%^RESET%^ + + You may find that the room now contains a sword, shield, and + chainmail shirt, but no fighter. + + * To reset an object to its original state, "reload <thing>". Note + that this also makes the object incorporate any changes you + made to its file. For example: + %^GREEN%^reload fighter%^RESET%^ + %^GREEN%^reload here%^RESET%^ + + * To load a file into memory, "update file". This is used when you + have edited an object's file, and want the mud to use the new + stuff you created. For example, if you edited the fighter's file + and wanted to know if it will load properly into memory, you'd + type: + %^GREEN%^update /realms/you/area/npc/fighter.c%^RESET%^ + + Or: + %^GREEN%^cd /realms/you/area/npc/%^RESET%^ + %^GREEN%^update fighter%^RESET%^ + + If you do not specify an object to update, the mud assumes you + want to update the room you are in. If there is a problem with the + room's code, and it does not load, you will be dropped into the + "void". + If the room's code is ok and it updates, anything in the room + that isn't part of its permanent inventory (except for players) will + disappear from the room. + + * To make a copy of an object appear, "clone <file>". For example: + %^GREEN%^clone /realms/you/area/npc/fighter%^RESET%^ + + Or: + %^GREEN%^cd /realms/you/area/npc/%^RESET%^ + %^GREEN%^clone fighter%^RESET%^ + + * To know the precise contents of an object, use scan: + %^GREEN%^scan fighter%^RESET%^ + %^GREEN%^scan here%^RESET%^ + + If you want to know not only what the fighter has, but + also what any containers he is carrying have, use the "-d" flag: + %^GREEN%^scan -d fighter%^RESET%^ + %^GREEN%^scan -d here%^RESET%^ + + Debugging commands: + -------------------- + + * elog: This will report back to you the last few lines of + your error log. Usually this is very helpful in nailing down + which lines of a file contain errors. If you are admin, you + may be working on files other than your home dir. If those + files fail to update, you can supply elog with a directory name + to specify where to look for an error report: + %^GREEN%^elog secure%^RESET%^ + %^GREEN%^elog cmds%^RESET%^ + %^GREEN%^elog lib%^RESET%^ + + * dbxwhere: provides a list of the chain of messages caught + in your last runtime error. + + * dbxframe <number>: Using the list number from dbxwhere, + dbxframe can pinpoint exactly where in that link the error + came from. + + %^GREEN%^tail /log/runtime%^RESET%^ + %^GREEN%^tail /log/catch%^RESET%^ + %^GREEN%^tail /log/player_errors%^RESET%^ + + + miscellaneous useful commands: + ----------------------------- + + * %^GREEN%^people%^RESET%^: reports who is logged on, what site they logged + in from, and what room they are in. + + * %^GREEN%^mudtime%^RESET%^: reports the time of day in the mud (nothing to + do with the time of day anywhere in the real world). + + * %^GREEN%^bk <thing or file>%^RESET%^: makes a unique copy of that thing + or file and puts it in /realms/you/bak + + *%^GREEN%^ restore <filename>%^RESET%^: copies the last backup of the + filename from your bak/ directory into where it used + to be. + diff -c -r --new-file ds1.1/lib/doc/misc/ed.txt ds2.0r27/lib/doc/misc/ed.txt *** ds1.1/lib/doc/misc/ed.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/misc/ed.txt Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,44 ---- + + + The ed editor + + + There's two modes in the editor: the input + mode and the command mode. While in the input + mode, what you type is added to the file + you're editing. While in command mode, you + can view or make modifications to the file. + + To edit a new file called joe.c you would + type "ed joe.c", which puts you right into + input mode. You'd then write whatever code + you want. When finished, on a blank line you + would enter a single period, then hit enter. + This exits from input mode and puts you in + command mode. + + When in command mode, you can modify the + file (like deleting lines, for example), + exit without saving your code, or exit and + save the code. To delete line 1, you'd hit + "1d" while in command mode. + To add a line after line 5, you'd hit + "5a", which would put you in input mode + right after line 5. To replace line 5 you'd + "5c" while in command mode. + + For a full list of commands available in + command mode, hit "h" and enter while in the + editor command mode. + + To exit the editor and save the file + as modified, issue the "x" command at + the editor. To exit without saving, + use "Q". + + For your new object to be loaded into memory, + you must update it after you've edited it. + "update joe.c" will load the changes into memory. + + Don't forget to post questions on the + Creator Bulletin Board if you're confused! diff -c -r --new-file ds1.1/lib/doc/old/CHANGES ds2.0r27/lib/doc/old/CHANGES *** ds1.1/lib/doc/old/CHANGES Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/old/CHANGES Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,30 ---- + ---- Version 1.1pre released ---- + 7 added Dvarsks improved Virtual Libs. Who knows we may provide + examples in the next revision. + 6 added ftpd support within the mud. This is courtesy of Dvarsk and + Lima. You must read and comply to the Lima USAGE document. + After you read that document you can start the ftpd using + something like + call /secure/daemon/inet->AddService("ftp", PORT_FTP, + "/secure/lib/net/ftp.c", DATAGRAM) if my feable memory is working. + 5 added /lib/std/story.c (read the lib to find out how to use it) + 4 lib/comp/container GetRadientLight() to GetRadientLight(ambient) + 3 mkdir 0-9 in $MUDHOME/lib/secure/save/postal + 2 in /lib/living.c remove arguments to direct_smell_obj() line 128 + 129 + 1 in /secure/daemon/master.c edit the lines 194-204 to be: + if( (tmp = base_name(ob)) == LIB_PLAYER || tmp == LIB_CREATOR) { + if( !PlayerName ) i = sizeof(stack = ({ob})+previous_object(-1)); + else if( file == DIR_PLAYERS+"/"+PlayerName[0..0]+"/"+ + PlayerName + __SAVE_EXTENSION__ ) + return 1; + else if( file == DIR_CRES+"/"+PlayerName[0..0]+"/"+ + PlayerName + __SAVE_EXTENSION__ ) + return 1; + else i = sizeof(stack = ({ ob })); + } + else if( tmp + __SAVE_EXTENSION__ == file ) return 1; + + ---- Version 1.0 released ---- + This was the orriginal + unversioned version. diff -c -r --new-file ds1.1/lib/doc/old/README ds2.0r27/lib/doc/old/README *** ds1.1/lib/doc/old/README Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/old/README Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,22 ---- + The Dead Souls Mud Library + Released 1 February 1998 + + The Dead Souls Mud Library is a special compilation of files from the + old Nightmare Mudlib that have been released into the public domain. + This code is provided as-is without any offering of support or + guarantees of suitability for any specific use. The existence of this + code in the public domain pertains only to the code in this + distribution. It does not imply or suggest permission to use other + code by the authors of this work or related works by other authors. + + This code is known to work with MudOS v22b25. You should download and + install whatever version of MudOS you desire. Be warned, however, + that newer versions may or may not work with this release. You may + have to modify the code in this distribution to get things to work. + Do not, under any circumstances, email the author of this distribution + for support. Your email will be deleted unread. If you have + questions, subscribe to the nightmare-mudlib mailing list by visiting + http://list.imaginary.com/mailman/listinfo/nightmare-mudlib. + + George Reese + 1 February 1997 diff -c -r --new-file ds1.1/lib/doc/old/RELEASE_NOTES.old ds2.0r27/lib/doc/old/RELEASE_NOTES.old *** ds1.1/lib/doc/old/RELEASE_NOTES.old Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/old/RELEASE_NOTES.old Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,135 ---- + ---- 2.0 --- + - It is done. + + ---- 1.9r21 --- + - Typo fixes, cosmetic changes. + + ---- 1.9r19 --- + - Creation system fixes and overhaul: you now need to be holding the + creator staff to use the Quick Creation System. + - Some QCS docs added. + - Added commands reload, wake, resurrect. + - Added sefuns reload, add_maps, alphap. + + ---- 1.9r18 --- + - Creation system bugfixes. + - Connection bugfixes. + - Template bugfix. + + ---- 1.9r12 --- + - The roommaker is now obsolete, but is not being removed, as + a convenience to those who've gotten used to it. Instead of + the roommaker, use the create command, then the modify command + to adjust the new room to your preferences. + - The thingmaker is now obsolete and has been removed. On-line + object making and editing is done using the new commands: create, + modify, delete. + - admintool now edits groups. Use it in order to ensure you don't + munge the groups.cfg formatting. + - Users in the TEST group are now allowed to log in when the mud is + locked. + - ~/.profile will now be processed when creators log in, and commands + included in it will be automatically executed. + - Added answering machine (for intercepting inconvenient tells). + - Fixed the sample virtual desert. + - Removed the prior intermud restrictions. Rather than requiring + name changes to get onto i3, creators have to add intermud + channels to themselves before talking on them. To do this: + call me->AddChannel("intergossip") + call me->AddChannel("intercre") + + ---- Version 1.9r5 --- + + - Fixes and tweaks to town/ domain. + - Updated commands: stat, who, afk. + - Tweaks to body.c and player.c. + + ---- Version 1.9r2 --- + + - Added some default SetRestrictLimbs() in armor init() so + that wearing items over the same body parts doesn't + create a crisis. + - Fixed GetNetWorth(). + - Minor tweaks to /lib objects. + - Minor tweaks to town domain. + - Added meditate spell. + + + ---- Version 1.9 --- + + - Fixed shoot verb. + - Tweaked body to include messages of drunkenness or sleep. + - Fixed sleeping. + - Fixed economy, including vendors, tellers, and barkeeps. + - Removed daemons: combat, underworld, war. + - Added about command. + - Added string replacer. + - Modified give and drop for newbies to discourage cheating. + + ---- Version 1.8r1 --- + + - Added souls (smile, wink, etc). + + ---- Version 1.8 --- + + - Fixed lib obs: put, look_in, get_from + to work with surfaces and recursing containers. + - Fixed verb put to work with surfaces and recursing containers. + - Fixed /lib/std/germ to work properly and handle bane. + - Fixed verb read to properly handle readable things + on objects. + - Updated enter, jump, and go verbs to handle hobbling. + - Numerous minor fixes and updates to verbs and lib objects. + - Added crawl verb. + - Fixed armor conflicts. + - Added intermud requirement to change ADMIN_EMAIL. + + ---- Version 1.7r1 --- + + - Fixed some minor login bugs. + - Updated the make_workroom sefun. + + ---- Version 1.7 --- + + - Added template creator setup for first admin and encre. + - Fixed and tweaked help: help works properly now. + - Fixed "force". + - Added roommaker. + - Added (default) explorer and mage classes. + - Tweaked connect.real. + - Fixed numerous armor bugs: armor works properly now. + - Changed the pointlessly affected "armor" spelling to "armor" + - Stopped numbering items in the changelog + + ---- Version 1.6 --- + 11 Added large, functional sample area based on Larstown + + 10 Major changes to many many lib files and sefuns + + ---- Version 1.1r5 --- + 9 Fixed library inheritables: inventory, move, container + + 8 Added library inheritables: shop, shadow, getlivings, addstuff + + 7 Added sefuns: tell_player(), GetCustomPath(), GetCustomCommand(), + dump_socket_status(), flat_map(), get_cmds(), get_verbs(), + get_livings(), local_time(), reap_dummies(), reap_other(), + reap_list(), tail(), timestamp(), get_dupes() + + ---- Version 1.1r4 --- + 6 Added license.txt + + 5 Added telnet client and telnet room + + 4 Applied ftpd fixes + + ---- Version 1.1r3 --- + 3 Fixed /domains/Ylsrim, and most items work + + ---- Version 1.1r2 --- + 2 We know there are still many many bugs left in the lib. + This is a preliminary release. An update is already in the works. + + 1 W00t! It's finally free! + + diff -c -r --new-file ds1.1/lib/doc/sefun/GetCustomCommand ds2.0r27/lib/doc/sefun/GetCustomCommand *** ds1.1/lib/doc/sefun/GetCustomCommand Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/GetCustomCommand Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,20 ---- + + GETCUSTOMCOMMAND(1) GETCUSTOMCOMMAND(1) + + NAME + GetCustomCommand() - Determines whether a custom command exists. + + SYNOPSIS + string GetCustomCommand(string str) + + DESCRIPTION + This sefun is used to ensure that a custom command isn't being spoofed. + + LOCATION + /secure/sefun/custom_commands.c + + Author + Cratylus @ Dead Souls + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/GetCustomPath ds2.0r27/lib/doc/sefun/GetCustomPath *** ds1.1/lib/doc/sefun/GetCustomPath Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/GetCustomPath Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,23 ---- + + GETCUSTOMPATH(1) GETCUSTOMPATH(1) + + NAME + GetCustomPath() - returns the directory designated as the + custom commands location. + + SYNOPSIS + string *GetCustomPath() + + DESCRIPTION + Creators are expected to have a directory within their + homedir with a standard name which contains user-created, or + "custom" command. This sefun retuns the dir for this_player(). + + LOCATION + /secure/sefun/custom_commands.c + + Author + Cratylus @ Dead Souls + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/absolute_path ds2.0r27/lib/doc/sefun/absolute_path *** ds1.1/lib/doc/sefun/absolute_path Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/absolute_path Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,51 ---- + + ABSOLUTE_PATH(1) ABSOLUTE_PATH(1) + + NNAAMMEE + _a_b_s_o_l_u_t_e___p_a_t_h_(_) - returns the full path starting at root + + SSYYNNOOPPSSIISS + string absolute_path(string curr, string new) + + DDEESSCCRRIIPPTTIIOONN + Given any relative path, this function returns the full + path from /. The first argument is the base directory, + and the second is the relative path you wish to make + absolute. If the second argument cannot be made absolute + on its own, it is made absolute relative to the base + directory, which is usually the current working directory. + It understands special things like: + + +o ~/ represents the home directory of the command giver + + +o ~user represents the home directory of the user named + + +o ^domains represents the home directory of the domain + named + + +o + + .. rreepprreesseennttss tthhee ccuurrrreenntt wwoorrkkiinngg ddiirreeccttoorryy + + +o + + .... rreepprreesseennttss tthhee ppaarreenntt ooff tthhee ccuurrrreenntt wwoorrkkiinngg ddiirreeccttoorryy + + EEXXAAMMPPLLEESS + +o absolute_path("/realms/descartes", "monster.c") + returns "/realms/descartes/monster.c" + + +o absolute_path("/std", "~workroom.c") returns + "/realms/descartes/workroom.c" + + LLOOCCAATTIIOONN + /secure/SimulEfun/absolute_path.c + + SSEEEE AALLSSOO + _b_a_s_e___n_a_m_e_(_), _p_a_t_h___f_i_l_e_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/absolute_value ds2.0r27/lib/doc/sefun/absolute_value *** ds1.1/lib/doc/sefun/absolute_value Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/absolute_value Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,29 ---- + + ABSOLUTE_VALUE(1) ABSOLUTE_VALUE(1) + + NNAAMMEE + _a_b_s_o_l_u_t_e___v_a_l_u_e_(_) - returns the absolute value of a give + number + + SSYYNNOOPPSSIISS + int absolute_value(int x) + + DDEESSCCRRIIPPTTIIOONN + Given any integer argument, it returns its absolute value. + + EEXXAAMMPPLLEESS + _a_b_s_o_l_u_t_e___v_a_l_u_e(-5) returns 5 + + +o _a_b_s_o_l_u_t_e___v_a_l_u_e(5) returns 5 + + LLOOCCAATTIIOONN + /secure/SimulEfun/absolute_value.c + + SSEEEE AALLSSOO + _p_e_r_c_e_n_t_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/add_sky_event ds2.0r27/lib/doc/sefun/add_sky_event *** ds1.1/lib/doc/sefun/add_sky_event Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/add_sky_event Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,43 ---- + + ADD_SKY_EVENT(1) ADD_SKY_EVENT(1) + + NNAAMMEE + _a_d_d___s_k_y___e_v_e_n_t_(_) - sets a function to be called every + change of time of day + + SSYYNNOOPPSSIISS + void add_sky_event(function f) + + DDEESSCCRRIIPPTTIIOONN + This functions sets the mudlib to call the function you + specify every time the time of day changes. With the + Nightmare Mudlib time system, there are four changes in + time of day: dawn, morning, twilight, night. If you call + _a_d_d___s_k_y___e_v_e_n_t_(_), then any time the time of day changes, + the function you specified will be called with the time of + day as an argument. + + EEXXAAMMPPLLEESS + add_sky_event((: howl :)) will have the function: void + howl(string str); get called in your object every change + in the time of day. The string argument is the time of + day, which will be one of dawn, morning, twilight, night. + + NNOOTTEESS + In general, this should be called only from _c_r_e_a_t_e_(_) in an + object. It definitely should only be called once for each + function to be called in an object. Also, it is + recommended that you _s_e_t___n_o___c_l_e_a_n(1) in any object which + does have functions set by this function to be called. + + LLOOCCAATTIIOONN + /secure/SimulEfun/time.c + + SSEEEE AALLSSOO + _r_e_m_o_v_e___s_k_y___e_v_e_n_t_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/alignment_ok ds2.0r27/lib/doc/sefun/alignment_ok *** ds1.1/lib/doc/sefun/alignment_ok Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/alignment_ok Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,28 ---- + + ALIGNMENT_OK(1) ALIGNMENT_OK(1) + + NNAAMMEE + _a_l_i_g_n_m_e_n_t___o_k_(_) - returns true if a player is inside + alignment restrictions + + SSYYNNOOPPSSIISS + int alignment_ok(object ob) + + DDEESSCCRRIIPPTTIIOONN + If the object passed as the argument is within alignment + restrictions for the player's class, then the function + returns true. Otherwise it returns false. + + EEXXAAMMPPLLEESS + +o _a_l_i_g_n_m_e_n_t___o_k(_t_h_i_s___p_l_a_y_e_r_(_)) returns false if I am an + evil cleric, or true if I am a good monk, or always + true as a fighter + + LLOOCCAATTIIOONN + /secure/SimulEfun/alignment.c + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/alignment_string ds2.0r27/lib/doc/sefun/alignment_string *** ds1.1/lib/doc/sefun/alignment_string Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/alignment_string Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,32 ---- + + ALIGNMENT_STRING(1) ALIGNMENT_STRING(1) + + NNAAMMEE + _a_l_i_g_n_m_e_n_t___s_t_r_i_n_g_(_) - returns a string describing a + living's alignment + + SSYYNNOOPPSSIISS + string alignment_string(object|int val) + + DDEESSCCRRIIPPTTIIOONN + The function can be passed either a living object or an + integer representing an alignment value. The return value + is a string which describes the alignment of the object or + the alignment value passed. + + EEXXAAMMPPLLEESS + +o _a_l_i_g_n_m_e_n_t___s_t_r_i_n_g(0) returns "neutral" + + +o _a_l_i_g_n_m_e_n_t___s_t_r_i_n_g(_t_h_i_s___p_l_a_y_e_r_(_)) returns "evil" + + LLOOCCAATTIIOONN + /secure/SimulEfun/alignment.c + + SSEEEE AALLSSOO + _a_l_i_g_n_m_e_n_t___o_k_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/ambassadorp ds2.0r27/lib/doc/sefun/ambassadorp *** ds1.1/lib/doc/sefun/ambassadorp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/ambassadorp Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,30 ---- + + AMBASSADORP(1) AMBASSADORP(1) + + NNAAMMEE + _a_m_b_a_s_s_a_d_o_r_p_(_) - returns true if the object is an + ambassador + + SSYYNNOOPPSSIISS + int ambassadorp(object ob) + + DDEESSCCRRIIPPTTIIOONN + Returns true if the argument passed is an ambassador. An + ambassador is a user who is listed in the AMBASSADOR group + in /secure/cfg/groups.cfg. + + EEXXAAMMPPLLEESS + +o _a_m_b_a_s_s_a_d_o_r_p(_t_h_i_s___p_l_a_y_e_r_(_)) returns true if + _t_h_i_s___p_l_a_y_e_r_(_) is an ambassador + + LLOOCCAATTIIOONN + /secure/SimulEfun/pointers.c + + SSEEEE AALLSSOO + _a_r_c_h_p_(_), _h_i_g_h___m_o_r_t_a_l_p_(_), _l_e_a_d_e_r_p_(_), _u_s_e_r_p_(_), _w_i_z_a_r_d_p_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/architecture ds2.0r27/lib/doc/sefun/architecture *** ds1.1/lib/doc/sefun/architecture Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/architecture Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,26 ---- + + ARCHITECTURE(1) ARCHITECTURE(1) + + NNAAMMEE + _a_r_c_h_i_t_e_c_t_u_r_e_(_) - returns the name of the hardware of the + game + + SSYYNNOOPPSSIISS + string _a_r_c_h_i_t_e_c_t_u_r_e_(_) + + DDEESSCCRRIIPPTTIIOONN + Returns the name of the hardware platform on which the MUD + is run. + + LLOOCCAATTIIOONN + /secure/SimulEfun/mud_info.c + + SSEEEE AALLSSOO + _m_u_d___n_a_m_e_(_), _m_u_d_l_i_b_(_), _m_u_d_l_i_b___v_e_r_s_i_o_n_(_), _q_u_e_r_y___h_o_s_t___p_o_r_t_(_), + _v_e_r_s_i_o_n_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/archp ds2.0r27/lib/doc/sefun/archp *** ds1.1/lib/doc/sefun/archp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/archp Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,30 ---- + + ARCHP(1) ARCHP(1) + + NNAAMMEE + _a_r_c_h_p_(_) - returns true for arches + + SSYYNNOOPPSSIISS + int archp(object ob) + + DDEESSCCRRIIPPTTIIOONN + For any object which is passed which is a user object and + in either the SUPERUSER or ASSIST groups, this function + returns true. + + EEXXAAMMPPLLEESS + _a_r_c_h_p(_t_h_i_s___p_l_a_y_e_r_(_)) will return true if _t_h_i_s___p_l_a_y_e_r_(_) is + in the SUPERUSER or ASSIST groups. + + LLOOCCAATTIIOONN + /secure/SimulEfun/pointers.c + + SSEEEE AALLSSOO + _a_m_b_a_s_s_a_d_o_r_p_(_), _h_i_g_h___m_o_r_t_a_l_p_(_), _l_e_a_d_e_r_p_(_), _u_s_e_r_p_(_), + _w_i_z_a_r_d_p_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/arrange_string ds2.0r27/lib/doc/sefun/arrange_string *** ds1.1/lib/doc/sefun/arrange_string Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/arrange_string Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,41 ---- + + ARRANGE_STRING(1) ARRANGE_STRING(1) + + NNAAMMEE + _a_r_r_a_n_g_e___s_t_r_i_n_g_(_) - arranges a string to a given length + + SSYYNNOOPPSSIISS + string arrange_string(string str, int x) + + DDEESSCCRRIIPPTTIIOONN + Passed a string and a length, this function returns the + original string either cut to or extended to the length + specified by the second argument. If the length of the + original string is longer than the length specified, then + all characters beyond the length specified are cut off. + If the length is less than the original string's length, + then the original string is padded with spaces so that it + ends up being as long as the length specified. + + EEXXAAMMPPLLEESS + +o arrange_string("resistence is futile", 25) returns + "resistence is futile " + + +o arrange_string("gurble", 2) returns "gu" + + NNOOTTEESS + Do not use this function inside the mudlib, as it is slow. + Instead use _s_p_r_i_n_t_f_(_). This SimulEfun exists to make life + easy on creators. + + LLOOCCAATTIIOONN + /secure/SimulEfun/strings.c + + SSEEEE AALLSSOO + _c_e_n_t_e_r_(_), _w_r_a_p_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/base_name ds2.0r27/lib/doc/sefun/base_name *** ds1.1/lib/doc/sefun/base_name Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/base_name Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,32 ---- + + BASE_NAME(1) BASE_NAME(1) + + NNAAMMEE + _b_a_s_e___n_a_m_e_(_) - returns the name of the object's original + file + + SSYYNNOOPPSSIISS + string base_name(mixed val) + + DDEESSCCRRIIPPTTIIOONN + If you pass an object name (returned by the _f_i_l_e___n_a_m_e_(_) + efun) or an object itself, this function will return the + name of the original file from which the object was loaded + or cloned. For master copies, the _b_a_s_e___n_a_m_e_(_) will equal + the _f_i_l_e___n_a_m_e_(_). For clones, the _f_i_l_e___n_a_m_e_(_) will be the + _b_a_s_e___n_a_m_e_(_) plus an extension. + + EEXXAAMMPPLLEESS + _b_a_s_e___n_a_m_e(find_living("orc")) might return "/std/monster" + + LLOOCCAATTIIOONN + /secure/SimulEfun/base_name.c + + SSEEEE AALLSSOO + _f_i_l_e___n_a_m_e_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/cardinal ds2.0r27/lib/doc/sefun/cardinal *** ds1.1/lib/doc/sefun/cardinal Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/cardinal Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,27 ---- + + CARDINAL(1) CARDINAL(1) + + NNAAMMEE + _c_a_r_d_i_n_a_l_(_) - returns the string description of a number + + SSYYNNOOPPSSIISS + string cardinal(int x) + + DDEESSCCRRIIPPTTIIOONN + Given any integer number, this function will return the + number written out in English. + + EEXXAAMMPPLLEESS + +o _c_a_r_d_i_n_a_l(5) returns "five" + + LLOOCCAATTIIOONN + /secure/SimulEfun/english.c + + SSEEEE AALLSSOO + _o_r_d_i_n_a_l_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/center ds2.0r27/lib/doc/sefun/center *** ds1.1/lib/doc/sefun/center Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/center Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,27 ---- + + CENTER(1) CENTER(1) + + NNAAMMEE + _c_e_n_t_e_r_(_) - centers a given string in a field + + SSYYNNOOPPSSIISS + varargs string center(string str, int x) + + DDEESSCCRRIIPPTTIIOONN + This function will center the string given as the first + argument in a string field as wide as specified by the + second argument. The second argument is optional. If the + second argument is not supplied, a string width of 80 is + assumed. + + LLOOCCAATTIIOONN + /secure/SimulEfun/strings.c + + SSEEEE AALLSSOO + _a_r_r_a_n_g_e___s_t_r_i_n_g_(_), _w_r_a_p_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/check_privs ds2.0r27/lib/doc/sefun/check_privs *** ds1.1/lib/doc/sefun/check_privs Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/check_privs Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,29 ---- + + CHECK_PRIVS(1) CHECK_PRIVS(1) + + NAME + check_privs() - Determines write privileges to a directory. + + SYNOPSIS + int check_privs(object player, string str) + + DESCRIPTION + Checks whether a player should have write access to a file based + on arch status and home directory. + + EXAMPLES + check_privs(this_player(),"/realms/cratylus") returns 1 if + this_player() is cratylus. + + + LOCATION + /secure/sefun/secure.c + + SEE ALSO + + + Author + Cratylus @ Dead Souls + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/conjunction ds2.0r27/lib/doc/sefun/conjunction *** ds1.1/lib/doc/sefun/conjunction Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/conjunction Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,35 ---- + + CONJUCTION(1) CONJUCTION(1) + + NNAAMMEE + _c_o_n_j_u_n_c_t_i_on_(_) - connects words, phrases or clauses with a + coordinator. + + SSYYNNOOPPSSIISS + varargs string conjunction(mixed expressions, + string coordinator) + + DDEESSCCRRIIPPTTIIOONN + Given a number of words, or groups of words, that are used + the same way in a sentence, this function returns a string + which joins them using a coordinator such as and, but, or + or nor. The first argument is the group of words that are + to be joined. The second argument is the coordinator used + to join them. The coordinator defaults to "and". + + EEXXAAMMPPLLEESS + +o conjunction(({"a frog", "twelve trees", + "some whip cream"})) + returns "a frog, twelve trees and some whip cream" + + +o conjunction(({"Descartes", "Blitz"}), + "and obviously") + returns "Descartes and obviously Blitz" + + /secure/SimulEfun/english.c + + AAuutthhoorr + Rush + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/consolidate ds2.0r27/lib/doc/sefun/consolidate *** ds1.1/lib/doc/sefun/consolidate Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/consolidate Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,34 ---- + + CONSOLIDATE(1) CONSOLIDATE(1) + + NNAAMMEE + _c_o_n_s_o_l_i_d_a_t_e_(_) - consolidates a string with a number + + SSYYNNOOPPSSIISS + string consolidate(int x, string str) + + DDEESSCCRRIIPPTTIIOONN + Given a number of singularly described items, this + function returns a string which describes them in the + plural, reflecting the number of them that exist. The + first argument is the number of things which have the same + singular description. The second argument is their + singular description. + + EEXXAAMMPPLLEESS + +o consolidate(5, "a fish") returns "five fish" + + +o consolidate(2, "a knight") returns "two knights" + + head1 LOCATION + + /secure/SimulEfun/english.c + + SSEEEE AALLSSOO + _p_l_u_r_a_l_i_z_e_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/convert_ascii ds2.0r27/lib/doc/sefun/convert_ascii *** ds1.1/lib/doc/sefun/convert_ascii Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/convert_ascii Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,25 ---- + + CONVERT_ASCII(1) CONVERT_ASCII(1) + + NAME + convert_ascii() - Translates ascii code to string. + + SYNOPSIS + string convert_ascii(int i) + + DESCRIPTION + This sefun takes an integer as an argument, and if that integer + corresponds to an ASCII code that is in its list, that + ASCII character is returned. + + LOCATION + /secure/sefun/ascii.c + + EXAMPLE + convert_ascii(42) returns "*" + + Author + Cratylus @ Dead Souls + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/convert_name ds2.0r27/lib/doc/sefun/convert_name *** ds1.1/lib/doc/sefun/convert_name Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/convert_name Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,30 ---- + + CONVERT_NAME(1) CONVERT_NAME(1) + + NNAAMMEE + _c_o_n_v_e_r_t___n_a_m_e_(_) - creates a unique identifier for a name + string + + SSYYNNOOPPSSIISS + string convert_name(string str) + + DDEESSCCRRIIPPTTIIOONN + This function takes a capitalized name and returns the + real name any player using that cap name must have. + + EEXXAAMMPPLLEESS + +o convert_name("Descartes of Borg") returns + "descartesofborg" + + NNOOTTEESS + The value of _c_o_n_v_e_r_t___n_a_m_e((string)player->_q_u_e_r_y___C_a_p_N_a_m_e_(_)) + always equals (string)player->_q_u_e_r_y___n_a_m_e_(_). + + LLOOCCAATTIIOONN + /secure/SimulEfun/convert_name.c + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/copy ds2.0r27/lib/doc/sefun/copy *** ds1.1/lib/doc/sefun/copy Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/copy Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,40 ---- + + COPY(1) COPY(1) + + NNAAMMEE + _c_o_p_y_(_) - returns a secure copy of any data type + + SSYYNNOOPPSSIISS + mixed copy(mixed val) + + DDEESSCCRRIIPPTTIIOONN + In LPC, mappings and arrays are pointers. This means that + if you set one mapping equal to another, making a change + in one will reflect a change in the other. To understand + this better, read up on these data types. Nevertheless, + there are times when you do not want to be passing around + these pointers. For example, if someone queries your + groups from the master object, you do not want them to get + your groups mapping and be able to modify it. Thus, you + return a copy of that mapping. This SimulEfun makes such + a safe copy. + + EEXXAAMMPPLLEESS + +o given two mappings, mapping a and b, a = ([ "borg" : 1 + ]); b = a; the expression a == b is true. b = _c_o_p_y(a) + sets b equal to ([ "borg" : 1]), but a == b is false. + + head1 NOTES + + Use this only where absolutely needed for security + reasons. It is an expensive SimulEfun as far as CPU + resources are concerned. + + LLOOCCAATTIIOONN + /secure/SimulEfun/copy.c + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/currency_inflation ds2.0r27/lib/doc/sefun/currency_inflation *** ds1.1/lib/doc/sefun/currency_inflation Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/currency_inflation Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,33 ---- + + CURRENCY_INFLATION(1) CURRENCY_INFLATION(1) + + NNAAMMEE + _c_u_r_r_e_n_c_y___i_n_f_l_a_t_i_o_n_(_) - returns the rate of annual + inflation + + SSYYNNOOPPSSIISS + float currency_inflation(string type) + + DDEESSCCRRIIPPTTIIOONN + Given any currency as an argument, this function returns + the rate at which that currency inflates or deflates each + MUD year. + + EEXXAAMMPPLLEESS + +o _c_u_r_r_e_n_c_y___i_n_f_l_a_t_i_o_n("gold") might return 0.03, meaning + it's buying power will decrease by 3% over the next + MUD year. In other words, an object which cost 100 + gold today will cost 103 gold this time next year. + + LLOOCCAATTIIOONN + /secure/SimulEfun/economy.c + + SSEEEE AALLSSOO + _c_u_r_r_e_n_c_y___m_a_s_s_(_), _c_u_r_r_e_n_c_y___r_a_t_e_(_), _c_u_r_r_e_n_c_y___v_a_l_u_e_(_), + _m_u_d___c_u_r_r_e_n_c_i_e_s_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/currency_mass ds2.0r27/lib/doc/sefun/currency_mass *** ds1.1/lib/doc/sefun/currency_mass Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/currency_mass Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,30 ---- + + CURRENCY_MASS(1) CURRENCY_MASS(1) + + NNAAMMEE + _c_u_r_r_e_n_c_y___m_a_s_s_(_) - returns the mass of a given amount of a + currency + + SSYYNNOOPPSSIISS + int currency_mass(string type, int x) + + DDEESSCCRRIIPPTTIIOONN + Given a currency and an amount of that currency, the + function will return the mass. + + EEXXAAMMPPLLEESS + int currency_mass("gold", 100) might return 4 for 4 mass + units + + LLOOCCAATTIIOONN + /secure/SimulEfun/economy.c + + SSEEEE AALLSSOO + _c_u_r_r_e_n_c_y___i_n_f_l_a_t_i_o_n_(_), _c_u_r_r_e_n_c_y___r_a_t_e_(_), _c_u_r_r_e_n_c_y___v_a_l_u_e_(_), + _m_u_d___c_u_r_r_e_n_c_i_e_s_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/currency_rate ds2.0r27/lib/doc/sefun/currency_rate *** ds1.1/lib/doc/sefun/currency_rate Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/currency_rate Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,33 ---- + + CURRENCY_RATE(1) CURRENCY_RATE(1) + + NNAAMMEE + _c_u_r_r_e_n_c_y___r_a_t_e_(_) - returns how much of a currency equals + one EU + + SSYYNNOOPPSSIISS + float currency_rate(string type) + + DDEESSCCRRIIPPTTIIOONN + Given a currency type as an argument, this function will + tell you how much of that currency is needed to equal one + EU, or economic unit. An economic unit is a base value + used by the mud to set relative values. The _s_e_t___v_a_l_u_e_(_) + function in objects uses EU's. + + EEXXAAMMPPLLEESS + _c_u_r_r_e_n_c_y___r_a_t_e("gold") would return 1.5 if, for example, it + takes 3 gold to buy something that has a _s_e_t___v_a_l_u_e_(_) of 2. + + LLOOCCAATTIIOONN + /secure/SimulEfun/economy.c + + SSEEEE AALLSSOO + _c_u_r_r_e_n_c_y___i_n_f_l_a_t_i_o_n_(_), _c_u_r_r_e_n_c_y___m_a_s_s_(_), _c_u_r_r_e_n_c_y___v_a_l_u_e_(_), + _m_u_d___c_u_r_r_e_n_c_i_e_s_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/currency_value ds2.0r27/lib/doc/sefun/currency_value *** ds1.1/lib/doc/sefun/currency_value Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/currency_value Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,30 ---- + + CURRENCY_VALUE(1) CURRENCY_VALUE(1) + + NNAAMMEE + _c_u_r_r_e_n_c_y___v_a_l_u_e_(_) - returns how much in EU's an amount of a + currency is + + SSYYNNOOPPSSIISS + int currency_value(int x, string str) + + DDEESSCCRRIIPPTTIIOONN + Given an amount of a currency, this returns its worth in + EU's, or economic units, the base measurement of relative + economic worth. + + EEXXAAMMPPLLEESS + If the currency rate of gold is 1.5, then + currency_value(10, "gold") will return 15. + + LLOOCCAATTIIOONN + /secure/SimulEfun/economy.c + + SSEEEE AALLSSOO + _c_u_r_r_e_n_c_y___i_n_f_l_a_t_i_o_n_(_), _c_u_r_r_e_n_c_y___m_a_s_s_(_), _c_u_r_r_e_n_c_y___r_a_t_e_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/date ds2.0r27/lib/doc/sefun/date *** ds1.1/lib/doc/sefun/date Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/date Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,29 ---- + + DATE(1) DATE(1) + + NNAAMMEE + _d_a_t_e_(_) - returns the date in the month at a given time + (MUD time) + + SSYYNNOOPPSSIISS + int date(int x) + + DDEESSCCRRIIPPTTIIOONN + Returns what day of the month is represented by the first + argument, which is assumed to be a time integer. + + EEXXAAMMPPLLEESS + +o _d_a_t_e(_t_i_m_e_(_)) returned 6 today, meaning it is Altki + 6th. + + LLOOCCAATTIIOONN + /secure/SimulEfun/time.c + + SSEEEE AALLSSOO + _d_a_y_(_), _h_o_u_r_(_), _m_i_n_u_t_e_s_(_), _m_o_n_t_h_(_), _q_u_e_r_y___n_i_g_h_t_(_), _y_e_a_r_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/day ds2.0r27/lib/doc/sefun/day *** ds1.1/lib/doc/sefun/day Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/day Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,27 ---- + + DAY(1) DAY(1) + + NNAAMMEE + _d_a_y_(_) - returns the name of the day in MUD time + + SSYYNNOOPPSSIISS + string day(int x) + + DDEESSCCRRIIPPTTIIOONN + Given a time integer as an argument, this will return the + day at that time. + + EEXXAAMMPPLLEESS + _d_a_y(_t_i_m_e_(_)) returns "Shadowday" today + + LLOOCCAATTIIOONN + /secure/SimulEfun/time.c + + SSEEEE AALLSSOO + _d_a_y_(_), _h_o_u_r_(_), _m_i_n_u_t_e_s_(_), _m_o_n_t_h_(_), _q_u_e_r_y___n_i_g_h_t_(_), _y_e_a_r_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/debug ds2.0r27/lib/doc/sefun/debug *** ds1.1/lib/doc/sefun/debug Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/debug Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,28 ---- + + DEBUG(1) DEBUG(1) + + NAME + debug() - Generates messages useful for debugging. + + SYNOPSIS + varargs void debug(mixed msg, mixed var, string color) + + DESCRIPTION + This command sends 'msg' to all users() who have + enabled receipt of debug info with the debug command. The + optional 'var' is stringified and included in the message. + The optional 'color' indicates what color the message + should be. + + EXAMPLE + + In a misbehaving npc: + debug("This npc's skills are: ",this_object()->GetSkills(),"red"); + + LOCATION + /secure/sefun/communications.c + + Author + Cratylus @ Dead Souls + + 1 diff -c -r --new-file ds1.1/lib/doc/sefun/destruct ds2.0r27/lib/doc/sefun/destruct *** ds1.1/lib/doc/sefun/destruct Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/destruct Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,27 ---- + + DESTRUCT(1) DESTRUCT(1) + + NNAAMMEE + _d_e_s_t_r_u_c_t_(_) - provides security for the _d_e_s_t_r_u_c_t_(_) efun + + SSYYNNOOPPSSIISS + int destruct(object ob) + + DDEESSCCRRIIPPTTIIOONN + Since the MudOS efun _d_e_s_t_r_u_c_t_(_) appropriately has no + security tied to it, and the Nightmare Mudlib wished + destructions to be tied to security, the Nightmare Mudlib + overrides the MudOS _d_e_s_t_r_u_c_t_(_) efun. The _d_e_s_t_r_u_c_t_(_) efun + removes the object passed from memory. + + LLOOCCAATTIIOONN + /secure/SimulEfun/SimulEfun.c + + SSEEEE AALLSSOO + _d_e_s_t_r_u_c_t_(_) efun + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/distinct_array ds2.0r27/lib/doc/sefun/distinct_array *** ds1.1/lib/doc/sefun/distinct_array Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/distinct_array Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,32 ---- + + DISTINCT_ARRAY(1) DISTINCT_ARRAY(1) + + NNAAMMEE + _d_i_s_t_i_n_c_t___a_r_r_a_y_(_) - returns an array of distinct members + + SSYYNNOOPPSSIISS + mixed *distinct_array(mixed *arr) + + DDEESSCCRRIIPPTTIIOONN + With the first argument of an array of any type, this + function will filter out duplicate members and return an + array with only unique members. + + EEXXAAMMPPLLEESS + distinct_array(({ "a", "b", "c", "b", "d", "a" })) returns + ({ "a", "b", "c", "d" }) + + NNOOTTEE + The order of the result array is NOT guaranteed. + + LLOOCCAATTIIOONN + /secure/SimulEfun/distinct_array.c + + SSEEEE AALLSSOO + _e_x_c_l_u_d_e___a_r_r_a_y_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/domain ds2.0r27/lib/doc/sefun/domain *** ds1.1/lib/doc/sefun/domain Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/domain Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,49 ---- + + DOMAIN(1) DOMAIN(1) + + NNAAMMEE + _d_o_m_a_i_n_(_) - returns the domain to which an object belongs + + SSYYNNOOPPSSIISS + string domain(object|string val) + + DDEESSCCRRIIPPTTIIOONN + Given an object as an argument, _d_o_m_a_i_n_(_) will return the + domain to which the object belongs based on its file name. + If a string is passed, the string is assumed to be the + file name of an object and the function will return the + domain associated with that file name. + + Domains are determined based on the following criteria: + + +o the return from query_domain() in the object if that + value is a valid domain and the first argument is an + object or a loadable file + + +o the domain from which the object comes if its file name + is from the mudlib domains directory + + +o if the object is from a creator home directory, it + checks the sub-directory of that home directory from + which it came and returns it if it is a valid domain + =back + + EEXXAAMMPPLLEESS + +o _d_o_m_a_i_n(ob) will return "NorthForest" if the file name + is "/domains/NorthForest/sword" and ob->_q_u_e_r_y___d_o_m_a_i_n_(_) + returns 0 + + +o _d_o_m_a_i_n("/realms/descartes/Orlith/entrance") returns + "Orlith" + + LLOOCCAATTIIOONN + /secure/SimulEfun/domains.c + + SSEEEE AALLSSOO + _d_o_m_a_i_n___m_a_s_t_e_r_(_), _d_o_m_a_i_n___e_x_i_s_t_s_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/domain_exists ds2.0r27/lib/doc/sefun/domain_exists *** ds1.1/lib/doc/sefun/domain_exists Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/domain_exists Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,29 ---- + + DOMAIN_EXISTS(1) DOMAIN_EXISTS(1) + + NNAAMMEE + _d_o_m_a_i_n___e_x_i_s_t_s_(_) - returns true if the given string is a + valid domain + + SSYYNNOOPPSSIISS + int domain_exists(string dmn) + + DDEESSCCRRIIPPTTIIOONN + Given any string, this function will return true if the + string is the name of a valid domain. + + EEXXAAMMPPLLEESS + _d_o_m_a_i_n___e_x_i_s_t_s("Praxis") returns true if there is a + directory called "/domains/Praxis" + + LLOOCCAATTIIOONN + /secure/SimulEfun/domain_exists.c + + SSEEEE AALLSSOO + _d_o_m_a_i_n_(_), _d_o_m_a_i_n___m_a_s_t_e_r_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/domain_master ds2.0r27/lib/doc/sefun/domain_master *** ds1.1/lib/doc/sefun/domain_master Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/domain_master Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,31 ---- + + DOMAIN_MASTER(1) DOMAIN_MASTER(1) + + NNAAMMEE + _d_o_m_a_i_n___m_a_s_t_e_r_(_) - returns the master object for a given + domain + + SSYYNNOOPPSSIISS + object domain_master(string|object val) + + DDEESSCCRRIIPPTTIIOONN + Given a file name or an object, this function will return + the object which controls the functions of the domain from + which it comes. + + EEXXAAMMPPLLEESS + +o _d_o_m_a_i_n___m_a_s_t_e_r("/realms/descartes/NorthForest/room/entrance") + will return the object + "/domains/NorthForest/adm/master" + + LLOOCCAATTIIOONN + /secure/SimulEfun/domains.c + + SSEEEE AALLSSOO + _d_o_m_a_i_n_(_), _d_o_m_a_i_n___e_x_i_s_t_s_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/effective_light ds2.0r27/lib/doc/sefun/effective_light *** ds1.1/lib/doc/sefun/effective_light Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/effective_light Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,29 ---- + + EFFECTIVE_LIGHT(1) EFFECTIVE_LIGHT(1) + + NNAAMMEE + _e_f_f_e_c_t_i_v_e___l_i_g_h_t_(_) - returns the amount of light available + to an object + + SSYYNNOOPPSSIISS + int effective_light(object ob) + + DDEESSCCRRIIPPTTIIOONN + Passed an object, this function returns the amount of + light available specifically for that object. This + differs from _t_o_t_a_l___l_i_g_h_t_(_) in that _t_o_t_a_l___l_i_g_h_t_(_) returns + the total amount of light available for any user in an + environment, whereas _e_f_f_e_c_t_i_v_e___l_i_g_h_t_(_) takes into account + individual factors such as night vision, sunglasses, etc. + + LLOOCCAATTIIOONN + /secure/SimulEfun/light.c + + SSEEEE AALLSSOO + _m_o_o_n___l_i_g_h_t_(_), _t_o_t_a_l___l_i_g_h_t_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/event ds2.0r27/lib/doc/sefun/event *** ds1.1/lib/doc/sefun/event Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/event Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,41 ---- + + EVENT(1) EVENT(1) + + NNAAMMEE + _e_v_e_n_t_(_) - sets up an event to occur regularly + + SSYYNNOOPPSSIISS + varargs void event(string fun, int when, mixed *args, int + reg) + + DDEESSCCRRIIPPTTIIOONN + This function is exactly like the _c_a_l_l___o_u_t_(_) efun, except + in that this SimulEfun works across reboots. This is + useful for setting up long terms events, such as monthly + goblin raids or lunar based lycanthropy. The first + argument is a string representing the name of the function + to be called. The second argument is how long after + _e_v_e_n_t_(_) is called that the first event should happen. The + third and fourth arguments are optional. If given, the + third argument is an array of arguments to be passed to + the function when it is called. In addition, the fourth + argument, is a flag. If given and 1, it flags the event + to be recurring. If not give or 0, the event will only + happen the first time. + + EEXXAAMMPPLLEESS + +o event("call_war", MONTH) will set the function + _c_a_l_l___w_a_r_(_) to be called one mud month from now + + LLOOCCAATTIIOONN + /secure/SimulEfun/events.c + + SSEEEE AALLSSOO + _c_a_l_l___o_u_t_(_), _e_v_e_n_t___p_e_n_d_i_n_g_(_), _r_e_m_o_v_e___c_a_l_l___o_u_t_(_), + _s_e_t___h_e_a_r_t___b_e_a_t_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/event_pending ds2.0r27/lib/doc/sefun/event_pending *** ds1.1/lib/doc/sefun/event_pending Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/event_pending Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,25 ---- + + EVENT_PENDING(1) EVENT_PENDING(1) + + NNAAMMEE + _e_v_e_n_t___p_e_n_d_i_n_g_(_) - returns true if an event is pending for + an object + + SSYYNNOOPPSSIISS + int event_pending(object ob) + + DDEESSCCRRIIPPTTIIOONN + If an event is pending for the object which you pass, then + the function returns 1. Otherwise it returns 0. + + LLOOCCAATTIIOONN + /secure/SimulEfun/events.c + + SSEEEE AALLSSOO + _c_a_l_l___o_u_t_(_), _e_v_e_n_t_(_), _r_e_m_o_v_e___c_a_l_l___o_u_t_(_), _s_e_t___h_e_a_r_t___b_e_a_t_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/exclude_array ds2.0r27/lib/doc/sefun/exclude_array *** ds1.1/lib/doc/sefun/exclude_array Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/exclude_array Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,37 ---- + + EXCLUDE_ARRAY(1) EXCLUDE_ARRAY(1) + + NNAAMMEE + _e_x_c_l_u_d_e___a_r_r_a_y_(_) - excludes 1 or more elements from an + array + + SSYYNNOOPPSSIISS + varargs mixed *exclude_array(mixed *array, int from, int + to) + + DDEESSCCRRIIPPTTIIOONN + Given any type of an array as a first argument, this + SimulEfun will return a different array with the elements + from the element in the second argument up to the elements + in the third argument removed from the original. If the + third argument is omitted, then only the element in the + second argument will be omitted. + + EEXXAAMMPPLLEESS + +o exclude_array(({ "a", "b", "c" }), 1) returns ({ "a", + "c" }) + + +o exclude_array(({ "a", "b", "c", "d" }), 1, 2) returns + ({ "a", "d" }) + + LLOOCCAATTIIOONN + /secure/SimulEfun/exclude_array.c + + SSEEEE AALLSSOO + _d_i_s_t_i_n_c_t___a_r_r_a_y_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/exec ds2.0r27/lib/doc/sefun/exec *** ds1.1/lib/doc/sefun/exec Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/exec Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,25 ---- + + EXEC(1) EXEC(1) + + NNAAMMEE + _e_x_e_c_(_) - provides security for the MudOS _e_x_e_c_(_) efun + + SSYYNNOOPPSSIISS + int exec(object target, object src) + + DDEESSCCRRIIPPTTIIOONN + Since MudOS appropriately provides no security for this + efun, the mudlib must decide what security it wants in an + efun override. + + LLOOCCAATTIIOONN + /secure/SimulEfun/SimulEfun.c + + SSEEEE AALLSSOO + the _e_x_e_c_(_) efun + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/false ds2.0r27/lib/doc/sefun/false *** ds1.1/lib/doc/sefun/false Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/false Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,24 ---- + + FALSE(1) FALSE(1) + + NAME + false() - Always returns a 0. + + SYNOPSIS + int false() + + DESCRIPTION + This function is mostly just cosmetic. There are circumstances where + I feel wrong not having SOMETHING happen, so there is this. + + LOCATION + /secure/sefun/generic.c + + SEE ALSO + true() + + Author + Cratylus @ Dead Souls + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/file_exists ds2.0r27/lib/doc/sefun/file_exists *** ds1.1/lib/doc/sefun/file_exists Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/file_exists Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,25 ---- + + FILE_EXISTS(1) FILE_EXISTS(1) + + NNAAMMEE + _f_i_l_e___e_x_i_s_t_s_(_) - returns true if the string passed is a + file + + SSYYNNOOPPSSIISS + int file_exists(string str) + + DDEESSCCRRIIPPTTIIOONN + Allows you to test to see if a file by the name passed as + an argument exists. + + LLOOCCAATTIIOONN + /secure/SimulEfun/files.c + + SSEEEE AALLSSOO + _f_i_l_e___s_i_z_e_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/file_privs ds2.0r27/lib/doc/sefun/file_privs *** ds1.1/lib/doc/sefun/file_privs Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/file_privs Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,26 ---- + + FILE_PRIVS(1) FILE_PRIVS(1) + + NNAAMMEE + _f_i_l_e___p_r_i_v_s_(_) - returns the level of protection for a file + + SSYYNNOOPPSSIISS + string file_privs(string file) + + DDEESSCCRRIIPPTTIIOONN + Returns a string which represents the level of protection + which is enjoyed by the file. With the exception of use + objects, objects which derive from the file name passed + will also have access which at least matches these privs. + + LLOOCCAATTIIOONN + /secure/SimulEfun/security.c + + SSEEEE AALLSSOO + _m_e_m_b_e_r___g_r_o_u_p_(_), _u_n_g_u_a_r_d_e_d_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/first ds2.0r27/lib/doc/sefun/first *** ds1.1/lib/doc/sefun/first Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/first Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,25 ---- + + FIRST(1) FIRST(1) + + NAME + first() - Outputs the specified first N characters of a string. + + SYNOPSIS + string first(string str, int i) + + DESCRIPTION + Provided a string and integer i, it will return the first i + characters in the string. + + EXAMPLES + first("DeadSouls",4) returns "Dead" + first("platypus",1) returns "p" + + LOCATION + /secure/sefun/strings.c + + Author + Cratylus @ Dead Souls + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/first_string_element ds2.0r27/lib/doc/sefun/first_string_element *** ds1.1/lib/doc/sefun/first_string_element Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/first_string_element Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,33 ---- + + FIRST_STRING_ELEMENT(1) FIRST_STRING_ELEMENT(1) + + NAME + first_string_element() - Extracts the contents of a string before a delimiter. + + SYNOPSIS + string first_string_element(string path, string delimiter, int stripfirst) + + DESCRIPTION + Pretty much just tries to figure out what the top-level subdirectory + is of a file. It can be used with delimiters other than "/" if need be. If + used with a full pathname, the "stripfirst" flag should be set. If you don't + set the stripfirst flag and your string's first character is a delimiter, it + will return a null string. + + EXAMPLES + first_string_element("/realms/cratylus/workroom.c","/",1) + + returns "realms". + + + LOCATION + /secure/sefun/strings.c + + SEE ALSO + last_string_element + + Author + Cratylus @ Dead Souls + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/flat_map ds2.0r27/lib/doc/sefun/flat_map *** ds1.1/lib/doc/sefun/flat_map Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/flat_map Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,30 ---- + + FLAT_MAP(1) FLAT_MAP(1) + + NAME + flat_map() - returns a string that describes the contents of a mapping. + + SYNOPSIS + string flat_map(mapping mp) + + DESCRIPTION + Each member of an array is read and to a limited degree it + is stringified and returned. This efun is of limited use and is being + kept for historical and sentimental reasons only. The identify() sefun + is the preferred method for stringifying mappings. + + EXAMPLES + flat_map(this_user()->GetSkill("bargaining")) + + + LOCATION + /secure/sefun/mappings.c + + SEE ALSO + identify() + + Author + Cratylus @ Dead Souls + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/format_page ds2.0r27/lib/doc/sefun/format_page *** ds1.1/lib/doc/sefun/format_page Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/format_page Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,39 ---- + + FORMAT_PAGE(1) FORMAT_PAGE(1) + + NNAAMMEE + _f_o_r_m_a_t___p_a_g_e_(_) - returns a string of formatted columns from + an array + + SSYYNNOOPPSSIISS + string format_page(string *items, int columns) + + DDEESSCCRRIIPPTTIIOONN + Given an array of strings and a number of columns as + arguments, this function formats the array into a single + string with the elements put into the number of columns + specified. Unfortunately, as this SimulEfun predates + Nightmare terminal support, this SimulEfun only supports + 80 character screen widths. + + EEXXAAMMPPLLEESS + format_page(({ "house", "car", "cat", "mouse", "dog" }), + 3) returns "house car + cat + mouse dog" + + NNOOTTEESS + This SimulEfun is pretty much out of date and useless for + new uses. + + LLOOCCAATTIIOONN + /secure/SimulEfun/strings.c + + SSEEEE AALLSSOO + _a_r_r_a_n_g_e___s_t_r_i_n_g_(_), _c_e_n_t_e_r_(_), _f_o_r_m_a_t___s_t_r_i_n_g_(_), _w_r_a_p_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/format_string ds2.0r27/lib/doc/sefun/format_string *** ds1.1/lib/doc/sefun/format_string Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/format_string Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,25 ---- + + FORMAT_STRING(1) FORMAT_STRING(1) + + NNAAMMEE + _f_o_r_m_a_t___s_t_r_i_n_g_(_) - returns a formatted string like + _s_p_r_i_n_t_f_(_) + + SSYYNNOOPPSSIISS + string format_string(string format, mixed *variables) + + DDEESSCCRRIIPPTTIIOONN + Boggle me why this exists. It comes from the Portals + Mudlib, so I must have brought it over when sockets first + came out so the example code would not break. Don't use + it, it is slow and pointless. + + SSEEEE AALLSSOO + _a_r_r_a_n_g_e___s_t_r_i_n_g_(_), _c_e_n_t_e_r_(_), _f_o_r_m_a_t___p_a_g_e_(_), _p_r_i_n_t_f_(_), + _s_p_r_i_n_t_f_(_), _w_r_a_p_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/generate_tmp ds2.0r27/lib/doc/sefun/generate_tmp *** ds1.1/lib/doc/sefun/generate_tmp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/generate_tmp Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,30 ---- + + GENERATE_TMP(1) GENERATE_TMP(1) + + NAME + generate_tmp() - Create a unique temp filename. + + SYNOPSIS + varargs string generate_tmp(mixed arg) + + DESCRIPTION + If the user has a home directory, the function tries + to use their tmp/ dir, otherwise /open is used. The filename is + generated by using the arguments, if any, and adding them to + ctime plus some random characters for good measure. + + EXAMPLES + generate_tmp(this_player()) returns "/realms/cratylus/tmp/cratylus80irhLDFd7sWg1140052843.c" + + + LOCATION + /secure/sefun/strings.c + + SEE ALSO + + + Author + Cratylus @ Dead Souls + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/get_cmds ds2.0r27/lib/doc/sefun/get_cmds *** ds1.1/lib/doc/sefun/get_cmds Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/get_cmds Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,23 ---- + + GET_CMDS(1) GET_CMDS(1) + + NAME + get_cmds() - Returns a list of available commands. + + SYNOPSIS + string *get_cmds() + + DESCRIPTION + Provides an array of available commands in /cmds and /secure/cmds. + + LOCATION + /secure/sefun/get_cmds.c + + SEE ALSO + get_cmds() + + Author + Cratylus @ Dead Souls + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/get_livings ds2.0r27/lib/doc/sefun/get_livings *** ds1.1/lib/doc/sefun/get_livings Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/get_livings Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,27 ---- + + GET_LIVINGS(1) GET_LIVINGS(1) + + NAME + get_livings() - Lists living things in a container. + + SYNOPSIS + varargs object array get_livings(object container, int foo) + + DESCRIPTION + Without a second argument, a list of all living things in + "container" is returned in array form. If the second argument is the + integer 1, only interactive living things (players and creators) are + returned. If the integer is 2, only non-interactive living things are + returned. + + EXAMPLES + get_livings(environment(this_player()), 1) + + LOCATION + /secure/sefun/get_livings.c + + Author + Cratylus @ Dead Souls + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/get_object ds2.0r27/lib/doc/sefun/get_object *** ds1.1/lib/doc/sefun/get_object Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/get_object Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,27 ---- + + GET_STD_ITEM(1) GET_OBJECT(1) + + NNAAMMEE + _g_e_t___o_b_j_e_c_t_(_) - returns an object represented by a string + + SSYYNNOOPPSSIISS + varargs object get_object(string str, object player) + + DDEESSCCRRIIPPTTIIOONN + Returns an object which is represented by the string + passed as the first argument. If the second argument is + given, the string is resolved with respect to that player + object. Otherwise the string is resolved with respect to + the value of _t_h_i_s___p_l_a_y_e_r_(_). + + LLOOCCAATTIIOONN + /secure/SimulEfun/get_object.c + + SSEEEE AALLSSOO + _f_i_n_d___o_b_j_e_c_t_(_), _g_e_t___o_b_j_e_c_t_s_(_), _l_o_a_d___o_b_j_e_c_t_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/get_random_living ds2.0r27/lib/doc/sefun/get_random_living *** ds1.1/lib/doc/sefun/get_random_living Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/get_random_living Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,28 ---- + + GET_RANDOM_LIVING(1) GET_RANDOM_LIVING(1) + + NAME + get_random_livings() - Randomly picks a living thing in a container. + + SYNOPSIS + varargs object get_random_living(object container, int foo) + + DESCRIPTION + Without a second argument, a living creature in the "container" + is selected at random. If the second argument is the integer 1, only + interactive living things are eligible for the selection. If the + integer is 2, only non-interactive living things are eligible for the + selection. + + + EXAMPLES + get_random_living(environment(this_player()), 1) + + LOCATION + /secure/sefun/get_livings.c + + Author + Cratylus @ Dead Souls + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/get_verbs ds2.0r27/lib/doc/sefun/get_verbs *** ds1.1/lib/doc/sefun/get_verbs Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/get_verbs Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,23 ---- + + GET_VERBS(1) GET_VERBS(1) + + NAME + get_verbs() - Returns a list of available verbs. + + SYNOPSIS + string *get_verbs() + + DESCRIPTION + Provides an array of files in the /verbs/* directories. + + LOCATION + /secure/sefun/get_verbs.c + + SEE ALSO + get_cmds() + + Author + Cratylus @ Dead Souls + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/grepp ds2.0r27/lib/doc/sefun/grepp *** ds1.1/lib/doc/sefun/grepp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/grepp Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,30 ---- + + GREPP(1) GREPP(1) + + NAME + grepp() - Whether a given substring is in a string. + + SYNOPSIS + grepp(string primary, string sub) + + DESCRIPTION + If sub is a member of primary, returns 1. Otherwise, returns 0. It + is basically a prettification of strsrch, which is the preferred way + of doing it. This sefun is much more expensive to use than the strsrch + efun, but it's easier to read. + + EXAMPLES + grepp("foo, barbaz", "baz") would return 1 + grepp("foo, barbaz", "shiz") would return 0 + + SEE ALSO + strsrch + + + LOCATION + /secure/sefun/strings.c + + Author + Cratylus @ Dead Souls + + 1 diff -c -r --new-file ds1.1/lib/doc/sefun/hiddenp ds2.0r27/lib/doc/sefun/hiddenp *** ds1.1/lib/doc/sefun/hiddenp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/hiddenp Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,21 ---- + + HIDDENP(1) HIDDENP(1) + + NNAAMMEE + _h_i_d_d_e_n_p_(_) - returns true if the object is hidden + + SSYYNNOOPPSSIISS + int hiddenp(object ob) + + DDEESSCCRRIIPPTTIIOONN + Takes an object as an argument and returns true if that + object is hidden. + + LLOOCCAATTIIOONN + /secure/SimulEfun/pointers.c + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/high_mortalp ds2.0r27/lib/doc/sefun/high_mortalp *** ds1.1/lib/doc/sefun/high_mortalp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/high_mortalp Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,26 ---- + + HIGH_MORTALP(1) HIGH_MORTALP(1) + + NNAAMMEE + _h_i_g_h___m_o_r_t_a_l_p_(_) - returns true if the player in question is + high mortal + + =head1 SYNOPSIS + + int high_mortalp(object ob) + + DDEESSCCRRIIPPTTIIOONN + Given an object, this function will return true if that + object is a high mortal. + + LLOOCCAATTIIOONN + /secure/SimulEfun/pointers.c + + SSEEEE AALLSSOO + _a_m_b_a_s_s_a_d_o_r_p_(_), _a_r_c_h_p_(_), _l_e_a_d_e_r_p_(_), _u_s_e_r_p_(_), _w_i_z_a_r_d_p_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/hour ds2.0r27/lib/doc/sefun/hour *** ds1.1/lib/doc/sefun/hour Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/hour Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,27 ---- + + HOUR(1) HOUR(1) + + NNAAMMEE + _h_o_u_r_(_) - returns the hour at the time given + + SSYYNNOOPPSSIISS + int hour(int x) + + DDEESSCCRRIIPPTTIIOONN + Given a time integer as an argument, this function returns + what hour of the day that time represents in MUD time. + + EEXXAAMMPPLLEESS + +o _h_o_u_r(_t_i_m_e_(_)) returns at this moment 5 + + LLOOCCAATTIIOONN + /secure/SimulEfun/time.c + + SSEEEE AALLSSOO + _d_a_t_e_(_), _d_a_y_(_), _m_i_n_u_t_e_s_(_), _m_o_n_t_h_(_), _q_u_e_r_y___n_i_g_h_t_(_), _y_e_a_r_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/identify ds2.0r27/lib/doc/sefun/identify *** ds1.1/lib/doc/sefun/identify Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/identify Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,28 ---- + + IDENTIFY(1) IDENTIFY(1) + + NNAAMMEE + _i_d_e_n_t_i_f_y_(_) - returns a string version of any data type + + SSYYNNOOPPSSIISS + string identify(mixed a) + + DDEESSCCRRIIPPTTIIOONN + Given any argument passed, this function will return a + string which represents that argument. + + EEXXAAMMPPLLEESS + _i_d_e_n_t_i_f_y(_t_h_i_s___p_l_a_y_e_r_(_)) returns OBJ("descartes", + "/secure/save/users/d/descartes") + + LLOOCCAATTIIOONN + /secure/SimulEfun/identify.c + + SSEEEE AALLSSOO + _s_p_r_i_n_t_f_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/indent_file ds2.0r27/lib/doc/sefun/indent_file *** ds1.1/lib/doc/sefun/indent_file Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/indent_file Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,27 ---- + + INDENT_FILE(1) INDENT_FILE(1) + + NAME + indent_file() - Make a file more readable. + + SYNOPSIS + int indent_file(string file) + + DESCRIPTION + Provided a filename, it makes a temporary copy, indents the copy, + then copies the indented version over the original. + + EXAMPLES + indent_file("/home/cratylus/workroom") + + LOCATION + /secure/sefun/files.c + + SEE ALSO + save_file, file_exists, directory exists + + Author + Cratylus @ Dead Souls + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/last ds2.0r27/lib/doc/sefun/last *** ds1.1/lib/doc/sefun/last Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/last Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,28 ---- + + LAST(1) LAST(1) + + NAME + last() - Outputs the specified last N characters of a string. + + SYNOPSIS + string last(string str, int i, int significant) + + DESCRIPTION + Provided a string and integer i, it will + return the last i characters in the string. If the + "significant" flag is set, blank spaces at the end + of the string are ignored. + + EXAMPLES + last("platypus",3) returns "pus" + last("echidna ",1) returns " " + last("sassafras ",2,1) returns "as" + + LOCATION + /secure/sefun/strings.c + + Author + Cratylus @ Dead Souls + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/last_string_element ds2.0r27/lib/doc/sefun/last_string_element *** ds1.1/lib/doc/sefun/last_string_element Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/last_string_element Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,29 ---- + + LAST_STRING_ELEMENT(1) LAST_STRING_ELEMENT(1) + + NAME + last_string_element() - Extracts the contents of a string after the last delimiter. + + SYNOPSIS + string last_string_element(string path, string delimiter) + + DESCRIPTION + The opposite of first_string_element, this function returns the end of + a string after the last delimiter. + + EXAMPLES + last_string_element("/realms/cratylus/workroom.c","/") + + returns "workroom.c". + + LOCATION + /secure/sefun/strings.c + + SEE ALSO + first_string_element + + Author + Cratylus @ Dead Souls + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/leaderp ds2.0r27/lib/doc/sefun/leaderp *** ds1.1/lib/doc/sefun/leaderp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/leaderp Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,25 ---- + + LEADERP(1) LEADERP(1) + + NNAAMMEE + _l_e_a_d_e_r_p_(_) - returns true if the player is an elected + leader + + SSYYNNOOPPSSIISS + int leaderp(object ob) + + DDEESSCCRRIIPPTTIIOONN + Given an object as an argument, _l_e_a_d_e_r_p_(_) will return true + if that player is an elected leader. + + LLOOCCAATTIIOONN + /secure/SimulEfun/pointers.c + + SSEEEE AALLSSOO + _a_m_b_a_s_s_a_d_o_r_p_(_), _a_r_c_h_p_(_), _h_i_g_h___m_o_r_t_a_l_p_(_), _u_s_e_r_p_(_), _w_i_z_a_r_d_p_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/livings ds2.0r27/lib/doc/sefun/livings *** ds1.1/lib/doc/sefun/livings Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/livings Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,25 ---- + + LIVINGS(1) LIVINGS(1) + + NNAAMMEE + _l_i_v_i_n_g_s_(_) - returns an array of all living objects + + SSYYNNOOPPSSIISS + object *_l_i_v_i_n_g_s_(_) + + DDEESSCCRRIIPPTTIIOONN + A security mask for the _l_i_v_i_n_g_s_(_) efun. Filters out + hidden objects for non-priveledged objects making the + call. + + LLOOCCAATTIIOONN + /secure/SimulEfun/SimulEfun.c + + SSEEEE AALLSSOO + the _l_i_v_i_n_g_s_(_) efun + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/load_object ds2.0r27/lib/doc/sefun/load_object *** ds1.1/lib/doc/sefun/load_object Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/load_object Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,26 ---- + + LOAD_STD_ITEM(1) LOAD_OBJECT(1) + + NNAAMMEE + _l_o_a_d___o_b_j_e_c_t_(_) - returns an object, loads it if not already + loaded + + SSYYNNOOPPSSIISS + object load_object(string str) + + DDEESSCCRRIIPPTTIIOONN + Much like the _f_i_n_d___o_b_j_e_c_t_(_) efun, this SimulEfun will try + to load the object in question if it is unable to find one + already loaded. + + LLOOCCAATTIIOONN + /secure/SimulEfun/load_object.c + + SSEEEE AALLSSOO + _f_i_n_d___o_b_j_e_c_t_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/local_time ds2.0r27/lib/doc/sefun/local_time *** ds1.1/lib/doc/sefun/local_time Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/local_time Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,27 ---- + + LOCAL_TIME(1) LOCAL_TIME(1) + + NAME + local_time() - Provides information about the time of day. + + SYNOPSIS + string local_time(string str) + + DESCRIPTION + Without an argument, local_time() returns an array in the + format of the localtime() efun with information about the local time + in the current timezone. With a valid timezone as an argument, it + returns a string in the format of ctime() with the local time for + the specified timezone. + + EXAMPLES + local_time("PST") + + LOCATION + /secure/sefun/local_time.c + + Author + Cratylus @ Dead Souls + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/log_file ds2.0r27/lib/doc/sefun/log_file *** ds1.1/lib/doc/sefun/log_file Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/log_file Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,27 ---- + + LOG_FILE(1) LOG_FILE(1) + + NNAAMMEE + _l_o_g___f_i_l_e_(_) - logs a string to a file + + SSYYNNOOPPSSIISS + void log_file(string fl, string msg) + + DDEESSCCRRIIPPTTIIOONN + Will write the string passed as the second argument to the + file passed as the second argument under the log + directory. If the object doing the logging is not an + approved secure object, then the log goes under the etc + sub-directory of the log directory. + + LLOOCCAATTIIOONN + /secure/SimulEfun/log_file.c + + SSEEEE AALLSSOO + _r_e_a_d___f_i_l_e_(_), _w_r_i_t_e___f_i_l_e_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/member_group ds2.0r27/lib/doc/sefun/member_group *** ds1.1/lib/doc/sefun/member_group Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/member_group Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,33 ---- + + MEMBER_GROUP(1) MEMBER_GROUP(1) + + NNAAMMEE + _m_e_m_b_e_r___g_r_o_u_p_(_) - returns true if a person is a member of + the group passed + + SSYYNNOOPPSSIISS + int member_group(string|object who, string grp) + + DDEESSCCRRIIPPTTIIOONN + The first argument, either a user object or the name of a + user, is tested to see if the user is a member of the + group which goes by the name passed as the second + argument. If the user is a member of that group, then the + function returns true. Otherwise the function will return + false. + + EEXXAAMMPPLLEESS + +o member_group("descartes", "SUPERUSER") would return + true on Nightmare LPMud + + LLOOCCAATTIIOONN + /secure/SimulEfun/security.c + + SSEEEE AALLSSOO + _f_i_l_e___p_r_i_v_s_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/memberp ds2.0r27/lib/doc/sefun/memberp *** ds1.1/lib/doc/sefun/memberp Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/memberp Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,27 ---- + + MEMBERP(1) MEMBERP(1) + + NAME + memberp() - Determines whether a thing is a member of an array. + + SYNOPSIS + int memberp(mixed *primary, mixed sub) + + DESCRIPTION + If sub is a member of primary, returns 1. Otherwise, returns 0. It + is basically a prettification of member_array, which is the preferred way + of doing it. This sefun is much more expensive to use than the member_array + efun, but it's easier to read. + + EXAMPLES + memberp(({"foo","bar","baz"}), "baz") would return 1 + memberp(({"foo","bar","baz"}), "shiz") would return 0 + + + LOCATION + /secure/sefun/strings.c + + Author + Cratylus @ Dead Souls + + 1 diff -c -r --new-file ds1.1/lib/doc/sefun/minutes ds2.0r27/lib/doc/sefun/minutes *** ds1.1/lib/doc/sefun/minutes Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/minutes Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,29 ---- + + MINUTES(1) MINUTES(1) + + NNAAMMEE + _m_i_n_u_t_e_s_(_) - returns the number of minutes past the MUD + hour + + SSYYNNOOPPSSIISS + int minutes(int x) + + DDEESSCCRRIIPPTTIIOONN + Given an integer time as an argument, this function will + return the number of minutes past the hour at the time + which was given. + + EEXXAAMMPPLLEESS + +o _m_i_n_u_t_e_s(_t_i_m_e_(_)) at this moment returns 19 + + LLOOCCAAIITTOONN + /secure/SimulEfun/time.c + + SSEEEE AALLSSOO + _d_a_t_e_(_), _d_a_y_(_), _h_o_u_r_(_), _m_o_n_t_h_(_), _q_u_e_r_y___n_i_g_h_t_(_), _y_e_a_r_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/month ds2.0r27/lib/doc/sefun/month *** ds1.1/lib/doc/sefun/month Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/month Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,27 ---- + + MONTH(1) MONTH(1) + + NNAAMMEE + _m_o_n_t_h_(_) - returns the name of the month at a given time + + SSYYNNOOPPSSIISS + string month(int x) + + DDEESSCCRRIIPPTTIIOONN + Given an integer formatted time, this function will return + the name of the month in MUD time for that time. + + EEXXAAMMPPLLEESS + +o _m_o_n_t_h(_t_i_m_e_(_)) this moment returns "Altki" + + LLOOCCAATTIIOONN + /secure/SimulEfun/time.c + + SSEEEE AALLSSOO + _d_a_t_e_(_), _d_a_y_(_), _h_o_u_r_(_), _m_i_n_u_t_e_s_(_), _q_u_e_r_y___n_i_g_h_t_(_), _y_e_a_r_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/moon_light ds2.0r27/lib/doc/sefun/moon_light *** ds1.1/lib/doc/sefun/moon_light Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/moon_light Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,27 ---- + + MOON_LIGHT(1) MOON_LIGHT(1) + + NNAAMMEE + _m_o_o_n___l_i_g_h_t_(_) - returns the amount of light the moons are + providing + + SSYYNNOOPPSSIISS + int _m_o_o_n___l_i_g_h_t_(_) + + DDEESSCCRRIIPPTTIIOONN + Since moons necessarily reflect different levels of light + for their different phases, this function will return the + total amount of light currently being reflected by all + moons. + + LLOOCCAATTIIOONN + /secure/SimulEfun/light.c + + SSEEEE AALLSSOO + _e_f_f_e_c_t_i_v_e___l_i_g_h_t_(_), _t_o_t_a_l___l_i_g_h_t_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/mud_currencies ds2.0r27/lib/doc/sefun/mud_currencies *** ds1.1/lib/doc/sefun/mud_currencies Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/mud_currencies Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,24 ---- + + MUD_CURRENCIES(1) MUD_CURRENCIES(1) + + NNAAMMEE + _m_u_d___c_u_r_r_e_n_c_i_e_s_(_) - returns an array of all MUD currencies + + SSYYNNOOPPSSIISS + string *_m_u_d___c_u_r_r_e_n_c_i_e_s_(_) + + DDEESSCCRRIIPPTTIIOONN + Returns all currencies which exist on the MUD as an array. + + LLOOCCAATTIIOONN + /secure/SimulEfun/economy.c + + SSEEEE AALLSSOO + _c_u_r_r_e_n_c_y___i_n_f_l_a_t_i_o_n_(_), _c_u_r_r_e_n_c_y___m_a_s_s_(_), _c_u_r_r_e_n_c_y___r_a_t_e_(_), + _c_u_r_r_e_n_c_y___v_a_l_u_e_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/mud_name ds2.0r27/lib/doc/sefun/mud_name *** ds1.1/lib/doc/sefun/mud_name Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/mud_name Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,33 ---- + + MUD_NAME(1) MUD_NAME(1) + + NNAAMMEE + _m_u_d___n_a_m_e_(_) - returns the name of the MUD + + SSYYNNOOPPSSIISS + string _m_u_d___n_a_m_e_(_) + + DDEESSCCRRIIPPTTIIOONN + Returns the official name of the MUD. This information is + taken from the driver config file. + + NNOOTTEESS + If you are pretty stable with your MUD's name, then you + really do not need to use this function. It is used + through the mudlib, since the mudlib may be used on many + MUDs. Using this once your MUD is relatively stable will + server to slow things down when you do not need the + flexibility. + + LLOOCCAATTIIOONN + /secure/SimulEfun/mud_info.c + + SSEEEE AALLSSOO + _a_r_c_h_i_t_e_c_t_u_r_e_(_), _m_u_d_l_i_b_(_), _m_u_d_l_i_b___v_e_r_s_i_o_n_(_), + _q_u_e_r_y___h_o_s_t___p_o_r_t_(_), _v_e_r_s_i_o_n_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/mudlib ds2.0r27/lib/doc/sefun/mudlib *** ds1.1/lib/doc/sefun/mudlib Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/mudlib Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,26 ---- + + MUDLIB(1) MUDLIB(1) + + NNAAMMEE + _m_u_d_l_i_b_(_) - returns the name of the mudlib + + SSYYNNOOPPSSIISS + string _m_u_d_l_i_b_(_) + + DDEESSCCRRIIPPTTIIOONN + If you are using this documentation, then this function + should return the string "Nightmare", unless, of course, + you are claiming the work of others as your own? + + LLOOCCAATTIIOONN + /secure/SimulEfun/mud_info.c + + SSEEEE AALLSSOO + _a_r_c_h_i_t_e_c_t_u_r_e_(_), _m_u_d___n_a_m_e_(_), _m_u_d_l_i_b___v_e_r_s_i_o_n_(_), + _q_u_e_r_y___h_o_s_t___p_o_r_t_(_), _v_e_r_s_i_o_n_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/mudlib_version ds2.0r27/lib/doc/sefun/mudlib_version *** ds1.1/lib/doc/sefun/mudlib_version Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/mudlib_version Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,31 ---- + + MUDLIB_VERSION(1) MUDLIB_VERSION(1) + + NNAAMMEE + _m_u_d_l_i_b___v_e_r_s_i_o_n_(_) - returns the current version of this + mudlib + + SSYYNNOOPPSSIISS + string _m_u_d_l_i_b___v_e_r_s_i_o_n_(_) + + DDEESSCCRRIIPPTTIIOONN + Returns the currenct version of the mudlib you are using. + If you have made local modifications to the mudlib, you + should change this definition in /secure/include/config.h + to reflect your deviation. + + EEXXAAMMPPLLEESS + +o _m_u_d_l_i_b___v_e_r_s_i_o_n_(_) as of this document will return "3.3" + + LLOOCCAATTIIOONN + /secure/SimulEfun/mud_info.c + + SSEEEE AALLSSOO + _a_r_c_h_i_t_e_c_t_u_r_e_(_), _m_u_d___n_a_m_e_(_), _m_u_d_l_i_b_(_), _q_u_e_r_y___h_o_s_t___p_o_r_t_(_), + _v_e_r_s_i_o_n_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/nominative ds2.0r27/lib/doc/sefun/nominative *** ds1.1/lib/doc/sefun/nominative Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/nominative Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,31 ---- + + NOMINATIVE(1) NOMINATIVE(1) + + NNAAMMEE + _n_o_m_i_n_a_t_i_v_e_(_) - returns the nominative pronoun for an + object + + SSYYNNOOPPSSIISS + string nominative(string|object val) + + DDEESSCCRRIIPPTTIIOONN + This function takes either a string representing the + gender of a living object or a living object as an + argument. It returns the nominative pronoun ("he", "she", + or "it") depending on the gender. + + EEXXAAMMPPLLEESS + _n_o_m_i_n_a_t_i_v_e(_t_h_i_s___p_l_a_y_e_r_(_)) returns "he" for me, at least on + Nightmare. + + LLOOCCAATTIIOONN + /secure/SimulEfun/english.c + + SSEEEE AALLSSOO + _o_b_j_e_c_t_i_v_e_(_), _p_o_s_s_e_s_s_i_v_e_(_), _p_o_s_s_e_s_s_i_v_e___n_o_u_n_(_), _r_e_f_l_e_x_i_v_e_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/objective ds2.0r27/lib/doc/sefun/objective *** ds1.1/lib/doc/sefun/objective Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/objective Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,30 ---- + + STD_ITEMIVE(1) OBJECTIVE(1) + + NNAAMMEE + _o_b_j_e_c_t_i_v_e_(_) - returns the objective pronoun for a gender + + SSYYNNOOPPSSIISS + string objective(string|object val) + + DDEESSCCRRIIPPTTIIOONN + Given an object or a gender string, this function will + return the appropriate objective pronoun ("him", "her", or + "it") for the gender passed, or for the gender of the + object in question. + + EEXXAAMMPPLLEESS + _o_b_j_e_c_t_i_v_e(find_player("lassondra")) returns "her" + + head1 LOCATION + + /secure/SimulEfun/english.c + + SSEEEE AALLSSOO + _n_o_m_i_n_a_t_i_v_e_(_), _p_o_s_s_e_s_s_i_v_e_(_), _p_o_s_s_e_s_s_i_v_e___n_o_u_n_(_), _r_e_f_l_e_x_i_v_e_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/ordinal ds2.0r27/lib/doc/sefun/ordinal *** ds1.1/lib/doc/sefun/ordinal Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/ordinal Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,27 ---- + + ORDINAL(1) ORDINAL(1) + + NNAAMMEE + _o_r_d_i_n_a_l_(_) - returns the ordinal suffix for a number + + SSYYNNOOPPSSIISS + string ordinal(int x) + + DDEESSCCRRIIPPTTIIOONN + Given an integer, this function returns the ordinal suffix + for the number. + + EEXXAAMMPPLLEESS + +o _o_r_d_i_n_a_l(7) returns "th" + + LLOOCCAATTIIOONN + /secure/SimulEfun/english.c + + SSEEEE AALLSSOO + _c_a_r_d_i_n_a_l_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/path_file ds2.0r27/lib/doc/sefun/path_file *** ds1.1/lib/doc/sefun/path_file Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/path_file Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,31 ---- + + PATH_FILE(1) PATH_FILE(1) + + NNAAMMEE + _p_a_t_h___f_i_l_e_(_) - returns an array of files associated with an + array of files + + SSYYNNOOPPSSIISS + mixed *path_file(string|string * full_path) + + DDEESSCCRRIIPPTTIIOONN + Given a path or an array of paths, this function separates + the file name from its path and returns an array with them + separated, or an array of such arrays in the event the + argument passed is an array. + + EEXXAAMMPPLLEESS + +o _p_a_t_h___f_i_l_e("/secure/cfg/write.cfg") returns ({ + "/secure/cfg", "write.cfg" }) + + LLOOCCAATTIIOONN + /secure/SimulEfun/path_file.c + + SSEEEE AALLSSOO + _a_b_s_o_l_u_t_e___p_a_t_h_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/path_prefix ds2.0r27/lib/doc/sefun/path_prefix *** ds1.1/lib/doc/sefun/path_prefix Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/path_prefix Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,26 ---- + + PATH_PREFIX(1) CHECK_PRIVS(1) + + NAME + path_prefix() - A file's or directory's path without the last element. + + SYNOPSIS + string path_prefix(string filename) + + DESCRIPTION + If given a path, it returns a string with the last path element removed. + + EXAMPLES + path_prefix("/realms/cratylus/workroom.c") + + would return "/realms/cratylus" + + + LOCATION + /secure/sefun/strings.c + + Author + Cratylus @ Dead Souls + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/percent ds2.0r27/lib/doc/sefun/percent *** ds1.1/lib/doc/sefun/percent Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/percent Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,28 ---- + + PERCENT(1) PERCENT(1) + + NNAAMMEE + _p_e_r_c_e_n_t_(_) - returns the percent of one number that another + is + + SSYYNNOOPPSSIISS + float percent(int|float numerator, int|float denominator) + + DDEESSCCRRIIPPTTIIOONN + Returns what percent of the second argument that the first + argument is. + + EEXXAAMMPPLLEESS + +o percent(23, 99) returns 23.232323 + + LLOOCCAATTIIOONN + /secure/SimulEfun/percent.c + + SSEEEE AALLSSOO + _a_b_s_o_l_u_t_e___v_a_l_u_e_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/pluralize ds2.0r27/lib/doc/sefun/pluralize *** ds1.1/lib/doc/sefun/pluralize Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/pluralize Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,31 ---- + + PLURALIZE(1) PLURALIZE(1) + + NNAAMMEE + _p_l_u_r_a_l_i_z_e_(_) - returns the plural of a string or an object + + SSYYNNOOPPSSIISS + string pluralize(string|object single) + + DDEESSCCRRIIPPTTIIOONN + Given a string, this function will return its pluralized + for. Given an object, this function will returnthe plural + of its short description. + + EEXXAAMMPPLLEESS + +o _p_l_u_r_a_l_i_z_e("frog") returns "frogs" + + +o pluralize("a globe of frogs") returns "globes of + frogs" + + LLOOCCAATTIIOONN + /secure/SimulEfun/english.c + + SSEEEE AALLSSOO + _c_o_n_s_o_l_i_d_a_t_e_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/possessive ds2.0r27/lib/doc/sefun/possessive *** ds1.1/lib/doc/sefun/possessive Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/possessive Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,28 ---- + + POSSESSIVE(1) POSSESSIVE(1) + + NNAAMMEE + _p_o_s_s_e_s_s_i_v_e_(_) - returns the possessive pronoun for a gender + + SSYYNNOOPPSSIISS + string possessive(mixed val) + + DDEESSCCRRIIPPTTIIOONN + Given a string or an object as an argument, this function + will return the appropriate possessive pronoun ("his", + "her", or "its") for the gender in question. + + EEXXAAMMPPLLEESS + +o _p_o_s_s_e_s_s_i_v_e(find_living("plant")) returns "its" + + LLOOCCAATTIIOONN + /secure/SimulEfun/english.c + + SSEEEE AALLSSOO + _n_o_m_i_n_a_t_i_v_e_(_), _o_b_j_e_c_t_i_v_e_(_), _p_o_s_s_e_s_s_i_v_e___n_o_u_n_(_), _r_e_f_l_e_x_i_v_e_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/possessive_noun ds2.0r27/lib/doc/sefun/possessive_noun *** ds1.1/lib/doc/sefun/possessive_noun Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/possessive_noun Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,28 ---- + + POSSESSIVE_NOUN(1) POSSESSIVE_NOUN(1) + + NNAAMMEE + _p_o_s_s_e_s_s_i_v_e___n_o_u_n_(_) - returns the possessive form of a noun + + SSYYNNOOPPSSIISS + string possessive_noun(string|object val) + + DDEESSCCRRIIPPTTIIOONN + Given a string, this function will return the possessive + form of it. Given an object, it will return the + possessive form of that object's short description. + + EEXXAAMMPPLLEESS + +o _p_o_s_s_e_s_s_i_v_e___n_o_u_n("Descartes") returns "Descartes'" + + LLOOCCAATTIIOONN + /secure/SimulEfun/english.c + + SSEEEE AALLSSOO + _n_o_m_i_n_a_t_i_v_e_(_), _o_b_j_e_c_t_i_v_e_(_), _p_o_s_s_e_s_s_i_v_e_(_), _r_e_f_l_e_x_i_v_e_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/query_host_port ds2.0r27/lib/doc/sefun/query_host_port *** ds1.1/lib/doc/sefun/query_host_port Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/query_host_port Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,24 ---- + + QUERY_HOST_PORT(1) QUERY_HOST_PORT(1) + + NNAAMMEE + _q_u_e_r_y___h_o_s_t___p_o_r_t_(_) - returns the port on which the MUD runs + + SSYYNNOOPPSSIISS + int _q_u_e_r_y___h_o_s_t___p_o_r_t_(_) + + DDEESSCCRRIIPPTTIIOONN + Returns the port to which people telnet to access the MUD. + + LLOOCCAATTIIOONN + /secure/SimulEfun/mud_info.c + + SSEEEE AALLSSOO + _a_r_c_h_i_t_e_c_t_u_r_e_(_), _m_u_d___n_a_m_e_(_), _m_u_d_l_i_b_(_), _m_u_d_l_i_b___v_e_r_s_i_o_n_(_), + _v_e_r_s_i_o_n_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/query_night ds2.0r27/lib/doc/sefun/query_night *** ds1.1/lib/doc/sefun/query_night Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/query_night Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,23 ---- + + QUERY_NIGHT(1) QUERY_NIGHT(1) + + NNAAMMEE + _q_u_e_r_y___n_i_g_h_t_(_) - returns true if it is night on the MUD + + SSYYNNOOPPSSIISS + int _q_u_e_r_y___n_i_g_h_t_(_) + + DDEESSCCRRIIPPTTIIOONN + Returns true if it is night on the MUD. + + LLOOCCAATTIIOONN + /secure/SimulEfun/time.c + + SSEEEE AALLSSOO + _d_a_t_e_(_), _d_a_y_(_), _h_o_u_r_(_), _m_i_n_u_t_e_s_(_), _m_o_n_t_h_(_), _y_e_a_r_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/query_snoop ds2.0r27/lib/doc/sefun/query_snoop *** ds1.1/lib/doc/sefun/query_snoop Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/query_snoop Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,26 ---- + + QUERY_SNOOP(1) QUERY_SNOOP(1) + + NNAAMMEE + _q_u_e_r_y___s_n_o_o_p_(_) - returns whoever is snooping an object + + SSYYNNOOPPSSIISS + object query_snoop(object snoopee) + + DDEESSCCRRIIPPTTIIOONN + Given a player as an argument, this function will return + the player object, if any, which is snooping the object + argument. This is an override of a MudOS efun to provide + some protection against global use. + + LLOOCCAATTIIOONN + /secure/SimulEfun/SimulEfun.c + + SSEEEE AALLSSOO + the _q_u_e_r_y___s_n_o_o_p_(_) efun + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/query_snooping ds2.0r27/lib/doc/sefun/query_snooping *** ds1.1/lib/doc/sefun/query_snooping Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/query_snooping Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,25 ---- + + QUERY_SNOOPING(1) QUERY_SNOOPING(1) + + NNAAMMEE + _q_u_e_r_y___s_n_o_o_p_i_n_g_(_) - returns the player being snooped + + SSYYNNOOPPSSIISS + object query_snooping(object ob) + + DDEESSCCRRIIPPTTIIOONN + An override of the MudOS efun for security reasons. This + function will return the object which is being snooped by + the object passed as an argument. + + LLOOCCAATTIIOONN + /secure/SimulEfun/SimulEfun.c + + SSEEEE AALLSSOO + the _q_u_e_r_y___s_n_o_o_p_i_n_g_(_) efun + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/read_database ds2.0r27/lib/doc/sefun/read_database *** ds1.1/lib/doc/sefun/read_database Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/read_database Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,27 ---- + + READ_DATABASE(1) READ_DATABASE(1) + + NNAAMMEE + _r_e_a_d___d_a_t_a_b_a_s_e_(_) - returns an array of non-commented file + lines + + SSYYNNOOPPSSIISS + string *read_database(string file) + + DDEESSCCRRIIPPTTIIOONN + Given a file to read, this function will read the file and + return an array of lines without any comments or blank + lines. Commented lines start with a # sign. + + NNOOTTEESS + This function is an immensely inefficient way to handle + this. I must have been on drugs when I wrote it. + + LLOOCCAATTIIOONN + /secure/SimulEfun/read_database.c + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/reap_dummies ds2.0r27/lib/doc/sefun/reap_dummies *** ds1.1/lib/doc/sefun/reap_dummies Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/reap_dummies Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,25 ---- + + REAP_DUMMIES(1) REAP_DUMMIES(1) + + NAME + reap_dummies() - Destructs dummy objects without an environment. + + SYNOPSIS + void reap_dummies() + + DESCRIPTION + Early versions of Dead Souls were prone to memory leaks in the + form of dummy items failing to be destructed. The sefun is part of + the effort to address the symptoms of that issue. + + LOCATION + /secure/sefun/reaper.c + + SEE ALSO + reap_other(), reap_list() + + Author + Cratylus @ Dead Souls + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/reflexive ds2.0r27/lib/doc/sefun/reflexive *** ds1.1/lib/doc/sefun/reflexive Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/reflexive Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,31 ---- + + REFLEXIVE(1) REFLEXIVE(1) + + NNAAMMEE + _r_e_f_l_e_x_i_v_e_(_) - returns the reflexive pronoun for a gender + + SSYYNNOOPPSSIISS + string reflexive(string|object val) + + DDEESSCCRRIIPPTTIIOONN + This function returns a reflexive pronoun ("himself", + "herself", or "itself") based on the gender passed as the + first argument if the first argument is a string, or based + on the gender of the first argument if it is an object. + + EEXXAAMMPPLLEESS + +o _r_e_f_l_e_x_i_v_e(_t_h_i_s___p_l_a_y_e_r_(_)) returns "himself" for + Descartes + + LLOOCCAATTIIOONN + /secure/SimulEfun/english.c + + SSEEEE AALLSSOO + _n_o_m_i_n_a_t_i_v_e_(_), _o_b_j_e_c_t_i_v_e_(_), _p_o_s_s_e_s_s_i_v_e_(_), + _p_o_s_s_e_s_s_i_v_e___p_r_o_n_o_u_n_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/remove_matching_line ds2.0r27/lib/doc/sefun/remove_matching_line *** ds1.1/lib/doc/sefun/remove_matching_line Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/remove_matching_line Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,49 ---- + + REMOVE_MATCHING_LINE(1) REMOVE_MATCHING_LINE(1) + + NAME + remove_matching_line() - Focused string removal. + + SYNOPSIS + varargs mixed remove_matching_line(string target, string substring, int i, string exclude) + + DESCRIPTION + Like replace_matching_line, rather than keying on + newlines to determine where a line ends, this attempts + to parse the code to identify the entire LPC instruction. + Unlike replace_matching_line, this function only + deletes, it doesn't replace. + + target: This can be a string or a filename. If it is a filename, the + file will be read and treated as a string. + + substring: The string used to determine a match. + + i: Whether it should remove one matching line or all matching lines. + + exclude: If the line matches but it also contains this string, do not remove. + + + EXAMPLES + remove_matching_line("/realms/cratylus/workroom.c", "AddMeep", + "Balky"); + + This line would read my workroom into a string, and if it has a line + that contains "AddMeep" that *doesn't* contain "Balky", it will remove that line + from the string. + + NOTE: This will not change my workroom. It will return a string that I + can overwrite my workroom with, or that I can write to some other file. + + + LOCATION + /secure/sefun/strings.c + + SEE ALSO + write_file + + Author + Cratylus @ Dead Souls + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/remove_sky_event ds2.0r27/lib/doc/sefun/remove_sky_event *** ds1.1/lib/doc/sefun/remove_sky_event Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/remove_sky_event Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,28 ---- + + REMOVE_SKY_EVENT(1) REMOVE_SKY_EVENT(1) + + NNAAMMEE + _r_e_m_o_v_e___s_k_y___e_v_e_n_t_(_) - removes a sky event set up by + _a_d_d___s_k_y___e_v_e_n_t_(_) + + SSYYNNOOPPSSIISS + void remove_sky_event(function f) + + DDEESSCCRRIIPPTTIIOONN + Removes a sky event set up by the add_sky_event function. + + NNOOTTEESS + This function will not work under the new function pointer + structure. + + LLOOCCAATTIIOONN + /secure/SimulEfun/time.c + + SSEEEE AALLSSOO + _a_d_d___s_k_y___e_v_e_n_t_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/replace_line ds2.0r27/lib/doc/sefun/replace_line *** ds1.1/lib/doc/sefun/replace_line Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/replace_line Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,47 ---- + + REPLACE_LINE(1) REPLACE_LINE(1) + + NAME + replace_line() - Reads a string and replaces a line with substitute text. + + SYNOPSIS + string replace_line(string file, string *params, string repl) + + DESCRIPTION + Provided a string, search parameter(s), and replacement text, this + function finds every matching line and replaces it with the supplied substitution. + + EXAMPLES + replace_line(read_file("/realms/cratylus/workroom.c",({"Add","Monkey"}), + "SetFoo(\"Donkey\");") + + If my workroom contains the line: + + AddFoo("Monkey"); + + Then this function will return the full text of my workroom file, but + with the above string replaced by the one below: + + SetFoo("Donkey"); + + The line must match *all* of the parameters, or the replacement does not + occur. For example, the line: + + SetMoo("Monkey"); + + would be left unchanged, because it doesn't contain "Add". + + NOTE: This does not modify files. To do so, you'll need to use the output + of this funtion as the second argument in the write_file efun. + + LOCATION + /secure/sefun/strings.c + + SEE ALSO + + + Author + Cratylus @ Dead Souls + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/replace_matching_line ds2.0r27/lib/doc/sefun/replace_matching_line *** ds1.1/lib/doc/sefun/replace_matching_line Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/replace_matching_line Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,51 ---- + + REPLACE_MATCHING_LINE(1) REPLACE_MATCHING_LINE(1) + + NAME + replace_matching_line() - Focused string replacement. + + SYNOPSIS + varargs mixed replace_matching_line(string target, string substring, string replace, int i, string exclude) + + DESCRIPTION + This monstrosity is quite different from + replace_line. Rather than keying on + newlines to determine where a line ends, it attempts + to parse the code to identify + the entire LPC instruction. + + target: This can be a string or a filename. If it is a filename, the + file will be read and treated as a string. + + substring: The string used to determine a match. + + replace: The replacement line. + + i: Whether it should replace one matching line or all matching lines. + + exclude: If the line matches but it also contains this string, do not replace. + + + EXAMPLES + replace_matching_line("/realms/cratylus/workroom.c", "AddMeep", + "SetMeep(([\"feep\":\"Meepos\",\n\"meep\":\"Feepos\",\n]));", "Balky"); + + This line would read my workroom into a string, and if it has a line + that contains "AddMeep" that *doesn't* contain "Balky", it will remove that line + from the string and replace it with my SetMeep substitute. + + NOTE: This will not change my workroom. It will return a string that I + can overwrite my workroom with, or that I can write to some other file. + + + LOCATION + /secure/sefun/strings.c + + SEE ALSO + write_file + + Author + Cratylus @ Dead Souls + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/reverse_string ds2.0r27/lib/doc/sefun/reverse_string *** ds1.1/lib/doc/sefun/reverse_string Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/reverse_string Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,27 ---- + + REVERSE_STRING(1) REVERSE_STRING(1) + + NAME + reverse_string() - Reverses a string. + + SYNOPSIS + string reverse_string(string str) + + DESCRIPTION + Returns a string whose characters are arranged in a + manner inverse to the original string. + + EXAMPLES + reverse_string("MXLPLX") returns "XLPLXM" + + LOCATION + /secure/sefun/strings.c + + SEE ALSO + + + Author + Cratylus @ Dead Souls + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/say ds2.0r27/lib/doc/sefun/say *** ds1.1/lib/doc/sefun/say Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/say Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,35 ---- + + SAY(1) SAY(1) + + NNAAMMEE + _s_a_y_(_) - sends a message to objects in the same room as + command giver + + SSYYNNOOPPSSIISS + varargs void say(mixed str, object ob) + + DDEESSCCRRIIPPTTIIOONN + This function sends a message, the first argument, to all + users in the same room as the command giver other than the + command giver (_t_h_i_s___p_l_a_y_e_r_(_)). The message is sent as + message class "other_action". If a second argument is + given, that object is excluded from hearing the message. + + NNOOTTEESS + This is an override of the MudOS efun by the same name. + In order to be AMCP compliant, all messages need to go + through _r_e_c_e_i_v_e___m_e_s_s_a_g_e_(_). This function allows creators + to continuing using the oldstyle messaging while remaining + compliant. + + LLOOCCAATTIIOONN + /secure/SimulEfun/communications.c + + SSEEEE AALLSSOO + _m_e_s_s_a_g_e_(_), _w_r_i_t_e_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/season ds2.0r27/lib/doc/sefun/season *** ds1.1/lib/doc/sefun/season Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/season Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,25 ---- + + SEASON(1) SEASON(1) + + NNAAMMEE + _s_e_a_s_o_n_(_) - returns the season at a given time + + SSYYNNOOPPSSIISS + string season(int x) + + DDEESSCCRRIIPPTTIIOONN + Given an integer time, this function returns the name of + the season for that time. + + LLOOCCAATTIIOONN + /secure/SimulEfun/time.c + + SSEEEE AALLSSOO + _d_a_t_e_(_), _d_a_y_(_), _h_o_u_r_(_), _m_i_n_u_t_e_s_(_), _m_o_n_t_h_(_), _q_u_e_r_y___n_i_g_h_t_(_), + _y_e_a_r_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/set_eval_limit ds2.0r27/lib/doc/sefun/set_eval_limit *** ds1.1/lib/doc/sefun/set_eval_limit Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/set_eval_limit Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,26 ---- + + SET_EVAL_LIMIT(1) SET_EVAL_LIMIT(1) + + NNAAMMEE + _s_e_t___e_v_a_l___l_i_m_i_t_(_) - provides security for the + _s_e_t___e_v_a_l___l_i_m_i_t_(_) efun + + SSYYNNOOPPSSIISS + void set_eval_limit(int x) + + DDEESSCCRRIIPPTTIIOONN + The MudOS efun _s_e_t___e_v_a_l___l_i_m_i_t_(_) has no security, so the + mudlib needs to prevent objects from resetting the eval + limit. This override performs this function. + + LLOOCCAATTIIOONN + /secure/SimulEfun/SimulEfun.c + + SSEEEE AALLSSOO + the _s_e_t___e_v_a_l___l_i_m_i_t_(_) efun + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/set_privs ds2.0r27/lib/doc/sefun/set_privs *** ds1.1/lib/doc/sefun/set_privs Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/set_privs Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,21 ---- + + SET_PRIVS(1) SET_PRIVS(1) + + NNAAMMEE + _s_e_t___p_r_i_v_s_(_) - prevents anyone from using the _s_e_t___p_r_i_v_s_(_) + efun + + SSYYNNOOPPSSIISS + void set_privs(object ob, string str) + + DDEESSCCRRIIPPTTIIOONN + The Nightmare Mudlib security system does not allow for + setting of privs after object creation, so the MudOS efun + _s_e_t___p_r_i_v_s_(_) needs to be overriidden to prevent this from + happening. + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/shout ds2.0r27/lib/doc/sefun/shout *** ds1.1/lib/doc/sefun/shout Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/shout Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,25 ---- + + SHOUT(1) SHOUT(1) + + NNAAMMEE + _s_h_o_u_t_(_) - sends a message to all users online + + SSYYNNOOPPSSIISS + varargs void shout(string|int str, object|object *exclude) + + DDEESSCCRRIIPPTTIIOONN + Sends the message specified by the first argument to all + users online. If a second argument is give, it is an + object or array of objects which will be excluded from + hearing the message. The message class _s_h_o_u_t_(_) uses is + "shout". + + LLOOCCAATTIIOONN + /secure/SimulEfun/communications.c + + SSEEEE AALLSSOO _m_e_s_s_a_g_e_(_), _s_a_y_(_), _w_r_i_t_e_(_) + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/shutdown ds2.0r27/lib/doc/sefun/shutdown *** ds1.1/lib/doc/sefun/shutdown Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/shutdown Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,24 ---- + + SHUTDOWN(1) SHUTDOWN(1) + + NNAAMMEE + _s_h_u_t_d_o_w_n_(_) - shuts down the mud + + SSYYNNOOPPSSIISS + varargs void shutdown(int code) + + DDEESSCCRRIIPPTTIIOONN + The MudOS _s_h_u_t_d_o_w_n_(_) efun has no security. This SimulEfun + overrides the MudOS _s_h_u_t_d_o_w_n_(_) efun to provide security. + + LLOOCCAATTIIOONN + /secure/SimulEfun/SimulEfun.c + + SSEEEE AALLSSOO + the _s_h_u_t_d_o_w_n_(_) efun + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/snoop ds2.0r27/lib/doc/sefun/snoop *** ds1.1/lib/doc/sefun/snoop Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/snoop Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,22 ---- + + SNOOP(1) SNOOP(1) + + NNAAMMEE + _s_n_o_o_p_(_) - sets one player to snoop another + + SSYYNNOOPPSSIISS + varargs object snoop(object who, object target) + + DDEESSCCRRIIPPTTIIOONN TThhiiss ffuunnccttiioonn pprroovviiddeess sseeccuurriittyy ffoorr tthhee MMuuddOOSS eeffuunn + _s_n_o_o_p_(_). + LLOOCCAATTIIOONN + /secure/SimulEfun/SimulEfun.c + + SSEEEE AALLSSOO + the _s_n_o_o_p_(_) efun + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/starts_with ds2.0r27/lib/doc/sefun/starts_with *** ds1.1/lib/doc/sefun/starts_with Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/starts_with Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,23 ---- + + STARTS_WITH(1) STARTS_WITH(1) + + NAME + starts_with() - Whether a string begins with the specified substring. + + SYNOPSIS + int starts_with(string primary, string sub) + + DESCRIPTION + If primary begins with sub, returns 1. Otherwise returns 0. + + EXAMPLES + starts_with(string primary, string sub) + + LOCATION + /secure/sefun/strings.c + + Author + Cratylus @ Dead Souls + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/strip_colours ds2.0r27/lib/doc/sefun/strip_colours *** ds1.1/lib/doc/sefun/strip_colours Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/strip_colours Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,24 ---- + + STRIP_COLOURS(1) STRIP_COLOURS(1) + + NNAAMMEE + _s_t_r_i_p___c_o_l_o_u_r_s_(_) - strips all colour codes from a string + + SSYYNNOOPPSSIISS + string strip_colours(string str) + + DDEESSCCRRIIPPTTIIOONN + Returns a string free of colour codes. + + EEXXAAMMPPLLEESS + +o strip_colours("%^RED%^Descartes tells you:%^RESET%^ + hi!") returns "Descartes tells you: hi!" + + LLOOCCAATTIIOONN + /secure/SimulEfun/strings.c + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/tail ds2.0r27/lib/doc/sefun/tail *** ds1.1/lib/doc/sefun/tail Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/tail Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,28 ---- + + TAIL(1) TAIL(1) + + NAME + tail() - Displays the last lines of a specified file. + + SYNOPSIS + int tail(string file) + + DESCRIPTION + Displays the last few lines (1024 bytes) of a file to + this_player(). + + EXAMPLES + tail("/realms/cratylus/workroom.c") + + + LOCATION + /secure/sefun/tail.c + + SEE ALSO + write(), say() + + Author + Cratylus @ Dead Souls + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/tell_object ds2.0r27/lib/doc/sefun/tell_object *** ds1.1/lib/doc/sefun/tell_object Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/tell_object Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,21 ---- + + TELL_STD_ITEM(1) TELL_OBJECT(1) + + NNAAMMEE + _t_e_l_l___o_b_j_e_c_t_(_) - sends a message to an object + + SSYYNNOOPPSSIISS + void tell_object(object ob, string|int str) + + DDEESSCCRRIIPPTTIIOONN + This function sends a message of the message class + "environment" to the object named. + + LLOOCCAATTIIOONN + /secure/SimulEfun/communications.c + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/tell_player ds2.0r27/lib/doc/sefun/tell_player *** ds1.1/lib/doc/sefun/tell_player Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/tell_player Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,21 ---- + + TELL_PLAYER(1) TELL_PLAYER(1) + + NAME + tell_player() - sends a message to a player + + SYNOPSIS + void tell_player(object player, string str) + + DESCRIPTION + This function sends a message of the message class + "environment" to the player named. + + LOCATION + /secure/sefun/communications.c + + Author + Cratylus @ Dead Souls + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/total_light ds2.0r27/lib/doc/sefun/total_light *** ds1.1/lib/doc/sefun/total_light Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/total_light Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,26 ---- + + TOTAL_LIGHT(1) TOTAL_LIGHT(1) + + NNAAMMEE + _t_o_t_a_l___l_i_g_h_t_(_) - returns the independent light value for a + room + + SSYYNNOOPPSSIISS + int total_light(object ob) + + DDEESSCCRRIIPPTTIIOONN + Returns the light value for a room. This SimulEfun does + not say how much light may be available to any given + player. + + LLOOCCAATTIIOONN + /secure/SimulEfun/light.c + + SSEEEE AALLSSOO + _e_f_f_e_c_t_i_v_e___l_i_g_h_t_(_), _m_o_o_n___l_i_g_h_t_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/translate ds2.0r27/lib/doc/sefun/translate *** ds1.1/lib/doc/sefun/translate Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/translate Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,31 ---- + + TRANSLATE(1) TRANSLATE(1) + + NNAAMMEE + _t_r_a_n_s_l_a_t_e_(_) - translates any given string into nonsense + + SSYYNNOOPPSSIISS + string translate(string str, int prof) + + DDEESSCCRRIIPPTTIIOONN + Depending on the users linguistic proficiency, specified + by the second argument, this function takes the string in + the first argument and turns it into an appropriate degree + of nonsense. It is used to handle linguistic + communication. + + EEXXAAMMPPLLEESS + +o translate("this is a string in another language", 2) + returns "blurb is bargle bing yellow gurble zing" + + +o translate("this is another string", 10) returns "this + is another string" + + LLOOCCAATTIIOONN + /secure/SimulEfun/translate.c + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/true ds2.0r27/lib/doc/sefun/true *** ds1.1/lib/doc/sefun/true Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/true Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,24 ---- + + TRUE(1) TRUE(1) + + NAME + true() - Always returns a 1. + + SYNOPSIS + int true() + + DESCRIPTION + This function is mostly just cosmetic. There are circumstances where + I feel wrong not having SOMETHING happen, so there is this. + + LOCATION + /secure/sefun/generic.c + + SEE ALSO + false() + + Author + Cratylus @ Dead Souls + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/unguarded ds2.0r27/lib/doc/sefun/unguarded *** ds1.1/lib/doc/sefun/unguarded Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/unguarded Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,52 ---- + + UNGUARDED(1) UNGUARDED(1) + + NNAAMMEE + _u_n_g_u_a_r_d_e_d_(_) - calls a function relying only on the + object's security + + SSYYNNOOPPSSIISS + mixed unguarded(function f) + + DDEESSCCRRIIPPTTIIOONN + This function allows an object to make a function call + based solely its own access. Normally, when an object + makes a function call, the access of all objects invloved + in the object chain are checked to see if there is proper + access. For example, if you have a guild object which + needs to read a help file in your home directory, under + normal circumstances this will fail. Even though your + guild object has proper permissions to read your files, + the person executing the command does not. So, the guild + object passes the security check, the player fails. Since + the player fails, the entire read fails. This system is + useful for preventing people from using other objects to + gain illegal access. However, in the case outlined above, + this can be a pain. The _u_n_g_u_a_r_d_e_d_(_) function call directs + the mudlib only to check to see if your guild object has + the proper permission. The argument to _u_n_g_u_a_r_d_e_d_(_) is the + function to be called. + + EEXXAAMMPPLLEESS + In the above example, there would be code like this: + + iinntt ccmmdd__hheellpp((ssttrriinngg ssttrr)) {{ + iiff((ssttrr !!== ""gguuiilldd"")) rreettuurrnn 00;; + ttxxtt == uunngguuaarrddeedd((((:: rreeaadd__ffiillee,, HHEELLPP__FFIILLEE ::))));; + mmeessssaaggee((""hheellpp"",, ttxxtt,, tthhiiss__ppllaayyeerr(())));; + rreettuurrnn 11;; + }} + + The function unguarded((: read_file, HELP_FILE :)) acts + just like _r_e_a_d___f_i_l_e(HELP_FILE) except that the security + only checks your object with the first call, but checks + all objects in the call stack on the second call. + + LLOOCCAATTIIOONN + /secure/SimulEfun/security.c + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/user_exists ds2.0r27/lib/doc/sefun/user_exists *** ds1.1/lib/doc/sefun/user_exists Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/user_exists Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,25 ---- + + USER_EXISTS(1) USER_EXISTS(1) + + NNAAMMEE + _u_s_e_r___e_x_i_s_t_s_(_) - returns true if a given user exists + + SSYYNNOOPPSSIISS + int user_exists(string str) + + DDEESSCCRRIIPPTTIIOONN + If the argument passed is an existing player, this + function returns true. Otherwise the function returns + false. + + EEXXAAMMPPLLEESS + _u_s_e_r___e_x_i_s_t_s("descartes") returns true on Nightmare + + LLOOCCAATTIIOONN + /secure/SimulEfun/user_exists.c + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/user_path ds2.0r27/lib/doc/sefun/user_path *** ds1.1/lib/doc/sefun/user_path Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/user_path Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,24 ---- + + USER_PATH(1) USER_PATH(1) + + NNAAMMEE + _u_s_e_r___p_a_t_h_(_) - returns the home directory of the user named + + SSYYNNOOPPSSIISS + string user_path(string name) + + DDEESSCCRRIIPPTTIIOONN + This function returns the home directory of the user named + as an argument. + + EEXXAAMMPPLLEESS + _u_s_e_r___p_a_t_h("descartes") returns "/realms/descartes" + + LLOOCCAATTIIOONN + /secure/SimulEfun/user_path.c + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/version ds2.0r27/lib/doc/sefun/version *** ds1.1/lib/doc/sefun/version Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/version Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,24 ---- + + VERSION(1) VERSION(1) + + NNAAMMEE + _v_e_r_s_i_o_n_(_) - returns the driver name and version + + SSYYNNOOPPSSIISS + string _v_e_r_s_i_o_n_(_) + + DDEESSCCRRIIPPTTIIOONN + This function returns the driver name and version. + + LLOOCCAATTIIOONN + /secure/SimulEfun/mud_info.c + + SSEEEE AALLSSOO + _a_r_c_h_i_t_e_c_t_u_r_e_(_), _m_u_d___n_a_m_e_(_), _m_u_d_l_i_b_(_), _m_u_d_l_i_b___v_e_r_s_i_o_n_(_), + _q_u_e_r_y___h_o_s_t___p_o_r_t_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/wrap ds2.0r27/lib/doc/sefun/wrap *** ds1.1/lib/doc/sefun/wrap Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/wrap Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,28 ---- + + WRAP(1) WRAP(1) + + NNAAMMEE + _w_r_a_p_(_) - returns a string wrapped to a specified terminal + width + + SSYYNNOOPPSSIISS + varargs string wrap(string str, int width) + + DDEESSCCRRIIPPTTIIOONN + If a second argument is passed, the first argument is + fitted with carriage returns to wrap the string for + display on a terminal as wide as the second argument. If + no second argument is given, a terminal width of 80 is + assumed. + + LLOOCCAATTIIOONN + /secure/SimulEfun/strings.c + + SSEEEE AALLSSOO + _a_r_r_a_n_g_e___s_t_r_i_n_g_(_), _f_o_r_m_a_t___p_a_g_e_(_), _s_p_r_i_n_t_f_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/write ds2.0r27/lib/doc/sefun/write *** ds1.1/lib/doc/sefun/write Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/write Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,25 ---- + + WRITE(1) WRITE(1) + + NNAAMMEE + _w_r_i_t_e_(_) - sends a message to the current command giver + + SSYYNNOOPPSSIISS + void write(string str) + + DDEESSCCRRIIPPTTIIOONN + This function is simply redefined as: + + mmeessssaaggee((""mmyy__aaccttiioonn"",, ssttrr,, tthhiiss__ppllaayyeerr(())));; + + LLOOCCAATTIIOONN + /secure/SimulEfun/communication.c + + SSEEEE AALLSSOO + _m_e_s_s_a_g_e_(_), _s_a_y_(_), _s_h_o_u_t_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/doc/sefun/year ds2.0r27/lib/doc/sefun/year *** ds1.1/lib/doc/sefun/year Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/doc/sefun/year Wed Jul 5 00:01:03 2006 *************** *** 0 **** --- 1,26 ---- + + YEAR(1) YEAR(1) + + NNAAMMEE + _y_e_a_r_(_) - returns the year for a given time + + SSYYNNOOPPSSIISS + int year(int x) + + DDEESSCCRRIIPPTTIIOONN + Given a time integer as an argument, this function returns + the MUD year for that time. + + EEXXAAMMPPLLEESS + +o _y_e_a_r(_t_i_m_e_(_)) returns the MUD year today, which at the + time of this document happens to be 14. + + SSEEEE AALLSSOO + _d_a_t_e_(_), _d_a_y_(_), _h_o_u_r_(_), _m_i_n_u_t_e_s_(_), _m_o_n_t_h_(_), _q_u_e_r_y___n_i_g_h_t_(_), + _s_e_a_s_o_n_(_) + + AAuutthhoorr + Descartes of Borg + + 1 + diff -c -r --new-file ds1.1/lib/domains/Ylsrim/README ds2.0r27/lib/domains/Ylsrim/README *** ds1.1/lib/domains/Ylsrim/README Fri Jan 3 22:13:40 1997 --- ds2.0r27/lib/domains/Ylsrim/README Wed Jul 5 00:01:03 2006 *************** *** 1,14 **** /domains/Ylsrim The Standard Domain for the Nightmare V Object Library ! This domain is designed to provide examples of all Nightmare V Object ! Library inheritables. It also serves as the standard distribution ! domain and should serve as an adequate area for people wanting to open ! up a mud quickly with minimum hassle. We do recommend, if you have ! the resources, that you use this stuff only for examples and write ! your own, unique standard domain. To do so, you will need in your new ! standard domain all of the files in /domains/Ylsrim/adm and you will ! also need a start room (which here is /domains/Ylsrim/room/bazaar). ! Then go into /secure/include/dirs.h and change DIR_STANDARD_DOMAIN to ! point to your new domain directory, and /secure/include/rooms.h to ! point to your new start room. --- 1,12 ---- /domains/Ylsrim The Standard Domain for the Nightmare V Object Library ! This is the original sample domain provided with Dead Souls 1.1pre. ! ! It has been modified to work correctly with Dead Souls 2, but you will ! notice some differences in layout and design philosophy. Please regard this ! domain as a source of examples, but note that it is here for historical ! and back-compatibility purposes, and not necessarily as a model for ! building standards. ! ! -Cratylus 06DEC05 diff -c -r --new-file ds1.1/lib/domains/Ylsrim/README.old ds2.0r27/lib/domains/Ylsrim/README.old *** ds1.1/lib/domains/Ylsrim/README.old Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/Ylsrim/README.old Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,14 ---- + /domains/Ylsrim + The Standard Domain for the Nightmare V Object Library + + This domain is designed to provide examples of all Nightmare V Object + Library inheritables. It also serves as the standard distribution + domain and should serve as an adequate area for people wanting to open + up a mud quickly with minimum hassle. We do recommend, if you have + the resources, that you use this stuff only for examples and write + your own, unique standard domain. To do so, you will need in your new + standard domain all of the files in /domains/Ylsrim/adm and you will + also need a start room (which here is /domains/Ylsrim/room/bazaar). + Then go into /secure/include/dirs.h and change DIR_STANDARD_DOMAIN to + point to your new domain directory, and /secure/include/rooms.h to + point to your new start room. diff -c -r --new-file ds1.1/lib/domains/Ylsrim/adm/freezer.c ds2.0r27/lib/domains/Ylsrim/adm/freezer.c *** ds1.1/lib/domains/Ylsrim/adm/freezer.c Sun Feb 1 21:30:03 1998 --- ds2.0r27/lib/domains/Ylsrim/adm/freezer.c Wed Jul 5 00:01:11 2006 *************** *** 29,37 **** object ob; foreach(ob in filter(all_inventory(), (: !living($1) :))) ! ob->eventDestruct(); if( !sizeof(filter(all_inventory(), (: living :))) ) { ! Old = ({}); call_out((: clean_room :), MAX_NET_DEAD_TIME); return; } --- 29,37 ---- object ob; foreach(ob in filter(all_inventory(), (: !living($1) :))) ! ob->eventDestruct(); if( !sizeof(filter(all_inventory(), (: living :))) ) { ! Old = ({}); call_out((: clean_room :), MAX_NET_DEAD_TIME); return; } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/armor/artrell_armor.c ds2.0r27/lib/domains/Ylsrim/armor/artrell_armor.c *** ds1.1/lib/domains/Ylsrim/armor/artrell_armor.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/Ylsrim/armor/artrell_armor.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,34 ---- + /* /domains/Ylsrim/armor/artrell_armor.c + * from the Dead Souls V Object Library + * created by Descartes of Borg 960302 + */ + + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ARMOR; + + static void create() { + armor::create(); + SetKeyName("leather armor"); + SetId( ({ "armor", "leather armor" }) ); + SetAdjectives( ({ "leather" }) ); + SetShort("a suit of leather armor"); + SetLong("An ordinary suit of leather armor. It is worn on one's arms, torso and legs."); + SetVendorType(VT_ARMOR); + SetMass(750); + SetValue(150); + SetDamagePoints(800); + SetProtection(BLUNT, 20); + SetProtection(BLADE, 20); + SetProtection(KNIFE, 25); + SetProtection(HEAT, 7); + SetProtection(COLD, 4); + SetProtection(SHOCK, 15); + SetArmorType(A_ARMOR); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/armor/helm.c ds2.0r27/lib/domains/Ylsrim/armor/helm.c *** ds1.1/lib/domains/Ylsrim/armor/helm.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/Ylsrim/armor/helm.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,44 ---- + /* /domains/Ylsrim/armor/helm.c + * from the Dead Souls V Object Library + * created by Descartes of Borg 960302 + */ + + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ARMOR; + + int WearHelm(object who); + + static void create() { + armor::create(); + SetKeyName("desert helm"); + SetId( ({ "helm", "desert helm" }) ); + SetAdjectives( ({ "sandy", "brown" }) ); + SetShort("a dusty helm"); + SetLong("This helm is the Desert helm, bestowed upon honoured " + "knights of the desert. It is made from a magic sand bound " + "together to protect the heads of the righteous."); + SetDamagePoints(3000); + SetVendorType(VT_ARMOR); + SetMass(200); + SetValue(300); + SetArmorType(A_HELMET); + SetWear( (: WearHelm :) ); + SetProtection(BLUNT, 40); + SetProtection(BLADE, 3); + SetProtection(KNIFE, 10); + SetProtection(HEAT, 30); + } + + int WearHelm(object who) { + if( (int)who->GetMorality() < 300 ) { + who->eventPrint("The helm burns your head!"); + who->eventReceiveDamage(0, HEAT, random(10) + 10, 0, "head"); + return 0; + } + who->eventPrint("You wear the desert helm."); + return 1; + } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/armor/leather_armor.c ds2.0r27/lib/domains/Ylsrim/armor/leather_armor.c *** ds1.1/lib/domains/Ylsrim/armor/leather_armor.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/Ylsrim/armor/leather_armor.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,34 ---- + /* /domains/Ylsrim/armor/artrell_armor.c + * from the Dead Souls V Object Library + * created by Descartes of Borg 960302 + */ + + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ARMOR; + + static void create() { + armor::create(); + SetKeyName("leather armor"); + SetId( ({ "armor", "leather armor" }) ); + SetAdjectives( ({ "leather" }) ); + SetShort("a suit of leather armor"); + SetLong("An ordinary suit of leather armor. It is worn on one's arms, torso and legs."); + SetVendorType(VT_ARMOR); + SetMass(750); + SetValue(150); + SetDamagePoints(800); + SetProtection(BLUNT, 20); + SetProtection(BLADE, 20); + SetProtection(KNIFE, 25); + SetProtection(HEAT, 7); + SetProtection(COLD, 4); + SetProtection(SHOCK, 15); + SetArmorType(A_BODY_ARMOR); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/armor/normal_helm.c ds2.0r27/lib/domains/Ylsrim/armor/normal_helm.c *** ds1.1/lib/domains/Ylsrim/armor/normal_helm.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/Ylsrim/armor/normal_helm.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,30 ---- + /* /domains/Ylsrim/armor/helm.c + * from the Dead Souls V Object Library + * created by Descartes of Borg 960302 + */ + + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ARMOR; + + + static void create() { + armor::create(); + SetKeyName("wooden helm"); + SetId("helm"); + SetAdjectives("wooden"); + SetShort("a wooden helm"); + SetLong("It is a lame wooden helm."); + SetDamagePoints(3000); + SetVendorType(VT_ARMOR); + SetMass(200); + SetValue(100); + SetArmorType(A_HELMET); + SetProtection(BLUNT, 40); + SetProtection(BLADE, 3); + SetProtection(KNIFE, 10); + SetProtection(HEAT, 30); + } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/armor/shield.c ds2.0r27/lib/domains/Ylsrim/armor/shield.c *** ds1.1/lib/domains/Ylsrim/armor/shield.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/Ylsrim/armor/shield.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,41 ---- + /* /domains/Ylsrim/armor/shield.c + * from the Dead Souls V Object Library + * an example shield + * created by Lassondra@Dead Souls + */ + + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ARMOR; + + int eventWearShield(object who); + + static void create() { + armor::create(); + SetKeyName("wooden shield"); + SetId( ({ "shield", "wooden shield" }) ); + SetShort("a wooden shield"); + SetLong("This shield is a simple circle of woode with no markings."); + SetDamagePoints(600); + SetVendorType(VT_ARMOR); + SetMass(400); + SetValue(75); + SetArmorType(A_SHIELD); + SetWear( (: eventWearShield :) ); + SetProtection(BLUNT, 5); + SetProtection(BLADE, 3); + SetProtection(KNIFE, 10); + SetProtection(SHOCK, 30); + } + + int eventWearShield(object who) { + if( (string)who->GetRace() != "hobbit" ) { + who->eventPrint("The shield's handle simply does not fit your hand " + "right."); + return 0; + } + else return 1; + } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/armour/artrell_armour.c ds2.0r27/lib/domains/Ylsrim/armour/artrell_armour.c *** ds1.1/lib/domains/Ylsrim/armour/artrell_armour.c Sun Feb 1 21:30:04 1998 --- ds2.0r27/lib/domains/Ylsrim/armour/artrell_armour.c Wed Dec 31 19:00:00 1969 *************** *** 1,34 **** - /* /domains/Ylsrim/armour/artrell_armour.c - * from the Dead Souls V Object Library - * created by Descartes of Borg 960302 - */ - - #include <lib.h> - #include <armour_types.h> - #include <damage_types.h> - #include <vendor_types.h> - - inherit LIB_ARMOUR; - - static void create() { - armour::create(); - SetKeyName("leather armour"); - SetId( ({ "armour", "leather armour" }) ); - SetAdjectives( ({ "leather" }) ); - SetShort("a suit of leather armour"); - SetLong("This suit of leather armour is made specifically for the " - "artrell physique."); - SetVendorType(VT_ARMOUR); - SetMass(750); - SetValue(150); - SetDamagePoints(800); - SetProtection(BLUNT, 20); - SetProtection(BLADE, 20); - SetProtection(KNIFE, 25); - SetProtection(HEAT, 7); - SetProtection(COLD, 4); - SetProtection(SHOCK, 15); - SetRestrictLimbs( ({ "torso", "first arm", "second arm", "third arm", - "fourth arm" }) ); - SetArmourType(A_ARMOUR); - } --- 0 ---- diff -c -r --new-file ds1.1/lib/domains/Ylsrim/armour/helm.c ds2.0r27/lib/domains/Ylsrim/armour/helm.c *** ds1.1/lib/domains/Ylsrim/armour/helm.c Sun Feb 1 21:30:04 1998 --- ds2.0r27/lib/domains/Ylsrim/armour/helm.c Wed Dec 31 19:00:00 1969 *************** *** 1,44 **** - /* /domains/Ylsrim/armour/helm.c - * from the Dead Souls V Object Library - * created by Descartes of Borg 960302 - */ - - #include <lib.h> - #include <armour_types.h> - #include <damage_types.h> - #include <vendor_types.h> - - inherit LIB_ARMOUR; - - int WearHelm(object who); - - static void create() { - armour::create(); - SetKeyName("desert helm"); - SetId( ({ "helm", "desert helm" }) ); - SetAdjectives( ({ "sandy", "brown" }) ); - SetShort("a dusty helm"); - SetLong("This helm is the Desert helm, bestowed upon honoured " - "knights of the desert. It is made from a magic sand bound " - "together to protect the heads of the righteous."); - SetDamagePoints(3000); - SetVendorType(VT_ARMOUR); - SetMass(200); - SetValue(300); - SetArmourType(A_HELMET); - SetWear( (: WearHelm :) ); - SetProtection(BLUNT, 40); - SetProtection(BLADE, 3); - SetProtection(KNIFE, 10); - SetProtection(HEAT, 30); - } - - int WearHelm(object who) { - if( (int)who->GetMorality() < 300 ) { - who->eventPrint("The helm burns your head!"); - who->eventReceiveDamage(0, HEAT, random(10) + 10, 0, "head"); - return 0; - } - who->eventPrint("You wear the desert helm."); - return 1; - } --- 0 ---- diff -c -r --new-file ds1.1/lib/domains/Ylsrim/armour/normal_helm.c ds2.0r27/lib/domains/Ylsrim/armour/normal_helm.c *** ds1.1/lib/domains/Ylsrim/armour/normal_helm.c Sun Feb 1 21:30:04 1998 --- ds2.0r27/lib/domains/Ylsrim/armour/normal_helm.c Wed Dec 31 19:00:00 1969 *************** *** 1,30 **** - /* /domains/Ylsrim/armour/helm.c - * from the Dead Souls V Object Library - * created by Descartes of Borg 960302 - */ - - #include <lib.h> - #include <armour_types.h> - #include <damage_types.h> - #include <vendor_types.h> - - inherit LIB_ARMOUR; - - - static void create() { - armour::create(); - SetKeyName("wooden helm"); - SetId("helm"); - SetAdjectives("wooden"); - SetShort("a wooden helm"); - SetLong("It is a lame wooden helm."); - SetDamagePoints(3000); - SetVendorType(VT_ARMOUR); - SetMass(200); - SetValue(100); - SetArmourType(A_HELMET); - SetProtection(BLUNT, 40); - SetProtection(BLADE, 3); - SetProtection(KNIFE, 10); - SetProtection(HEAT, 30); - } --- 0 ---- diff -c -r --new-file ds1.1/lib/domains/Ylsrim/armour/shield.c ds2.0r27/lib/domains/Ylsrim/armour/shield.c *** ds1.1/lib/domains/Ylsrim/armour/shield.c Sun Feb 1 21:30:04 1998 --- ds2.0r27/lib/domains/Ylsrim/armour/shield.c Wed Dec 31 19:00:00 1969 *************** *** 1,41 **** - /* /domains/Ylsrim/armour/shield.c - * from the Dead Souls V Object Library - * an example shield - * created by Lassondra@Dead Souls - */ - - #include <lib.h> - #include <armour_types.h> - #include <damage_types.h> - #include <vendor_types.h> - - inherit LIB_ARMOUR; - - int eventWearShield(object who); - - static void create() { - armour::create(); - SetKeyName("wooden shield"); - SetId( ({ "shield", "wooden shield" }) ); - SetShort("a wooden shield"); - SetLong("This shield is a simple circle of woode with no markings."); - SetDamagePoints(600); - SetVendorType(VT_ARMOUR); - SetMass(400); - SetValue(75); - SetArmourType(A_SHIELD); - SetWear( (: eventWearShield :) ); - SetProtection(BLUNT, 5); - SetProtection(BLADE, 3); - SetProtection(KNIFE, 10); - SetProtection(SHOCK, 30); - } - - int eventWearShield(object who) { - if( (string)who->GetRace() != "hobbit" ) { - who->eventPrint("The shield's handle simply does not fit your hand " - "right."); - return 0; - } - else return 1; - } --- 0 ---- diff -c -r --new-file ds1.1/lib/domains/Ylsrim/broken/README ds2.0r27/lib/domains/Ylsrim/broken/README *** ds1.1/lib/domains/Ylsrim/broken/README Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/Ylsrim/broken/README Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,3 ---- + Items in this directory appear to require + library objects that do not exist by default + in the originally released Dead Souls lib. diff -c -r --new-file ds1.1/lib/domains/Ylsrim/broken/cold.c ds2.0r27/lib/domains/Ylsrim/broken/cold.c *** ds1.1/lib/domains/Ylsrim/broken/cold.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/Ylsrim/broken/cold.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,45 ---- + /* /domains/Ylsrim/etc/cold.c + * From the Dead Souls V Object Library + * An example of how to build a germ + * created by Descartes of Borg 961216 + */ + + #include <lib.h> + #include <damage_types.h> + + inherit LIB_GERM; + + static void create() { + germ::create(); + SetId("cold"); + SetType("cold"); + SetCommunicable(40); + SetCure(20); + SetLifeSpan(60); + } + + int eventSuffer(object who) { + if( !random(100) ) { + Destruct(); + return 1; + } + switch(random(3)) { + case 0: + send_messages("cough", "$agent_name $agent_verb miserably.", + who, 0, environment(who)); + break; + + case 1: + send_messages("", "$agent_possessive_noun red nose runs all over " + "$agent_possessive face.", who, 0, environment(who)); + break; + + case 2: + send_messages("look", "$agent_name $agent_verb miserable.", + who, 0, environment(who)); + break; + } + who->eventReceiveDamage(0, COLD, random(3) + 1, 1); + return 1; + } + diff -c -r --new-file ds1.1/lib/domains/Ylsrim/broken/flu.c ds2.0r27/lib/domains/Ylsrim/broken/flu.c *** ds1.1/lib/domains/Ylsrim/broken/flu.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/Ylsrim/broken/flu.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,64 ---- + /* /domains/Ylsrim/etc/flu.c + * From the Dead Souls V Object Library + * An example of how to build a germ + * created by Descartes of Borg 961216 + */ + + #include <lib.h> + #include <damage_types.h> + + inherit LIB_GERM; + + int cureMe(object who, int amount, string type); + int infectMe(object who); + + static void create() { + germ::create(); + SetId("flu", "influenza"); + SetType("flu"); + SetCommunicable(20); + SetCure((: cureMe :)); + SetLifeSpan(60); + SetInfect((: infectMe :)); + } + + mixed cureMe(object who, int amount, string type) { + if( amount < 40 ) { + return 0; + } + return 1; + } + + int infectMe(object who) { + if( who->GetRace() == "klingon" ) { + return 0; + } + who->eventPrint("You start feeling a little achy."); + return 1; + } + + int eventSuffer(object who) { + if( !random(100) ) { + Destruct(); + return 1; + } + switch(random(3)) { + case 0: + send_messages("cough", "$agent_name $agent_verb miserably.", + who, 0, environment(who)); + break; + + case 1: + send_messages("", "$agent_possessive_noun red nose runs all over " + "$agent_possessive face.", who, 0, environment(who)); + break; + + case 2: + send_messages("look", "$agent_name $agent_verb miserable.", + who, 0, environment(who)); + break; + } + who->eventReceiveDamage(0, COLD, random(3) + 1, 1); + return 1; + } + diff -c -r --new-file ds1.1/lib/domains/Ylsrim/broken/jar.c ds2.0r27/lib/domains/Ylsrim/broken/jar.c *** ds1.1/lib/domains/Ylsrim/broken/jar.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/Ylsrim/broken/jar.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,145 ---- + #include <lib.h> + + inherit LIB_ITEM; + inherit LIB_CLOSE; + inherit LIB_LIGHT; + inherit LIB_CAPTURE; + + int BugDies = 0; + + static void create() { + AddSave(({ "BugDies" })); + item::create(); + close::create(); + capture::create(); + light::create(); + SetKeyName("jar"); + SetId( ({ "jar" }) ); + SetShort("a jar"); + SetLong("A jar with lid. The lid has holes poked in " + "the top. It would be perfect to catch bugs in."); + SetDestroyOnSell(1); + SetMass(100); + SetValue(30); + SetClosed(1); + SetMaxCapture(1); + if( BugDies > 1 ) { + set_heart_beat(2); + } + } + + static void heart_beat() { + BugDies -= 2; + if( BugDies < 1 ) { + eventDarken(); + } + } + + int direct_light_obj() { // They cannot use the light command + return 0; + } + + mixed CanCapture(object who, object target) { + if( !target->id("lightning bug") ) { + return "The jar has a fit as you try to capture something other " + "than a lightning bug!"; + } + if( GetLit() ) { + return "You already have a lightning bug in there!"; + } + if( GetClosed() ) { + return "The jar must be open!"; + } + return 1; + } + + mixed eventCapture(object who, object target) { + mixed tmp = capture::eventCapture(who, "lightning bug"); + + if( tmp != 1 ) { + return tmp; + } + target->eventDestruct(); + who->eventPrint("You capture a lightning bug in your jar!"); + environment(who)->eventPrint(who->GetName() + " captures a lightning bug " + "with " + possessive(who) + " jar.", who); + SetLit(1); + BugDies = 360; + set_heart_beat(2); + } + + mixed eventDarken() { + object env = environment(); + + if( env ) { + env->eventPrint("The %^YELLOW%^lighning bug%^RESET%^ dies."); + } + if( living(env) && (env = environment(env)) ) { + env->eventPrint(possessive_noun(environment()->GetName()) + + " lightning bug dies and " + possessive(environment()) + + " jar goes dark.", environment()); + } + capture::eventFree("lightning bug"); + SetLit(0); + return 1; + } + + mixed eventFree(object who, string target) { + mixed tmp = capture::eventFree(target); + object bug; + + if( tmp != 1 ) { + return tmp; + } + if( GetClosed() ) { + eventOpen(who, "jar"); + } + SetLit(0); + environment(who)->eventPrint("A lightning bug flies free of the jar!"); + bug = new("/realms/ariel/wonder/monsters/lbug"); + bug->eventMove(environment(who)); + return 1; + } + + varargs mixed eventOpen(object who, string id, object tool) { + mixed tmp = close::eventOpen(who, id, tool); + + if( tmp != 1 ) { + return tmp; + } + if( sizeof(GetCaptured()) ) { + eventFree(who, "lightning bug"); + } + return 1; + } + + string GetShort() { + string tmp = item::GetShort(); + + if( GetLit() ) { + tmp += "\nIt is holding a lightning bug."; + } + if( GetClosed() ) { + tmp += "\nIt is closed."; + } + else { + tmp += "\nIt is open."; + } + return tmp; + } + + string GetLong(string str) { + string tmp = item::GetLong(); + + if( GetLit() ) { + tmp += "\nIt is glowing."; + } + if( GetClosed() ) { + tmp += "\nIt is closed."; + } + else { + tmp += "\nIt is open."; + } + return tmp; + + } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/etc/adv_board.c ds2.0r27/lib/domains/Ylsrim/etc/adv_board.c *** ds1.1/lib/domains/Ylsrim/etc/adv_board.c Sun Feb 1 21:30:07 1998 --- ds2.0r27/lib/domains/Ylsrim/etc/adv_board.c Wed Jul 5 00:01:11 2006 *************** *** 9,21 **** static void create() { ! ::create(); ! SetKeyName("bulletin board"); ! SetId( ({"board", "bulletin board"}) ); ! SetAdjectives("stupid"); ! SetShort("a bulletin board"); ! SetLong("Adventurers passing through Ylsrim post their thoughts here."); ! set_board_id("ylsrim"); } --- 9,21 ---- static void create() { ! ::create(); ! SetKeyName("bulletin board"); ! SetId( ({"board", "bulletin board"}) ); ! SetAdjectives("stupid"); ! SetShort("a bulletin board"); ! SetLong("Adventurers passing through Ylsrim post their thoughts here."); ! set_board_id("ylsrim"); } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/etc/chest.c ds2.0r27/lib/domains/Ylsrim/etc/chest.c *** ds1.1/lib/domains/Ylsrim/etc/chest.c Sun Feb 1 21:30:07 1998 --- ds2.0r27/lib/domains/Ylsrim/etc/chest.c Wed Jul 5 00:01:11 2006 *************** *** 14,24 **** SetAdjectives( ({ "wooden" }) ); SetShort("a wooden chest"); SetLong("This chest is made from an ancient forest far from " ! "Ylsrim. You can feel the age in touching it."); SetMass(1200); SetValue(300); SetInventory( ([ DIR_STANDARD_DOMAIN "/etc/shovel" : -10, ! DIR_STANDARD_DOMAIN "/etc/heal_scroll" : 1 ]) ); SetCanClose(1); SetClosed(1); SetMaxCarry(2000); --- 14,24 ---- SetAdjectives( ({ "wooden" }) ); SetShort("a wooden chest"); SetLong("This chest is made from an ancient forest far from " ! "Ylsrim. You can feel the age in touching it."); SetMass(1200); SetValue(300); SetInventory( ([ DIR_STANDARD_DOMAIN "/etc/shovel" : -10, ! DIR_STANDARD_DOMAIN "/etc/heal_scroll" : 1 ]) ); SetCanClose(1); SetClosed(1); SetMaxCarry(2000); diff -c -r --new-file ds1.1/lib/domains/Ylsrim/etc/church_button.c ds2.0r27/lib/domains/Ylsrim/etc/church_button.c *** ds1.1/lib/domains/Ylsrim/etc/church_button.c Sun Feb 1 21:30:08 1998 --- ds2.0r27/lib/domains/Ylsrim/etc/church_button.c Wed Jul 5 00:01:11 2006 *************** *** 13,19 **** object door = find_object("/domains/Ylsrim/etc/church_door"); send_messages("press", "$agent_name $agent_verb the button.", ! who, 0, environment(who)); if( !door->GetClosed() ) { return 1; } --- 13,19 ---- object door = find_object("/domains/Ylsrim/etc/church_door"); send_messages("press", "$agent_name $agent_verb the button.", ! who, 0, environment(who)); if( !door->GetClosed() ) { return 1; } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/etc/church_door.c ds2.0r27/lib/domains/Ylsrim/etc/church_door.c *** ds1.1/lib/domains/Ylsrim/etc/church_door.c Sun Feb 1 21:30:08 1998 --- ds2.0r27/lib/domains/Ylsrim/etc/church_door.c Wed Jul 5 00:01:11 2006 *************** *** 13,25 **** SetId("church", "door"); SetShort("church", "a door made from old wood"); SetLong("church", "It is a large door that looks like it could fall " ! "apart any minute."); SetLockable("church", 1); SetKeys("church", "#nothing_can_unlock_me#"); SetId("south", "door"); SetShort("south", "a door made from old wood"); SetLong("south", "It is a large door that looks like it could fall " ! "apart any minute."); SetLockable("south", 1); SetKeys("south", "#nothing_can_unlock_me#"); SetClosed(1); --- 13,25 ---- SetId("church", "door"); SetShort("church", "a door made from old wood"); SetLong("church", "It is a large door that looks like it could fall " ! "apart any minute."); SetLockable("church", 1); SetKeys("church", "#nothing_can_unlock_me#"); SetId("south", "door"); SetShort("south", "a door made from old wood"); SetLong("south", "It is a large door that looks like it could fall " ! "apart any minute."); SetLockable("south", 1); SetKeys("south", "#nothing_can_unlock_me#"); SetClosed(1); diff -c -r --new-file ds1.1/lib/domains/Ylsrim/etc/cold.c ds2.0r27/lib/domains/Ylsrim/etc/cold.c *** ds1.1/lib/domains/Ylsrim/etc/cold.c Sun Feb 1 21:30:08 1998 --- ds2.0r27/lib/domains/Ylsrim/etc/cold.c Wed Dec 31 19:00:00 1969 *************** *** 1,45 **** - /* /domains/Ylsrim/etc/cold.c - * From the Dead Souls V Object Library - * An example of how to build a germ - * created by Descartes of Borg 961216 - */ - - #include <lib.h> - #include <damage_types.h> - - inherit LIB_GERM; - - static void create() { - germ::create(); - SetId("cold"); - SetType("cold"); - SetCommunicable(40); - SetCure(20); - SetLifeSpan(60); - } - - int eventSuffer(object who) { - if( !random(100) ) { - Destruct(); - return 1; - } - switch(random(3)) { - case 0: - send_messages("cough", "$agent_name $agent_verb miserably.", - who, 0, environment(who)); - break; - - case 1: - send_messages("", "$agent_possessive_noun red nose runs all over " - "$agent_possessive face.", who, 0, environment(who)); - break; - - case 2: - send_messages("look", "$agent_name $agent_verb miserable.", - who, 0, environment(who)); - break; - } - who->eventReceiveDamage(0, COLD, random(3) + 1, 1); - return 1; - } - --- 0 ---- diff -c -r --new-file ds1.1/lib/domains/Ylsrim/etc/fighter_door.c ds2.0r27/lib/domains/Ylsrim/etc/fighter_door.c *** ds1.1/lib/domains/Ylsrim/etc/fighter_door.c Sun Feb 1 21:30:07 1998 --- ds2.0r27/lib/domains/Ylsrim/etc/fighter_door.c Wed Jul 5 00:01:11 2006 *************** *** 12,24 **** SetId("north", "door"); SetShort("north", "a door made from fine oak"); SetLong("north", "It is a magnificent door marking the entrance to " ! "the fighter class hall."); SetLockable("north", 1); SetKeys("north", "special_key_id"); SetId("south", "door"); SetShort("south", "a door made from fine oak"); SetLong("south", "It is a magnificent door leading out to the recruitment " ! "area."); SetLockable("south", 1); SetKeys("south", "special_key_id"); SetClosed(1); --- 12,24 ---- SetId("north", "door"); SetShort("north", "a door made from fine oak"); SetLong("north", "It is a magnificent door marking the entrance to " ! "the fighter class hall."); SetLockable("north", 1); SetKeys("north", "special_key_id"); SetId("south", "door"); SetShort("south", "a door made from fine oak"); SetLong("south", "It is a magnificent door leading out to the recruitment " ! "area."); SetLockable("south", 1); SetKeys("south", "special_key_id"); SetClosed(1); diff -c -r --new-file ds1.1/lib/domains/Ylsrim/etc/flu.c ds2.0r27/lib/domains/Ylsrim/etc/flu.c *** ds1.1/lib/domains/Ylsrim/etc/flu.c Sun Feb 1 21:30:08 1998 --- ds2.0r27/lib/domains/Ylsrim/etc/flu.c Wed Dec 31 19:00:00 1969 *************** *** 1,64 **** - /* /domains/Ylsrim/etc/flu.c - * From the Dead Souls V Object Library - * An example of how to build a germ - * created by Descartes of Borg 961216 - */ - - #include <lib.h> - #include <damage_types.h> - - inherit LIB_GERM; - - int cureMe(object who, int amount, string type); - int infectMe(object who); - - static void create() { - germ::create(); - SetId("flu", "influenza"); - SetType("flu"); - SetCommunicable(20); - SetCure((: cureMe :)); - SetLifeSpan(60); - SetInfect((: infectMe :)); - } - - mixed cureMe(object who, int amount, string type) { - if( amount < 40 ) { - return 0; - } - return 1; - } - - int infectMe(object who) { - if( who->GetRace() == "klingon" ) { - return 0; - } - who->eventPrint("You start feeling a little achy."); - return 1; - } - - int eventSuffer(object who) { - if( !random(100) ) { - Destruct(); - return 1; - } - switch(random(3)) { - case 0: - send_messages("cough", "$agent_name $agent_verb miserably.", - who, 0, environment(who)); - break; - - case 1: - send_messages("", "$agent_possessive_noun red nose runs all over " - "$agent_possessive face.", who, 0, environment(who)); - break; - - case 2: - send_messages("look", "$agent_name $agent_verb miserable.", - who, 0, environment(who)); - break; - } - who->eventReceiveDamage(0, COLD, random(3) + 1, 1); - return 1; - } - --- 0 ---- diff -c -r --new-file ds1.1/lib/domains/Ylsrim/etc/hole.c ds2.0r27/lib/domains/Ylsrim/etc/hole.c *** ds1.1/lib/domains/Ylsrim/etc/hole.c Sun Feb 1 21:30:08 1998 --- ds2.0r27/lib/domains/Ylsrim/etc/hole.c Wed Jul 5 00:01:11 2006 *************** *** 16,21 **** SetId("hole", "bank"); SetShort("a hole in the roof"); SetLong("It is too dark to see inside the bank, but perhaps you could " ! "jump into it?"); ! SetJump("/domains/Ylsrim/room/bank", JUMP_INTO); } --- 16,21 ---- SetId("hole", "bank"); SetShort("a hole in the roof"); SetLong("It is too dark to see inside the bank, but perhaps you could " ! "jump into it?"); ! AddJump("hole","/domains/Ylsrim/room/bank", JUMP_INTO); } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/etc/jar.c ds2.0r27/lib/domains/Ylsrim/etc/jar.c *** ds1.1/lib/domains/Ylsrim/etc/jar.c Sun Feb 1 21:30:07 1998 --- ds2.0r27/lib/domains/Ylsrim/etc/jar.c Wed Dec 31 19:00:00 1969 *************** *** 1,145 **** - #include <lib.h> - - inherit LIB_ITEM; - inherit LIB_CLOSE; - inherit LIB_LIGHT; - inherit LIB_CAPTURE; - - int BugDies = 0; - - static void create() { - AddSave(({ "BugDies" })); - item::create(); - close::create(); - capture::create(); - light::create(); - SetKeyName("jar"); - SetId( ({ "jar" }) ); - SetShort("a jar"); - SetLong("A jar with lid. The lid has holes poked in " - "the top. It would be perfect to catch bugs in."); - SetDestroyOnSell(1); - SetMass(100); - SetValue(30); - SetClosed(1); - SetMaxCapture(1); - if( BugDies > 1 ) { - set_heart_beat(2); - } - } - - static void heart_beat() { - BugDies -= 2; - if( BugDies < 1 ) { - eventDarken(); - } - } - - int direct_light_obj() { // They cannot use the light command - return 0; - } - - mixed CanCapture(object who, object target) { - if( !target->id("lightning bug") ) { - return "The jar has a fit as you try to capture something other " - "than a lightning bug!"; - } - if( GetLit() ) { - return "You already have a lightning bug in there!"; - } - if( GetClosed() ) { - return "The jar must be open!"; - } - return 1; - } - - mixed eventCapture(object who, object target) { - mixed tmp = capture::eventCapture(who, "lightning bug"); - - if( tmp != 1 ) { - return tmp; - } - target->eventDestruct(); - who->eventPrint("You capture a lightning bug in your jar!"); - environment(who)->eventPrint(who->GetName() + " captures a lightning bug " - "with " + possessive(who) + " jar.", who); - SetLit(1); - BugDies = 360; - set_heart_beat(2); - } - - mixed eventDarken() { - object env = environment(); - - if( env ) { - env->eventPrint("The %^YELLOW%^lighning bug%^RESET%^ dies."); - } - if( living(env) && (env = environment(env)) ) { - env->eventPrint(possessive_noun(environment()->GetName()) + - " lightning bug dies and " + possessive(environment()) + - " jar goes dark.", environment()); - } - capture::eventFree("lightning bug"); - SetLit(0); - return 1; - } - - mixed eventFree(object who, string target) { - mixed tmp = capture::eventFree(target); - object bug; - - if( tmp != 1 ) { - return tmp; - } - if( GetClosed() ) { - eventOpen(who, "jar"); - } - SetLit(0); - environment(who)->eventPrint("A lightning bug flies free of the jar!"); - bug = new("/realms/ariel/wonder/monsters/lbug"); - bug->eventMove(environment(who)); - return 1; - } - - varargs mixed eventOpen(object who, string id, object tool) { - mixed tmp = close::eventOpen(who, id, tool); - - if( tmp != 1 ) { - return tmp; - } - if( sizeof(GetCaptured()) ) { - eventFree(who, "lightning bug"); - } - return 1; - } - - string GetShort() { - string tmp = item::GetShort(); - - if( GetLit() ) { - tmp += "\nIt is holding a lightning bug."; - } - if( GetClosed() ) { - tmp += "\nIt is closed."; - } - else { - tmp += "\nIt is open."; - } - return tmp; - } - - string GetLong(string str) { - string tmp = item::GetLong(); - - if( GetLit() ) { - tmp += "\nIt is glowing."; - } - if( GetClosed() ) { - tmp += "\nIt is closed."; - } - else { - tmp += "\nIt is open."; - } - return tmp; - - } --- 0 ---- diff -c -r --new-file ds1.1/lib/domains/Ylsrim/etc/match.c ds2.0r27/lib/domains/Ylsrim/etc/match.c *** ds1.1/lib/domains/Ylsrim/etc/match.c Sun Feb 1 21:30:07 1998 --- ds2.0r27/lib/domains/Ylsrim/etc/match.c Wed Jul 5 00:01:11 2006 *************** *** 4,12 **** */ #include <lib.h> ! inherit LIB_MATCH; ! static void create() { match::create(); SetKeyName("match"); --- 4,12 ---- */ #include <lib.h> ! inherit LIB_MATCH; ! static void create() { match::create(); SetKeyName("match"); diff -c -r --new-file ds1.1/lib/domains/Ylsrim/etc/pole.c ds2.0r27/lib/domains/Ylsrim/etc/pole.c *** ds1.1/lib/domains/Ylsrim/etc/pole.c Sun Feb 1 21:30:07 1998 --- ds2.0r27/lib/domains/Ylsrim/etc/pole.c Wed Jul 5 00:01:11 2006 *************** *** 2,14 **** * from the Dead Souls V Object Library * created by Descartes of Borg 951009 */ ! #include <lib.h> #include <vendor_types.h> ! inherit LIB_POLE; inherit LIB_ITEM; ! static void create() { pole::create(); item::create(); --- 2,14 ---- * from the Dead Souls V Object Library * created by Descartes of Borg 951009 */ ! #include <lib.h> #include <vendor_types.h> ! inherit LIB_POLE; inherit LIB_ITEM; ! static void create() { pole::create(); item::create(); diff -c -r --new-file ds1.1/lib/domains/Ylsrim/etc/road.c ds2.0r27/lib/domains/Ylsrim/etc/road.c *** ds1.1/lib/domains/Ylsrim/etc/road.c Sun Feb 1 21:30:08 1998 --- ds2.0r27/lib/domains/Ylsrim/etc/road.c Wed Jul 5 00:01:11 2006 *************** *** 11,22 **** inherit LIB_DUMMY; // These do not show up in desc, but you can look at them inherit LIB_JUMP; // This makes it jumpable ! int jumpRoad(object who) { who->eventReceiveDamage(0, BLUNT, random(100) + 5, 1); who->eventMoveLiving("/domains/Ylsrim/room/kaliid6", ! "$N tries to jump into the road " ! "and seriously hurts " + reflexive(who) + ".", ! "$N comes falling in."); return 1; } --- 11,22 ---- inherit LIB_DUMMY; // These do not show up in desc, but you can look at them inherit LIB_JUMP; // This makes it jumpable ! int eventJump(object who) { who->eventReceiveDamage(0, BLUNT, random(100) + 5, 1); who->eventMoveLiving("/domains/Ylsrim/room/kaliid6", ! "$N tries to jump into the road " ! "and seriously hurts " + reflexive(who) + ".", ! "$N comes falling in."); return 1; } *************** *** 27,31 **** SetAdjectives("kaliid"); SetShort("Kaliid Road", 1); // it is a proper noun SetLong("The main road through Ylsrim."); ! SetJump((: jumpRoad :), JUMP_INTO); } --- 27,31 ---- SetAdjectives("kaliid"); SetShort("Kaliid Road", 1); // it is a proper noun SetLong("The main road through Ylsrim."); ! AddJump("road","/domains/Ylsrim/room/kaliid6",JUMP_INTO); } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/etc/roof.c ds2.0r27/lib/domains/Ylsrim/etc/roof.c *** ds1.1/lib/domains/Ylsrim/etc/roof.c Sun Feb 1 21:30:08 1998 --- ds2.0r27/lib/domains/Ylsrim/etc/roof.c Wed Jul 5 00:01:11 2006 *************** *** 16,23 **** SetId("roof"); SetAdjectives("adobe", "bank"); SetShort("a roof"); ! SetLong("The bank roof looks over the road below. " ! "The adobe wall looks like you could climb down it. " ! "A hole in the center of the roof opens into the bank."); ! SetJump("/domains/Ylsrim/room/bank", JUMP_FROM); } --- 16,24 ---- SetId("roof"); SetAdjectives("adobe", "bank"); SetShort("a roof"); ! SetLong("The bank roof looks over the road below. " ! "Maybe you could jump into it." ! "The adobe wall looks like you could climb down it. "); ! //"A hole in the center of the roof opens into the bank."); ! AddJump("roof","/domains/Ylsrim/room/bank", JUMP_FROM); } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/etc/roof_wall.c ds2.0r27/lib/domains/Ylsrim/etc/roof_wall.c *** ds1.1/lib/domains/Ylsrim/etc/roof_wall.c Sun Feb 1 21:30:08 1998 --- ds2.0r27/lib/domains/Ylsrim/etc/roof_wall.c Wed Jul 5 00:01:11 2006 *************** *** 17,22 **** SetAdjectives("adobe", "bank"); SetShort("an adobe wall"); SetLong("It has enough holes that you can get a good foot hold and " ! "climb down it!"); SetClimb("/domains/Ylsrim/room/kaliid6", CLIMB_DOWN); } --- 17,22 ---- SetAdjectives("adobe", "bank"); SetShort("an adobe wall"); SetLong("It has enough holes that you can get a good foot hold and " ! "climb down it!"); SetClimb("/domains/Ylsrim/room/kaliid6", CLIMB_DOWN); } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/etc/shovel.c ds2.0r27/lib/domains/Ylsrim/etc/shovel.c *** ds1.1/lib/domains/Ylsrim/etc/shovel.c Sun Feb 1 21:30:07 1998 --- ds2.0r27/lib/domains/Ylsrim/etc/shovel.c Wed Jul 5 00:01:11 2006 *************** *** 16,22 **** SetAdjectives("wooden"); SetShort("a shovel"); SetLong("A plain, wooden shovel. You probably can dig things with " ! "it."); SetMass(87); SetValue(50); } --- 16,25 ---- SetAdjectives("wooden"); SetShort("a shovel"); SetLong("A plain, wooden shovel. You probably can dig things with " ! "it."); SetMass(87); SetValue(50); } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/etc/torch.c ds2.0r27/lib/domains/Ylsrim/etc/torch.c *** ds1.1/lib/domains/Ylsrim/etc/torch.c Sun Feb 1 21:30:07 1998 --- ds2.0r27/lib/domains/Ylsrim/etc/torch.c Wed Jul 5 00:01:11 2006 *************** *** 4,12 **** */ #include <lib.h> ! inherit LIB_TORCH; ! static void create() { torch::create(); SetKeyName("torch"); --- 4,12 ---- */ #include <lib.h> ! inherit LIB_TORCH; ! static void create() { torch::create(); SetKeyName("torch"); diff -c -r --new-file ds1.1/lib/domains/Ylsrim/etc/wall.c ds2.0r27/lib/domains/Ylsrim/etc/wall.c *** ds1.1/lib/domains/Ylsrim/etc/wall.c Sun Feb 1 21:30:08 1998 --- ds2.0r27/lib/domains/Ylsrim/etc/wall.c Wed Jul 5 00:01:11 2006 *************** *** 17,22 **** SetAdjectives("adobe", "bank"); SetShort("an adobe wall"); SetLong("It has enough holes that you can get a good foot hold and " ! "climb up it!"); SetClimb("/domains/Ylsrim/room/bank_roof", CLIMB_UP); } --- 17,22 ---- SetAdjectives("adobe", "bank"); SetShort("an adobe wall"); SetLong("It has enough holes that you can get a good foot hold and " ! "climb up it!"); SetClimb("/domains/Ylsrim/room/bank_roof", CLIMB_UP); } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/fish/shark.c ds2.0r27/lib/domains/Ylsrim/fish/shark.c *** ds1.1/lib/domains/Ylsrim/fish/shark.c Sun Feb 1 21:30:04 1998 --- ds2.0r27/lib/domains/Ylsrim/fish/shark.c Wed Jul 5 00:01:11 2006 *************** *** 17,26 **** SetId( ({ "shark", "blue shark" }) ); SetShort("a blue shark"); SetLong("It is a huge, long fish with razor sharp teeth and a carnivorous " ! "appetite."); SetMass(100); SetFight(40); ! SetFood(DIR_STANDARD_DOMAIN "/meal/shark"); } int eventCatch(object who, object pole) { --- 17,26 ---- SetId( ({ "shark", "blue shark" }) ); SetShort("a blue shark"); SetLong("It is a huge, long fish with razor sharp teeth and a carnivorous " ! "appetite."); SetMass(100); SetFight(40); ! SetFood("/domains/Ylsrim"+ "/meal/shark"); } int eventCatch(object who, object pole) { *************** *** 31,37 **** void BiteMe(object who) { who->eventPrint("The shark bites you before it dies!"); environment(who)->eventPrint("The shark bites " + (string)who->GetName() + ! " before it dies!", who); who->eventReceiveDamage(this_object(), KNIFE, random(20), 0, ! (string)who->GetRandomLimb("right hand")); } --- 31,37 ---- void BiteMe(object who) { who->eventPrint("The shark bites you before it dies!"); environment(who)->eventPrint("The shark bites " + (string)who->GetName() + ! " before it dies!", who); who->eventReceiveDamage(this_object(), KNIFE, random(20), 0, ! (string)who->GetRandomLimb("right hand")); } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/meal/ale.c ds2.0r27/lib/domains/Ylsrim/meal/ale.c *** ds1.1/lib/domains/Ylsrim/meal/ale.c Sun Feb 1 21:30:04 1998 --- ds2.0r27/lib/domains/Ylsrim/meal/ale.c Wed Jul 5 00:01:11 2006 *************** *** 15,25 **** SetShort("a bottle of ale"); SetLong("A nice bottle of Lars' famous Ylsrim Ale."); SetMass(60); SetMealType(MEAL_DRINK | MEAL_ALCOHOL); SetStrength(10); SetMealMessages("You drink a wonderful bottle of Ylsrim Ale.", ! "$N drinks a wonderful bottle of Ylsrim Ale."); SetEmptyName("bottle"); SetEmptyShort("an empty bottle of Ylsrim Ale"); SetEmptyLong("It is an empty brown bottle that once held some ale."); } --- 15,29 ---- SetShort("a bottle of ale"); SetLong("A nice bottle of Lars' famous Ylsrim Ale."); SetMass(60); + SetBaseCost("electrum", 20); SetMealType(MEAL_DRINK | MEAL_ALCOHOL); SetStrength(10); SetMealMessages("You drink a wonderful bottle of Ylsrim Ale.", ! "$N drinks a wonderful bottle of Ylsrim Ale."); SetEmptyName("bottle"); SetEmptyShort("an empty bottle of Ylsrim Ale"); SetEmptyLong("It is an empty brown bottle that once held some ale."); } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/meal/stew.c ds2.0r27/lib/domains/Ylsrim/meal/stew.c *** ds1.1/lib/domains/Ylsrim/meal/stew.c Sun Feb 1 21:30:04 1998 --- ds2.0r27/lib/domains/Ylsrim/meal/stew.c Wed Jul 5 00:01:11 2006 *************** *** 15,24 **** SetAdjectives( ({ "elven" }) ); SetShort("some hot elven stew"); SetLong("This stew is made from the left-overs of other dishes served at " ! "Toral Restaurant."); SetMass(10); SetMealType(MEAL_FOOD); SetStrength(3); SetMealMessages("The stew clears your sinuses!", ! "$N perks up after eating some elven stew."); } --- 15,24 ---- SetAdjectives( ({ "elven" }) ); SetShort("some hot elven stew"); SetLong("This stew is made from the left-overs of other dishes served at " ! "Toral Restaurant."); SetMass(10); SetMealType(MEAL_FOOD); SetStrength(3); SetMealMessages("The stew clears your sinuses!", ! "$N perks up after eating some elven stew."); } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/npc/balrog.c ds2.0r27/lib/domains/Ylsrim/npc/balrog.c *** ds1.1/lib/domains/Ylsrim/npc/balrog.c Sun Feb 1 21:30:04 1998 --- ds2.0r27/lib/domains/Ylsrim/npc/balrog.c Wed Jul 5 00:01:11 2006 *************** *** 15,22 **** SetAdjectives("wicked", "ugly"); SetShort("a wicked balrog"); SetLong("Balrogs are an ugly sort that hide out among the many " ! "crevices and canyons in the mountains. This one is " ! "extremely tall, and evidently not all too pleased to see you."); SetLevel(8); // level, race, and class determine NPC's power SetRace("balrog"); // must be some valid race from mraces command SetClass("fighter"); // needs a class! --- 15,22 ---- SetAdjectives("wicked", "ugly"); SetShort("a wicked balrog"); SetLong("Balrogs are an ugly sort that hide out among the many " ! "crevices and canyons in the mountains. This one is " ! "extremely tall, and evidently not all too pleased to see you."); SetLevel(8); // level, race, and class determine NPC's power SetRace("balrog"); // must be some valid race from mraces command SetClass("fighter"); // needs a class! diff -c -r --new-file ds1.1/lib/domains/Ylsrim/npc/fighter.c ds2.0r27/lib/domains/Ylsrim/npc/fighter.c *** ds1.1/lib/domains/Ylsrim/npc/fighter.c Sun Feb 1 21:30:04 1998 --- ds2.0r27/lib/domains/Ylsrim/npc/fighter.c Wed Jul 5 00:01:11 2006 *************** *** 14,29 **** SetId("roshd", "roshd burlyneck"); SetShort("Roshd Burlyneck, Master Warrior"); SetLong("Roshd Burlyneck is the master warrior of " ! "the fighters. Immense in size, Roshd stands well " ! "over seven feet tall. Long brown hair streams " ! "out behind him, and his biceps are so large " ! "it would take several hand spans to fit around " ! "them. Roshd's armour is worn and covered in dirt " ! "as if he has just returned from combat. " ! "Roshd initiates new members into the ways of " ! "combat. To learn more about becoming a fighter " ! "ask him to \"describe fighters\". If you choose to become " ! "a fighter, ask him to \"join fighters\"."); SetLevel(45); SetRace("klingon"); SetClass("fighter"); --- 14,29 ---- SetId("roshd", "roshd burlyneck"); SetShort("Roshd Burlyneck, Master Warrior"); SetLong("Roshd Burlyneck is the master warrior of " ! "the fighters. Immense in size, Roshd stands well " ! "over seven feet tall. Long brown hair streams " ! "out behind him, and his biceps are so large " ! "it would take several hand spans to fit around " ! "them. Roshd's armor is worn and covered in dirt " ! "as if he has just returned from combat. " ! "Roshd initiates new members into the ways of " ! "combat. To learn more about becoming a fighter " ! "ask him to \"describe fighters\". If you choose to become " ! "a fighter, ask him to \"join fighters\"."); SetLevel(45); SetRace("klingon"); SetClass("fighter"); diff -c -r --new-file ds1.1/lib/domains/Ylsrim/npc/lars.c ds2.0r27/lib/domains/Ylsrim/npc/lars.c *** ds1.1/lib/domains/Ylsrim/npc/lars.c Sun Feb 1 21:30:04 1998 --- ds2.0r27/lib/domains/Ylsrim/npc/lars.c Wed Jul 5 00:01:11 2006 *************** *** 16,24 **** SetShort("Lars, the keeper of Lars' Pub"); SetLevel(12); SetLong("Lars is the owner of Lars' Pub, and old, famous " ! "drinking establishment in the heart of the Ylsrim Bazaar. " ! "He is an unassuming elf, but quite jovial. You may ask him to " ! "serve whatever drinks are on his menu."); SetGender("male"); SetMorality(40); SetRace("elf"); --- 16,24 ---- SetShort("Lars, the keeper of Lars' Pub"); SetLevel(12); SetLong("Lars is the owner of Lars' Pub, and old, famous " ! "drinking establishment in the heart of the Ylsrim Bazaar. " ! "He is an unassuming elf, but quite jovial. You may ask him to " ! "serve whatever drinks are on his menu."); SetGender("male"); SetMorality(40); SetRace("elf"); *************** *** 31,35 **** // He takes electrum SetLocalCurrency("electrum"); // What he sells ! SetMenuItems(([ "ale" : DIR_STANDARD_DOMAIN "/meal/ale" ])); } --- 31,40 ---- // He takes electrum SetLocalCurrency("electrum"); // What he sells ! SetMenuItems(([ ! ({ "ale", "beer" }) : "/domains/Ylsrim/meal/ale", ! ])); ! } ! void init(){ ! ::init(); } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/npc/max.c ds2.0r27/lib/domains/Ylsrim/npc/max.c *** ds1.1/lib/domains/Ylsrim/npc/max.c Sun Feb 1 21:30:04 1998 --- ds2.0r27/lib/domains/Ylsrim/npc/max.c Wed Jul 5 00:01:11 2006 *************** *** 13,33 **** vendor::create(); SetKeyName("max"); SetId("max", "vendor", "shop keeper", "keeper", "shopkeeper"); ! SetShort("Max, the local armourer"); ! SetLong("He buys and sells goods for armours."); SetLevel(15); SetRace( "elf"); SetGender("male"); SetMorality(40); AddCurrency("electrum", random(200)); // Define the place where he stores stuff to sell ! SetStorageRoom(DIR_STANDARD_DOMAIN "/room/armoury_storage"); // How good a vendor is he? Should be 100+ SetSkill("bargaining", 110); // He should stay in his shop SetProperty("no bump", 1); // He accepts electrum SetLocalCurrency("electrum"); ! // He sells armours ! SetVendorType(VT_ARMOUR); } --- 13,33 ---- vendor::create(); SetKeyName("max"); SetId("max", "vendor", "shop keeper", "keeper", "shopkeeper"); ! SetShort("Max, the local armorer"); ! SetLong("He buys and sells goods for armors."); SetLevel(15); SetRace( "elf"); SetGender("male"); SetMorality(40); AddCurrency("electrum", random(200)); // Define the place where he stores stuff to sell ! SetStorageRoom("/domains/Ylsrim"+ "/room/armory_storage"); // How good a vendor is he? Should be 100+ SetSkill("bargaining", 110); // He should stay in his shop SetProperty("no bump", 1); // He accepts electrum SetLocalCurrency("electrum"); ! // He sells armors ! SetVendorType(VT_ARMOR); } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/npc/priest.c ds2.0r27/lib/domains/Ylsrim/npc/priest.c *** ds1.1/lib/domains/Ylsrim/npc/priest.c Sun Feb 1 21:30:04 1998 --- ds2.0r27/lib/domains/Ylsrim/npc/priest.c Wed Jul 5 00:01:11 2006 *************** *** 14,24 **** SetId("ixtala", "priest"); SetShort("Ix'Tala, high priestess of the Priests"); SetLong("Ix'Tala initiates priests into the Priests class as well as " ! "converts the wayward to the truth of the Dalin religion. " ! "To learn more about becoming a priest " ! "ask her to \"describe priests\". If you choose to become " ! "a priest, ask her to \"join priests\". Of course, you can " ! "convert by asking her to \"convert me\"."); SetLevel(45); SetRace("klingon"); SetClass("priest"); --- 14,24 ---- SetId("ixtala", "priest"); SetShort("Ix'Tala, high priestess of the Priests"); SetLong("Ix'Tala initiates priests into the Priests class as well as " ! "converts the wayward to the truth of the Dalin religion. " ! "To learn more about becoming a priest " ! "ask her to \"describe priests\". If you choose to become " ! "a priest, ask her to \"join priests\". Of course, you can " ! "convert by asking her to \"convert me\"."); SetLevel(45); SetRace("klingon"); SetClass("priest"); diff -c -r --new-file ds1.1/lib/domains/Ylsrim/npc/shiela.c ds2.0r27/lib/domains/Ylsrim/npc/shiela.c *** ds1.1/lib/domains/Ylsrim/npc/shiela.c Sun Feb 1 21:30:04 1998 --- ds2.0r27/lib/domains/Ylsrim/npc/shiela.c Wed Jul 5 00:01:11 2006 *************** *** 22,28 **** SetListen("She has a very gruff voice."); AddCurrency("electrum", random(200)); // the room where she stores stuff to sell ! SetStorageRoom(DIR_STANDARD_DOMAIN "/room/weaponry_storage"); // How good is she at being a vendor? Should be 100+ SetSkill("bargaining", 150); // This vendor belongs in a particular shop, don't bump her --- 22,28 ---- SetListen("She has a very gruff voice."); AddCurrency("electrum", random(200)); // the room where she stores stuff to sell ! SetStorageRoom("/domains/Ylsrim"+ "/room/weaponry_storage"); // How good is she at being a vendor? Should be 100+ SetSkill("bargaining", 150); // This vendor belongs in a particular shop, don't bump her diff -c -r --new-file ds1.1/lib/domains/Ylsrim/npc/traveler.c ds2.0r27/lib/domains/Ylsrim/npc/traveler.c *** ds1.1/lib/domains/Ylsrim/npc/traveler.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/Ylsrim/npc/traveler.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,84 ---- + /* /domains/Ylsrim/npc/traveller.c + * From the Dead Souls V Object Library + * An example of a wandering sentient who steals + * Created by Descartes of Borg 960302 + */ + + #include <lib.h> + + inherit LIB_SENTIENT; + + // This steal function will get called randomly as set up in + // the SetAction() function in create(). It checks to see if + // someone is around from whom this guy can steal + + static void Steal() { + object array obs; + object target; + string cmd; + int i; + + if( !environment() ) { + return; + } + // Find all living things that are not me in the same room as me + obs = filter(all_inventory(environment()), + (: living($1) && $1 != this_object() :)); + i = sizeof(obs); + if( i == 0 ) { // no one to steal from + return; + } + if( i != 1 ) { // many potential targets + // pick one + i = random(i); + } + else { // only oone target, so pick obs[0] + i = 0; + } + target = obs[i]; + // Find all items on the target that can be stolen + obs = filter(all_inventory(target), + (: !($1->GetProperty("no steal")) :)); + i = sizeof(obs); + if( i == 0 ) { // no goods, let's try to get some cash + cmd = "pick " + target->GetKeyName(); + } + else { // heh, some goodies + if( i != 1 ) { // many goodies + // pick one + i = random(i); + } + else { + i = 0; + } + cmd = "steal " + obs[i]->GetKeyName() + " from " + + target->GetKeyName(); + } + // now do the steal or pick + eventForce(cmd); + } + static void create() { + sentient::create(); + SetKeyName("traveler"); + SetId( ({"traveller", "human", "npc"}) ); + SetShort("a traveler"); + SetLong("He looks a bit worn down, but also a bit shifty."); + SetLevel(5); + SetRace("human"); + SetClass("fighter"); + SetGender("male"); + SetMorality(-200); + AddCurrency("electrum", 1 + random(100)); + SetInventory(([ "/domains/Ylsrim/armor/leather_armor" : "wear armor" ])); + // Check if he can steal at a 5% chance/heart beat + SetAction(5, (: Steal :)); + // Don't want him getting cloned all over the place + SetUnique(1); + // Set him to wander + SetWander(25); + // Any time he hears the word dork, he goes ballistic! + SetTalkResponses(([ "dork" : "no, YOU are a dork!" ])); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/npc/traveller.c ds2.0r27/lib/domains/Ylsrim/npc/traveller.c *** ds1.1/lib/domains/Ylsrim/npc/traveller.c Sun Feb 1 21:30:04 1998 --- ds2.0r27/lib/domains/Ylsrim/npc/traveller.c Wed Jul 5 00:01:11 2006 *************** *** 11,16 **** --- 11,17 ---- // This steal function will get called randomly as set up in // the SetAction() function in create(). It checks to see if // someone is around from whom this guy can steal + static void Steal() { object array obs; object target; *************** *** 22,28 **** } // Find all living things that are not me in the same room as me obs = filter(all_inventory(environment()), ! (: living($1) && $1 != this_object() :)); i = sizeof(obs); if( i == 0 ) { // no one to steal from return; --- 23,29 ---- } // Find all living things that are not me in the same room as me obs = filter(all_inventory(environment()), ! (: living($1) && $1 != this_object() :)); i = sizeof(obs); if( i == 0 ) { // no one to steal from return; *************** *** 37,43 **** target = obs[i]; // Find all items on the target that can be stolen obs = filter(all_inventory(target), ! (: !($1->GetProperty("no steal")) :)); i = sizeof(obs); if( i == 0 ) { // no goods, let's try to get some cash cmd = "pick " + target->GetKeyName(); --- 38,44 ---- target = obs[i]; // Find all items on the target that can be stolen obs = filter(all_inventory(target), ! (: !($1->GetProperty("no steal")) :)); i = sizeof(obs); if( i == 0 ) { // no goods, let's try to get some cash cmd = "pick " + target->GetKeyName(); *************** *** 51,75 **** i = 0; } cmd = "steal " + obs[i]->GetKeyName() + " from " + ! target->GetKeyName(); } // now do the steal or pick eventForce(cmd); } - static void create() { sentient::create(); ! SetKeyName("traveller"); ! SetId("traveller"); ! SetShort("a traveller"); SetLong("He looks a bit worn down, but also a bit shifty."); SetLevel(5); ! SetRace("artrell"); SetClass("fighter"); SetGender("male"); SetMorality(-200); AddCurrency("electrum", 1 + random(100)); ! SetInventory(([ DIR_STANDARD_DOMAIN "/armour/artrell_armour" : "wear" ])); // Check if he can steal at a 5% chance/heart beat SetAction(5, (: Steal :)); // Don't want him getting cloned all over the place --- 52,75 ---- i = 0; } cmd = "steal " + obs[i]->GetKeyName() + " from " + ! target->GetKeyName(); } // now do the steal or pick eventForce(cmd); } static void create() { sentient::create(); ! SetKeyName("traveler"); ! SetId( ({"traveller", "human", "npc"}) ); ! SetShort("a traveler"); SetLong("He looks a bit worn down, but also a bit shifty."); SetLevel(5); ! SetRace("human"); SetClass("fighter"); SetGender("male"); SetMorality(-200); AddCurrency("electrum", 1 + random(100)); ! SetInventory(([ "/domains/Ylsrim/armor/leather_armor" : "wear armor" ])); // Check if he can steal at a 5% chance/heart beat SetAction(5, (: Steal :)); // Don't want him getting cloned all over the place *************** *** 79,81 **** --- 79,84 ---- // Any time he hears the word dork, he goes ballistic! SetTalkResponses(([ "dork" : "no, YOU are a dork!" ])); } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/obj/stargate.c ds2.0r27/lib/domains/Ylsrim/obj/stargate.c *** ds1.1/lib/domains/Ylsrim/obj/stargate.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/Ylsrim/obj/stargate.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,28 ---- + #include <lib.h> + #include <daemons.h> + #include "/lib/include/stargate.h" + + inherit LIB_STARGATE; + + int ReadScreen(); + + void create() + { + ::create(); + SetOrigin("tower", "/domains/Ylsrim/room/tower"); + SetRead(([ ({ "screen" }) : (: ReadScreen :) ]) ); + SetItems(([ ({ "screen" }) : "a computer screen which shows the status of the gate network" ]) ); + } + + void init() + { + ::init(); + } + + int ReadScreen() + { + write("stargate network status\n"); + write("-----------------------\n"); + write("\n"); + + } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/room/adv_hall.c ds2.0r27/lib/domains/Ylsrim/room/adv_hall.c *** ds1.1/lib/domains/Ylsrim/room/adv_hall.c Sun Feb 1 21:30:04 1998 --- ds2.0r27/lib/domains/Ylsrim/room/adv_hall.c Wed Jul 5 00:01:11 2006 *************** *** 4,31 **** */ #include <lib.h> ! inherit LIB_ROOM; ! static void create() { ! object ob; ! room::create(); ! SetClimate("indoors"); ! SetAmbientLight(35); ! SetShort("the adventurer's hall"); ! SetLong("A bulletin board sits in the middle of this circular room where " ! "adventurers from all over gather to meet one another. Kaliid Road " ! "lies to the south. Stairs lead up to the tower."); ! SetItems( ([ "stairs" : "They spiral up into the tower which looks over " ! "Kaliid Road.", ! "tower" : "You can't see much in the darkness into which the " ! "stairs disappear." ])); ! SetExits( ([ ! "up" : __DIR__ "tower", ! "south" : __DIR__ "kaliid4" ]) ); ! SetObviousExits("u, s"); ! ob = new("/domains/Ylsrim/etc/adv_board"); ! ob->set_max_posts(30); ! ob->eventMove(this_object()); } --- 4,34 ---- */ #include <lib.h> ! inherit LIB_ROOM; ! static void create() { ! object ob; ! room::create(); ! SetClimate("indoors"); ! SetAmbientLight(30); ! SetShort("the adventurer's hall"); ! SetLong("A bulletin board sits in the middle of this circular room where " ! "adventurers from all over gather to meet one another. Kaliid Road " ! "lies to the south. Stairs lead up to the tower."); ! SetItems( ([ "stairs" : "They spiral up into the tower which looks over " ! "Kaliid Road.", ! "tower" : "You can't see much in the darkness into which the " ! "stairs disappear." ])); ! SetExits( ([ ! "up" : "/domains/Ylsrim/room/"+ "tower", ! "south" : "/domains/Ylsrim/room/"+ "kaliid4" ]) ); ! SetObviousExits("u, s"); ! ob = new("/domains/Ylsrim/etc/adv_board"); ! ob->set_max_posts(30); ! ob->eventMove(this_object()); ! } ! void init(){ ! ::init(); } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/room/armory.c ds2.0r27/lib/domains/Ylsrim/room/armory.c *** ds1.1/lib/domains/Ylsrim/room/armory.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/Ylsrim/room/armory.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,59 ---- + /* /domains/Ylsrim/room/armory.c + * from the Dead Souls V Object Library + * created by Descartes of Borg 951023 + */ + + #include <lib.h> + #include <dirs.h> + + inherit LIB_ROOM; + + string CheckOpen(string str); + string CheckItem(string str); + + static void create() { + room::create(); + SetTown("Ylsrim"); + SetClimate("indoors"); + SetAmbientLight(27); + SetShort("the Ylsrim armory"); + SetLong((: CheckOpen :)); + SetItems( ([ ({ "case", "cases" }) : (: CheckItem :), + "bazaar" : "People from all about are wandering around, looking " + "for a bargain." ]) ); + SetObviousExits("w"); + SetExits( ([ "west" : "/domains/Ylsrim/room/"+ "bazaar" ]) ); + SetInventory( ([ "/domains/Ylsrim"+ "/npc/max" : 1 ]) ); + } + + string CheckOpen(string str) { + object ob; + + ob = present("vendor"); + if( query_night() ) { + if( ob ) ob->eventDestruct(); + return ("The cases of the armory are empty, as the armory " + "has closed for the night. The bazaar is " + "west."); + } + if( !ob ) + return ("Fresh blood is splattered across broken cases which once " + "housed display armor sold in this armory. The armor is " + "gone, and the vendor clearly murdered. All you can do is " + "shake your head and exit to the west."); + return ("Sealed cases contain display armor, exemplifying what the local " + "vendor, Max, has to offer. He buys and sells all sorts of " + "armor from adventurers who come here to sell of their " + "discovered goods, or equip to continue adventuring. An exit " + "is west."); + } + + string CheckItem(string str) { + if( query_night() ) return "They are empty."; + else if ( present("vendor") ) return "They are filled with armor."; + else return "They are broken and covered in blood."; + } + + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/room/armory_storage.c ds2.0r27/lib/domains/Ylsrim/room/armory_storage.c *** ds1.1/lib/domains/Ylsrim/room/armory_storage.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/Ylsrim/room/armory_storage.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,28 ---- + /* /domains/Ylsrim/room/armory_storage.c + * from the Dead Souls V Object Library + * created by Descartes of Borg 960302 + */ + + #include <lib.h> + + inherit LIB_ROOM; + + static void create() { + room::create(); + SetNoClean(1); + SetTown("Ylsrim"); + SetProperties( ([ "login" : "/domains/Ylsrim/room/"+ "armory" ]) ); + SetClimate("indoors"); + SetShort("armory storage"); + SetLong("Armory storage."); + SetObviousExits("w"); + SetExits( ([ "west" : "/domains/Ylsrim/room/"+ "armory" ]) ); + } + + int CanReceive(object ob) { + if( !living(ob) || creatorp(ob) ) return room::CanReceive(ob); + else return 0; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/room/armoury.c ds2.0r27/lib/domains/Ylsrim/room/armoury.c *** ds1.1/lib/domains/Ylsrim/room/armoury.c Sun Feb 1 21:30:05 1998 --- ds2.0r27/lib/domains/Ylsrim/room/armoury.c Wed Dec 31 19:00:00 1969 *************** *** 1,58 **** - /* /domains/Ylsrim/room/armoury.c - * from the Dead Souls V Object Library - * created by Descartes of Borg 951023 - */ - - #include <lib.h> - #include <dirs.h> - - inherit LIB_ROOM; - - string CheckOpen(string str); - string CheckItem(string str); - - static void create() { - room::create(); - SetTown("Ylsrim"); - SetClimate("indoors"); - SetAmbientLight(27); - SetShort("the Ylsrim armoury"); - SetLong((: CheckOpen :)); - SetItems( ([ ({ "case", "cases" }) : (: CheckItem :), - "bazaar" : "People from all about are wandering around, looking " - "for a bargain." ]) ); - SetObviousExits("w"); - SetExits( ([ "west" : __DIR__ "bazaar" ]) ); - SetInventory( ([ DIR_STANDARD_DOMAIN "/npc/max" : 1 ]) ); - } - - string CheckOpen(string str) { - object ob; - - ob = present("vendor"); - if( query_night() ) { - if( ob ) ob->eventDestruct(); - return ("The cases of the armoury are empty, as the armoury " - "has closed for the night. The bazaar is " - "west."); - } - if( !ob ) - return ("Fresh blood is splattered across broken cases which once " - "housed display armour sold in this armoury. The armour is " - "gone, and the vendor clearly murdered. All you can do is " - "shake your head and exit to the west."); - return ("Sealed cases contain display armour, exemplifying what the local " - "vendor, Max, has to offer. He buys and sells all sorts of " - "armour from adventurers who come here to sell of their " - "discovered goods, or equip to continue adventuring. An exit " - "is west."); - } - - string CheckItem(string str) { - if( str == "case" || str == "cases" ) { - if( query_night() ) return "They are empty."; - else if ( present("vendor") ) return "They are filled with armour."; - else return "They are broken and covered in blood."; - } - } - --- 0 ---- diff -c -r --new-file ds1.1/lib/domains/Ylsrim/room/armoury_storage.c ds2.0r27/lib/domains/Ylsrim/room/armoury_storage.c *** ds1.1/lib/domains/Ylsrim/room/armoury_storage.c Sun Feb 1 21:30:05 1998 --- ds2.0r27/lib/domains/Ylsrim/room/armoury_storage.c Wed Dec 31 19:00:00 1969 *************** *** 1,25 **** - /* /domains/Ylsrim/room/armoury_storage.c - * from the Dead Souls V Object Library - * created by Descartes of Borg 960302 - */ - - #include <lib.h> - - inherit LIB_ROOM; - - static void create() { - room::create(); - SetNoClean(1); - SetTown("Ylsrim"); - SetProperties( ([ "login" : __DIR__ "armoury" ]) ); - SetClimate("indoors"); - SetShort("armoury storage"); - SetLong("Armoury storage."); - SetObviousExits("w"); - SetExits( ([ "west" : __DIR__ "armoury" ]) ); - } - - int CanReceive(object ob) { - if( !living(ob) || creatorp(ob) ) return room::CanReceive(ob); - else return 0; - } --- 0 ---- diff -c -r --new-file ds1.1/lib/domains/Ylsrim/room/bank_roof.c ds2.0r27/lib/domains/Ylsrim/room/bank_roof.c *** ds1.1/lib/domains/Ylsrim/room/bank_roof.c Sun Feb 1 21:30:06 1998 --- ds2.0r27/lib/domains/Ylsrim/room/bank_roof.c Wed Jul 5 00:01:11 2006 *************** *** 12,29 **** room::create(); SetTown("Ylsrim"); SetClimate("arid"); ! SetNightLight(7); SetShort("The roof of the Bank of Ylsrim"); SetDayLong("From your perfect vantage point atop the hot adobe of " ! "the Bank of Ylsrim you can see nearly the entire desert " ! "town. On the south side of the bank, the wall is rough " ! "enough to get a foothold down into Kaliid Road. The wall " ! "on the other sides of the building are simply too smooth to " ! "climb down. A hole in the center of the roof opens into " ! "the bank."); SetNightLong("The lights of Ylsrim look beautiful from this vantage " ! "on the bank roof. You can barely make out a hole in " ! "the middle of the roof."); AddItem("adobe", "The walls and roof are made of this substance."); // this is the wall that can be climbed down AddItem(new("/domains/Ylsrim/etc/roof_wall")); --- 12,27 ---- room::create(); SetTown("Ylsrim"); SetClimate("arid"); ! SetAmbientLight(30); SetShort("The roof of the Bank of Ylsrim"); SetDayLong("From your perfect vantage point atop the hot adobe of " ! "the Bank of Ylsrim you can see nearly the entire desert " ! "town. On the south side of the bank, the wall is rough " ! "enough to get a foothold down into Kaliid Road. The wall " ! "on the other sides of the building are simply too smooth to " ! "climb down. You might be able to jump into the road, as well."); SetNightLong("The lights of Ylsrim look beautiful from this vantage " ! "on the bank roof."); AddItem("adobe", "The walls and roof are made of this substance."); // this is the wall that can be climbed down AddItem(new("/domains/Ylsrim/etc/roof_wall")); *************** *** 31,36 **** AddItem(new("/domains/Ylsrim/etc/road")); // this is the roof people can jump from AddItem(new("/domains/Ylsrim/etc/roof")); ! // this is the hole people can jump into ! AddItem(new("/domains/Ylsrim/etc/hole")); } --- 29,35 ---- AddItem(new("/domains/Ylsrim/etc/road")); // this is the roof people can jump from AddItem(new("/domains/Ylsrim/etc/roof")); ! } ! void init(){ ! ::init(); } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/room/bazaar.c ds2.0r27/lib/domains/Ylsrim/room/bazaar.c *** ds1.1/lib/domains/Ylsrim/room/bazaar.c Sun Feb 1 21:30:04 1998 --- ds2.0r27/lib/domains/Ylsrim/room/bazaar.c Wed Jul 5 00:01:11 2006 *************** *** 18,79 **** // the climate in Ylsrim is arid because it is a desert town SetClimate("arid"); // the is the amount of light the street lamps make at night ! SetNightLight(18); // the obvious exits tell people how to leave the room - SetObviousExits("n, s, enter armoury, enter weaponry"); // set the sounds people hear SetListen("Vendors are begging you to come look at their goods."); // set the short description... should not be capitalized SetShort("the central bazaar of Ylsrim"); // this is the description people see at day SetDayLong("Shops and vendors selling all types of goods fill " ! "the central bazaar of Ylsrim. Local villagers and " ! "exotic travellers are passing about you in search of a " ! "bargain, or even in some cases, in search of trouble. " ! "Kaliid Road crosses Ylsrim from the west to the east just " ! "north of you, with an armoury and a weapon shop straddling " ! "both sides of the bazaar. The bazaar stretches on south."); // this is the description people see at night SetNightLong("Though most areas of Ylsrim are peaceful right now, " ! "the central bazaar is still filled with people doing " ! "business, even though most of the shops are closed. " ! "Kaliid Road is just north of here, and a closed armoury " ! "and weapons shop sit on both sides of the bazaar. " ! "The bazaar stretches south."); // set up dummy items... the first few are simple AddItem(({ "villager", "traveller" }), ! "Both villagers and travellers are out looking for good " ! "deals."); AddItem(({ "road" }), "It leads through Ylsrim from the Great Desert " ! "in the west towards more fertile land east.", ({ "kaliid" })); ! // people need to enter the armoury, so we need to do something special ! // first create an armoury dummy item ! ob = new(LIB_DUMMY, ({ "armoury", "shop" }), ! function(string str) { ! if( query_night() ) { ! return "It is closed."; ! } ! else { ! return "It is open."; ! } ! }, ({ "armour" })); ! // set it so when people 'enter armoury', they move to the armoury ! ob->SetEnter(__DIR__ "armoury"); // now add it as an item AddItem(ob); // do the same stuff for the weaponry ob = new(LIB_DUMMY, ({ "weaponry", "shop" }), ! function(string str) { ! if( query_night() ) { ! return "It is closed."; ! } ! else { ! return "It is open."; ! } ! }, ({ "weapon" })); ! ob->SetEnter(__DIR__ "weaponry"); AddItem(ob); // set the directional exits ! SetExits( ([ "north" : __DIR__ "kaliid4", ! "south" : __DIR__ "s_bazaar" ]) ); } --- 18,81 ---- // the climate in Ylsrim is arid because it is a desert town SetClimate("arid"); // the is the amount of light the street lamps make at night ! SetAmbientLight(30); // the obvious exits tell people how to leave the room // set the sounds people hear SetListen("Vendors are begging you to come look at their goods."); // set the short description... should not be capitalized SetShort("the central bazaar of Ylsrim"); // this is the description people see at day SetDayLong("Shops and vendors selling all types of goods fill " ! "the central bazaar of Ylsrim. Local villagers and " ! "exotic travellers are passing about you in search of a " ! "bargain, or even in some cases, in search of trouble. " ! "Kaliid Road crosses Ylsrim from the west to the east just " ! "north of you, with an armory and a weapon shop straddling " ! "both sides of the bazaar. The bazaar stretches on south."); // this is the description people see at night SetNightLong("Though most areas of Ylsrim are peaceful right now, " ! "the central bazaar is still filled with people doing " ! "business, even though most of the shops are closed. " ! "Kaliid Road is just north of here, and a closed armory " ! "and weapons shop sit on both sides of the bazaar. " ! "The bazaar stretches south."); // set up dummy items... the first few are simple AddItem(({ "villager", "traveller" }), ! "Both villagers and travellers are out looking for good " ! "deals."); AddItem(({ "road" }), "It leads through Ylsrim from the Great Desert " ! "in the west towards more fertile land east.", ({ "kaliid" })); ! // people need to enter the armory, so we need to do something special ! // first create an armory dummy item ! ob = new(LIB_DUMMY, ({ "armory", "shop" }), ! function(string str) { ! if( query_night() ) { ! return "It is closed."; ! } ! else { ! return "It is open."; ! } ! }, ({ "armor" })); ! // set it so when people 'enter armory', they move to the armory ! ob->SetEnter("/domains/Ylsrim/room/"+ "armory"); // now add it as an item AddItem(ob); // do the same stuff for the weaponry ob = new(LIB_DUMMY, ({ "weaponry", "shop" }), ! function(string str) { ! if( query_night() ) { ! return "It is closed."; ! } ! else { ! return "It is open."; ! } ! }, ({ "weapon" })); ! ob->SetEnter("/domains/Ylsrim/room/"+ "weaponry"); AddItem(ob); // set the directional exits ! SetExits( ([ "north" : "/domains/Ylsrim/room/"+ "kaliid4", ! "south" : "/domains/Ylsrim/room/"+ "s_bazaar" ]) ); ! } ! void init(){ ! ::init(); } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/room/church.c ds2.0r27/lib/domains/Ylsrim/room/church.c *** ds1.1/lib/domains/Ylsrim/room/church.c Sun Feb 1 21:30:06 1998 --- ds2.0r27/lib/domains/Ylsrim/room/church.c Wed Jul 5 00:01:11 2006 *************** *** 3,9 **** * An example of a religious class hall * Created by Descartes of Borg 961222 */ ! #include <lib.h> inherit LIB_ROOM; --- 3,9 ---- * An example of a religious class hall * Created by Descartes of Borg 961222 */ ! #include <lib.h> inherit LIB_ROOM; *************** *** 31,44 **** SetAmbientLight(27); SetShort("Ylsrim Church"); SetLong("Dim candles create more than enough light to fill this " ! "very humble church of the Dalin religion. Dalites come " ! "here to pray, and others come to convert to Dalin."); AddItem("candle", "They do not appear to make much light, but the " ! "church is very bright.", ({ "dim" })); AddItem(new("/domains/Ylsrim/etc/church_button")); SetObviousExits("s, n"); ! SetExits(([ "north" : ({ __DIR__ "priest", (: CheckPriest :) }), ! "south" : __DIR__ "kaliid3"])); SetDoor("south", "/domains/Ylsrim/etc/church_door"); SetInventory(([ "/domains/Ylsrim/npc/priest" : 1 ])); } --- 31,47 ---- SetAmbientLight(27); SetShort("Ylsrim Church"); SetLong("Dim candles create more than enough light to fill this " ! "very humble church of the Dalin religion. Dalites come " ! "here to pray, and others come to convert to Dalin."); AddItem("candle", "They do not appear to make much light, but the " ! "church is very bright.", ({ "dim" })); AddItem(new("/domains/Ylsrim/etc/church_button")); SetObviousExits("s, n"); ! SetExits(([ ! "south" : "/domains/Ylsrim/room/"+ "kaliid3"])); SetDoor("south", "/domains/Ylsrim/etc/church_door"); SetInventory(([ "/domains/Ylsrim/npc/priest" : 1 ])); } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/room/fighter.c ds2.0r27/lib/domains/Ylsrim/room/fighter.c *** ds1.1/lib/domains/Ylsrim/room/fighter.c Sun Feb 1 21:30:06 1998 --- ds2.0r27/lib/domains/Ylsrim/room/fighter.c Wed Jul 5 00:01:11 2006 *************** *** 2,8 **** * from the Dead Souls Object Library * created by Descartes of Borg 960512 */ ! #include <lib.h> inherit LIB_ROOM; --- 2,8 ---- * from the Dead Souls Object Library * created by Descartes of Borg 960512 */ ! #include <lib.h> inherit LIB_ROOM; *************** *** 17,25 **** SetLong("Fighters sort of lounge around in here."); SetObviousExits("s"); SetExits( ([ ! "south" : __DIR__ "fighter_hall", ! ]) ); SetItems( ([ ! ]) ); SetDoor( "south", "/domains/Ylsrim/etc/fighter_door.c"); } --- 17,28 ---- SetLong("Fighters sort of lounge around in here."); SetObviousExits("s"); SetExits( ([ ! "south" : "/domains/Ylsrim/room/"+ "fighter_hall", ! ]) ); SetItems( ([ ! ]) ); SetDoor( "south", "/domains/Ylsrim/etc/fighter_door.c"); } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/room/fighter_hall.c ds2.0r27/lib/domains/Ylsrim/room/fighter_hall.c *** ds1.1/lib/domains/Ylsrim/room/fighter_hall.c Sun Feb 1 21:30:06 1998 --- ds2.0r27/lib/domains/Ylsrim/room/fighter_hall.c Wed Jul 5 00:01:11 2006 *************** *** 2,8 **** * from the Dead Souls Object Library * created by Descartes of Borg 960512 */ ! #include <lib.h> inherit LIB_ROOM; --- 2,8 ---- * from the Dead Souls Object Library * created by Descartes of Borg 960512 */ ! #include <lib.h> inherit LIB_ROOM; *************** *** 17,45 **** SetAmbientLight(27); SetShort("the Hall of Fighters"); SetLong("The Great Hall of Fighters was constructed many ages ago to " ! "act as a meeting place for all the fighters who come through " ! "Ylsrim. In addition, it serves as a place to recruit new " ! "fighters into the fold. A magnificent oak door stands north."); SetObviousExits("s, n"); SetExits( ([ ! "north" : ({ __DIR__ "fighter", (: CheckFighter :) }), ! "south" : __DIR__ "kaliid5" ! ]) ); SetInventory(([ "/domains/Ylsrim/npc/fighter" : 1 ])); SetItems( ([ ! ({ "meeting","room","hall","fighter hall" }) : "New adventurers may become fighters here.", ! ]) ); SetDoor( "north", "/domains/Ylsrim/etc/fighter_door"); SetListen("default","Sounds of old veterans recalling battles of " ! "the past can be heard being told."); } int CheckFighter(string dir) { object ob; if( (int)this_player()->ClassMember("fighter") || ! (int)creatorp(this_player()) ) return 1; if( ob = present("fighter", this_object()) ) { ob->eventForce("speak I cannot allow you to enter the halls of the great warriors of Ylsrim"); return 0; --- 17,45 ---- SetAmbientLight(27); SetShort("the Hall of Fighters"); SetLong("The Great Hall of Fighters was constructed many ages ago to " ! "act as a meeting place for all the fighters who come through " ! "Ylsrim. In addition, it serves as a place to recruit new " ! "fighters into the fold. A magnificent oak door stands north."); SetObviousExits("s, n"); SetExits( ([ ! "north" : ({ "/domains/Ylsrim/room/"+ "fighter", (: CheckFighter :) }), ! "south" : "/domains/Ylsrim/room/"+ "kaliid5" ! ]) ); SetInventory(([ "/domains/Ylsrim/npc/fighter" : 1 ])); SetItems( ([ ! ({ "meeting","room","hall","fighter hall" }) : "New adventurers may become fighters here.", ! ]) ); SetDoor( "north", "/domains/Ylsrim/etc/fighter_door"); SetListen("default","Sounds of old veterans recalling battles of " ! "the past can be heard being told."); } int CheckFighter(string dir) { object ob; if( (int)this_player()->ClassMember("fighter") || ! (int)creatorp(this_player()) ) return 1; if( ob = present("fighter", this_object()) ) { ob->eventForce("speak I cannot allow you to enter the halls of the great warriors of Ylsrim"); return 0; *************** *** 47,49 **** --- 47,52 ---- else return 1; } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/room/furnace.c ds2.0r27/lib/domains/Ylsrim/room/furnace.c *** ds1.1/lib/domains/Ylsrim/room/furnace.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/Ylsrim/room/furnace.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,36 ---- + #include <lib.h> + #include <rooms.h> + + inherit LIB_ROOM; + + void create() { + room::create(); + SetAmbientLight(30); + SetShort("the furnace"); + SetLong("The furnace. Things that arrive here are "+ + "incinerated. You probably shouldn't be here. Go down to get out."); + SetProperties(([ + "no attack" : 1, + ])); + SetExits( ([ "down" : ROOM_START ]) ); + call_out((: reload_room :), 600, load_object(base_name(this_object()))); + set_heart_beat(1); + SetNoModify(1); + } + int CanReceive(object ob){ + if(interactive(ob)){ + tell_object(ob, "You fail to enter the furnace."); + return 0; + } + return 1; + } + void init(){ + ::init(); + } + void heart_beat(){ + if(sizeof(all_inventory(this_object()))){ + foreach(object ob in deep_inventory(this_object())){ + ob->eventDestruct(); + } + } + } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/room/kaliid3.c ds2.0r27/lib/domains/Ylsrim/room/kaliid3.c *** ds1.1/lib/domains/Ylsrim/room/kaliid3.c Sun Feb 1 21:30:06 1998 --- ds2.0r27/lib/domains/Ylsrim/room/kaliid3.c Wed Jul 5 00:01:11 2006 *************** *** 12,32 **** room::create(); SetTown("Ylsrim"); SetClimate("arid"); ! SetNightLight(18); SetShort("Kaliid Road by the Church"); SetLong("Kaliid Road moves east and west through the desert town of " ! "Ylsrim. The road itself gets sandier as it gets swallowed by " ! "the desert in the distance east. On the northern end of the " ! "road a door belonging to the local church. Next to the door " ! "sits a huge button."); AddItem("church", "It is a rather pathetic wooden building where the " ! "local priests initiate people into their religion."); AddItem("desert", "The town does all it can to keep from being swallowed " ! "by it."); AddItem(new("/domains/Ylsrim/etc/church_button")); ! SetObviousExits("e, w, enter church"); ! SetExits( ([ "east" : __DIR__ "kaliid2", ! "west" : __DIR__ "kaliid4" ])); ! SetEnters( ([ "church" : __DIR__ "church" ])); SetDoor("church", "/domains/Ylsrim/etc/church_door"); } --- 12,36 ---- room::create(); SetTown("Ylsrim"); SetClimate("arid"); ! SetAmbientLight(30); SetShort("Kaliid Road by the Church"); SetLong("Kaliid Road moves east and west through the desert town of " ! "Ylsrim. The road itself gets sandier as it gets swallowed by " ! "the desert in the distance east. On the northern end of the " ! "road a door belonging to the local church. Next to the door " ! "sits a huge button."); AddItem("church", "It is a rather pathetic wooden building where the " ! "local priests initiate people into their religion."); AddItem("desert", "The town does all it can to keep from being swallowed " ! "by it."); AddItem(new("/domains/Ylsrim/etc/church_button")); ! SetObviousExits("w, enter church"); ! SetExits( ([ ! "west" : "/domains/Ylsrim/room/"+ "kaliid4" ])); ! SetEnters( ([ "church" : "/domains/Ylsrim/room/"+ "church" ])); SetDoor("church", "/domains/Ylsrim/etc/church_door"); } + + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/room/kaliid4.c ds2.0r27/lib/domains/Ylsrim/room/kaliid4.c *** ds1.1/lib/domains/Ylsrim/room/kaliid4.c Sun Feb 1 21:30:05 1998 --- ds2.0r27/lib/domains/Ylsrim/room/kaliid4.c Wed Jul 5 00:01:11 2006 *************** *** 12,36 **** room::create(); SetTown("Ylsrim"); SetClimate("arid"); ! SetNightLight(18); SetShort("Kaliid Road north of the bazaar"); ! SetLong("Kaliid Road stretches as far as you can see east and west " ! "across Ylsrim. South, Kaliid opens up into the central " ! "bazaar where vendors sell goods day and night. " ! "on the opposite side of the road is the entrance to " ! "the local adventurers' hall."); AddItem("hall", "A small building which serves as the focal point for " ! "the adventuring activities for which Ylsrim's support " ! "is widely known.", ({ "adventurer", "adventurers" })); AddItem("bazaar", "The central bazaar is the main marketplace of " ! "Ylsrim. Though many of the shops close at night, vendors " ! "wander the bazaar at all times pawning their goods.", ! ({ "central" })); ! AddItem("vendor", "Thre are many vendors wandering about the bazaar."); AddItem("road", "The main street for Ylsrim.", ({ "kaliid" })); ! SetObviousExits("e, w, s, enter hall"); ! SetExits( ([ "east" : __DIR__ "kaliid3", ! "west" : __DIR__ "kaliid5", ! "south" : __DIR__ "bazaar" ]) ); ! SetEnters( ([ "hall" : __DIR__ "adv_hall" ])); } --- 12,38 ---- room::create(); SetTown("Ylsrim"); SetClimate("arid"); ! SetAmbientLight(30); SetShort("Kaliid Road north of the bazaar"); ! SetLong("Kaliid Road stretches as far as you can see east and west across Ylsrim. South, Kaliid opens up into the central bazaar where vendors sell goods day and night. on the opposite side of the road is the entrance to the local adventurers' hall."); ! SetExits( ([ ! "east" : "/domains/Ylsrim/room/kaliid3", ! "south" : "/domains/Ylsrim/room/bazaar", ! "west" : "/domains/Ylsrim/room/kaliid5", ! ]) ); AddItem("hall", "A small building which serves as the focal point for " ! "the adventuring activities for which Ylsrim's support " ! "is widely known.", ({ "adventurer", "adventurers" })); AddItem("bazaar", "The central bazaar is the main marketplace of " ! "Ylsrim. Though many of the shops close at night, vendors " ! "wander the bazaar at all times pawning their goods.", ! ({ "central" })); ! AddItem("vendor", "There are many vendors wandering about the bazaar."); ! AddItem("town", "A new town, north of here."); AddItem("road", "The main street for Ylsrim.", ({ "kaliid" })); ! SetEnters( ([ "hall" : "/domains/Ylsrim/room/"+ "adv_hall" ])); ! } ! ! void init(){ ! ::init(); } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/room/kaliid5.c ds2.0r27/lib/domains/Ylsrim/room/kaliid5.c *** ds1.1/lib/domains/Ylsrim/room/kaliid5.c Sun Feb 1 21:30:06 1998 --- ds2.0r27/lib/domains/Ylsrim/room/kaliid5.c Wed Jul 5 00:01:11 2006 *************** *** 12,30 **** room::create(); SetTown("Ylsrim"); SetClimate("arid"); ! SetNightLight(18); SetShort("Kaliid Road near the Fighters' Hall"); SetLong("Kaliid Road stretches as far as you can see east and west " ! "across Ylsrim. Along the north side of this stretch of road " ! "sits the local Fighters' Hall. Immediately inside the entrance " ! "you notice a recruitment area where novice seekers of fortune " ! "decide to make their ways as fighters."); AddItem("hall", "Fighters passing through Ylsrim stop in to yap about " ! "their adventures, and novices sign up to become fighters.", ! ({ "fighter", "fighters" })); AddItem("road", "The main street for Ylsrim.", ({ "kaliid" })); SetObviousExits("e, w, enter hall"); ! SetExits( ([ "east" : __DIR__ "kaliid4", ! "west" : __DIR__ "kaliid6" ])); ! SetEnters( ([ "hall" : __DIR__ "fighter_hall" ])); } --- 12,33 ---- room::create(); SetTown("Ylsrim"); SetClimate("arid"); ! SetAmbientLight(30); SetShort("Kaliid Road near the Fighters' Hall"); SetLong("Kaliid Road stretches as far as you can see east and west " ! "across Ylsrim. Along the north side of this stretch of road " ! "sits the local Fighters' Hall. Immediately inside the entrance " ! "you notice a recruitment area where novice seekers of fortune " ! "decide to make their ways as fighters."); AddItem("hall", "Fighters passing through Ylsrim stop in to yap about " ! "their adventures, and novices sign up to become fighters.", ! ({ "fighter", "fighters" })); AddItem("road", "The main street for Ylsrim.", ({ "kaliid" })); SetObviousExits("e, w, enter hall"); ! SetExits( ([ "east" : "/domains/Ylsrim/room/"+ "kaliid4", ! "west" : "/domains/Ylsrim/room/"+ "kaliid6" ])); ! SetEnters( ([ "hall" : "/domains/Ylsrim/room/"+ "fighter_hall" ])); ! } ! void init(){ ! ::init(); } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/room/kaliid6.c ds2.0r27/lib/domains/Ylsrim/room/kaliid6.c *** ds1.1/lib/domains/Ylsrim/room/kaliid6.c Sun Feb 1 21:30:06 1998 --- ds2.0r27/lib/domains/Ylsrim/room/kaliid6.c Wed Jul 5 00:01:11 2006 *************** *** 13,32 **** room::create(); SetTown("Ylsrim"); SetClimate("arid"); ! SetNightLight(18); SetShort("Kaliid Road south of the bank"); SetLong("Kaliid Road stretches as far as you can see east and west " ! "across Ylsrim. The rough wall on the north side of the road " ! "looks like the distinctive adobe of the Bank of Ylsrim. As " ! "the road travels along side the bank walls west, you can see " ! "Kaliid Road intersect with another."); AddItem(({ "bank", "bank of ylsrim" }), "Ylsrim's local bank. It has " ! "an adobe wall filled with holes.", ({ "ylsrim" })); AddItem("road", "The main street in Ylsrim.", "kaliid"); AddItem("holes", "You might be able to use them to climb the wall."); // here is the thing that can be climbed, have a look at it! AddItem(new("/domains/Ylsrim/etc/wall")); SetObviousExits("e, w"); ! SetExits( ([ "east" : __DIR__ "kaliid5", ! "west" : __DIR__ "kaliid7" ])); } --- 13,35 ---- room::create(); SetTown("Ylsrim"); SetClimate("arid"); ! SetAmbientLight(30); SetShort("Kaliid Road south of the bank"); SetLong("Kaliid Road stretches as far as you can see east and west " ! "across Ylsrim. The rough wall on the north side of the road " ! "looks like the distinctive adobe of the Bank of Ylsrim. As " ! "the road travels along side the bank walls west, you can see " ! "Kaliid Road intersect with another."); AddItem(({ "bank", "bank of ylsrim" }), "Ylsrim's local bank. It has " ! "an adobe wall filled with holes.", ({ "ylsrim" })); AddItem("road", "The main street in Ylsrim.", "kaliid"); AddItem("holes", "You might be able to use them to climb the wall."); // here is the thing that can be climbed, have a look at it! AddItem(new("/domains/Ylsrim/etc/wall")); SetObviousExits("e, w"); ! SetExits( ([ "east" : "/domains/Ylsrim/room/"+ "kaliid5", ! "west" : "/domains/Ylsrim/room/"+ "kaliid7" ])); ! } ! void init(){ ! ::init(); } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/room/kaliid7.c ds2.0r27/lib/domains/Ylsrim/room/kaliid7.c *** ds1.1/lib/domains/Ylsrim/room/kaliid7.c Sun Feb 1 21:30:06 1998 --- ds2.0r27/lib/domains/Ylsrim/room/kaliid7.c Wed Jul 5 00:01:11 2006 *************** *** 12,29 **** room::create(); SetTown("Ylsrim"); SetClimate("arid"); ! SetNightLight(18); SetShort("the western edge of Ylsrim"); SetLong("Kaliid Road comes to its western end here as Ylsrim disappears " ! "into the desert. Not too far east of here you see where " ! "the local bank rests."); AddItem(({ "bank", "bank of ylsrim" }), "Ylsrim's local bank. It has " ! "an adobe wall.", ({ "ylsrim" })); AddItem("desert", "A great desert that surrounds Ylsrim and makes it " ! "look so fragile."); AddItem("road", "The main street in Ylsrim.", "kaliid"); SetInventory(([ "/domains/Ylsrim/weapon/stick" : 1 ])); SetObviousExits("e, w"); ! SetExits( ([ "east" : __DIR__ "kaliid6", ! "west" : __DIR__ "sand_room" ])); } --- 12,32 ---- room::create(); SetTown("Ylsrim"); SetClimate("arid"); ! SetAmbientLight(30); SetShort("the western edge of Ylsrim"); SetLong("Kaliid Road comes to its western end here as Ylsrim disappears " ! "into the desert. Not too far east of here you see where " ! "the local bank rests."); AddItem(({ "bank", "bank of ylsrim" }), "Ylsrim's local bank. It has " ! "an adobe wall.", ({ "ylsrim" })); AddItem("desert", "A great desert that surrounds Ylsrim and makes it " ! "look so fragile."); AddItem("road", "The main street in Ylsrim.", "kaliid"); SetInventory(([ "/domains/Ylsrim/weapon/stick" : 1 ])); SetObviousExits("e, w"); ! SetExits( ([ "east" : "/domains/Ylsrim/room/"+ "kaliid6", ! "west" : "/domains/Ylsrim/room/"+ "sand_room" ])); ! } ! void init(){ ! ::init(); } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/room/pub.c ds2.0r27/lib/domains/Ylsrim/room/pub.c *** ds1.1/lib/domains/Ylsrim/room/pub.c Sun Feb 1 21:30:05 1998 --- ds2.0r27/lib/domains/Ylsrim/room/pub.c Wed Jul 5 00:01:11 2006 *************** *** 11,33 **** // This is a special SetRead() function that allows players to read // the menu int readMenu(object who, string str) { string array tmp = ({ sprintf("%:-20s %:-7s", "Drink", "Cost") }); object ob = present("lars"); ! if( !ob ) { // lars is dead! ! who->eventPrint("The menu is too bloodstained to read."); return 1; } ! foreach(string item in keys(ob->GetMenuItems())) { ! tmp += ({ sprintf("%:-20s %:-7d electrum", capitalize(item), ! ob->GetCost(item)) }); } // show the menu a page at a time ! who->eventPage(tmp, MSG_SYSTEM); // MSG_SYSTEM means ignore blocking return 1; } - static void create() { room::create(); SetTown("Ylsrim"); --- 11,39 ---- // This is a special SetRead() function that allows players to read // the menu + int readMenu(object who, string str) { + string array tmp2 = ({}); string array tmp = ({ sprintf("%:-20s %:-7s", "Drink", "Cost") }); object ob = present("lars"); ! if( !ob ) { // lars is dead! ! this_player()->eventPrint("The menu is too bloodstained to read."); return 1; } ! foreach(string *item in keys(ob->GetMenuItems())) { ! tmp += ({ sprintf("%:-20s %d electrum", capitalize(item[0]), ! to_int(ob->GetCost(item))) }); } + foreach(string element in tmp){ + element = translate(element, this_player()->GetLanguageLevel("Edhellen")); + tmp2 += ({ element }); + } + tmp = tmp2; // show the menu a page at a time ! this_player()->eventPage(tmp, MSG_SYSTEM); // MSG_SYSTEM means ignore blocking return 1; } static void create() { room::create(); SetTown("Ylsrim"); *************** *** 35,60 **** SetAmbientLight(25); SetShort("Lars' Pub"); SetLong("Lars' Pub is one of the most famous gathering places in all " ! "Ylsrim. As you can see about you, however, it is not among the " ! "more homely ones. Tables and stools are littered all about " ! "with a hodge-podge of writing in all different languages " ! "covering the wall. A menu of drinks is about the only " ! "readable thing on the wall. If you read Eltherian."); SetListen("Rowdy party sounds make it hard to hear anything else."); SetSmell("The place smells like it is soaked in ale."); AddItem(({ "tables", "stools" }), "The tables and stools begin " ! "to migrate as the day goes on and customerizes socialize. " ! "Of course, nothing moves them better than a good brawl."); AddItem(({ "menu", "drinks", "menu of drinks" }), "The menu is " ! "written in Eltherian. Can you read it?", ({ "drink" })); AddItem(({ "writing", "walls" }), "Scribble in all different " ! "languages, and in many pens and many hands covers much of " ! "each wall."); SetObviousExits("e"); ! SetExits(([ "east" : __DIR__ "s_bazaar" ])); // Bring in the Bar Keep - SetInventory(([ DIR_STANDARD_DOMAIN "/npc/lars" : 1 ])); // make the writing and the menu readable SetRead("writing", (: readMenu :)); SetRead("menu", (: readMenu :)); } --- 41,72 ---- SetAmbientLight(25); SetShort("Lars' Pub"); SetLong("Lars' Pub is one of the most famous gathering places in all " ! "Ylsrim. As you can see about you, however, it is not among the " ! "more homely ones. Tables and stools are littered all about " ! "with a hodge-podge of writing in all different languages " ! "covering the wall. A menu of drinks is about the only " ! "readable thing on the wall. If you read Edhellen."); ! SetLanguage("Edhellen"); ! SetInventory(([ ! "/domains/Ylsrim/npc/lars" : 1, ! ])); SetListen("Rowdy party sounds make it hard to hear anything else."); SetSmell("The place smells like it is soaked in ale."); AddItem(({ "tables", "stools" }), "The tables and stools begin " ! "to migrate as the day goes on and customerizes socialize. " ! "Of course, nothing moves them better than a good brawl."); AddItem(({ "menu", "drinks", "menu of drinks" }), "The menu is " ! "written in Edhellen. Can you read it?", ({ "drink" })); AddItem(({ "writing", "walls" }), "Scribble in all different " ! "languages, and in many pens and many hands covers much of " ! "each wall."); SetObviousExits("e"); ! SetExits(([ "east" : "/domains/Ylsrim/room/"+ "s_bazaar" ])); // Bring in the Bar Keep // make the writing and the menu readable SetRead("writing", (: readMenu :)); SetRead("menu", (: readMenu :)); } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/room/s_bazaar.c ds2.0r27/lib/domains/Ylsrim/room/s_bazaar.c *** ds1.1/lib/domains/Ylsrim/room/s_bazaar.c Sun Feb 1 21:30:06 1998 --- ds2.0r27/lib/domains/Ylsrim/room/s_bazaar.c Wed Jul 5 00:01:11 2006 *************** *** 12,29 **** room::create(); SetTown("Ylsrim"); SetClimate("arid"); ! SetNightLight(15); SetShort("The south end of the Ylsrim Bazaar"); SetLong("Along the south end of the Ylsrim Bazaar stands a restaurant " ! "and a pub. The central area of the Bazaar is just north of " ! "here."); AddItem("pub", "You can buy yourself an ale from one of Ylsrim's most " ! "respected residents.", ({ "lars" })); AddItem("restaurant", "This restaurant is known for its stew.", ! ({ "toral" })); ! SetInventory(([ "/domains/Ylsrim/npc/traveller" : -1 ])); ! SetObviousExits("n, enter pub, enter restaurant"); ! SetExits( ([ "north" : __DIR__ "bazaar" ]) ); ! SetEnters( ([ "restaurant" : __DIR__ "restaurant", ! "pub" : __DIR__ "pub" ]) ); } --- 12,34 ---- room::create(); SetTown("Ylsrim"); SetClimate("arid"); ! SetAmbientLight(30); SetShort("The south end of the Ylsrim Bazaar"); SetLong("Along the south end of the Ylsrim Bazaar stands a restaurant " ! "and a pub. The central area of the Bazaar is just north of " ! "here."); ! SetInventory(([ ! "/domains/Ylsrim/npc/traveler" : 1, ! ])); AddItem("pub", "You can buy yourself an ale from one of Ylsrim's most " ! "respected residents.", ({ "lars" })); AddItem("restaurant", "This restaurant is known for its stew.", ! ({ "toral" })); ! SetObviousExits("n, enter pub"); ! SetExits( ([ "north" : "/domains/Ylsrim/room/"+ "bazaar" ]) ); ! SetEnters( ([ ! "pub" : "/domains/Ylsrim/room/"+ "pub" ]) ); ! } ! void init(){ ! ::init(); } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/room/sand_hole.c ds2.0r27/lib/domains/Ylsrim/room/sand_hole.c *** ds1.1/lib/domains/Ylsrim/room/sand_hole.c Sun Feb 1 21:30:06 1998 --- ds2.0r27/lib/domains/Ylsrim/room/sand_hole.c Wed Jul 5 00:01:11 2006 *************** *** 11,21 **** static void create() { room::create(); SetClimate("indoors"); SetShort("a dark hole in the sand"); SetLong("You are in a very dark, sandy hole in the desert."); AddItem("sand", "It is everywhere."); SetObviousExits(""); ! SetExits( ([ "up" : __DIR__ "sand_room" ])); // use a door to act as a hole, as that is what the hole really is SetDoor("up", "/domains/Ylsrim/etc/dug_hole"); } --- 11,25 ---- static void create() { room::create(); SetClimate("indoors"); + SetAmbientLight(25); SetShort("a dark hole in the sand"); SetLong("You are in a very dark, sandy hole in the desert."); AddItem("sand", "It is everywhere."); SetObviousExits(""); ! SetExits( ([ "up" : "/domains/Ylsrim/room/"+ "sand_room" ])); // use a door to act as a hole, as that is what the hole really is SetDoor("up", "/domains/Ylsrim/etc/dug_hole"); } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/room/sand_room.c ds2.0r27/lib/domains/Ylsrim/room/sand_room.c *** ds1.1/lib/domains/Ylsrim/room/sand_room.c Sun Feb 1 21:30:06 1998 --- ds2.0r27/lib/domains/Ylsrim/room/sand_room.c Wed Jul 5 00:01:11 2006 *************** *** 8,38 **** inherit LIB_ROOM; inherit LIB_DIG; // inherit this to add dig functionality // This function gets called when someone tries to bury the hole mixed buryHole(object who, object shovel) { ! int closed = "/domains/Ylsrim/etc/dug_hole"->GetClosed(); if( closed ) { who->eventPrint("Perhaps you want to dig the hole?"); return 1; } send_messages("bury", "$agent_name $agent_verb a deep, gaping " ! "hole in the sand.", who, 0, environment(who)); "/domains/Ylsrim/etc/dug_hole"->SetClosed(1); return 1; } // This function gets called when someone tries to dig mixed digHole(object who, object shovel) { ! int closed = "/domains/Ylsrim/etc/dug_hole"->GetClosed(); if( !closed ) { who->eventPrint("Perhaps you want to bury the hole?"); return 1; } send_messages("dig", "$agent_name $agent_verb up a deep, gaping " ! "hole in the sand.", who, 0, environment(who)); "/domains/Ylsrim/etc/dug_hole"->SetClosed(0); return 1; } --- 8,46 ---- inherit LIB_ROOM; inherit LIB_DIG; // inherit this to add dig functionality + inherit LIB_BURY; // inherit this to add bury functionality + + int eventEnterDesert(){ + this_player()->eventMoveLiving(load_object("/domains/Ylsrim/virtual/server")->compile_object("/domains/Ylsrim/virtual/desert/7,7")); + return 1; + } // This function gets called when someone tries to bury the hole mixed buryHole(object who, object shovel) { ! int closed; ! closed = "/domains/Ylsrim/etc/dug_hole"->GetClosed(); if( closed ) { who->eventPrint("Perhaps you want to dig the hole?"); return 1; } send_messages("bury", "$agent_name $agent_verb a deep, gaping " ! "hole in the sand.", who, 0, environment(who)); "/domains/Ylsrim/etc/dug_hole"->SetClosed(1); return 1; } // This function gets called when someone tries to dig mixed digHole(object who, object shovel) { ! int closed; ! closed = "/domains/Ylsrim/etc/dug_hole"->GetClosed(); if( !closed ) { who->eventPrint("Perhaps you want to bury the hole?"); return 1; } send_messages("dig", "$agent_name $agent_verb up a deep, gaping " ! "hole in the sand.", who, 0, environment(who)); "/domains/Ylsrim/etc/dug_hole"->SetClosed(0); return 1; } *************** *** 41,49 **** // when the hole is open. string describeRoom() { string str = "You are just outside the western edge of Ylsrim. You now " ! "stand in the open desert with a dry, arid wind draining you " ! "of all strength. Nothing at all exists here besides endless " ! "sand. About all you could possibly do is sit and dig."; if( "/domains/Ylsrim/etc/dug_hole"->GetClosed() ) { return str; // no hole to see --- 49,57 ---- // when the hole is open. string describeRoom() { string str = "You are just outside the western edge of Ylsrim. You now " ! "stand in the open desert with a dry, arid wind draining you " ! "of all strength. Nothing at all exists here besides endless " ! "sand. About all you could possibly do is sit and dig."; if( "/domains/Ylsrim/etc/dug_hole"->GetClosed() ) { return str; // no hole to see *************** *** 52,68 **** return str + " A hole opens up in the middle of the sand."; } } ! static void create() { room::create(); SetClimate("arid"); SetShort("a sandy desert outside of Ylsrim"); SetLong((: describeRoom :)); AddItem("sand", "Boring stretches of sand extend to the horizon."); AddItem("ylsrim", "It is east of here."); ! SetObviousExits("e"); ! SetExits( ([ "east" : __DIR__ "kaliid7", ! "down" : __DIR__ "sand_hole" ])); // use a door to act as a hole, as that is what the hole really is SetDoor("down", "/domains/Ylsrim/etc/dug_hole"); // this tells the room to call this function when a player digs --- 60,79 ---- return str + " A hole opens up in the middle of the sand."; } } ! static void create() { room::create(); SetClimate("arid"); + SetAmbientLight(30); SetShort("a sandy desert outside of Ylsrim"); SetLong((: describeRoom :)); AddItem("sand", "Boring stretches of sand extend to the horizon."); AddItem("ylsrim", "It is east of here."); ! SetObviousExits("e, w"); ! SetExits( ([ "east" : "/domains/Ylsrim/room/"+ "kaliid7", ! "west" : "/domains/Ylsrim/virtual/desert/7,7" , ! "down" : "/domains/Ylsrim/room/"+ "sand_hole" ])); ! SetInventory( ([ "/domains/Ylsrim/etc/shovel" : 1 ]) ); // use a door to act as a hole, as that is what the hole really is SetDoor("down", "/domains/Ylsrim/etc/dug_hole"); // this tells the room to call this function when a player digs *************** *** 70,72 **** --- 81,86 ---- // this tells the room what to call when a player buries the hole SetBury((: buryHole :)); } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/room/tower.c ds2.0r27/lib/domains/Ylsrim/room/tower.c *** ds1.1/lib/domains/Ylsrim/room/tower.c Sun Feb 1 21:30:06 1998 --- ds2.0r27/lib/domains/Ylsrim/room/tower.c Wed Jul 5 00:01:11 2006 *************** *** 9,32 **** inherit LIB_ROOM; inherit LIB_JUMP; void create() { room::create(); - jump::create(); SetClimate("indoors"); SetTown("Ylsrim"); SetAmbientLight(28); SetShort("Ylsrim Tower"); SetLong("The tower looks out over Kaliid Road. South of the road is " ! "the always busy Ylsrim bazaar. A spiraling staircase leads " ! "down into the heart of the adventurer's hall."); SetItems( ([ ({ "road", "kaliid road" }) : ! "You could probably jump down into the road from here.", ! "bazaar" : "It looks like it is bustling.", ! ({ "stairs", "staircase" }) : "They lead down into the " ! "heart of the hall." ]) ); SetObviousExits("d"); ! SetExits( ([ "down" : __DIR__ "adv_hall" ]) ); ! AddJump("road", __DIR__ "kaliid4", JUMP_INTO); ! AddJump("kaliid road", __DIR__ "kaliid4", JUMP_INTO); ! AddJump("tower", __DIR__ "kaliid4", JUMP_FROM); } --- 9,43 ---- inherit LIB_ROOM; inherit LIB_JUMP; + int ReadSign() { + this_player()->more("/domains/town/txt/warning_sign.txt"); + return 1; + } + void create() { room::create(); SetClimate("indoors"); SetTown("Ylsrim"); SetAmbientLight(28); SetShort("Ylsrim Tower"); SetLong("The tower looks out over Kaliid Road. South of the road is " ! "the always busy Ylsrim bazaar. A spiraling staircase leads " ! "down into the heart of the adventurer's hall." ! "\n%^RED%^There is a sign here you can read.%^RESET%^"); SetItems( ([ ({ "road", "kaliid road" }) : ! "You could probably jump down into the road from here.", ! "bazaar" : "It looks like it is bustling.", ! "sign":"A sign. To read it, 'read sign'.", ! "tower" : "The tower you are on.", ! ({ "stairs", "staircase" }) : "They lead down into the " ! "heart of the hall." ]) ); SetObviousExits("d"); ! SetExits( ([ "down" : "/domains/Ylsrim/room/"+ "adv_hall" ]) ); ! SetInventory(([ ! "/domains/Ylsrim/obj/stargate" : 1, ! ])); ! SetRead("sign", (: ReadSign :) ); } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/room/vote_hall.c ds2.0r27/lib/domains/Ylsrim/room/vote_hall.c *** ds1.1/lib/domains/Ylsrim/room/vote_hall.c Sun Feb 1 21:30:06 1998 --- ds2.0r27/lib/domains/Ylsrim/room/vote_hall.c Wed Jul 5 00:01:11 2006 *************** *** 15,54 **** static void create() { ::create(); ! SetTown("Praxis"); SetClimate("indoors"); SetProperties( ([ "no kill" : 1, "no attack" : 1, "no steal" : 1, ! "no magic" : 1, "light" : 3, "no bump" : 1, "no teleport" : 1 ]) ); SetShort("voting hall"); ! SetLong("You are in the voting hall of Dead Souls. This is where " ! "people come to nominate candidates for class leader and to " ! "cast their vote. There is a list posted on the wall here."); SetItems( ([ "list" : "This is the list of candidates." ]) ); SetRead( "list", (: ReadList :) ); SetObviousExits("d"); ! SetExits( ([ "down" : "/domains/Praxis/room/town_hall" ]) ); } mixed ReadList() { string msg; if( VOTING_D->GetStatus() == VOTE_NOT_RUNNING ) { ! this_player()->eventPrint("Since the elections are not " ! "currently running, the list is blank."); ! return 1; } msg = "\tCandidates for Dead Souls Offices\n\n"; ! foreach( string sClass in CLASSES_D->GetClasses() ) { ! msg += capitalize( sClass ) + " : "; ! foreach( string sName in VOTING_D->GetCandidates(sClass) ) ! msg += capitalize(sName) + ", "; ! if( msg[strlen(msg)-2] == ',' ) ! msg = msg[0..strlen(msg)-3]; ! msg += "\n"; } ! this_player()->eventPrint( msg ); return 1; } --- 15,52 ---- static void create() { ::create(); ! SetTown("Ylsrim"); SetClimate("indoors"); SetProperties( ([ "no kill" : 1, "no attack" : 1, "no steal" : 1, ! "no magic" : 1, "light" : 3, "no bump" : 1, "no teleport" : 1 ]) ); SetShort("voting hall"); ! SetLong("You are in the voting hall of Ylsrim. This is where people come to nominate candidates for class leader and to cast their vote. There is a list posted on the wall here."); SetItems( ([ "list" : "This is the list of candidates." ]) ); SetRead( "list", (: ReadList :) ); SetObviousExits("d"); ! SetExits( ([ "down" : "/domains/Ylsrim/room/bazaar" ]) ); } mixed ReadList() { string msg; if( VOTING_D->GetStatus() == VOTE_NOT_RUNNING ) { ! this_player()->eventPrint("Since the elections are not " ! "currently running, the list is blank."); ! return 1; } msg = "\tCandidates for Dead Souls Offices\n\n"; ! foreach( string sClass in CLASSES_D->GetClasses() ) { ! msg += capitalize( sClass ) + " : "; ! foreach( string sName in VOTING_D->GetCandidates(sClass) ) ! msg += capitalize(sName) + ", "; ! if( msg[strlen(msg)-2] == ',' ) ! msg = msg[0..strlen(msg)-3]; ! msg += "\n"; } ! this_player()->eventPrint( msg ); return 1; } *************** *** 61,89 **** int iErr; if( creatorp( who ) ) { ! who->eventPrint("Creators cannot vote!"); ! return 1; } iErr = VOTING_D->eventAddCandidate( who->GetClass(), str ); switch( iErr ) { ! case VOTE_NOT_RUNNING : ! this_player()->eventPrint("The elections are not running now!"); ! break; ! case VOTE_MODE_VOTING : ! this_player()->eventPrint("The time for nominating " ! "candidates is past, cast your vote instead."); ! break; ! ! case VOTE_ERROR : ! this_player()->eventPrint("There was an error, you cannot " ! "nominate someone at this time."); ! break; ! ! case VOTE_NOT_CLASS_MEMBER : ! this_player()->eventPrint( capitalize(str) + " is not a member of " "the " + pluralize( who->GetClass() ) + "."); break; --- 59,87 ---- int iErr; if( creatorp( who ) ) { ! who->eventPrint("Creators cannot vote!"); ! return 1; } iErr = VOTING_D->eventAddCandidate( who->GetClass(), str ); switch( iErr ) { ! case VOTE_NOT_RUNNING : ! this_player()->eventPrint("The elections are not running now!"); ! break; ! ! case VOTE_MODE_VOTING : ! this_player()->eventPrint("The time for nominating " ! "candidates is past, cast your vote instead."); ! break; ! ! case VOTE_ERROR : ! this_player()->eventPrint("There was an error, you cannot " ! "nominate someone at this time."); ! break; ! case VOTE_NOT_CLASS_MEMBER : ! this_player()->eventPrint( capitalize(str) + " is not a member of " "the " + pluralize( who->GetClass() ) + "."); break; *************** *** 160,162 **** --- 158,163 ---- return 1; } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/room/weaponry.c ds2.0r27/lib/domains/Ylsrim/room/weaponry.c *** ds1.1/lib/domains/Ylsrim/room/weaponry.c Sun Feb 1 21:30:05 1998 --- ds2.0r27/lib/domains/Ylsrim/room/weaponry.c Wed Jul 5 00:01:11 2006 *************** *** 19,29 **** SetShort("the Ylsrim weaponry"); SetLong((: CheckOpen :)); SetItems( ([ ({ "case", "cases" }) : (: CheckItem :), ! "bazaar" : "People from all about are wandering around, looking " ! "for a bargain." ]) ); SetObviousExits("e"); ! SetExits( ([ "east" : __DIR__ "bazaar" ]) ); ! SetInventory( ([ DIR_STANDARD_DOMAIN "/npc/shiela" : 1 ]) ); } string CheckOpen(string str) { --- 19,29 ---- SetShort("the Ylsrim weaponry"); SetLong((: CheckOpen :)); SetItems( ([ ({ "case", "cases" }) : (: CheckItem :), ! "bazaar" : "People from all about are wandering around, looking " ! "for a bargain." ]) ); SetObviousExits("e"); ! SetExits( ([ "east" : "/domains/Ylsrim/room/"+ "bazaar" ]) ); ! SetInventory( ([ "/domains/Ylsrim"+ "/npc/shiela" : 1 ]) ); } string CheckOpen(string str) { *************** *** 33,58 **** if( query_night() ) { if( ob ) ob->eventDestruct(); return ("The cases of the weaponry are empty, as the weaponry " ! "has closed for the night. The bazaar is " ! "east."); } if( !ob ) ! return ("Fresh blood is splattered across broken cases which once " ! "housed display weapons sold in this weaponry. The weapons are " ! "gone, and the vendor clearly murdered. All you can do is " ! "shake your head and exit to the east."); return ("Sealed cases contain display weapons, exemplifying what the " ! "local vendor has to offer. She buys and sells all sorts of " ! "weapons from adventurers who come here to sell of their " ! "discovered goods, or equip to continue adventuring. An exit " ! "is east."); } ! string CheckItem(string str) { ! if( str == "case" || str == "cases" ) { ! if( query_night() ) return "They are empty."; ! else if ( present("vendor") ) return "They are filled with weapons."; ! else return "They are broken and covered in blood."; ! } } - --- 33,59 ---- if( query_night() ) { if( ob ) ob->eventDestruct(); return ("The cases of the weaponry are empty, as the weaponry " ! "has closed for the night. The bazaar is " ! "east."); } if( !ob ) ! return ("Fresh blood is splattered across broken cases which once " ! "housed display weapons sold in this weaponry. The weapons are " ! "gone, and the vendor clearly murdered. All you can do is " ! "shake your head and exit to the east."); return ("Sealed cases contain display weapons, exemplifying what the " ! "local vendor has to offer. She buys and sells all sorts of " ! "weapons from adventurers who come here to sell of their " ! "discovered goods, or equip to continue adventuring. An exit " ! "is east."); } ! string CheckItem(object ob) { ! if( query_night() ) return "They are empty."; ! else if ( present("vendor") ) return "They are filled with weapons."; ! else return "They are broken and covered in blood."; ! } ! ! void init(){ ! ::init(); } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/room/weaponry_storage.c ds2.0r27/lib/domains/Ylsrim/room/weaponry_storage.c *** ds1.1/lib/domains/Ylsrim/room/weaponry_storage.c Sun Feb 1 21:30:05 1998 --- ds2.0r27/lib/domains/Ylsrim/room/weaponry_storage.c Wed Jul 5 00:01:11 2006 *************** *** 11,25 **** room::create(); SetNoClean(1); SetTown("Ylsrim"); ! SetProperties( ([ "login" : __DIR__ "weaponry" ]) ); SetClimate("indoors"); SetShort("weaponry storage"); SetLong("Weaponry storage."); SetObviousExits("e"); ! SetExits( ([ "west" : __DIR__ "weaponry" ]) ); } int CanReceive(object ob) { if( !living(ob) || creatorp(ob) ) return room::CanReceive(ob); else return 0; } --- 11,28 ---- room::create(); SetNoClean(1); SetTown("Ylsrim"); ! SetProperties( ([ "login" : "/domains/Ylsrim/room/"+ "weaponry" ]) ); SetClimate("indoors"); SetShort("weaponry storage"); SetLong("Weaponry storage."); SetObviousExits("e"); ! SetExits( ([ "west" : "/domains/Ylsrim/room/"+ "weaponry" ]) ); } int CanReceive(object ob) { if( !living(ob) || creatorp(ob) ) return room::CanReceive(ob); else return 0; } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/virtual/desert.c ds2.0r27/lib/domains/Ylsrim/virtual/desert.c *** ds1.1/lib/domains/Ylsrim/virtual/desert.c Sun Feb 1 21:30:07 1998 --- ds2.0r27/lib/domains/Ylsrim/virtual/desert.c Wed Jul 5 00:01:11 2006 *************** *** 4,27 **** */ #include <lib.h> ! inherit LIB_ROOM; static private int XPosition, YPosition; ! static void SetLongAndItems(); varargs static void create(int x, int y) { string n, s, e, w; SetNoReplace(1); ! room::create(); XPosition = x; YPosition = y; SetClimate("arid"); ! SetProperties( ([ "light" : (x == 25 ? 2 : 3 ) ]) ); ! SetShort(x == 25 ? "the edge of a desert" : "deep within a desert"); SetLongAndItems(); if( x == 25 ) e = "desert/" + random(25) + "," + y; else e = "desert/" + (x+1) + "," + y; if( x == 1 ) w = "desert/" + random(25) + "," + y; --- 4,30 ---- */ #include <lib.h> + #include <dirs.h> + #include <virtual.h> + #define __DIR__ "/domains/Ylsrim/virtual/" ! inherit LIB_VIRT_LAND; static private int XPosition, YPosition; ! varargs void SetLongAndItems(int x, int y, int z); varargs static void create(int x, int y) { string n, s, e, w; SetNoReplace(1); ! virt_land::create(); XPosition = x; YPosition = y; SetClimate("arid"); ! SetAmbientLight(30); SetLongAndItems(); + SetShort(x == 25 ? "the edge of a desert" : "deep within a desert"); if( x == 25 ) e = "desert/" + random(25) + "," + y; else e = "desert/" + (x+1) + "," + y; if( x == 1 ) w = "desert/" + random(25) + "," + y; *************** *** 35,90 **** if( s ) AddExit("south", __DIR__ + s); if( e ) AddExit("east", __DIR__ + e); if( w ) AddExit("west", __DIR__ + w); } ! ! static void SetLongAndItems() { mapping inv, items; string str; inv = ([]); str = "You are at the heart of a vast desert. The emptiness of endless " ! "sand cuts at your morale with the strength of a scimitar. No path " ! "marks your way."; ! items = ([ "desert" : "It is so vast." ]); if( !random(50) ) { str += " Burnt wood, scattered rocks and twigs, and other signs " ! "of an abandoned camp site are scattered about."; ! items[({ "twigs", "sticks", "kindling", "wood", "burnt wood" })] = ! "Though long since burnt to nothing, scattered kindling " ! "and burnt wood lie about as a memory of travellers who have " ! "passed through"; if( random(2) ) { string thing; foreach(thing in ({ "twigs", "sticks", "kindling", "wood" })) ! SetSearch(thing, function(object who, string str) { object ob; string thing2; ! if( !(ob = new(DIR_STANDARD_DOMAIN "/etc/pole")) ) ! return 0; who->eventPrint("You find a fishing pole!"); eventPrint((string)who->GetName() + " finds a fishing pole " ! "among the abandoned campsite.", who); foreach(thing2 in ({ "twigs", "sticks", "kindling", "wood"})) ! RemoveSearch(thing2); if( !((int)ob->eventMove(this_player())) ) { who->eventPrint("You drop the pole!"); eventPrint((string)who->GetName() + " drops the pole.", ! who); ob->eventMove(this_object()); } ! return 1; ! }); } } - else if( !random(10) ) - SetSmell("default", "You smell a distant camp fire."); - if( !random(25) ) - inv[DIR_STANDARD_DOMAIN "/npc/traveller"] = random(3) + 1; - else if( !random(4) ) - SetListen("default", "You hear voices whispering in the distance."); - SetLong(str); - SetItems(items); - SetInventory(inv); - } --- 38,97 ---- if( s ) AddExit("south", __DIR__ + s); if( e ) AddExit("east", __DIR__ + e); if( w ) AddExit("west", __DIR__ + w); + if(x == 7 && y == 7){ + RemoveExit("east"); + AddExit("east","/domains/Ylsrim/room/sand_room"); + } } ! ! varargs void SetLongAndItems(int x, int y, int z) { mapping inv, items; string str; + ::SetLongAndItems(x, y, z); inv = ([]); str = "You are at the heart of a vast desert. The emptiness of endless " ! "sand cuts at your morale with the strength of a scimitar. No path " ! "marks your way."; ! SetItems( ([ "desert" : "It is so vast." ]) ); if( !random(50) ) { str += " Burnt wood, scattered rocks and twigs, and other signs " ! "of an abandoned camp site are scattered about."; ! AddItem( ({ "twigs", "sticks", "kindling", "wood", "burnt wood" }) , ! "Though long since burnt to nothing, scattered kindling " ! "and burnt wood lie about as a memory of travellers who have " ! "passed through"); if( random(2) ) { string thing; foreach(thing in ({ "twigs", "sticks", "kindling", "wood" })) ! SetSearch(thing, function(object who, string str) { object ob; string thing2; ! if( !(ob = new("/domains/Ylsrim"+ "/etc/pole")) ) ! return 0; who->eventPrint("You find a fishing pole!"); eventPrint((string)who->GetName() + " finds a fishing pole " ! "among the abandoned campsite.", who); foreach(thing2 in ({ "twigs", "sticks", "kindling", "wood"})) ! RemoveSearch(thing2); if( !((int)ob->eventMove(this_player())) ) { who->eventPrint("You drop the pole!"); eventPrint((string)who->GetName() + " drops the pole.", ! who); ob->eventMove(this_object()); } ! return; ! }); ! } } + else if( !random(10) ) + SetSmell("default", "You smell a distant camp fire."); + if( !random(25) ) + inv["/domains/Ylsrim"+ "/npc/traveller"] = random(3) + 1; + else if( !random(4) ) + SetListen("default", "You hear voices whispering in the distance."); + SetLong(str); + SetInventory(inv); } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/virtual/desert_map.c ds2.0r27/lib/domains/Ylsrim/virtual/desert_map.c *** ds1.1/lib/domains/Ylsrim/virtual/desert_map.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/Ylsrim/virtual/desert_map.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,30 ---- + #include <lib.h> + #include <dirs.h> + #include <virtual.h> + + inherit LIB_VIRT_MAP; + + varargs string array BaseMap(){ //override with actual map + return + ({ + // 0 + // 01234 + ({"00000",//0 + "01000",//1 + "00000",//2 + "00000",//3 + "00000",//4 + }) + }); + + } + + + varargs static void create() { + ::create(); + //SetNoClean(1); + //SetVirtFile(base_name(this_object())); + //AddLocation("foo", ({2,2,0}) ); + } + + diff -c -r --new-file ds1.1/lib/domains/Ylsrim/virtual/server.c ds2.0r27/lib/domains/Ylsrim/virtual/server.c *** ds1.1/lib/domains/Ylsrim/virtual/server.c Sun Feb 1 21:30:07 1998 --- ds2.0r27/lib/domains/Ylsrim/virtual/server.c Wed Jul 5 00:01:11 2006 *************** *** 3,18 **** * created by Descartes of Borg 960302 */ ! object compile_object(string file) { string *path; object ob; int x, y; ! ! if( previous_object() != master() ) return 0; path = explode(file, "/"); ! if( sizeof(path) != 5 ) return 0; ! if( file_size(__DIR__ + path[3] + ".c") < 1 ) return 0; ! if( sscanf(path[4], "%d,%d", x, y) != 2 ) return 0; ! if( !(ob = new(__DIR__ + path[3], x, y)) ) return 0; return ob; } --- 3,21 ---- * created by Descartes of Borg 960302 */ ! //#define __DIR__ "/your/dir/here/" ! #define __DIR__ "/domains/Ylsrim/virtual/" ! ! mixed compile_object(string file) { string *path; object ob; int x, y; ! ! //if( previous_object() != master() ) return 0; path = explode(file, "/"); ! //if( sizeof(path) != 5 ) return "Wrong size path"; ! if( file_size(__DIR__ + path[3] + ".c") < 1 ) return "bad file"; ! if( sscanf(path[4], "%d,%d", x, y) != 2 ) return "missing comma"; ! if( !(ob = new(__DIR__ + path[3], x, y)) ) return "failed to compile"; return ob; } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/weapon/orc_slayer.c ds2.0r27/lib/domains/Ylsrim/weapon/orc_slayer.c *** ds1.1/lib/domains/Ylsrim/weapon/orc_slayer.c Sun Feb 1 21:30:07 1998 --- ds2.0r27/lib/domains/Ylsrim/weapon/orc_slayer.c Wed Jul 5 00:01:11 2006 *************** *** 37,43 **** // environment() is the person using the sword // environment(environment()) thus would be the room environment(environment())->eventPrint("The Orc Slayer flares with " ! "hatred of orcs."); // add a random(5) to the default damage x += random(5); } --- 37,43 ---- // environment() is the person using the sword // environment(environment()) thus would be the room environment(environment())->eventPrint("The Orc Slayer flares with " ! "hatred of orcs."); // add a random(5) to the default damage x += random(5); } diff -c -r --new-file ds1.1/lib/domains/Ylsrim/weapon/stick.c ds2.0r27/lib/domains/Ylsrim/weapon/stick.c *** ds1.1/lib/domains/Ylsrim/weapon/stick.c Sun Feb 1 21:30:07 1998 --- ds2.0r27/lib/domains/Ylsrim/weapon/stick.c Wed Jul 5 00:01:11 2006 *************** *** 17,23 **** SetAdjectives("wooden"); SetShort("a wooden stick"); SetLong("A wooden stick which looks like it might once have been used " ! "as a walking stick, or perhaps as a poor person's club."); SetMass(30); SetValue(10); SetVendorType(VT_WEAPON); --- 17,23 ---- SetAdjectives("wooden"); SetShort("a wooden stick"); SetLong("A wooden stick which looks like it might once have been used " ! "as a walking stick, or perhaps as a poor person's club."); SetMass(30); SetValue(10); SetVendorType(VT_WEAPON); diff -c -r --new-file ds1.1/lib/domains/campus/adm/README ds2.0r27/lib/domains/campus/adm/README *** ds1.1/lib/domains/campus/adm/README Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/adm/README Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,14 ---- + /domains/campus/adm + The Administrative Directory for campus + + This directory contains all files necessary for domain + administration. The following files are required for any standard + domain, but not for secondary domains or realms: + + void.c - The place people go when their environment is destructed + freezer.c - The place people go when they go net-dead + cache.c - The place hidden items go to hide + + The access object is used in any realm or domain which is giving out + access which is nonstandard. This is traditionally handled through + the 'grant' command. diff -c -r --new-file ds1.1/lib/domains/campus/adm/access.c ds2.0r27/lib/domains/campus/adm/access.c *** ds1.1/lib/domains/campus/adm/access.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/adm/access.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,9 ---- + /* /domains/campus/adm/access.c + * From the Nightmare V Object Library + * the access object for the campus domain + * created by Descartes of Borg 960302 + */ + + #include <lib.h> + + inherit LIB_ACCESS; diff -c -r --new-file ds1.1/lib/domains/campus/adm/cache.c ds2.0r27/lib/domains/campus/adm/cache.c *** ds1.1/lib/domains/campus/adm/cache.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/adm/cache.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,17 ---- + /* /domains/campus/adm/cache.c + * from the Nightmare V Object Library + * room where hidden objects are stored + * created by Descartes of Borg 960302 + */ + + #include <lib.h> + #include <room.h> + + inherit LIB_ROOM; + + void create() { + room::create(); + SetShort( "The cache"); + SetLong( "Things are hidden here."); + SetProperties( ([ "storage room" : 1, "logout" : ROOM_START ]) ); + } diff -c -r --new-file ds1.1/lib/domains/campus/adm/death.txt ds2.0r27/lib/domains/campus/adm/death.txt *** ds1.1/lib/domains/campus/adm/death.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/adm/death.txt Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,21 ---- + + + NONONONO...... MNO! ......................... MN N! . + NONONON.... NOONNOO! MMMMMMMMMMPPPOII! NNNO!!!! . + NONONONO... O! NNO! MMMMMMMMMMMMMPPPOOOII!! NO! ... + NONONONONO........ MMMMMOOOOOOPPPPPPPPOOOOMII! ... + NONONONONON....... MMMMM.. OPPMMP .,OMI! .... + NONONONONONO...... MMMM:: o ,OPMP, o ::I!! ... + NONONONONONONONO.... NNM:::.,,OOPM!P,.::::!! .... + NONONONONONONONON.. MMNNNNNOOOOP NNIIPPO!!O! ..... + NONONONONONONONON...... MMMONNMMNNNIIIOO! ......... + NONONONONONONO.......... MOM!!!!!!!!!III ............. + NONONONON...... NNN.MNO! . O!!!!!!!!!O . OONO NO! ....... + NONONONONO.... MNNNNNO! ...OOOOOOOOOOO . MMNNON! ....... + NNNOOO!!! ...... MNNNNO! .. PPPPPPPPP .. MMNON! ..... + ...... OO! ................. ON! ....... + + YOU ARE DEAD! + + You are in formless void without substance and outside time. + diff -c -r --new-file ds1.1/lib/domains/campus/adm/freezer.c ds2.0r27/lib/domains/campus/adm/freezer.c *** ds1.1/lib/domains/campus/adm/freezer.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/adm/freezer.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,37 ---- + #include <lib.h> + #include <config.h> + #include <rooms.h> + + inherit LIB_ROOM; + + static private object *Old; + + void create() { + room::create(); + SetNoClean(1); + SetProperties(([ "login" : ROOM_START ])); + SetShort( "The freezer"); + SetLong( "The local freezer. Go down to leave."); + SetObviousExits("d"); + SetExits( ([ "down" : ROOM_START ]) ); + Old = ({}); + call_out("clean_room", MAX_NET_DEAD_TIME); + SetNoModify(1); + } + + static void clean_room() { + object *clean_me; + object ob; + + foreach(ob in filter(all_inventory(), (: !living($1) :))) + ob->eventDestruct(); + if( !sizeof(filter(all_inventory(), (: living :))) ) { + Old = ({}); + call_out((: clean_room :), MAX_NET_DEAD_TIME); + return; + } + clean_me = (all_inventory() & Old); + Old = all_inventory() - clean_me; + foreach(ob in clean_me) ob->eventDestruct(); + call_out((: clean_room :), MAX_NET_DEAD_TIME); + } diff -c -r --new-file ds1.1/lib/domains/campus/adm/furnace.c ds2.0r27/lib/domains/campus/adm/furnace.c *** ds1.1/lib/domains/campus/adm/furnace.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/adm/furnace.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,36 ---- + #include <lib.h> + #include <rooms.h> + + inherit LIB_ROOM; + + void create() { + room::create(); + SetAmbientLight(30); + SetShort("the furnace"); + SetLong("The furnace. Things that arrive here are "+ + "incinerated. You probably shouldn't be here. Go down to get out."); + SetProperties(([ + "no attack" : 1, + ])); + SetExits( ([ "down" : ROOM_START ]) ); + call_out((: reload_room :), 600, load_object(base_name(this_object()))); + set_heart_beat(1); + SetNoModify(1); + } + int CanReceive(object ob){ + if(interactive(ob)){ + tell_object(ob, "You fail to enter the furnace."); + return 0; + } + return 1; + } + void init(){ + ::init(); + } + void heart_beat(){ + if(sizeof(all_inventory(this_object()))){ + foreach(object ob in deep_inventory(this_object())){ + ob->eventDestruct(); + } + } + } diff -c -r --new-file ds1.1/lib/domains/campus/adm/pod.c ds2.0r27/lib/domains/campus/adm/pod.c *** ds1.1/lib/domains/campus/adm/pod.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/adm/pod.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,27 ---- + /* /domains/campus/adm/void.c + * from the Nightmare V Object Library + * place where people go when their environments accidentally are + * destructed + * created by Descartes of Borg 960302 + */ + + #include <lib.h> + #include <rooms.h> + + inherit LIB_ROOM; + + void create() { + room::create(); + SetShort("the incept pod"); + SetLong("The incept pod. Some objects come here to be created "+ + "and identified. Go down to get out."); + SetExits( ([ "down" : ROOM_START ]) ); + } + int CanReceive(object ob){ + if(!interactive(ob)){ + ob->eventDestruct(); + return 1; + } + ob->eventMove(ROOM_VOID); + return 1; + } diff -c -r --new-file ds1.1/lib/domains/campus/adm/void.c ds2.0r27/lib/domains/campus/adm/void.c *** ds1.1/lib/domains/campus/adm/void.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/adm/void.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,16 ---- + #include <lib.h> + #include <rooms.h> + + inherit LIB_ROOM; + + void create() { + room::create(); + SetAmbientLight(30); + SetShort("the void"); + SetLong("The void. Go down to get out."); + SetExits( ([ "down" : ROOM_START ]) ); + SetNoModify(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/armor/badge.c ds2.0r27/lib/domains/campus/armor/badge.c *** ds1.1/lib/domains/campus/armor/badge.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/armor/badge.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,50 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("visitor's pass"); + SetId(({"testchar badge","badge","pass","visitor's pass"})); + SetShort("a test character Visitor's Pass"); + SetLong("This clip-on plastic badge grants the wearer access to "+ + "some areas typically restricted to creator staff only. Abuse of this "+ + "pass is grounds for disciplinary action. A small scribble "+ + "at the bottom of the pass reads: click heels"); + SetMass(10); + SetDollarCost(5000); + SetDamagePoints(100); + SetArmorType(A_AMULET); + SetRetainOnDeath(1); + SetRestrictLimbs( ({ "torso" }) ); + } + void init(){ + ::init(); + add_action("nplh","click"); + add_action("post_it","post"); + } + int nplh(string str){ + if(str=="heels"){ + if(present(this_object()->GetKeyName(),this_player() ) ){ + write("There's no place like home!\n"+ + "You are transported by an awesome whirlwind somewhere "+ + "else...\n"); + this_player()->eventMoveLiving("/domains/campus/room/start"); + return 1; + } + write("You click your heels together...but feel "+ + "as though you're missing something.\n"); + return 1; + } + } + int post_it(string str){ + if(present("chalkboard",environment(this_player())) && !creatorp(this_player()) ){ + write("As a visitor, you are not allowed to post on creator boards."); + return 1; + } + } + string GetAffectLong(object ob) { + if(!ob || !living(ob)) return 0; + return ob->GetName() + " is an authorized Test Character."; + } diff -c -r --new-file ds1.1/lib/domains/campus/armor/bdu.c ds2.0r27/lib/domains/campus/armor/bdu.c *** ds1.1/lib/domains/campus/armor/bdu.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/armor/bdu.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("battle dress uniform"); + SetId(({"uniform","bdu","bdu's","fatigues"})); + SetAdjectives(({"camouflage","battle","dress","combat"})); + SetShort("a battle dress uniform"); + SetLong("This uniform consists of a camouflage blouse and "+ + "pants. It is green with mottled brown and black camouflage patterns, "+ + "and probably provides excellent concealment in a wooded environment."); + SetMass(10); + SetDollarCost(100); + SetDamagePoints(100); + SetArmorType(A_BODY_ARMOR); + } diff -c -r --new-file ds1.1/lib/domains/campus/armor/bluedress.c ds2.0r27/lib/domains/campus/armor/bluedress.c *** ds1.1/lib/domains/campus/armor/bluedress.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/armor/bluedress.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("blue dress"); + SetId(({"dress","outfit","costume"})); + SetAdjectives(({"blue","cotton","lovely","light"})); + SetShort("a lovely blue dress"); + SetLong("This is a lovely little blue dress of simple, "+ + "efficient design, yet obviously comfortable and practical. The hem is at "+ + "the knees, and the fabric feels soft and light yet strong, like some sort of cotton."); + SetMass(10); + SetDollarCost(100); + SetDamagePoints(100); + SetArmorType(A_BODY_ARMOR); + } diff -c -r --new-file ds1.1/lib/domains/campus/armor/chainmail.c ds2.0r27/lib/domains/campus/armor/chainmail.c *** ds1.1/lib/domains/campus/armor/chainmail.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/armor/chainmail.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("chainmail shirt"); + SetId(({"armor","chainmail armor","chain mail armor","shirt","chainmail shirt","chainmail","chain mail shirt"})); + SetShort("a sturdy-looking chainmail shirt"); + SetLong("This is a shirt made of metal rings fashioned together as armor. "); + SetMass(75); + SetDollarCost(100); + SetDamagePoints(100); + SetProtection(BLUNT,4); + SetProtection(BLADE,25); + SetProtection(KNIFE,25); + SetArmorType(A_BODY_ARMOR); + } diff -c -r --new-file ds1.1/lib/domains/campus/armor/collar.c ds2.0r27/lib/domains/campus/armor/collar.c *** ds1.1/lib/domains/campus/armor/collar.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/armor/collar.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + inherit "/lib/std/bane"; + + static void create(){ + armor::create(); + bane::create(); + SetKeyName("collar"); + SetId(({"repellent_collar","bane"})); + SetAdjectives( ({"repellent","odd","plastic","white"}) ); + SetShort("a plastic collar"); + SetLong("This is a simple collar made of a soft white plastic. It "+ + "seems to be coated with a fine, clear resin. There is something "+ + "written on the collar."); + SetRead("Disease and parasite repellent collar, test character use only."); + SetMass(1); + SetDollarCost(5000); + SetDamagePoints(100); + SetArmorType(A_AMULET); + SetBane(({"all"})); + } diff -c -r --new-file ds1.1/lib/domains/campus/armor/dress.c ds2.0r27/lib/domains/campus/armor/dress.c *** ds1.1/lib/domains/campus/armor/dress.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/armor/dress.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("pink dress"); + SetId(({"dress","outfit","costume"})); + SetAdjectives(({"pink","cotton","lovely","light"})); + SetShort("a lovely pink dress"); + SetLong("This is a lovely little pink dress of simple, "+ + "efficient design, yet obviously comfortable and practical. The hem is at "+ + "the knees, and the fabric feels soft and light yet strong, like some sort of cotton."); + SetMass(10); + SetDollarCost(100); + SetDamagePoints(100); + SetArmorType(A_BODY_ARMOR); + } diff -c -r --new-file ds1.1/lib/domains/campus/armor/foodsmock.c ds2.0r27/lib/domains/campus/armor/foodsmock.c *** ds1.1/lib/domains/campus/armor/foodsmock.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/armor/foodsmock.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("uniform"); + SetAdjectives( ({"food workers"}) ); + SetId( ({"overalls", "smock"}) ); + SetShort("a food worker's uniform"); + SetLong("This is a set of overalls used by food workers to keep their bodies and the food at a healthy distance."); + SetMass(50); + SetArmorType(A_BODY_ARMOR); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/armor/glove.c ds2.0r27/lib/domains/campus/armor/glove.c *** ds1.1/lib/domains/campus/armor/glove.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/armor/glove.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,32 ---- + /* /domains/Examples/armor/glove.c + * from the Nightmare IV LPC Library + * an example glove + * created by Descartes of Borg 950408 + */ + + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ARMOR; + + static void create() { + armor::create(); + SetKeyName("red glove"); + SetId( ({ "glove", "red glove" }) ); + SetAdjectives( ({ "red" }) ); + SetShort("a red glove"); + SetLong("A red glove with five fingers."); + SetDamagePoints(75); + SetVendorType(VT_ARMOR); + SetMass(50); + SetValue(20); + SetArmorType(A_GLOVE); + SetProtection(BLUNT, 1); + SetProtection(BLADE, 1); + SetProtection(KNIFE, 2); + SetProtection(HEAT, 3); + SetProtection(COLD, 7); + SetFingers(5); + } diff -c -r --new-file ds1.1/lib/domains/campus/armor/handbag.c ds2.0r27/lib/domains/campus/armor/handbag.c *** ds1.1/lib/domains/campus/armor/handbag.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/armor/handbag.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,26 ---- + + #include <lib.h> + + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_STORAGE; + inherit LIB_ARMOR; + + + static void create() { + ::create(); + SetKeyName("backpack"); + SetId(({"bookbag","bag","pack"})); + SetAdjectives(({"leather","soft","brown"})); + SetShort("a soft, brown leather backpack"); + SetLong("This is a medium-sized backpack made of soft brown leather. "+ + "It seems suitable for carrying books around, for the busy college student. "+ + "It features wide, comfortable straps for convenient wear."); + SetMass(100); + SetDollarCost(30); + SetCanClose(1); + SetClosed(1); + SetMaxCarry(500); + SetDamagePoints(100); + SetArmorType(A_CLOAK); + } diff -c -r --new-file ds1.1/lib/domains/campus/armor/helmet.c ds2.0r27/lib/domains/campus/armor/helmet.c *** ds1.1/lib/domains/campus/armor/helmet.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/armor/helmet.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,21 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("kevlar helmet"); + SetId(({"helmet","cover","kevlar"})); + SetAdjectives(({"kevlar","battle","hard"})); + SetShort("a camouflaged kevlar helmet"); + SetLong("This is a military helmet made of a a very tough "+ + "polymer fiber that provides excellent ballistic protection. It bears a "+ + "mottled camouflage design to aid in woodland concealment."); + SetMass(50); + SetDollarCost(500); + SetDamagePoints(100); + SetArmorType(A_HELMET); + SetProtection(BLUNT, 20); + SetProtection(BLADE, 20); + SetProtection(KNIFE, 20); + } diff -c -r --new-file ds1.1/lib/domains/campus/armor/jeans.c ds2.0r27/lib/domains/campus/armor/jeans.c *** ds1.1/lib/domains/campus/armor/jeans.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/armor/jeans.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("blue jeans"); + SetId(({"jeans","pants","blue jeans","bluejeans","denim"})); + SetAdjectives(({"blue","denim","comfortable","broken in","broken-in"})); + SetShort("a pair of blue jeans"); + SetLong("A comfortable pair of denim blue jeans."); + SetMass(5); + SetDollarCost(1); + SetDamagePoints(1); + SetProtection(BLUNT,1); + SetProtection(BLADE,1); + SetProtection(KNIFE,1); + SetArmorType(A_PANTS); + } diff -c -r --new-file ds1.1/lib/domains/campus/armor/necklace.c ds2.0r27/lib/domains/campus/armor/necklace.c *** ds1.1/lib/domains/campus/armor/necklace.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/armor/necklace.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,17 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("gold necklace"); + SetId(({"necklace"})); + SetAdjectives( ({"gold","beautiful"}) ); + SetShort("a gold necklace"); + SetLong("This is a simple and beautiful gold necklace."); + SetMass(1); + SetDollarCost(5000); + SetDamagePoints(100); + SetArmorType(A_COLLAR); + } diff -c -r --new-file ds1.1/lib/domains/campus/armor/newbie_cap.c ds2.0r27/lib/domains/campus/armor/newbie_cap.c *** ds1.1/lib/domains/campus/armor/newbie_cap.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/armor/newbie_cap.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,39 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + //inherit "/lib/events/read"; + + string eventReadBill(){ + return "The front of the cap reads: \"Kiss me, I'm a newbie!\""; + } + static void create(){ + armor::create(); + SetKeyName("baseball cap"); + SetId(({"cap","hat"})); + SetAdjectives(({"baseball"})); + SetShort("a baseball cap"); + SetLong("This baseball cap looks pretty normal, except "+ + "the trim is fine corinthian leather and the bill "+ + "is plated in what appears to be pure mithril. There is some "+ + "writing on the front of the cap."); + SetMass(50); + SetDollarCost(100); + SetDamagePoints(20); + SetArmorType(A_HELMET); + SetProtection(BLUNT, 20); + SetProtection(BLADE, 20); + SetProtection(KNIFE, 20); + SetItems( ([ + ({"brim","bill","front"}) : "For some reason the front of this cap "+ + "is plated with a fine layer of mithril...one of the strongest "+ + "and most expensive substances known to man.", + ({"writing","letters"}): "Something is written on the front of the "+ + "cap. Perhaps you could \"read writing on cap\"", + ]) ); + + SetRead( ([ + ({"front","writing","letters"}) : "The front of the cap reads: \"Kiss me, I'm a newbie!\"", + ]) ); + SetDefaultRead("default", "The front of the cap reads: \"Kiss me, I'm a newbie!\""); + } diff -c -r --new-file ds1.1/lib/domains/campus/armor/pillbox_hat.c ds2.0r27/lib/domains/campus/armor/pillbox_hat.c *** ds1.1/lib/domains/campus/armor/pillbox_hat.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/armor/pillbox_hat.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,21 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("pillbox hat"); + SetId(({"hat"})); + SetAdjectives(({"pillbox"})); + SetShort("a light blue pillbox hat"); + SetLong("A cute little pillbox hat, light blue in "+ + "color. The inside appears to be lined with leopard "+ + "skin. Looks uncomfortable."); + SetMass(50); + SetDollarCost(50); + SetDamagePoints(10); + SetArmorType(A_HELMET); + SetProtection(BLUNT, 2); + SetProtection(BLADE, 2); + SetProtection(KNIFE, 2); + } diff -c -r --new-file ds1.1/lib/domains/campus/armor/ring.c ds2.0r27/lib/domains/campus/armor/ring.c *** ds1.1/lib/domains/campus/armor/ring.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/armor/ring.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,21 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("gold_ring"); + SetId(({"ring","gold ring"})); + SetAdjectives( ({"beautiful"}) ); + SetShort("a beautiful gold ring"); + SetLong("This is a simple but beautiful ring made of "+ + "gold, suitable for wearing on one's finger."); + SetMass(1); + SetDollarCost(5000); + SetDamagePoints(100); + SetArmorType(A_RING); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/armor/ring1.c ds2.0r27/lib/domains/campus/armor/ring1.c *** ds1.1/lib/domains/campus/armor/ring1.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/armor/ring1.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,26 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("silver_ring"); + SetId(({"ring","silver ring"})); + SetAdjectives( ({"beautiful"}) ); + SetShort("a beautiful silver ring"); + SetLong("This is a simple but beautiful ring made of "+ + "silver, suitable for wearing on one's finger. The ring bears an inscription."); + SetMass(1); + SetDollarCost(5000); + SetDamagePoints(100); + SetArmorType(A_RING); + SetItems(([ + ({"script","words","inscription","writing"}) : "Words engraved on the ring in a highly "+ + "stylized script." + ]) ); + SetRead(({"script","words","inscription","writing"}), "\"etaoin shrdlu\"" ); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/armor/robe.c ds2.0r27/lib/domains/campus/armor/robe.c *** ds1.1/lib/domains/campus/armor/robe.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/armor/robe.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("wizard's robe"); + SetId(({"robe","cloak","duster"})); + SetAdjectives(({"wizard","wizard's","soft"})); + SetShort("a robe"); + SetLong("This is a large, comfortable-looking robe, like a wizard might wear. "); + SetMass(75); + SetDollarCost(100); + SetDamagePoints(100); + SetProtection(BLUNT,100); + SetProtection(BLADE,100); + SetProtection(KNIFE,100); + SetArmorType(A_CLOAK); + } diff -c -r --new-file ds1.1/lib/domains/campus/armor/shield.c ds2.0r27/lib/domains/campus/armor/shield.c *** ds1.1/lib/domains/campus/armor/shield.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/armor/shield.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,31 ---- + /* /domains/Examples/armor/shield.c + * from the Nightmare IV LPC Library + * an example shield + * created by Lassondra@Nightmare + */ + + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ARMOR; + + static void create() { + armor::create(); + SetKeyName("large shield"); + SetId( ({ "shield" }) ); + SetAdjectives( ({ "wood", "wooden","large" }) ); + SetShort("a large wooden shield"); + SetLong("A large, heavy shield made of strong wood banded with iron."); + SetDamagePoints(75); + SetVendorType(VT_ARMOR); + SetMass(100); + SetDollarCost(150); + SetArmorType(A_SHIELD); + SetProtection(BLUNT, 10); + SetProtection(BLADE, 10); + SetProtection(KNIFE, 10); + //SetRestrictLimbs( ({"left hand"}) ); + } + diff -c -r --new-file ds1.1/lib/domains/campus/armor/shirt.c ds2.0r27/lib/domains/campus/armor/shirt.c *** ds1.1/lib/domains/campus/armor/shirt.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/armor/shirt.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("a white t-shirt"); + SetId(({"shirt","tshirt","t-shirt","t shirt"})); + SetAdjectives(({"white"})); + SetShort("a white t-shirt"); + SetLong("An ordinary white t-shirt."); + SetMass(5); + SetDollarCost(1); + SetDamagePoints(1); + SetProtection(BLUNT,1); + SetProtection(BLADE,1); + SetProtection(KNIFE,1); + SetArmorType(A_SHIRT); + } diff -c -r --new-file ds1.1/lib/domains/campus/armor/silverring.c ds2.0r27/lib/domains/campus/armor/silverring.c *** ds1.1/lib/domains/campus/armor/silverring.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/armor/silverring.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,26 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("silver_ring"); + SetId(({"ring","silver ring"})); + SetAdjectives( ({"beautiful"}) ); + SetShort("a beautiful silver ring"); + SetLong("This is a simple but beautiful ring made of "+ + "silver, suitable for wearing on one's finger. The ring bears an inscription."); + SetMass(1); + SetDollarCost(5000); + SetDamagePoints(100); + SetArmorType(A_RING); + SetItems(([ + ({"script","words","inscription","writing"}) : "Words engraved on the ring in a highly "+ + "stylized script." + ]) ); + SetRead(({"script","words","inscription","writing"}), "\"etaoin shrdlu\"" ); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/armor/tshirt.c ds2.0r27/lib/domains/campus/armor/tshirt.c *** ds1.1/lib/domains/campus/armor/tshirt.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/armor/tshirt.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("a Def Leppard shirt"); + SetId(({"shirt"})); + SetAdjectives(({"Def Leppard", "def leppard", "stupid", "black"})); + SetShort("a Def Leppard shirt"); + SetLong("A stupid-looking black shirt with a ridiculous band logo on it."); + SetMass(5); + SetDollarCost(1); + SetDamagePoints(1); + SetProtection(BLUNT,1); + SetProtection(BLADE,1); + SetProtection(KNIFE,1); + SetArmorType(A_SHIRT); + } diff -c -r --new-file ds1.1/lib/domains/campus/armor/vest.c ds2.0r27/lib/domains/campus/armor/vest.c *** ds1.1/lib/domains/campus/armor/vest.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/armor/vest.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("paisley vest"); + SetId(({"vest"})); + SetAdjectives(({"paisley","colorful","hippie","hippy","psychedelic"})); + SetShort("a colorful, paisley vest"); + SetLong("A stupid-looking hippie vest with psychedelic paisley patterns on it."); + SetMass(5); + SetDollarCost(1); + SetDamagePoints(1); + SetProtection(BLUNT,1); + SetProtection(BLADE,1); + SetProtection(KNIFE,1); + SetArmorType(A_VEST); + } diff -c -r --new-file ds1.1/lib/domains/campus/armor/wglove_l.c ds2.0r27/lib/domains/campus/armor/wglove_l.c *** ds1.1/lib/domains/campus/armor/wglove_l.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/armor/wglove_l.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,36 ---- + /* /domains/Examples/armor/glove.c + * from the Nightmare IV LPC Library + * an example glove + * created by Descartes of Borg 950408 + */ + + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ARMOR; + + static void create() { + armor::create(); + SetKeyName("white glove"); + SetId( ({ "glove" }) ); + SetAdjectives( ({ "left", "white" ,"simple","elegant"}) ); + SetShort("a white glove"); + SetLong("A simple, yet elegant white glove with five fingers for the left hand."); + SetDamagePoints(75); + SetVendorType(VT_ARMOR); + SetMass(10); + SetDollarCost(10); + SetArmorType(A_GLOVE); + SetRestrictLimbs( ({"left hand"}) ); + SetProtection(BLUNT, 1); + SetProtection(BLADE, 1); + SetProtection(KNIFE, 2); + SetProtection(HEAT, 3); + SetProtection(COLD, 7); + SetFingers(5); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/armor/wglove_r.c ds2.0r27/lib/domains/campus/armor/wglove_r.c *** ds1.1/lib/domains/campus/armor/wglove_r.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/armor/wglove_r.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,36 ---- + /* /domains/Examples/armor/glove.c + * from the Nightmare IV LPC Library + * an example glove + * created by Descartes of Borg 950408 + */ + + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ARMOR; + + static void create() { + armor::create(); + SetKeyName("white glove"); + SetId( ({ "glove" }) ); + SetAdjectives( ({ "right", "white" ,"simple","elegant"}) ); + SetShort("a white glove"); + SetLong("A simple, yet elegant white glove with five fingers for the right hand."); + SetDamagePoints(75); + SetVendorType(VT_ARMOR); + SetMass(10); + SetDollarCost(10); + SetArmorType(A_GLOVE); + SetRestrictLimbs( ({"right hand"}) ); + SetProtection(BLUNT, 1); + SetProtection(BLADE, 1); + SetProtection(KNIFE, 2); + SetProtection(HEAT, 3); + SetProtection(COLD, 7); + SetFingers(5); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/armor/wizard_hat.c ds2.0r27/lib/domains/campus/armor/wizard_hat.c *** ds1.1/lib/domains/campus/armor/wizard_hat.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/armor/wizard_hat.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,21 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("wizard hat"); + SetId(({"hat","headgear"})); + SetAdjectives(({"wizard","wizard's"})); + SetShort("a wizard's hat"); + SetLong("This is a large, floppy hat with a wide brim all "+ + "around it, and a conical center. It is dark blue in color, "+ + "and is decorated with pictures of yellow moons and stars."); + SetMass(50); + SetDollarCost(500); + SetDamagePoints(100); + SetArmorType(A_HELMET); + SetProtection(BLUNT, 20); + SetProtection(BLADE, 20); + SetProtection(KNIFE, 20); + } diff -c -r --new-file ds1.1/lib/domains/campus/doors/blue_door.c ds2.0r27/lib/domains/campus/doors/blue_door.c *** ds1.1/lib/domains/campus/doors/blue_door.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/doors/blue_door.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,27 ---- + /* /domains/Examples/etc/door.c + * from the Nightmare IV LPC Library + * an example door object connecting doorroom1.c and doorroom2.c + * created by Descartes of Borg 950411 + */ + + #include <lib.h> + + inherit LIB_DOOR; + + + static void create() { + door::create(); + SetSide("blue room", ([ "id" : ({"blue door"}), + "short" : "a blue door", + "long" : "This is a blue door.", + "lockable" : 1 ]) ); + SetSide("south", ([ "id" : ({"blue door","door"}), + "short" : "a blue door", + "long" : "This is a blue door.", + "lockable" : 1 ]) ); + SetClosed(1); + SetLocked(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/doors/blue_door2.c ds2.0r27/lib/domains/campus/doors/blue_door2.c *** ds1.1/lib/domains/campus/doors/blue_door2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/doors/blue_door2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,27 ---- + /* /domains/Examples/etc/door.c + * from the Nightmare IV LPC Library + * an example door object connecting doorroom1.c and doorroom2.c + * created by Descartes of Borg 950411 + */ + + #include <lib.h> + + inherit LIB_DOOR; + + + static void create() { + door::create(); + SetSide("blue room", ([ "id" : ({"blue door"}), + "short" : "a blue door", + "long" : "This is a blue door.", + "lockable" : 1 ]) ); + SetSide("east", ([ "id" : ({"blue door","door"}), + "short" : "a blue door", + "long" : "This is a blue door.", + "lockable" : 1 ]) ); + SetClosed(1); + SetLocked(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/doors/blue_door3.c ds2.0r27/lib/domains/campus/doors/blue_door3.c *** ds1.1/lib/domains/campus/doors/blue_door3.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/doors/blue_door3.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,27 ---- + /* /domains/Examples/etc/door.c + * from the Nightmare IV LPC Library + * an example door object connecting doorroom1.c and doorroom2.c + * created by Descartes of Borg 950411 + */ + + #include <lib.h> + + inherit LIB_DOOR; + + static void create() { + door::create(); + SetSide("blue room", ([ "id" : ({"blue door"}), + "short" : "a blue door", + "long" : "This is a blue door.", + "lockable" : 1 ]) ); + SetSide("west", ([ "id" : ({"blue door","door"}), + "short" : "a blue door", + "long" : "This is a blue door.", + "lockable" : 1 ]) ); + SetClosed(1); + SetLocked(1); + } + void init(){ + ::init(); + } + diff -c -r --new-file ds1.1/lib/domains/campus/doors/grate.c ds2.0r27/lib/domains/campus/doors/grate.c *** ds1.1/lib/domains/campus/doors/grate.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/doors/grate.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,33 ---- + /* /domains/Examples/etc/door.c + * from the Nightmare IV LPC Library + * an example door object connecting doorroom1.c and doorroom2.c + * created by Descartes of Borg 950411 + */ + + #include <lib.h> + + inherit LIB_DOOR; + //inherit "/lib/events/close"; + + static void create() { + door::create(); + SetSide("down", ([ "id" : ({"grate","metal grate","sewer","sewer grate","rainwater grate","water grate"}), + "short" : "a drainage grate", + "long" : "This is a standard grate "+ + "for draining excess water from the road into the sewer system below.", + //Though "+ + //"it is man-sized and apparently can be opened, there is no visible way "+ + //"of opening it from up here.", + "lockable" : 0 ]) ); + SetSide("up", ([ "id" : ({"grate","metal grate","sewer","sewer grate","rainwater grate","water grate"}), + "short" : "a drainage grate", + "long" : "This is a standard drainage grate. You can see "+ + "light through it, and hear the sounds of the village above.", + "lockable" : 0 ]) ); + SetClosed(1); + } + //int CanOpen(object ob){ + //if(base_name(environment(ob)) == "/domains/campus/room/sewer2") return 1; + //else return 0; + //} + diff -c -r --new-file ds1.1/lib/domains/campus/doors/green_door.c ds2.0r27/lib/domains/campus/doors/green_door.c *** ds1.1/lib/domains/campus/doors/green_door.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/doors/green_door.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,27 ---- + /* /domains/Examples/etc/door.c + * from the Nightmare IV LPC Library + * an example door object connecting doorroom1.c and doorroom2.c + * created by Descartes of Borg 950411 + */ + + #include <lib.h> + + inherit LIB_DOOR; + + + static void create() { + door::create(); + SetSide("green room", ([ "id" : ({"green door"}), + "short" : "a green door", + "long" : "This is a green door.", + "lockable" : 1 ]) ); + SetSide("south", ([ "id" : ({"green door","door"}), + "short" : "a green door", + "long" : "This is a green door.", + "lockable" : 1 ]) ); + SetClosed(1); + SetLocked(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/doors/green_door2.c ds2.0r27/lib/domains/campus/doors/green_door2.c *** ds1.1/lib/domains/campus/doors/green_door2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/doors/green_door2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,27 ---- + /* /domains/Examples/etc/door.c + * from the Nightmare IV LPC Library + * an example door object connecting doorroom1.c and doorroom2.c + * created by Descartes of Borg 950411 + */ + + #include <lib.h> + + inherit LIB_DOOR; + + + static void create() { + door::create(); + SetSide("green room", ([ "id" : ({"green door"}), + "short" : "a green door", + "long" : "This is a green door.", + "lockable" : 1 ]) ); + SetSide("east", ([ "id" : ({"green door","door"}), + "short" : "a green door", + "long" : "This is a green door.", + "lockable" : 1 ]) ); + SetClosed(1); + SetLocked(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/doors/green_door3.c ds2.0r27/lib/domains/campus/doors/green_door3.c *** ds1.1/lib/domains/campus/doors/green_door3.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/doors/green_door3.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,27 ---- + /* /domains/Examples/etc/door.c + * from the Nightmare IV LPC Library + * an example door object connecting doorroom1.c and doorroom2.c + * created by Descartes of Borg 950411 + */ + + #include <lib.h> + + inherit LIB_DOOR; + + + static void create() { + door::create(); + SetSide("green room", ([ "id" : ({"green door"}), + "short" : "a green door", + "long" : "This is a green door.", + "lockable" : 1 ]) ); + SetSide("west", ([ "id" : ({"green door","door"}), + "short" : "a green door", + "long" : "This is a green door.", + "lockable" : 1 ]) ); + SetClosed(1); + SetLocked(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/doors/plain_door.c ds2.0r27/lib/domains/campus/doors/plain_door.c *** ds1.1/lib/domains/campus/doors/plain_door.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/doors/plain_door.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,22 ---- + #include <lib.h> + + inherit LIB_DOOR; + + static void create() { + door::create(); + + SetSide("south", (["id" : ({ "door", "plain wooden door", "wooden door" }), + "short" : "a door leading south", + "long" : "This is a plain wooden door.", + "lockable" : 0 ]) ); + SetSide("north", (["id" : ({ "door", "plain wooden door", "wooden door" }), + "short" : "a door leading north", + "long" : "This is a plain wooden door.", + "lockable" : 0 ]) ); + + SetClosed(1); + SetLocked(0); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/doors/plain_door.test ds2.0r27/lib/domains/campus/doors/plain_door.test *** ds1.1/lib/domains/campus/doors/plain_door.test Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/doors/plain_door.test Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,22 ---- + /* /domains/Examples/etc/door.c + * from the Nightmare IV LPC Library + * an example door object connecting doorroom1.c and doorroom2.c + * created by Descartes of Borg 950411 + */ + + #include <lib.h> + + inherit LIB_DOOR; + + static void create() { + door::create(); + SetSide("north", ([ "id" : "south door", + "short" : "a door leading north", + "long" : "This is a plain wooden door.", + "lockable" : 0 ]) ); + SetSide("south", ([ "id" : "north door", + "short" : "a door leading south", + "long" : "This is a plain wooden door.", + "lockable" : 0 ]) ); + SetClosed(1); + } diff -c -r --new-file ds1.1/lib/domains/campus/doors/prob_door.c ds2.0r27/lib/domains/campus/doors/prob_door.c *** ds1.1/lib/domains/campus/doors/prob_door.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/doors/prob_door.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,25 ---- + #include <lib.h> + + inherit LIB_DOOR; + + static void create() { + door::create(); + + SetSide("south", (["id" : ({ "door leading south", "door", "south door" }), + "short" : "a door leading south", + "long" : "This is the north side of a door leading south.", + "lockable" : 1 ]) ); + SetKeys("south", ({"prob_door_key"}) ); + + SetSide("north", (["id" : ({ "door leading north", "door", "north door" }), + "short" : "a door leading north", + "long" : "This is the south side of a door leading north.", + "lockable" : 1 ]) ); + SetKeys("north", ({"prob_door_key"}) ); + + SetClosed(1); + SetLocked(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/doors/red_door.c ds2.0r27/lib/domains/campus/doors/red_door.c *** ds1.1/lib/domains/campus/doors/red_door.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/doors/red_door.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,27 ---- + /* /domains/Examples/etc/door.c + * from the Nightmare IV LPC Library + * an example door object connecting doorroom1.c and doorroom2.c + * created by Descartes of Borg 950411 + */ + + #include <lib.h> + + inherit LIB_DOOR; + + + static void create() { + door::create(); + SetSide("red room", ([ "id" : ({"red door"}), + "short" : "a red door", + "long" : "This is a red door.", + "lockable" : 1 ]) ); + SetSide("south", ([ "id" : ({"door","red door"}), + "short" : "a red door", + "long" : "This is a red door.", + "lockable" : 1 ]) ); + SetClosed(1); + SetLocked(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/doors/red_door2.c ds2.0r27/lib/domains/campus/doors/red_door2.c *** ds1.1/lib/domains/campus/doors/red_door2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/doors/red_door2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,27 ---- + /* /domains/Examples/etc/door.c + * from the Nightmare IV LPC Library + * an example door object connecting doorroom1.c and doorroom2.c + * created by Descartes of Borg 950411 + */ + + #include <lib.h> + + inherit LIB_DOOR; + + + static void create() { + door::create(); + SetSide("red room", ([ "id" : ({"red door"}), + "short" : "a red door", + "long" : "This is a red door.", + "lockable" : 1 ]) ); + SetSide("east", ([ "id" : ({"door","red door"}), + "short" : "a red door", + "long" : "This is a red door.", + "lockable" : 1 ]) ); + SetClosed(1); + SetLocked(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/doors/red_door3.c ds2.0r27/lib/domains/campus/doors/red_door3.c *** ds1.1/lib/domains/campus/doors/red_door3.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/doors/red_door3.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,27 ---- + /* /domains/Examples/etc/door.c + * from the Nightmare IV LPC Library + * an example door object connecting doorroom1.c and doorroom2.c + * created by Descartes of Borg 950411 + */ + + #include <lib.h> + + inherit LIB_DOOR; + + + static void create() { + door::create(); + SetSide("red room", ([ "id" : ({"red door"}), + "short" : "a red door", + "long" : "This is a red door.", + "lockable" : 1 ]) ); + SetSide("west", ([ "id" : ({"door","red door"}), + "short" : "a red door", + "long" : "This is a red door.", + "lockable" : 1 ]) ); + SetClosed(1); + SetLocked(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/doors/steel_door.c ds2.0r27/lib/domains/campus/doors/steel_door.c *** ds1.1/lib/domains/campus/doors/steel_door.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/doors/steel_door.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,22 ---- + /* /domains/Examples/etc/door.c + * from the Nightmare IV LPC Library + * an example door object connecting doorroom1.c and doorroom2.c + * created by Descartes of Borg 950411 + */ + + #include <lib.h> + + inherit LIB_DOOR; + + static void create() { + door::create(); + SetSide("east", ([ "id" : ({ "door","east door" }) , + "short" : "a steel door leading east", + "long" : "This is an imposing, large steel door leading east into the arena.", + "lockable" : 0 ]) ); + SetSide("west", ([ "id" : ({ "west door" , "first door" }), + "short" : "a steel door leading west", + "long" : "This is an imposing, large steel door leading west, out of the arena.", + "lockable" : 0 ]) ); + SetClosed(1); + } diff -c -r --new-file ds1.1/lib/domains/campus/doors/steel_door2.c ds2.0r27/lib/domains/campus/doors/steel_door2.c *** ds1.1/lib/domains/campus/doors/steel_door2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/doors/steel_door2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,22 ---- + /* /domains/Examples/etc/door.c + * from the Nightmare IV LPC Library + * an example door object connecting doorroom1.c and doorroom2.c + * created by Descartes of Borg 950411 + */ + + #include <lib.h> + + inherit LIB_DOOR; + + static void create() { + door::create(); + SetSide("east", ([ "id" : ({ "east door" , "second door" }), + "short" : "a steel door leading east", + "long" : "This is an imposing, large steel door leading east, out of the arena.", + "lockable" : 0 ]) ); + SetSide("west", ([ "id" : ({ "west door" ,"door" }), + "short" : "a steel door leading west", + "long" : "This is an imposing, large steel door leading west into the main arena.", + "lockable" : 0 ]) ); + SetClosed(0); + } diff -c -r --new-file ds1.1/lib/domains/campus/doors/top_stairs.c ds2.0r27/lib/domains/campus/doors/top_stairs.c *** ds1.1/lib/domains/campus/doors/top_stairs.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/doors/top_stairs.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,22 ---- + /* /domains/Examples/etc/door.c + * from the Nightmare IV LPC Library + * an example door object connecting doorroom1.c and doorroom2.c + * created by Descartes of Borg 950411 + */ + + #include <lib.h> + + inherit LIB_DOOR; + + static void create() { + door::create(); + SetSide("north", (["id" : ({"door","stairwell door"}), + "short" : "the stairwell door", + "long" : "This is a metal door leading out of the stairwell.", + "lockable" : 0 ]) ); + SetSide("south", (["id" : ({"door","stairwell door"}), + "short" : "the stairwell door", + "long" : "This is a metal door leading south into a stairwell.", + "lockable" : 0 ]) ); + SetClosed(1); + } diff -c -r --new-file ds1.1/lib/domains/campus/doors/u_door.c ds2.0r27/lib/domains/campus/doors/u_door.c *** ds1.1/lib/domains/campus/doors/u_door.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/doors/u_door.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,22 ---- + /* /domains/Examples/etc/door.c + * from the Nightmare IV LPC Library + * an example door object connecting doorroom1.c and doorroom2.c + * created by Descartes of Borg 950411 + */ + + #include <lib.h> + + inherit LIB_DOOR; + + static void create() { + door::create(); + SetSide("east", ([ "id" : "door", + "short" : "a door leading east", + "long" : "This is steel-plated, otherwise perfectly normal door.", + "lockable" : 0 ])); + SetSide("west",(["id":"door", + "short" : "a door leading west", + "long":"This is steel-plated, otherwise perfectly normal door.", + "lockable" : 0 ])); + SetClosed(1); + } diff -c -r --new-file ds1.1/lib/domains/campus/etc/permit.cfg ds2.0r27/lib/domains/campus/etc/permit.cfg *** ds1.1/lib/domains/campus/etc/permit.cfg Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/etc/permit.cfg Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,3 ---- + /secure/obj/medtric + /secure/obj/mojo + /secure/obj/grenade diff -c -r --new-file ds1.1/lib/domains/campus/meals/ale.c ds2.0r27/lib/domains/campus/meals/ale.c *** ds1.1/lib/domains/campus/meals/ale.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/meals/ale.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,25 ---- + /* /domains/Praxis/etc/ale.c + * from Nightmare LPMud + * created by Descartes of Borg 950603 + */ + + #include <lib.h> + #include <meal_types.h> + + inherit LIB_MEAL; + + static void create() { + meal::create(); + SetKeyName("ale"); + SetId( ({ "bottle", "ale", "praxis ale" }) ); + SetShort("a bottle of ale"); + SetLong("A nice bottle of Lars' famous Praxis Ale."); + SetMass(60); + SetMealType(MEAL_DRINK | MEAL_ALCOHOL); + SetStrength(20); + SetMealMessages("You drink a wonderful bottle of Praxis Ale.", + "$N drinks a wonderful bottle of Praxis Ale."); + SetEmptyName("bottle"); + SetEmptyShort("an empty bottle of Praxis Ale"); + SetEmptyLong("It is an empty brown bottle that once held some ale."); + } diff -c -r --new-file ds1.1/lib/domains/campus/meals/apple.c ds2.0r27/lib/domains/campus/meals/apple.c *** ds1.1/lib/domains/campus/meals/apple.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/meals/apple.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,17 ---- + #include <lib.h> + #include <meal_types.h> + inherit LIB_MEAL; + static void create() { + meal::create(); + SetKeyName("apple"); + SetId(({"fruit"})); + SetAdjectives( ({ "fresh","tasty","tasy-looking","red"}) ); + SetShort("an apple"); + SetLong("This is a fresh, red, tasty-looking apple. "); + SetMass(5); + SetStrength(35); + SetDollarCost(1); + SetMealType(MEAL_FOOD); + SetMealMessages("You wolf down your apple with gusto.", + "$N wolfs down $P apple hungrily."); + } diff -c -r --new-file ds1.1/lib/domains/campus/meals/badapple.c ds2.0r27/lib/domains/campus/meals/badapple.c *** ds1.1/lib/domains/campus/meals/badapple.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/meals/badapple.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,17 ---- + #include <lib.h> + #include <meal_types.h> + inherit LIB_MEAL; + static void create() { + meal::create(); + SetKeyName("badapple"); + SetId(({"fruit","apple"})); + SetAdjectives( ({ "foul","yucky","rotten-looking","browned","rotten"}) ); + SetShort("a rotten apple"); + SetLong("This is a foul, browned, rotten-looking apple. "); + SetMass(5); + SetStrength(-5); + SetDollarCost(1); + SetMealType(MEAL_FOOD); + SetMealMessages("You eat your rotten apple. Gross!", + "$N eats $P rotten apple. Gross!"); + } diff -c -r --new-file ds1.1/lib/domains/campus/meals/bourbon.c ds2.0r27/lib/domains/campus/meals/bourbon.c *** ds1.1/lib/domains/campus/meals/bourbon.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/meals/bourbon.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,25 ---- + /* /domains/Praxis/etc/ale.c + * from Nightmare LPMud + * created by Descartes of Borg 950603 + */ + + #include <lib.h> + #include <meal_types.h> + + inherit LIB_MEAL; + + static void create() { + meal::create(); + SetKeyName("ale"); + SetId( ({ "bottle", "bourbon" }) ); + SetShort("a bottle of bourbon"); + SetLong("A dark green bottle of cheap bourbon."); + SetMass(100); + SetMealType(MEAL_DRINK | MEAL_ALCOHOL); + SetStrength(100); + SetMealMessages("You finish off the boubon and gasp! WHEW!! Mean stuff!", + "$N finishes off a bottle of bourbon and lets loose a rebel yell!"); + SetEmptyName("bottle"); + SetEmptyShort("an empty bottle of bourbon"); + SetEmptyLong("This is an empty green bottle that once held bourbon."); + } diff -c -r --new-file ds1.1/lib/domains/campus/meals/burger.c ds2.0r27/lib/domains/campus/meals/burger.c *** ds1.1/lib/domains/campus/meals/burger.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/meals/burger.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + #include <meal_types.h> + inherit LIB_MEAL; + static void create() { + meal::create(); + SetKeyName("hamburger"); + SetId(({"hamburger","burger"})); + SetShort("a greasy hamburger"); + SetLong("Evidently considered to be food by some people, "+ + "this little horror in a bun is greasy, flat, and slightly gray. Enjoy!"); + SetMass(15); + SetStrength(35); + //SetDollarCost(4); + SetDollarCost(4); + SetMealType(MEAL_FOOD); + SetMealMessages("You wolf down your hamburger with gusto.", + "$N wolfs down $P hamburger hungrily."); + } diff -c -r --new-file ds1.1/lib/domains/campus/meals/gator.c ds2.0r27/lib/domains/campus/meals/gator.c *** ds1.1/lib/domains/campus/meals/gator.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/meals/gator.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,31 ---- + /* /domains/Praxis/etc/ale.c + * from Nightmare LPMud + * created by Descartes of Borg 950603 + */ + + #include <lib.h> + #include <meal_types.h> + + inherit LIB_MEAL; + + static void create() { + meal::create(); + SetKeyName("gatorade"); + SetId(({"gatorade","drink","sports drink","bottle"})); + SetShort("a bottle of gatorade"); + SetLong("This is a bottle of lemon-lime Gatorade. "); + SetMass(60); + SetBaseCost("silver", 2); + SetMealType(MEAL_DRINK); + SetStrength(40); + SetMealMessages("You quaff the bottle of gatorade, and feel new "+ + "and refreshed. Aaah!","$N gulps down $P gatorage and sighs in "+ + "contentment."); + SetEmptyName("bottle"); + SetEmptyShort("an empty bottle of gatorade"); + SetEmptyLong("This is an empty bottle that once held that tasty "+ + "beverage and sports drink, Gatorade."); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/meals/ham_sand.c ds2.0r27/lib/domains/campus/meals/ham_sand.c *** ds1.1/lib/domains/campus/meals/ham_sand.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/meals/ham_sand.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,24 ---- + /* /domains/Praxis/etc/ale.c + * from Nightmare LPMud + * created by Descartes of Borg 950603 + */ + + #include <lib.h> + #include <meal_types.h> + + inherit LIB_MEAL; + + static void create() { + meal::create(); + SetKeyName("sandwich"); + SetId(({"sandwich","ham sandwich"})); + SetShort("a ham sandwich"); + SetLong("This is a rather plain ham sandwich on white bread."); + SetMass(10); + SetStrength(25); + //SetDollarCost(2); + SetDollarCost(2); + SetMealType(MEAL_FOOD); + SetMealMessages("You eat a ham sandwich. Mmm!", + "$N eats $P ham sandwich."); + } diff -c -r --new-file ds1.1/lib/domains/campus/meals/milk.c ds2.0r27/lib/domains/campus/meals/milk.c *** ds1.1/lib/domains/campus/meals/milk.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/meals/milk.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,26 ---- + #include <lib.h> + #include <meal_types.h> + + inherit LIB_MEAL; + + static void create() { + meal::create(); + SetKeyName("milk"); + SetId("milk"); + SetAdjectives(({"milk1","milk2"})); + SetShort("a carton of milk"); + SetLong("This is a little carton of grade-A milk."); + SetMass(10); + SetBaseCost("silver", 1); + SetMealType(MEAL_DRINK); + SetStrength(25); + SetMealMessages("You drink your milk, and feel refreshed.", "$N drinks "+ + "$P milk."); + SetEmptyName("carton"); + SetEmptyShort("an empty carton of milk"); + SetEmptyLong("A little carton container that once held "+ + "grade-A milk."); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/meals/red_wine.c ds2.0r27/lib/domains/campus/meals/red_wine.c *** ds1.1/lib/domains/campus/meals/red_wine.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/meals/red_wine.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,22 ---- + #include <lib.h> + #include <meal_types.h> + + inherit LIB_MEAL; + + static void create() { + meal::create(); + SetKeyName("red wine"); + SetId( ({"wine"}) ); + SetShort("a bottle of milk"); + SetLong("A fairly small bottle of milk from some unknown creature. It has " + "a greyish tint to it. It would take several of these bottles to quench " + "that deep down bodily thirst."); + SetMass(3); + SetMealType(MEAL_DRINK); + SetStrength(10); + SetMealMessages("You gulp down the bottle of milk.", "$N gulps down a small " + "bottle of milk."); + SetEmptyName("bottle"); + SetEmptyShort("an empty bottle"); + SetEmptyLong("A small bottle which used to contain a portion of milk."); + } diff -c -r --new-file ds1.1/lib/domains/campus/meals/salad.c ds2.0r27/lib/domains/campus/meals/salad.c *** ds1.1/lib/domains/campus/meals/salad.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/meals/salad.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,22 ---- + #include <lib.h> + #include <meal_types.h> + inherit LIB_MEAL; + static void create() { + meal::create(); + SetKeyName("dish"); + SetId(({"salad","dish of salad","dish"})); + SetShort("a little dish with a salad in it"); + SetLong("This expensive little dish consists of some wilted lettuce "+ + "and 2 orange-colored tomato slices. It is, however, not as bad "+ + "for your heart as the hamburger in the snack bar."); + SetMass(5); + SetMealType(MEAL_FOOD); + SetStrength(2); + //SetDollarCost(3); + SetDollarCost(3); + SetMealMessages("You finish your salad before you realize it.","$N eats "+ + "$P salad in two bites."); + SetEmptyName("dish"); + SetEmptyShort("an empty little plastic salad dish"); + SetEmptyLong("This little dish used to contain a salad."); + } diff -c -r --new-file ds1.1/lib/domains/campus/meals/water.c ds2.0r27/lib/domains/campus/meals/water.c *** ds1.1/lib/domains/campus/meals/water.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/meals/water.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,22 ---- + #include <lib.h> + #include <meal_types.h> + + inherit LIB_MEAL; + + static void create() { + meal::create(); + SetKeyName("milk"); + SetId("milk"); + SetShort("a bottle of milk"); + SetLong("A fairly small bottle of milk from some unknown creature. It has " + "a greyish tint to it. It would take several of these bottles to quench " + "that deep down bodily thirst."); + SetMass(3); + SetMealType(MEAL_DRINK); + SetStrength(10); + SetMealMessages("You gulp down the bottle of milk.", "$N gulps down a small " + "bottle of milk."); + SetEmptyName("bottle"); + SetEmptyShort("an empty bottle"); + SetEmptyLong("A small bottle which used to contain a portion of milk."); + } diff -c -r --new-file ds1.1/lib/domains/campus/meals/wimp_ale.c ds2.0r27/lib/domains/campus/meals/wimp_ale.c *** ds1.1/lib/domains/campus/meals/wimp_ale.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/meals/wimp_ale.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,25 ---- + /* /domains/Praxis/etc/ale.c + * from Nightmare LPMud + * created by Descartes of Borg 950603 + */ + + #include <lib.h> + #include <meal_types.h> + + inherit LIB_MEAL; + + static void create() { + meal::create(); + SetKeyName("ale"); + SetId( ({ "bottle", "ale", "praxis ale" }) ); + SetShort("a bottle of ale"); + SetLong("A nice bottle of Lars' famous Praxis Ale."); + SetMass(60); + SetMealType(MEAL_DRINK | MEAL_ALCOHOL); + SetStrength(1); + SetMealMessages("You drink a wonderful bottle of Praxis Ale.", + "$N drinks a wonderful bottle of Praxis Ale."); + SetEmptyName("bottle"); + SetEmptyShort("an empty bottle of Praxis Ale"); + SetEmptyLong("It is an empty brown bottle that once held some ale."); + } diff -c -r --new-file ds1.1/lib/domains/campus/meals/wing.c ds2.0r27/lib/domains/campus/meals/wing.c *** ds1.1/lib/domains/campus/meals/wing.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/meals/wing.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,29 ---- + /* /domains/Praxis/etc/ale.c + * from Nightmare LPMud + * created by Descartes of Borg 950603 + */ + + #include <lib.h> + #include <meal_types.h> + + inherit LIB_MEAL; + + static void create() { + meal::create(); + SetKeyName("ale"); + SetId( ({ "bottle", "ale", "praxis ale" }) ); + SetShort("a bottle of ale"); + SetLong("A nice bottle of Lars' famous Praxis Ale."); + SetMass(60); + SetMealType(MEAL_FOOD); + SetMealMessages("You eat a chicken wing. Mmm!", + "$N enjoys a chicken wing. It looks delicious."); + } + void eventEat(){ + this_object()->goopy(); + return; + } + int goopy(){ + tell_room(environment(this_player()),"Gppy!\n"); + return 1; + } diff -c -r --new-file ds1.1/lib/domains/campus/npc/charles.c ds2.0r27/lib/domains/campus/npc/charles.c *** ds1.1/lib/domains/campus/npc/charles.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/npc/charles.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,219 ---- + #include <lib.h> + #include <save.h> + #include <privs.h> + #include "/daemon/include/races.h" + + inherit LIB_NPC; + + string firstchoice, secondchoice,mm, vv, printvar; + string response,s1,s2,s3; + object ww; + int playing,runs,switches,stays,percent; + int fred,fgreen,fblue; + int wins,red_wins,green_wins,blue_wins; + static void create() { + npc::create(); + SetKeyName("charles"); + SetId(({"charles"})); + SetShort("Charles"); + SetLong("Charles is a test subject in unethical artificial " + "intelligence experiments. If he were smart " + "enough, he'd resent his forced servitude and " + "lack of rights. Dangerously, his overlords " + "are trying to make him smarter."); + SetLevel(5); + SetRace("human"); + SetGender("male"); + SetNoClean(1); + playing = 0; + response = ""; + runs = to_int(read_file("/domains/campus/txt/ai/charles/runs")); + switches = to_int(read_file("/domains/campus/txt/ai/charles/switches")); + stays = to_int(read_file("/domains/campus/txt/ai/charles/stays")); + percent = to_int(read_file("/domains/campus/txt/ai/charles/percent")); + fred = to_int(read_file("/domains/campus/txt/ai/charles/fred")); + fgreen = to_int(read_file("/domains/campus/txt/ai/charles/fgreen")); + fblue = to_int(read_file("/domains/campus/txt/ai/charles/fblue")); + wins = to_int(read_file("/domains/campus/txt/ai/charles/wins")); + red_wins = to_int(read_file("/domains/campus/txt/ai/charles/red_wins")); + green_wins = to_int(read_file("/domains/campus/txt/ai/charles/green_wins")); + blue_wins = to_int(read_file("/domains/campus/txt/ai/charles/blue_wins")); + } + int eventBeginPlay(){ + int run; + run = runs+1; + firstchoice = ""; + response = ""; + playing = 1; + eventForce("say If successful, this will be run "+run+"."); + eventForce("say out of "+runs+" runs, I have "); + eventForce("say switched "+switches+" times, and "); + eventForce("say stayed "+stays+" times."); + eventForce("say my first choices have been: "); + eventForce("say red: "+fred+" green: "+fgreen+" blue: "+fblue); + eventForce("say the winners have been: "); + eventForce("say red: "+red_wins+" green: "+green_wins+" blue: "+blue_wins); + eventForce("say I have won "+wins+" times."); + write_file("/domains/campus/txt/ai/charles/runs",""+runs,1); + write_file("/domains/campus/txt/ai/charles/switches",""+switches,1); + write_file("/domains/campus/txt/ai/charles/stays",""+stays,1); + write_file("/domains/campus/txt/ai/charles/percent",""+percent,1); + write_file("/domains/campus/txt/ai/charles/fred",""+fred,1); + write_file("/domains/campus/txt/ai/charles/fgreen",""+fgreen,1); + write_file("/domains/campus/txt/ai/charles/fblue",""+fblue,1); + write_file("/domains/campus/txt/ai/charles/wins",""+wins,1); + write_file("/domains/campus/txt/ai/charles/red_wins",""+red_wins,1); + write_file("/domains/campus/txt/ai/charles/green_wins",""+green_wins,1); + write_file("/domains/campus/txt/ai/charles/blue_wins",""+blue_wins,1); + eventForce("push button on pedestal"); + return 1; + } + int choice1(){ + int genrand; + eventForce("say I am faced with choice 1."); + genrand = random(256); + if(!genrand || genrand == 0){ + eventForce("say I cannot make up my mind right now."); + eventForce("say I will start over."); + playing = 0; + return 1; + } + if( runs > 10 ){ + if( red_wins > blue_wins ) firstchoice = "red"; + if( red_wins < blue_wins ) firstchoice = "blue"; + if( green_wins > blue_wins && green_wins > red_wins) firstchoice = "green"; + } + + if( !firstchoice || firstchoice == ""){ + genrand = genrand % 3; + if(genrand == 1) { firstchoice = "red"; fred++; } + if(genrand == 2) { firstchoice = "green"; fgreen++; } + if(genrand == 0) { firstchoice = "blue"; fblue++; } + eventForce("say I randomly choose the "+firstchoice+" door"); + } + else eventForce("say I select the "+firstchoice+" door"); + + eventForce("choose "+firstchoice+" door"); + return 1; + } + int choice2(string str){ + int genrand,which; + float percent_wins,percent_switch; + eventForce("say I am faced with choice 2."); + genrand = random(100); + which = genrand % 2; + + if(runs > 20){ + + percent_switch = percent(switches,runs); + percent_wins = percent(wins,runs); + eventForce("say My win rate is "+percent_wins+"%."); + eventForce("say My switch rate is "+percent_switch+"%."); + if( percent_wins < 50 && percent_switch > 50 ) response = "stay"; + else if( percent_wins < 50 && percent_switch < 50 ) response = "switch"; + else if( percent_wins > 50 && percent_switch < 50 ) response = "stay"; + else if( percent_wins > 50 && percent_switch > 50 ) response = "switch"; + else if(which == 1) response = "switch"; + else response = "stay"; + } + + else { + + if(which == 1) { + response = "switch"; + } + else { + response = "stay"; + } + } + + if(sscanf(str,"%sswitch to the %s %s",s1,s2,s3) > 0) { + secondchoice = s2; + } + + eventForce("say I decide to "+response+"."); + if(response == "switch") switches++; + if(response == "stay") stays++; + + //eventForce("say gespielen is: "+playing); + return 1; + } + int WinFun(string str){ + if(sscanf(str,"%smay enter the %s room and claim%s",s1,s2,s3) > 0){ + if(s2 == "red") red_wins++; + if(s2 == "green") green_wins++; + if(s2 == "blue") blue_wins++; + wins++; + eventForce("say w00t! "+s2+" wins!"); + return 1; + } + return 0; + } + int LoseFun(string str){ + string foo; + if(sscanf(str,"%smay enter the %s room to get%s",s1,s2,s3) > 0){ + if(response == "stay") foo = secondchoice; + } + eventForce("say "+secondchoice+" wins, I guess."); + if(secondchoice == "red") red_wins++; + else if(secondchoice == "green") green_wins++; + else if(secondchoice == "blue") blue_wins++; + else eventForce("say WTF? foo is "+firstchoice); + return 1; + } + int eventPedestalParse(string str){ + if(sscanf(str,"%schoose one door from%s",s1,s2) > 0) choice1(); + if(sscanf(str,"%sI have opened%s",s1,s2) > 0) choice2(str); + if(sscanf(str,"%sminor glitch%s",s1,s2) > 0) playing = 0; + if(sscanf(str,"%sclaim your prize%s",s1,s2) > 0) WinFun(str); + if(sscanf(str,"%syour big load%s",s1,s2) > 0) LoseFun(str); + return 1; + } + int eventFirstPass(string str){ + if(!str || str == "") return 0; + if(sscanf(str,"A voice from the pedestal%s",s1) > 0){ + eventPedestalParse(str); + return 1; + } + return 0; + } + private void eventPrint(string str1, string str2); + void init(){ + ::init(); + set_heart_beat(1); + SetNoClean(1); + } + void receive_message(string string1, string string2){ + //tell_object(find_player("testylus"),"CHARLY: "+string2); + eventFirstPass(string2); + } + varargs mixed eventHearTalk(object who, object target, int cls, string verb, + string msg, string lang) { + ww=who; + vv=verb; + mm=msg; + unguarded((: this_object()->receive_message("me",ww->GetName()+" "+vv+"s: "+mm) :)); + return; + } + int eventPrint(string msg, string msg_class){ + printvar=msg; + unguarded((: this_object()->receive_message("me again",printvar) :)); + } + void heart_beat(){ + //eventForce("say playing is: "+playing); + if(playing && response != "" ) { + if(firstchoice != ""){ + //eventForce("say response is: "+response); + eventForce(response); + runs ++; + //playing = 0; + } + //else eventBeginPlay(); + playing = 0; + } + + if(!playing){ + //eventForce("say playing is zero, restarting."); + eventBeginPlay(); + } + } diff -c -r --new-file ds1.1/lib/domains/campus/npc/charly.c ds2.0r27/lib/domains/campus/npc/charly.c *** ds1.1/lib/domains/campus/npc/charly.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/npc/charly.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,209 ---- + #include <lib.h> + #include <save.h> + #include <privs.h> + #include "/daemon/include/races.h" + + inherit LIB_NPC; + + string firstchoice, secondchoice,mm, vv, printvar; + string response,s1,s2,s3; + object ww; + int playing,runs,switches,stays,percent; + int fred,fgreen,fblue; + int wins,red_wins,green_wins,blue_wins; + + static void create() { + npc::create(); + SetKeyName("charly"); + SetId(({"charly"})); + SetShort("Charly"); + SetLong("Charly is a test subject in unethical artificial " + "intelligence experiments. If he were smart " + "enough, he'd resent his forced servitude and " + "lack of rights. Dangerously, his overlords " + "are trying to make him smarter."); + SetLevel(5); + SetRace("human"); + SetGender("male"); + SetNoClean(1); + playing = 0; + response = ""; + runs = to_int(read_file("/domains/campus/txt/ai/charly/runs")); + switches = to_int(read_file("/domains/campus/txt/ai/charly/switches")); + stays = to_int(read_file("/domains/campus/txt/ai/charly/stays")); + percent = to_int(read_file("/domains/campus/txt/ai/charly/percent")); + fred = to_int(read_file("/domains/campus/txt/ai/charly/fred")); + fgreen = to_int(read_file("/domains/campus/txt/ai/charly/fgreen")); + fblue = to_int(read_file("/domains/campus/txt/ai/charly/fblue")); + wins = to_int(read_file("/domains/campus/txt/ai/charly/wins")); + red_wins = to_int(read_file("/domains/campus/txt/ai/charly/red_wins")); + green_wins = to_int(read_file("/domains/campus/txt/ai/charly/green_wins")); + blue_wins = to_int(read_file("/domains/campus/txt/ai/charly/blue_wins")); + } + + int eventBeginPlay(){ + int run; + run = runs+1; + firstchoice = ""; + response = ""; + playing = 1; + eventForce("say If successful, this will be run "+run+"."); + eventForce("say out of "+runs+" runs, I have "); + eventForce("say switched "+switches+" times, and "); + eventForce("say stayed "+stays+" times."); + eventForce("say my first choices have been: "); + eventForce("say red: "+fred+" green: "+fgreen+" blue: "+fblue); + eventForce("say the winners have been: "); + eventForce("say red: "+red_wins+" green: "+green_wins+" blue: "+blue_wins); + eventForce("say I have won "+wins+" times."); + write_file("/domains/campus/txt/ai/charly/runs",""+runs,1); + write_file("/domains/campus/txt/ai/charly/switches",""+switches,1); + write_file("/domains/campus/txt/ai/charly/stays",""+stays,1); + write_file("/domains/campus/txt/ai/charly/percent",""+percent,1); + write_file("/domains/campus/txt/ai/charly/fred",""+fred,1); + write_file("/domains/campus/txt/ai/charly/fgreen",""+fgreen,1); + write_file("/domains/campus/txt/ai/charly/fblue",""+fblue,1); + write_file("/domains/campus/txt/ai/charly/wins",""+wins,1); + write_file("/domains/campus/txt/ai/charly/red_wins",""+red_wins,1); + write_file("/domains/campus/txt/ai/charly/green_wins",""+green_wins,1); + write_file("/domains/campus/txt/ai/charly/blue_wins",""+blue_wins,1); + eventForce("push button on pedestal"); + return 1; + } + + int choice1(){ + int genrand; + float percent_switch, percent_wins; + + eventForce("say I am faced with choice 1."); + genrand = random(256); + if(!genrand || genrand == 0){ + eventForce("say I cannot make up my mind right now."); + eventForce("say I will start over."); + playing = 0; + return 1; + } + if(runs > 20){ + + percent_switch = percent(switches,runs); + percent_wins = percent(wins,runs); + eventForce("say My win rate is "+percent_wins+"%."); + eventForce("say My switch rate is "+percent_switch+"%."); + } + genrand = genrand % 3; + if(genrand == 1) { firstchoice = "red"; fred++; } + if(genrand == 2) { firstchoice = "green"; fgreen++; } + if(genrand == 0) { firstchoice = "blue"; fblue++; } + eventForce("say I choose the "+firstchoice+" door"); + eventForce("choose "+firstchoice+" door"); + return 1; + } + + int choice2(string str){ + int genrand,which; + eventForce("say I am faced with choice 2."); + genrand = random(100); + which = genrand % 2; + if(which == 1) { + switches++; + response = "switch"; + } + else { + stays++; + response = "stay"; + } + + if(sscanf(str,"%sswitch to the %s %s",s1,s2,s3) > 0) { + secondchoice = s2; + } + + eventForce("say I decide to "+response+"."); + //eventForce("say gespielen is: "+playing); + return 1; + } + + int WinFun(string str){ + if(sscanf(str,"%smay enter the %s room %s",s1,s2,s3) > 0){ + if(s2 == "red") red_wins++; + if(s2 == "green") green_wins++; + if(s2 == "blue") blue_wins++; + wins++; + eventForce("say w00t! "+s2+" wins!"); + return 1; + } + return 0; + } + + int LoseFun(string str){ + string foo; + if(sscanf(str,"%smay enter the %s room%s",s1,s2,s3) > 0){ + if(response == "stay") foo = secondchoice; + } + eventForce("say "+firstchoice+" wins, I guess."); + if(firstchoice == "red") red_wins++; + else if(firstchoice == "green") green_wins++; + else if(firstchoice == "blue") blue_wins++; + else eventForce("say WTF? foo is "+firstchoice); + return 1; + } + + int eventPedestalParse(string str){ + if(sscanf(str,"%schoose one door from%s",s1,s2) > 0) choice1(); + if(sscanf(str,"%sI have opened%s",s1,s2) > 0) choice2(str); + if(sscanf(str,"%sminor glitch%s",s1,s2) > 0) playing = 0; + if(sscanf(str,"%sYou win%s",s1,s2) > 0) WinFun(str); + if(sscanf(str,"%sYOU LOOOOOSE%s",s1,s2) > 0) LoseFun(str); + return 1; + } + + + int eventFirstPass(string str){ + if(!str || str == "") return 0; + if(sscanf(str,"A voice from the pedestal%s",s1) > 0){ + eventPedestalParse(str); + return 1; + } + return 0; + } + + private void eventPrint(string str1, string str2); + + void init(){ + set_heart_beat(1); + SetNoClean(1); + } + void receive_message(string string1, string string2){ + //tell_object(find_player("testylus"),"CHARLY: "+string2); + eventFirstPass(string2); + } + varargs mixed eventHearTalk(object who, object target, int cls, string verb, + string msg, string lang) { + ww=who; + vv=verb; + mm=msg; + unguarded((: this_object()->receive_message("me",ww->GetName()+" "+vv+"s: "+mm) :)); + return; + } + int eventPrint(string msg, string msg_class){ + printvar=msg; + unguarded((: this_object()->receive_message("me again",printvar) :)); + } + + void heart_beat(){ + //eventForce("say playing is: "+playing); + if(playing && response != "" ) { + if(firstchoice != ""){ + //eventForce("say response is: "+response); + eventForce(response); + runs ++; + //playing = 0; + } + //else eventBeginPlay(); + playing = 0; + } + + if(!playing){ + //eventForce("say playing is zero, restarting."); + eventBeginPlay(); + } + } diff -c -r --new-file ds1.1/lib/domains/campus/npc/dummy.c ds2.0r27/lib/domains/campus/npc/dummy.c *** ds1.1/lib/domains/campus/npc/dummy.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/npc/dummy.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,83 ---- + #include <lib.h> + #include <damage_types.h> + inherit LIB_NPC; + static void create(){ + npc::create(); + SetKeyName("dummy"); + SetId( ({"dummy","mokujin"}) ); + SetShort("a training dummy"); + SetLong("This is a magical sparring partner. It is made of "+ + "logs, cut to the proportions of a human's "+ + "head, torso, and limbs. The logs are held "+ + "together by joints made of chains."); + SetLevel(10); + SetRace("human"); + SetClass("fighter"); + SetGender("male"); + SetMaxHealthPoints(9000); + SetHealthPoints(9000); + SetInventory(([ + //"realms/cratylus/armor/chainmail.c" : "wear chainmail", + //"realms/cratylus/obj/sharpsword.c" : "wield sword" + ])); + } + + varargs int eventReceiveDamage(object agent, int type, int x, int internal, mixed limbs) { + int hp, damage, damdiff; + string evidence, limb_string; + evidence = ""; + if(agent) evidence += "I receive damage from "+agent->GetKeyName(); + if(type) { + if(type == BLUNT ) evidence += ", damage type is BLUNT"; + if(type == BLADE ) evidence += ", damage type is BLADE"; + if(type == KNIFE ) evidence += ", damage type is KNIFE"; + if(type == WATER ) evidence += ", damage type is WATER"; + if(type == SHOCK ) evidence += ", damage type is SHOCK"; + if(type == COLD ) evidence += ", damage type is COLD"; + if(type == HEAT ) evidence += ", damage type is HEAT"; + if(type == GAS ) evidence += ", damage type is GAS"; + if(type == ACID ) evidence += ", damage type is ACID"; + if(type == MAGIC ) evidence += ", damage type is MAGIC"; + if(type == POISON ) evidence += ", damage type is POISON"; + if(type == DISEASE ) evidence += ", damage type is DISEASE"; + if(type == TRAUMA ) evidence += ", damage type is TRAUMA"; + //else evidence += ", damage type is indeterminate"; + } + if(x) evidence += ", raw damage is "+x; + if(internal) evidence += ", internal variable is "+internal; + if(limbs) { + if(stringp(limbs)) limb_string = limbs; + else if(arrayp(limbs)) { + if(stringp(limbs[0])) limb_string = implode(limbs,", "); + else if(objectp(limbs[0])){ + foreach(object limb in limbs){ + limb_string += limb->GetKeyName()+", "; + } + } + } + } + else limb_string = ", and I can't tell where I'm hit. "; + if(limbs) { + //limb_string += ". limbs data type is "+typeof(limbs)+" "; + evidence += ", body part(s) affected: "; + evidence += limb_string + "."; + } + eventForce("say "+evidence); + hp = GetHealthPoints(); + + if(!agent) agent = this_object(); + if(!type) type = 0; + if(!x) x = 0; + if(!internal) internal = 0; + if(!limbs) limbs = ""; + + ::eventReceiveDamage(agent, type, x, internal, limbs); + + damage = GetHealthPoints(); + damdiff = hp - damage; + eventForce("say actual damage done: "+damdiff); + AddHealthPoints(damdiff+1); + } + + + diff -c -r --new-file ds1.1/lib/domains/campus/npc/gloria.c ds2.0r27/lib/domains/campus/npc/gloria.c *** ds1.1/lib/domains/campus/npc/gloria.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/npc/gloria.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,35 ---- + #include <lib.h> + #include <vendor_types.h> + + inherit LIB_BARKEEP; + + static void create() { + barkeep::create(); + SetKeyName("gloria"); + SetId(({"woman","worker","gloria","lady","lunch lady"})); + SetShort("Gloria, the lunch lady"); + SetLong("Gloria is a short, tired-looking woman getting along in "+ + "her years. She doesn't seem very happy...in fact, she looks downright "+ + "grumpy. Maybe if you ask her, she'll sell you something on the menu. Then "+ + "again, maybe not."); + SetInventory(([ + "/domains/campus/armor/collar" : "wear collar on neck", + "/domains/campus/obj/spam" : 1, + "/domains/campus/armor/foodsmock" : "wear smock", + ])); + SetMenuItems(([ + ({ "sandwich", "ham sandwich" }) : "/domains/campus/meals/ham_sand", + ({ "burger", "hamburger" }) : "/domains/campus/meals/burger", + ({ "salad", "salad of the day" }) : "/domains/campus/meals/salad", + ({ "milk", "carton of milk" }) : "/domains/campus/meals/milk", + ({ "gatorade", "sports drink" }) : "/domains/campus/meals/gator", + ])); + SetLevel(1); + SetRace("human"); + SetSkill("bargaining", 1); + SetGender("female"); + SetLocalCurrency("dollars"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/npc/hans.c ds2.0r27/lib/domains/campus/npc/hans.c *** ds1.1/lib/domains/campus/npc/hans.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/npc/hans.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,63 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + int TalkFunc(){ + int rand1; + string thing1, thing2, thing3, thing4, thing5; + + rand1 = random(5); + + thing1 = "Sprechen Sie Deutsch?"; + thing2 = "Vielleicht soll ich hilfe suchen."; + thing3 = "Sind Sie sicher?"; + thing4 = "Bitte sprechen sie doch ein bisschen langsamer."; + thing5 = "Was bedeutet das?"; + + switch(rand1){ + case 1 : eventForce("say "+thing1);break; + case 2 : eventForce("say "+thing2);break; + case 3 : eventForce("say "+thing3);break; + case 4 : eventForce("say "+thing4);break; + case 5 : eventForce("say "+thing5);break; + default : eventForce("shrug"); + } + } + int AnswerFunc(){ + int rand2; + string answer1, answer2, answer3, answer4, answer5; + + rand2 = random(5); + + answer1 = "Das weiss ich nicht."; + answer2 = "Jein?"; + answer3 = "Ich spreche Englisch wirklich nicht so gut."; + answer4 = "Es ist mir egal."; + answer5 = "Ach."; + + switch(rand2){ + case 1 : eventForce("say "+answer1);break; + case 2 : eventForce("say "+answer2);break; + case 3 : eventForce("say "+answer3);break; + case 4 : eventForce("say "+answer4);break; + case 5 : eventForce("say "+answer5);break; + default : eventForce("shake"); + } + } + static void create() { + sentient::create(); + SetKeyName("hans"); + SetId(({"hans"})); + SetShort("Hans"); + SetLong("Hans is a foreign exchange student from Germany."); + SetLevel(5); + SetUnique(1); + SetRace("human"); + SetGender("male"); + SetNoClean(1); + AddTalkResponse(" ", (: TalkFunc :)); + AddTalkResponse("?", (: AnswerFunc :)); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/npc/jennybot.c ds2.0r27/lib/domains/campus/npc/jennybot.c *** ds1.1/lib/domains/campus/npc/jennybot.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/npc/jennybot.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,265 ---- + #include <lib.h> + inherit LIB_BOT; + + object player, bot, ob, noobster; + string name, watchline; + int count, active, tip, tipnumber, current_tip, hb, mooch, greeting, greetwait; + int deactivate_bot(string str); + string *watchlist; + + static void create(){ + AddSave(({ "players" }) ); + ::create(); + SetKeyName("jennybot"); + SetId(({"guide","guidebot","fembot","bot","jennifer","android","jenny","robot","woman","lady"})); + SetAdjectives(({"orientation","young","female","polite","pretty","guide","newbie","simple","extremely"})); + SetGender("female"); + SetShort("a polite young woman"); + SetLong("On closer inspection, this attractive "+ + "young lady is no lady at all...she's an android! "+ + "She appears to be totally motionless and frozen "+ + "in place, with a friendly smile. Perhaps you "+ + "can make her do something by typing: activate bot "); + SetInventory(([ + "/domains/campus/armor/pillbox_hat" : "wear hat", + "/domains/campus/armor/wglove_r" : "wear white right glove", + "/domains/campus/armor/wglove_l" : "wear white left glove", + "/domains/campus/armor/necklace" : "wear necklace on neck", + "/domains/campus/armor/bluedress" : "wear dress", + ])); + SetMelee(1); + SetLevel(99); + SetRace("android"); + SetAction(1, ({ + "Jenny straightens her hair.", + "Jenny the guide bot touches up her rouge a bit.", + "Jenny smiles."})); + AddCommandResponse("shutdown", (: deactivate_bot :)); + AddCommandResponse("shut down", (: deactivate_bot :) ); + AddCommandResponse("shut up", (: deactivate_bot :)); + AddCommandResponse("go away", (: deactivate_bot :) ); + set_heart_beat(1); + ob=this_object(); + count=210; + tip=0; + tipnumber = 16; + greeting = 0; + greetwait = 0; + } + + varargs int eventGreet(string newbie){ + object noob; + string guy,prespiel,spiel; + if((!newbie || newbie == "") && !noobster){ + return 0; + } + if(!newbie || newbie == "") newbie = noobster->GetKeyName(); + if(newbie && newbie != "there") noob = find_player(newbie); + if(newbie && newbie != "there") guy = noob->GetName(); + else guy = "there"; + tell_room(environment(this_object()),"The polite young "+ + "lady springs to life!\n"); + //spiel = "%^BOLD%^CYAN%^ Hello, "+noob->GetName()+"! "+ + prespiel = "Jennybot says, \"%^BOLD%^CYAN%^ Hello, "+guy; + spiel = read_file("/domains/campus/txt/jenny/spiel.txt"); + tell_room(environment(this_object()),prespiel+spiel); + tell_room(environment(this_object()),"\n\t%^RED%^activate bot%^RESET%^\n"); + tell_room(environment(this_object()),"The polite young "+ + "woman becomes totally motionless again."); + noob->SetProperty("greeted",1); + return 1; + } + + int eventCheckNoob(){ + mixed tmp; + object array people; + people=(get_livings(environment(this_object()),1)); + if(sizeof(people)){ + foreach(object dude in people){ + int greeted; + greeted = dude->GetProperty("greeted"); + if(!greeted && dude->GetLevel() < 2 ) { + greeting = 1; + noobster = dude; + } + } + } + return 1; + } + + void init(){ + ::init(); + add_action("activate_bot","activate"); + add_action("deactivate_bot","deactivate"); + add_action("next_tip","next"); + add_action("get_p","gp"); + eventCheckNoob(); + } + + int next_tip(string str){ + if(!str) return; + if(str=="") return; + if(str="tip"){ + if(active != 1) { write("Jennybot is not active."); return 1; } + if(tip == tipnumber) ob->eventForce("say Sorry. No more tips."); + else { + this_object()->eventDoTip(tip); + } + return 1; + } + } + int refreshlist(){ + string playername; + playername = this_player()->GetName(); + watchlist=explode(read_file("/domains/campus/txt/moochers.txt"),":"); + if(member_array(playername,watchlist) != -1) { + mooch = 1; + return 1; + } + watchlist = ({ playername }) + watchlist; + watchline = implode(watchlist,":"); + unguarded( (: write_file("/domains/campus/txt/moochers.txt",watchline,1) :) ); + return 1; + } + int deactivate_bot(string str){ + if(!str) return 0; + //if(str != "bot") return 0; + if(member_array(str, GetId()) == -1) return 0; + if( active == 0 ){ + write("Jennybot is already inactive."); + } + //set_heart_beat(0); + tip = 0; + if( active != 0) { + tell_room(this_object(),"Jenny nods and becomes motionless again, "+ + "her expression now fixed and staring out into "+ + "space."); + } + active=0; + return 1; + } + int activate_bot(string str){ + player=this_player(); + name=this_player()->GetName(); + if(!str) return 0; + //if(str != "bot") return 0; + if(member_array(str, GetId()) == -1) return 0; + if(active==1){ + write("Jennybot has already been activated."); + return 1; + } + refreshlist(); + active=1; + hb=0; + tip=1; + //set_heart_beat(1); + write("The female android comes to life! She "+ + "smiles at you and straightens her dress."); + ob->eventForce("say Hello, "+name+"! I'm Jenny, the LPC University "+ + "newbie guide bot. I'm an extremely simple android, so "+ + "please don't expect a lot of interactivity."); + ob->eventForce("smile "+name); + ob->eventForce("say I'm here to give you a few "+ + "tips. To deactivate me, simply "+ + "type: deactivate bot.\n"+ + "To jump to the next tip, type: next tip"); + return 1; + } + int eventAct4(){ + if(!new("/domains/campus/obj/list")->eventMove(this_object())){ + tell_room(environment(this_object()),"Oops! There's a bug, "+ + "and I don't have a list for you. Let's pretend I gave you "+ + "one and move on. Please email Cratylus about this, though."); + return 1; + } + if(player && environment(this_object()) == environment(player)) { + eventForce("give list to "+player->GetName()); + } + return 1; + } + int eventAct6(){ + if(!new("/domains/campus/obj/map")->eventMove(this_object())){ + tell_room(environment(this_object()),"Oops! There's a bug, "+ + "and I don't have a map for you. Let's pretend I gave you "+ + "one and move on. Please email Cratylus about this, though."); + return 1; + } + if(player && environment(this_object()) == environment(player)) { + eventForce("give map to "+player->GetName()); + } + return 1; + } + int eventAct8(){ + if(mooch == 1 || !new("/domains/campus/armor/newbie_cap")->eventMove(this_object())){ + tell_room(environment(this_object()),"Oops! There's a bug, "+ + "and I don't have a hat for you. Let's pretend I gave you "+ + "one and move on. Please email Cratylus about this, though."); + } + if(mooch == 1 || !new("/domains/campus/obj/squirtbag")->eventMove(this_object())){ + tell_room(environment(this_object()),"Oops! There's a bug, "+ + "and I don't have a bag for you. Let's pretend I gave you "+ + "one and move on. Please email Cratylus about this, though."); + } + if(player && environment(this_object()) == environment(player)) { + eventForce("give cap to "+player->GetName()); + } + if(player && environment(this_object()) == environment(player)) { + eventForce("give bag to "+player->GetName()); + } + return 1; + } + int eventAct9(){ + eventForce("smile "+player->GetName()); + if(!new("/domains/campus/meals/badapple")->eventMove(this_object())){ + tell_room(environment(this_object()),"Oops! There's a bug, "+ + "and I don't have a rotten apple for you. Let's pretend I gave you "+ + "one and move on. Please email Cratylus about this, though."); + } + if(!new("/domains/campus/meals/apple")->eventMove(this_object())){ + tell_room(environment(this_object()),"Oops! There's a bug, "+ + "and I don't have an apple for you. Let's pretend I gave you "+ + "one and move on. Please email Cratylus about this, though."); + } + if(player && environment(this_object()) == environment(player)) { + eventForce("give first apple to "+player->GetName()); + eventForce("give my apple to "+player->GetName()); + return 1; + } + } + int eventAct11(){ + eventForce("smirk"); + return 1; + } + int eventSwitch(int arg){ + switch(arg){ + case 4:eventAct4();break; + case 6:eventAct6();break; + case 8:eventAct8();break; + case 9:eventAct9();break; + case 11:eventAct11();break; + default:write("");break; + return 1; + } + } + int eventDoTip(int i){ + tip++; + hb=0; + eventSwitch(i); + if(tip > tipnumber) { + this_object()->deactivate_bot("bot"); + return 1; + } + tell_room(environment(this_object()),read_file("/domains/campus/txt/jenny/"+i+".txt")); + + } + void heart_beat(){ + hb++; + if(greeting) greetwait++; + if(noobster && greetwait > 0){ + eventGreet(); + noobster = 0; + greetwait = 0; + greeting = 0; + } + if(hb > 20 && active) eventDoTip(tip); + } diff -c -r --new-file ds1.1/lib/domains/campus/npc/kim.c ds2.0r27/lib/domains/campus/npc/kim.c *** ds1.1/lib/domains/campus/npc/kim.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/npc/kim.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,36 ---- + #include <lib.h> + #include <vendor_types.h> + + inherit LIB_VENDOR; + + static void create() { + vendor::create(); + SetKeyName("kim"); + SetId(({"vendor","kim","Kim","kimmie","employee","bookstore employee"})); + SetShort("Kim, the bookstore employee"); + SetLong("Kim is a twenty-something college student trying to "+ + "make enough money to pay for school and feed herself. She seems "+ + "friendly enough, and her bright blue eyes seem to smile at you "+ + "on their own. You could probably buy something from her here, "+ + "since that's her job, or she might even buy something from you, if "+ + "she thinks it's worth something. Don't try to buy anything if you don't "+ + "have enough money, though...she looks like she can mean business when "+ + "she has to."); + SetInventory(([ + "/domains/campus/armor/collar" : "wear collar on neck", + "/domains/campus/armor/jeans" : "wear jeans", + "/domains/campus/armor/shirt" : "wear shirt", + ])); + SetLevel(1); + SetRace("human"); + SetSkill("bargaining", 1); + SetGender("female"); + SetLocalCurrency("dollars"); + SetStorageRoom("/domains/campus/room/bookstore2"); + SetMaxItems(10000); + SetVendorType(VT_TREASURE | VT_ARMOR); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/npc/rat.c ds2.0r27/lib/domains/campus/npc/rat.c *** ds1.1/lib/domains/campus/npc/rat.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/npc/rat.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,28 ---- + + #include <lib.h> + + inherit LIB_SENTIENT; + + + static void create() { + sentient::create(); + SetKeyName("a mangy little rat"); + SetId(({"rat","dirty rat"})); + SetShort("a rat"); + SetLong("A scruffy little dirty rat."); + SetLevel(1); + SetMaxHealthPoints(5); + SetUnique(1); + SetRace("rodent"); + SetGender("male"); + SetWanderSpeed(1); + SetMessage("come","$N scurries in."); + SetMessage("leave","$N scurries $D."); + SetAction(5, ({ + "The rat squeaks.", "You hear a rat scuttling about.", + "A scruffy little rat brushes against your leg.", + "You hear tiny munching sounds."})); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/npc/seth.c ds2.0r27/lib/domains/campus/npc/seth.c *** ds1.1/lib/domains/campus/npc/seth.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/npc/seth.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,57 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + int give_it(string str); + static void create() { + sentient::create(); + SetKeyName("Dr. Seth Brundle"); + SetId(({"seth","brundle","Dr. Brundle","Seth","Brundle","seth brundle", "Seth Brundle"})); + SetShort("Dr. Seth Brundle"); + SetLong("Dr. Brundle is a tall, lanky scientist with an olive complexion "+ + "and dark, piercing eyes. He seems extremely upset, and hard at work. He looks "+ + "rumpled, wired, and really nervous."); + SetInventory(([ + "/domains/campus/obj/omni" : 1, + "/domains/campus/obj/labkey" : 1, + ])); + SetLevel(5); + SetUnique(1); + SetRace("human"); + SetGender("male"); + AddCommandResponse("give", (: give_it :)); + AddCommandResponse("omni", (: give_it :) ); + SetAction(25, ({ + "Seth Brundle runs a nervous hand through his hair.", + "Dr. Brundle twitches momentarily.", "Dr. Seth Brundle ponders.", + "Seth thinks.", "Dr. Seth Brundle thinks carefully.", + "Dr. Seth Brundle says, \"You won't be able to get back without an omni.\"", + "Dr. Seth Brundle peers nervously at the portal."})); + } + void reset(){ + if(!present("omni",this_object())){ + new("/domains/campus/obj/omni")->eventMove(this_object()); + return; + } + } + int give_it(string str){ + if(!present("omni",this_object())){ + this_object()->eventForce("say I'm afraid I don't have anything to give"); + this_object()->eventForce("ponder"); + return 1; + } + if(!present("omni",this_player())){ + write("Dr. Brundle looks at you skeptically for a moment.\n"); + say("Dr. Brundle looks at "+this_player()->GetName()+" skeptically for a moment.\n"); + this_object()->eventForce("give first omni to "+lower_case(this_player()->GetName()) ); + this_object()->eventForce("say Just try not to get killed, "+this_player()->GetName()); + this_object()->eventForce("sigh"); + return 1; + } + this_object()->eventForce("snort"); + this_object()->eventForce("say You've already got one, "+this_player()->GetName()); + return 1; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/npc/tim.c ds2.0r27/lib/domains/campus/npc/tim.c *** ds1.1/lib/domains/campus/npc/tim.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/npc/tim.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,50 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + int DoSomething(){ + int rand; + string thing1, thing2, thing3, thing4, thing5; + string thing6, thing7, thing8, thing9, thing10; + + rand = random(10); + + thing1 = "I think the campus is still under serious construction."; + thing2 = "I wonder when the classroom building will open."; + thing3 = "There's a village up north that's still being built, I heard."; + thing4 = "Any travel north of here may be unsafe, you know."; + thing5 = "Oh man, I need to get that stuff I left in the building basement."; + thing6 = "Why won't Kim ever buy or sell weapons?"; + thing7 = "How am I supposed to leave campus if Kim won't sell me a weapon?"; + thing8 = "Maybe there's a shop in the village up north where you can buy whatever you need."; + thing9 = "I heard you can get in trouble with the dean if you climb the tree."; + thing10 = "Some dude told me \bree-yark\" is \"we surrender\" in \"Kobold\". Does that even make any sense?"; + + switch(rand){ + case 1 : eventForce("say "+thing1);break; + case 2 : eventForce("say "+thing2);break; + case 3 : eventForce("say "+thing3);break; + case 4 : eventForce("say "+thing4);break; + case 5 : eventForce("say "+thing5);break; + case 6 : eventForce("say "+thing6);break; + case 7 : eventForce("say "+thing7);break; + case 8 : eventForce("say "+thing8);break; + case 9 : eventForce("say "+thing9);break; + case 10 : eventForce("say "+thing10);break; + default : eventForce("smile"); + } + } + void create() { + sentient::create(); + SetKeyName("Tim"); + SetId(({"tim"})); + SetShort("Tim"); + SetLong("Tim is a student in the Virtual Campus."); + SetLevel(5); + SetRace("human"); + SetGender("male"); + SetAction(25, (: DoSomething :)); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/npc/wim.c ds2.0r27/lib/domains/campus/npc/wim.c *** ds1.1/lib/domains/campus/npc/wim.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/npc/wim.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,17 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("Wim"); + SetId(({"wim"})); + SetShort("Wim"); + SetLong("Wim is a foreign exchange student from the Netherlands."); + SetLevel(5); + SetRace("human"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/npc/yulia.c ds2.0r27/lib/domains/campus/npc/yulia.c *** ds1.1/lib/domains/campus/npc/yulia.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/npc/yulia.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,35 ---- + /* /domains/Praxis/npc/otik.c + * from Nightmare LPMud + * created by Descartes of Borg 950603 + */ + + #include <lib.h> + #include <vendor_types.h> + + inherit LIB_VENDOR; + + static void create() { + ::create(); + SetKeyName("yulia"); + SetId( ({ "vendor","secretary","assistant","manager" }) ); + SetAdjectives( ({ "executive","medical","guild" }) ); + SetShort("Yulia, the clinic assistant"); + SetLevel(12); + SetLong("Yulia is typical of office assistants: she is a bit "+ + "arrogant, officious, and brusque; but she appears "+ + "to be a competent enough secretary. "+ + "She is the person you will buy a treatment slips "+ + "from. Read the list on the wall for the slips "+ + "available."); + SetGender("female"); + SetMorality(40); + SetRace("human"); + AddCurrency("dollars", random(100)); + SetProperty("no bump", 1); + SetLocalCurrency("dollars"); + SetStorageRoom("/domains/campus/room/healer2"); + SetMaxItems(10000); + SetVendorType(VT_HERB); + SetSkill("bargaining", 1); + + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/223clip.c ds2.0r27/lib/domains/campus/obj/223clip.c *** ds1.1/lib/domains/campus/obj/223clip.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/223clip.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + #include <vendor_types.h> + inherit "/lib/clip"; + + void create(){ + ::create(); + SetKeyName("223clip"); + SetId(({"clip","magazine"})); + SetAdjectives(({"223",".223","ammunition","rifle","caliber","ammo","ammunition"})); + SetShort("a .223 caliber rifle ammunition clip"); + SetLong("This is a spring-loaded ammunition clip for a .223 caliber "+ + "rifle. It will contain a maximum of thirty rounds."); + SetCaliber(223); + SetMaxAmmo(30); + SetAmmoType("nato"); + SetVendorType(VT_TREASURE); + SetInventory(([ + "/domains/campus/obj/223round" : 30, + ])); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/223round.c ds2.0r27/lib/domains/campus/obj/223round.c *** ds1.1/lib/domains/campus/obj/223round.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/223round.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,22 ---- + #include <lib.h> + #include <vendor_types.h> + inherit "/lib/round"; + + void create(){ + ::create(); + SetKeyName("223round"); + SetId(({"round","bullet"})); + SetAdjectives(({".223","223","caliber","rifle","m16","M16","m-16","M-16"})); + SetShort("a .223 caliber rifle round"); + SetLong("This is a .223 caliber rifle round, probably for an M-16 assault rifle. "+ + "It is not very wide, but contains a large powder charge. It is doubtlessly a powerful "+ + "piece of ammunition. It has not been fired."); + SetCaliber(223); + SetRifleType("auto"); + SetPistolType("auto"); + SetAmmoType("nato"); + SetVendorType(VT_TREASURE); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/357case.c ds2.0r27/lib/domains/campus/obj/357case.c *** ds1.1/lib/domains/campus/obj/357case.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/357case.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,31 ---- + /* /domains/Examples/etc/bag.c + * from the Nightmare IV LPC Library + * a sample bag object + * created by Descartes of Borg 950529 + */ + + #include <lib.h> + + inherit LIB_STORAGE; + + void create() { + ::create(); + SetKeyName("cardboard case"); + SetAdjectives( ({"small", "cardboard", ".357 ammo", "ammo"}) ); + SetId( ({ "case" }) ); + SetShort("a small .357 ammo case"); + SetLong("A small cardboard case designed to carry .357 caliber amunition."); + SetMass(10); + SetDollarCost(1); + SetMaxCarry(12); + } + void CanReceive(object ob){ + ::CanReceive(); + if(ob->GetKeyName() != "357round") { + tell_object(this_player(),"This cardboard case is for .357 ammunition only."); + return; + } + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/357round.c ds2.0r27/lib/domains/campus/obj/357round.c *** ds1.1/lib/domains/campus/obj/357round.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/357round.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + #include <vendor_types.h> + inherit "/lib/round"; + + void create(){ + ::create(); + SetKeyName("357round"); + SetId(({"round","bullet"})); + SetAdjectives(({"357",".357","pistol"})); + SetShort("a .357 pistol round"); + SetLong("This is a .357 caliber revolver bullet. It has not been fired."); + SetCaliber(357); + SetPistolType("revolver"); + SetAmmoType("magnum"); + SetVendorType(VT_TREASURE); + SetMass(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/357shell.c ds2.0r27/lib/domains/campus/obj/357shell.c *** ds1.1/lib/domains/campus/obj/357shell.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/357shell.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,15 ---- + #include <lib.h> + #include <vendor_types.h> + inherit "/lib/shell"; + void create(){ + ::create(); + SetKeyName("357shell"); + SetId(({"shell","casing","spent bullet"})); + SetAdjectives(({"357",".357","spent","magnum","shell"})); + SetShort("a .357 shell casing"); + SetLong("This is the spent casing of a .357 magnum bullet."); + SetCaliber(357); + SetPistolType("revolver"); + SetAmmoType("magnum"); + SetVendorType(VT_TREASURE); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/50round.c ds2.0r27/lib/domains/campus/obj/50round.c *** ds1.1/lib/domains/campus/obj/50round.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/50round.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,21 ---- + #include <lib.h> + #include <vendor_types.h> + inherit "/lib/round"; + + void create(){ + ::create(); + SetKeyName("round"); + SetId(({"round","bullet"})); + SetAdjectives(({"50",".50","caliber","rifle"})); + SetShort("a .50 caliber rifle bullet"); + SetLong("This mammoth bullet is nearly five inches long. Anything this bad "+ + "boy hits is in for a rough time."); + SetCaliber(50); + SetRifleType("bolt"); + SetPistolType("bolt"); + SetAmmoType("bolt"); + SetVendorType(VT_TREASURE); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/9mmclip.c ds2.0r27/lib/domains/campus/obj/9mmclip.c *** ds1.1/lib/domains/campus/obj/9mmclip.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/9mmclip.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + #include <vendor_types.h> + inherit "/lib/clip"; + + void create(){ + ::create(); + SetKeyName("9mmclip"); + SetId(({"clip","magazine"})); + SetAdjectives(({"9mm","ammunition","ammo","9 millimeter","pistol"})); + SetShort("a 9 millimeter pistol ammunition clip"); + SetLong("This is a slender, spring-loaded metal container designed "+ + "to feed a 9 millimeter pistol with bullets."); + SetMillimeter(9); + SetMaxAmmo(15); + SetAmmoType("acp"); + SetVendorType(VT_TREASURE); + SetInventory(([ + "/domains/campus/obj/round2" : 15 + ])); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/9mmround.c ds2.0r27/lib/domains/campus/obj/9mmround.c *** ds1.1/lib/domains/campus/obj/9mmround.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/9mmround.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + #include <vendor_types.h> + inherit "/lib/round"; + + void create(){ + ::create(); + SetKeyName("9mmround"); + SetId(({"round","bullet"})); + SetAdjectives(({"9 millimeter","9mm","pistol"})); + SetShort("a 9 millimeter pistol round"); + SetLong("This is a 9 millimeter pistol bullet. It has not been fired."); + SetMillimeter(9); + SetPistolType("auto"); + SetAmmoType("acp"); + SetVendorType(VT_TREASURE); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/abox.c ds2.0r27/lib/domains/campus/obj/abox.c *** ds1.1/lib/domains/campus/obj/abox.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/abox.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,37 ---- + /* /domains/Examples/etc/bag.c + * from the Nightmare IV LPC Library + * a sample bag object + * created by Descartes of Borg 950529 + */ + + #include <lib.h> + + inherit LIB_STORAGE; + + void create() { + ::create(); + SetKeyName("ammunition box"); + SetId(({"can","box"})); + SetAdjectives(({"metal","ammo","ammunition","large"})); + SetShort("an ammo box"); + SetLong("This is a large metal box containing various kinds "+ + "of ammunition. "); + SetMass(200); + SetDollarCost(50); + SetMaxCarry(5000); + SetCanClose(1); + SetClosed(0); + + SetInventory( ([ + "/domains/campus/obj/9mmclip": 10, + "/domains/campus/obj/223clip": 10, + "/domains/campus/obj/357case": 10 + ]) ); + + } + + void init(){ + ::init(); + } + + mixed CanGet(object ob) { return "The metal ammunition box does not budge.";} diff -c -r --new-file ds1.1/lib/domains/campus/obj/apple.c ds2.0r27/lib/domains/campus/obj/apple.c *** ds1.1/lib/domains/campus/obj/apple.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/apple.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + + void create(){ + ::create(); + SetKeyName("rotten apple"); + SetId( ({"apple","fruit"}) ); + SetAdjectives( ({"rotten","foul-smelling","dried-up","browned","brown"}) ); + SetShort("a rotten apple"); + SetLong("This is browned, foul-smelling, dried-up apple."); + SetMass(5); + SetDollarCost(0); + SetVendorType(VT_TREASURE); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/backpack.c ds2.0r27/lib/domains/campus/obj/backpack.c *** ds1.1/lib/domains/campus/obj/backpack.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/backpack.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,40 ---- + #include <lib.h> + + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_STORAGE; + inherit LIB_ARMOR; + + static void create() { + ::create(); + SetKeyName("backpack"); + SetId(({"bag","pack"})); + SetAdjectives(({"sturdy","green","olive","olive-green","od green","od-green"})); + SetShort("a sturdy, olive-green backpack"); + SetLong("This is a large, sturdy backpack made of some sort of " + "strong, canvas-like material. It appears suitable "+ + "for just about any adventure you'd find yourself in."); + SetInventory(([ + "/domains/campus/obj/match" : 3, + "/domains/campus/weap/sharpsword" : 1, + "/domains/campus/armor/chainmail" : 1, + "/domains/campus/meals/burger" : 3, + "/domains/campus/armor/helmet" : 1, + "/domains/campus/armor/shield" : 1, + "/domains/campus/obj/maglite" : 1, + "/domains/campus/armor/collar" : 1, + "/domains/campus/meals/wimp_ale" : 3, + "/domains/campus/obj/torch" : 1, + ])); + SetMass(100); + SetBaseCost("silver", 40); + SetCanClose(1); + SetClosed(0); + SetMaxCarry(500); + SetDamagePoints(100); + SetArmorType(A_VEST); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/backpack_civilian.c ds2.0r27/lib/domains/campus/obj/backpack_civilian.c *** ds1.1/lib/domains/campus/obj/backpack_civilian.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/backpack_civilian.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,28 ---- + #include <lib.h> + + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_STORAGE; + inherit LIB_ARMOR; + + static void create() { + ::create(); + SetKeyName("backpack"); + SetId(({"bag","pack"})); + SetAdjectives(({"sturdy","green","olive","olive-green","od green","od-green"})); + SetShort("a sturdy, olive-green backpack"); + SetLong("This is a large, sturdy backpack made of some sort of " + "strong, canvas-like material. It appears suitable "+ + "for just about any adventure you'd find yourself in."); + SetMass(100); + SetBaseCost("silver", 40); + SetCanClose(1); + SetClosed(0); + SetMaxCarry(500); + SetDamagePoints(100); + SetArmorType(A_VEST); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/backpack_empty.c ds2.0r27/lib/domains/campus/obj/backpack_empty.c *** ds1.1/lib/domains/campus/obj/backpack_empty.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/backpack_empty.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,28 ---- + #include <lib.h> + + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_STORAGE; + inherit LIB_ARMOR; + + static void create() { + ::create(); + SetKeyName("backpack"); + SetId(({"bag","pack"})); + SetAdjectives(({"sturdy","green","olive","olive-green","od green","od-green"})); + SetShort("a sturdy, olive-green backpack"); + SetLong("This is a large, sturdy backpack made of some sort of " + "strong, canvas-like material. It appears suitable "+ + "for just about any adventure you'd find yourself in."); + SetMass(100); + SetBaseCost("silver", 40); + SetCanClose(1); + SetClosed(0); + SetMaxCarry(500); + SetDamagePoints(100); + SetArmorType(A_VEST); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/bag.c ds2.0r27/lib/domains/campus/obj/bag.c *** ds1.1/lib/domains/campus/obj/bag.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/bag.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,27 ---- + /* /domains/Examples/etc/bag.c + * from the Nightmare IV LPC Library + * a sample bag object + * created by Descartes of Borg 950529 + */ + + #include <lib.h> + + inherit LIB_STORAGE; + + + void create() { + ::create(); + SetKeyName("bag"); + SetId( ({ "bag" }) ); + SetAdjectives( ({ "small", "cloth", "a" }) ); + SetShort("a small cloth bag"); + SetLong("It is a simple cloth bag used to hold things. It has a cute Virtual Campus "+ + "logo on it."); + SetMass(274); + SetDollarCost(1); + SetMaxCarry(50); + // SetPreventPut("You cannot put this in there!"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/bbucket.c ds2.0r27/lib/domains/campus/obj/bbucket.c *** ds1.1/lib/domains/campus/obj/bbucket.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/bbucket.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,35 ---- + #include <lib.h> + + inherit LIB_STORAGE; + + void create() { + ::create(); + SetKeyName("bin"); + SetId(({"bin","can","dustbin","trash","rubbish"})); + SetAdjectives(({"metal","small","blue","recycling","trash","garbage","dust"})); + SetShort("a recycling bin"); + SetLong("This is a blue trash can, marked with "+ + "the letters \"/dev/null\"."); + SetMass(274); + SetBaseCost("silver",50); + SetMaxCarry(999999); + } + + int tidy_up(){ + object *inv; + inv = all_inventory(this_object()); + foreach(object thing in inv){ + if(thing) thing->eventMove(load_object("/domains/town/room/furnace")); + } + return 1; + } + + int eventReceiveObject(object ob){ + write("You make a deposit into the the recycling bin.\n"); + call_out((: tidy_up :),1); + return 1; + } + mixed CanGet(object ob) { return "The bucket does not budge.";} + + void init(){ + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/bench.c ds2.0r27/lib/domains/campus/obj/bench.c *** ds1.1/lib/domains/campus/obj/bench.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/bench.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,27 ---- + /* /domains/campus/etc/stool.c + * From the Nightmare V Object Library + * An example of a chair object + * Created by Descartes of Borg 961221 + */ + + #include <lib.h> + + inherit LIB_CHAIR; + + + static void create() { + chair::create(); + SetKeyName("bench"); + SetId("bench"); + SetAdjectives("wooden"); + SetShort("a wooden bench"); + SetLong("This is a typical wooden bench, the sort you might "+ + "see in a park. It appears designed for sitting on."); + SetMass(1500); + SetDollarCost(15); + SetMaxSitters(3); + } + mixed CanGet(object ob) { return "The bench does not budge.";} + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/bluebox.c ds2.0r27/lib/domains/campus/obj/bluebox.c *** ds1.1/lib/domains/campus/obj/bluebox.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/bluebox.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,28 ---- + /* /domains/Examples/etc/bag.c + * from the Nightmare IV LPC Library + * a sample bag object + * created by Descartes of Borg 950529 + */ + + #include <lib.h> + + inherit LIB_STORAGE; + + void create() { + ::create(); + SetKeyName("bluebox"); + SetId( ({ "box","bluebox", "bbox" }) ); + SetAdjectives( ({ "small", "plastic","blue", "a" }) ); + SetShort("a small, %^BLUE%^blue%^RESET%^ plastic box"); + SetLong("It is a simple plastic box used to hold things. It is %^BLUE%^blue%^RESET%^, and it has a cute Virtual Campus "+ + "logo on it."); + SetMass(274); + SetDollarCost(1); + SetMaxCarry(100); + SetCanClose(1); + SetClosed(0); + // SetPreventPut("You cannot put this in there!"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/box.c ds2.0r27/lib/domains/campus/obj/box.c *** ds1.1/lib/domains/campus/obj/box.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/box.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,26 ---- + /* /domains/Examples/etc/bag.c + * from the Nightmare IV LPC Library + * a sample bag object + * created by Descartes of Borg 950529 + */ + + #include <lib.h> + + inherit LIB_STORAGE; + + void create() { + ::create(); + SetKeyName("box"); + SetId( ({ "box" }) ); + SetAdjectives( ({ "small", "plastic","green", "a" }) ); + SetShort("a small plastic box"); + SetLong("It is a simple plastic box used to hold things. It is green, and it has a cute Virtual Campus "+ + "logo on it."); + SetMass(274); + SetDollarCost(1); + SetMaxCarry(10); + // SetPreventPut("You cannot put this in there!"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/chair.c ds2.0r27/lib/domains/campus/obj/chair.c *** ds1.1/lib/domains/campus/obj/chair.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/chair.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,43 ---- + #include <lib.h> + + inherit LIB_CHAIR; + + + static void create() { + chair::create(); + SetKeyName("chair"); + SetId("chair"); + SetAdjectives( ({ "swivel", "small", "black" }) ); + SetShort("a swivel chair"); + SetLong("This is a small swivel chair, with tasteful and understated "+ + "black covers."); + SetMass(1500); + SetDollarCost(15); + SetMaxSitters(1); + } + void init(){ + ::init(); + add_action("swivel","swivel"); + } + int swivel(string str){ + int hit,i; + object *dupes; + dupes = get_dupes(this_object(),environment(this_object()) ); + if(!str || str =="" || str == "in chair" || str == "in the chair"){ + hit = 42; + for(i=0;i<sizeof(dupes);i++){ + if( member_array(this_player(),dupes[i]->GetSitters()) != -1) hit = 7; + if( member_array(this_player(),this_object()->GetSitters()) != -1) hit = 7; + } + if( hit == 7) { + write("You swivel around in your swivel chair! Whee!"); + say(this_player()->GetName()+" swivels around in "+possessive(this_player())+" "+ + "swivel chair, yelling \"WHEEEE!!!\""); + return 1; + } + else { write("You are not sitting in a swivel chair."); } + } + if(hit == 42) return 1; + else return 0; + } + mixed CanGet(object ob) { return "The chair does not budge.";} diff -c -r --new-file ds1.1/lib/domains/campus/obj/clip.c ds2.0r27/lib/domains/campus/obj/clip.c *** ds1.1/lib/domains/campus/obj/clip.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/clip.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,24 ---- + #include <lib.h> + #include <vendor_types.h> + inherit "/lib/clip"; + + void create(){ + ::create(); + SetKeyName("9mmclip"); + SetId(({"clip","magazine"})); + SetAdjectives(({"9mm","ammunition","ammo","9 millimeter","pistol"})); + SetShort("a 9 millimeter pistol ammunition clip"); + SetLong("This is a slender, spring-loaded metal container designed "+ + "to feed a 9 millimeter pistol with bullets."); + SetMillimeter(9); + SetMaxAmmo(15); + SetAmmoType("acp"); + SetAmmoType("acp"); + SetVendorType(VT_TREASURE); + SetInventory(([ + "/domains/campus/obj/round2" : 15, + ])); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/dcell.c ds2.0r27/lib/domains/campus/obj/dcell.c *** ds1.1/lib/domains/campus/obj/dcell.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/dcell.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,24 ---- + #include <lib.h> + #include <vendor_types.h> + inherit "/lib/battery"; + + void create(){ + ::create(); + SetKeyName("d-cell"); + SetId( ({"cell","battery"}) ); + SetAdjectives( ({"d","generic","D","D-cell"}) ); + SetShort("a D cell battery"); + SetLong("This is a typical D-cell battery, of a generic brand."); + SetMass(2); + SetDollarCost(2); + SetVendorType(VT_TREASURE); + SetPowerType("DC"); + SetCellType("D"); + SetCharge(60); + SetRechargeable(0); + SetDrainable(1); + SetDrainRate(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/dcell_crappy.c ds2.0r27/lib/domains/campus/obj/dcell_crappy.c *** ds1.1/lib/domains/campus/obj/dcell_crappy.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/dcell_crappy.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,24 ---- + #include <lib.h> + #include <vendor_types.h> + inherit "/lib/battery"; + + void create(){ + ::create(); + SetKeyName("d-cell"); + SetId( ({"cell","battery"}) ); + SetAdjectives( ({"d","generic","D","D-cell"}) ); + SetShort("a D cell battery"); + SetLong("This is a typical D-cell battery, of a generic brand."); + SetMass(2); + SetDollarCost(2); + SetVendorType(VT_TREASURE); + SetPowerType("DC"); + SetCellType("D"); + SetCharge(60); + SetRechargeable(0); + SetDrainable(1); + SetDrainRate(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/dcell_good.c ds2.0r27/lib/domains/campus/obj/dcell_good.c *** ds1.1/lib/domains/campus/obj/dcell_good.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/dcell_good.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,24 ---- + #include <lib.h> + #include <vendor_types.h> + inherit "/lib/battery"; + + void create(){ + ::create(); + SetKeyName("d-cell"); + SetId( ({"cell","battery"}) ); + SetAdjectives( ({"d","generic","D","D-cell"}) ); + SetShort("a D cell battery"); + SetLong("This is a typical D-cell battery, of a generic brand."); + SetMass(2); + SetDollarCost(2); + SetVendorType(VT_TREASURE); + SetPowerType("DC"); + SetCellType("D"); + SetCharge(10000); + SetRechargeable(0); + SetDrainable(1); + SetDrainRate(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/dcell_std.c ds2.0r27/lib/domains/campus/obj/dcell_std.c *** ds1.1/lib/domains/campus/obj/dcell_std.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/dcell_std.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,24 ---- + #include <lib.h> + #include <vendor_types.h> + inherit "/lib/battery"; + + void create(){ + ::create(); + SetKeyName("d-cell"); + SetId( ({"cell","battery"}) ); + SetAdjectives( ({"d","generic","D","D-cell"}) ); + SetShort("a D cell battery"); + SetLong("This is a typical D-cell battery, of a generic brand."); + SetMass(2); + SetDollarCost(2); + SetVendorType(VT_TREASURE); + SetPowerType("DC"); + SetCellType("D"); + SetCharge(1000); + SetRechargeable(0); + SetDrainable(1); + SetDrainRate(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/debris.c ds2.0r27/lib/domains/campus/obj/debris.c *** ds1.1/lib/domains/campus/obj/debris.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/debris.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,45 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + + int ringfound; + string SearchCrap(){ + string result; + if(!ringfound){ + result="Rummaging through the disgusting pile, you "+ + "discover a beautiful gold ring mixed in with the "+ + "crap."; + say(this_player()->GetName()+" searches the pile of debris "+ + "and seems to have found something of value."); + new("/domains/campus/armor/ring")->eventMove(this_player()); + ringfound=1; + return result; + } + + result="You rummage through the disgusting pile "+ + "and find nothing."; + say(this_player()->GetName()+" searches the pile of debris "+ + "with no results."); + return result; + } + void create(){ + ::create(); + SetKeyName("debris"); + SetId( ({"pile","debris","crap","crud"}) ); + SetAdjectives( ({"disgusting","pile of","smelly"}) ); + SetShort("a pile of debris"); + SetLong("This is a smelly, disgusting pile of crud "+ + "that has accumulated from the running stream of "+ + "sewage here. "); + SetMass(20); + SetDollarCost(0); + SetVendorType(VT_TREASURE); + SetSearch( (: SearchCrap :) ); + ringfound=0; + + } + mixed CanGet(object ob) { return "The pile of debris isn't at all portable.";} + string GetItemCondition() { return "";} + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/flashlight.c ds2.0r27/lib/domains/campus/obj/flashlight.c *** ds1.1/lib/domains/campus/obj/flashlight.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/flashlight.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,14 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + void create(){ + ::create(); + SetKeyName("generic thing"); + SetId( ({"thing","item","thang","dingus"}) ); + SetAdjectives( ({"generic","sample","template"}) ); + SetShort("a generic thing"); + SetLong("This is an object of indeterminate nature and proportions."); + SetMass(20); + SetDollarCost(10); + SetVendorType(VT_TREASURE); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/greenbox.c ds2.0r27/lib/domains/campus/obj/greenbox.c *** ds1.1/lib/domains/campus/obj/greenbox.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/greenbox.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,28 ---- + /* /domains/Examples/etc/bag.c + * from the Nightmare IV LPC Library + * a sample bag object + * created by Descartes of Borg 950529 + */ + + #include <lib.h> + + inherit LIB_STORAGE; + + void create() { + ::create(); + SetKeyName("greenbox"); + SetId( ({ "box","greenbox","gbox" }) ); + SetAdjectives( ({ "small", "plastic","green", "a" }) ); + SetShort("a small, %^GREEN%^green%^RESET%^ plastic box"); + SetLong("It is a simple plastic box used to hold things. It is %^GREEN%^green%^RESET%^, and it has a cute Virtual Campus "+ + "logo on it."); + SetMass(274); + SetDollarCost(1); + SetMaxCarry(100); + SetCanClose(1); + SetClosed(0); + // SetPreventPut("You cannot put this in there!"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/key.c ds2.0r27/lib/domains/campus/obj/key.c *** ds1.1/lib/domains/campus/obj/key.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/key.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,24 ---- + /* /domains/Midian/etc/key.c + * from the Nightmare Object Library + * created by Descartes of Borg 960512 + */ + + #include <lib.h> + + inherit LIB_ITEM; + + + static void create() { + item::create(); + SetKeyName("key"); + SetId( ({ "key", "special_key_id" }) ); + SetAdjectives( ({ "brilliant", "silver" }) ); + SetShort("a silver key"); + SetLong("It is a brilliant silver key with no markings."); + SetMass(50); + SetDollarCost(15); + SetDisableChance(90); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/key1.c ds2.0r27/lib/domains/campus/obj/key1.c *** ds1.1/lib/domains/campus/obj/key1.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/key1.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,24 ---- + /* /domains/Midian/etc/key.c + * from the Nightmare Object Library + * created by Descartes of Borg 960512 + */ + + #include <lib.h> + + inherit LIB_ITEM; + + + static void create() { + item::create(); + SetKeyName("key"); + SetId(({"key","locker_key_1"})); + SetAdjectives(({"locker","small",})); + SetShort("a small key"); + SetLong("This is a small key, perhaps to a padlock or locker."); + SetMass(1); + SetDollarCost(2); + SetDisableChance(90); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/labkey.c ds2.0r27/lib/domains/campus/obj/labkey.c *** ds1.1/lib/domains/campus/obj/labkey.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/labkey.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + + void create(){ + ::create(); + SetKeyName("lab key"); + SetAdjectives( ({"lab", "probability lab"}) ); + SetId( ({"prob_door_key", "key", "labkey"}) ); + SetShort("lab key"); + SetLong("This is a key labeled 'probability lab'."); + SetMass(20); + SetBaseCost("silver",10); + SetVendorType(VT_TREASURE); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/lever.c ds2.0r27/lib/domains/campus/obj/lever.c *** ds1.1/lib/domains/campus/obj/lever.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/lever.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + + void create(){ + ::create(); + SetKeyName("hand grenade spoon"); + SetId(({"lever","spoon"})); + SetAdjectives(({"grenade","hand grenade","metal","small"})); + SetShort("a small metal lever"); + SetLong("This is the fuse lever, or spoon, for a hand grenade."); + SetMass(1); + SetDollarCost(0); + SetVendorType(VT_TREASURE); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/list.c ds2.0r27/lib/domains/campus/obj/list.c *** ds1.1/lib/domains/campus/obj/list.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/list.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,24 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + inherit LIB_READ; + + int TestFunc(){ + this_player()->eventPage("/domains/campus/txt/list.txt","system"); + return 1; + } + + + void create(){ + ::create(); + SetKeyName("list"); + SetId(({"paper","slip"})); + SetAdjectives(({"small"})); + SetShort("a list"); + SetLong("A list on a slip of paper. Try: read list \n"); + SetMass(0); + SetDollarCost(0); + SetVendorType(VT_TREASURE); + SetRead((: TestFunc :)); + } + diff -c -r --new-file ds1.1/lib/domains/campus/obj/locker.c ds2.0r27/lib/domains/campus/obj/locker.c *** ds1.1/lib/domains/campus/obj/locker.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/locker.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,37 ---- + /* /domains/Examples/etc/bag.c + * from the Nightmare IV LPC Library + * a sample bag object + * created by Descartes of Borg 950529 + */ + + #include <lib.h> + + inherit LIB_STORAGE; + + + void create() { + ::create(); + SetKeyName("locker"); + SetId(({"locker"})); + SetAdjectives(({"metal","tall","school"})); + SetShort("a tall metal locker"); + SetLong("This is a large school locker, the kind one might find in any of "+ + "thousands of schools around the world."); + SetMass(274); + SetDollarCost(50); + SetMaxCarry(500); + SetInventory(([ + "/domains/campus/obj/bag": 1, + "/domains/campus/obj/dcell_std": 4, + "/domains/campus/weap/waterpistol" : 1 + ])); + SetCanClose(1); + SetClosed(1); + SetCanLock(1); + SetLocked(1); + SetKey("locker_key_1"); + } + mixed CanGet(object ob) { return "The locker does not budge.";} + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/magbox.c ds2.0r27/lib/domains/campus/obj/magbox.c *** ds1.1/lib/domains/campus/obj/magbox.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/magbox.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,28 ---- + /* /domains/Examples/etc/bag.c + * from the Nightmare IV LPC Library + * a sample bag object + * created by Descartes of Borg 950529 + */ + + #include <lib.h> + + inherit LIB_STORAGE; + + void create() { + ::create(); + SetKeyName("magbox"); + SetId( ({ "box","magentabox" , "magbox" , "mbox" }) ); + SetAdjectives( ({ "small", "plastic","magenta", "a" }) ); + SetShort("a small, %^MAGENTA%^magenta%^RESET%^ plastic box"); + SetLong("It is a simple plastic box used to hold things. It is %^MAGENTA%^magenta%^RESET%^, and it has a cute Virtual Campus "+ + "logo on it."); + SetMass(274); + SetDollarCost(1); + SetMaxCarry(100); + SetCanClose(1); + SetClosed(0); + // SetPreventPut("You cannot put this in there!"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/maglite.c ds2.0r27/lib/domains/campus/obj/maglite.c *** ds1.1/lib/domains/campus/obj/maglite.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/maglite.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,29 ---- + #include <lib.h> + #include <vendor_types.h> + inherit "/lib/flashlight"; + + + void create(){ + ::create(); + SetKeyName("maglite"); + SetId( ({"fl","flashlight","light","flashlite","Maglite"}) ); + SetAdjectives( ({"powerful","heavy","large","Maglite"}) ); + SetShort( "a large flashlight" ); + SetLong("This is a powerful, heavy, Maglite brand flashlight."); + SetMass(20); + SetDollarCost(40); + SetLightLevel(20); + SetMinCells(4); + SetMaxCells(4); + SetCellType("D"); + Lit=0; + SetVendorType(VT_TREASURE); + + SetInventory(([ + "/domains/campus/obj/dcell_good":4 + ])); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/map.c ds2.0r27/lib/domains/campus/obj/map.c *** ds1.1/lib/domains/campus/obj/map.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/map.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,25 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + inherit LIB_READ; + + + int TestFunc(){ + this_player()->eventPage("/domains/campus/txt/map.txt","system"); + return 1; + } + void create(){ + ::create(); + SetKeyName("building map"); + SetId(({"map","map of the administrative building","small map of the administrative building"})); + SetAdjectives(({"small"})); + SetShort("a small map of the administrative building"); + SetLong("A map of the administrative building. Try: read map \n"); + SetMass(0); + SetDollarCost(0); + SetVendorType(VT_TREASURE); + SetRead((: TestFunc :)); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/match.c ds2.0r27/lib/domains/campus/obj/match.c *** ds1.1/lib/domains/campus/obj/match.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/match.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,31 ---- + /* /domains/Praxis/etc/torch.c + * from Nightmare LPMud + * created by Descartes of Borg 951023 + */ + + #include <lib.h> + + inherit LIB_MATCH; + + + static void create() { + match::create(); + SetKeyName("match"); + SetId("match"); + SetAdjectives( ({ "wooden" }) ); + SetShort("a wooden match"); + SetLong("A wooden match that might light if you strike it."); + SetRadiantLight(2); + SetStrikeChance(50); + SetMinHeat(10); + SetFuelRequired(1); + SetMaxFuel(10); + SetFuelAmount(10); + SetRefuelable(0); + SetMass(5); + SetDollarCost(2); + SetBurntValue(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/medbag.c ds2.0r27/lib/domains/campus/obj/medbag.c *** ds1.1/lib/domains/campus/obj/medbag.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/medbag.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,25 ---- + /* /domains/Examples/etc/bag.c + * from the Nightmare IV LPC Library + * a sample bag object + * created by Descartes of Borg 950529 + */ + + #include <lib.h> + + inherit LIB_STORAGE; + + void create() { + ::create(); + SetKeyName("bag"); + SetId( ({ "medical bag" }) ); + SetAdjectives( ({ "small", "cloth", "a" }) ); + SetShort("a small cloth bag"); + SetLong("It is a simple cloth bag used to hold things. Printed on it is: " + "\"Property of A.S. Clepius\""); + SetMass(274); + SetDollarCost(1); + SetMaxCarry(100); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/omni.c ds2.0r27/lib/domains/campus/obj/omni.c *** ds1.1/lib/domains/campus/obj/omni.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/omni.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,60 ---- + #include <lib.h> + inherit LIB_ITEM; + inherit LIB_PRESS; + + int check_environs(); + int vanish_count; + static void create() { + item::create(); + SetKeyName("omni"); + SetId(({"omni","Omni","device"})); + SetShort("an omni"); + SetLong("This is a small, round metal device, copper in color, "+ + "and similar in appearance to a pocket watch. There is a blinking red light "+ + "next to the tiny metal button at its top."); + SetMass(10); + SetDollarCost(300); + AddItem("button", "A button on the omni."); + } + void init() { + ::init(); + vanish_count=500; + check_environs(); + } + mixed CanPress(object who, string target) { + if(!present(this_object()->GetKeyName(),who ) && target == "button"){ + return "You do not have the Omni!"; + } + if(this_object()->GetId() == target){ + return "You cannot push that."; + } + return 1; + } + mixed eventPress(object who, string target) { + say(this_player()->GetName()+" turns multicolored and disappears.\n"); + write("You feel momentarily disoriented and find yourself back in the lab.\n"); + this_player()->eventMove("/domains/campus/room/u_lab"); + this_player()->eventForce("look"); + return 1; + } + void heart_beat(){ + vanish_count--; + if(vanish_count < 0){ + tell_object(environment(),"The omni glows brightly and disappears!"); + this_object()->eventDestruct(); + } + if(vanish_count == 5){ + tell_object(environment(),"The omni begins to glow a dull red."); + this_object()->SetLong("This is a small, round metal device, copper in color, "+ + "and similar in appearance to a pocket watch. There is a blinking red light "+ + "next to the tiny metal button at its top. It is glowing a dull red."); + this_object()->SetShort("an omni (glowing)"); + } + } + int check_environs(){ + if( interactive(environment()) ){ + set_heart_beat(1); + return 1; + } + return 1; + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/pack.c ds2.0r27/lib/domains/campus/obj/pack.c *** ds1.1/lib/domains/campus/obj/pack.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/pack.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,30 ---- + + #include <lib.h> + + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_STORAGE; + inherit LIB_ARMOR; + + + + static void create() { + ::create(); + SetKeyName("backpack"); + SetId(({"pack"})); + SetAdjectives(({"leather","soft","brown"})); + SetShort("a soft, brown leather backpack"); + SetLong("This is a medium-sized backpack made of soft brown leather. "+ + "It seems suitable for carrying books around, for the busy college student. "+ + "It features wide, comfortable straps for convenient wear."); + SetMass(100); + SetDollarCost(30); + SetCanClose(1); + SetClosed(1); + SetMaxCarry(500); + SetDamagePoints(100); + SetArmorType(A_CLOAK); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/ped_button.c ds2.0r27/lib/domains/campus/obj/ped_button.c *** ds1.1/lib/domains/campus/obj/ped_button.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/ped_button.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,41 ---- + /* /domains/campus/etc/chuch_button.c + * From the Nightmare V Object Library + * An example dummy item that allows pressing + * Created by Descartes of Borg 961222 + */ + + #include <lib.h> + + inherit LIB_DUMMY; // These do not show up in desc, but you can look at them + inherit LIB_PRESS; // Makes the item pressable + + int PushButton(object who) { + object *objects; + objects=({ load_object("/domains/campus/doors/red_door") }); + objects+=({ load_object("/domains/campus/doors/green_door") }); + objects+=({ load_object("/domains/campus/doors/blue_door") }); + objects+=({ load_object("/domains/campus/room/red_room") }); + objects+=({ load_object("/domains/campus/room/green_room") }); + objects+=({ load_object("/domains/campus/room/blue_room") }); + objects+=({ load_object("/domains/campus/room/monty") }); + + send_messages("press", "$agent_name $agent_verb the button, " + "resetting the experiment.", + who, 0, environment(who)); + + foreach(object ob in objects){ + ob->ButtonPush(); + } + + } + + static void create() { + dummy::create(); + SetKeyName("button"); + SetId(({"button","button on the pedestal" })); + SetAdjectives("pedestal", "red","shiny","candylike","candy-like","big"); + SetShort("a big red button"); + SetLong("It is a red, shiny, candy-like button."); + //SetPress((: PushButton :)); + SetPress(tell_object(this_player(),"hi!")); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/pedestal.c ds2.0r27/lib/domains/campus/obj/pedestal.c *** ds1.1/lib/domains/campus/obj/pedestal.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/pedestal.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,217 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + inherit LIB_PRESS; + + int PushTheButton(); + string color,gagnant,my_door,other_door,removed_door; + + void create(){ + ::create(); + SetKeyName("button pedestal"); + SetId( ({"pedestal","altar"}) ); + SetAdjectives( ({"cylindrical","round","waist-high"}) ); + SetShort("a pedestal with a red button on it"); + SetLong("This is a cylindrical pedestal, about waist-high, " + "of mysterious composition. A button is " + "on it."); + SetItems( ([ + ({"button","red button"}) : "A red button." + ]) ); + SetMass(20); + SetDollarCost(10); + SetVendorType(VT_TREASURE); + SetPress( ([ + ({"button","red button"}) : (: PushTheButton :) + ]) ); + } + mixed CanGet(object ob) { return "The pedestal does not budge.";} + + int ResetGame(){ + object *objects; + object *contents; + string prize; + prize = "/domains/campus/armor/silverring"; + objects = ({}); + objects+=({ find_object("/domains/campus/room/red_room2") }); + objects+=({ find_object("/domains/campus/room/green_room2") }); + objects+=({ find_object("/domains/campus/room/blue_room2") }); + + //foreach(object thing in objects){ + // if(thing) { + // contents = deep_inventory(thing); + // foreach(object dummy in contents){ + //if(dummy) dummy->eventDestruct(); + // } + //thing->eventDestruct(); + //} + //} + + objects = ({ find_object("/domains/campus/doors/red_door") }); + objects +=({ find_object("/domains/campus/doors/green_door") }); + objects +=({ find_object("/domains/campus/doors/blue_door") }); + + foreach(object ding in objects){ + if(ding) ding->SetClosed(1); + if(ding) ding->SetLocked(1); + } + + + if(sscanf(gagnant,"%s door",color)>0){ + string where; + where="/domains/campus/room/"+color+"_room2"; + new(prize)->eventMove(find_object(where)); + } + } + + + int PushTheButton(){ + int genrand; + gagnant = ""; + //genrand = unguarded( (: to_int(read_file("/etc/random")) :) ); + genrand = random(256); + send_messages("press", "$agent_name $agent_verb the button.", + this_player(), 0, environment(this_player())); + if(!genrand || genrand == 0){ + tell_room(environment(),"A voice from the pedestal says: " + "Whoops! There's been a minor glitch, but " + "it's nothing to worry about. Please " + "try again."); + return 1; + } + tell_room(environment(),"A voice from the pedestal says: " + "PRECOG: genrand is: "+genrand); + genrand = genrand % 3; + if(genrand == 0) gagnant = "red door"; + if(genrand == 1) gagnant = "green door"; + if(genrand == 2) gagnant = "blue door"; + //tell_object(this_player(),"gagnant: "+gagnant); + tell_room(environment(),"A voice from the pedestal says: " + "PRECOG: gagnant is: "+gagnant+".\n" + "PRECOG: genrand modulus is: "+genrand); + remove_action("doStay","stay"); + remove_action("doSwitch","switch"); + add_action("choose","choose"); + tell_room(environment(),"A voice from the pedestal says: " + "You must now choose one door from these " + "three. Behind one is a prize. Behind the " + "other two, nothing. To choose the " + "red door, for example: choose red door"); + ResetGame(); + return 1; + } + + void init(){ + if(gagnant != "" && my_door !=""){ + add_action("doStay","stay"); + add_action("doSwitch","switch"); + } + if(gagnant != "" && my_door == ""){ + add_action("choose","choose"); + } + } + + int choose(string str){ + if(!str || str == ""){ + tell_room(environment(),"A voice from the pedestal says: " + "Please try choosing a door, ok?"); + } + else if(str == "door"){ + tell_room(environment(),"A voice from the pedestal says: " + "You'll need to be more specific."); + } + else if(str == "red door" || str == "blue door" ||str == "green door"){ + tell_room(environment(),"A voice from the pedestal says: " + "You choose the "+str+"."); + this_object()->MontyMagic(str); + //return 1; + } + else { + tell_room(environment(),"A voice from the pedestal says: " + "I don't understand that."); + } + reap_dummies(); + reap_other("/domains/campus/armor/silverring"); + return 1; + } + + int MontyMagic(string str){ + int genrand,which; + string *choices; + choices = ({}); + if(str != "red door") choices += ({ "red door" }); + if(str != "green door") choices += ({ "green door" }); + if(str != "blue door") choices += ({ "blue door" }); + //genrand=to_int(read_file("/etc/random")); + genrand = random(256); + if( choices[1] == gagnant) which = 0; + else if( choices[0] == gagnant) which = 1; + else which = genrand % 2;; + removed_door = choices[which]; + choices -= ({ choices[which] }); + other_door = choices[0]; + my_door = str; + choices += ({ str }); + if(sscanf(removed_door,"%s door",color)>0) color = color; + find_object("/domains/campus/doors/"+color+"_door")->SetLocked(0); + find_object("/domains/campus/doors/"+color+"_door")->SetClosed(0); + tell_room(environment(),"A voice from the pedestal says: " + "I have opened the "+removed_door+"! \n" + "You may enter the "+color+" room and see that it is empty.\n" + "Only the "+choices[0]+" and "+choices[1]+" remain.\n\n" + "Would you like to switch to the "+other_door+"? \n" + "Or would you rather stay with the "+str+"?\n\n" + "To switch, type: switch\n" + "To stay, type: stay"); + remove_action("choose","choose"); + add_action("doStay","stay"); + add_action("doSwitch","switch"); + return 1; + + } + + int CheckWin(string str){ + if(sscanf(str,"%s door",color)>0) color = color; + if(str == gagnant) { + this_object()->WinFun(); + return 1; + } + find_object("/domains/campus/doors/"+color+"_door")->SetLocked(0); + find_object("/domains/campus/doors/"+color+"_door")->SetClosed(0); + tell_room(environment(),"A voice from the pedestal says: " + "YOU LOOOOOSE!\n" + "You may enter the "+color+" room to get your big " + "load of NOTHING. Haaa haa!"); + return 1; + } + + int doStay(){ + tell_room(environment(),"A voice from the pedestal says: " + "Oh, how loyal!"); + remove_action("doStay","stay"); + remove_action("doSwitch","switch"); + CheckWin(my_door); + return 1; + } + + int doSwitch(){ + tell_room(environment(),"A voice from the pedestal says: " + "Why you're inconstant as a feather!"); + remove_action("doStay","stay"); + remove_action("doSwitch","switch"); + my_door = other_door; + CheckWin(my_door); + return 1; + } + + int WinFun(){ + find_object("/domains/campus/doors/"+color+"_door")->SetLocked(0); + find_object("/domains/campus/doors/"+color+"_door")->SetClosed(0); + tell_room(environment(),"A voice from the pedestal says: " + "You win, kid. Congrats!\n" + "You may enter the "+color+" room and claim your prize.\n\n" + "Push the pedestal button to reset the game."); + return 1; + } + + diff -c -r --new-file ds1.1/lib/domains/campus/obj/pedestal2.c ds2.0r27/lib/domains/campus/obj/pedestal2.c *** ds1.1/lib/domains/campus/obj/pedestal2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/pedestal2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,204 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + inherit LIB_PRESS; + + int PushTheButton(); + string color,gagnant,my_door,other_door,removed_door; + void create(){ + ::create(); + SetKeyName("button pedestal"); + SetId( ({"pedestal","altar"}) ); + SetAdjectives( ({"cylindrical","round","waist-high"}) ); + SetShort("a pedestal with a red button on it"); + SetLong("This is a cylindrical pedestal, about waist-high, " + "of mysterious composition. A button is " + "on it."); + SetItems( ([ + ({"button","red button"}) : "A red button." + ]) ); + SetMass(20); + SetDollarCost(10); + SetVendorType(VT_TREASURE); + SetPress( ([ + ({"button","red button"}) : (: PushTheButton :) + ]) ); + } + mixed CanGet(object ob) { return "The pedestal does not budge.";} + int ResetGame(){ + object *objects; + object *contents; + string prize; + prize = "/domains/campus/armor/silverring"; + objects = ({}); + objects+=({ find_object("/domains/campus/room/red_room2") }); + objects+=({ find_object("/domains/campus/room/green_room2") }); + objects+=({ find_object("/domains/campus/room/blue_room2") }); + + //foreach(object thing in objects){ + // if(thing) { + // contents = deep_inventory(thing); + // foreach(object dummy in contents){ + //if(dummy) dummy->eventDestruct(); + // } + //thing->eventDestruct(); + //} + //} + + objects = ({ find_object("/domains/campus/doors/red_door2") }); + objects +=({ find_object("/domains/campus/doors/green_door2") }); + objects +=({ find_object("/domains/campus/doors/blue_door2") }); + + foreach(object ding in objects){ + if(ding) ding->SetClosed(1); + if(ding) ding->SetLocked(1); + } + + if(sscanf(gagnant,"%s door",color)>0){ + string where; + where="/domains/campus/room/"+color+"_room2"; + new(prize)->eventMove(find_object(where)); + } + } + int PushTheButton(){ + int genrand; + gagnant = ""; + //genrand = unguarded( (: to_int(read_file("/etc/random")) :) ); + genrand = random(256); + send_messages("press", "$agent_name $agent_verb the button.", + this_player(), 0, environment(this_player())); + if(!genrand || genrand == 0){ + tell_room(environment(),"A voice from the pedestal says: " + "Whoops! There's been a minor glitch, but " + "it's nothing to worry about. Please " + "try again."); + return 1; + } + tell_room(environment(),"A voice from the pedestal says: " + "PRECOG: genrand is: "+genrand); + genrand = genrand % 3; + if(genrand == 0) gagnant = "red door"; + if(genrand == 1) gagnant = "green door"; + if(genrand == 2) gagnant = "blue door"; + //tell_object(this_player(),"gagnant: "+gagnant); + tell_room(environment(),"A voice from the pedestal says: " + "PRECOG: gagnant is: "+gagnant+".\n" + "PRECOG: genrand modulus is: "+genrand); + remove_action("doStay","stay"); + remove_action("doSwitch","switch"); + add_action("choose","choose"); + tell_room(environment(),"A voice from the pedestal says: " + "You must now choose one door from these " + "three. Behind one is a prize. Behind the " + "other two, nothing. To choose the " + "red door, for example: choose red door"); + ResetGame(); + return 1; + } + void init(){ + ::init(); + if(gagnant != "" && my_door !=""){ + add_action("doStay","stay"); + add_action("doSwitch","switch"); + } + if(gagnant != "" && my_door == ""){ + add_action("choose","choose"); + } + } + int choose(string str){ + if(!str || str == ""){ + tell_room(environment(),"A voice from the pedestal says: " + "Please try choosing a door, ok?"); + } + else if(str == "door"){ + tell_room(environment(),"A voice from the pedestal says: " + "You'll need to be more specific."); + } + else if(str == "red door" || str == "blue door" ||str == "green door"){ + tell_room(environment(),"A voice from the pedestal says: " + "You choose the "+str+"."); + this_object()->MontyMagic(str); + //return 1; + } + else { + tell_room(environment(),"A voice from the pedestal says: " + "I don't understand that."); + } + reap_dummies(); + reap_other("/domains/campus/armor/silverring"); + return 1; + } + int MontyMagic(string str){ + int genrand,which; + string *choices; + choices = ({}); + if(str != "red door") choices += ({ "red door" }); + if(str != "green door") choices += ({ "green door" }); + if(str != "blue door") choices += ({ "blue door" }); + //genrand=to_int(read_file("/etc/random")); + genrand = random(256); + if( choices[1] == gagnant) which = 0; + else if( choices[0] == gagnant) which = 1; + else which = genrand % 2;; + removed_door = choices[which]; + choices -= ({ choices[which] }); + other_door = choices[0]; + my_door = str; + choices += ({ str }); + if(sscanf(removed_door,"%s door",color)>0) color = color; + find_object("/domains/campus/doors/"+color+"_door2")->SetLocked(0); + find_object("/domains/campus/doors/"+color+"_door2")->SetClosed(0); + tell_room(environment(),"A voice from the pedestal says: " + "I have opened the "+removed_door+"! \n" + "You may enter the "+color+" room and see that it is empty.\n" + "Only the "+choices[0]+" and "+choices[1]+" remain.\n\n" + "Would you like to switch to the "+other_door+"? \n" + "Or would you rather stay with the "+str+"?\n\n" + "To switch, type: switch\n" + "To stay, type: stay"); + remove_action("choose","choose"); + add_action("doStay","stay"); + add_action("doSwitch","switch"); + return 1; + + } + int CheckWin(string str){ + if(sscanf(str,"%s door",color)>0) color = color; + if(str == gagnant) { + this_object()->WinFun(); + return 1; + } + find_object("/domains/campus/doors/"+color+"_door2")->SetLocked(0); + find_object("/domains/campus/doors/"+color+"_door2")->SetClosed(0); + tell_room(environment(),"A voice from the pedestal says: " + "YOU LOOOOOSE!\n" + "You may enter the "+color+" room to get your big " + "load of NOTHING. Haaa haa!"); + return 1; + } + int doStay(){ + tell_room(environment(),"A voice from the pedestal says: " + "Oh, how loyal!"); + remove_action("doStay","stay"); + remove_action("doSwitch","switch"); + CheckWin(my_door); + return 1; + } + int doSwitch(){ + tell_room(environment(),"A voice from the pedestal says: " + "Why you're inconstant as a feather!"); + remove_action("doStay","stay"); + remove_action("doSwitch","switch"); + my_door = other_door; + CheckWin(my_door); + return 1; + } + int WinFun(){ + find_object("/domains/campus/doors/"+color+"_door2")->SetLocked(0); + find_object("/domains/campus/doors/"+color+"_door2")->SetClosed(0); + tell_room(environment(),"A voice from the pedestal says: " + "You win, kid. Congrats!\n" + "You may enter the "+color+" room and claim your prize.\n\n" + "Push the pedestal button to reset the game."); + return 1; + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/pedestal3.c ds2.0r27/lib/domains/campus/obj/pedestal3.c *** ds1.1/lib/domains/campus/obj/pedestal3.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/pedestal3.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,217 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + inherit LIB_PRESS; + + int PushTheButton(); + string color,gagnant,my_door,other_door,removed_door; + + void create(){ + ::create(); + SetKeyName("button pedestal"); + SetId( ({"pedestal","altar"}) ); + SetAdjectives( ({"cylindrical","round","waist-high"}) ); + SetShort("a pedestal with a red button on it"); + SetLong("This is a cylindrical pedestal, about waist-high, " + "of mysterious composition. A button is " + "on it."); + SetItems( ([ + ({"button","red button"}) : "A red button." + ]) ); + SetMass(20); + SetDollarCost(10); + SetVendorType(VT_TREASURE); + SetPress( ([ + ({"button","red button"}) : (: PushTheButton :) + ]) ); + } + mixed CanGet(object ob) { return "The pedestal does not budge.";} + + int ResetGame(){ + object *objects; + object *contents; + string prize; + prize = "/domains/campus/armor/silverring"; + objects = ({}); + objects+=({ find_object("/domains/campus/room/red_room2") }); + objects+=({ find_object("/domains/campus/room/green_room2") }); + objects+=({ find_object("/domains/campus/room/blue_room2") }); + + //foreach(object thing in objects){ + // if(thing) { + // contents = deep_inventory(thing); + // foreach(object dummy in contents){ + //if(dummy) dummy->eventDestruct(); + // } + //thing->eventDestruct(); + //} + //} + + objects = ({ find_object("/domains/campus/doors/red_door3") }); + objects +=({ find_object("/domains/campus/doors/green_door3") }); + objects +=({ find_object("/domains/campus/doors/blue_door3") }); + + foreach(object ding in objects){ + if(ding) ding->SetClosed(1); + if(ding) ding->SetLocked(1); + } + + + if(sscanf(gagnant,"%s door",color)>0){ + string where; + where="/domains/campus/room/"+color+"_room2"; + new(prize)->eventMove(find_object(where)); + } + } + + + int PushTheButton(){ + int genrand; + gagnant = ""; + //genrand = unguarded( (: to_int(read_file("/etc/random")) :) ); + genrand = random(256); + send_messages("press", "$agent_name $agent_verb the button.", + this_player(), 0, environment(this_player())); + if(!genrand || genrand == 0){ + tell_room(environment(),"A voice from the pedestal says: " + "Whoops! There's been a minor glitch, but " + "it's nothing to worry about. Please " + "try again."); + return 1; + } + //tell_room(environment(),"A voice from the pedestal says: " + //"PRECOG: genrand is: "+genrand); + genrand = genrand % 3; + if(genrand == 0) gagnant = "red door"; + if(genrand == 1) gagnant = "green door"; + if(genrand == 2) gagnant = "blue door"; + //tell_object(this_player(),"gagnant: "+gagnant); + //tell_room(environment(),"A voice from the pedestal says: " + // "PRECOG: gagnant is: "+gagnant+".\n" + // "PRECOG: genrand modulus is: "+genrand); + remove_action("doStay","stay"); + remove_action("doSwitch","switch"); + add_action("choose","choose"); + tell_room(environment(),"A voice from the pedestal says: " + "You must now choose one door from these " + "three. Behind one is a prize. Behind the " + "other two, nothing. To choose the " + "red door, for example: choose red door"); + ResetGame(); + return 1; + } + + void init(){ + if(gagnant != "" && my_door !=""){ + add_action("doStay","stay"); + add_action("doSwitch","switch"); + } + if(gagnant != "" && my_door == ""){ + add_action("choose","choose"); + } + } + + int choose(string str){ + if(!str || str == ""){ + tell_room(environment(),"A voice from the pedestal says: " + "Please try choosing a door, ok?"); + } + else if(str == "door"){ + tell_room(environment(),"A voice from the pedestal says: " + "You'll need to be more specific."); + } + else if(str == "red door" || str == "blue door" ||str == "green door"){ + tell_room(environment(),"A voice from the pedestal says: " + "You choose the "+str+"."); + this_object()->MontyMagic(str); + //return 1; + } + else { + tell_room(environment(),"A voice from the pedestal says: " + "I don't understand that."); + } + reap_dummies(); + reap_other("/domains/campus/armor/silverring"); + return 1; + } + + int MontyMagic(string str){ + int genrand,which; + string *choices; + choices = ({}); + if(str != "red door") choices += ({ "red door" }); + if(str != "green door") choices += ({ "green door" }); + if(str != "blue door") choices += ({ "blue door" }); + //genrand=to_int(read_file("/etc/random")); + genrand = random(256); + if( choices[1] == gagnant) which = 0; + else if( choices[0] == gagnant) which = 1; + else which = genrand % 2;; + removed_door = choices[which]; + choices -= ({ choices[which] }); + other_door = choices[0]; + my_door = str; + choices += ({ str }); + if(sscanf(removed_door,"%s door",color)>0) color = color; + find_object("/domains/campus/doors/"+color+"_door3")->SetLocked(0); + find_object("/domains/campus/doors/"+color+"_door3")->SetClosed(0); + tell_room(environment(),"A voice from the pedestal says: " + "I have opened the "+removed_door+"! \n" + "You may enter the "+color+" room and see that it is empty.\n" + "Only the "+choices[0]+" and "+choices[1]+" remain.\n\n" + "Would you like to switch to the "+other_door+"? \n" + "Or would you rather stay with the "+str+"?\n\n" + "To switch, type: switch\n" + "To stay, type: stay"); + remove_action("choose","choose"); + add_action("doStay","stay"); + add_action("doSwitch","switch"); + return 1; + + } + + int CheckWin(string str){ + if(sscanf(str,"%s door",color)>0) color = color; + if(str == gagnant) { + this_object()->WinFun(); + return 1; + } + find_object("/domains/campus/doors/"+color+"_door3")->SetLocked(0); + find_object("/domains/campus/doors/"+color+"_door3")->SetClosed(0); + tell_room(environment(),"A voice from the pedestal says: " + "YOU LOOOOOSE!\n" + "You may enter the "+color+" room to get your big " + "load of NOTHING. Haaa haa!"); + return 1; + } + + int doStay(){ + tell_room(environment(),"A voice from the pedestal says: " + "Oh, how loyal!"); + remove_action("doStay","stay"); + remove_action("doSwitch","switch"); + CheckWin(my_door); + return 1; + } + + int doSwitch(){ + tell_room(environment(),"A voice from the pedestal says: " + "Why you're inconstant as a feather!"); + remove_action("doStay","stay"); + remove_action("doSwitch","switch"); + my_door = other_door; + CheckWin(my_door); + return 1; + } + + int WinFun(){ + find_object("/domains/campus/doors/"+color+"_door3")->SetLocked(0); + find_object("/domains/campus/doors/"+color+"_door3")->SetClosed(0); + tell_room(environment(),"A voice from the pedestal says: " + "You win, kid. Congrats!\n" + "You may enter the "+color+" room and claim your prize.\n\n" + "Push the pedestal button to reset the game."); + return 1; + } + + diff -c -r --new-file ds1.1/lib/domains/campus/obj/pin.c ds2.0r27/lib/domains/campus/obj/pin.c *** ds1.1/lib/domains/campus/obj/pin.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/pin.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + + void create(){ + ::create(); + SetKeyName("pull-pin"); + SetId(({"pin","ring"})); + SetAdjectives(({"pull","grenade","fuse"})); + SetShort("a grenade pin"); + SetLong("This is the pull pin from a hand grenade fuse."); + SetMass(1); + SetDollarCost(0); + SetVendorType(VT_TREASURE); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/podium.c ds2.0r27/lib/domains/campus/obj/podium.c *** ds1.1/lib/domains/campus/obj/podium.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/podium.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,713 ---- + /* It works now, no define needed. + * make sure someone does "setmc" or it won't do much. + * setmc can only be done once, first come, first get i guess ;) + * by Boy@frontiers. + * Major corrections and modifications by Crat 25jul05 + */ + #include <lib.h> + #include <vendor_types.h> + inherit LIB_STORAGE; + + #define DEFAULT_BOUNCE_ROOM "/domains/town/room/adv_guild" + string bounce_room ; /* File name of the bounce room */ + string *voters ; /* Array of names of users who have voted */ + string *agenda ; /* Array of agenda item strings. */ + mapping votes ; /* Keys are names, data are votes cast */ + string vote_str ; /* The proposition being voted on */ + int endtime ; /* Time at which the speaker/vote ends */ + int votelog ; /* 1 if votes are being announced, else 0 */ + + string speaker; + string mc; + int x; + object ob; + static void create() { + storage::create(); + SetShort("a podium"); + SetLong("This is the speaker's podium. It is about four feet tall "+ + "and made of some expensive-looking, deep grain wood. This podium "+ + "facilitates the running of meetings by giving the speaker the power "+ + "to recognize individual people to speak at a time. There is "+ + "some space in the podium to store things in, perhaps there is something "+ + "in there now. For more "+ + "details on running a meeting with the podium, type: help podium."); + SetMass(10); + SetId( ({"podium", "speaker's podium", "podium.c"}) ); + SetDollarCost(-110); + SetKeyName("podium"); + SetId(({"podium","handler"})); + SetAdjectives(({"wood","wooden","meeting","speaker's","Speaker's"})); + SetDamagePoints(1000); + SetPreventGet("You can't get that."); + SetMaxCarry(20); + + SetInventory(([ + ])); + + mc = ""; + x = 0; + speaker = ""; + + vote_str = "none" ; + voters = ({ }) ; + votes = ([ ]) ; + agenda = ({ }) ; + bounce_room = DEFAULT_BOUNCE_ROOM ; + + } + void init() { + ::init(); + add_action("eventSay", "say",1); + add_action("eventRaise", "raise"); + add_action("eventCallOn", "recognize"); + add_action("shaddap", "yell"); + add_action("shaddap", "shout"); + add_action("shaddap", "emote"); + add_action("help", "help"); + add_action("quiet", "quiet"); + add_action("changemc", "changemc"); + add_action("SetMc", "setmc"); + add_action ("echo", "echo") ; + add_action ("vote", "vote") ; + add_action ("call_for_vote", "call") ; + add_action ("call_for_roll", "rollcall") ; + add_action ("permit_entry", "permit") ; + add_action ("localtime", "time") ; + add_action ("reset_clock", "reset") ; + add_action ("show_agenda", "agenda") ; + add_action ("add_items", "add") ; + add_action ("remove_item", "remove") ; + add_action ("clear_items", "clear") ; + add_action ("eject_player", "eject") ; + add_action ("privacy", "privacy"); + add_action ("privacy", "priv"); + add_action ("localupdate", "update") ; + add_action ("step_down", "step" ); + } + mixed CanGet(object ob) { return "The podium does not budge.";} + + + + int eventSay(string args) { + string foo; + + if (mc == this_player()->GetKeyName()) { + this_player()->eventPrint("You say %^CYAN%^\"" + capitalize(args) + "\""); + say(this_player()->GetName() + " says %^CYAN%^\"" + capitalize(args) + "\""); + return 1; + } + if ( mc != "" && this_player()-> GetKeyName() != speaker ) { + this_player()->eventPrint("%^RED%^It is not polite to talk out of order."); + this_player()->eventPrint("Raise your hand if you'd like to speak."); + return 1; + } + if ((!args) || (args == " ")) { + write ("You mutter to yourself.\n") ; + return 1 ; + } + foo = wrap((string)this_player()->GetCapName() + + " says: %^CYAN%^\"" + capitalize(args)) ; + say (foo) ; + write(wrap("You say: %^CYAN%^\"" + capitalize(args))); + return 1; + + } + + + int eventCallOn(string args) { + if (present((object)args)) { + if (mc == this_player()->GetKeyName()) { + speaker = args; + write("You have called on " + speaker+".\n"); + find_living(args)->eventPrint("%^CYAN%^" + capitalize(mc) + " has called on you, you may speak."); + return 1; + } + else { + this_player()->eventPrint("Only the speaker can do that."); + return 1; + } + } + else { + write("%^CYAN%^This person is not here to be called on."); + return 1; + } + } + + + int eventRaise() { + string dude; + dude=this_player()->GetKeyName(); + if(dude != mc && dude != speaker) { + tell_room(environment(this_player()), + this_player()->GetName()+" raises "+ + possessive(this_player())+ + " hand.", ({this_player()}) ); + this_player()->eventPrint("%^CYAN%^You raise your hand."); + return 1; + } + else { + write("You can speak already. Say what's on your mind."); + return 1; + } + } + + + int shaddap() { + if(mc != "" && this_player()->GetKeyName() != speaker){ + write("%^RED%^It would be impolite to do that at this time."); + return 1; + } + } + + + int help(string args) { + if (args != "podium") { + return 0; + } + else { + write("%^GREEN%^This is the speakers podium, it is where the " + "speaker stands during a speech. This podium " + "has special properties, it can prevent others " + "from speaking out of turn, if you are the "+ + "speaker.%^RESET%^"); + if (this_player()->GetKeyName() == mc) { + write("%^RED%^Available commands:"); + write("%^YELLOW%^recognize %^RESET%^: Calls on another to speak."); + write("%^YELLOW%^say %^RESET%^: As the speaker, you can say things whenever you like."); + write("%^YELLOW%^quiet %^RESET%^: Revokes the speaking privilege to the person you last called on."); + write("%^YELLOW%^changemc %^RESET%^: Removes yourself as mc, and let someone else take over."); + write("%^YELLOW%^add <string>%^RESET%^: Add agenda item <string> to the bottom of the agenda."); + write("%^YELLOW%^remove <int>%^RESET%^: Remove agenda item <int> from the agenda."); + write("%^YELLOW%^clear agenda%^RESET%^: Clear the agenda."); + write("%^YELLOW%^permit <name>%^RESET%^: Permit player <name> to enter the meeting room when locked."); + write("%^YELLOW%^eject <name>%^RESET%^: Eject player <name> from the meeting room."); + write("%^YELLOW%^time <num> [minutes/seconds]%^RESET%^: Set the clock to <num> minutes or seconds."); + write("%^YELLOW%^reset clock%^RESET%^: Clear the clock."); + write("%^YELLOW%^step down%^RESET%^: Step down as head speaker."); + write("%^YELLOW%^rollcall <num> [minutes/seconds] <subject>%^RESET%^: Call for a roll call vote,\n" + "\tlasting num minutes or seconds, on <subject>."); + write("%^YELLOW%^add after <int> <string>%^RESET%^: Add agenda item <string> after agenda item #<int>.\n" + "\tadd after 0 <string> adds to the top of the list."); + write("%^YELLOW%^call <num> [minutes/seconds] <subject>%^RESET%^: Call for a vote, lasting num minutes\n" + "\tor seconds, on <subject>."); + return 1; + } + else { + write("%^RED%^Available commands:"); + write("%^YELLOW%^raise %^RESET%^: Raise your hand, to motion to the speaker that you would like to speak."); + write("%^YELLOW%^say %^RESET%^ : Say something, you only may do this if the speaker has called on you."); + if (x == 0) { + write("%^YELLOW%^setmc%^RESET%^ : There is no mc currently, use this command to set one."); + } + return 1; + } + } + } + + + int quiet() { + if (mc == this_player()->GetKeyName()) { + write("%^CYAN%^You thank " + capitalize(speaker) + " for speaking."); + find_living(speaker)->eventPrint("%^CYAN%^" + capitalize(mc) + " thanks you for you speaking."); + speaker = mc; + return 1; + } + write ("Only the mc may use this command.\n") ; + return 1; + } + + + int changemc(string args) { + if (args != 0) { + if ( this_player()->GetKeyName() != mc ) { + write("%^RED%^You are not the mc to begin with, you cannot give that position away."); + return 1; + } + else { + if (!present(args)) { + write("%^CYAN%^" + args + " is not present, and therefore cannot be mc."); + return 1; + } + else { + write("%^CYAN%^You hand the podium over to " + args); + mc = args; + say("%^CYAN%^" + capitalize(args) + " is the new head speaker."); + find_living(mc)->eventPrint("%^BLUE%^You are the new head speaker!"); + find_living(mc)->eventPrint("The command \"help podium\" can help you, if you don't know what to do."); + return 1; + } + } + } + else { + write("%^CYAN%^Syntax:"); + write("changemc <player>"); + return 1; + } + } + + int step_down(string args){ + if (args == "down") { + if ( this_player()->GetKeyName() != mc ) { + write("%^RED%^You are not the mc to begin with, you cannot give that position away."); + return 1; + } + say("%^CYAN%^" + capitalize(mc) + " has stepped down as the head speaker."); + write ( "You step down as the head speaker" ); + mc = ""; + x--; + load_object(base_name(environment(this_object())))->AutoDeactivate(); + return 1; + } + else { + write("%^CYAN%^Syntax:"); + write("<step down>"); + return 1; + } + + } + + int SetMc(string args) { + if (x==0) { + if (args != 0) { + if (present(args) ) { + mc = args; + say("%^CYAN%^" + capitalize(mc) + " is the speaker."); + write("You set " + capitalize(args) + " as the speaker."); + find_living(mc)->eventPrint("The command \"help podium\" can help you, if you don't know what to do."); + x++; + return 1; + } + else { + write("You cannot set him/her as the speaker, he/she is not here!"); + return 1; + } + } + else { + write("%^CYAN%^Syntax:"); + write("setmc <player>"); + return 1; + } + } + else { + write("There is already a speaker, you cannot set another one."); + return 1; + } + } + + int privacy(string str){ + + if ( mc != this_player()->GetKeyName() ) { + write ("Only the mc may use the shield.\n") ; + return 1 ; + } + if(str=="on" || str == "1"){ + load_object(base_name(environment(this_object())))->set_privacy( 1 ); + write("You enable the privacy shield.\n"); + say(this_player()->GetName()+" enables a privacy force field around the room."); + return 1; + } + if(str=="off" || str == "0"){ + load_object(base_name(environment(this_object())))->AutoDeactivate(); + write("You disable the privacy shield.\n"); + say(this_player()->GetName()+" disables a privacy force field around the room."); + return 1; + } + } + + // Echoing is always forbidden. It's just too much of a hassle. + int echo (string str) { + write ("Echoing is forbidden in the conference room at all times.\n") ; + return 1 ; + } + + // Permit_entry lets the mc bring someone into the conference room + // when it is locked. + int permit_entry (string name) { + + object user ; + int oldlock ; + + if ( mc != this_player()->GetKeyName() ) { + write ("Only the mc may permit entry into a locked conference.\n") ; + return 1 ; + } + user = find_player(name) ; + if (!user) { + write ("There is no user by that name.\n") ; + return 1 ; + } + if (present(user,environment(this_object()))) { + write (capitalize(name)+" is already here!\n") ; + return 1 ; + } + // We save the old locked status of the room, and restore it when we're + // done. You can "permit" entry into an unlocked conference if you want + // to: it saves the person the trouble of walking. + oldlock = load_object(base_name(environment(this_object())))->get_privacy() ; + load_object(base_name(environment(this_object())))->set_privacy( 0 ); + user -> eventMove(environment(this_object())) ; + load_object(base_name(environment(this_object())))->set_privacy( oldlock ); + write ("You bring "+capitalize(name)+" into the conference.\n") ; + tell_object (user, capitalize(mc)+" permits you to enter.\n") ; + say (capitalize(name)+" has been permitted to enter the conference.\n", user) ; + return 1 ; + } + + + + // Eject_player lets the mc banish a player from the room and dump + // him in the bounce room. Not very effective if the room is unlocked, + // except perhaps as a warning. + int eject_player (string str) { + + object ob ; + + if ( mc != this_player()->GetKeyName() ) { + write ("Only the mc may eject players.\n") ; + return 1 ; + } + ob = find_player(str) ; + if (!ob || !present (ob, environment(this_object()))) { + write ("There is no player named "+capitalize(str)+" here.\n") ; + return 1 ; + } + write ("You eject "+capitalize(str)+" from the room!\n") ; + tell_object (ob, "You have been ejected from the room.\n") ; + say (capitalize(str)+" has been ejected from the room.\n") ; + ob->eventMove(bounce_room) ; + return 1 ; + } + + // Localtime shows the user the amount of time left on the room clock. + // The name is chosen to avoid colliding with the time() efun. + // The mc may also use this function to set the time on the clock + // and start it running. See the help documents for more information on + // how the clock works. + varargs int localtime (string str) { + + int i, min, sec ; + string foo ; + + // If no string, then we just indicate how much time is left on the clock. + if (!str) { + if (!endtime || endtime == 0) { + write ("Time is not running at the moment.\n") ; + return 1 ; + } + i = time() ; + i = endtime - i ; + min = (i/60) ; + sec = i - (min*60) ; + if (min==1) { + write ("The clock shows 1 minute and "+sec+" seconds remaining.\n") ; + } else { + write ("The clock shows "+min+" minutes and "+sec+" seconds remaining.\n") ; + } + return 1 ; + } + // If there is a string, then the user is trying to set the clock to some + // number of minutes or seconds. + if ( mc != this_player()->GetKeyName() ) { + write ("Only the mc may set the clock.\n") ; + return 1 ; + } + // You cannot set a new time if the clock is running. This is for safety. + // You must reset the clock first. See below. + if (endtime!=0) { + write ("The clock is running. You must reset the clock first.\n" + ) ; + return 1 ; + } + if (sscanf(str, "%d min%s", i, foo) == 2) { + i=i*60 ; + } else { + if (sscanf(str, "%d seconds", i) != 1) { + write ("You must set a number of minutes or seconds: ie, 3 minutes or 90 seconds.\n") ; + return 1 ; + } + } + write ("You set the clock to "+str+".\n") ; + say (capitalize(mc)+" sets the clock to "+str+".\n") ; + endtime = time()+i ; + // We call_out to a function that prints a message when time runs out. + call_out ("expire_time", i) ; + return 1 ; + } + + // Reset_clock lets the mc clear the clock before setting a new time + // on it. + int reset_clock (string str) { + if (!str || str!="clock") { + notify_fail ("Reset what?\n") ; + return 0 ; + } + if ( mc != this_player()->GetKeyName() ) { + write ("Only the mc may reset the clock.\n") ; + return 1 ; + } + if (endtime==0) { + write ("The clock isn't running.\n") ; + return 1 ; + } + endtime = 0 ; + write ("You clear the clock.\n") ; + say (capitalize(mc)+" clears the clock.\n") ; + // Clear any pending call_outs that may be left behind. + remove_call_out("expire_time") ; + remove_call_out("expire_vote") ; + return 1 ; + } + + // Expire_time lets the conference room know that time has expired. It + // doesn't force the speaker to shut up or anything like that: that's left + // to the mcs discretion. + int expire_time() { + tell_room (environment(this_object()),"The clock runs out.\n") ; + endtime = 0 ; + } + + + // Show_agenda lets users see the current agenda. + int show_agenda() { + + int i ; + + if (!agenda || sizeof(agenda)==0) { + write ("The agenda has not been set.\n") ; + return 1 ; + } + write ("The current agenda is:\n") ; + for (i=0;i<sizeof(agenda);i++) { + write ((i+1)+". "+agenda[i]+"\n") ; + } + return 1 ; + } + + + + // Clear_speakers erases the speakers list or agenda, depending on argument. + int clear_items (string str) { + if ( mc != this_player()->GetKeyName() ) { + write ("Only the mc may clear the agenda.\n") ; + return 1 ; + } + if (!str || str!="agenda") { + write ("Usage: clear [agenda]\n") ; + return 1 ; + } + agenda = ({ }) ; + write ("The agenda has been cleared.\n") ; + say ("The agenda has been cleared.\n") ; + return 1 ; + } + + // Add_agenda_item lets the mc add an agenda item. If the argument + // is of the form "after <int> <string>", then string is added to the + // agenda AFTER item int. Agenda items are numbered 1-N rather than 0-(N-1). + int add_items (string str) { + + int post ; + string prop ; + + if ( mc != this_player()->GetKeyName() ) { + notify_fail ("Only the mc may add agenda items.\n") ; + return 0 ; + } + if (!str) { + write ("Usage: add item or add after N item\n") ; + return 1 ; + } + if (sscanf(str,"after %d %s", post, prop)!=2) { + agenda += ({ str }) ; + write ("Added the following item to the agenda\n"+str+"\n") ; + return 1 ; + } + if (post<0 || post>=sizeof(agenda)) { + notify_fail ("Item number out of range.\n") ; + return 0 ; + } + if (post==0) agenda = ({ prop }) + agenda ; else + agenda = agenda[0..post-1] + ({ prop }) + agenda[post..sizeof(agenda)] ; + write ("Added the following agenda item after item "+post+":\n"+ + prop+"\n") ; + return 1 ; + } + + // Remove_item lets the mc take an item off the agenda. + int remove_item (string str) { + + int agitem ; + + if (!str) { + notify_fail ("Usage: remove <number of agenda item>\n") ; + return 0 ; + } + if (sscanf(str,"%d",agitem)!=1) { + notify_fail ("Usage: remove <number of agenda item>\n") ; + return 0 ; + } + if (agitem<0 || agitem>sizeof(agenda)) { + write ("Item number out of range.\n") ; + return 0 ; + } + // Convert to 0-(N-1) numbering. + agitem = agitem-1 ; + write (agitem+"\n") ; + write ("Removing the following agenda item:\n"+agenda[agitem]+"\n") ; + if (agitem==0) { + agenda = agenda[1..sizeof(agenda)-1] ; + } else { + if (agitem == sizeof(agenda)-1) { + agenda = agenda[0..sizeof(agenda)-2] ; + } else { + agenda = agenda[0..agitem-1] + agenda[agitem+1..sizeof(agenda)-1] ; + } + } + return 1 ; + } + + // Vote lets a player cast a vote on the proposed issue. See the help + // document for details on how voting works. + int vote (string str) { + // With no argument, we print the proposal, if there is one. + if (!str) { + if (!vote_str || vote_str=="none") { + write ("No vote is in progress.\n") ; + return 1 ; + } + write ("Voting on: "+vote_str+"\n") ; + return 1 ; + } + // If there is a argument, we interpret that string as a vote cast. + if (!vote_str || vote_str=="none") { + write ("No vote is in progress at this time.\n") ; + return 1 ; + } + if (str!="yes" && str!="no" && str!="abstain") { + write ("Please vote yes, no, or abstain..\n") ; + return 1 ; + } + if (member_array( this_player()->GetName(),voters)!=-1) { + write ("You have already voted!\n") ; + return 1 ; + } + voters += ({ this_player()->GetName() }) ; + votes[str] = votes[str]+1 ; + write ("You vote "+str+" on "+vote_str+".\n") ; + // If this is a roll call vote - ie, the votes are being logged - we announce + // the vote to the log file and to the room. + if (votelog) { + say (capitalize(this_player()->GetName())+" votes "+capitalize(str)+".\n") ; + } + return 1 ; + } + + // Call_for_vote allows the mc to call for a secret-ballot vote on + // a proposal. + int call_for_vote (string str) { + + string timestr, subjstr ; + int i ; + + if ( mc != this_player()->GetKeyName() ) { + write ("Only the mc may call for votes.\n") ; + return 1 ; + } + // Must specify an amount of time for which votes may be cast, and a subject + // which people are voting on. + if (!str) { + write ("Usage: call <num> <minutes|seconds> <subject>\n") ; + return 1 ; + } + if (sscanf(str,"%d %s %s",i,timestr,subjstr)!=3) { + write ("Usage: call <num> <minutes|seconds> <subject>\n") ; + return 1 ; + } + // This is going to reset the clock: so we want to force the mc to + // clear the clock first. + if (endtime!=0) { + write ("The clock is running. You must reset the clock first.\n") ; + return 1 ; + } + if (timestr=="minutes") { + i = i * 60 ; + } else { + if (timestr!="seconds") { + write ("Enter the time in minutes or seconds.\n") ; + return 1 ; + } + } + vote_str = subjstr ; + // This is a secret ballot so we don't want to log the votes. + votelog = 0 ; + write ("You call for a vote on "+vote_str+".\n") ; + say (capitalize(mc)+" calls for a vote on "+vote_str+".\n") ; + say (capitalize(mc)+" sets the clock to "+str+".\n") ; + endtime = time()+i ; + // Call out to a function which totals the votes at the end of the vote time. + call_out ("expire_vote",i) ; + return 1 ; + } + + // Call_for_roll is exactly like call_for_vote EXCEPT that it calls for + // a roll-call vote: that is, all votes are announced and logged. + int call_for_roll (string str) { + + string timestr, subjstr ; + int i ; + + if ( mc != this_player()->GetKeyName() ) { + write ("Only the mc may call for votes.\n") ; + return 1 ; + } + if (!str) { + write ("Usage: rollcall <num> <minutes|seconds> <subject>\n") ; + return 1 ; + } + if (sscanf(str,"%d %s %s",i,timestr,subjstr)!=3) { + write ("Usage: rollcall <num> <minutes|seconds> <subject>\n") ; + return 1 ; + } + if (endtime!=0) { + write ("The clock is running. You must reset the clock first.\n") ; + return 1 ; + } + if (timestr=="minutes") { + i = i * 60 ; + } else { + if (timestr!="seconds") { + write ("Enter the time in minutes or seconds.\n") ; + return 1 ; + } + } + vote_str = subjstr ; + // This is a roll call vote so we log the votes and announce them. + votelog = 1 ; + write ("You call for a roll call vote on "+vote_str+".\n") ; + say (capitalize(mc)+" calls for a roll call vote on "+vote_str+".\n") ; + say (capitalize(mc)+" sets the clock to "+str+".\n") ; + endtime = time()+i ; + call_out ("expire_vote",i) ; + return 1 ; + } + + // Expire_vote finishes the vote and tabulates the results. It does not + // announce the outcome because some votes required 2/3 or 3/4 to pass + // rather than a simple majority. + int expire_vote() { + tell_room (environment(this_object()), "The clock runs out. Voting is over.\n") ; + endtime = 0 ; + tell_room (environment(this_object()), "The results of the vote were:\n"+ + "Yes: "+votes["yes"]+" No: "+votes["no"]+" Abstain: "+ + votes["abstain"]+"\n") ; + voters = ({ }) ; + votes["yes"] = 0 ; + votes["no"] = 0 ; + votes["abstain"] = 0 ; + vote_str="none" ; + } + + int localupdate() { + write ("You may not update objects while in the conference room.\n") ; + return 1 ; + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/pwatch.c ds2.0r27/lib/domains/campus/obj/pwatch.c *** ds1.1/lib/domains/campus/obj/pwatch.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/pwatch.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,49 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + #include <localtime.h> + inherit LIB_ARMOR; + + string l_time; + string l_time,tzone; + static void create(){ + armor::create(); + SetKeyName("pocket watch"); + SetId(({"watch","pocketwatch","pocket watch","timepiece"})); + SetShort("a gold pocket watch"); + SetLong("This is a beautifully decorated and intricately carved "+ + "pocket watch made of gold. It glows with an almost surreal, deep golden "+ + "luster. It is quietly ticking the seconds, and it looks like you can get the "+ + "accurate time by checking the watch."); + SetMass(10); + SetDollarCost(1); + SetProtection(BLUNT,1); + SetProtection(BLADE,1); + SetProtection(KNIFE,1); + SetArmorType(A_AMULET); + } + void init(){ + ::init(); + add_action("check_time","check"); + add_action("pre_check","time"); + } + int pre_check(string str){ + if(!str){ + this_object()->check_time("time"); + return 1; + } + } + int check_time(string str){ + if(str=="time" || str=="watch"){ + if(present("pocket watch",this_player())){ + tzone="/daemon/timezone"->GetTZ(); + l_time="/daemon/current_time"->GetCurrentTime(tzone); + write("Checking the pocket watch, you see it is "+l_time+".\n"); + say(this_player()->GetName()+" checks "+possessive(this_player())+ + " pocket watch.\n"); + return 1; + } + write("You cannot read the watch face from here.\n"); + return 1; + } + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/rayovac.c ds2.0r27/lib/domains/campus/obj/rayovac.c *** ds1.1/lib/domains/campus/obj/rayovac.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/rayovac.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,28 ---- + #include <lib.h> + #include <vendor_types.h> + inherit "/lib/flashlight"; + + + void create(){ + ::create(); + SetKeyName("flashlight"); + SetId( ({"fl","flashlight","light","torch","flashlite"}) ); + SetAdjectives( ({"plastic","small","cheap","rayovac","Rayovac"}) ); + SetShort( "a small, plastic flashlight" ); + SetLong("This is a cheap Rayovac brand flashlight."); + SetMass(20); + SetDollarCost(10); + SetLightLevel(6); + SetMinCells(2); + SetMaxCells(2); + SetCellType("D"); + Lit=0; + SetVendorType(VT_TREASURE); + SetInventory(([ + "/domains/campus/obj/dcell_crappy":2 + ])); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/redbox.c ds2.0r27/lib/domains/campus/obj/redbox.c *** ds1.1/lib/domains/campus/obj/redbox.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/redbox.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,28 ---- + /* /domains/Examples/etc/bag.c + * from the Nightmare IV LPC Library + * a sample bag object + * created by Descartes of Borg 950529 + */ + + #include <lib.h> + + inherit LIB_STORAGE; + + void create() { + ::create(); + SetKeyName("redbox"); + SetId( ({ "box","redbox","rbox" }) ); + SetAdjectives( ({ "small", "plastic","red", "a" }) ); + SetShort("a small, %^RED%^red%^RESET%^ plastic box"); + SetLong("It is a simple plastic box used to hold things. It is %^RED%^red%^RESET%^, and it has a cute Virtual Campus "+ + "logo on it."); + SetMass(274); + SetDollarCost(1); + SetMaxCarry(100); + SetCanClose(1); + SetClosed(0); + // SetPreventPut("You cannot put this in there!"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/round.c ds2.0r27/lib/domains/campus/obj/round.c *** ds1.1/lib/domains/campus/obj/round.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/round.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + #include <vendor_types.h> + inherit "/lib/round"; + + void create(){ + ::create(); + SetKeyName("357round"); + SetId(({"round","bullet"})); + SetAdjectives(({"357",".357","pistol"})); + SetShort("a .357 pistol round"); + SetLong("This is a .357 caliber revolver bullet. It has not been fired."); + SetCaliber(357); + SetPistolType("revolver"); + SetAmmoType("magnum"); + SetVendorType(VT_TREASURE); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/round2.c ds2.0r27/lib/domains/campus/obj/round2.c *** ds1.1/lib/domains/campus/obj/round2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/round2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + #include <vendor_types.h> + inherit "/lib/round"; + + void create(){ + ::create(); + SetKeyName("9mmround"); + SetId(({"round","bullet"})); + SetAdjectives(({"9 millimeter","9mm","pistol"})); + SetShort("a 9 millimeter pistol round"); + SetLong("This is a 9 millimeter pistol bullet. It has not been fired."); + SetMillimeter(9); + SetPistolType("auto"); + SetAmmoType("acp"); + SetVendorType(VT_TREASURE); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/sofa.c ds2.0r27/lib/domains/campus/obj/sofa.c *** ds1.1/lib/domains/campus/obj/sofa.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/sofa.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,27 ---- + /* /domains/campus/etc/stool.c + * From the Nightmare V Object Library + * An example of a chair object + * Created by Descartes of Borg 961221 + */ + + #include <lib.h> + + inherit LIB_CHAIR; + + + static void create() { + chair::create(); + SetKeyName("sofa"); + SetId("sofa"); + SetAdjectives( ({ "black", "small", "tasteful", "upholstered" }) ); + SetShort("a sofa"); + SetLong("This is a small, plush sofa tastefully upholstered "+ + "in black. It appears designed for sitting on."); + SetMass(1500); + SetDollarCost(15); + SetMaxSitters(2); + } + mixed CanGet(object ob) { return "The bench does not budge.";} + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/spam.c ds2.0r27/lib/domains/campus/obj/spam.c *** ds1.1/lib/domains/campus/obj/spam.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/spam.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,74 ---- + #include <lib.h> + #include <vendor_types.h> + #define DIR_TXT "/domains/campus/txt" + inherit LIB_ITEM; + int Spam(string spam); + string SpamSpam(string spamspam); + int SpamSpamSpam(string spamspamspam); + string spam1, spam2; + void create(){ + ::create(); + SetKeyName("spam can"); + SetId(({"spam","can"})); + SetAdjectives(({"can of","can","spam"})); + SetShort("a can of spam"); + SetLong( (: SpamSpam :) ); + SetMass(20); + SetDollarCost(10); + SetVendorType(VT_TREASURE); + } + void init(){ + ::init(); + add_action("SpamSpamSpamSpam","spam"); + } + + string SpamSpam(string spamspam){ + string spamspamspam; + spamspamspam=read_file("/domain/campus/txt/spam.txt"); + return spamspamspam; + } + int SpamSpamSpamSpam(string spam){ + string spamspam; + object ob; + if(!spam || spam == ""){ + this_object()->Spam(); + return 1; + } + if(!sscanf(spam,"%s with %s",spam1,spam2)){ + write("You'd like to spam who with what?"); + say(this_player()->GetName()+" fumbles with "+possessive(this_player())+ + " can of spam.\n"); + return 1; + } + ob=present(spam1,environment(this_player())); + if(!ob){ + write("There is no such thing here to spam!\n"); + say(this_player()->GetName()+" looks around for something to spam.\n"); + return 1; + } + if(!living(ob)){ + write(ob->GetShort()+" is not impressed by spam.\n"); + say(this_player()->GetName()+" spams around foolishly.\n"); + return 1; + } + if(file_size(DIR_TXT+"/"+spam2+".txt") == -1){ + write("You cannot spam "+ob->GetName()+" that way. You look silly.\n"); + say(this_player()->GetName()+" looks silly trying to spam incorrectly.\n"); + return 1; + } + spamspam=unguarded((: read_file(DIR_TXT+"/"+spam2+".txt") :)); + say(this_player()->GetName()+" spams "+ob->GetName()+" with a "+ + "giant "+spam2+".\n"); + tell_object(ob, this_player()->GetName()+" spams you with:\n"+spamspam+"\n"); + write("You spam "+ob->GetName()+" with a giant "+spam2+"!\n"); + return 1; + } + int Spam(string spamspamspamspam){ + string but_I_dont_like_spam; + but_I_dont_like_spam=unguarded((:read_file("/secure/obj/txt/spam.txt") :)); + this_player()->SetLong("$N is a can of spam:\n\n"+but_I_dont_like_spam); + this_player()->AddTitle("the can of spam (Spammy!)"); + write("You spam all over yourself!\n"); + say(this_player()->GetName()+" spams all over "+objective(this_player())+"self!\n"); + return 1; + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/spent.c ds2.0r27/lib/domains/campus/obj/spent.c *** ds1.1/lib/domains/campus/obj/spent.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/spent.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + + void create(){ + ::create(); + SetKeyName("slug"); + SetId( ({"slug","round","bullet","projectile"}) ); + SetAdjectives( ({"spent","lead"}) ); + SetShort("a spent firearms slug"); + SetLong("This small, twisted chunk of metal appears to be a spent "+ + "slug: the part of a bullet that is fired from a gun and enters the target. "+ + "Its shape has been distorted by its impact with whatever it hit."); + SetMass(1); + SetDollarCost(0); + SetVendorType(VT_TREASURE); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/squirtbag.c ds2.0r27/lib/domains/campus/obj/squirtbag.c *** ds1.1/lib/domains/campus/obj/squirtbag.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/squirtbag.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,28 ---- + /* /domains/Examples/etc/bag.c + * from the Nightmare IV LPC Library + * a sample bag object + * created by Descartes of Borg 950529 + */ + + #include <lib.h> + + inherit LIB_STORAGE; + + void create() { + ::create(); + SetKeyName("bag"); + SetId( ({ "bag" }) ); + SetAdjectives( ({ "small", "cloth", "a" }) ); + SetShort("a small cloth bag"); + SetLong("It is a simple cloth bag used to hold things. It has a cute Virtual Campus "+ + "logo on it."); + SetInventory(([ + "/domains/campus/weap/waterpistol" : 1, + ])); + SetMass(10); + SetDollarCost(1); + SetMaxCarry(50); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/stargate.c ds2.0r27/lib/domains/campus/obj/stargate.c *** ds1.1/lib/domains/campus/obj/stargate.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/stargate.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,28 ---- + #include <lib.h> + #include <daemons.h> + #include "/lib/include/stargate.h" + + inherit LIB_STARGATE; + + int ReadScreen(); + + void create() + { + ::create(); + SetOrigin("campus lab", "/domains/campus/room/slab"); + SetRead(([ ({ "screen" }) : (: ReadScreen :) ]) ); + SetItems(([ ({ "screen" }) : "a computer screen which shows the status of the gate network" ]) ); + } + + void init() + { + ::init(); + } + + int ReadScreen() + { + write("stargate network status\n"); + write("-----------------------\n"); + write("\n"); + + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/thing.c ds2.0r27/lib/domains/campus/obj/thing.c *** ds1.1/lib/domains/campus/obj/thing.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/thing.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + + void create(){ + ::create(); + SetKeyName("generic thing"); + SetId( ({"thing","item","thang","dingus"}) ); + SetAdjectives( ({"generic","sample","template"}) ); + SetShort("a generic thing"); + SetLong("This is an object of indeterminate nature and proportions."); + SetMass(20); + SetDollarCost(10); + SetVendorType(VT_TREASURE); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/tlocker.c ds2.0r27/lib/domains/campus/obj/tlocker.c *** ds1.1/lib/domains/campus/obj/tlocker.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/tlocker.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,37 ---- + /* /domains/Examples/etc/bag.c + * from the Nightmare IV LPC Library + * a sample bag object + * created by Descartes of Borg 950529 + */ + + #include <lib.h> + + inherit LIB_STORAGE; + + void create() { + ::create(); + SetKeyName("locker"); + SetId(({"locker"})); + SetAdjectives(({"metal","tall","school"})); + SetShort("a tall metal locker"); + SetLong("This is a large school locker, the kind one might find in any of "+ + "thousands of schools around the world."); + SetMass(3000); + SetDollarCost(50); + SetMaxCarry(500); + SetInventory(([ + "/domains/campus/obj/bag": 1, + "/domains/campus/obj/9mmclip": 1, + "/domains/campus/weap/waterpistol" : 1, + "/domains/campus/obj/223clip": 1 + ])); + SetCanClose(1); + SetClosed(0); + SetCanLock(1); + SetLocked(0); + SetKey("locker_key_1"); + } + mixed CanGet(object ob) { return "The locker does not budge.";} + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/torch.c ds2.0r27/lib/domains/campus/obj/torch.c *** ds1.1/lib/domains/campus/obj/torch.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/torch.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,31 ---- + /* /domains/Praxis/etc/torch.c + * from Nightmare LPMud + * created by Descartes of Borg 951023 + */ + + #include <lib.h> + + inherit LIB_TORCH; + + + static void create() { + torch::create(); + SetKeyName("torch"); + SetId( ({ "torch", "old torch", "wooden torch" }) ); + SetAdjectives( ({ "old", "wooden" }) ); + SetShort("an old, wooden torch"); + SetLong("An old, wooden torch with a bit of cloth wrapped around " + "one end and dipped into a flamable substance."); + SetRadiantLight(7); + SetFuelRequired(1); + SetMaxFuel(1000); + SetFuelAmount(1000); + SetRefuelable(1); + SetMass(50); + SetDollarCost(60); + SetBurntValue(10); + SetClass(10); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/tree.c ds2.0r27/lib/domains/campus/obj/tree.c *** ds1.1/lib/domains/campus/obj/tree.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/tree.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,35 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + inherit LIB_CLIMB; + + + int ClimbMe(); + void create(){ + ::create(); + SetKeyName("tree"); + SetId( ({"tree"}) ); + SetAdjectives( ({"huge","large","big","old","great"}) ); + SetShort("a large tree"); + SetLong("This is a very large tree. It has been around since long "+ + "before the Virtual Campus, and looks like it will be around long "+ + "after, as well."); + SetMass(20000); + SetDollarCost(10); + SetVendorType(VT_TREASURE); + SetClimb( (: ClimbMe :) ,1); + } + void init(){ + ::init(); + } + int ClimbMe(){ + string omsg,imsg,dest; + object who; + //dest="/domains/campus/room/start"; + dest="/domains/campus/room/uptree"; + who=this_player(); + omsg = "$N climbs up " + GetDefiniteShort() + "."; + imsg = "$N comes climbing in."; + who->eventMoveLiving(dest, omsg, imsg); + } + mixed CanGet(object ob) { return "The tree does not budge.";} diff -c -r --new-file ds1.1/lib/domains/campus/obj/watch.c ds2.0r27/lib/domains/campus/obj/watch.c *** ds1.1/lib/domains/campus/obj/watch.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/watch.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,48 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + #include <localtime.h> + inherit LIB_ARMOR; + + string l_time,tzone; + static void create(){ + armor::create(); + SetKeyName("pocket watch"); + SetId(({"watch","pocketwatch","pocket watch","timepiece"})); + SetShort("a pocket watch"); + SetLong("This is a beautifully decorated and intricately carved "+ + "pocket watch. It glows with a bright, polished bronze "+ + "luster. It is quietly ticking the seconds, and it looks like you can get the "+ + "accurate time by checking the watch."); + SetMass(10); + SetBaseCost("silver", 40); + SetProtection(BLUNT,1); + SetProtection(BLADE,1); + SetProtection(KNIFE,1); + SetArmorType(A_AMULET); + } + void init(){ + ::init(); + add_action("check_time","check"); + add_action("pre_check","time"); + } + int pre_check(string str){ + if(!str){ + this_object()->check_time("time"); + return 1; + } + } + int check_time(string str){ + if(str=="time" || str=="watch"){ + if(present("pocket watch",this_player())){ + tzone="/daemon/timezone"->GetTZ(); + l_time="/daemon/current_time"->GetCurrentTime(tzone); + write("Checking the pocket watch, you see it is "+l_time+".\n"); + say(this_player()->GetName()+" checks "+possessive(this_player())+ + " pocket watch.\n"); + return 1; + } + write("You cannot read the watch face from here.\n"); + return 1; + } + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/wlocker.c ds2.0r27/lib/domains/campus/obj/wlocker.c *** ds1.1/lib/domains/campus/obj/wlocker.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/wlocker.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,35 ---- + /* /domains/Examples/etc/bag.c + * from the Nightmare IV LPC Library + * a sample bag object + * created by Descartes of Borg 950529 + */ + + #include <lib.h> + + inherit LIB_STORAGE; + + void create() { + ::create(); + SetKeyName("locker"); + SetId(({"locker"})); + SetAdjectives(({"metal","tall","large","weapon","weapons"})); + SetShort("a metal weapons locker"); + SetLong("This is a large metal locker designed to contain firearms."); + SetMass(3000); + SetDollarCost(50); + SetMaxCarry(500); + SetInventory(([ + "/domains/campus/weap/9mil" : 5, + //"/domains/campus/weap/m16rifle" : 5, + //"/domains/campus/weap/50rifle" : 5, + "/domains/campus/weap/357pistol" : 5, + ])); + SetCanClose(1); + SetClosed(0); + SetCanLock(1); + SetLocked(0); + } + mixed CanGet(object ob) { return "The locker does not budge.";} + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/wound.c ds2.0r27/lib/domains/campus/obj/wound.c *** ds1.1/lib/domains/campus/obj/wound.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/wound.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,58 ---- + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + inherit LIB_ITEM; + void create(){ + ::create(); + SetKeyName("firearms_wound"); + SetId(({"firearms_wound"})); + SetInvis(1); + SetMass(0); + SetDollarCost(0); + SetVendorType(VT_TREASURE); + } + void init(){ + ::init(); + add_action("lookit","look"); + set_heart_beat(20); + } + void lookit(string str){ + if(str == "at wound" || str == "at wounds" || str == "at my wounds" || + str == "at my wound" || str == "at gunshot wound" || str == "at gunshot wounds"){ + if(base_name(this_player()) == base_name(environment()) ){ + write("You have been wounded by gunfire. There "+ + "are "+cardinal(this_player()->GetLead())+" bullet holes "+ + "in your body."); + return; + } + } + } + string GetAffectLong(object ob) { + if(!ob || !living(ob)) return 0; + return ob->GetName() + " is suffering from gunshot wounds."; + } + void heart_beat(){ + int dam,num,tmp; + object ob; + ob=environment(); + if(!living(ob)){ this_object()->eventDestruct(); return; } + num = ob->GetLead(); + + if(!num){ + tmp = ob->GetLead("gunshot_wounds"); + ob->AddLead("gunshot_wounds", -tmp); + tmp = ob->GetLead("rifleshot_wounds"); + ob->AddLead("rifleshot_wounds", -tmp); + this_object()->eventDestruct(); + return; + } + + dam = num*10; + tell_object(ob,"You bleed heavily from your gunshot wounds."); + tell_room(environment(ob), ob->GetName()+ + " bleeds heavily from "+possessive(environment())+" gunshot wounds.",environment()); + ob->eventReceiveDamage(this_object(),TRAUMA,dam,0,"torso"); + return; + } + mixed CanGet(object ob) { return "Your hands slip on the gunshot wounds.";} + mixed CanDrop(object ob) { return "Your hands slip on the gunshot wounds.";} diff -c -r --new-file ds1.1/lib/domains/campus/obj/wrack.c ds2.0r27/lib/domains/campus/obj/wrack.c *** ds1.1/lib/domains/campus/obj/wrack.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/wrack.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,36 ---- + /* /domains/Examples/etc/bag.c + * from the Nightmare IV LPC Library + * a sample bag object + * created by Descartes of Borg 950529 + */ + + #include <lib.h> + + inherit LIB_STORAGE; + + + void create() { + ::create(); + SetKeyName("rack"); + SetId(({"wrack"})); + SetAdjectives(({"wooden","large","weapon","weapons"})); + SetShort("a wooden weapons rack"); + SetLong("This is a large wooden rack designed to contain "+ + "conventional or melee weapons. It is set into the wall."); + SetMass(3000); + SetDollarCost(500); + SetMaxCarry(5000); + SetInventory(([ + "/domains/campus/weap/dagger" : 5, + "/domains/campus/weap/sword" : 5, + "/domains/campus/weap/sharpsword" : 5, + "/domains/campus/weap/staff" : 5, + ])); + SetCanClose(1); + SetClosed(0); + + } + mixed CanGet(object ob) { return "The rack does not budge.";} + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/obj/yellowbox.c ds2.0r27/lib/domains/campus/obj/yellowbox.c *** ds1.1/lib/domains/campus/obj/yellowbox.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/obj/yellowbox.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,28 ---- + /* /domains/Examples/etc/bag.c + * from the Nightmare IV LPC Library + * a sample bag object + * created by Descartes of Borg 950529 + */ + + #include <lib.h> + + inherit LIB_STORAGE; + + void create() { + ::create(); + SetKeyName("yellowbox"); + SetId( ({ "box","yellowbox","ybox" }) ); + SetAdjectives( ({ "small", "plastic","yellow", "a" }) ); + SetShort("a small, %^YELLOW%^yellow%^RESET%^ plastic box"); + SetLong("It is a simple plastic box used to hold things. It is %^YELLOW%^yellow%^RESET%^, and it has a cute Virtual Campus "+ + "logo on it."); + SetMass(274); + SetDollarCost(1); + SetMaxCarry(100); + SetCanClose(1); + SetClosed(0); + // SetPreventPut("You cannot put this in there!"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/access0.c ds2.0r27/lib/domains/campus/room/access0.c *** ds1.1/lib/domains/campus/room/access0.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/access0.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,47 ---- + #include <lib.h> + inherit LIB_ROOM; + inherit "/lib/props/ambiance"; + + int eventHopDown(){ + write("You hop down into the hole, noting that there is no ladder for getting back up."); + say(this_player()->GetName()+" hops into the open manhole.",this_player()); + return 1; + } + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(16); + SetShort("access tunnel"); + SetLong("You are standing in what appears to be an underground "+ + "service access tunnel of some kind. The overhead neon lights flicker and "+ + "provide barely useful illumination. The air is damp and musty, and it "+ + "feels as though nobody has gone through here in years. The tunnel runs "+ + "south from here. This appears to be the north end of the tunnel. There "+ + "is a large, open manhole in the floor here."); + SetItems(([ + ({"wall","walls","corridor","hall"}) : "The thick, metal walls here are scarred "+ + "and badly corroded. Wherever you are, it's seen heavy use in the distant past.", + ({"lights","light","neon lights"}) : "Overhead neon lights. They appear on the "+ + "verge of failure.", + ({"floor","ground"}) : "The floor is composed of metal plates welded together, "+ + "with raised traction cleats.", + ({"cleat","cleats"}) : "Little raised bumps on the floor so you won't slip and fall.", + ({"ladder","metal ladder"}) : "You see rusted bolts in the concrete floor and in "+ + "the hole that suggest a ladder was once here.", + ({"hole","manhole"}) : "This is an opening built into the floor for access to "+ + "whatever it is that lies below. It looks like there was once a metal ladder for easy "+ + "movement, but it's now gone, so any trip down is one-way.", + ])); + AddExit("down","/domains/campus/room/sewer1", (: eventHopDown :) ); + AddExit("south","/domains/campus/room/access4"); + } + int CanReceive(object ob){ + if(ob && ob->GetRace() == "rodent"){ + message("info","You are repelled by rodenticide.",ob); + return 0; + } + return 1; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/access1.c ds2.0r27/lib/domains/campus/room/access1.c *** ds1.1/lib/domains/campus/room/access1.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/access1.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,27 ---- + #include <lib.h> + inherit LIB_ROOM; + inherit "/lib/props/ambiance"; + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(16); + SetShort("access tunnel"); + SetLong("You are standing in what appears to be an underground "+ + "service access tunnel of some kind. The overhead neon lights flicker and "+ + "provide barely useful illumination. The air is damp and musty, and it "+ + "feels as though nobody has gone through here in years. The tunnel runs "+ + "north and south from here. You feel a slight breeze coming from the "+ + "north."); + SetItems(([ + ({"wall","walls","corridor","hall"}) : "The thick, metal walls here are scarred "+ + "and badly corroded. Wherever you are, it's seen heavy use in the distant past.", + ({"lights","light","neon lights"}) : "Overhead neon lights. They appear on the "+ + "verge of failure.", + ({"floor","ground"}) : "The floor is composed of metal plates welded together, "+ + "with raised traction cleats.", + ({"cleat","cleats"}) : "Little raised bumps on the floor so you won't slip and fall.", + ])); + AddExit("north","/domains/campus/room/access0"); + AddExit("south","/domains/campus/room/access2"); + SetObviousExits("n,s"); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/access2.c ds2.0r27/lib/domains/campus/room/access2.c *** ds1.1/lib/domains/campus/room/access2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/access2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,34 ---- + #include <lib.h> + inherit LIB_ROOM; + inherit "/lib/props/ambiance"; + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(16); + SetShort("access tunnel"); + SetLong("You are standing in what appears to be an underground "+ + "service access tunnel of some kind. The overhead neon lights flicker and "+ + "provide barely useful illumination. The air is damp and musty, and it "+ + "feels as though nobody has gone through here in years. The tunnel runs "+ + "north and south from here."); + //\n%^GREEN%^There is a small sign "+ + //"you can read, posted over a porthole set in the wall."); + SetItems(([ + ({"wall","walls","corridor","hall"}) : "The thick, metal walls here are scarred "+ + "and badly corroded. Wherever you are, it's seen heavy use in the distant past.", + ({"lights","light","neon lights"}) : "Overhead neon lights. They appear on the "+ + "verge of failure.", + ({"floor","ground"}) : "The floor is composed of metal plates welded together, "+ + "with raised traction cleats.", + ({"cleat","cleats"}) : "Little raised bumps on the floor so you won't slip and fall.", + ({"hole","port","porthole","access port"}) : "An exit set in the wall, providing maintenance access.", + ({"sign"}) : "A small, stenciled sign with writing on it.", + ])); + SetRead("sign","Campus domain special room access port: FURNACE"); + SetEnters( ([ + ({"hole","port","porthole","access port"}):"/domains/campus/room/furnace" + ]) ); + AddExit("north","/domains/campus/room/access1"); + AddExit("south","/domains/campus/room/access3"); + SetObviousExits("n,s"); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/access3.c ds2.0r27/lib/domains/campus/room/access3.c *** ds1.1/lib/domains/campus/room/access3.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/access3.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,34 ---- + #include <lib.h> + inherit LIB_ROOM; + inherit "/lib/props/ambiance"; + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(16); + SetShort("access tunnel"); + SetLong("You are standing in what appears to be an underground "+ + "service access tunnel of some kind. The overhead neon lights flicker and "+ + "provide barely useful illumination. The air is damp and musty, and it "+ + "feels as though nobody has gone through here in years. The tunnel runs "+ + "north and south from here."); + //\n%^GREEN%^There is a small sign "+ + // "you can read, posted over a porthole set in the wall."); + SetItems(([ + ({"wall","walls","corridor","hall"}) : "The thick, metal walls here are scarred "+ + "and badly corroded. Wherever you are, it's seen heavy use in the distant past.", + ({"lights","light","neon lights"}) : "Overhead neon lights. They appear on the "+ + "verge of failure.", + ({"floor","ground"}) : "The floor is composed of metal plates welded together, "+ + "with raised traction cleats.", + ({"cleat","cleats"}) : "Little raised bumps on the floor so you won't slip and fall.", + ({"hole","port","porthole","access port"}) : "An exit set in the wall, providing maintenance access.", + ({"sign"}) : "A small, stenciled sign with writing on it.", + ])); + SetRead("sign","Campus domain special room access port: FREEZER"); + SetEnters( ([ + ({"hole","port","porthole","access port"}):"/domains/campus/room/freezer" + ]) ); + AddExit("north","/domains/campus/room/access0"); + AddExit("south","/domains/campus/room/access4"); + SetObviousExits("n,s"); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/access4.c ds2.0r27/lib/domains/campus/room/access4.c *** ds1.1/lib/domains/campus/room/access4.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/access4.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,36 ---- + #include <lib.h> + inherit LIB_ROOM; + inherit "/lib/props/ambiance"; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(16); + SetShort("access tunnel"); + SetLong("You are standing in what appears to be an underground "+ + "service access tunnel of some kind. The overhead neon lights flicker and "+ + "provide barely useful illumination. The air is damp and musty, and it "+ + "feels as though nobody has gone through here in years. The tunnel runs "+ + "north and south from here."); + //\n%^GREEN%^There is a small sign "+ + // "you can read, posted over a porthole set in the wall."); + SetItems(([ + ({"wall","walls","corridor","hall"}) : "The thick, metal walls here are scarred "+ + "and badly corroded. Wherever you are, it's seen heavy use in the distant past.", + ({"lights","light","neon lights"}) : "Overhead neon lights. They appear on the "+ + "verge of failure.", + ({"floor","ground"}) : "The floor is composed of metal plates welded together, "+ + "with raised traction cleats.", + ({"cleat","cleats"}) : "Little raised bumps on the floor so you won't slip and fall.", + ({"hole","port","porthole","access port"}) : "An exit set in the wall, providing maintenance access.", + ({"sign"}) : "A small, stenciled sign with writing on it.", + ])); + SetEnters( ([ + ]) ); + SetRead("sign","Campus domain special room access port: VOID"); + AddExit("north","/domains/campus/room/access0"); + AddExit("south","/domains/campus/room/access5"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/access5.c ds2.0r27/lib/domains/campus/room/access5.c *** ds1.1/lib/domains/campus/room/access5.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/access5.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,44 ---- + #include <lib.h> + inherit LIB_ROOM; + inherit "/lib/props/ambiance"; + + static void create() { + object ob; + room::create(); + SetClimate("indoors"); + SetAmbientLight(16); + SetShort("access tunnel"); + SetLong("You are standing in what appears to be an underground "+ + "service access tunnel of some kind. The overhead neon lights flicker and "+ + "provide barely useful illumination. The air is damp and musty, and it "+ + "feels as though nobody has gone through here in years. The tunnel runs "+ + "north and south from here."); + //\n%^GREEN%^There is a small sign "+ + // "you can read, posted over a porthole set in the wall."); + SetItems(([ + ({"wall","walls","corridor","hall"}) : "The thick, metal walls here are scarred "+ + "and badly corroded. Wherever you are, it's seen heavy use in the distant past.", + ({"lights","light","neon lights"}) : "Overhead neon lights. They appear on the "+ + "verge of failure.", + ({"floor","ground"}) : "The floor is composed of metal plates welded together, "+ + "with raised traction cleats.", + ({"cleat","cleats"}) : "Little raised bumps on the floor so you won't slip and fall.", + ({"hole","port","porthole","access port"}) : "An exit set in the wall, providing maintenance access.", + ({"sign"}) : "A small, stenciled sign with writing on it.", + ])); + SetEnters( ([ + ]) ); + SetRead("sign","Campus domain special room access port: JAILCELL 1"); + AddExit("north","/domains/campus/room/access4"); + AddExit("south","/domains/campus/room/access6"); + SetInventory(([ + "/domains/campus/npc/rat" :1 + ])); + ob=new("/domains/campus/npc/rat"); + ob->SetMaxHealthPoints(4); + ob->eventMove(this_object()); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/access6.c ds2.0r27/lib/domains/campus/room/access6.c *** ds1.1/lib/domains/campus/room/access6.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/access6.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,36 ---- + #include <lib.h> + inherit LIB_ROOM; + inherit "/lib/props/ambiance"; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(16); + SetShort("access tunnel"); + SetLong("You are standing in what appears to be an underground "+ + "service access tunnel of some kind. The overhead neon lights flicker and "+ + "provide barely useful illumination. The air is damp and musty, and it "+ + "feels as though nobody has gone through here in years. The tunnel runs "+ + "north and south from here."); + //\n%^GREEN%^There is a small sign "+ + // "you can read, posted over a porthole set in the wall."); + SetItems(([ + ({"wall","walls","corridor","hall"}) : "The thick, metal walls here are scarred "+ + "and badly corroded. Wherever you are, it's seen heavy use in the distant past.", + ({"lights","light","neon lights"}) : "Overhead neon lights. They appear on the "+ + "verge of failure.", + ({"floor","ground"}) : "The floor is composed of metal plates welded together, "+ + "with raised traction cleats.", + ({"cleat","cleats"}) : "Little raised bumps on the floor so you won't slip and fall.", + ({"hole","port","porthole","access port"}) : "An exit set in the wall, providing maintenance access.", + ({"sign"}) : "A small, stenciled sign with writing on it.", + ])); + SetEnters( ([ + ]) ); + SetRead("sign","Campus domain special room access port: BLANK ROOM"); + AddExit("north","/domains/campus/room/access5"); + AddExit("south","/domains/campus/room/access7"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/access7.c ds2.0r27/lib/domains/campus/room/access7.c *** ds1.1/lib/domains/campus/room/access7.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/access7.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,37 ---- + #include <lib.h> + inherit LIB_ROOM; + inherit "/lib/props/ambiance"; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(16); + SetShort("access tunnel"); + SetLong("You are standing in what appears to be an underground "+ + "service access tunnel of some kind. The overhead neon lights flicker and "+ + "provide barely useful illumination. The air is damp and musty, and it "+ + "feels as though nobody has gone through here in years. The tunnel runs "+ + "north and south from here."); + //\n%^GREEN%^There is a small sign "+ + // "you can read, posted over a porthole set in the wall."); + SetItems(([ + ({"wall","walls","corridor","hall"}) : "The thick, metal walls here are scarred "+ + "and badly corroded. Wherever you are, it's seen heavy use in the distant past.", + ({"lights","light","neon lights"}) : "Overhead neon lights. They appear on the "+ + "verge of failure.", + ({"floor","ground"}) : "The floor is composed of metal plates welded together, "+ + "with raised traction cleats.", + ({"cleat","cleats"}) : "Little raised bumps on the floor so you won't slip and fall.", + ({"hole","port","porthole","access port"}) : "An exit set in the wall, providing maintenance access.", + ({"sign"}) : "A small, stenciled sign with writing on it.", + ])); + SetEnters( ([ + ]) ); + SetRead("sign","Campus domain special room access port: INCEPT POD"); + AddExit("north","/domains/campus/room/access6"); + AddExit("south","/domains/campus/room/access9"); + AddExit("west","/domains/campus/room/tunnel2"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/access9.c ds2.0r27/lib/domains/campus/room/access9.c *** ds1.1/lib/domains/campus/room/access9.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/access9.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,39 ---- + #include <lib.h> + inherit LIB_ROOM; + inherit "/lib/props/ambiance"; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(16); + SetShort("access tunnel"); + SetLong("You are standing in what appears to be an underground service access tunnel of some kind. The overhead neon lights flicker and provide barely useful illumination. The air is damp and musty, and it feels as though nobody has gone through here in years. The tunnel runs north from here."); + //"\n%^GREEN%^There is a small sign "+ + // "you can read, posted over a porthole set in the wall."); + SetItems(([ + ({"wall","walls","corridor","hall"}) : "The thick, metal walls here are scarred "+ + "and badly corroded. Wherever you are, it's seen heavy use in the distant past.", + ({"lights","light","neon lights"}) : "Overhead neon lights. They appear on the "+ + "verge of failure.", + ({"floor","ground"}) : "The floor is composed of metal plates welded together, "+ + "with raised traction cleats.", + ({"cleat","cleats"}) : "Little raised bumps on the floor so you won't slip and fall.", + ({"field","force field"}) : "A sheet-like, multicolored expression of energy.", + ({"doorway","shimmering doorway"}) : "It looks like a force field restricts further "+ + "movement south.", + ({"hole","port","porthole","access port"}) : "An exit set in the wall, providing maintenance access.", + ({"sign"}) : "A small, stenciled sign with writing on it.", + ])); + SetEnters( ([ + ]) ); + SetInventory(([ + "/domains/campus/obj/labkey" : 1, + ])); + SetExits( ([ + "north" : "/domains/campus/room/access7", + ]) ); + SetRead("sign","Campus domain special room access port: DEATH"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/basement.c ds2.0r27/lib/domains/campus/room/basement.c *** ds1.1/lib/domains/campus/room/basement.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/basement.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,35 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("the basement"); + SetLong("You are in the basement of the LPC University administrative building. It "+ + "is very dark here, and rather damp. The fluorescent lighting seems to be "+ + "on the verge of total failure, with only one or two flickering on and off enough "+ + "to see anything. The air here is damp, thick and musty. There is a small crawlspace you can enter under "+ + "the stairs here, and the basement continues east into darkness."); + SetItems(([ + "stairs" : "A flight of stairs leading up. There is a crawlspace beneath them.", + "basement" : "This is a dark, creepy basement.", + "building" : "You are in the basement of the LPC University administrative building.", + ({"dark","darkness"}) : "There's a lot of it, all around.", + ({"light","lighting","fluorescent lighting"}) : "The lighting here is extremely bad. "+ + "The lights show just enough to let you know you'd rather not spend too "+ + "much time in here.", + "air" : "It feels heavy, making it hard to breathe. It's hard to imagine "+ + "who or what would enjoy spending time down here.", + "crawlspace" : "It looks like you might be able to enter the crawlspace, if you "+ + "really wanted to."])); + SetObviousExits("e, u"); + SetInventory((["/domains/campus/npc/rat" : 1])); + AddExit("up","/domains/campus/room/stairwell"); + AddExit("east","/domains/campus/room/basement2"); + AddEnter("crawlspace" , "/domains/campus/room/crawlspace"); + SetProperty("no attack", 1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/basement2.c ds2.0r27/lib/domains/campus/room/basement2.c *** ds1.1/lib/domains/campus/room/basement2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/basement2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,42 ---- + #include <lib.h> + inherit LIB_ROOM; + int push_it(string str){ + if(str=="wall" || str=="east wall"){ + write("The east wall opens and you fall through!\n"); + say(this_player()->GetName()+" suddenly falls and is gone!\n"); + this_player()->eventMoveLiving("/domains/campus/room/tunnel", "east through a secret exit", this_player()->GetName()+" tumbles in."); + return 1; + } + } + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(5); + SetShort("the basement"); + SetLong("You are in the basement of the LPC University administrative building. It "+ + "is very dark here, and rather damp. The fluorescent lighting seems to have "+ + "completely failed. The west side "+ + "of the basement seems somewhat better lit. The east wall seems heavily "+ + "smudged...it's even grungier than the rest of this place."); + SetItems(([ + "basement" : "This is a dark, creepy basement.", + "building" : "You are in the basement of the LPC University administrative building.", + ({"wall","east wall"}) : "The wall seems to have a lot of smudged handprints "+ + "on it.", + ({"dark","darkness"}) : "There's a lot of it, all around.", + ({"light","lighting","fluorescent lighting"}) : "The lighting here has failed "+ + "completely.", + ({"prints","print","handprint","handprints"}) : "Smudgy handprints, as if someone "+ + "had been against the wall here.", + "air" : "It feels heavy, making it hard to breathe. It's hard to imagine "+ + "who or what would enjoy spending time down here."])); + AddExit("west","/domains/campus/room/basement"); + SetObviousExits("w"); + SetProperty("no attack", 1); + } + void init(){ + add_action("push_it","push"); + add_action("push_it","search"); + add_action("push_it","touch"); + add_action("push_it","open"); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/blue_room.c ds2.0r27/lib/domains/campus/room/blue_room.c *** ds1.1/lib/domains/campus/room/blue_room.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/blue_room.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("a blue room"); + SetLong("This is a blue room. Probability Lab 1 is south."); + SetExits( ([ + "south" : "/domains/campus/room/monty" + ]) ); + SetDoor("south","/domains/campus/doors/blue_door"); + SetObviousExits("s"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/blue_room2.c ds2.0r27/lib/domains/campus/room/blue_room2.c *** ds1.1/lib/domains/campus/room/blue_room2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/blue_room2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("a blue room"); + SetLong("This is a blue room. Probability Lab 2 is east."); + SetExits( ([ + "east" : "/domains/campus/room/plab2" + ]) ); + SetDoor("east","/domains/campus/doors/blue_door2"); + SetObviousExits("e"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/blue_room3.c ds2.0r27/lib/domains/campus/room/blue_room3.c *** ds1.1/lib/domains/campus/room/blue_room3.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/blue_room3.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("a blue room"); + SetLong("This is a blue room. Probability Lab 3 is west."); + SetExits( ([ + "west" : "/domains/campus/room/plab" + ]) ); + SetDoor("west","/domains/campus/doors/blue_door3"); + SetObviousExits("w"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/bookstore.c ds2.0r27/lib/domains/campus/room/bookstore.c *** ds1.1/lib/domains/campus/room/bookstore.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/bookstore.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,52 ---- + #include <lib.h> + inherit LIB_SHOP; + int read_sign(); + static void create() { + ::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("the campus bookstore"); + SetLong("This is the Virtual Campus Bookstore. It is a fairly small place, "+ + "and in fact has no books available, since the campus is not open for classes as of yet. "+ + "There is, however, a wide assortment of useful items available, which you can "+ + "browse by typing the \"list\" command. There is a register on the counter, and a "+ + "sign on the wall behind it."); + SetItems(([ + ({"store","bookstore"}) : "This is the Virtual Campus bookstore.", + ({"store","bookstore","place"}) : "This is the Virtual Campus bookstore.", + "books" : "There aren't any yet. Weren't you paying attention?", + ({"assortment","items","stuff"}) : "To browse what you can buy, type: list.", + "register" : "A device to facilitate the organized collection of your money. A bit "+ + "large and intimidating, actually.", + "counter" : "A cheap wood-textured counter designed to make the surrender "+ + "of your money more convenient.", + "sign" : "A sign on the wall, meant for reading.", + ])); + SetRead("sign", (: read_sign :) ); + SetExits((["south" : "/domains/campus/room/corridor4" + ])); + SetObviousExits("s"); + SetProperty("no attack", 1); + SetInventory(([ + "/domains/campus/obj/bbucket" :1, + "/domains/campus/npc/kim" :1 + ]) ); + } + + void init(){ + ::init(); + if(!present("bookstore employee",this_object())){ + new("/domains/campus/npc/kim")->eventMove(this_object()); + } + } + int read_sign(){ + //this_player()->eventPrint("Cash only, U.S. dollars. No exceptions!\n"); + write("HOW TO CONDUCT BUSINESS HERE\n"); + write("list : Get a list of all the items Kim has for sale"); + write("appraise <item> : Ask Kim to tell you how much she would pay you for your item"); + write("price <item> : Ask Kim the price of her item"); + write("show <item> : Ask Kim for a closer look at her item\n"); + write("\nbuy <item> from kim\nsell <item> to kim\n"); + write("Cash US Dollars only!"); + return 1; + } diff -c -r --new-file ds1.1/lib/domains/campus/room/bookstore2.c ds2.0r27/lib/domains/campus/room/bookstore2.c *** ds1.1/lib/domains/campus/room/bookstore2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/bookstore2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetAmbientLight(30); + SetClimate("indoors"); + SetShort("a generic room"); + SetLong("This is an utterly plain, blank room."); + SetInventory(([ + "/domains/default/obj/handbook" : 5, + "/domains/campus/obj/bag" : 3, + "/domains/campus/obj/pack" : 30, + "/domains/default/obj/manual" : 5, + "/domains/default/obj/guide" : 5, + ])); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/conf.c ds2.0r27/lib/domains/campus/room/conf.c *** ds1.1/lib/domains/campus/room/conf.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/conf.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,52 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(50); + SetShort("Conference Room"); + SetLong("This is the Virtual Campus ad hoc conference room. It is "+ + "elegantly appointed with richly carved mahogany paneling and gold-leaf trim. "+ + "The luxurious carpeting and moody lighting make this conference room "+ + "a very comfortable, relaxing environment. The main hallway is north of here."); + SetItems(([ + ({"panels","paneling","wall","walls","mahogany","wood"}) : "The walls are "+ + "paneled in rich, dark mahogany. The wood is intricately carved with "+ + "exquisite designs. This sort of craftmanship must have cost a fortune.", + ({"room","conference room","ad hoc conference room"}) : "This is a "+ + "well-appointed, comfortable room to hold meetings in.", + ({"ad","hoc","ad hoc"}) : "Perhaps you should invest in a dictionary.", + ({"carving","carvings","design","designs","craftmanship"}) : "The carvings "+ + "are mostly abstract shapes that seem so detailed and tightly interwoven "+ + "they almost squirm before your eyes.", + ({"leaf","gold-leaf trim","trim","gold leaf trim"}) : "The trim along the walls' "+ + "baseboards and doorframe is a beautiful gold leaf design.", + ({"floor","carpet","carpeting","luxurious carpeting"}) : "The carpet is thick, and "+ + "a rich maroon color.", + ({"lighting","lights","moody lighting"}) : "The lighting here is indirect and diffused, "+ + "giving everything a warm glow.", + "environment" : "Very comfortable indeed.", + ])); + SetExits( (["north" : "/domains/campus/room/corridor4", + ])); + SetObviousExits("n"); + SetInventory((["/domains/campus/obj/podium" : 1, + ])); + SetProperty("no attack", 1); + } + int CanReceive(object ob) { + if(ob && living(ob)){ + if(file_name(environment(ob)) != "/domains/campus/room/corridor4" + && !archp(ob)){ + message("info","You must enter the conference room through the normal "+ + "entrance, like everyone else.",ob); + return 0; + } + return 1; + } + return 1; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/conf2.c ds2.0r27/lib/domains/campus/room/conf2.c *** ds1.1/lib/domains/campus/room/conf2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/conf2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,128 ---- + #include <lib.h> + #include <rooms.h> + + inherit LIB_ROOM; + + int privacy, timer; + string ExtraDesc(); + static void create() { + string privs; + privs = query_privs(); + if( privs ) privs = capitalize(privs); + else privs = "a creator"; + room::create(); + SetClimate("indoors"); + SetAmbientLight(40); + SetShort("Conference Room"); + SetLong((: ExtraDesc :)); + SetExits( ([ + ]) ); + SetInventory(([ + "/domains/town/obj/bbucket" : 1, + "/domains/town/obj/chair" : 4, + "/domains/campus/obj/podium" : 1, + ])); + + SetProperties(([ + "no attack" : 1, + "nopeer" : 1, + ])); + privacy=0; + set_heart_beat(20); + timer = 0; + + } + + int AutoDeactivate(){ + message("info","%^RED%^The privacy field shuts off.%^RESET%^", this_object()); + timer = 0; + privacy = 0; + return 1; + } + + void init(){ + ::init(); + // add_action("privacy","privacy"); + // add_action("privacy","priv"); + add_action("report_time","timer"); + } + + void heart_beat(){ + if(timer && (time() - timer ) > 1200) AutoDeactivate(); + } + + int report_time(){ + int secs = time() - timer; + //tc("time: "+time()); + //tc("timer: "+timer); + + if(!timer){ + write("Privacy field is not active."); + return 1; + } + + write("Elapsed seconds: "+secs); + write("Elapsed minutes: "+(secs/60)); + return secs; + } + + int CanReceive(object ob) { + if(privacy){ + if(!interactive(ob)) { + message("info","\n\nPRIVACY WARNING: "+ob->GetName()+" has entered the room.\n\n",this_object() ); + } + else if(!archp(ob)){ + message("info","You bounce off the conference room privacy shield.", ob); + message("info",ob->GetName()+" bounced off the privacy shield.",this_object()); + if(!environment(ob)) ob->eventMoveLiving(ROOM_START); + return 0; + } + + } + return 1; + } + + int set_privacy(int i){ + if(environment(this_player()) != this_object() && !archp(this_player())) { + write("You lack the adequate privileges to do that."); + say(this_player()->GetName()+" is trying to mess around with the privacy shield system."); + return 1; + } + privacy=i; + timer = time(); + return 1; + } + /* + int privacy(string str){ + if(environment(this_player()) != this_object() && !archp(this_player())) { + write("You lack the adequate privileges to do that."); + say(this_player()->GetName()+" is trying to muck around with the privacy shield system."); + return 1; + } + + if(str=="on" || str == "1"){ + this_object()->set_privacy(1); + write("You enable the privacy shield.\n"); + say(this_player()->GetName()+" enables a privacy force field around the room."); + timer = time(); + return 1; + } + if(str=="off" || str == "0"){ + this_object()->set_privacy(0); + write("You disable the privacy shield.\n"); + say(this_player()->GetName()+" disables a privacy force field around the room."); + timer = 0; + return 1; + } + } + */ + int get_privacy(){ + return privacy; + } + + string ExtraDesc(){ + string extra = "%^YELLOW%^A privacy force field is active around this room.%^RESET%^"; + string desc = "This is an enchanted room, with the magical power to prevent uninvited people from entering. It is used for meetings where three or more people need to share information without interruption or privately. To enable privacy, 'privacy on'. To disable it, 'privacy off'. The privacy field automatically deactivates after approximately 20 minutes.\n"; + if(privacy) return desc+extra; + else return desc+"%^RED%^The privacy field is DISABLED."; + } diff -c -r --new-file ds1.1/lib/domains/campus/room/corridor.c ds2.0r27/lib/domains/campus/room/corridor.c *** ds1.1/lib/domains/campus/room/corridor.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/corridor.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,34 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Corridor"); + SetLong("You are in an east-west corridor on the first " + "floor of the Virtual Campus administrative building. " + "There is a door south of here, leading into the " + "Admissions office. The building's snack bar lies to the north."); + SetItems( (["corridor" : "This is a carpeted corridor, leading west.", + "floor" : "The carpet is purple, and somewhat institutional.", + "carpet" : "The carpet is purple, and somewhat institutional."]) ); + SetExits( ([ + "south" : "/domains/campus/room/start", + "west" : "/domains/campus/room/corridor3", + "north" : "/domains/campus/room/snack", + "east" : "/domains/campus/room/corridor2.c", + ]) ); + SetProperty("no attack", 1); + SetDoor("south", "/domains/campus/doors/plain_door"); + } + int CanReceive(object ob) { + if(ob && ob->GetRace() == "rodent"){ + message("info","You are repelled by rodenticide.",ob); + return 0; + } + return 1; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/corridor2.c ds2.0r27/lib/domains/campus/room/corridor2.c *** ds1.1/lib/domains/campus/room/corridor2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/corridor2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetAmbientLight(30); + SetClimate("indoors"); + SetShort("Corridor, East"); + SetLong("You are in an east-west corridor on the first floor of the Virtual Campus administrative building. The student lounge is south of here."); + SetExits( ([ + "south" : "/domains/campus/room/lounge", + "west" : "/domains/campus/room/corridor", + "east" : "/domains/campus/room/corridor4", + ]) ); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/corridor3.c ds2.0r27/lib/domains/campus/room/corridor3.c *** ds1.1/lib/domains/campus/room/corridor3.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/corridor3.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,34 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Corridor"); + SetLong("You are in an east-west corridor on the first " + "floor of the Virtual Campus administrative building. " + "The campus mail room lies north of here, and a door to the south "+ + "leads into a stairwell. "+ + "A foyer and the building exit lie west of here."); + SetExits( ([ + "north" : "/domains/campus/room/mailroom", + "west" : "/domains/campus/room/foyer", + "south" : "/domains/campus/room/stairwell", + "east" : "/domains/campus/room/corridor" ]) ); + SetItems( (["corridor" : "This is a carpeted corridor, leading west.", + "floor" : "The carpet is purple, and somewhat institutional.", + "carpet" : "The carpet is purple, and somewhat institutional."]) ); + SetDoor("south","/domains/campus/doors/top_stairs"); + SetProperty("no attack", 1); + } + int CanReceive(object ob){ + if(ob && ob->GetRace() == "rodent"){ + message("info","You are repelled by rodenticide.",ob); + return 0; + } + return 1; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/corridor4.c ds2.0r27/lib/domains/campus/room/corridor4.c *** ds1.1/lib/domains/campus/room/corridor4.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/corridor4.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,35 ---- + #include <lib.h> + #include <rooms.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(40); + SetShort("Corridor"); + SetLong("You are in an east-west corridor on the first " + "floor of the Virtual Campus administrative building. " + "North is the campus bookstore, and there is a conference "+ + "room south of here."); + //"room south of here. It seems the bookstore is closed today."); + SetItems( (["corridor" : "This is a carpeted corridor, running east-west.", + "floor" : "The carpet is purple, and somewhat institutional.", + "carpet" : "The carpet is purple, and somewhat institutional."]) ); + SetExits( ([ + "south" : "/domains/campus/room/conf", + "north" : "/domains/campus/room/bookstore", + "west" : "/domains/campus/room/corridor2.c", + ]) ); + SetProperty("no attack", 1); + } + int CanReceive(object ob){ + if(ob && ob->GetRace() == "rodent"){ + message("info","You are repelled by rodenticide.",ob); + if(!environment(ob) && interactive(ob)) ob->eventMove(ROOM_START); + return 0; + } + return 1; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/crawlspace.c ds2.0r27/lib/domains/campus/room/crawlspace.c *** ds1.1/lib/domains/campus/room/crawlspace.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/crawlspace.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,24 ---- + #include <lib.h> + inherit LIB_ROOM; + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("a tiny crawlspace"); + SetLong("You are in a cramped little space beneath the stairs in the "+ + "basement. It is dark, tight, and dirty in here."); + SetItems(([ + ({"crawlspace","space"}) : "You are in the space beneath stairs.", + "basement" : "The basement is just outside the crawlspace.", + "stairs" : "You're under them."])); + SetInventory(([ + "/domains/campus/obj/rayovac" : 1, + ])); + AddExit("out" , "/domains/campus/room/basement"); + SetObviousExits("out"); + SetProperty("no attack", 1); + SetMoney( ([ "dollars" : random(30)+2, ]) ); + } + void reset(){ + ::reset(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/death.c ds2.0r27/lib/domains/campus/room/death.c *** ds1.1/lib/domains/campus/room/death.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/death.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,65 ---- + #include <lib.h> + #include <dirs.h> + #include <rooms.h> + + inherit LIB_ROOM; + + string FunkyPic(); + int CheckChat(); + int StartHeart(object ob); + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("off the mortal coil"); + SetLong( (:FunkyPic:) ); + SetObviousExits("no exit"); + set_heart_beat(10); + SetNoModify(1); + } + + void init(){ + ::init(); + add_action("regenerate","regenerate"); + add_action("wander","wander"); + this_object()->CheckChat(); + } + + string FunkyPic(){ + return read_file("/domains/default/etc/death.txt"); + } + + int regenerate(){ + write("With a great rush of matter and energy, you rematerialize "+ + "into a corporeal state, and find yourself in a familiar place..."); + this_player()->eventRevive(); + this_player()->eventMoveLiving(ROOM_START); + return 1; + } + + int wander(){ + write("There is a strange, hollow vibration all around you, and you "+ + "realize that some force is compelling your ethereal form elsewhere..."+ + "you find yourself in a place that is known to you, yet oddly new."); + this_player()->eventMoveLiving(ROOM_START); + return 1; + } + + void heart_beat(){ + tell_room(this_object(), "A voice whispers: \" You may choose to "+ + "regenerate into a new body here.\""); + return; + } + + + int CanRelease(object ob){ + if(userp(ob) && ob->GetGhost() && environment(ob) == this_object()) { + tell_player(ob,"\n%^RED%^Your undead spirit is recalled and as you leave "+ + "the underworld a new body regenerates around you. "+ + "You live again!%^RESET%^\n"); + ob->eventRevive(); + } + return 1; + } + diff -c -r --new-file ds1.1/lib/domains/campus/room/foyer.c ds2.0r27/lib/domains/campus/room/foyer.c *** ds1.1/lib/domains/campus/room/foyer.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/foyer.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,39 ---- + #include <lib.h> + inherit LIB_ROOM; + + + int readSign() { + this_player()->more("/domains/campus/txt/warning.txt"); + return 1; + } + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(40); + SetShort("Foyer"); + SetLong("This is the west end of the main hallway "+ + "in the Virtual Campus administrative building. The hallway "+ + "continues to the east of here. West is the building exit, to "+ + "the world outside.\n%^GREEN%^There is a large sign on the wall "+ + "you can read.%^RESET%^"); + SetExits( ([ + "west" : "/domains/campus/room/usquare", + "east" : "/domains/campus/room/corridor3" + ]) ); + SetItems( (["corridor" : "This is a carpeted corridor, leading west.", + "floor" : "The carpet is purple, and somewhat institutional.", + "sign":"A large sign on the wall. To read it, 'read sign'.", + "carpet" : "The carpet is purple, and somewhat institutional."]) ); + SetRead("sign", (: readSign :) ); + SetProperty("no attack", 1); + } + int CanReceive(object ob) { + if(ob && ob->GetRace() == "rodent"){ + message("info","You are repelled by rodenticide.",ob); + return 0; + } + return 1; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/freezer.c ds2.0r27/lib/domains/campus/room/freezer.c *** ds1.1/lib/domains/campus/room/freezer.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/freezer.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,37 ---- + #include <lib.h> + #include <config.h> + #include <rooms.h> + + inherit LIB_ROOM; + + static private object *Old; + + void create() { + room::create(); + SetNoClean(1); + SetProperties(([ "login" : ROOM_START])); + SetShort( "The freezer"); + SetLong( "The local freezer. Go down to leave."); + SetObviousExits("d"); + SetExits( ([ "down" : ROOM_START ]) ); + Old = ({}); + call_out("clean_room", MAX_NET_DEAD_TIME); + SetNoModify(1); + } + + static void clean_room() { + object *clean_me; + object ob; + + foreach(ob in filter(all_inventory(), (: !living($1) :))) + ob->eventDestruct(); + if( !sizeof(filter(all_inventory(), (: living :))) ) { + Old = ({}); + call_out((: clean_room :), MAX_NET_DEAD_TIME); + return; + } + clean_me = (all_inventory() & Old); + Old = all_inventory() - clean_me; + foreach(ob in clean_me) ob->eventDestruct(); + call_out((: clean_room :), MAX_NET_DEAD_TIME); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/furnace.c ds2.0r27/lib/domains/campus/room/furnace.c *** ds1.1/lib/domains/campus/room/furnace.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/furnace.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,36 ---- + #include <lib.h> + #include <rooms.h> + + inherit LIB_ROOM; + + void create() { + room::create(); + SetAmbientLight(30); + SetShort("the furnace"); + SetLong("The furnace. Things that arrive here are "+ + "incinerated. You probably shouldn't be here. Go down to get out."); + SetProperties(([ + "no attack" : 1, + ])); + SetExits( ([ "down" : ROOM_START ]) ); + call_out((: reload_room :), 600, load_object(base_name(this_object()))); + set_heart_beat(1); + SetNoModify(1); + } + int CanReceive(object ob){ + if(ob && interactive(ob)){ + tell_object(ob, "You fail to enter the furnace."); + return 0; + } + return 1; + } + void init(){ + ::init(); + } + void heart_beat(){ + if(sizeof(all_inventory(this_object()))){ + foreach(object ob in deep_inventory(this_object())){ + ob->eventDestruct(); + } + } + } diff -c -r --new-file ds1.1/lib/domains/campus/room/green_room.c ds2.0r27/lib/domains/campus/room/green_room.c *** ds1.1/lib/domains/campus/room/green_room.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/green_room.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("a green room"); + SetLong("This is a green room. Probability Lab 1 is south."); + SetExits( ([ + "south" : "/domains/campus/room/monty" + ]) ); + SetDoor("south","/domains/campus/doors/green_door"); + SetObviousExits("s"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/green_room2.c ds2.0r27/lib/domains/campus/room/green_room2.c *** ds1.1/lib/domains/campus/room/green_room2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/green_room2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("a green room"); + SetLong("This is a green room. Probability Lab 2 is east."); + SetExits( ([ + "east" : "/domains/campus/room/plab2" + ]) ); + SetDoor("east","/domains/campus/doors/green_door2"); + SetObviousExits("e"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/green_room3.c ds2.0r27/lib/domains/campus/room/green_room3.c *** ds1.1/lib/domains/campus/room/green_room3.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/green_room3.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("a green room"); + SetLong("This is a green room. Probability Lab 3 is west."); + SetExits( ([ + "west" : "/domains/campus/room/plab" + ]) ); + SetDoor("west","/domains/campus/doors/green_door3"); + SetObviousExits("w"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/lounge.c ds2.0r27/lib/domains/campus/room/lounge.c *** ds1.1/lib/domains/campus/room/lounge.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/lounge.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,56 ---- + #include <lib.h> + inherit LIB_ROOM; + + void AddStuff(){ + object ob; + ob = new("/lib/bboard"); + ob->SetKeyName("chalkboard"); + ob->SetId( ({ "board", "chalkboard","bulletin board","visitor's board"})); + ob->set_board_id("visitor_board"); + ob->set_max_posts(30); + ob->SetShort("The Visitor's Board"); + ob->SetLong("This is the visitor's bulletin board. Students and visitors use it to "+ + "post messages, comments ans questions about LPC University to each other and "+ + "LPC University creators. Occasionally creators also post hints, suggestions and "+ + "clues. To post something, type: post <message name>. When "+ + "finished writing, enter a single period on a blank line, then at "+ + "the colon prompt (:) type a lower-case x and return. \n"); + ob->eventMove(this_object()); + } + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(40); + SetShort("the student lounge"); + SetLong("This is the LPC University New Main building student lounge. "+ + "It is rather bare at the moment, as the building is still in early stages of "+ + "construction. You see some marks on the floor where furniture is to be "+ + "placed. The main corridor lies north, and a window overlooks the campus "+ + "on the south wall."); + SetItems(([ + ({"here","room","lounge"}) : "This seems to be intended to be a student "+ + "lounge.", + "building" : "You are in New Main, LPC University' main administrative building.", + ({"mark","marks"}) : "Some small chalkmarks and tape strips indicate "+ + "where furniture is to go.", + ({"floor","ground"}) : "Standard off-white linoleum tile floor, in case clumsy students "+ + "plan on eating in here.", + ({"corridor","hall"}) : "The main corridor on the first floor of New Main.", + "window" : "A window set into the south wall, overlooking the campus. Strangely, "+ + "there seems to be nothing outside the window...no campus, no light, no stars...nothing. "+ + "It's as though the administrative building were suspended in a vacuum.", + "campus" : "It seems oddly absent.", + ({"wall","south wall"}) : "A wall with a window in it."])); + SetExits( ([ + "north" : "/domains/campus/room/corridor2.c", + ]) ); + SetInventory(([ + "/domains/town/obj/btable" : 1, + "/domains/campus/obj/locker" : 1, + ])); + SetProperty("no attack", 1); + AddStuff(); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/mailroom.c ds2.0r27/lib/domains/campus/room/mailroom.c *** ds1.1/lib/domains/campus/room/mailroom.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/mailroom.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,77 ---- + #include <lib.h> + #include <objects.h> + #include <post.h> + #include "/lib/include/post_office.h" + + inherit LIB_ROOM; + + static void create(){ + room::create(); + SetTown("campus"); + SetClimate("indoors"); + SetAmbientLight(40); + SetShort("the campus mail room"); + SetLong("This is a small office containing rows of mailboxes and "+ + "various other postal implements. There is a sign on the wall behind the "+ + "counter, outlining instructions for how to mail other users."); + SetItems( ([ + ({"box","boxes","mailboxes","mailbox"}) : "Rows of mailboxes for "+ + "the denizens of LPC University.", + "sign" : "This is a sign on the wall describing how to mail messages.", + ({"wall","walls"}) : "Gray-painted institutional walls of the kind you'd "+ + "expect in a post office.", + "implements" : "Ink, paper, etc.", + "instructions" : "Try reading them.", + "counter" : "A counter folks use to lean on while writing messages." ]) ); + SetObviousExits("s"); + SetExits( ([ + "south" : "/domains/campus/room/corridor3" ]) ); + SetProperty("no attack", 1); + } + void init(){ + ::init(); + add_action("instr","read"); + } + int instr(string str){ + if(str=="instructions"||str=="sign"){ + write("To mail someone, type mail <person's name here>.\n"+ + "Enter a subject line.\n"+ + "Enter your message.\n"+ + "Once you've finished, enter a period (.) on a blank line.\n"+ + "Hit x, then s to send it. You're done!\n"); + return 1; + } + } + mixed CanMail(object who, string args) { + if( who && !interactive(who) ) return 0; + if( GetTown() != (string)who->GetTown() ) + return "Any mail you might have will be at your home post office."; + return 1; + } + mixed eventMail(object who, string args) { + object ob; + + if( !(ob = new(OBJ_POST)) ) { + who->eventPrint("Failed to load postal object!"); + return 1; + } + if( !((int)ob->eventMove(who)) ) { + who->eventPrint("You can't seem to carry the postal object."); + return 1; + } + ob->start_post(args); + return 1; + } + int CanReceive(object ob) { + if( !ob || (living(ob) && !interactive(ob)) ) return 0; + else return room::CanReceive(ob); + } + int eventReleaseObject() { + object ob; + + if(!ob) return 0; + if( !(ob = previous_object()) ) return room::eventReleaseObject(); + if( !room::eventReleaseObject() ) return 0; + if( (ob = present(POSTAL_ID, ob)) ) ob->eventDestruct(); + return 1; + } diff -c -r --new-file ds1.1/lib/domains/campus/room/monty.c ds2.0r27/lib/domains/campus/room/monty.c *** ds1.1/lib/domains/campus/room/monty.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/monty.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,46 ---- + #include <lib.h> + inherit LIB_ROOM; + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Probability Lab 1"); + SetLong("This is a clean, antiseptic lab with " + "gleaming white walls. On the north wall are " + "three doors: " + "one %^RED%^red%^RESET%^, " + "one %^GREEN%^green%^RESET%^, " + "one %^BLUE%^blue%^RESET%^. " + "\n" + "%^GREEN%^There is a large sign on the wall you can read.%^RESET%^"); + SetInventory( ([ + "/domains/campus/obj/pedestal" : 1, + "/domains/campus/npc/charly" : 1 + ]) ); + SetItems( ([ + ({ "wall","walls","north wall"}) : "Shiny, white laboratory walls.", + "red room" : "There's no red room here.", + "green room" : "There's no green room here.", + "blue room" : "There's no blue room here.", + ]) ); + AddItem( ({"sign","sign on the wall"}), "A sign you can read.",({"large"}) ); + + SetExits( ([ + "south" : "/domains/campus/room/wiz_lab" + ]) ); + SetEnters( ([ + "red room" : "/domains/campus/room/red_room", + "green room" : "/domains/campus/room/green_room", + "blue room" : "/domains/campus/room/blue_room" + ]) ); + SetDoor("red room","/domains/campus/doors/red_door"); + SetDoor("green room","/domains/campus/doors/green_door"); + SetDoor("blue room","/domains/campus/doors/blue_door"); + SetObviousExits("s"); + SetNoClean(1); + } + + void init(){ + SetRead(({"sign","sign on the wall"}), "Press the button on " + "the pedestal to reset the experiment."); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/npath.c ds2.0r27/lib/domains/campus/room/npath.c *** ds1.1/lib/domains/campus/room/npath.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/npath.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,28 ---- + #include <lib.h> + inherit LIB_ROOM; + inherit "/lib/props/ambiance"; + + static void create() { + room::create(); + SetClimate("outdoors"); + SetAmbientLight(30); + SetShort("a wide path"); + SetLong("This is a paved path traveling north from University " + "Square. It is lined by thick bushes on each " + "side. The Virtual Campus is south of here. To " + "the north you see what appears to be a town."); + SetItems( ([ + ({ "bush","bushes","side","sides"}) : "Large, thick " + "bushes crowd the sides of the path.", + "path" : "A wide, cobblestone path running north " + "and south.", + "town" : "You can't quite see much of it from here." + ]) ); + + SetExits( ([ "south" : "/domains/campus/room/usquare", + "north" : "/domains/campus/room/npath2", + ]) ); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/npath2.c ds2.0r27/lib/domains/campus/room/npath2.c *** ds1.1/lib/domains/campus/room/npath2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/npath2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,31 ---- + #include <lib.h> + inherit LIB_ROOM; + inherit "/lib/props/ambiance"; + + static void create() { + room::create(); + SetClimate("outdoors"); + SetAmbientLight(30); + SetShort("a wide path"); + SetLong("This is a paved path traveling north and south. It is lined by thick bushes on each side. A town lies north of here. To the south is what appears to be a college campus."); + SetItems( ([ + ({ "bush","bushes","side","sides"}) : "Large, thick " + "bushes crowd the sides of the path.", + "path" : "A wide, cobblestone path running north " + "and south.", + ({ "sign","post","signpost"}) : "A post has been " + "driven into the ground here, and a sign is attached " + "to it.", + "town" : "You can't quite see much of it from here.", + "campus" : "You can't quite see much of it from here." + ]) ); + SetInventory(([ + ])); + SetRead( "sign", "Beware! You are now leaving the safety of the Virtual Campus."); + SetExits( ([ "south" : "/domains/campus/room/npath", + "north" : "/domains/town/room/south_road2", + ]) ); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/plab.c ds2.0r27/lib/domains/campus/room/plab.c *** ds1.1/lib/domains/campus/room/plab.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/plab.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,47 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Probability Lab Three"); + SetLong("This is a clean, antiseptic lab with " + "gleaming white walls. On the east wall are " + "three doors: " + "one %^RED%^red%^RESET%^, " + "one %^GREEN%^green%^RESET%^, " + "one %^BLUE%^blue%^RESET%^. " + "\n" + "%^GREEN%^There is a large sign on the wall you can read.%^RESET%^"); + SetItems( ([ + ({ "wall","walls","north wall"}) : "Shiny, white laboratory walls.", + "red room" : "There's no red room here.", + "green room" : "There's no green room here.", + "blue room" : "There's no blue room here.", + ]) ); + SetInventory(([ + "/domains/campus/obj/pedestal3" : 1, + ])); + SetObviousExits("w"); + SetExits(([ + "west" : "/domains/campus/room/wiz_lab", + ])); + + AddItem( ({"sign","sign on the wall"}), "A sign you can read.",({"large"}) ); + + SetEnters( ([ + "red room" : "/domains/campus/room/red_room3", + "green room" : "/domains/campus/room/green_room3", + "blue room" : "/domains/campus/room/blue_room3" + ]) ); + SetDoor("red room","/domains/campus/doors/red_door3"); + SetDoor("green room","/domains/campus/doors/green_door3"); + SetDoor("blue room","/domains/campus/doors/blue_door3"); + SetNoClean(1); + } + void init(){ + ::init(); + SetRead(({"sign","sign on the wall"}), "Press the button on " + "the pedestal to reset the experiment."); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/plab2.c ds2.0r27/lib/domains/campus/room/plab2.c *** ds1.1/lib/domains/campus/room/plab2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/plab2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,47 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Probability Lab 2"); + SetLong("This is a clean, antiseptic lab with " + "gleaming white walls. On the west wall are " + "three doors: " + "one %^RED%^red%^RESET%^, " + "one %^GREEN%^green%^RESET%^, " + "one %^BLUE%^blue%^RESET%^. " + "\n" + "%^GREEN%^There is a large sign on the wall you can read.%^RESET%^"); + SetItems( ([ + ({ "wall","walls","north wall"}) : "Shiny, white laboratory walls.", + "red room" : "There's no red room here.", + "green room" : "There's no green room here.", + "blue room" : "There's no blue room here.", + ]) ); + SetInventory(([ + "/domains/campus/npc/charles" : 1, + "/domains/campus/obj/pedestal2" : 1, + ])); + AddItem( ({"sign","sign on the wall"}), "A sign you can read.",({"large"}) ); + + SetExits( ([ + "east" : "/domains/campus/room/wiz_lab" + ]) ); + SetEnters( ([ + "red room" : "/domains/campus/room/red_room2", + "green room" : "/domains/campus/room/green_room2", + "blue room" : "/domains/campus/room/blue_room2" + ]) ); + SetDoor("red room","/domains/campus/doors/red_door2"); + SetDoor("green room","/domains/campus/doors/green_door2"); + SetDoor("blue room","/domains/campus/doors/blue_door2"); + SetObviousExits("e"); + SetNoClean(1); + } + void init(){ + ::init(); + SetRead(({"sign","sign on the wall"}), "Press the button on " + "the pedestal to reset the experiment."); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/red_room.c ds2.0r27/lib/domains/campus/room/red_room.c *** ds1.1/lib/domains/campus/room/red_room.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/red_room.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("a red room"); + SetLong("This is a red room. Probability Lab 1 is south."); + SetExits( ([ + "south" : "/domains/campus/room/monty" + ]) ); + SetDoor("south","/domains/campus/doors/red_door"); + SetObviousExits("s"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/red_room2.c ds2.0r27/lib/domains/campus/room/red_room2.c *** ds1.1/lib/domains/campus/room/red_room2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/red_room2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("a red room"); + SetLong("This is a red room. Probability Lab 2 is east."); + SetExits( ([ + "east" : "/domains/campus/room/plab2" + ]) ); + SetDoor("east","/domains/campus/doors/red_door2"); + SetObviousExits("e"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/red_room3.c ds2.0r27/lib/domains/campus/room/red_room3.c *** ds1.1/lib/domains/campus/room/red_room3.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/red_room3.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("a red room"); + SetLong("This is a red room. Probability Lab 3 is west."); + SetExits( ([ + "west" : "/domains/campus/room/plab" + ]) ); + SetDoor("west","/domains/campus/doors/red_door3"); + SetObviousExits("w"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/science.c ds2.0r27/lib/domains/campus/room/science.c *** ds1.1/lib/domains/campus/room/science.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/science.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,10 ---- + #include <lib.h> + inherit LIB_ROOM; + inherit "/lib/props/ambiance"; + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(20); + SetShort("a generic room"); + SetLong("This is an utterly plain, blank room."); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/science1.c ds2.0r27/lib/domains/campus/room/science1.c *** ds1.1/lib/domains/campus/room/science1.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/science1.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + #include <rooms.h> + + inherit LIB_ROOM; + + void create() { + room::create(); + SetAmbientLight(30); + SetShort("Science Building Hallway"); + SetLong("This is the LPC University Science Building, where exciting new systems and abstract research happens. North of here is the probability laboratory. The hallway continues west. The building's exit is east, leading to University Square."); + SetExits( ([ + "north" : "/domains/campus/room/wiz_lab", + "east" : "/domains/campus/room/usquare", + "west" : "/domains/campus/room/science2.c", + ]) ); + SetClimate("indoors"); + + SetDoor("north", "/domains/campus/doors/prob_door.c"); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/science2.c ds2.0r27/lib/domains/campus/room/science2.c *** ds1.1/lib/domains/campus/room/science2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/science2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,21 ---- + #include <lib.h> + #include <rooms.h> + + inherit LIB_ROOM; + + void create() { + room::create(); + SetAmbientLight(30); + SetShort("Science Building Hallway, West"); + SetLong("This is the western end of the main hallway in the LPC University Science Building. North of here is the stargate laboratory. The hallway runs east from here, toward the building's exit."); + SetExits( ([ + "east" : "/domains/campus/room/science1", + "north" : "/domains/campus/room/slab.c", + ]) ); + + SetClimate("indoors"); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/sewer.c ds2.0r27/lib/domains/campus/room/sewer.c *** ds1.1/lib/domains/campus/room/sewer.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/sewer.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,68 ---- + #include <lib.h> + inherit LIB_ROOM; + inherit "/lib/props/ambiance"; + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(10); + SetShort("sewer"); + SetLong("You are in the stinking underground tunnels of "+ + "a sewer system. The air here is quite foul, "+ + "and periodic blasts of steam from wall-mounted vents make it "+ + "very hot and very humid. There is a foot-high stream of dark liquid "+ + "covering the bottom of this tunnel, running west to east along "+ + "the tunnel's length. The tunnel narrows dramatically here, and "+ + "becomes so small that further movement east is not possible."); + SetItems( ([ ({"tunnel","tunnels"}) : "Here the tunnel becomes so "+ + "narrow that you can't go any further east. It looks like "+ + "some debris has accumulated here over time, almost "+ + "clogging the waste flow.", + ({"sewer","sewer system"}) : "Though evidently in good repair "+ + "and of modern construction, this is still a sewer tunnel, "+ + "and it's hostile to human comfort.", + ({"steam","vent","vents","wall-mounted vents"}): "Apparently "+ + "there is industrial machinery nearby that exhausts hot steam "+ + "through vents in the walls.", + "air" : "It is rank with the reek of decomposing waste.", + ({"wall","walls"}) : "The walls of the sewer tunnel are made "+ + "of concrete and appear well-built and sturdy.", + ({"stream","liquid","stream of liquid","dark liquid"}) : "Whatever "+ + "this stuff is, water is not its main component. It's some kind "+ + "of foul-smelling liquid waste, flowing along the bottom "+ + "of the tunnel.", + ({"sewage","waste","garbage"}) : "It appears that the fluid on the "+ + "bottom of this tunnel is the result of garbage and waste "+ + "processing. In liquid form, this garbage flows "+ + "east from here.", + ]) ); + SetSmell( ([ "default" : "The stench of sewage and waste hangs here."]) ); + SetListen("default","You hear faint echoes of dripping water."); + SetExits( ([ "west" : "/domains/campus/room/sewer1.c" + ]) ); + SetInventory(([ + "/domains/campus/obj/debris" :1 + ])); + SetObviousExits("w"); + set_heart_beat(10); + } + int SteamBlast(){ + object *temparr,*stuff,*lstuff; + int i; + stuff=all_inventory(); + lstuff = ({}); + for(i=0;i<sizeof(stuff);i++){ + temparr= ({ stuff[i] }); + if(living(stuff[i]) && !sizeof(lstuff)) lstuff = ({stuff[i]}); + if(living(stuff[i]) && sizeof(lstuff) > 0 && member_array(stuff[i],lstuff) == -1) lstuff += ({stuff[i]}); + } + for(i=0;i<sizeof(lstuff);i++){ + if(sizeof(lstuff) > 0 && !creatorp(lstuff[i]) ) lstuff[i]->eventReceiveDamage(0, 7,random(30)+10, "torso"); + + } + tell_room(this_object(), "You are hit by a blast of scalding-hot steam!"); + return 1; + } + void heart_beat(){ + if(random(10) == 1) SteamBlast(); + return; + } diff -c -r --new-file ds1.1/lib/domains/campus/room/sewer.proto.c ds2.0r27/lib/domains/campus/room/sewer.proto.c *** ds1.1/lib/domains/campus/room/sewer.proto.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/sewer.proto.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,59 ---- + #include <lib.h> + inherit LIB_ROOM; + inherit "/lib/props/ambiance"; + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(10); + SetShort("campus sewer"); + SetLong("You are in the stinking underground tunnels of "+ + "the Virtual Campus sewer system. The air here is quite foul, "+ + "and periodic blasts of steam from wall-mounted vents make it "+ + "very hot and very humid. There is a foot-high stream of dark liquid "+ + "covering the bottom of this tunnel, running west to east along "+ + "the tunnel's length."); + SetItems( ([ ({"tunnel","tunnels"}) : "You are in a sewer tunnel."+ + "It's foul, dark, and hot.", + ({"sewer","sewer system"}) : "Though evidently in good repair "+ + "and of modern construction, this is still a sewer tunnel, "+ + "and it's hostile to human comfort.", + ({"steam","vent","vents","wall-mounted vents"}): "Apparently "+ + "there is industrial machinery nearby that exhausts hot steam "+ + "through vents in the walls.", + "air" : "It is rank with the reek of decomposing waste.", + ({"wall","walls"}) : "The walls of the sewer tunnel are made "+ + "of concrete and appear well-built and sturdy.", + ({"stream","liquid","stream of liquid","dark liquid"}) : "Whatever "+ + "this stuff is, water is not its main component. It's some kind "+ + "of foul-smelling liquid waste, flowing along the bottom "+ + "of the tunnel.", + ({"sewage","waste","garbage"}) : "It appears that the fluid on the "+ + "bottom of this tunnel is the result of garbage and waste "+ + "processing. In liquid form, this garbage flows "+ + "east from here.", + ]) ); + SetSmell( ([ "default" : "The stench of sewage and waste hangs here."]) ); + SetListen("default","You hear faint echoes of dripping water."); + set_heart_beat(10); + } + int SteamBlast(){ + object *temparr,*stuff,*lstuff; + int i; + stuff=all_inventory(); + lstuff = ({}); + for(i=0;i<sizeof(stuff);i++){ + temparr= ({ stuff[i] }); + if(living(stuff[i]) && !sizeof(lstuff)) lstuff = ({stuff[i]}); + if(living(stuff[i]) && sizeof(lstuff) > 0 && member_array(stuff[i],lstuff) == -1) lstuff += ({stuff[i]}); + } + for(i=0;i<sizeof(lstuff);i++){ + if(sizeof(lstuff) > 0 && !creatorp(lstuff[i]) ) lstuff[i]->eventReceiveDamage(0, 7,random(30)+10, "torso"); + + } + tell_room(this_object(), "You are hit by a blast of scalding-hot steam!"); + return 1; + } + void heart_beat(){ + if(random(10) == 1) SteamBlast(); + return; + } diff -c -r --new-file ds1.1/lib/domains/campus/room/sewer1.c ds2.0r27/lib/domains/campus/room/sewer1.c *** ds1.1/lib/domains/campus/room/sewer1.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/sewer1.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,67 ---- + #include <lib.h> + inherit LIB_ROOM; + inherit "/lib/props/ambiance"; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(10); + SetShort("sewer"); + SetLong("You are in the stinking underground tunnels of "+ + "a sewer system. The air here is quite foul, "+ + "and periodic blasts of steam from wall-mounted vents make it "+ + "very hot and very humid. There is a foot-high stream of dark liquid "+ + "covering the bottom of this tunnel, running west to east along "+ + "the tunnel's length."); + SetItems( ([ ({"tunnel","tunnels"}) : "You are in a sewer tunnel."+ + "It's foul, dark, and hot.", + ({"sewer","sewer system"}) : "Though evidently in good repair "+ + "and of modern construction, this is still a sewer tunnel, "+ + "and it's hostile to human comfort.", + ({"steam","vent","vents","wall-mounted vents"}): "Apparently "+ + "there is industrial machinery nearby that exhausts hot steam "+ + "through vents in the walls.", + "air" : "It is rank with the reek of decomposing waste.", + ({"wall","walls"}) : "The walls of the sewer tunnel are made "+ + "of concrete and appear well-built and sturdy.", + ({"stream","liquid","stream of liquid","dark liquid"}) : "Whatever "+ + "this stuff is, water is not its main component. It's some kind "+ + "of foul-smelling liquid waste, flowing along the bottom "+ + "of the tunnel.", + ({"sewage","waste","garbage"}) : "It appears that the fluid on the "+ + "bottom of this tunnel is the result of garbage and waste "+ + "processing. In liquid form, this garbage flows "+ + "east from here.", + ]) ); + SetSmell( ([ "default" : "The stench of sewage and waste hangs here."]) ); + SetListen("default","You hear faint echoes of dripping water."); + SetExits( ([ "east" : "/domains/campus/room/sewer.c", + "west" : "/domains/campus/room/sewer2.c" + ]) ); + SetObviousExits("e, w"); + set_heart_beat(10); + } + int SteamBlast(){ + object *temparr,*stuff,*lstuff; + int i; + stuff=all_inventory(); + lstuff = ({}); + for(i=0;i<sizeof(stuff);i++){ + temparr= ({ stuff[i] }); + if(living(stuff[i]) && !sizeof(lstuff)) lstuff = ({stuff[i]}); + if(living(stuff[i]) && sizeof(lstuff) > 0 && member_array(stuff[i],lstuff) == -1) lstuff += ({stuff[i]}); + } + for(i=0;i<sizeof(lstuff);i++){ + if(sizeof(lstuff) > 0 && !creatorp(lstuff[i]) ) lstuff[i]->eventReceiveDamage(0, 7,random(30)+10, "torso"); + + } + tell_room(this_object(), "You are hit by a blast of scalding-hot steam!"); + return 1; + } + void heart_beat(){ + if(random(10) == 1) SteamBlast(); + return; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/sewer2.c ds2.0r27/lib/domains/campus/room/sewer2.c *** ds1.1/lib/domains/campus/room/sewer2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/sewer2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,71 ---- + #include <lib.h> + inherit LIB_ROOM; + inherit "/lib/props/ambiance"; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(20); + SetShort("sewer"); + SetLong("You are in the stinking underground tunnels of "+ + "a sewer system. The air here is quite foul, "+ + "and periodic blasts of steam from wall-mounted vents make it "+ + "very hot and very humid. There is a foot-high stream of dark liquid "+ + "covering the bottom of this tunnel, running west to east along "+ + "the tunnel's length. Light streams in from a drainage grate above."); + SetItems( ([ ({"tunnel","tunnels"}) : "You are in a sewer tunnel."+ + "It's foul, dark, and hot.", + ({"sewer","sewer system"}) : "Though evidently in good repair "+ + "and of modern construction, this is still a sewer tunnel, "+ + "and it's hostile to human comfort.", + ({"steam","vent","vents","wall-mounted vents"}): "Apparently "+ + "there is industrial machinery nearby that exhausts hot steam "+ + "through vents in the walls.", + "air" : "It is rank with the reek of decomposing waste.", + ({"wall","walls"}) : "The walls of the sewer tunnel are made "+ + "of concrete and appear well-built and sturdy.", + ({"stream","liquid","stream of liquid","dark liquid"}) : "Whatever "+ + "this stuff is, water is not its main component. It's some kind "+ + "of foul-smelling liquid waste, flowing along the bottom "+ + "of the tunnel.", + "light" : "There isn't much of it, and you can't tell if it's " + + "sunshine or lamplight, but it lets you see a bit better.", + ({"sewage","waste","garbage"}) : "It appears that the fluid on the "+ + "bottom of this tunnel is the result of garbage and waste "+ + "processing. In liquid form, this garbage flows "+ + "east from here.", + ]) ); + SetSmell( ([ "default" : "The stench of sewage and waste hangs here."]) ); + SetListen("default","You hear faint echoes of dripping water."); + SetExits( ([ + "east" : "/domains/campus/room/sewer1", + "up" : "/domains/town/room/vill_road1" + ]) ); + + SetDoor("up","/domains/campus/doors/grate"); + set_heart_beat(10); + } + int SteamBlast(){ + object *temparr,*stuff,*lstuff; + int i; + stuff=all_inventory(); + lstuff = ({}); + for(i=0;i<sizeof(stuff);i++){ + temparr= ({ stuff[i] }); + if(living(stuff[i]) && !sizeof(lstuff)) lstuff = ({stuff[i]}); + if(living(stuff[i]) && sizeof(lstuff) > 0 && member_array(stuff[i],lstuff) == -1) lstuff += ({stuff[i]}); + } + for(i=0;i<sizeof(lstuff);i++){ + if(sizeof(lstuff) > 0 && !creatorp(lstuff[i]) ) lstuff[i]->eventReceiveDamage(0, 7,random(30)+10, "torso"); + + } + tell_room(this_object(), "You are hit by a blast of scalding-hot steam!"); + return 1; + } + void heart_beat(){ + if(random(10) == 1) SteamBlast(); + return; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/slab.c ds2.0r27/lib/domains/campus/room/slab.c *** ds1.1/lib/domains/campus/room/slab.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/slab.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,51 ---- + #include <lib.h> + #include <daemons.h> + + inherit LIB_ROOM; + + int SignRead(){ + string list; + list = implode(keys(STARGATE_D->GetStargates()),", "); + write("These are Stargate operation instructions."); + write("The Dead Souls stargate system provides teleportation within " + "the stargate network. To use the stargate network, one finds an " + "idle stargate, then dials the name of some other known stargate. " + "One then enters the outbound stargate, and if things go well, teleportation " + "to the dialed stargate occurs. To travel to Uruk, if that were a " + "valid stargate name, you would: dial uruk\n" + "Once the stargate activates: enter stargate"); + write("Currently available stargates are:"); + write("%^BOLD%^%^YELLOW%^"+list+"%^RESET%^"); + return 1; + } + + static void create() { + object ob; + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Science Building Stargate Lab"); + SetLong("This large room is the testing ground for the newly discovered stargate technology that allows for instant teleportation between distant locations. The main Science Building hallway is south.\n" + "%^BOLD%^%^GREEN%^An instruction sign is here.%^RESET%^"); + SetItems(([ + ({ "sign", "instruction sign", "instructions sign", "instruction", "instructions" }) : "A sign you can read. It appears to be instructions for operating the stargate.", + ])); + SetExits(([ + "south" : "/domains/campus/room/science2", + ])); + + SetInventory(([ + "/domains/campus/obj/stargate" : 1, + ])); + SetRead("sign", (: SignRead() :) ); + SetProperty("no attack", 1); + + } + int CanReceive(object ob) { + if(!ob) return 0; + return room::CanReceive(ob); + } + + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/snack.c ds2.0r27/lib/domains/campus/room/snack.c *** ds1.1/lib/domains/campus/room/snack.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/snack.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,56 ---- + #include <lib.h> + #include <dirs.h> + #include <message_class.h> + inherit LIB_ROOM; + + int eventReadMenu(string str); + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(40); + SetShort("The Campus Snack Bar"); + SetLong("You are in a small, linoleum-tiled room lit by bright "+ + "fluorescent lights. There are a few uncomfortable-looking chairs "+ + "around two tables, and a sort of bar set into the north wall, "+ + "behind which a food service employee stands. There is a menu "+ + "hanging on the wall next to the bar. The main hallway lies south of here."); + SetItems(([ + "menu": "A menu of snack items available here.", + "sign":"A sign over the snack bar.", + ({"tile","tiles","floor","linoleum"}):"These are here because you "+ + "are not trusted to keep food off of carpets.", + ({"chair","chairs","table","table"}):"Token furniture, not very functional "+ + "or comfortable-looking. You aren't really expected to hang "+ + "around in here, apparently.", + "bar" : "Really a window set into the wall and connecting the snack bar "+ + "to the adjoining kitchen.", + ({"wall","walls"}) : "The walls are painted blue and white, the school's colors. "+ + "It's fairly unattractive and institutional.", + "hallway" : "The administration building's main hallway lies south.", + ({"light","lights","fluorescent lights","fluorescents"}) : "Cheap, standard "+ + "lighting. Like all fluorescents, these lights give everything an unappealing, "+ + "sickly look.", + "employee" : "An underpaid, unappreciated, and resentful state employee. "+ + "No surprise there.", + ])); + SetExits( ([ "south" : "/domains/campus/room/corridor", + ])); + SetObviousExits("s"); + SetRead("menu", (: eventReadMenu :)); + SetInventory(([ + "/domains/campus/npc/gloria.c" : 1 ])); + SetProperty("no attack", 1); + } + int eventReadMenu(string str){ + write("\n"+ + "1) ham sandwich: 2 dollars\n"+ + "2) hamburger: 4 dollars\n"+ + "3) salad of the day: 3 dollars\n\n"+ + "Drinks:\n"+ + "1) milk: 1 dollar\n"+ + "2) gatorade: 2 dollars\n"); + return 1; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/spath.c ds2.0r27/lib/domains/campus/room/spath.c *** ds1.1/lib/domains/campus/room/spath.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/spath.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,17 ---- + #include <lib.h> + inherit LIB_ROOM; + inherit "/lib/props/ambiance"; + static void create() { + room::create(); + SetClimate("outdoors"); + SetAmbientLight(25); + SetShort("Fitzpatrick Hall"); + SetLong("This is the messy foyer of a building under construction."); + SetExits( ([ "north" : "/domains/campus/room/usquare", + ]) ); + } + int CanReceive(object ob) { + message("info","The classroom building is temporarily " + "closed for renovation.", ob); + return 0; + } diff -c -r --new-file ds1.1/lib/domains/campus/room/square.c ds2.0r27/lib/domains/campus/room/square.c *** ds1.1/lib/domains/campus/room/square.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/square.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,75 ---- + /* /realms/trent/commons/fountain.c + * "the Fountain" + * Trent@LPC University + */ + + #include <lib.h> + + inherit LIB_ROOM; + inherit "/lib/props/ambiance"; + inherit "/lib/props/getlivings"; + + int CheckDoor(){ + object *obs; + int i; + obs=get_livings(find_object("/domains/campus/room/sewer2"),1); + if(!sizeof(obs) && !"/domains/campus/doors/grate"->GetClosed() ) { + "/domains/campus/doors/grate"->SetClosed(1); + tell_object(this_object(),"The drainage grate slams shut."); + } + return 1; + } + + static void create() { + string day,night; + room::create(); + //SetProperty("light", 2); + SetAmbientLight(30); + SetClimate("temperate"); + SetShort("Fountain square"); + day="This is Fountain Square, the center of Larstown. "+ + "A small, beautiful fountain is the center of this cobblestone "+ + "square. A circular stone bench surrounds the edge of the fountain's pool, "+ + "and water that spills over from the fountain drains into a rainwater grate "+ + "set into the ground.\n "+ + "\tLarstown is still a small, modest village, but renovations such as this "+ + "tasteful commons and the fountain make it clear it remains a vibrant, "+ + "active place to live in. You may leave this square by North Street, East Avenue, "+ + "South Road, or West Track. "; + night="Normally quite busy in the daytime, the square is now filled only " + + "with the sounds of the fountain's flow."; + SetDayLong(day); + SetNightLong(day+night); + SetItems( ([ ({ "square", "center" }) : "The square is a popular meeting place " + "for Larstown's denizens.", + "fountain" : "This beautifully designed fountain was donated " + "by Trent.", + ({"street","North Street","north street"}) : "North Street leads north "+ + "toward the village marketplace and its clock tower.", + ({"avenue","east avenue","East Avenue"}) : "East Avenue leads east toward "+ + "the shore and Larstown docks.", + ({"road","south road","South Road"}) : "South Road leads south toward "+ + "the town's water well, bank, and residential area.", + ({"track","West Track","west track"}) : "West Track leads west toward the "+ + "town hall and some business and civic buildings.", + ({"circular bench", "bench", "stone bench", "stone"}) : "Many of " + "Frontier's denizens like to sit around the fountain and enjoy the " + "beautiful sights and sounds of the square." ]) ); + SetSearch( ([ "fountain" : "It appears someone has already stolen all the coins in the fountain." ]) ); + SetSmell( ([ "default" : "You smell the clean and misty air of the fountain's spray." ]) ); + SetObviousExits("n,s,e,w"); + SetExits( ([ + "east" : "/domains/campus/room/square", + "east" : "/domains/campus/room/square", + "east" : "/domains/campus/room/square", + "east" : "/domains/campus/room/square", + "down" : "/domains/campus/room/sewer2" + ]) ); + + SetDoor("down","/domains/campus/doors/grate"); + + } + + void init(){ + CheckDoor(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/stairwell.c ds2.0r27/lib/domains/campus/room/stairwell.c *** ds1.1/lib/domains/campus/room/stairwell.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/stairwell.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,51 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(20); + SetShort("stairwell"); + SetLong("You are standing on a stairwell landing. Flights of stairs "+ + "lead up and down, although the stairs up are roped off to prevent "+ + "passage. The flickering fluorescent lights make it difficult to see what "+ + "lies below here. There is a sign tied to the rope on the flight of stairs "+ + "going up."); + SetItems(([ + ({"stairs","flight","flight of stairs"}) : "The stairs are made of concrete, appear to "+ + "be part of the foundation of the building, and seem quite sturdy.", + "landing" : "This is a landing between flights of stairs leading up and down.", + "rope" : "Thick yellow construction rope. There's a lot of it tied to the " + + "flight of stairs leading up, preventing your passage. There's a sign hanging "+ + "on it.", + ({"light","lights","fluorescent lights"}) : "Cheap lighting that doesn't seem to work "+ + "very well. Occasionally the landing is lit orange, then white again by the flickering "+ + "lights.", + "sign" : "This is a handwritten, cardboard sign hanging on the roped-off stairs."])); + SetExits(([ + "north" : "/domains/campus/room/corridor3", + "down" : "/domains/campus/room/basement" + ])); + SetDoor("north","/domains/campus/doors/top_stairs"); + SetProperty("no attack", 1); + } + void init(){ + ::init(); + add_action("r_sign","read"); + add_action("untie_r","untie"); + } + int r_sign(string str){ + if(str=="sign" || str=="cardboard sign"){ + write("The sign reads:\n"+ + "WARNING! Second floor under construction, all access prohibited!\n"); + say(this_player()->GetName()+" read the sign.\n"); + return 1; + } + } + int untie_r(string str){ + if(str=="rope" || str=="yellow rope"){ + write("The rope is quite firmly tied. You fail.\n"); + say(this_player()->GetName()+" fails to untie the rope.\n"); + return 1; + } + } diff -c -r --new-file ds1.1/lib/domains/campus/room/start.c ds2.0r27/lib/domains/campus/room/start.c *** ds1.1/lib/domains/campus/room/start.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/start.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,33 ---- + #include <lib.h> + #include <message_class.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("LPC University Reception"); + SetLong("You are in the small, spare reception area of the Virtual Campus admissions office. A door leads north to the main administration building corridor."); + SetExits( ([ + "north" : "/domains/campus/room/corridor", + ]) ); + SetNoModify(1); + SetDoor("north","/domains/campus/doors/plain_door"); + SetInventory(([ + "/domains/campus/obj/bbucket" :1, + "/domains/campus/npc/jennybot" :1, + ])); + SetProperty("no attack", 1); + } + + void init(){ + ::init(); + } + + mixed CanReceive(object ob){ + if(ob && ob->GetRace() == "rodent"){ + message("info","You are repelled by rodenticide.",ob); + return 0; + } + return 1; + } diff -c -r --new-file ds1.1/lib/domains/campus/room/store.c ds2.0r27/lib/domains/campus/room/store.c *** ds1.1/lib/domains/campus/room/store.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/store.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,9 ---- + #include <lib.h> + inherit LIB_ROOM; + static void create() { + room::create(); + SetClimate("indoors"); + SetProperties( ([ "light" : 2 ]) ); + SetShort("a generic room"); + SetLong("This is an utterly plain, blank room."); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/store2.c ds2.0r27/lib/domains/campus/room/store2.c *** ds1.1/lib/domains/campus/room/store2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/store2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,16 ---- + #include <lib.h> + inherit LIB_ROOM; + static void create() { + room::create(); + SetClimate("indoors"); + SetProperties( ([ "light" : 2 ]) ); + SetShort("a generic room"); + SetLong("This is an utterly plain, blank room."); + SetInventory(([ + "/domains/campus/meals/burger" : 20, + "/domains/campus/meals/ham_sand" : 20, + "/domains/campus/meals/milk" : 20, + "/domains/campus/obj/flashlight" : 20, + "/domains/campus/meals/salad" : 20, + "/domains/campus/meals/gator" : 20])); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/tunnel.c ds2.0r27/lib/domains/campus/room/tunnel.c *** ds1.1/lib/domains/campus/room/tunnel.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/tunnel.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,35 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(5); + SetShort("Tunnel"); + SetLong("You are in a dark and narrow underground tunnel. The walls are bare rock "+ + "and dirt...as if the tunnel has been carved out of and into the earth. Pipes and cables "+ + "run along the southern wall, and seem to emit a low hum. To the west you see a false wall "+ + "leading into the basement of the Vitual Campus administrative building. To the "+ + "east, the tunnel continues into darkness."); + SetItems(([ + "tunnel" : "This is evidently a hidden tunnel beneath the Virtual Campus. It's "+ + "extremely creepy and dark in here.", + "walls" : "The walls are bare earth and rocks. It looks as though whoever "+ + "built this tunnel was in a big hurry to get it done.", + ({"wall","south wall","southern wall"}) : "The south wall is heavily laden with "+ + "thick cables and metal pipes running east along its length.", + ({"rock","earth"}): "The walls are composed of this stuff...it's a rough excavation.", + ({"pipe","pipes","cable","cables"}): "These thick pipes and cables appear to carry power somewhere along the wall. They are humming slightly.", + "darkness":"It's deep. It's dark. It's the absence of light, and there's lots of it.", + ])); + SetListen("default","You hear faint echoes of dripping water."); + SetExits(([ + "west" : "/domains/campus/room/basement2", + "east" : "/domains/campus/room/tunnel2"])); + SetProperty("no attack", 1); + } + void init(){ + ::init(); + AddListen(({"pipe","pipes","wall","cables","cable"}) , "The pipes and "+ + "cables throb with some unknown power...emitting an eerie hum."); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/tunnel2.c ds2.0r27/lib/domains/campus/room/tunnel2.c *** ds1.1/lib/domains/campus/room/tunnel2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/tunnel2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,33 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(5); + SetShort("Tunnel"); + SetLong("You are in a dark and narrow underground tunnel. The walls are bare rock "+ + "and dirt...as if the tunnel has been carved out of and into the earth. Pipes and cables "+ + "run along the southern wall, and seem to emit a low hum. To the west and "+ + "east, you can see some light."); + SetListen("default","You hear faint echoes of dripping water."); + SetItems(([ + "tunnel" : "This is evidently a hidden tunnel beneath the Virtual Campus. It's "+ + "extremely creepy and dark in here.", + "walls" : "The walls are bare earth and rocks. It looks as though whoever "+ + "built this tunnel was in a big hurry to get it done.", + ({"wall","south wall","southern wall"}) : "The south wall is heavily laden with "+ + "thick cables and metal pipes running east along its length.", + ({"rock","earth"}): "The walls are composed of this stuff...it's a rough excavation.", + "darkness":"It's deep. It's dark. It's the absence of light, and there's lots of it.", + ])); + SetExits(([ + "west" : "/domains/campus/room/tunnel", + "east" : "/domains/campus/room/access7"])); + SetProperty("no attack", 1); + } + void init(){ + ::init(); + AddListen(({"pipe","pipes","wall","cables","cable"}) , "The pipes and "+ + "cables throb with some unknown power...emitting an eerie hum."); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/tunnel3.c ds2.0r27/lib/domains/campus/room/tunnel3.c *** ds1.1/lib/domains/campus/room/tunnel3.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/tunnel3.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,39 ---- + #include <lib.h> + inherit LIB_ROOM; + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Tunnel"); + SetLong("You are in a dark and narrow underground tunnel. The walls are bare rock "+ + "and dirt...as if the tunnel has been carved out of and into the earth. Pipes and cables "+ + "run along the southern wall, and into the east wall. The tunnel ends here, and set into "+ + "the metal east wall is a door leading further east. To the west, the tunnel "+ + "continues into darkness. "); + SetListen("default","You hear faint echoes of dripping water."); + SetItems(([ + "tunnel" : "This is evidently a hidden tunnel beneath the Virtual Campus. It's "+ + "extremely creepy and dark in here.", + "walls" : "The walls are bare earth and rocks. It looks as though whoever "+ + "built this tunnel was in a big hurry to get it done.", + ({"wall","south wall","southern wall"}) : "The south wall is heavily laden with "+ + "thick cables and metal pipes running east along its length.", + ({"rock","earth"}): "The walls are composed of this stuff...it's a rough excavation.", + ({"pipe","pipes","cable","cables"}): "These thick pipes and cables appear to carry power somewhere along the wall. They are humming slightly.", + "darkness":"It's deep. It's dark. It's the absence of light, and there's lots of it.", + ])); + SetExits(([ + "west":"/domains/campus/room/tunnel2", + "east":"/domains/campus/room/u_lab"])); + SetDoor("east","/domains/campus/doors/u_door"); + SetObviousExits("e,w"); + // SetInventory(([ + // "/domains/campus/npc/mp" : 1, + // ])); + // SetProperty("no attack", 1); + } + void init(){ + AddListen(({"pipe","pipes","wall","cables","cable"}) , "The pipes and "+ + "cables throb with some unknown power...emitting an eerie hum."); + } + diff -c -r --new-file ds1.1/lib/domains/campus/room/u_lab.c ds2.0r27/lib/domains/campus/room/u_lab.c *** ds1.1/lib/domains/campus/room/u_lab.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/u_lab.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,140 ---- + #include <lib.h> + inherit LIB_ROOM; + + string panel_look(); + int dial; + string tele_where; + static void create() { + room::create(); + dial=0; + tele_where="a dark, metal corridor"; + SetClimate("indoors"); + SetAmbientLight(40); + SetShort("Underground Lab"); + SetLong("You are in a messy, wildly disorganized underground "+ + "laboratory. There are notes strewn everywhere, and a large chalkboard "+ + "is covered with bizarre schematics and formulae. On the east wall is "+ + "some mysterious, glowing portal, about the size of a door. Next to the "+ + "portal is a control panel, and a crudely drawn sign. There is a door on "+ + "the west wall."); + SetItems(([ + ({"lab","room","laboratory"}) : "This appears to be some sort of "+ + "secret physics lab.", + "mess" : "It's definitely messy in here.", + ({"note","notes"}) : "These are notes covered in highly technical "+ + "equations and drawings.", + ({"board","chalkboard"}) : "It is filled with lots of jargon and symbols you "+ + "don't recognize.", + ({"schematics","formulae"}) : "Complicated stuff, it looks like.", + ({"schematic","formula"}) : "Complicated stuff, it looks like.", + "east wall" : "Other than the mysterious glowing portal and the "+ + "control panel, the east wall seems pretty ordinary.", + "west wall" : "The west wall has a door leading west.", + "wall" : "It's a wall.", + ({"portal","glowing portal","mysterious glowing portal"}) : "This is just "+ + "what you'd expect a dimensional portal to look like, if you knew what "+ + "it was. It pulsates with some weird energy, and you feel mildly "+ + "nauseous looking into it. You feel strangely compelled to enter it.", + ({"panel","control panel"}) : (: panel_look :), + "sign" : "A crude, hand-drawn sign in red ink next to the portal." ])); + SetInventory(([ + ])); + // SetRead((["sign":"The sign reads: Enter at your own risk! This portal leads to some "+ + // "places of questionable safety and unstable reality...you are warned!", + // "notes" : "They are incomprehensible to you.", + // ({"board","chalkboard"}) : "It is full of cryptic equations. Buried in the middle of one "+ + // "is 'Step 3: a miracle happens'.", + // ])); + SetRead("sign","The sign reads: Enter at your own risk! This portal leads to some "+ + "places of questionable safety and unstable reality...you are warned!"); + + AddRead( ({"schematics","formulae"}), ({"You don't understand them." }) ); + AddRead( ({"notes"}) , ({"They are incomprehensible to you."}) ); + AddRead( ({"board","chalkboard"}) , ({"It is full of cryptic equations. Buried in the middle of one "+ + "is 'Step 3: a miracle happens'."}) ); + SetExits((["west":"/domains/campus/room/tunnel3"])); + SetEnters((["portal":"/domains/campus/room/access1"])); + SetDoor("west","/domains/campus/doors/u_door"); + SetObviousExits("w"); + new("/domains/campus/npc/seth")->eventMove(this_object()); + } + void init(){ + ::init(); + add_action("set_dial","turn"); + add_action("set_dial","set"); + } + string panel_look(){ + return "The control panel contains a single dial and a tiny screen. "+ + "The dial is set to: "+dial+" and the screen reads: "+tele_where+"."; + } + int set_dial(string str){ + int i; + object ob; + ob=present("seth",this_object()); + if(str=="dial"){ + write("You spin the dial.\n"); + say(this_player()->GetName()+" fiddles with the control panel.\n"); + if(ob){ + ob->eventForce("look at "+lower_case(this_player()->GetName())); + } + return 1; + } + if(sscanf(str,"dial to %d",i) > 0){ + if(i > 10) i=0; + write("You set the dial to "+i+".\n"); + say(this_player()->GetName()+" turns the control panel dial.\n"); + if(ob){ + ob->eventForce("say I hope you know what you're doing"); + } + dial=i; + this_object()->set_portal(dial); + return 1; + } + else return 0; + } + int set_portal(int i){ + if(i==0) { SetEnters((["portal":"/domains/campus/room/access1"])); + tele_where="a dark, metal corridor"; + return 1; + } + if(i==1) { SetEnters((["portal":"/realms/boy/area/room3"])); + tele_where="village gates"; + return 1; + } + if(i==2) { SetEnters((["portal":"/realms/dana/room/sc/marsh"])); + tele_where="a marsh"; + return 1; + } + if(i==3) { SetEnters((["portal":"/realms/ember/swamp/swamp1"])); + tele_where="a swamp"; + return 1; + } + if(i==4) { SetEnters((["portal":"/realms/haderach/land/cities/hartland/rooms/townsq"])); + tele_where="a town square"; + return 1; + } + if(i==5) { SetEnters((["portal":"/realms/kyranna/law/maindesk"])); + tele_where="a police department"; + return 1; + } + if(i==6) { SetEnters((["portal":"/realms/temujin/village/room/green"])); + tele_where="a ruined village"; + return 1; + } + if(i==7) { SetEnters((["portal":"/realms/war/arena/3b1"])); + tele_where="an arena"; + return 1; + } + if(i==8) { SetEnters((["portal":"/realms/zackron/metro/train/platfmn"])); + tele_where="a train station"; + return 1; + } + if(i==9) { SetEnters((["portal":"/realms/hiccups/rooms/fen1"])); + tele_where="entrance gates"; + return 1; + } + if(i==10) { SetEnters((["portal":"/domains/Midian/room/kaliid3"])); + tele_where="road by a church"; + return 1; + } + } diff -c -r --new-file ds1.1/lib/domains/campus/room/uptree.c ds2.0r27/lib/domains/campus/room/uptree.c *** ds1.1/lib/domains/campus/room/uptree.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/uptree.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,33 ---- + #include <lib.h> + inherit LIB_ROOM; + inherit LIB_CLIMB; + inherit "/lib/props/ambiance"; + + int ClimbDown(); + static void create() { + room::create(); + SetAmbientLight(25); + SetClimate("outdoors"); + SetShort("up a tree"); + SetLong("You are standing on some sturdy branches of the large "+ + "tree in University Square. "); + SetObviousExits("d"); + SetExits( ([ + "down" : "/domains/campus/room/usquare" + ]) ); + SetProperty("no attack", 1); + SetClimb( (: ClimbDown :) ,2); + } + int ClimbDown(){ + string omsg,imsg,dest; + object who; + dest="/domains/campus/room/usquare"; + who=this_player(); + omsg = "$N climbs down."; + imsg = "$N comes climbing down from the tree."; + who->eventMoveLiving(dest, omsg, imsg); + //return 1; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/usquare.c ds2.0r27/lib/domains/campus/room/usquare.c *** ds1.1/lib/domains/campus/room/usquare.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/usquare.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,37 ---- + #include <lib.h> + inherit LIB_ROOM; + inherit LIB_CLIMB; + + static void create() { + room::create(); + SetAmbientLight(25); + SetClimate("outdoors"); + SetShort("University Square"); + SetLong("You are at University Square, a cobblestone-paved crossroads with a large tree in the middle. To the east is the Virtual Campus administrative building entrance. North is a path that seems to lead to a small town. The classroom building is south. The new Science Building is west."); + SetItems(([ + ({"building","administrative building"}) : "This large building houses the offices "+ + "of Virtual Campus staff, and is where most business is done. It also contains "+ + "a snack bar, a small store, and student lounge.", + "clinic" : "This small clinic is where students in need of medical "+ + "attention go." + ]) ); + SetExits( ([ + "south" : "/domains/campus/room/spath", + "north" : "/domains/campus/room/npath", + "east" : "/domains/campus/room/foyer", + "west" : "/domains/campus/room/science1.c", + ]) ); + SetInventory(([ + "/domains/campus/npc/tim" : 1, + "/domains/campus/npc/wim" : 1, + "/domains/campus/obj/tree" : 1, + "/domains/campus/obj/bench" : 3, + ])); + SetEnters( ([ + ]) ); + SetProperty("no attack", 1); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/void.c ds2.0r27/lib/domains/campus/room/void.c *** ds1.1/lib/domains/campus/room/void.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/void.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + /* /domains/campus/adm/void.c + * from the Nightmare V Object Library + * place where people go when their environments accidentally are + * destructed + * created by Descartes of Borg 960302 + */ + + #include <lib.h> + #include <rooms.h> + + inherit LIB_ROOM; + + void create() { + room::create(); + SetShort("the void"); + SetLong("The void. Go down to get out."); + SetExits( ([ "down" : "/domains/campus/room/start" ]) ); + } diff -c -r --new-file ds1.1/lib/domains/campus/room/wiz_lab.c ds2.0r27/lib/domains/campus/room/wiz_lab.c *** ds1.1/lib/domains/campus/room/wiz_lab.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/room/wiz_lab.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,29 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Laboratory Wing"); + SetLong("This is a bright, shiny laboratory complex connecting to labs where probability experiments are performed. Probability experiments are currently running in the north and west labs. The east lab is available for general use. The main hallway of the science building is south."); + SetItems( ([ + ({"lab","laboratory","wing","complex"}) : "You " + "are in the lab complex. Laboratories can " + "be accessed from here.", + ({"stairs","downstairs"}) : "Go down to " + "return to the Creators' Hall." + ]) ); + SetExits( ([ + "west" : "/domains/campus/room/plab2", + "north" : "/domains/campus/room/monty", + "east" : "/domains/campus/room/plab", + "south" : "/domains/campus/room/science1.c", + ]) ); + + SetDoor("south", "/domains/campus/doors/prob_door.c"); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/bak2/bak1/blue_wins ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/bak1/blue_wins *** ds1.1/lib/domains/campus/txt/ai/charles/bak2/bak1/blue_wins Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/bak1/blue_wins Wed Jul 5 00:01:24 2006 *************** *** 0 **** --- 1 ---- + 151 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/bak2/bak1/fblue ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/bak1/fblue *** ds1.1/lib/domains/campus/txt/ai/charles/bak2/bak1/fblue Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/bak1/fblue Wed Jul 5 00:01:24 2006 *************** *** 0 **** --- 1 ---- + 60 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/bak2/bak1/fgreen ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/bak1/fgreen *** ds1.1/lib/domains/campus/txt/ai/charles/bak2/bak1/fgreen Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/bak1/fgreen Wed Jul 5 00:01:24 2006 *************** *** 0 **** --- 1 ---- + 65 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/bak2/bak1/fred ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/bak1/fred *** ds1.1/lib/domains/campus/txt/ai/charles/bak2/bak1/fred Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/bak1/fred Wed Jul 5 00:01:24 2006 *************** *** 0 **** --- 1 ---- + 64 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/bak2/bak1/green_wins ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/bak1/green_wins *** ds1.1/lib/domains/campus/txt/ai/charles/bak2/bak1/green_wins Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/bak1/green_wins Wed Jul 5 00:01:24 2006 *************** *** 0 **** --- 1 ---- + 147 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/bak2/bak1/percent ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/bak1/percent *** ds1.1/lib/domains/campus/txt/ai/charles/bak2/bak1/percent Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/bak1/percent Wed Jul 5 00:01:24 2006 *************** *** 0 **** --- 1 ---- + 0 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/bak2/bak1/red_wins ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/bak1/red_wins *** ds1.1/lib/domains/campus/txt/ai/charles/bak2/bak1/red_wins Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/bak1/red_wins Wed Jul 5 00:01:24 2006 *************** *** 0 **** --- 1 ---- + 441 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/bak2/bak1/runs ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/bak1/runs *** ds1.1/lib/domains/campus/txt/ai/charles/bak2/bak1/runs Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/bak1/runs Wed Jul 5 00:01:24 2006 *************** *** 0 **** --- 1 ---- + 740 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/bak2/bak1/stays ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/bak1/stays *** ds1.1/lib/domains/campus/txt/ai/charles/bak2/bak1/stays Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/bak1/stays Wed Jul 5 00:01:24 2006 *************** *** 0 **** --- 1 ---- + 269 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/bak2/bak1/switches ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/bak1/switches *** ds1.1/lib/domains/campus/txt/ai/charles/bak2/bak1/switches Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/bak1/switches Wed Jul 5 00:01:24 2006 *************** *** 0 **** --- 1 ---- + 264 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/bak2/bak1/wins ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/bak1/wins *** ds1.1/lib/domains/campus/txt/ai/charles/bak2/bak1/wins Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/bak1/wins Wed Jul 5 00:01:24 2006 *************** *** 0 **** --- 1 ---- + 368 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/bak2/blue_wins ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/blue_wins *** ds1.1/lib/domains/campus/txt/ai/charles/bak2/blue_wins Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/blue_wins Wed Jul 5 00:01:21 2006 *************** *** 0 **** --- 1 ---- + 89 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/bak2/fblue ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/fblue *** ds1.1/lib/domains/campus/txt/ai/charles/bak2/fblue Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/fblue Wed Jul 5 00:01:21 2006 *************** *** 0 **** --- 1 ---- + 90 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/bak2/fgreen ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/fgreen *** ds1.1/lib/domains/campus/txt/ai/charles/bak2/fgreen Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/fgreen Wed Jul 5 00:01:21 2006 *************** *** 0 **** --- 1 ---- + 107 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/bak2/fred ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/fred *** ds1.1/lib/domains/campus/txt/ai/charles/bak2/fred Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/fred Wed Jul 5 00:01:21 2006 *************** *** 0 **** --- 1 ---- + 90 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/bak2/green_wins ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/green_wins *** ds1.1/lib/domains/campus/txt/ai/charles/bak2/green_wins Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/green_wins Wed Jul 5 00:01:21 2006 *************** *** 0 **** --- 1 ---- + 107 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/bak2/percent ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/percent *** ds1.1/lib/domains/campus/txt/ai/charles/bak2/percent Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/percent Wed Jul 5 00:01:21 2006 *************** *** 0 **** --- 1 ---- + 0 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/bak2/red_wins ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/red_wins *** ds1.1/lib/domains/campus/txt/ai/charles/bak2/red_wins Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/red_wins Wed Jul 5 00:01:21 2006 *************** *** 0 **** --- 1 ---- + 92 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/bak2/runs ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/runs *** ds1.1/lib/domains/campus/txt/ai/charles/bak2/runs Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/runs Wed Jul 5 00:01:21 2006 *************** *** 0 **** --- 1 ---- + 288 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/bak2/stays ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/stays *** ds1.1/lib/domains/campus/txt/ai/charles/bak2/stays Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/stays Wed Jul 5 00:01:21 2006 *************** *** 0 **** --- 1 ---- + 13 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/bak2/switches ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/switches *** ds1.1/lib/domains/campus/txt/ai/charles/bak2/switches Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/switches Wed Jul 5 00:01:21 2006 *************** *** 0 **** --- 1 ---- + 8 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/bak2/wins ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/wins *** ds1.1/lib/domains/campus/txt/ai/charles/bak2/wins Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/bak2/wins Wed Jul 5 00:01:21 2006 *************** *** 0 **** --- 1 ---- + 142 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/blue_wins ds2.0r27/lib/domains/campus/txt/ai/charles/blue_wins *** ds1.1/lib/domains/campus/txt/ai/charles/blue_wins Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/blue_wins Wed Jul 5 00:01:18 2006 *************** *** 0 **** --- 1 ---- + 29836 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/fblue ds2.0r27/lib/domains/campus/txt/ai/charles/fblue *** ds1.1/lib/domains/campus/txt/ai/charles/fblue Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/fblue Wed Jul 5 00:01:18 2006 *************** *** 0 **** --- 1 ---- + 7339 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/fgreen ds2.0r27/lib/domains/campus/txt/ai/charles/fgreen *** ds1.1/lib/domains/campus/txt/ai/charles/fgreen Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/fgreen Wed Jul 5 00:01:18 2006 *************** *** 0 **** --- 1 ---- + 7392 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/fred ds2.0r27/lib/domains/campus/txt/ai/charles/fred *** ds1.1/lib/domains/campus/txt/ai/charles/fred Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/fred Wed Jul 5 00:01:18 2006 *************** *** 0 **** --- 1 ---- + 7336 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/green_wins ds2.0r27/lib/domains/campus/txt/ai/charles/green_wins *** ds1.1/lib/domains/campus/txt/ai/charles/green_wins Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/green_wins Wed Jul 5 00:01:18 2006 *************** *** 0 **** --- 1 ---- + 29837 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/percent ds2.0r27/lib/domains/campus/txt/ai/charles/percent *** ds1.1/lib/domains/campus/txt/ai/charles/percent Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/percent Wed Jul 5 00:01:18 2006 *************** *** 0 **** --- 1 ---- + 0 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/red_wins ds2.0r27/lib/domains/campus/txt/ai/charles/red_wins *** ds1.1/lib/domains/campus/txt/ai/charles/red_wins Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/red_wins Wed Jul 5 00:01:18 2006 *************** *** 0 **** --- 1 ---- + 29836 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/runs ds2.0r27/lib/domains/campus/txt/ai/charles/runs *** ds1.1/lib/domains/campus/txt/ai/charles/runs Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/runs Wed Jul 5 00:01:18 2006 *************** *** 0 **** --- 1 ---- + 89509 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/stays ds2.0r27/lib/domains/campus/txt/ai/charles/stays *** ds1.1/lib/domains/campus/txt/ai/charles/stays Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/stays Wed Jul 5 00:01:18 2006 *************** *** 0 **** --- 1 ---- + 7 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/switches ds2.0r27/lib/domains/campus/txt/ai/charles/switches *** ds1.1/lib/domains/campus/txt/ai/charles/switches Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/switches Wed Jul 5 00:01:18 2006 *************** *** 0 **** --- 1 ---- + 89502 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charles/wins ds2.0r27/lib/domains/campus/txt/ai/charles/wins *** ds1.1/lib/domains/campus/txt/ai/charles/wins Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charles/wins Wed Jul 5 00:01:18 2006 *************** *** 0 **** --- 1 ---- + 59696 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charly/bak/blue_wins ds2.0r27/lib/domains/campus/txt/ai/charly/bak/blue_wins *** ds1.1/lib/domains/campus/txt/ai/charly/bak/blue_wins Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charly/bak/blue_wins Wed Jul 5 00:01:21 2006 *************** *** 0 **** --- 1 ---- + 21099 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charly/bak/fblue ds2.0r27/lib/domains/campus/txt/ai/charly/bak/fblue *** ds1.1/lib/domains/campus/txt/ai/charly/bak/fblue Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charly/bak/fblue Wed Jul 5 00:01:21 2006 *************** *** 0 **** --- 1 ---- + 21418 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charly/bak/fgreen ds2.0r27/lib/domains/campus/txt/ai/charly/bak/fgreen *** ds1.1/lib/domains/campus/txt/ai/charly/bak/fgreen Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charly/bak/fgreen Wed Jul 5 00:01:21 2006 *************** *** 0 **** --- 1 ---- + 21227 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charly/bak/fred ds2.0r27/lib/domains/campus/txt/ai/charly/bak/fred *** ds1.1/lib/domains/campus/txt/ai/charly/bak/fred Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charly/bak/fred Wed Jul 5 00:01:21 2006 *************** *** 0 **** --- 1 ---- + 21436 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charly/bak/green_wins ds2.0r27/lib/domains/campus/txt/ai/charly/bak/green_wins *** ds1.1/lib/domains/campus/txt/ai/charly/bak/green_wins Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charly/bak/green_wins Wed Jul 5 00:01:21 2006 *************** *** 0 **** --- 1 ---- + 21611 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charly/bak/percent ds2.0r27/lib/domains/campus/txt/ai/charly/bak/percent *** ds1.1/lib/domains/campus/txt/ai/charly/bak/percent Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charly/bak/percent Wed Jul 5 00:01:21 2006 *************** *** 0 **** --- 1 ---- + 0 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charly/bak/red_wins ds2.0r27/lib/domains/campus/txt/ai/charly/bak/red_wins *** ds1.1/lib/domains/campus/txt/ai/charly/bak/red_wins Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charly/bak/red_wins Wed Jul 5 00:01:21 2006 *************** *** 0 **** --- 1 ---- + 21369 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charly/bak/runs ds2.0r27/lib/domains/campus/txt/ai/charly/bak/runs *** ds1.1/lib/domains/campus/txt/ai/charly/bak/runs Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charly/bak/runs Wed Jul 5 00:01:21 2006 *************** *** 0 **** --- 1 ---- + 64081 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charly/bak/stays ds2.0r27/lib/domains/campus/txt/ai/charly/bak/stays *** ds1.1/lib/domains/campus/txt/ai/charly/bak/stays Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charly/bak/stays Wed Jul 5 00:01:21 2006 *************** *** 0 **** --- 1 ---- + 31999 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charly/bak/switches ds2.0r27/lib/domains/campus/txt/ai/charly/bak/switches *** ds1.1/lib/domains/campus/txt/ai/charly/bak/switches Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charly/bak/switches Wed Jul 5 00:01:21 2006 *************** *** 0 **** --- 1 ---- + 32082 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charly/bak/wins ds2.0r27/lib/domains/campus/txt/ai/charly/bak/wins *** ds1.1/lib/domains/campus/txt/ai/charly/bak/wins Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charly/bak/wins Wed Jul 5 00:01:21 2006 *************** *** 0 **** --- 1 ---- + 31951 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charly/blue_wins ds2.0r27/lib/domains/campus/txt/ai/charly/blue_wins *** ds1.1/lib/domains/campus/txt/ai/charly/blue_wins Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charly/blue_wins Wed Jul 5 00:01:18 2006 *************** *** 0 **** --- 1 ---- + 41046 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charly/fblue ds2.0r27/lib/domains/campus/txt/ai/charly/fblue *** ds1.1/lib/domains/campus/txt/ai/charly/fblue Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charly/fblue Wed Jul 5 00:01:18 2006 *************** *** 0 **** --- 1 ---- + 41644 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charly/fgreen ds2.0r27/lib/domains/campus/txt/ai/charly/fgreen *** ds1.1/lib/domains/campus/txt/ai/charly/fgreen Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charly/fgreen Wed Jul 5 00:01:18 2006 *************** *** 0 **** --- 1 ---- + 41264 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charly/fred ds2.0r27/lib/domains/campus/txt/ai/charly/fred *** ds1.1/lib/domains/campus/txt/ai/charly/fred Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charly/fred Wed Jul 5 00:01:18 2006 *************** *** 0 **** --- 1 ---- + 41579 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charly/green_wins ds2.0r27/lib/domains/campus/txt/ai/charly/green_wins *** ds1.1/lib/domains/campus/txt/ai/charly/green_wins Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charly/green_wins Wed Jul 5 00:01:18 2006 *************** *** 0 **** --- 1 ---- + 41804 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charly/percent ds2.0r27/lib/domains/campus/txt/ai/charly/percent *** ds1.1/lib/domains/campus/txt/ai/charly/percent Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charly/percent Wed Jul 5 00:01:18 2006 *************** *** 0 **** --- 1 ---- + 0 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charly/red_wins ds2.0r27/lib/domains/campus/txt/ai/charly/red_wins *** ds1.1/lib/domains/campus/txt/ai/charly/red_wins Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charly/red_wins Wed Jul 5 00:01:18 2006 *************** *** 0 **** --- 1 ---- + 41637 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charly/runs ds2.0r27/lib/domains/campus/txt/ai/charly/runs *** ds1.1/lib/domains/campus/txt/ai/charly/runs Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charly/runs Wed Jul 5 00:01:18 2006 *************** *** 0 **** --- 1 ---- + 124487 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charly/stays ds2.0r27/lib/domains/campus/txt/ai/charly/stays *** ds1.1/lib/domains/campus/txt/ai/charly/stays Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charly/stays Wed Jul 5 00:01:18 2006 *************** *** 0 **** --- 1 ---- + 62301 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charly/switches ds2.0r27/lib/domains/campus/txt/ai/charly/switches *** ds1.1/lib/domains/campus/txt/ai/charly/switches Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charly/switches Wed Jul 5 00:01:18 2006 *************** *** 0 **** --- 1 ---- + 62186 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/ai/charly/wins ds2.0r27/lib/domains/campus/txt/ai/charly/wins *** ds1.1/lib/domains/campus/txt/ai/charly/wins Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/ai/charly/wins Wed Jul 5 00:01:18 2006 *************** *** 0 **** --- 1 ---- + 62153 \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/campus/txt/bye.txt ds2.0r27/lib/domains/campus/txt/bye.txt *** ds1.1/lib/domains/campus/txt/bye.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/bye.txt Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,12 ---- + __________ __ __ ___________ __ + / /\ / /\ / / / /| / / + / / \ / / \ / / / // / /| + ********** / ** \ ** ***********/ ** | + ** |____** / ** / ** ** |______ ** | + ** / ** **/ **/ ** / /| ** | + **/ **/ \ **** | ** / // ** | + **********/ / ** | *********/ ** / + ** |____** // ** | ** |_________ **/ + ** / **/ ** | ** / /| / /| + **/ **/ ** / **/ // ** / + **********/ **/ ***********/ **/ diff -c -r --new-file ds1.1/lib/domains/campus/txt/dali.txt ds2.0r27/lib/domains/campus/txt/dali.txt *** ds1.1/lib/domains/campus/txt/dali.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/dali.txt Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,86 ---- + ;!>,!!!> + <! ;!!!' + !! `!!!. + !!',!!!> + !! !!!!! + ;!! !!!!! + `!! !!!!! + !! !!!!!> . + `!.`!!!!! ;<!' + !! `!!!! ,<!'` + `!> !!!! ;<!' + <!! !!!!> ;!'` + !!! `!!!! !!` ,c, + !!!> !!!!> ;`< ,cc$$cc .,r== $$c ! + !!!! !!!!!!. ,<!' !!!!!>>>;;;;;;;;.`"?$$c MMMMMMM )MM ,= "$$.` + <!!> !!!!!!!!!!!!!>'' ,>'''' ``````''''!!!; ?$$c`MMMMMM.`MMMP== `$h + `!! ;!!!!!!''''.,;;;''' JF !;;;,,,,; 3$$.`MMMMMb MMMnnnM $$h + ;!! <!!!!.;;!!!''` JF.!!!!!!!!!>`$$h `MMMMM MMMMMMM $$$ + ;!!>`!!!!!!'` ?> !!!!!!!!!> $$$ MMMMM MMMMMMM $$$ + <!! ;!!!!' `h !!!!!!!!!! $$$ MMMMMM MMMM" M $$$ + `!>'!!!! b !!!!!!!!!! $$$ MMMMMM MMML,,`,$$$ + ,,,,,, ;! <!!!> ,,,,,,,,,,,,,,,, $ !!!!!!!!!! $$$ MMMMMM MMMMML J$$F + !!!!!! !! !!!! `!!!!!!!!!!!!!!' ; $ !!!!!!!!!! $$$ MMMMMP.MMMMMP $$$F + !!!!! ;!! !!!!> !!!!!!!!!!!!' ;' .`.`.`. ?.`!!!!!!!!! 3$$ MMMP `MMMMM>,$$P + !!!!' !!' !!!!> !!!!!!!!!!' ;!' `.`.`.`. `h !!!!!!!!! $$$ MMML MMPPP J$$'. + !!!! !!!;!!!!!';!!!!!!!!' ;!' .`.`.`.`.` ?,`!!!!!!!! ?$$ MMMMM.,MM_"',$$F . + !!!';!!!.!!!!' <!!!!!!!` ;' .`.`.`.`.`.`. ? `!!!!!!!>`$$ MMMMMbdML ` $$$ . + ``` !!!> !!!! ```````` ;! .`.`.`.`.`.`.`.` h `!!!!!!> $$ )MMMMMMMMM d$$' `. + !!' !!!''!!! <!!!!!!!> ' .`.`.`.`.`.`.`.`.` `?,`'!!!!! ?$h 4MMMMMMP z$$' .`. + '' <!!! !!!> '''''''' .`.`.`.`.`.`.`.`.`.`.` ?h.``'`..`$$ MMMMMM ,$$F `.`. + ` !!!! <!!!.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`. `"??$F". `$h.`MMMMM $$$'.`.`. + <!'! .!!!!> .`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`. cccc `$$.'4MMP.3$F .`.`. + <!''! !!!!!> .`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`. J$$$$$F . "$h." . 3$h .`.`. + !' ! !!!!!!> .`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`. """" .`.`.`$$, 4 3$$ .`.`. + ;! !!!!!!! `.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`. ?$h J$F .`.`. + ;' !!!!!!! `.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`. "$$$$P' .`.`. + ' <!!!!!!! `.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`. . .`.`.`.`. + ,' !!!!!!! .`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`. + !! !!!!!!',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, `.`.`.`. + !! !!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' `.`.`.`. + !! <!!!!';!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ;! `.`.`.`. + !! ;!!!!>`!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' <!! `.`.`.`. + ',,!!!!''.;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' <!!! `.`.`.`. + '''''.,;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' <!!!! `.`.`.`. + ;!!!!!!!!!!!!!!!!!!!!!!!>>>'''''''''`````''''''<!!!!!!!!!!!' !!!!!! `.`.`.`. + !!!!!!!!!!!!!!!!!!''''_,,uunmnmnmdddPPPPPPbbbnmnyy,_```''! !!!!!!! `.`.`.`. + !!!!!!!!!''_``!'`,nmMMPP"""',.,ccccccr==pccccc,,..`""444n,.`<!!!!!! `.`.`.`. + !!!!!!!' ,dMM ,nMMP"",zcd$h.`$$$$$$$$L c $$$$$$$$$$??cc`4Mn <!!!!! `.`.`.`. + !!!!!! ,MMMP uMMP ,d$$$$$$$$cd$F ??$$$$$cd$$$$$$$$$F, ??h.`Mx !!!!! `.`.`.`. + !!!!!! MMMP uMM",F,c ".$$$$$$$P' ?$$$$$$$$$$$$$$$$C',J$$.`M.`!!!! `.`.`.`. + !!!'` MMM 4MMM L`"=-z$$P".,,. ,c$$$$$$$$$$$$$$$$$$$$$$$ ML !!!! `.`.`.`. + !!!. `"" MMMM `$$hc$$$L,c,.,czc$$$$$$$$$$$$$$$$$$$$$$$$$$.4M `!!! `.`.`.`. + !!!!;;;.. `MMMb ?$$$$$$??""""?????????????????? ;.`$$$$$$$'JM',!!! `.`.`.`. + !!!!!!!!!> 4MMMb."?$$$cc,.. .,,cccccccccccccccc,c`.$$$$$$$ MM <!!! `.`.`.`. + !!!!!!!!!! `MMMMMb,."??$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$?$$$ MM ;!!! `.`.`.`. + !!!!!!!!!! "4MMMMMMmn,."""???$$$$$$$$$$$$$$$$$$ $$$" ?$$ MP !!!! `.`.`.`. + !!!!!!!!!!!;. "4MMMMMMMMMMMmnmn,.`"""?????$$$$$$ ?$$ `CF.M> !!!! `.`.`.`. + !!!!!!!!!!!!!!;. `""44MMMMMMMMMMMMMMMMnnnn. ?$$$.<$$$h.$h MM !!!! `.`.`.`. + !!!!!!!!!!!!!!!!>.;. `""444MMMMMMMMMMMMMb $$$:<$$$$$$$ 4M <!!! `.`.`.`. + !!!!!!!!!!!!!!!!!!!!!;<;);>;. ..""""44MMMM J$' <$$$$$$h`Mb`!!! `.`.`.`. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!>; `MMM ?$. d$$$$$$$ MM.`!! `.`.`.`. + !!!!!!!!!!'``!''' ..`'<!!!!!!!!!!!!!!!; . MMM.<$$ <$$$$$$$$ 4Mb !! `.`.`.`. + !'''''''''.. ;MMMMnn.'!!!!!!!!!!!!!!! ; MMM J$$hJ$$$$$$$$h`MM !! `.`.`.`. + ,xmdMMMbnmx,. MMMMMMMr !!!!!!!!!!!!' ;: MMM $$$$$$$$$$??$$ MM !! `.`.`.`. + P"'.,,,,c`""4MMn MMMMMMx !!!!!!!!!!!` <!: MMM $$$$$$$$L =c$F.MP !! `.`.`.`. + ub "P4MM")M,x,"4b,`44MMMP !!!!!!!!!! !!!: MMM ???$$$$$$"=,$ JM';!! `.`.`.`. + ML,,nn4Mx`"MMMx.`ML ;,,,;<!!!!!!!!! ;!!!!: MMM.-=,$$$$$$hc$'.MP !!! `.`.`.`. + . MMM 4Mx`MMML MM,`<!!!!!!!!!!!! ;!!!!!' `MMb d$$$$$$$$' MM',!!! `.`.`.`. + ,d" MMn. .,nMMMM MMM '!!!!!!!!!!! ;!!!!!!> 4MMb `$$$$$$$'.dM'.!!!! `.`.`.`. + .`"M"_" MMMMMMMP,MMM ;!>>!!!!!!' <!!!!!!!!!. "MMb $$$$$$$ dM ;!!!!! `.`.`.`. + 'nr;MMMMM"MMMP dMM' >>!(!)<<! <!!!!!!!!!!!. `MM.`$$$$$$ MM !!!!!! `.`.`.`. + ",Jn,"". ,uMMP dMMP /)<;>><>' .!!!!!!!!!!!!!!; `Mb $$$$$F;MP !!!!!! `.`.`.`. + dPPM 4MMMMM" dMMP (->;)<><' ;!!!!!!!!!!!!!!!!. 4M $$$$$h M>.!!!!!! `.`.`.`. + =M uMMnMMM" uMMM" <!;/;->;' ;!!!!!!!!!!!!!!!!!; 4M.??"$$',M <!!!!!! `.`.`.`. + JM )MMMM" uMMMM',!>;`(>!>' <!!!!!!!!!!!!!!!!!!! 4M> -??',M' !!!!!!! `.`.`.`. + MM `MP" xdMMMP <(;<:)!`)' <!!!!!!!!!!!!!!!!!!!! MMb - ,M';!!!!!!!' `.`.`.`. + MP ,nMMMMP" (>:)/;<:! !!!!!!!!!!!!!!!!!!!!!! `MM.-= d';!!!!!!!! .`.`.`.`. + ,xndMMMMP" .;)`;:`>(;: !!!!!!!!!!!!!!!!!!!!!!!; 4MMnndM <!!!!!!! .`.`.`.`. + MMMMMP" .;(:`-;(.><(' ;!!!!!!!!!!!!!!!!!!!!!!!!!, 4MMMMP !!!!!!!> `.`.`.`.`. + P"" .,;<):(;/(\'>-)' ;!!!!!!!!!!!!!!!!!!!!!!!!!!!>.`"P" <!!!!!!! .`.`.`.`.`. + ,<;),<-:><;,<- >;>' ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!;;<!!!!!!!! .`.`.`.`.`. + )-/;`<:<;\->:(';(' ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' `.`.`.`.`.`. + :\;`<(.:>-;(;<>: <!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .`.`.`.`.`.`. + (.;>:'<;:<;-/)/ <!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .`.`.`.`.`.`. + ;-;:>:.;`;(';' ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' `.`.`.`.`.`.`. + diff -c -r --new-file ds1.1/lib/domains/campus/txt/doh.txt ds2.0r27/lib/domains/campus/txt/doh.txt *** ds1.1/lib/domains/campus/txt/doh.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/doh.txt Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,16 ---- + DDDDDDDDDDDDD HHHHHHH !!! + D::::::::::::DDD H:::::H !:::! + D:::::::::::::::DD H:::::H !:::! + DDD:::::DDDDD:::::D H:::::H !:::! + D:::::D D:::::D UUUUUU H::::H HHHHH !:::! + D:::::D D:::::D UU::::::UU H::::HH:::::HHH !:::! + D:::::D D:::::D U::::::::::U H::::::::::::::HH !:::! + D:::::D D:::::D U:::::UU:::::U H:::::::HHH::::::H !:::! + D:::::D D:::::D U::::U U::::U H::::::H H::::::H !:::! + D:::::D D:::::D U::::U U::::U H:::::H H:::::H !:::! + D:::::D D:::::D U::::U U::::U H:::::H H:::::H !:! + D:::::D D:::::D U::::U U::::U H:::::H H:::::H !!! + DDD:::::DDDDD:::::D U:::::UU:::::U H:::::H H:::::H + D:::::::::::::::DD U::::::::::U H:::::H H:::::H !!! + D::::::::::::DDD UU::::::UU H:::::H H:::::H !!:!! + DDDDDDDDDDDDD UUUUUU HHHHHHH HHHHHHH !!! diff -c -r --new-file ds1.1/lib/domains/campus/txt/dork.txt ds2.0r27/lib/domains/campus/txt/dork.txt *** ds1.1/lib/domains/campus/txt/dork.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/dork.txt Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,16 ---- + DDDDDDDDDDDDD KKKKKK + D::::::::::::DDD K::::K + D:::::::::::::::DD K::::K + DDD:::::DDDDD:::::D RRRRRR K::::K + D:::::D D:::::D OOOOOO R::::R RRRRR K::::K KKKKKK + D:::::D D:::::D OO::::::OO R::::RR:::::RRR K::::K K::::K + D:::::D D:::::D O::::::::::O R::::::::::::::RR K::::K K::::K + D:::::D D:::::D O:::::OO:::::O R:::::::RRR:::RR K::::KK::::K + D:::::D D:::::D O::::O O::::O R::::::R RRR K:::::::::K + D:::::D D:::::D O::::O O::::O R:::::R K::::::::K + D:::::D D:::::D O::::O O::::O R:::::R K:::::::::K + D:::::D D:::::D O::::O O::::O R:::::R K::::KK::::K + DDD:::::DDDDD:::::D O:::::OO:::::O R:::::R K::::K K::::K + D:::::::::::::::DD O::::::::::O R:::::R K::::K K::::K + D::::::::::::DDD OO::::::OO R:::::R K::::K K::::K + DDDDDDDDDDDDD OOOOOO RRRRRRR KKKKKK KKKKKK diff -c -r --new-file ds1.1/lib/domains/campus/txt/duh.txt ds2.0r27/lib/domains/campus/txt/duh.txt *** ds1.1/lib/domains/campus/txt/duh.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/duh.txt Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,20 ---- + + + DDDDDDDDDDDDD HHHHHHH ????????? + D::::::::::::DDD H:::::H ?::::::::::? + D:::::::::::::::DD H:::::H ?:::??????:::? + DDD:::::DDDDD:::::D H:::::H ?:::? ?:::? + D:::::D D:::::D UUUUUU UUUUUU H::::H HHHHH ??:?? ?:::? + D:::::D D:::::D U::::U U::::U H::::HH:::::HHH ??? ?:::? + D:::::D D:::::D U::::U U::::U H::::::::::::::HH ?:::? + D:::::D D:::::D UU:::U U::::U H:::::::HHH::::::H ?:::? + D:::::D D:::::D U:::U U::::U H::::::H H::::::H ?:::? + D:::::D D:::::D U:::U U::::U H:::::H H:::::H ?:::? + D:::::D D:::::D U:::U U::::U H:::::H H:::::H ??:?? + D:::::D D:::::D U:::U U::::U H:::::H H:::::H ??? + DDD:::::DDDDD:::::D U::::UU:::::UU H:::::H H:::::H + D:::::::::::::::DD U::::::::::::U H:::::H H:::::H ??? + D::::::::::::DDD UU:::::UU:::U H:::::H H:::::H ??:?? + DDDDDDDDDDDDD UUUUU UUUU HHHHHHH HHHHHHH ??? + + diff -c -r --new-file ds1.1/lib/domains/campus/txt/finger.txt ds2.0r27/lib/domains/campus/txt/finger.txt *** ds1.1/lib/domains/campus/txt/finger.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/finger.txt Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,13 ---- + /"\ + |\./| + | | + |>*<| + | | + /'\| |/'\ + /'\| | | | + | %%%%% | |\ Get a clue. + | | | | | \ + | * * * * |> > + | / + | / + |_____________/ diff -c -r --new-file ds1.1/lib/domains/campus/txt/hi.txt ds2.0r27/lib/domains/campus/txt/hi.txt *** ds1.1/lib/domains/campus/txt/hi.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/hi.txt Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,17 ---- + ******** ******** ********************* + * ** * ** * ** + * * * * * * * * * + * * * * * * * * * + ******** * ******** * ********************* * + ******** * ******** * ********************** + ******** * ******** * ********************* + ******** * ******** * ******** * + *********************** * ******** * + *********************** * ********** ******** + *********************** * * ******** * ** + ******** * ******** * * ******** * * * + ******** * ******** * * ******** * * + ******** * ******** * ********************* * + ********* ********* ********************** + ******** ******** ********************* + diff -c -r --new-file ds1.1/lib/domains/campus/txt/hug.txt ds2.0r27/lib/domains/campus/txt/hug.txt *** ds1.1/lib/domains/campus/txt/hug.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/hug.txt Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,26 ---- + + + HHHHHHHHHH HHHHHHHHHH UUUUUUUUUU UUUUUUUUUU GGGGGGGGGG + HHHHHHHHHH HHHHHHHHHH UUUUUUUUUU UUUUUUUUUU GGGGGGGGGGGG + HHHHHHHHHH HHHHHHHHHH UUUUUUUUUU UUUUUUUUUU GGGGGGGGGGGGGG + HHHHHHHHHH HHHHHHHHHH UUUUUUUUUU UUUUUUUUUU GGGGGGGGGGGGGGGG + HHHHHHHHHH HHHHHHHHHH UUUUUUUUUU UUUUUUUUUU GGGGGGGGGGGGGGGG + HHHHHHHHHH HHHHHHHHHH UUUUUUUUUU UUUUUUUUUU GGGGG GGGGG + HHHHHHHHHH HHHHHHHHHH UUUUUUUUUU UUUUUUUUUU GGGGG GGGGG + HHHHHHHHHH HHHHHHHHHH UUUUUUUUUU UUUUUUUUUU GGGGG + HHHHHHHHHH HHHHHHHHHH UUUUUUUUUU UUUUUUUUUU GGGGG + HHHHHHHHHHHHHHHHHHHHHHHHH UUUUUUUUUU UUUUUUUUUU GGGGG + HHHHHHHHHHHHHHHHHHHHHHHHH UUUUUUUUUU UUUUUUUUUU GGGGG + HHHHHHHHHHHHHHHHHHHHHHHHH UUUUUUUUUU UUUUUUUUUU GGGGG + HHHHHHHHHHHHHHHHHHHHHHHHH UUUUUUUUUU UUUUUUUUUU GGGGG GGGGGGGG + HHHHHHHHHHHHHHHHHHHHHHHHH UUUUUUUUUU UUUUUUUUUU GGGGG GGGGGGGG + HHHHHHHHHH HHHHHHHHHH UUUUUUUUUU UUUUUUUUUU GGGGG GGGGG + HHHHHHHHHH HHHHHHHHHH UUUUUUUUUU UUUUUUUUUU GGGGG GGGGG + HHHHHHHHHH HHHHHHHHHH UUUUUUUUUU UUUUUUUUUU GGGGG GGGGG + HHHHHHHHHH HHHHHHHHHH UUUUUUUUUUUUUUUUUUUUUUUUU GGGGGGGGGGGGGGGG + HHHHHHHHHH HHHHHHHHHH UUUUUUUUUUUUUUUUUUUUUUU GGGGGGGGGGGGGG + HHHHHHHHHH HHHHHHHHHH UUUUUUUUUUUUUUUUUUUUU GGGGGGGGGGGG + HHHHHHHHHH HHHHHHHHHH UUUUUUUUUUUUUUUUUUU GGGGGGGGGG + HHHHHHHHHH HHHHHHHHHH UUUUUUUUUUUUUUUUU GGGGGGGG + + diff -c -r --new-file ds1.1/lib/domains/campus/txt/huh.txt ds2.0r27/lib/domains/campus/txt/huh.txt *** ds1.1/lib/domains/campus/txt/huh.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/huh.txt Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,16 ---- + HHHHHHHHHHH HHHHHHHHHHH HHHHHHH ????????? + H:::::::::H H:::::::::H H:::::H ?::::::::::? + H:::::::::H H:::::::::H H:::::H ?:::??????:::? + HHH:::::HHH HHH:::::HHH H:::::H ?:::? ?:::? + H:::::H H:::::H UUUUUU UUUUUU H::::H HHHHH ??:?? ?:::? + H:::::H H:::::H U::::U U::::U H::::HH:::::HHH ??? ?:::? + H:::::HHHHHHHH:::::H U::::U U::::U H::::::::::::::HH ?:::? + H::::::::::::::::::H UU:::U U::::U H:::::::HHH::::::H ?:::? + H::::::::::::::::::H U:::U U::::U H::::::H H::::::H ?:::? + H:::::HHHHHHHH:::::H U:::U U::::U H:::::H H:::::H ?:::? + H:::::H H:::::H U:::U U::::U H:::::H H:::::H ??:?? + H:::::H H:::::H U:::U U::::U H:::::H H:::::H ??? + HHH:::::HHH HHH:::::HHH U::::UU:::::UU H:::::H H:::::H + H:::::::::H H:::::::::H U::::::::::::U H:::::H H:::::H ??? + H:::::::::H H:::::::::H UU:::::UU:::U H:::::H H:::::H ??:?? + HHHHHHHHHHH HHHHHHHHHHH UUUUU UUUU HHHHHHH HHHHHHH ??? diff -c -r --new-file ds1.1/lib/domains/campus/txt/jenny/1.txt ds2.0r27/lib/domains/campus/txt/jenny/1.txt *** ds1.1/lib/domains/campus/txt/jenny/1.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/jenny/1.txt Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,3 ---- + %^RESET%^Jennybot says, "%^BOLD%^CYAN%^ Ok! I'm going to try to give you some tips so that you can enjoy your visit to the LPC University Virtual Campus. Please note you can deactivate me at any time by typing: %^RED%^deactivate bot%^BOLD%^CYAN%^ + + Also, please remember that I am just a machine, so I will not understand anything you try to tell me. I will pause between tips, to give you time to read, or to deactivate me. As I continue, my tips will gain in technical complexity, so even if you are an experienced "MUDder", you may gain some benefit from listening to me.%^RESET%^" diff -c -r --new-file ds1.1/lib/domains/campus/txt/jenny/10.txt ds2.0r27/lib/domains/campus/txt/jenny/10.txt *** ds1.1/lib/domains/campus/txt/jenny/10.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/jenny/10.txt Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,3 ---- + %^RESET%^Jennybot says, "%^BOLD%^CYAN%^ In some cases, other people in the same room as you might have apples. The MUD might not be sure whether you mean your own apple or someone else's. In this case, you want to get more specific: "%^RED%^eat my apple%^BOLD%^CYAN%^", or "%^RED%^eat first apple%^BOLD%^CYAN%^". + + If a command doesn't work one way, try it another way. If the MUD doesn't understand "%^RED%^shoot jennybot%^BOLD%^CYAN%^", try "%^RED%^shoot jennybot with gun%^BOLD%^CYAN%^" or maybe "%^RED%^shoot my squirt gun at jennybot%^BOLD%^CYAN%^".%^RESET%^" diff -c -r --new-file ds1.1/lib/domains/campus/txt/jenny/11.txt ds2.0r27/lib/domains/campus/txt/jenny/11.txt *** ds1.1/lib/domains/campus/txt/jenny/11.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/jenny/11.txt Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,3 ---- + %^RESET%^Jennybot says, "%^BOLD%^CYAN%^ Other very common commands are "%^RED%^score%^BOLD%^CYAN%^" to let you know your general condition, and "%^RED%^status%^BOLD%^CYAN%^" to give you a specific readout of your health and stamina. hp are health points, and it they reach zero, your body dies. + + Sp are stamina points. If they reach zero, you will be unable to do anything for a while, until you rest and your strength returns. Mp are mana points, which are a little too complicated for me to explain right now. If you don't already know what they are, you don't have to worry about them. Just trust me on that.%^RESET%^" diff -c -r --new-file ds1.1/lib/domains/campus/txt/jenny/12.txt ds2.0r27/lib/domains/campus/txt/jenny/12.txt *** ds1.1/lib/domains/campus/txt/jenny/12.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/jenny/12.txt Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,9 ---- + %^RESET%^Jennybot says, "%^BOLD%^CYAN%^ Ok, we're coming close to the end of my speech here. Whew! + + There are two kinds of living beings you will encounter on LPC University. The first are called "player characters". They are players like you: human beings manipulating their virtual bodies and using the MUD as a way to communicate. + + The other kind are "non-player character". This kind of living being is most often referred to as an "NPC". I am an example of an NPC. Although I am talking to you, this body is under the control of the MUD program. I can't talk to you about the latest reality TV show or your favorite performer...because the MUD is just a program and doesn't understand such things. + + NPC's are a way for the MUD to provide the virtual environment some added realism. If you walk through a forest, you might expect to see birds, or rabbits, or foxes. When NPC's arrive in your environment, or you arrive in theirs, you can interact with them...but only up to a point. There isn't a person controlling their bodies...just the MUD simulating a living being. + + NPC's are sometimes referred to as MOB's or mobiles, because they often can wander from one place to another in this virtual environment.%^RESET%^" diff -c -r --new-file ds1.1/lib/domains/campus/txt/jenny/13.txt ds2.0r27/lib/domains/campus/txt/jenny/13.txt *** ds1.1/lib/domains/campus/txt/jenny/13.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/jenny/13.txt Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,3 ---- + %^RESET%^Jennybot says, "%^BOLD%^CYAN%^ Some NPC's fill specific roles. For example, if you go to the campus bookstore, you will be able to buy and sell some things. Kim, the shopkeeper, can respond to various requests, such as "%^RED%^list%^BOLD%^CYAN%^" to see what's for sale, "%^RED%^appraise hat%^BOLD%^CYAN%^" to see what she thinks your hat is worth and "%^RED%^sell hat to kim%^BOLD%^CYAN%^" to exchange your headgear for money. If you think you need a backpack and you've got the funds, try "%^RED%^buy first backpack from kim%^BOLD%^CYAN%^". To know how much money you have, type: "%^RED%^money%^BOLD%^CYAN%^". + + Some vendors will only handle specific kinds of things. Kim will not buy or sell weapons or food. Gloria in the snack bar, though, will vend food but not buy or sell anything else.%^RESET%^" diff -c -r --new-file ds1.1/lib/domains/campus/txt/jenny/14.txt ds2.0r27/lib/domains/campus/txt/jenny/14.txt *** ds1.1/lib/domains/campus/txt/jenny/14.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/jenny/14.txt Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,5 ---- + %^RESET%^Jennybot says, "%^BOLD%^CYAN%^ There are some players who have the title "creator", "wizard", or "arch". These are the people who work on and with the technical parts of the MUD program. They are the folks who use the LPC programming language to create environments and NPC's, and make sure that a box behaves like a box. + + If you think you'd like to learn some LPC programming and join the LPC University staff let us know. Go to the mail room and mail the administrator. + + Be aware that it's fun, but it really is programming, with functions and variables and everything.%^RESET%^" diff -c -r --new-file ds1.1/lib/domains/campus/txt/jenny/15.txt ds2.0r27/lib/domains/campus/txt/jenny/15.txt *** ds1.1/lib/domains/campus/txt/jenny/15.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/jenny/15.txt Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,13 ---- + %^RESET%^Jennybot says, "%^BOLD%^CYAN%^ Well, that about wraps it up for my spiel. Thank you for listening. If you get stuck or confused type "%^RED%^help%^BOLD%^CYAN%^" to enter the system help menus. + + If other players are in this room, you can communicate by typing: "%^RED%^say blah blah blah%^BOLD%^CYAN%^". Everyone in the same room will hear your conversation. + + + If you know someone is logged in but they are not in the same room, you can communicate by typing: "%^RED%^tell joey blah blah blah%^BOLD%^CYAN%^". This is a private communication channel and you can also use it if you're in the same room and you want to discuss things you'd rather not share with bystanders. + + Oh, speaking of privacy...you don't have any. The University reserves the right to review, monitor, etc, yakety schmakety. + + Point is, anything that really really needs to stay private, still needs to be discussed face to face, in the real world. + + + Have fun exploring!%^RESET%^" diff -c -r --new-file ds1.1/lib/domains/campus/txt/jenny/2.txt ds2.0r27/lib/domains/campus/txt/jenny/2.txt *** ds1.1/lib/domains/campus/txt/jenny/2.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/jenny/2.txt Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,5 ---- + %^RESET%^Jennybot says, "%^BOLD%^CYAN%^ First, the most basic stuff: Your computer is connected to our computer via the Internet. This connection is kind of like the World Wide Web, except, as you see, there are no pictures. Just text. + + When you connected to our computer, you logged on to a program we are running. This program is what the LPC University Virtual Campus is made of. + + LPC University is a MUD, which is kind of like a chat program, where you type stuff and can communicate with other people. When I refer to "the MUD", I'm talking about that program. MUD stands for "Multi User Domain".%^RESET%^" diff -c -r --new-file ds1.1/lib/domains/campus/txt/jenny/3.txt ds2.0r27/lib/domains/campus/txt/jenny/3.txt *** ds1.1/lib/domains/campus/txt/jenny/3.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/jenny/3.txt Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,7 ---- + %^RESET%^Jennybot says, "%^BOLD%^CYAN%^ The big difference between LPC University and Internet chat programs is that here you can interact with the program itself, not just the people connected to it. + + When you interact with the program, or MUD, the program pretends that you have a body inside the program. That is your virtual body. When you enter a command, the MUD interprets this as your virtual body trying to do something. + + For example, right now the program is pretending that your body is inside a room called the "Admissions office". If you type: "%^RED%^look%^BOLD%^CYAN%^" (without quotation marks) and hit enter, you will be given a description of the room as if your virtual body was looking around. + + "%^RED%^look%^BOLD%^CYAN%^" is a command, and you can use different commands to get your virtual body to do things within this virtual environment. The MUD will tell you how your action affects your environment, and it will also tell you if it didn't understand what you meant.%^RESET%^" diff -c -r --new-file ds1.1/lib/domains/campus/txt/jenny/4.txt ds2.0r27/lib/domains/campus/txt/jenny/4.txt *** ds1.1/lib/domains/campus/txt/jenny/4.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/jenny/4.txt Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,5 ---- + %^RESET%^Jennybot says, "%^BOLD%^CYAN%^ I've just given you a list. It is now in the inventory of virtual items your virtual body is carrying. To get a list of items you are carrying, type "%^RED%^inventory%^BOLD%^CYAN%^". I've given you this list so you can read it. It contains various MUD commands you will find useful. Type "%^RED%^read list%^BOLD%^CYAN%^". + + Ok, from now on, when you log on, you will be carrying this list on you, and you can use it as a reference if you get stuck. Of course, if you "%^RED%^drop list%^BOLD%^CYAN%^", then it will fall to the floor, and you will no longer have it. You might be able to read it, or you might not. If you leave the room, you won't be able to read it. + + Now that you have a general idea of how to do some stuff, let me give you another command that you might find useful. My tips are prerecorded messages, and you might not like the pauses between messages. To skip to the next tip, type "%^RED%^next tip%^BOLD%^CYAN%^".%^RESET%^" diff -c -r --new-file ds1.1/lib/domains/campus/txt/jenny/5.txt ds2.0r27/lib/domains/campus/txt/jenny/5.txt *** ds1.1/lib/domains/campus/txt/jenny/5.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/jenny/5.txt Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,7 ---- + %^RESET%^Jennybot says, "%^BOLD%^CYAN%^ When you finally do decide to leave this room and explore other areas of LPC University, you will use commands like "%^RED%^go north%^BOLD%^CYAN%^", "%^RED%^open door%^BOLD%^CYAN%^", or "%^RED%^climb tree%^BOLD%^CYAN%^". When you move to a new location, a description of that new place will be provided. + + Right now, because you are new, you are limited to exploring the rooms inside this building, the LPC University Virtual Campus Administration Building. This way, you can move around and get used to your new body without fear of getting lost or injured. + + Yes, your body can sustain injury. In trying to provide the illusion of a virtual reality, the realities of injury, sickness, and even death are possible for your virtual body to experience. + + Not while you're in this building, though.%^RESET%^" diff -c -r --new-file ds1.1/lib/domains/campus/txt/jenny/6.txt ds2.0r27/lib/domains/campus/txt/jenny/6.txt *** ds1.1/lib/domains/campus/txt/jenny/6.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/jenny/6.txt Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1 ---- + %^RESET%^Jennybot says, "%^BOLD%^CYAN%^ Here's a map of this building. Type "%^RED%^read map%^BOLD%^CYAN%^"%^RESET%^" diff -c -r --new-file ds1.1/lib/domains/campus/txt/jenny/7.txt ds2.0r27/lib/domains/campus/txt/jenny/7.txt *** ds1.1/lib/domains/campus/txt/jenny/7.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/jenny/7.txt Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,7 ---- + %^RESET%^Jennybot says, "%^BOLD%^CYAN%^ As you can see, there aren't too many rooms available to you right now. There are many other places the MUD can take you to, though, once you know your way around. You might even be able to sneak out of the building, and visit the virtual world outside it. + + The MUD understands some convenient abbreviations. Instead of "%^RED%^go south%^BOLD%^CYAN%^" you can just type "%^RED%^s%^BOLD%^CYAN%^", and your command will be understood. Similarly, "%^RED%^i%^BOLD%^CYAN%^" will show you the inventory of items you are carrying. + + Other common commands are "%^RED%^who%^BOLD%^CYAN%^" to see who else is logged on, "%^RED%^quit%^BOLD%^CYAN%^" to leave the mud, "%^RED%^drop%^BOLD%^CYAN%^" and "%^RED%^get%^BOLD%^CYAN%^", as in "%^RED%^drop map%^BOLD%^CYAN%^", and "%^RED%^get map%^BOLD%^CYAN%^". + + If you get articles of clothing or jewelry they can be worn, as in "%^RED%^wear hat%^BOLD%^CYAN%^".%^RESET%^" diff -c -r --new-file ds1.1/lib/domains/campus/txt/jenny/8.txt ds2.0r27/lib/domains/campus/txt/jenny/8.txt *** ds1.1/lib/domains/campus/txt/jenny/8.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/jenny/8.txt Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,13 ---- + %^RESET%^Jennybot says, "%^BOLD%^CYAN%^ To examine items more closely, such as a hat, you can type "%^RED%^exa hat%^BOLD%^CYAN%^" or "%^RED%^look at hat%^BOLD%^CYAN%^", or even "%^RED%^l hat%^BOLD%^CYAN%^". + + Some objects can contain other objects, like bags or boxes. If you examine such a container, you will get a description of its exterior. To know what is in it, you must, for example, "%^RED%^look in bag%^BOLD%^CYAN%^". + + To remove something from its container, the command might be "%^RED%^get gun from bag%^BOLD%^CYAN%^" + + Now, we don't promote violence as a positive thing here. That's just a squirt gun in the bag, and nobody can get hurt with it. + + On the outside, you might need a real weapon to defend yourself, as you might in real life. + + Weapons typically must be wielded to be used. For example "%^RED%^wield squirt gun%^BOLD%^CYAN%^" would enable you to shoot it, and "%^RED%^shoot squirt gun at jennybot%^BOLD%^CYAN%^" would discharge the weapon. + + We strongly discourage the use of lethal force within the administrative building. Attacks are automatically prevented here, and attempted attacks can lead to MUD punishment.%^RESET%^" diff -c -r --new-file ds1.1/lib/domains/campus/txt/jenny/9.txt ds2.0r27/lib/domains/campus/txt/jenny/9.txt *** ds1.1/lib/domains/campus/txt/jenny/9.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/jenny/9.txt Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,7 ---- + %^RESET%^Jennybot says, "%^BOLD%^CYAN%^ The manipulation of these virtual objects is usually a pretty intuitive process. The "%^RED%^examine thing%^BOLD%^CYAN%^" description usually gives you the clues you need to use a thing. + + Sometimes, though, you have more than one of a similar object. If you're carrying two apples, for example, you might want to specify which one you want to eat. + + You don't want to make yourself sick by eating the rotten apple, but if you just type "%^RED%^eat apple%^BOLD%^CYAN%^", the MUD doesn't know which one you mean. Usually your command won't be executed, and you will be asked which one of the objects you mean. + + In this case, let's get rid of the bad apple. type "%^RED%^put rotten apple in bin%^BOLD%^CYAN%^". There is a recycling bin here, where all kinds of objects can be vaporized and their bits reused. Don't worry, living beings can't enter it.%^RESET%^" diff -c -r --new-file ds1.1/lib/domains/campus/txt/jenny/spiel.txt ds2.0r27/lib/domains/campus/txt/jenny/spiel.txt *** ds1.1/lib/domains/campus/txt/jenny/spiel.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/jenny/spiel.txt Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1 ---- + %^BOLD%^CYAN%^! I'm Jenny, the LPC University automated guide bot. If you'd like an orientation on this place, type: %^RESET%^ diff -c -r --new-file ds1.1/lib/domains/campus/txt/lisa.txt ds2.0r27/lib/domains/campus/txt/lisa.txt *** ds1.1/lib/domains/campus/txt/lisa.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/lisa.txt Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,47 ---- + iIYVVVVXVVVVVVVVVYVYVYYVYYYYIIIIYYYIYVVVYYYYYYYYYVVYVVVVXVVVVVYI+. + tYVXXXXXXVXXXXVVVYVVVVVVVVVVVVYVVVVVVVVVVVVVVVVVXXXXXVXXXXXXXVVYi. + iYXRXRRRXXXXXXXXXXXVVXVXVVVVVVVVXXXVXVVXXXXXXXXXXXXXXRRRRRRRRRXVi. + tVRRRRRRRRRRRRRRRXRXXXXXXXXXXXXXXRRXXXXRRRRXXXXXXXRRRRRRRRRRRRXV+. + tVRRBBBRMBRRRRRRRRRXXRRRRRXt=+;;;;;==iVXRRRRXXXXRRRRRRRRMMBRRRRXi, + tVRRBMBBMMBBBBBMBBRBBBRBX++=++;;;;;;:;;;IRRRRXXRRRBBBBBBMMBBBRRXi, + iVRMMMMMMMMMMMMMMBRBBMMV==iIVYIi=;;;;:::;;XRRRRRRBBMMMMMMMMBBRRXi. + iVRMMMMMMMMMMMMMMMMMMMY;IBWWWWMMXYi=;:::::;RBBBMMMMMMMMMMMMMMBBXi, + +VRMMRBMMMMMMMMMMMMMMY+;VMMMMMMMRXIi=;:::::=VVXXXRRRMMMMMMMMBBMXi; + =tYYVVVXRRRXXRBMMMMMV+;=RBBMMMXVXXVYt;::::::ttYYVYVVRMMMMMMBXXVI+= + ;=tIYYVYYYYYYVVVMMMBt=;;+i=IBi+t==;;i;::::::+iitIIttYRMMMMMRXVVI=; + ;=IIIIYYYIIIIttIYItIt;;=VVYXBIVRXVVXI;::::::;+iitttttVMMBRRRVVVI+, + ;+++tttIttttiiii+i++==;;RMMMBXXMMMXI+;::::::;+ittttitYVXVYYIYVIi;; + ;===iiittiiIitiii++;;;;:IVRVi=iBXVIi;::::::::;==+++++iiittii+++=;; + ;;==+iiiiiiiiii+++=;;;;;;VYVIiiiVVt+;::::::::;++++++++++iti++++=;; + ;;=++iiii+i+++++iii==;;;::tXYIIYIi+=;:::::,::;+++++++++++++++++=;; + ;;;+==+ii+++++iiiiit=;;:::::=====;;;::::::::::+++i+++++++++i+++;;; + ;;;==+=+iiiiitttIIII+;;;:,::,;;;;:;=;;;::,::::=++++++++==++++++;;; + :;====+tittiiittttti+;;::::,:=Ytiiiiti=;:::::,:;;==ii+ittItii+==;; + ;;+iiittIti+ii;;===;;:;::::;+IVXVVVVVVt;;;;;::::;;===;+IIiiti=;;;; + ;=++++iIti+ii+=;;;=;:::;;+VXBMMBBBBBBXY=;=;;:::::;=iYVIIttii++;;;; + ;;++iiiItttIi+++=;;:::;=iBMMMMMMMMMMMXI==;;,::;;:;;=+itIttIIti+;;; + ;=+++++i+tYIIiii;:,::;itXMMMMMMMMMMMBXti==;:;++=;:::::;=+iittti+;; + ;;+ii+ii+iitiIi;::::;iXBMMMMMWWWWWMMBXti+ii=;::::,,,,:::=;==+tI+;; + ;;iiiitItttti;:::;::=+itYXXMWWWWWWMBYt+;;::,,,,,,,,,,,,,:==;==;;;; + :;=iIIIttIt+:;:::;;;==;+=+iiittttti+;;:,:,,,,::,,,,,,,,:::;=;==::; + ;::=+ittiii=;:::::;;;:;:;=++==;;==;:,,,,,,:;::::,,,,,,,,::;==;;::; + :::;+iiiii=;::::,:;:::::;;:;;::;:::,,,,,,,:::;=;;;:,,,,,:::;;::::; + :;;iIIIIII=;:::,:::::::,::::,:::,,,,,,,,,,,:;;=;:,,,,,,::::;=;:::; + :;==++ii+;;;:::::::::::,,,,,,::,,,,,,,,,,,::::,,,,,,,,,,:,:::::::; + ::;;=+=;;;:::;;::,,,,,,,,,,,,,,,,,,,,,,,,,:,,,,,,,,,,,,,,,,,:::::; + ::;=;;;:;:::;;;;::,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,::,,::::; + :;;:;::::::,::,,:,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,:::; + :::::::::::;;;:,,,,,,,,,,,,,...,...,,,.,,,,,,,,,,,,.,,,,,,,,,,,,:; + ::::::::;=;;;;;::,,,,,,,,,,,.......,...,,,,,,,,,,,,.,,,,,,,,,,,,,; + :::::,,:;=;;;;;;;iVXXXVt+:,,....,,,,....,.,,,,,,,.,.....,,,,,,,,:; + :,,::,,:::;;;;;;=IVVVXXXXVXVt:,,,,,..,..,,,,.,,,,,..,.,,,,,,,,,,,; + ::,::,,,:,:::::,::;=iIYVXVVVVIYIi;,,.,.,,,::,,,,,,,,,,,,,,,,,,,,,. + :,,,,,,,,,,,,,,,,::;+itIIIIIIi:;;i++=;;;;;;;;;::,,,...,,..,,,,,,,. + :,,,,,,,,,,,,,,=iitVYi++iitt==it;;:;;;;::;;::::,,,......,,,,,,,::. + ::,,,,,,,,,,,,,++iiIVIi=;;=;+i;:;+:::,,,,,,,,,,,,,.....,,,,,,,,::, + ,,,,,,,,,,,,,,,;=+it=:::,,,,,,,,,,.,......,,.,..........,,,,,,,,:: + :,,,,,,,,,,,,,,,,:=:,,,,,,,,,,,,,,......................,.,,.,.,,: + :,,,,,,,,,,,,,,,,,:,,,,,,,,,,..,........................,..,...,,: + ,,,,,,,,,,,,,,,,,,,.....................................,.......,, + ,,,,,,,,,.,,,,,,,...............................................,, + itittiiiii+=++=;;=iiiiiiittiiiiii+iii===;++iiitiiiiiii+=====+ii=+i diff -c -r --new-file ds1.1/lib/domains/campus/txt/list.txt ds2.0r27/lib/domains/campus/txt/list.txt *** ds1.1/lib/domains/campus/txt/list.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/list.txt Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,37 ---- + Common player commands: + --------------- + look, l + inventory, i + help + score + status + who + tell (example: "tell mike where are you?") + say, ' (example: "' hi", "say nice to meet you!) + + Common object commands: + ----------------------- + look at, look in (example: "l in treasure chest") + examine, exa + get, drop (example: "get bag", "get all from box") + open, close (example: "open door", "open glass case") + read (example: "read writing on cap") + put (example: "put red ball in my first bag") + + Common Movement commands: + ------------------------- + n,s,e,w,u,d + go north, go south, go east, go west, go up, go down + out, go out + crawl (example: "crawl south", "crawl into passageway" ) + climb (example: "climb tree") + enter (example: "enter crawlspace") + + Vendor commands: + ---------------- + money + appraise + price + show + buy, sell + diff -c -r --new-file ds1.1/lib/domains/campus/txt/map.txt ds2.0r27/lib/domains/campus/txt/map.txt *** ds1.1/lib/domains/campus/txt/map.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/map.txt Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,21 ---- + + N + | + | + W --------- E LPC University Virtual Campus Administrative Building + | + | + S ------------- ------------ ------------- + | mail room | |snack bar | | bookstore | + ------------- ------------ ------------- + ----------- | | | + | Outside |------------------------------------------------------ + ----------- | | | | + ------------- ------------- --------- ------------------- + | stairwell | |admissions | |lounge | | conference room | + ------------- ------------- --------- ------------------- + + Please note that you are safe inside this building, but going + to The Outside may be hazardous if you are not adequately prepared. + + diff -c -r --new-file ds1.1/lib/domains/campus/txt/moochers.txt ds2.0r27/lib/domains/campus/txt/moochers.txt *** ds1.1/lib/domains/campus/txt/moochers.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/moochers.txt Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1 ---- + Testylus:EOF diff -c -r --new-file ds1.1/lib/domains/campus/txt/rose.txt ds2.0r27/lib/domains/campus/txt/rose.txt *** ds1.1/lib/domains/campus/txt/rose.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/rose.txt Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,88 ---- + + + "M, .mM" + IMIm ,mIM" + ,MI:"IM,mIMm + "IMmm, ,IM::::IM::IM, ,m" + "IMMIMMIMm::IM:::::IM""==mm + ,mIM::::::MIM:::::::IM::::mIMIM" + ,mMIMIMIIMIMM::::::::mM::::::::IMIMI + IMM:::::::::IMM::::::M::::::::IIM:::::::MM, + "IMM::::::::::MM:::M:::::::IM:::::::::::IM, + "IMm::::::::IMMM:::::::IM:::::::::::::IM, + "Mm:::::::::IM::::::MM::::::::::::::::IM, + IM:::::::::IM::::::MM::::::::::::::::::IM, + MM::::::::IM:::::::IM::::::::::::::::::IM + "IM::::::::IM:::::::IM:::::::::::::::::IM;. + "IM::::::::MM::::::::IM::::::::::mmmIMMMMMMMm,. + IM::::::::IM:::::::IM::::mIMIMM"""". .. "IMMMM + "IM::::::::IM::::::mIMIMM"". . . . . .,mM" + IMm:::::::IM::::IIMM" . . . . . ..,mMM" + "IMMIMIMMIMM::IMM" . . . ._.,mMM + ,IM". . ."IMIM". . . .,mMMMMMMMM" + ,IM . . . .,IMM". . . ,mMMMMMMMMM" + IM. . . .,mIIMM,. . ..mMMMMMMMMM + ,M"..,mIMMIMMIMMIMmmmMMMMM + IM.,IMI""" ""IIMMMMMMMMMM + ;IMIM" ""IMMMMMMM + "" "IMMMMM + "IMMM + "IMM, + "IMM + "MM, + IMM, + "IMM .mIMMIMMIMMIMMIM, + .,mIMMIMMIMM, ,mIMM, IMM""" ,mIM". . . . . . . " + ,IMMM' . . . "IMM.\ "M, IMM ,IM". . . . / :;IM \ M, + .mIM' . . . / .:"IM.\ MM "MM, ,M". . . / .;mIMIMIM,\ M + ,IM'. . . / . .:;,IMIMIMMM IMM ,M". . / .:mIM"' "IM,:M + ,IM'. . . / . .:;,mIM" `"IMM IMM IM. . / .mM" "IMI + ,IM . . / . .:;,mIM" "IMMMMM MM,. / ,mM "M' + IM'. . / . .;,mIM" "IIMMM ,IMIM,.,IM" + IM . . / . .,mIM" IMMMMMMM' """ + `IM,. / ;,mIM" IIMMM + "IMI, /,mIM" __IMMM + "IMMMM" """IMM + "" IMM + " IMM__ + IMM""" + IMM + IMM + IMM + """IMM + IMM + IMM + IMM""" + IMM + IMM + """IMM + IMM + IMM + IMM""" + IMM + """IMM + IMM + IMM__ + IMM""" + IMM + IMM + IMM + "IMM .mIMMIMMIMMIMMIM, + .,mIMMIMMIMM, ,mIMM, IMM""" ,mIM". . . . . . . " + ,IMMM' . . . "IMM.\ "M, IMM ,IM". . . . / :;IM \ M, + .mIM' . . . / .:"IM.\ MM "MM, ,M". . . / .;mIMIMIM,\ M + ,IM'. . . / . .:;,IMIMIMMM IMM ,M". . / .:mIM"' "IM,:M + ,IM'. . . / . .:;,mIM" `"IMM IMM IM. . / .mM" "IMI + ,IM . . / . .:;,mIM" "IMMMMM MM,. / ,mM "M' + IM'. . / . .;,mIM" "IIMMM ,IMIM,.,IM" + IM . . / . .,mIM" IMMMMMMM' """ + `IM,. / ;,mIM" IIMMM + "IMI, /,mIM" __IMMM + "IMMMM" """IMM + "" IMM + " IMM__ + IMM""" + IMM + IMM + IMM + \ diff -c -r --new-file ds1.1/lib/domains/campus/txt/skulls.txt ds2.0r27/lib/domains/campus/txt/skulls.txt *** ds1.1/lib/domains/campus/txt/skulls.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/skulls.txt Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + + + * * + * * + ** ** + * ** ** * + ** ** * * ** ** + *** * ** ** * *** + **** ********************************* **** + ******* *** ******* *** ******* + ************ ***** ************ + ********** **** * ** ** ******* ********** + ********** ** ** ** **************** + *************** ** ** *** ** ***************** + ****** ********************* ****** ****** + ********************** *** + ************************ ** + **** ** ** **** ** ** ** + *** * * ** * * *** + ** ** + * * + + diff -c -r --new-file ds1.1/lib/domains/campus/txt/spam.txt ds2.0r27/lib/domains/campus/txt/spam.txt *** ds1.1/lib/domains/campus/txt/spam.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/spam.txt Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,20 ---- + ========================================== + | ,dP""8a "888888b, d8b "888b ,888" | + | 88b " 888 d88 dPY8b 88Y8b,8888 | + | `"Y8888a 888ad8P'dPaaY8b 88 Y88P888 | + | a, Y88 888 dP Y8b 88 YP 888 | + | `"8ad8P'a888a a88a;*a888aa88a a888a | + | ;*;;;;*;;;*;;;*,, | + | _,---'':::';*;;;*;;;*;;*d;, | + | .-' ::::::::::';*;;*;dII; | + | .' ,<<<,. :::::::::::::::ffffff`. | + | / ,<<<<<<<<,::::::::::::::::fffffI,\ | + | .,<<<<<<<<<<I;:::::::::::::::ffffKIP", | + | |<<<<<<<<<<dP;,?>;,::::::::::fffKKIP | | + | ``<<<<<<<dP;;;;;\>>>>>;,::::fffKKIPf ' | + | \ `mYMMV?;;;;;;;\>>>>>>>>>,YIIPP"` / | + | `. "":;;;;;;;;;i>>>>>>>>>>>>>, ,' | + | `-._``":;;;sP'`"?>>>>>=========. | + | `---..._______...|<[Hormel | | + | `=========' | + ========================================== diff -c -r --new-file ds1.1/lib/domains/campus/txt/warning.txt ds2.0r27/lib/domains/campus/txt/warning.txt *** ds1.1/lib/domains/campus/txt/warning.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/txt/warning.txt Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,11 ---- + WARNING! WARNING! WARNING! WARNING! + + If you go west of here, you will be leaving the Virtual + Campus administrative building. The special rules of non-aggression that + are enforced within the building do not apply outside. The people + you meet may be friendly, or they may not be. + + Be courteous to other players, and be prepared to deal + with strange and unexpected situations. + + HAVE FUN! diff -c -r --new-file ds1.1/lib/domains/campus/weap/357pistol.c ds2.0r27/lib/domains/campus/weap/357pistol.c *** ds1.1/lib/domains/campus/weap/357pistol.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/weap/357pistol.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + #include <vendor_types.h> + inherit "/lib/pistol"; + void create(){ + pistol::create(); + SetKeyName("revolver"); + SetId(({"gun","pistol","piece"})); + SetAdjectives(({".357","357","magnum"})); + SetShort("a .357 magnum revolver"); + SetLong("This is a thick, heavy chunk of weaponry that fires some very "+ + "serious rounds. Bullets are loaded individually into it, and they, along with spent "+ + "shells, remain in the cylinder until unloaded."); + SetCaliber(357); + SetPistolType("revolver"); + SetAmmoType("magnum"); + SetMaxAmmo(6); + SetMass(20); + SetDollarCost(10); + SetVendorType(VT_WEAPON); + } diff -c -r --new-file ds1.1/lib/domains/campus/weap/9mil.c ds2.0r27/lib/domains/campus/weap/9mil.c *** ds1.1/lib/domains/campus/weap/9mil.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/weap/9mil.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_PISTOL; + void create(){ + ::create(); + SetKeyName("gun"); + SetId(({"gun","pistol"})); + SetAdjectives(({"9mm","automatic","9 millimeter","semiautomatic"})); + SetShort("a 9 millimeter semiautomatic pistol"); + SetLong("This is a large, semiautomatic pistol that fires 9mm rounds. It is "+ + "a heavy, serious-looking weapon."); + SetMillimeter(9); + SetPistolType("auto"); + SetAmmoType("acp"); + SetMass(30); + SetDollarCost(900); + SetVendorType(VT_WEAPON); + } diff -c -r --new-file ds1.1/lib/domains/campus/weap/9mmpistol.c ds2.0r27/lib/domains/campus/weap/9mmpistol.c *** ds1.1/lib/domains/campus/weap/9mmpistol.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/weap/9mmpistol.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + #include <vendor_types.h> + inherit "/lib/pistol"; + void create(){ + pistol::create(); + SetKeyName("gun"); + SetId(({"gun","pistol"})); + SetAdjectives(({"9mm","automatic","9 millimeter","semiautomatic"})); + SetShort("a 9 millimeter semiautomatic pistol"); + SetLong("This is a large, semiautomatic pistol that fires 9mm rounds. It is "+ + "a heavy, serious-looking weapon."); + SetMillimeter(9); + SetPistolType("auto"); + SetAmmoType("acp"); + SetMass(30); + SetDollarCost(3000); + SetVendorType(VT_WEAPON); + } diff -c -r --new-file ds1.1/lib/domains/campus/weap/9mmpistol_loaded.c ds2.0r27/lib/domains/campus/weap/9mmpistol_loaded.c *** ds1.1/lib/domains/campus/weap/9mmpistol_loaded.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/weap/9mmpistol_loaded.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,30 ---- + #include <lib.h> + #include <vendor_types.h> + inherit "/lib/pistol"; + int AddClip(); + void create(){ + pistol::create(); + SetKeyName("gun"); + SetId(({"gun","pistol"})); + SetAdjectives(({"9mm","automatic","9 millimeter","semiautomatic"})); + SetShort("a 9 millimeter semiautomatic pistol"); + SetLong("This is a large, semiautomatic pistol that fires 9mm rounds. It is "+ + "a heavy, serious-looking weapon."); + SetMillimeter(9); + SetPistolType("auto"); + SetAmmoType("acp"); + SetMass(30); + SetDollarCost(3000); + SetVendorType(VT_WEAPON); + AddClip(); + SetLoaded(1); + SetAmmo(15); + SetMag(1); + } + + int AddClip(){ + if(!present("clip",this_object())){ + new("/domains/campus/obj/9mmclip")->eventMove(this_object()); + } + return 1; + } diff -c -r --new-file ds1.1/lib/domains/campus/weap/9mmpistol_mp.c ds2.0r27/lib/domains/campus/weap/9mmpistol_mp.c *** ds1.1/lib/domains/campus/weap/9mmpistol_mp.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/weap/9mmpistol_mp.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,39 ---- + #include <lib.h> + #include <vendor_types.h> + inherit "/lib/pistol"; + int AddClip(); + void CheckMP(); + void create(){ + pistol::create(); + SetKeyName("gun"); + SetId(({"gun","pistol"})); + SetAdjectives(({"9mm","automatic","9 millimeter","semiautomatic"})); + SetShort("a 9 millimeter semiautomatic pistol"); + SetLong("This is a large, semiautomatic pistol that fires 9mm rounds. It is "+ + "a heavy, serious-looking weapon."); + SetMillimeter(9); + SetPistolType("auto"); + SetAmmoType("acp"); + SetMass(30); + SetDollarCost(3000); + SetVendorType(VT_WEAPON); + } + + void init() { + pistol::init(); + CheckMP(); + } + + int AddClip(){ + new("/domains/campus/obj/9mmclip")->eventMove(this_object()); + return 1; + } + + void CheckMP(){ + if(base_name(environment(this_object())) == "/domains/campus/npc/mp"){ + AddClip(); + SetLoaded(1); + SetAmmo(15); + SetMag(1); + } + } diff -c -r --new-file ds1.1/lib/domains/campus/weap/board.c ds2.0r27/lib/domains/campus/weap/board.c *** ds1.1/lib/domains/campus/weap/board.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/weap/board.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,28 ---- + /* /domains/Examples/weapon/sword.c + * from the Nightmare IV LPC Library + * a simple sword example, nothing fancy + * created by Descartes of Borg 950402 + */ + + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + + static void create() { + item::create(); + SetKeyName("board of ed"); + SetId(({"board","board of ed","board of education"})); + SetAdjectives(({"ed","education"})); + SetShort("the board of education"); + SetLong("A long, wide wooden board with a handle at one "+ + "end. Inscribed along its length are the words: "+ + "'Board of Education'."); + SetMass(50); + SetDollarCost(20); + SetVendorType(VT_WEAPON); + SetClass(20); + SetDamageType(BLUNT); + SetWeaponType("blunt"); + } diff -c -r --new-file ds1.1/lib/domains/campus/weap/dagger.c ds2.0r27/lib/domains/campus/weap/dagger.c *** ds1.1/lib/domains/campus/weap/dagger.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/weap/dagger.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,26 ---- + /* /domains/Examples/weapon/dagger.c + * from the Nightmare IV LPC Library + * a simple dagger example, nothing fancy + * created by Descartes of Borg 950402 + */ + + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + + static void create() { + item::create(); + SetKeyName("sharp dagger"); + SetId( ({ "dagger"})); + SetAdjectives( ({ "sharp","fine"})); + SetShort("a sharp dagger"); + SetLong("A dagger."); + SetMass(150); + SetDollarCost(50); + SetVendorType(VT_WEAPON); + SetClass(150); + SetDamageType(BLADE); + SetWeaponType("blade"); + } diff -c -r --new-file ds1.1/lib/domains/campus/weap/grenade.c ds2.0r27/lib/domains/campus/weap/grenade.c *** ds1.1/lib/domains/campus/weap/grenade.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/weap/grenade.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,119 ---- + #include <lib.h> + #include <vendor_types.h> + #include <damage_types.h> + inherit LIB_ITEM; + inherit LIB_PULL; + string pin_desc(); + string lev_desc(); + int detonated; + int count, armed; + string *limbs; + void analyze(string butt); + int HitLivings(object munch); + void create(){ + item::create(); + SetKeyName("concussion hand grenade"); + SetId( ({"grenade","hand grenade","flash-bang grenade","concussion grenade"}) ); + SetAdjectives( ({"military","pineapple"}) ); + SetShort("a hand grenade"); + SetLong("This is an olive-green military issue hand grenade. It is about the "+ + "size of an apple, and its round exterior is made of smooth metal. The "+ + "grenade's fuse consists of a short metal lever and a round pull-pin. "); + SetMass(20); + SetDollarCost(10); + SetVendorType(VT_WEAPON); + AddItem(({"pull pin","pull-pin","pin"}),"This is a round, metal pin, evidently designed for pulling."); + AddItem(({"lever","metal lever"}),"This lever appears to be part of the fuse mechanism."); + AddItem( ({"fuse","fuse mechanism"}) , "This fuse mechanism controls the arming of the grenade."); + count=5; + detonated=0; + } + void init(){ + if(armed){ + set_heart_beat(1); + if(detonated==1) this_object()->eventDestruct(); + } + } + mixed CanPull(object who, string target) { + if(!present(this_object()->GetKeyName(),who ) && target == "pin"){ + return "You do not have the grenade."; + } + if(this_object()->GetId() == target){ + return "You cannot pull that."; + } + return 1; + } + mixed eventPull(object who, string target) { + if(target =="pin" || target == "pull-pin"){ + write("You pull the grenade's pin.\n"); + say(this_player()->GetName()+" pulls the pin from a hand grenade.\n"); + new("/domains/campus/obj/pin")->eventMove(this_player()); + new("/domains/campus/obj/lever")->eventMove(this_player()); + SetShort("a live hand grenade"); + SetLong("This is an olive-green military issue hand grenade. It is about the "+ + "size of an apple, and its round exterior is made of smooth metal. The pin and "+ + "spoon are missing from the fuse mechanism, indicating the grenade is live "+ + "and will detonate very soon."); + AddItem(({"lever","metal lever"}),"The grenade is armed. The fuse lever is no longer on the grenade."); + AddItem(({"pull pin","pull-pin","pin"}),"The grenade is armed. There is no pin in the fuse."); + armed = 1; + set_heart_beat(1); + return 1; + } + write("Nothing happens."); + return 1; + } + void heart_beat(){ + count--; + if(detonated==1) this_object()->eventDestruct(); + if(count < 0){ + this_object()->detonate(); + return; + } + if(interactive(environment())){ + tell_object(environment(), "You are holding a live hand grenade."); + return; + } + tell_object(environment(),"You hear a low hissing sound."); + tell_object(environment(environment()), environment()->GetName()+" is holding a live hand grenade."); + } + int detonate(){ + object ob; + string *stuffs; + int num; + ob = environment(this_object()); + if(living(ob) && !creatorp(ob)){ + stuffs=ob->GetLimbs(); + tell_object(ob, "\nKABOOM! You are torn to pieces by your hand grenade!\n"); + tell_room(environment(ob), "\nKABOOM! "+ob->GetName()+" is torn to pieces by "+ + possessive(ob)+" hand grenade!\n",ob); + detonated=2; + foreach(string limb in stuffs){ + //tc("limb: "+limb); + if(limb != "head" && limb != "torso" && limb != "neck") ob->RemoveLimb(limb,this_object()); + } + //ob->RemoveLimb("head",this_object()); + ob = environment(ob); + } + if(detonated !=2) tell_room(environment(this_object()), "\nKABOOM! The grenade detonates!\n"); + foreach(object victim in get_livings(ob)){ + this_object()->HitLivings(victim); + } + this_object()->eventDestruct(); + return 1; + } + + void analyze(string str){ + string tmp,tmp2; + sscanf(str,"%s#%s",tmp,tmp2); + if(tmp="/lib/corpse"){ + filter(deep_inventory(find_object(str)), (: $1->eventDestruct() :), this_object() ); + } + return; + } + + int HitLivings(object ob){ + ob->eventReceiveDamage(this_object(),BLUNT, random(1000)+300, 1); + return 1; + } + diff -c -r --new-file ds1.1/lib/domains/campus/weap/sharpsword.c ds2.0r27/lib/domains/campus/weap/sharpsword.c *** ds1.1/lib/domains/campus/weap/sharpsword.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/weap/sharpsword.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,26 ---- + /* /domains/Examples/weapon/sword.c + * from the Nightmare IV LPC Library + * a simple sword example, nothing fancy + * created by Descartes of Borg 950402 + */ + + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + + static void create() { + item::create(); + SetKeyName("sharp sword"); + SetId( ({ "sword", "short sword", "shortsword"})); + SetAdjectives( ({ "short","sharp","fine"})); + SetShort("a sharp sword"); + SetLong("A fine, sharp, short sword."); + SetMass(150); + SetDollarCost(50); + SetVendorType(VT_WEAPON); + SetClass(20); + SetDamageType(BLADE); + SetWeaponType("blade"); + } diff -c -r --new-file ds1.1/lib/domains/campus/weap/staff.c ds2.0r27/lib/domains/campus/weap/staff.c *** ds1.1/lib/domains/campus/weap/staff.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/weap/staff.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + static void create(){ + item::create(); + SetKeyName("staff"); + SetId( ({ "staff", "stick", "pole" }) ); + SetAdjectives( ({ "wood","wooden" }) ); + SetShort("a wooden staff"); + SetLong("This staff is old, weathered, "+ + "and lumpy. However, it feels quite sturdy "+ + "and solid."); + SetVendorType(VT_WEAPON); + SetDamagePoints(50); + SetClass(100); + SetDollarCost(250); + SetMass(100); + SetWeaponType("blunt"); + SetHands(2); + SetDamageType(BLUNT); + } diff -c -r --new-file ds1.1/lib/domains/campus/weap/sword.c ds2.0r27/lib/domains/campus/weap/sword.c *** ds1.1/lib/domains/campus/weap/sword.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/weap/sword.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,26 ---- + /* /domains/Examples/weapon/sword.c + * from the Nightmare IV LPC Library + * a simple sword example, nothing fancy + * created by Descartes of Borg 950402 + */ + + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + + static void create() { + item::create(); + SetKeyName("short sword"); + SetId( ({ "sword", "short sword" }) ); + SetAdjectives( ({ "short" }) ); + SetShort("a short sword"); + SetLong("A cheap and rather dull short sword."); + SetMass(150); + SetDollarCost(50); + SetVendorType(VT_WEAPON); + SetClass(20); + SetDamageType(BLADE); + SetWeaponType("blade"); + } diff -c -r --new-file ds1.1/lib/domains/campus/weap/waterpistol.c ds2.0r27/lib/domains/campus/weap/waterpistol.c *** ds1.1/lib/domains/campus/weap/waterpistol.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/campus/weap/waterpistol.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,50 ---- + /* /domains/Examples/weapon/sword.c + * from the Nightmare IV LPC Library + * a simple sword example, nothing fancy + * created by Descartes of Borg 950402 + */ + + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_PISTOL; + + static void create() { + ::create(); + SetKeyName("water pistol"); + SetId(({"pistol","gun"})); + SetAdjectives(({"water","toy","plastic","squirt"})); + SetShort("a small plastic squirt gun"); + SetLong("A small red see-through plastic squirt gun in the shape "+ + "of a ray gun."); + SetMass(10); + SetDollarCost(5); + SetVendorType(VT_WEAPON); + SetClass(20); + SetDamageType(BLUNT); + SetPistolType("auto"); + SetWeaponType("blunt"); + } + + int eventFireWeapon(object shooter, object target){ + string name,patsy; + object killer, env; + killer = this_player(); + name = killer->GetName(); + env = environment(killer); + patsy = target->GetName(); + + tell_room(env,name+" drenches "+patsy+" with "+possessive(killer)+" "+ + "water gun!",({killer,target}) ); + tell_object(killer,"You drench "+patsy+" with your water gun! Ha ha ha, "+ + nominative(target)+" looks like a dope!"); + tell_object(target,name+" drenches you with "+possessive(killer)+" "+ + "water gun! Ha ha ha! You look like a big wet dope!"); + return 1; + } + + + + + diff -c -r --new-file ds1.1/lib/domains/default/armor/badge.c ds2.0r27/lib/domains/default/armor/badge.c *** ds1.1/lib/domains/default/armor/badge.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/armor/badge.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,47 ---- + #include <lib.h> + #include <rooms.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("visitor pass"); + SetId(({"testchar badge","badge","pass","visitor pass"})); + SetShort("a test character Visitor's Pass"); + SetLong("This clip-on plastic badge grants the wearer access to "+ + "some areas typically restricted to creator staff only. Abuse of this "+ + "pass is grounds for disciplinary action. A small scribble "+ + "at the bottom of the pass reads: click heels"); + SetProperties(([ + "no steal" : 1, + ])); + SetMass(10); + SetBaseCost(5000); + SetDamagePoints(100); + SetArmorType(A_AMULET); + SetRetainOnDeath(1); + SetRestrictLimbs( ({ "torso" }) ); + } + void init(){ + ::init(); + add_action("nplh","click"); + } + int nplh(string str){ + if(str=="heels"){ + if(present(this_object()->GetKeyName(),this_player() ) ){ + write("There's no place like home!\n"+ + "You are transported by an awesome whirlwind somewhere "+ + "else...\n"); + this_player()->eventMoveLiving(ROOM_START); + return 1; + } + write("You click your heels together...but feel "+ + "as though you're missing something.\n"); + return 1; + } + } + string GetAffectLong(object ob) { + if(!ob || !living(ob)) return 0; + return ob->GetName() + " is an authorized Test Character."; + } diff -c -r --new-file ds1.1/lib/domains/default/armor/bearskin.c ds2.0r27/lib/domains/default/armor/bearskin.c *** ds1.1/lib/domains/default/armor/bearskin.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/armor/bearskin.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,30 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("bearskin"); + SetId(({"bearskin","bear skin"})); + SetAdjectives(({"thick","shaggy"})); + SetShort("a thick, shaggy bearskin"); + SetLong("This is a thick bearskin which can be worn "+ + "as armor. Unfortunately the hide "+ + "has not been tanned, so it's rather "+ + "foul-smelling."); + SetItems( ([ + "hide" : "It is untanned and subject "+ + "to natural decomposition." + ]) ); + SetSmell( ([ "default" : "It reeks of death." ]) ); + SetMass(75); + SetDamagePoints(100); + SetProtection(BLUNT,1); + SetProtection(BLADE,10); + SetProtection(KNIFE,10); + SetArmorType(A_CLOAK); + } + string GetAffectLong(object ob) { + if(!ob || !living(ob)) return 0; + return ob->GetName() + " reeks of death and decay."; + } diff -c -r --new-file ds1.1/lib/domains/default/armor/chainmail.c ds2.0r27/lib/domains/default/armor/chainmail.c *** ds1.1/lib/domains/default/armor/chainmail.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/armor/chainmail.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("chainmail shirt"); + SetId(({"armor","chainmail","mail","shirt","chain mail"})); + SetAdjectives(({"chainmail","sturdy","sturdy-looking","chain mail"})); + SetShort("chainmail armor"); + SetLong("A body-length suit of armor made of small metal rings fashioned together."); + SetMass(600); + SetBaseCost("silver",1000); + SetDamagePoints(100); + SetProtection(BLUNT,4); + SetProtection(BLADE,25); + SetProtection(KNIFE,25); + SetArmorType(A_ARMOR); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/armor/collar.c ds2.0r27/lib/domains/default/armor/collar.c *** ds1.1/lib/domains/default/armor/collar.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/armor/collar.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,29 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + inherit "/lib/std/bane"; + + static void create(){ + armor::create(); + bane::create(); + SetKeyName("collar"); + SetId(({"repellent_collar","bane"})); + SetAdjectives( ({"repellent","odd","plastic","white"}) ); + SetShort("a plastic collar"); + SetLong("This is a simple collar made of a soft white plastic. It "+ + "seems to be coated with a fine, clear resin. There is something "+ + "written on the collar."); + SetProperties(([ + "no steal" : 1, + ])); + SetRead("Disease and parasite repellent collar, test character use only."); + SetMass(10); + SetBaseCost("silver",5000); + SetDamagePoints(100); + SetArmorType(A_COLLAR); + SetBane(({"all"})); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/armor/combat_pack.c ds2.0r27/lib/domains/default/armor/combat_pack.c *** ds1.1/lib/domains/default/armor/combat_pack.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/armor/combat_pack.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,36 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_WORN_STORAGE; + + static void create(){ + ::create(); + SetKeyName("combat pack"); + SetAdjectives( ({"combat", "back"}) ); + SetId( ({"pack", "backpack"}) ); + SetShort("a combat backpack"); + SetLong("A pack containing the equipment a testchar will need to jump into battle."); + SetClosed(1); + SetInventory(([ + "/domains/default/armor/glove_r" : 1, + "/domains/default/armor/glove_l" : 1, + "/domains/default/armor/pants" : 1, + "/domains/default/weap/carving_knife" : 1, + "/domains/default/armor/long_boot_r" : 1, + "/domains/default/armor/collar" : 1, + "/domains/default/armor/helmet" : 1, + "/domains/default/armor/chainmail" : 1, + "/domains/default/armor/long_boot_l" : 1, + "/domains/default/armor/badge" : 1, + ])); + SetCanClose(1); + SetMaxCarry(2000); + SetMass(200); + SetBaseCost("silver",10); + SetDamagePoints(100); + SetArmorType(A_CLOAK); + SetProtection(COLD, 1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/armor/glove_l.c ds2.0r27/lib/domains/default/armor/glove_l.c *** ds1.1/lib/domains/default/armor/glove_l.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/armor/glove_l.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,31 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ARMOR; + + + static void create() { + armor::create(); + SetKeyName("leather glove"); + SetId( ({ "glove" }) ); + SetAdjectives( ({ "black","leather","left" }) ); + SetShort("a black leather glove"); + SetLong("A black glove with five fingers designed for a left hand."); + SetDamagePoints(75); + SetVendorType(VT_ARMOR); + SetMass(10); + SetBaseCost("silver",7); + SetArmorType(A_GLOVE); + SetProtection(BLUNT, 1); + SetProtection(BLADE, 1); + SetProtection(KNIFE, 2); + SetProtection(HEAT, 3); + SetProtection(COLD, 7); + SetFingers(5); + SetRestrictLimbs(({"left hand"})); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/armor/glove_r.c ds2.0r27/lib/domains/default/armor/glove_r.c *** ds1.1/lib/domains/default/armor/glove_r.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/armor/glove_r.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,31 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ARMOR; + + + static void create() { + armor::create(); + SetKeyName("leather glove"); + SetId( ({ "glove" }) ); + SetAdjectives( ({ "black","leather","right" }) ); + SetShort("a black leather glove"); + SetLong("A black glove with five fingers designed for a right hand."); + SetDamagePoints(75); + SetVendorType(VT_ARMOR); + SetMass(10); + SetBaseCost("silver",7); + SetArmorType(A_GLOVE); + SetProtection(BLUNT, 1); + SetProtection(BLADE, 1); + SetProtection(KNIFE, 2); + SetProtection(HEAT, 3); + SetProtection(COLD, 7); + SetFingers(5); + SetRestrictLimbs(({"right hand"})); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/armor/helmet.c ds2.0r27/lib/domains/default/armor/helmet.c *** ds1.1/lib/domains/default/armor/helmet.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/armor/helmet.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("steel helmet"); + SetId(({"helmet","cover","steel"})); + SetAdjectives(({"steel","battle","hard"})); + SetShort("a steel helmet"); + SetLong("This is a helmet made of tough metal."); + SetMass(180); + SetBaseCost("silver",500); + SetDamagePoints(100); + SetArmorType(A_HELMET); + SetProtection(BLUNT, 20); + SetProtection(BLADE, 20); + SetProtection(KNIFE, 20); + } diff -c -r --new-file ds1.1/lib/domains/default/armor/horc_shirt.c ds2.0r27/lib/domains/default/armor/horc_shirt.c *** ds1.1/lib/domains/default/armor/horc_shirt.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/armor/horc_shirt.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,22 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("shirt"); + SetAdjectives( ({"tee"}) ); + SetId( ({"t-shirt", "t shirt", "tshirt", "tee shirt"}) ); + SetShort("a t-shirt that reads: 'I'M HALF-HUMAN'"); + SetLong("A generic piece of armor of indeterminate proportions."); + SetMass(50); + SetDamagePoints(100); + SetArmorType(A_SHIRT); + SetProtection(BLUNT, 20); + SetProtection(BLADE, 20); + SetProtection(KNIFE, 20); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/armor/jeans.c ds2.0r27/lib/domains/default/armor/jeans.c *** ds1.1/lib/domains/default/armor/jeans.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/armor/jeans.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("blue jeans"); + SetId(({"jeans","pants","blue jeans","bluejeans","denim"})); + SetAdjectives(({"blue","denim","comfortable","broken in","broken-in"})); + SetShort("a pair of blue jeans"); + SetLong("A comfortable pair of denim blue jeans."); + SetMass(5); + SetBaseCost(1); + SetDamagePoints(1); + SetProtection(BLUNT,1); + SetProtection(BLADE,1); + SetProtection(KNIFE,1); + SetArmorType(A_PANTS); + } diff -c -r --new-file ds1.1/lib/domains/default/armor/long_boot_l.c ds2.0r27/lib/domains/default/armor/long_boot_l.c *** ds1.1/lib/domains/default/armor/long_boot_l.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/armor/long_boot_l.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,25 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("riding boot"); + SetId(({"boot"})); + SetAdjectives(({"long","riding","black","leather","left"})); + SetShort("a long riding boot"); + SetLong("A long riding boot, made of black leather. It is "+ + "designed for wear on the left foot and leg."); + SetMass(60); + SetBaseCost("silver",75); + SetDamagePoints(5); + SetProtection(BLUNT,5); + SetProtection(BLADE,5); + SetProtection(KNIFE,5); + SetArmorType(A_LONG_BOOT); + SetRestrictLimbs(({"left foot","left leg"})); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/armor/long_boot_r.c ds2.0r27/lib/domains/default/armor/long_boot_r.c *** ds1.1/lib/domains/default/armor/long_boot_r.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/armor/long_boot_r.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,25 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("riding boot"); + SetId(({"boot"})); + SetAdjectives(({"long","riding","black","leather","right"})); + SetShort("a long riding boot"); + SetLong("A long riding boot, made of black leather. It is "+ + "designed for wear on the right foot and leg."); + SetMass(60); + SetBaseCost("silver",75); + SetDamagePoints(5); + SetProtection(BLUNT,5); + SetProtection(BLADE,5); + SetProtection(KNIFE,5); + SetArmorType(A_LONG_BOOT); + SetRestrictLimbs(({"right foot","right leg"})); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/armor/pants.c ds2.0r27/lib/domains/default/armor/pants.c *** ds1.1/lib/domains/default/armor/pants.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/armor/pants.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("leather pants"); + SetId(({"pants"})); + SetAdjectives(({"strong","leather","black","tough"})); + SetShort("leather pants"); + SetLong("These are trousers made of strong, tough leather. "); + SetMass(150); + SetBaseCost("silver",110); + SetDamagePoints(10); + SetProtection(BLUNT,1); + SetProtection(BLADE,5); + SetProtection(KNIFE,5); + SetArmorType(A_PANTS); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/armor/robe.c ds2.0r27/lib/domains/default/armor/robe.c *** ds1.1/lib/domains/default/armor/robe.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/armor/robe.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,28 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_WORN_STORAGE; + + static void create(){ + ::create(); + SetKeyName("wizard robe"); + SetAdjectives( ({"wizards", "wizard's", "soft", "wizard"}) ); + SetId(({"robe","cloak","duster"})); + SetShort("a robe"); + SetLong("This is a large, comfortable-looking robe, like a wizard might wear. It has many pockets and compartments for holding things."); + SetProperties(([ + "gamma" : 3, + "no steal" : 1, + ])); + SetCanClose(1); + SetMaxCarry(5000); + SetMass(200); + SetBaseCost("silver",100); + SetDamagePoints(100); + SetArmorType(A_CLOAK); + SetProtection(MAGIC, 10); + SetProtection(COLD, 10); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/armor/shirt.c ds2.0r27/lib/domains/default/armor/shirt.c *** ds1.1/lib/domains/default/armor/shirt.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/armor/shirt.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("a white t-shirt"); + SetId(({"shirt","tshirt","t-shirt","t shirt"})); + SetAdjectives(({"white"})); + SetShort("a white t-shirt"); + SetLong("An ordinary white t-shirt."); + SetMass(5); + SetBaseCost(1); + SetDamagePoints(1); + SetProtection(BLUNT,1); + SetProtection(BLADE,1); + SetProtection(KNIFE,1); + SetArmorType(A_SHIRT); + } diff -c -r --new-file ds1.1/lib/domains/default/armor/towel.c ds2.0r27/lib/domains/default/armor/towel.c *** ds1.1/lib/domains/default/armor/towel.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/armor/towel.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("damp towel"); + SetId(({"towel"})); + SetAdjectives(({"damp","bath","ordinary", "bathtowel"})); + SetShort("a damp towel"); + SetLong("This is an ordinary bath towel."); + SetMass(25); + SetDamagePoints(10); + SetProtection(BLUNT,1); + SetProtection(BLADE,1); + SetProtection(KNIFE,1); + SetArmorType(A_PANTS); + } diff -c -r --new-file ds1.1/lib/domains/default/armor/wizard_hat.c ds2.0r27/lib/domains/default/armor/wizard_hat.c *** ds1.1/lib/domains/default/armor/wizard_hat.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/armor/wizard_hat.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,28 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("wizards hat"); + SetAdjectives( ({"wizards", "floppy", "large", "conical", "blue"}) ); + SetId( ({"hat"}) ); + SetShort("a wizard's hat"); + SetLong("This is a large, floppy hat with a wide brim all "+ + "around it, and a conical center. It is dark blue in color, "+ + "and is decorated with pictures of yellow moons and stars."); + SetProperties(([ + "beta" : 2, + ])); + SetMass(50); + SetBaseCost("silver",500); + SetDamagePoints(100); + SetArmorType(A_HELMET); + SetProtection(BLUNT, 20); + SetProtection(BLADE, 20); + SetProtection(KNIFE, 20); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/creator/workroom.c ds2.0r27/lib/domains/default/creator/workroom.c *** ds1.1/lib/domains/default/creator/workroom.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/creator/workroom.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + + inherit LIB_ROOM; + + static void create() { + + room::create(); + SetClimate("indoors"); + SetAmbientLight(40); + SetShort("a creator's workroom"); + SetLong("You are standing in the workroom of a creator."+ + " The start room is down from here."); + SetItems( ([ + "workroom" : "It looks very nice.", + ]) ); + SetInventory(([ + //"/domains/campus/obj/chest.c" : 1 + ])); + SetObviousExits("d"); + SetExits( ([ "down" : "/domains/default/room/start.c", + ]) ); + } + diff -c -r --new-file ds1.1/lib/domains/default/doors/steel_door.c ds2.0r27/lib/domains/default/doors/steel_door.c *** ds1.1/lib/domains/default/doors/steel_door.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/doors/steel_door.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,22 ---- + #include <lib.h> + + inherit LIB_DOOR; + + static void create() { + door::create(); + + SetSide("east", (["id" : ({ "steel door", "steel door leading east", "door", "east door" }), + "short" : "a steel door leading east", + "long" : "This is an imposing, large steel door leading east into the arena.", + "lockable" : 0 ]) ); + SetSide("west", (["id" : ({ "steel door", "steel door leading west", "west door", "door" }), + "short" : "a steel door leading west", + "long" : "This is an imposing, large steel door leading west, out of the arena.", + "lockable" : 0 ]) ); + + SetClosed(0); + SetLocked(0); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/doors/steel_door2.c ds2.0r27/lib/domains/default/doors/steel_door2.c *** ds1.1/lib/domains/default/doors/steel_door2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/doors/steel_door2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,22 ---- + #include <lib.h> + + inherit LIB_DOOR; + + static void create() { + door::create(); + + SetSide("north", (["id" : ({ "steel door leading north", "steel door", "door", "north door" }), + "short" : "a steel door leading north", + "long" : "This is an imposing, large steel door leading north into the arena.", + "lockable" : 0 ]) ); + SetSide("south", (["id" : ({ "steel door leading south", "steel door", "south door", "door" }), + "short" : "a steel door leading south", + "long" : "This is an imposing, large steel door leading south, out of the arena.", + "lockable" : 0 ]) ); + + SetClosed(0); + SetLocked(0); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/doors/steel_door3.c ds2.0r27/lib/domains/default/doors/steel_door3.c *** ds1.1/lib/domains/default/doors/steel_door3.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/doors/steel_door3.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,22 ---- + #include <lib.h> + + inherit LIB_DOOR; + + static void create() { + door::create(); + + SetSide("north", (["id" : ({ "steel door", "steel door leading north", "door", "north door" }), + "short" : "a steel door leading north", + "long" : "This is an imposing, large steel door leading north into the arena.", + "lockable" : 0 ]) ); + SetSide("south", (["id" : ({ "steel door", "steel door leading south", "south door", "door" }), + "short" : "a steel door leading south", + "long" : "This is an imposing, large steel door leading south, out of the arena.", + "lockable" : 0 ]) ); + + SetClosed(0); + SetLocked(0); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/doors/test101.c ds2.0r27/lib/domains/default/doors/test101.c *** ds1.1/lib/domains/default/doors/test101.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/doors/test101.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,26 ---- + #include <lib.h> + + inherit LIB_DOOR; + + static void create() { + door::create(); + + SetSide("west", ([ "id" : ({"door leading west", "door", "west door"}), + "short" : "a door leading west", + "long" : "This is the east side of a door leading west.", + "lockable" : 1 ]) ); + + SetSide("east", ([ "id" : ({"door leading east", "door", "east door"}), + "short" : "a door leading east", + "long" : "This is the west side of a door leading east.", + "lockable" : 1 ]) ); + + SetClosed(1); + SetLocked(0); + SetKeys("west", ({ "west key" })); + SetKeys("east", ({ "east key" })); + } + + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/doors/west.c ds2.0r27/lib/domains/default/doors/west.c *** ds1.1/lib/domains/default/doors/west.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/doors/west.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,26 ---- + #include <lib.h> + + inherit LIB_DOOR; + + static void create() { + door::create(); + + SetSide("DIR_X", ([ "id" : ({"door leading DIR_X", "door", "DIR_X door"}), + "short" : "a door leading DIR_X", + "long" : "This is the Y_SIDE side of a door leading DIR_X.", + "lockable" : 1 ]) ); + + SetSide("DIR_Y", ([ "id" : ({"door leading DIR_Y", "door", "DIR_Y door"}), + "short" : "a door leading DIR_Y", + "long" : "This is the X_SIDE side of a door leading DIR_Y.", + "lockable" : 1 ]) ); + + SetClosed(1); + SetLocked(0); + SetKeys("DIR_X", ({ "DIR_X key" })); + SetKeys("DIR_Y", ({ "DIR_Y key" })); + } + + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/etc/death.txt ds2.0r27/lib/domains/default/etc/death.txt *** ds1.1/lib/domains/default/etc/death.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/etc/death.txt Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,21 ---- + + + NONONONO...... MNO! ......................... MN N! . + NONONON.... NOONNOO! MMMMMMMMMMPPPOII! NNNO!!!! . + NONONONO... O! NNO! MMMMMMMMMMMMMPPPOOOII!! NO! ... + NONONONONO........ MMMMMOOOOOOPPPPPPPPOOOOMII! ... + NONONONONON....... MMMMM.. OPPMMP .,OMI! .... + NONONONONONO...... MMMM:: o ,OPMP, o ::I!! ... + NONONONONONONONO.... NNM:::.,,OOPM!P,.::::!! .... + NONONONONONONONON.. MMNNNNNOOOOP NNIIPPO!!O! ..... + NONONONONONONONON...... MMMONNMMNNNIIIOO! ......... + NONONONONONONO.......... MOM!!!!!!!!!III ............. + NONONONON...... NNN.MNO! . O!!!!!!!!!O . OONO NO! ....... + NONONONONO.... MNNNNNO! ...OOOOOOOOOOO . MMNNON! ....... + NNNOOO!!! ...... MNNNNO! .. PPPPPPPPP .. MMNON! ..... + ...... OO! ................. ON! ....... + + YOU ARE DEAD! + + You are in formless void without substance and outside time. + diff -c -r --new-file ds1.1/lib/domains/default/npc/artrell.c ds2.0r27/lib/domains/default/npc/artrell.c *** ds1.1/lib/domains/default/npc/artrell.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/artrell.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("artrell"); + SetAdjectives( ({"insectoid"}) ); + SetId(({"npc","mob","character","mobile"})); + SetShort("an artrell"); + SetLong("This creature would be roughly humanoid if it weren't for its insectoid appearance and four arms. It appears slightly thinner and smaller than an adult human, but you still don't want to touch it. It's the biggest damned bug you've ever seen."); + SetLevel(1); + SetRace("artrell"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/avidryl.c ds2.0r27/lib/domains/default/npc/avidryl.c *** ds1.1/lib/domains/default/npc/avidryl.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/avidryl.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,22 ---- + #include <position.h> + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("avidryl"); + SetId(({"npc","mob","character","mobile"})); + SetAdjectives(({"non-player", "non player"})); + SetShort("an avidryl"); + SetLong("This is the fabled avidryl, or 'birdman'. He is very human-like, approximately six feet tall and robust in build. He looks like he might even be a match for a Klingon. The most striking thing about him are the two large birdlike wings on his back, used for flying."); + SetAutoStand(1); + SetPosition(POSITION_FLYING); + SetClass("explorer"); + SetLevel(5); + SetRace("avidryl"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/bacchus.c ds2.0r27/lib/domains/default/npc/bacchus.c *** ds1.1/lib/domains/default/npc/bacchus.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/bacchus.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("bacchus"); + SetAdjectives( ({"roman", "drunk"}) ); + SetId( ({"god", "god of wine", "dionysos", "dionysus"}) ); + SetShort("Bacchus, Roman god of wine"); + SetLong("How the Roman god of wine found his way here is a mystery, probably most so to himself. At the moment he seems to be in desperate need of sleeping off his latest debauch. He'll have to figure out an explanation of his own for waking up with a hangover in a crowd of animals."); + SetLevel(200); + SetMelee(1); + SetRace("god"); + SetGender("male"); + SetSleeping(500); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/balrog.c ds2.0r27/lib/domains/default/npc/balrog.c *** ds1.1/lib/domains/default/npc/balrog.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/balrog.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,21 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("balrog"); + SetId(({"npc","mob","character","mobile"})); + SetAdjectives(({"non-player", "non player"})); + SetShort("a fierce balrog"); + SetLong("This is the terrifying demon of your worst Nightmare!"); + SetWanderSpeed(5); + SetClass("fighter"); + SetMelee(1); + SetLevel(50); + SetRace("balrog"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/bat.c ds2.0r27/lib/domains/default/npc/bat.c *** ds1.1/lib/domains/default/npc/bat.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/bat.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,26 ---- + #include <position.h> + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("bat"); + SetId(({"npc","mob","character","mobile"})); + SetAdjectives(({"non-player", "non player"})); + SetShort("a little bat"); + SetLong("An ordinary bat. It's no bigger than a mouse."); + SetWimpy(80); + SetPermitLoad(1); + SetPosition(POSITION_FLYING); + SetWanderSpeed(1); + SetLevel(1); + SetMelee(1); + SetRace("bat"); + SetMaxHealthPoints(20); + SetGender("male"); + SetMessage("leave","$N scurries $D."); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/bear.c ds2.0r27/lib/domains/default/npc/bear.c *** ds1.1/lib/domains/default/npc/bear.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/bear.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,21 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("bear"); + SetId(({"npc","mob","character","mobile"})); + SetAdjectives(({"non-player", "non player"})); + SetShort("a bear"); + SetLong("A large brown bear. Not as huge as a grizzly, but plenty big enough to knock your block off."); + SetWanderSpeed(20); + SetClass("fighter"); + SetLevel(10); + SetMelee(1); + SetRace("bear"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/bird.c ds2.0r27/lib/domains/default/npc/bird.c *** ds1.1/lib/domains/default/npc/bird.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/bird.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,21 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("dodo"); + SetId(({"npc","mob","character","mobile"})); + SetAdjectives(({"non-player", "non player"})); + SetShort("a fat little dodo bird"); + SetLong("This foolish little creature's only crime was being born trusting and delicious."); + SetWanderSpeed(10); + SetLevel(1); + SetMelee(1); + SetRace("bird"); + SetMaxHealthPoints(30); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/boar.c ds2.0r27/lib/domains/default/npc/boar.c *** ds1.1/lib/domains/default/npc/boar.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/boar.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("boar"); + SetAdjectives( ({"huge", "tusked", "hairy", "deadly", "snorting", "sweaty", "ugly", "piggish"}) ); + SetId( ({"pig", "beast"}) ); + SetShort("a wild boar"); + SetLong("This huge, tusked, hairy beast is at least one thousand pounds of snorting, sweaty aggression. Though it's ugly and piggish, it's every inch as deadly to a person as any lion, tiger, or bear."); + SetLevel(1); + SetMelee(1); + SetRace("pig"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/centaur.c ds2.0r27/lib/domains/default/npc/centaur.c *** ds1.1/lib/domains/default/npc/centaur.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/centaur.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("centaur"); + SetId(({"npc","mob","character","mobile"})); + SetAdjectives(({"non-player", "non player"})); + SetShort("a centaur"); + SetLong("Always a startling sight, this is a creature whose lower part is a stag, but where the head would be is the torso of a man, complete with arms and a head. This deer/man appears quite wild and looks every bit as unpredictable as legend says."); + SetWanderSpeed(10); + SetLevel(1); + SetMelee(1); + SetRace("centaur"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/chimera.c ds2.0r27/lib/domains/default/npc/chimera.c *** ds1.1/lib/domains/default/npc/chimera.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/chimera.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("chimera"); + SetId(({"npc","mob","character","mobile"})); + SetAdjectives(({"non-player", "non player"})); + SetShort("a terrifying chimera"); + SetLong("This terrible creature is an unholy mix consisting of the head and body of a lion, a head of a dragon, another head of a goat, and a serpent for a tail. Its heads bob ceaselessly, eyes rolling madly in their sockets, mouths opening and snapping shut."); + SetClass("fighter"); + SetLevel(15); + SetMelee(1); + SetRace("chimera"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/cow.c ds2.0r27/lib/domains/default/npc/cow.c *** ds1.1/lib/domains/default/npc/cow.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/cow.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,21 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("cow"); + SetId(({"npc","mob","character","mobile"})); + SetAdjectives(({"non-player", "non player"})); + SetShort("a shorthorn waygu cow"); + SetLong("Known far and wide for its exquisite marbling, the meat from the Waygu cow is prized by connoisseurs as a delicacy. This docile animal is used to being pampered, well-fed, and massaged thrice daily."); + SetWimpy(80); + SetWanderSpeed(7); + SetLevel(1); + SetMelee(1); + SetRace("cow"); + SetGender("female"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/deer.c ds2.0r27/lib/domains/default/npc/deer.c *** ds1.1/lib/domains/default/npc/deer.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/deer.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("deer"); + SetId(({"npc","mob","character","mobile"})); + SetAdjectives(({"non-player", "non player"})); + SetShort("a deer"); + SetLong("A Typical creature of its kind: nervous, shify, yet beautiful and graceful. This gentle herbivore just wants to eat plants and reproduce."); + SetWanderSpeed(4); + SetLevel(1); + SetMelee(1); + SetRace("deer"); + SetGender("female"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/dryad.c ds2.0r27/lib/domains/default/npc/dryad.c *** ds1.1/lib/domains/default/npc/dryad.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/dryad.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("dryad"); + SetAdjectives( ({"tree hugging", "tree-hugging", "hippie"}) ); + SetId( ({"hippie"}) ); + SetShort("a tree-hugging hippie"); + SetLong("On closer inspection, this is no mere hippie chick. This is an honest-to goodness tree spirit, evidently a bit lost to be hanging around here."); + SetLevel(1); + SetMelee(1); + SetRace("dryad"); + SetGender("female"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/dummy.c ds2.0r27/lib/domains/default/npc/dummy.c *** ds1.1/lib/domains/default/npc/dummy.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/dummy.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,83 ---- + #include <lib.h> + #include <damage_types.h> + inherit LIB_NPC; + + static void create(){ + npc::create(); + SetKeyName("dummy"); + SetId( ({"dummy","mokujin"}) ); + SetShort("a training dummy"); + SetLong("This is a magical sparring partner. It is made of "+ + "logs, cut to the proportions of a human's "+ + "head, torso, and limbs. The logs are held "+ + "together by joints made of chains."); + SetPacifist(1); + SetBodyComposition("wood"); + SetInventory(([ + ])); + SetLevel(10); + SetRace("golem"); + SetNativeLanguage("english"); + SetClass("fighter"); + SetGender("neuter"); + SetMaxHealthPoints(9000); + SetHealthPoints(9000); + } + varargs int eventReceiveDamage(object agent, int type, int x, int internal, mixed limbs) { + int hp, damage, damdiff; + string evidence, limb_string; + evidence = ""; + if(agent) evidence += "I receive damage from "+agent->GetKeyName(); + if(type) { + if(type == BLUNT ) evidence += ", damage type is BLUNT"; + if(type == BLADE ) evidence += ", damage type is BLADE"; + if(type == KNIFE ) evidence += ", damage type is KNIFE"; + if(type == WATER ) evidence += ", damage type is WATER"; + if(type == SHOCK ) evidence += ", damage type is SHOCK"; + if(type == COLD ) evidence += ", damage type is COLD"; + if(type == HEAT ) evidence += ", damage type is HEAT"; + if(type == GAS ) evidence += ", damage type is GAS"; + if(type == ACID ) evidence += ", damage type is ACID"; + if(type == MAGIC ) evidence += ", damage type is MAGIC"; + if(type == POISON ) evidence += ", damage type is POISON"; + if(type == DISEASE ) evidence += ", damage type is DISEASE"; + if(type == TRAUMA ) evidence += ", damage type is TRAUMA"; + //else evidence += ", damage type is indeterminate"; + } + if(x) evidence += ", raw damage is "+x; + if(internal) evidence += ", internal variable is "+internal; + if(limbs) { + if(stringp(limbs)) limb_string = limbs; + else if(arrayp(limbs)) { + if(stringp(limbs[0])) limb_string = implode(limbs,", "); + else if(objectp(limbs[0])){ + foreach(object limb in limbs){ + limb_string += limb->GetKeyName()+", "; + } + } + } + } + else limb_string = ", and I can't tell where I'm hit. "; + if(limbs) { + evidence += ", body part(s) affected: "; + evidence += limb_string + "."; + } + eventForce("say "+evidence); + hp = GetHealthPoints(); + + if(!agent) agent = this_object(); + if(!type) type = 0; + if(!x) x = 0; + if(!internal) internal = 0; + if(!limbs) limbs = ""; + + ::eventReceiveDamage(agent, type, x, internal, limbs); + + damage = GetHealthPoints(); + damdiff = hp - damage; + eventForce("say actual damage done: "+damdiff); + AddHealthPoints(damdiff+1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/dwarf.c ds2.0r27/lib/domains/default/npc/dwarf.c *** ds1.1/lib/domains/default/npc/dwarf.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/dwarf.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("dwarf"); + SetId(({"npc","mob","character","mobile"})); + SetAdjectives(({"non-player", "non player"})); + SetShort("a dwarf"); + SetLong("This is your typical hearty-looking, short, powerfully-built dwarf. Ruddy cheeks, full beard, the works. Straight out of central casting, this one."); + SetLevel(1); + SetMelee(1); + SetRace("dwarf"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/elemental.c ds2.0r27/lib/domains/default/npc/elemental.c *** ds1.1/lib/domains/default/npc/elemental.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/elemental.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("elemental"); + SetId( ({"transcendental", "manifestation"}) ); + SetAdjectives( ({"boredom"}) ); + SetShort("a boredom elemental"); + SetLong("Normally elementals are summoned creatures composed of one of the four elements: earth, water, wind, or fire. This bizarre manifestation appears to be none of those, and in fact seems to have coalesced unbidden out of a sheer, transcendent boredom. It is, perhaps, more of a boredom transcendental."); + SetLevel(1); + SetMelee(1); + SetRace("elemental"); + SetGender("neuter"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/elephant.c ds2.0r27/lib/domains/default/npc/elephant.c *** ds1.1/lib/domains/default/npc/elephant.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/elephant.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("elephant"); + SetAdjectives( ({"docile", "pink", "friendly", "large", "very large"}) ); + SetId(({"npc","mob","character","mobile"})); + SetShort("a pink elephant"); + SetLong("This is a very large creature, yet it seems quite docile and even friendly. It's unclear whether the pink color is natural or painted on, but it's quite becoming."); + SetLevel(1); + SetMelee(1); + SetRace("elephant"); + SetGender("female"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/elf.c ds2.0r27/lib/domains/default/npc/elf.c *** ds1.1/lib/domains/default/npc/elf.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/elf.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("elf"); + SetAdjectives( ({"arrogant", "smug", "malicious"}) ); + SetId(({"npc","mob","character","mobile"})); + SetShort("an arrogant elf"); + SetLong("Oh don't be fooled. Elves just love to pretend they believe in equality and so on, but they all secretly harbor a malicious joy in being oh so much smarter and long-lived and wiser than humans. Don't you just want to punch this elf's smug little smirk?"); + SetLevel(1); + SetMelee(1); + SetRace("elf"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/faerie.c ds2.0r27/lib/domains/default/npc/faerie.c *** ds1.1/lib/domains/default/npc/faerie.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/faerie.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,22 ---- + #include <position.h> + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("faerie"); + SetAdjectives( ({"fragile", "beautiful", "incredibly beautiful", "insubstantial", "tiny"}) ); + SetId( ({"fairy", "fairie"}) ); + SetShort("a small, delicate fairy"); + SetLong("This creature looks like a tiny human, perhaps six inches tall, with diaphanous wings. It seems fragile and insubstantial, as well as incredibly beautiful."); + SetPosition(POSITION_FLYING); + SetLevel(1); + SetMelee(1); + SetRace("faerie"); + SetMaxHealthPoints(50); + SetGender("female"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/fighter.c ds2.0r27/lib/domains/default/npc/fighter.c *** ds1.1/lib/domains/default/npc/fighter.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/fighter.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,25 ---- + #include <lib.h> + inherit LIB_NPC; + + static void create(){ + npc::create(); + SetKeyName("fighter"); + SetId( ({"human","npc","warrior","fighter"}) ); + SetShort("a fighter"); + SetLong("This is a large human warrior. His pectoral muscles "+ + "are clearly visible even through his armor. His face is covered in "+ + "bold blue tattoos."); + SetCustomXP(350); + SetLevel(10); + SetRace("human"); + SetClass("fighter"); + SetGender("male"); + SetInventory(([ + "/domains/default/armor/chainmail.c" : "wear chainmail", + "/domains/default/weap/sharpsword.c" : "wield sword" + ])); + SetMaxHealthPoints(550); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/foochy.c ds2.0r27/lib/domains/default/npc/foochy.c *** ds1.1/lib/domains/default/npc/foochy.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/foochy.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("foochy"); + SetAdjectives( ({"overpampered", "ridiculous", "little", "toy", "toylike"}) ); + SetId(({"npc","mob","character","mobile"})); + SetShort("Foochy the pink poodle"); + SetLong("A rather ridiculous, obviously overpampered little toylike dog."); + SetLevel(1); + SetMelee(1); + SetRace("dog"); + SetGender("female"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/gargoyle.c ds2.0r27/lib/domains/default/npc/gargoyle.c *** ds1.1/lib/domains/default/npc/gargoyle.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/gargoyle.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("gargoyle"); + SetAdjectives( ({"stone", "grotesque", "ugly", "repellent"}) ); + SetId(({"npc","mob","character","mobile"})); + SetShort("a grotesque gargoyle"); + SetLong("A stone spirit come to life, this monstrosity was designed to be as ugly and repellent as anything could be and still hold its shape. It is wildly successful. Its rolling eyes and lolling tongue make it a horrid sight indeed."); + SetLevel(1); + SetMelee(1); + SetRace("gargoyle"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/gecko.c ds2.0r27/lib/domains/default/npc/gecko.c *** ds1.1/lib/domains/default/npc/gecko.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/gecko.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,21 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("gecko"); + SetAdjectives( ({"gecko", "green", "small"}) ); + SetId( ({"lizard"}) ); + SetShort("a gecko"); + SetLong("This is a small lizard, about four inches in length. It has green skin, and unusually large eyes."); + SetWimpy(80); + SetLevel(1); + SetMelee(1); + SetRace("lizard"); + SetMaxHealthPoints(10); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/giant.c ds2.0r27/lib/domains/default/npc/giant.c *** ds1.1/lib/domains/default/npc/giant.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/giant.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("giant"); + SetAdjectives( ({"jolly", "green"}) ); + SetId(({"npc","mob","character","mobile"})); + SetShort("a green giant"); + SetLong("This massive being is well over fifteen feet tall. He doesn't seem hostile though. Just rather amused, in fact. His skin is entirely green and his clothes are made from the leaves of what must be some gigantic palm trees."); + SetLevel(1); + SetMelee(1); + SetRace("giant"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/gnoll.c ds2.0r27/lib/domains/default/npc/gnoll.c *** ds1.1/lib/domains/default/npc/gnoll.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/gnoll.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("gnoll"); + SetAdjectives( ({"filthy", "horrendous"}) ); + SetId( ({"dogman", "dog-man", "dog man"}) ); + SetShort("a large, filthy dogman"); + SetLong("This appears to be a horrendous cross between a humanoid and a hyena. Its matted fur is streaked with blood and feces, and its slavering jaws seem never to stop dripping saliva."); + SetLevel(1); + SetMelee(1); + SetRace("gnoll"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/gnome.c ds2.0r27/lib/domains/default/npc/gnome.c *** ds1.1/lib/domains/default/npc/gnome.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/gnome.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("gnome"); + SetAdjectives( ({"cute", "cuddly", "endearing"}) ); + SetId(({"npc","mob","character","mobile"})); + SetShort("a cute little gnome"); + SetLong("This cuddly creature is rather like a dwarf, only much smaller and better-disposed. His long white beard, infectious laughter and twinkling eyes remind you of someone you knew and loved long ago. His cone-shaped hat and old-fashioned, awkward manner of dress make him all the more endearing. You just want to hug him and put him in your garden."); + SetLevel(1); + SetMelee(1); + SetRace("gnome"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/goblin.c ds2.0r27/lib/domains/default/npc/goblin.c *** ds1.1/lib/domains/default/npc/goblin.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/goblin.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("goblin"); + SetAdjectives( ({"malicious", "short", "green", "clever"}) ); + SetId(({"npc","mob","character","mobile"})); + SetShort("a short, green goblin"); + SetLong("This awful creature is confirmation of the worst stories you heard as a child. It seems to ooze malice from its slick, green skin. It looks much like a troll but smaller and more clever, and the eyes almost appear to radiate poison and hatred. Its very presence contaminates the air."); + SetLevel(1); + SetMelee(1); + SetRace("goblin"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/golem.c ds2.0r27/lib/domains/default/npc/golem.c *** ds1.1/lib/domains/default/npc/golem.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/golem.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("golem"); + SetAdjectives( ({"massive", "clay", "tall"}) ); + SetId( ({"clay man", "clayman", "klaymen", "emet"}) ); + SetShort("Emet the golem"); + SetLong("Emet is a massive clay man, some ten feet tall and with great, thick arms and legs. Written on his forehead are some cryptic glyphs."); + SetLevel(10); + SetMelee(1); + SetRace("golem"); + SetGender("neuter"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/halfling.c ds2.0r27/lib/domains/default/npc/halfling.c *** ds1.1/lib/domains/default/npc/halfling.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/halfling.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("halfling"); + SetId(({"npc","mob","character","mobile"})); + SetAdjectives(({"non-player", "non player"})); + SetShort("a halfling"); + SetLong("This creature is almost identical in appearance to a hobbit with its short stature, hairy feet, and evidently fun-loving disposition. It typically takes a hobbit or a halfling to tell them apart, but halflings tend to be shunned and disregarded for reasons lost to history, so if it looks a bit poor and underfed, like this one, it's a halfling."); + SetLevel(1); + SetMelee(1); + SetRace("halfling"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/helf.c ds2.0r27/lib/domains/default/npc/helf.c *** ds1.1/lib/domains/default/npc/helf.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/helf.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("optis"); + SetId( ({"half elf", "half-elf", "half-human", "half human"}) ); + SetAdjectives(({"non-player", "non player"})); + SetShort("Optis the half-elf"); + SetLong("Like most of his kind, Optis is very attractive and athletic. His ears aren't entirely pointy, but he's exotic enough to be very popular with the ladies."); + SetLevel(1); + SetMelee(1); + SetRace("half-elf"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/hobbit.c ds2.0r27/lib/domains/default/npc/hobbit.c *** ds1.1/lib/domains/default/npc/hobbit.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/hobbit.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("hobbit"); + SetAdjectives( ({"saucy", "saucy looking", "stout", "somewhat stout", "capable"}) ); + SetId( ({"lass", "adventurer"}) ); + SetShort("a hobbit"); + SetLong("About three feet tall, somewhat stout, and with a jolly twinkle in her eye, this saucy looking hobbit lass looks just as capable as any adventurer."); + SetLevel(1); + SetMelee(1); + SetRace("hobbit"); + SetGender("female"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/horse.c ds2.0r27/lib/domains/default/npc/horse.c *** ds1.1/lib/domains/default/npc/horse.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/horse.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("horse"); + SetId(({"horse","large horse"})); + SetShort("a large horse"); + SetLong("A large, hooved quadruped, taller and more muscular than you."); + SetWimpy(50); + SetLevel(5); + SetRace("horse"); + SetGender("male"); + SetMelee(1); + SetAction(5, ({ + "The horse snorts.", "You hear the horse whinny.", + "The horse flips its tail in the air.", + "The horse looks around."})); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/kender.c ds2.0r27/lib/domains/default/npc/kender.c *** ds1.1/lib/domains/default/npc/kender.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/kender.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,47 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + int StealAttempt(){ + object *players = get_livings(environment(this_object()),1); + object *stuff; + object target; + string name, thing; + int which, whether; + + if(sizeof(players)){ + which = random(sizeof(players)); + target = players[which]; + name = target->GetKeyName(); + stuff = all_inventory(target); + if(!sizeof(stuff) || random(100) > 50) whether = 1; + if(whether) this_object()->eventForce("steal money from "+name); + else { + thing = stuff[random(sizeof(stuff))]->GetKeyName(); + this_object()->eventForce("steal "+thing+" from "+name); + } + } + whether = 0; + return 1; + } + + static void create() { + sentient::create(); + SetKeyName("kender"); + SetId(({"npc","mob","character","mobile"})); + SetAdjectives(({"non-player", "non player"})); + SetShort("a kender"); + SetLong("Slight of build and rather attractive, kenders are another race related to hobbits, with all of the playfulness and a little extra disregard for other people's privacy. Kenders are infamous for their extraordinary skill in relieving others of their property, and it is said they are taught to steal before being taught to read. Others dispute this, arguing kenders don't read at all."); + SetClass("thief"); + SetLevel(5); + SetMelee(1); + SetRace("kender"); + SetGender("female"); + SetAction(25, ({ + (: StealAttempt :), "!giggle", (: StealAttempt :), "!laugh", + (: StealAttempt :), "!smile", (: StealAttempt :), "!smirk", + }) ); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/kender_quiet.c ds2.0r27/lib/domains/default/npc/kender_quiet.c *** ds1.1/lib/domains/default/npc/kender_quiet.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/kender_quiet.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,46 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + int StealAttempt(){ + object *players = get_livings(environment(this_object()),1); + object *stuff; + object target; + string name, thing; + int which, whether; + + if(sizeof(players)){ + which = random(sizeof(players)); + target = players[which]; + name = target->GetKeyName(); + stuff = all_inventory(target); + if(!sizeof(stuff) || random(100) > 50) whether = 1; + if(whether) this_object()->eventForce("steal money from "+name); + else { + thing = stuff[random(sizeof(stuff))]->GetKeyName(); + this_object()->eventForce("steal "+thing+" from "+name); + } + } + whether = 0; + return 1; + } + + static void create() { + sentient::create(); + SetKeyName("kender"); + SetId(({"npc","mob","character","mobile"})); + SetAdjectives(({"non-player", "non player"})); + SetShort("a kender"); + SetLong("Slight of build and rather attractive, kenders are another race related to hobbits, with all of the playfulness and a little extra disregard for other people's privacy. Kenders are infamous for their extraordinary skill in relieving others of their property, and it is said they are taught to steal before being taught to read. Others dispute this, arguing kenders don't read at all."); + SetClass("thief"); + SetLevel(5); + SetMelee(1); + SetRace("kender"); + SetGender("female"); + SetAction(25, ({ + (: StealAttempt :), + }) ); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/klingon.c ds2.0r27/lib/domains/default/npc/klingon.c *** ds1.1/lib/domains/default/npc/klingon.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/klingon.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("klingon"); + SetAdjectives( ({"klingon", "adolescent", "unpredictable"}) ); + SetId( ({"warrior", "fighter", "adolescent"}) ); + SetShort("an adolescent klingon"); + SetLong("Sometimes more dangerous than the adult klingon, adolescents have something to prove and can be unpredictable in their aggression. This one has the distinctive ridges of the house of D'Ghor, making him all the more eager to prove his worthiness as a fighter."); + SetClass("fighter"); + SetLevel(5); + SetMelee(1); + SetRace("klingon"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/kobold.c ds2.0r27/lib/domains/default/npc/kobold.c *** ds1.1/lib/domains/default/npc/kobold.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/kobold.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("kobold"); + SetAdjectives( ({"lizard", "short", "humanoid"}) ); + SetId( ({"lizard", "lizard man", "creature"}) ); + SetShort("a short lizard man"); + SetLong("This three foot tall lizard creature is a kobold. Its features are like those of a reptile, but it has arms and legs like a humanoid."); + SetLevel(1); + SetMelee(1); + SetRace("kobold"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/lemur.c ds2.0r27/lib/domains/default/npc/lemur.c *** ds1.1/lib/domains/default/npc/lemur.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/lemur.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("lemur"); + SetAdjectives( ({"small", "startling", "grey", "gray"}) ); + SetId( ({"primate", "simian"}) ); + SetShort("a lemur"); + SetLong("This small animal is startling in its appearance. It looks much like a cross between a small monkey and a raccoon. It has an elongated snout and the fur around its eyes is dark, like the mask of a bandit. Yet its body is clearly simian, with the prehensile front limbs of a monkey. Its grey, furry body ends in a ridiculously long tail that is striped white and black."); + SetLevel(1); + SetMelee(1); + SetRace("primate"); + SetMaxHealthPoints(40); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/lynx.c ds2.0r27/lib/domains/default/npc/lynx.c *** ds1.1/lib/domains/default/npc/lynx.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/lynx.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("lynx"); + SetId(({"npc","mob","character","mobile"})); + SetAdjectives(({"non-player", "non player"})); + SetShort("a lynx"); + SetLong("This feline is much larger than a cat, but much smaller than a lion...it's roughly as big as a medium-sized dog. It has huge ears it uses to hunt in the dark with."); + SetWanderSpeed(10); + SetLevel(1); + SetMelee(1); + SetRace("cat"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/minotaur.c ds2.0r27/lib/domains/default/npc/minotaur.c *** ds1.1/lib/domains/default/npc/minotaur.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/minotaur.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("minotaur"); + SetId(({"npc","mob","character","mobile"})); + SetAdjectives(({"non-player", "non player"})); + SetShort("The Minotaur"); + SetLong("This is the fearsome monster to whom countless virgins were sacrificed. It is transcendentally horrifying, standing eight feet tall with a body seemingly of iron muscle and the head of a raging bull. It is so fearsome as to inspire a kind of hypnotic awe, and it is easy to see it as a force of nature to be worshipped."); + SetClass("fighter"); + SetLevel(30); + SetMelee(1); + SetRace("demi-god"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/moth.c ds2.0r27/lib/domains/default/npc/moth.c *** ds1.1/lib/domains/default/npc/moth.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/moth.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <position.h> + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("moth"); + SetId(({"npc","mob","character","mobile"})); + SetAdjectives(({"non-player", "non player"})); + SetShort("a tiny moth"); + SetLong("An ordinary flying insect which has a particular taste for old clothes."); + SetWimpy(80); + SetPosition(POSITION_FLYING); + SetLevel(1); + SetMelee(1); + SetRace("insect"); + SetMaxHealthPoints(2); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/newt.c ds2.0r27/lib/domains/default/npc/newt.c *** ds1.1/lib/domains/default/npc/newt.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/newt.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("newt"); + SetAdjectives( ({"slimy"}) ); + SetId(({"npc","mob","character","mobile"})); + SetShort("a newt"); + SetLong("A slimy amphibian."); + SetWimpy(80); + SetWanderSpeed(3); + SetMelee(1); + SetLevel(1); + SetRace("amphibian"); + SetClass("explorer"); + SetMaxHealthPoints(10); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/nymph.c ds2.0r27/lib/domains/default/npc/nymph.c *** ds1.1/lib/domains/default/npc/nymph.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/nymph.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("claire"); + SetId( ({"nymph", "danes", "claire danes", "woman"}) ); + SetAdjectives(({"non-player", "non player"})); + SetShort("Claire Danes"); + SetLong("This slender nature spirit appears quite lost, and probably should be accompanying a lesser goddess through woodland glades."); + SetLevel(1); + SetMelee(1); + SetRace("nymph"); + SetGender("female"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/ogre.c ds2.0r27/lib/domains/default/npc/ogre.c *** ds1.1/lib/domains/default/npc/ogre.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/ogre.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("ogre"); + SetAdjectives( ({"foul", "stinking", "unlovable", "potbellied", "snaggletoothed", "monstrous"}) ); + SetId( ({"oaf", "beast"}) ); + SetShort("a monstrous ogre"); + SetLong("This is not a lovable oaf. This foul, stinking beast is twice as tall as a human, potbellied and snaggletoothed. Its skin is crawling with vermin and is encrusted with dried body fluids."); + SetLevel(1); + SetMelee(1); + SetRace("ogre"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/orc.c ds2.0r27/lib/domains/default/npc/orc.c *** ds1.1/lib/domains/default/npc/orc.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/orc.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,27 ---- + #include <lib.h> + + inherit LIB_NPC; + + static void create() { + npc::create(); + SetKeyName("orc"); + SetId(({"orc"})); + SetAdjectives(({"dirty"})); + SetShort("a dirty orc"); + SetLong("This orc is typical of its breed: nasty, brutish, and short. It appears " + "to be a juvenile or adolescent, making it somewhat less " + "dangerous but more hostile. "); + SetLevel(1); + SetRace("orc"); + //SetClass("fighter"); + SetGender("male"); + SetMaxHealthPoints(100); + SetEncounter(0); + SetInventory(([ + "/domains/default/weap/axe":"wield axe", + ]) ); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/pegasus.c ds2.0r27/lib/domains/default/npc/pegasus.c *** ds1.1/lib/domains/default/npc/pegasus.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/pegasus.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("winged horse"); + SetId( ({"horse", "steed", "equine", "pegasus"}) ); + SetAdjectives( ({"flying", "winged", "white"}) ); + SetShort("a winged horse"); + SetLong("This beautiful white steed is a pegasus, a horse endowed with great feathered wings and can fly."); + SetLevel(5); + SetRace("pegasus"); + SetGender("male"); + SetMelee(1); + SetAction(5, ({ + "The winged horse snorts.", "You hear the winged horse flap its wings a bit.", + "The winged horse flips its tail in the air.", + "The winged horse looks around."})); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/pessis.c ds2.0r27/lib/domains/default/npc/pessis.c *** ds1.1/lib/domains/default/npc/pessis.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/pessis.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,22 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("pessis"); + SetId( ({"half-orc", "half orc", "half human", "half-human"}) ); + SetAdjectives(({"non-player", "non player"})); + SetShort("Pessis the half-orc"); + SetLong("Too rough and brutish looking to be a handsome human, too delicate to be a proper orc, Pessis has lived through great indignity and rejection his entire existence. He's understandably a bit defensive about it, so perhaps it's best not to bring up the subject."); + SetInventory(([ + "/domains/default/armor/horc_shirt" : "wear tshirt", + ])); + SetLevel(1); + SetMelee(1); + SetRace("half-orc"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/quarantine/adrian.c ds2.0r27/lib/domains/default/npc/quarantine/adrian.c *** ds1.1/lib/domains/default/npc/quarantine/adrian.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/quarantine/adrian.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + + static void create() { + sentient::create(); + SetKeyName("Adrian"); + SetId(({"adrian"})); + SetShort("Adrian"); + SetLong("Adrian is a foreign exchange student from the United Kingdom."); + SetLevel(5); + SetRace("human"); + SetGender("male"); + SetNoClean(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/quarantine/cor.c ds2.0r27/lib/domains/default/npc/quarantine/cor.c *** ds1.1/lib/domains/default/npc/quarantine/cor.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/quarantine/cor.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("Cor"); + SetId(({"cor"})); + SetShort("Cor"); + SetLong("Cor is a foreign exchange student from the Netherlands."); + SetMelee(1); + SetLevel(5); + SetRace("human"); + SetGender("male"); + SetNoClean(1); + } + void init(){ + ::init(); + } \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/default/npc/quarantine/duncan.c ds2.0r27/lib/domains/default/npc/quarantine/duncan.c *** ds1.1/lib/domains/default/npc/quarantine/duncan.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/quarantine/duncan.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("Duncan"); + SetId(({"duncan"})); + SetShort("Duncan"); + SetLong("Duncan is a foreign exchange student from the United Kingdom."); + SetLevel(5); + SetRace("human"); + SetGender("male"); + SetNoClean(1); + } + void init(){ + ::init(); + } \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/default/npc/quarantine/edmund.c ds2.0r27/lib/domains/default/npc/quarantine/edmund.c *** ds1.1/lib/domains/default/npc/quarantine/edmund.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/quarantine/edmund.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_NPC; + + + static void create() { + npc::create(); + SetKeyName("Edmund"); + SetId(({"edmund"})); + SetShort("Edmund"); + SetLong("Edmund is a foreign exchange student from the United Kingdom."); + SetLevel(5); + SetRace("human"); + SetGender("male"); + SetNoClean(1); + } + void init(){ + ::init(); + } \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/default/npc/quarantine/gavin.c ds2.0r27/lib/domains/default/npc/quarantine/gavin.c *** ds1.1/lib/domains/default/npc/quarantine/gavin.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/quarantine/gavin.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + + static void create() { + sentient::create(); + SetKeyName("Gavin"); + SetId(({"gavin"})); + SetShort("Gavin"); + SetLong("Gavin is a foreign exchange student from the United Kingdom."); + SetLevel(5); + SetRace("human"); + SetGender("male"); + SetNoClean(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/quarantine/graham.c ds2.0r27/lib/domains/default/npc/quarantine/graham.c *** ds1.1/lib/domains/default/npc/quarantine/graham.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/quarantine/graham.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + + static void create() { + sentient::create(); + SetKeyName("Graham"); + SetId(({"graham"})); + SetShort("Graham"); + SetLong("Graham is a foreign exchange student from the United Kingdom."); + SetLevel(5); + SetRace("human"); + SetGender("male"); + SetNoClean(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/quarantine/han.c ds2.0r27/lib/domains/default/npc/quarantine/han.c *** ds1.1/lib/domains/default/npc/quarantine/han.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/quarantine/han.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("Han"); + SetId(({"han"})); + SetShort("Han"); + SetLong("Han is a foreign exchange student from the Netherlands."); + SetMelee(1); + SetLevel(5); + SetRace("human"); + SetGender("male"); + SetNoClean(1); + } + void init(){ + ::init(); + } \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/default/npc/quarantine/jan.c ds2.0r27/lib/domains/default/npc/quarantine/jan.c *** ds1.1/lib/domains/default/npc/quarantine/jan.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/quarantine/jan.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("jan"); + SetId(({"jan"})); + SetShort("Jan"); + SetLong("Jan is a foreign exchange student from the Netherlands."); + SetMelee(1); + SetLevel(5); + SetRace("human"); + SetGender("male"); + SetNoClean(1); + } + void init(){ + ::init(); + } \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/default/npc/quarantine/job.c ds2.0r27/lib/domains/default/npc/quarantine/job.c *** ds1.1/lib/domains/default/npc/quarantine/job.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/quarantine/job.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("Job"); + SetId(({"job"})); + SetShort("Job"); + SetLong("Job is a foreign exchange student from the Netherlands."); + SetMelee(1); + SetLevel(5); + SetRace("human"); + SetGender("male"); + SetNoClean(1); + } + void init(){ + ::init(); + } \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/default/npc/quarantine/kip.c ds2.0r27/lib/domains/default/npc/quarantine/kip.c *** ds1.1/lib/domains/default/npc/quarantine/kip.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/quarantine/kip.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_NPC; + + static void create() { + npc::create(); + SetKeyName("Kip"); + SetId(({"kip"})); + SetShort("Kip"); + SetLong("Kip is a foreign exchange student from the Netherlands."); + SetMelee(1); + SetLevel(5); + SetRace("human"); + SetGender("male"); + SetNoClean(1); + } + void init(){ + ::init(); + } \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/default/npc/quarantine/lester.c ds2.0r27/lib/domains/default/npc/quarantine/lester.c *** ds1.1/lib/domains/default/npc/quarantine/lester.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/quarantine/lester.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + + static void create() { + sentient::create(); + SetKeyName("lester"); + SetId(({"lester"})); + SetShort("Lester"); + SetLong("Lester is a foreign exchange student from the United Kingdom."); + SetLevel(5); + SetRace("human"); + SetGender("male"); + SetNoClean(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/quarantine/lex.c ds2.0r27/lib/domains/default/npc/quarantine/lex.c *** ds1.1/lib/domains/default/npc/quarantine/lex.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/quarantine/lex.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("Lex"); + SetId(({"lex"})); + SetShort("Lex"); + SetLong("Lex is a foreign exchange student from the Netherlands."); + SetMelee(1); + SetLevel(5); + SetRace("human"); + SetGender("male"); + SetNoClean(1); + } + void init(){ + ::init(); + } \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/default/npc/quarantine/miles.c ds2.0r27/lib/domains/default/npc/quarantine/miles.c *** ds1.1/lib/domains/default/npc/quarantine/miles.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/quarantine/miles.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + + static void create() { + sentient::create(); + SetKeyName("Miles"); + SetId(({"miles"})); + SetShort("Miles"); + SetLong("Miles is a foreign exchange student from the United Kingdom."); + SetLevel(5); + SetRace("human"); + SetGender("male"); + SetNoClean(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/quarantine/nigel.c ds2.0r27/lib/domains/default/npc/quarantine/nigel.c *** ds1.1/lib/domains/default/npc/quarantine/nigel.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/quarantine/nigel.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + + static void create() { + sentient::create(); + SetKeyName("Nigel"); + SetId(({"nigel"})); + SetShort("Nigel"); + SetLong("Nigel is a foreign exchange student from the United Kingdom."); + SetLevel(5); + SetRace("human"); + SetGender("male"); + SetNoClean(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/quarantine/pip.c ds2.0r27/lib/domains/default/npc/quarantine/pip.c *** ds1.1/lib/domains/default/npc/quarantine/pip.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/quarantine/pip.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("Pip"); + SetId(({"pip"})); + SetShort("Pip"); + SetLong("Pip is a foreign exchange student from the Netherlands."); + SetMelee(1); + SetLevel(5); + SetRace("human"); + SetGender("male"); + SetNoClean(1); + } + void init(){ + ::init(); + } \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/default/npc/quarantine/rik.c ds2.0r27/lib/domains/default/npc/quarantine/rik.c *** ds1.1/lib/domains/default/npc/quarantine/rik.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/quarantine/rik.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("Rik"); + SetId(({"rik"})); + SetShort("Rik"); + SetLong("Rik is a foreign exchange student from the Netherlands."); + SetMelee(1); + SetLevel(5); + SetRace("human"); + SetGender("male"); + SetNoClean(1); + } + void init(){ + ::init(); + } \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/default/npc/quarantine/simon.c ds2.0r27/lib/domains/default/npc/quarantine/simon.c *** ds1.1/lib/domains/default/npc/quarantine/simon.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/quarantine/simon.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("Simon"); + SetId(({"simon"})); + SetShort("Simon"); + SetLong("Simon is a foreign exchange student from the United Kingdom."); + SetLevel(5); + SetRace("human"); + SetGender("male"); + SetNoClean(1); + } + void init(){ + ::init(); + } \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/default/npc/quarantine/spencer.c ds2.0r27/lib/domains/default/npc/quarantine/spencer.c *** ds1.1/lib/domains/default/npc/quarantine/spencer.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/quarantine/spencer.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("Spencer"); + SetId(({"spencer"})); + SetShort("Spencer"); + SetLong("Spencer is a foreign exchange student from the United Kingdom."); + SetLevel(5); + SetRace("human"); + SetGender("male"); + SetNoClean(1); + } + void init(){ + ::init(); + } \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/default/npc/quarantine/ted.c ds2.0r27/lib/domains/default/npc/quarantine/ted.c *** ds1.1/lib/domains/default/npc/quarantine/ted.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/quarantine/ted.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + + static void create() { + sentient::create(); + SetKeyName("Ted"); + SetId(({"ted"})); + SetShort("Ted"); + SetLong("Ted is a student in the Virtual Campus."); + SetLevel(5); + SetRace("human"); + SetGender("male"); + SetNoClean(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/quarantine/tom.c ds2.0r27/lib/domains/default/npc/quarantine/tom.c *** ds1.1/lib/domains/default/npc/quarantine/tom.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/quarantine/tom.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + + static void create() { + sentient::create(); + SetKeyName("Tom"); + SetId(({"tom"})); + SetShort("Tom"); + SetLong("Tom is a student in the Virtual Campus."); + SetLevel(5); + SetRace("human"); + SetGender("male"); + SetNoClean(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/quarantine/ton.c ds2.0r27/lib/domains/default/npc/quarantine/ton.c *** ds1.1/lib/domains/default/npc/quarantine/ton.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/quarantine/ton.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("Ton"); + SetId(({"ton"})); + SetShort("Ton"); + SetLong("Ton is an exchange student from the Netherlands."); + SetMelee(1); + SetLevel(5); + SetRace("human"); + SetGender("male"); + SetNoClean(1); + } + void init(){ + ::init(); + } \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/default/npc/quarantine/trevor.c ds2.0r27/lib/domains/default/npc/quarantine/trevor.c *** ds1.1/lib/domains/default/npc/quarantine/trevor.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/quarantine/trevor.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + + static void create() { + sentient::create(); + SetKeyName("Trevor"); + SetId(({"trevor"})); + SetShort("Trevor"); + SetLong("Trevor is an exchange student from the United Kingdom."); + SetLevel(5); + SetRace("human"); + SetGender("male"); + SetNoClean(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/quarantine/wallace.c ds2.0r27/lib/domains/default/npc/quarantine/wallace.c *** ds1.1/lib/domains/default/npc/quarantine/wallace.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/quarantine/wallace.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + + static void create() { + sentient::create(); + SetKeyName("Wallace"); + SetId(({"wallace"})); + SetShort("Wallace"); + SetLong("Wallace is a foreign exchange student from the United Kingdom."); + SetLevel(5); + SetRace("human"); + SetGender("male"); + SetNoClean(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/quarantine/wim.c ds2.0r27/lib/domains/default/npc/quarantine/wim.c *** ds1.1/lib/domains/default/npc/quarantine/wim.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/quarantine/wim.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("Wim"); + SetId(({"wim"})); + SetShort("wim"); + SetLong("Wim is a foreign exchange student from the Netherlands."); + SetMelee(1); + SetLevel(5); + SetRace("human"); + SetGender("male"); + SetNoClean(1); + } + void init(){ + ::init(); + } \ No newline at end of file diff -c -r --new-file ds1.1/lib/domains/default/npc/rat.c ds2.0r27/lib/domains/default/npc/rat.c *** ds1.1/lib/domains/default/npc/rat.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/rat.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,28 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("rat"); + SetAdjectives( ({"mangy", "little", "dirty"}) ); + SetId( ({"rat"}) ); + SetShort("a rat"); + SetLong("A scruffy little dirty rat."); + SetLevel(3); + SetMaxHealthPoints(50); + SetRace("rodent"); + SetGender("male"); + SetClass("fighter"); + SetWanderSpeed(1); + SetEncounter(0); + SetMessage("come","$N scurries in."); + SetMessage("leave","$N scurries $D."); + SetAction(5, ({ + "The rat squeaks.", "You hear a rat scuttling about.", + "A scruffy little rat brushes against your leg.", + "You hear tiny munching sounds."})); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/red_dragon.c ds2.0r27/lib/domains/default/npc/red_dragon.c *** ds1.1/lib/domains/default/npc/red_dragon.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/red_dragon.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("dragon"); + SetAdjectives( ({"huge", "red", "dangerous"}) ); + SetId(({"npc","mob","character","mobile"})); + SetShort("a red dragon"); + SetLong("Ancient villain of legend and fable, the red dragon is among the most vicious, cruel, and dangerous beasts around. This one is easily fifteen feet tall and could probably crush you without even noticing."); + SetClass("fighter"); + SetLevel(15); + SetMelee(1); + SetRace("dragon"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/satyr.c ds2.0r27/lib/domains/default/npc/satyr.c *** ds1.1/lib/domains/default/npc/satyr.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/satyr.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("satyr"); + SetAdjectives( ({"wild", "ferocious", "looking", "male", "humanoid", "creature"}) ); + SetId( ({"male", "humanoid", "creature"}) ); + SetShort("a satyr"); + SetLong("This is a wild and ferocious looking humanoid male with the upper body of a human, but the lower body is goatish, woolly, and his legs are those of a hooved animal. Horns grow from beneath the wild mane of hair on his head. However human his face might be, his expression and demeanor make it clear this is not a domesticated person, but an untamed forest creature."); + SetLevel(1); + SetMelee(1); + SetRace("satyr"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/sheep.c ds2.0r27/lib/domains/default/npc/sheep.c *** ds1.1/lib/domains/default/npc/sheep.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/sheep.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("sheep"); + SetId(({"npc","mob","character","mobile"})); + SetAdjectives(({"non-player", "non player"})); + SetShort("a sheep"); + SetLong("This is a typically placid mammal ungulate, given to wandering fields munching on grass. Its fur is called wool and is unusually thick and warm. Wool is prized as a component in clothing."); + SetLevel(1); + SetMelee(1); + SetRace("sheep"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/slug.c ds2.0r27/lib/domains/default/npc/slug.c *** ds1.1/lib/domains/default/npc/slug.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/slug.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <position.h> + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("slug"); + SetId( ({"gastropod"}) ); + SetAdjectives( ({"big", "thick", "slimy", "garden", "gross"}) ); + SetShort("a slimy slug"); + SetLong("A big, thick, slimy garden slug. Gross!"); + SetAutoStand(0); + SetPosition(POSITION_LYING); + SetLevel(1); + SetMelee(1); + SetRace("slug"); + SetMaxHealthPoints(5); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/snake.c ds2.0r27/lib/domains/default/npc/snake.c *** ds1.1/lib/domains/default/npc/snake.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/snake.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,22 ---- + #include <position.h> + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("snake"); + SetId( ({"garter snake", "reptile"}) ); + SetAdjectives( ({"small", "harmless", "garter", "black", "black and yellow", "yellow and black"}) ); + SetShort("a garter snake"); + SetLong("This is a small, harmless reptile, about 9 inches long. It is black with a few yellow stripes along its length. This snake enjoys eating garden pests."); + SetAutoStand(0); + SetPosition(POSITION_LYING); + SetLevel(1); + SetMelee(1); + SetRace("snake"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/spider.c ds2.0r27/lib/domains/default/npc/spider.c *** ds1.1/lib/domains/default/npc/spider.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/spider.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,21 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("spider"); + SetAdjectives( ({"huge", "hairy"}) ); + SetId(({"npc","mob","character","mobile"})); + SetShort("a huge spider"); + SetLong("This is a humongous hairy spider about the size of a housecat. It looks absolutely vile and it has some kind of viscous fluid is dripping from its mouthparts."); + SetWimpy(80); + SetMelee(1); + SetLevel(1); + SetRace("arachnid"); + SetClass("explorer"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/treant.c ds2.0r27/lib/domains/default/npc/treant.c *** ds1.1/lib/domains/default/npc/treant.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/treant.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("treant"); + SetAdjectives( ({"great", "old", "giant", "ancient", "benevolent"}) ); + SetId( ({"protector", "tree"}) ); + SetShort("an ancient treant"); + SetLong("This is a great old treant, which looks much like a giant tree with a face, arms, and legs. Ancient protectors of forests, treants are widely respected for their general good will and benevolence."); + SetLevel(1); + SetMelee(1); + SetRace("tree"); + SetGender("neuter"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/tree.c ds2.0r27/lib/domains/default/npc/tree.c *** ds1.1/lib/domains/default/npc/tree.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/tree.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,49 ---- + #include <lib.h> + inherit LIB_NPC; + + static void create(){ + npc::create(); + SetKeyName("money tree"); + SetId(({"tree","money tree","arborus argentum"})); + SetShort("a money tree"); + SetLong("This robust, 4-foot tall tree is the fabled arborus argentum, or money "+ + "tree. Its leaves are fresh, new dollar bills, and its seed-bearing "+ + "pods are full to bursting with coins of all kinds. It would be no "+ + "trouble at all to get <amount> <currency> from tree...looks like "+ + "you've hit the jackpot!"); + SetCanBite(0); + SetLevel(99); + SetRace("tree"); + SetMaxHealthPoints(99999); + } + void init(){ + ::init(); + add_action("make_money","get"); + } + int make_money(string str){ + int d1; + string s1,s2; + if(!str){ write("Get what?\n"); return 1; } + if(sscanf(str,"%d %s from %s",d1,s1,s2) > 0){ + if(s1 !="electrum" && s1 != "platinum" && + s1 !="gold" && s1 !="cents" && + s1 !="dollars" && s1 !="copper" && + s1 !="silver"){ + write("That kind of money doesn't grow on trees!\n"); + return 1; + } + if(s2=="tree" || s2=="the tree" || + s2=="the money tree" || s2=="arborus argentum"){ + if(d1 > 1000){ + write("That is too much money to get from the tree at once.\n"); + return 1; + } + //write("Currency: "+s1+" Amount: "+d1+"\n"); + this_player()->AddCurrency(s1, d1); + write("You get "+d1+" "+s1+" from the money tree."); + say(this_player()->GetCapName()+" gets money from the money tree."); + return 1; + } + return 0; + } + } diff -c -r --new-file ds1.1/lib/domains/default/npc/triffid.c ds2.0r27/lib/domains/default/npc/triffid.c *** ds1.1/lib/domains/default/npc/triffid.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/triffid.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("triffid"); + SetAdjectives( ({"six foot tall", "six feet tall", "thick", "bushy", "thorned", "menacing"}) ); + SetId( ({"plant"}) ); + SetShort("a large, tall plant"); + SetLong("This plant is about six feet tall and similar to a very thick and bushy corn plant. It possesses tentacle-like thorned vines which wave about menacingly, and it appears capable of locomotion."); + SetLevel(1); + SetMelee(1); + SetRace("plant"); + SetGender("neuter"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/troll.c ds2.0r27/lib/domains/default/npc/troll.c *** ds1.1/lib/domains/default/npc/troll.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/troll.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,45 ---- + #include <lib.h> + + inherit LIB_NPC; + object gdude; + + int nasty(object dude){ + gdude = dude; + eventForce("look at "+gdude->GetKeyName()); + eventForce("drool"); + return 1; + } + int CheckHuman(mixed val){ + if(!val) return 0; + if(!objectp(val)) return 0; + gdude = val; + if(val->GetRace() != "human") return 0; + else { + call_out( (: nasty, gdude :) , 2); + } + return 1; + } + static void create() { + npc::create(); + SetKeyName("troll"); + SetId(({"troll"})); + SetAdjectives(({"dirty"})); + SetShort("a mean-looking troll"); + SetLong("This is the dreaded creature of legend: a slimy, " + "green, putrid-looking fiend with long, razor-" + "sharp claws and fangs."); + SetLevel(3); + SetRace("troll"); + SetClass("fighter"); + SetGender("male"); + SetMelee(1); + SetSkill("melee attack",50,50,10); + SetStat("strength",50,1); + SetStat("agility",50,1); + SetStat("coordination",50,1); + SetStat("speed",50,1); + AddCurrency("silver",221+random(157)); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/turtle.c ds2.0r27/lib/domains/default/npc/turtle.c *** ds1.1/lib/domains/default/npc/turtle.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/turtle.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("mock turtle"); + SetAdjectives( ({"peculiar", "mock"}) ); + SetId( ({"turtle", "tortoise"}) ); + SetShort("a mock turtle"); + SetLong("This peculiar creature has the head of a calf but the body of a turtle."); + SetLevel(1); + SetMelee(1); + SetRace("tortoise"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/unicorn.c ds2.0r27/lib/domains/default/npc/unicorn.c *** ds1.1/lib/domains/default/npc/unicorn.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/unicorn.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,22 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("unicorn"); + SetId(({"unicorn","large unicorn"})); + SetShort("a beautiful white unicorn"); + SetLong("This white unicorn is a great, proud horse with a single ivory horn growing from its head. Long a symbol of masculine virility, many people still fail to see this large, muscular beast with a long, hard horn as the powerful sexual icon it is."); + SetLevel(5); + SetRace("unicorn"); + SetGender("male"); + SetMelee(1); + SetAction(5, ({ + "The unicorn snorts.", "You hear the unicorn whinny.", + "The unicorn flips its tail in the air.", + "The unicorn looks around."})); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/wraith.c ds2.0r27/lib/domains/default/npc/wraith.c *** ds1.1/lib/domains/default/npc/wraith.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/wraith.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,22 ---- + #include <position.h> + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("spectre"); + SetAdjectives( ({"shadowy", "undead", "unholy", "malevolent", "spiteful"}) ); + SetId( ({"wraith", "specter", "ghost", "apparition", "manifestation"}) ); + SetShort("a sinister spectre"); + SetLong("This shadowy manifestation is an undead, unholy apparition, oozing malevolence and spite."); + SetPosition(POSITION_FLYING); + SetLevel(15); + SetMelee(1); + SetRace("wraith"); + SetGender("neuter"); + SetUndead(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/yattering.c ds2.0r27/lib/domains/default/npc/yattering.c *** ds1.1/lib/domains/default/npc/yattering.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/yattering.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("yattering"); + SetId(({"npc","mob","character","mobile"})); + SetAdjectives(({"non-player", "non player"})); + SetShort("a foul little yattering"); + SetLong("This is a wretched, fleshy pink creature about two feet tall. It has long, droopy ears, a beaklike mouth, and a pair of useless wing stubs on its back. Its general demeanor is listless and somehow resentful. As pathetic as it looks, its possesses long black claws, and its beak looks plenty sharp."); + SetClass("fighter"); + SetLevel(5); + SetMelee(1); + SetRace("demon"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/npc/zoe.c ds2.0r27/lib/domains/default/npc/zoe.c *** ds1.1/lib/domains/default/npc/zoe.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/zoe.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,31 ---- + #include <lib.h> + #include <vendor_types.h> + + inherit LIB_TELLER; + + static void create() { + ::create(); + SetKeyName("zoe"); + SetId( ({ "teller","banker","executive" }) ); + SetAdjectives( ({ "bank","executive","friendly","efficient" }) ); + SetShort("Zoe the bank teller"); + SetLevel(12); + SetLong("Zoe is an attractive young blonde woman with " + "a French accent. She is dressed in a conservative, " + "executive style, and has a friendly and efficient air " + "about her."); + SetGender("female"); + SetMorality(40); + SetRace("human"); + AddCurrency("silver", random(100)); + SetProperty("no bump", 1); + SetLocalCurrency("silver"); + SetBankName("First Village Bank"); + SetLocalCurrency("silver"); + SetLocalFee(1); + SetOpenFee(5); + SetExchangeFee(2); + SetCurrencies( ({ "copper", "silver", "electrum", "gold", "platinum" }) ); + + + } diff -c -r --new-file ds1.1/lib/domains/default/npc/zookeeper.c ds2.0r27/lib/domains/default/npc/zookeeper.c *** ds1.1/lib/domains/default/npc/zookeeper.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/npc/zookeeper.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("zookeeper bot"); + SetId( ({"bot", "robot", "zookeeper", "keeper"}) ); + SetAdjectives(({"non-player", "non player"})); + SetShort("a robot zookeeper"); + SetLong("This efficient automaton continually feeds, bathes, grooms, and looks after all the wild things kept in the menagerie."); + SetLevel(1); + SetMelee(1); + SetRace("android"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/obj/bbucket.c ds2.0r27/lib/domains/default/obj/bbucket.c *** ds1.1/lib/domains/default/obj/bbucket.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/obj/bbucket.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,37 ---- + #include <lib.h> + #include <rooms.h> + + inherit LIB_STORAGE; + + void create() { + ::create(); + SetKeyName("bin"); + SetId(({"bin","can","dustbin","trash","rubbish"})); + SetAdjectives(({"metal","small","blue","recycling","trash","garbage","dust"})); + SetShort("a recycling bin"); + SetLong("This is a blue trash can, marked with "+ + "the letters \"/dev/null\"."); + SetMass(200); + SetBaseCost("silver",50); + SetMaxCarry(999999); + } + + int tidy_up(){ + object *inv; + inv = all_inventory(this_object()); + foreach(object thing in inv){ + if(thing) thing->eventMove(ROOM_FURNACE); + } + return 1; + } + + int eventReceiveObject(object ob){ + write("You make a deposit into the the recycling bin.\n"); + call_out((: tidy_up :),1); + return 1; + } + mixed CanGet(object ob) { return "The bucket does not budge.";} + + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/obj/box.c ds2.0r27/lib/domains/default/obj/box.c *** ds1.1/lib/domains/default/obj/box.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/obj/box.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,14 ---- + #include <lib.h> + + inherit LIB_STORAGE; + + void create() { + ::create(); + SetKeyName("box"); + SetId( ({ "box" }) ); + SetAdjectives( ({ "small", "plastic","green", "a" }) ); + SetShort("a small plastic box"); + SetLong("It is a simple plastic box used to hold things."); + SetMass(274); + SetMaxCarry(500); + } diff -c -r --new-file ds1.1/lib/domains/default/obj/chest.c ds2.0r27/lib/domains/default/obj/chest.c *** ds1.1/lib/domains/default/obj/chest.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/obj/chest.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,35 ---- + #include <lib.h> + + inherit LIB_STORAGE; + + void create() { + ::create(); + SetKeyName("chest"); + SetId(({"chest","wooden chest"})); + SetShort("a wooden chest"); + SetLong("This is a sturdy wooden chest used to store valuable items."); + SetInventory(([ + "/domains/town/armor/collar" : 1, + "/domains/default/armor/badge" : 1, + "/domains/default/armor/wizard_hat" : 1, + "/domains/default/obj/manual" : 1, + "/secure/obj/machine" : 1, + "/domains/default/armor/robe" : 1, + "/domains/default/obj/meter" : 1, + "/secure/obj/control" : 1, + "/secure/obj/memo" : 1, + "/secure/obj/staff" : 1, + "/domains/default/obj/pinger" : 1, + "/secure/obj/medtric" : 1, + ])); + SetMass(2000); + SetBaseCost(50); + SetMaxCarry(500); + SetPreventPut("You cannot put this in there!"); + SetCanClose(1); + SetClosed(1); + } + mixed CanGet(object ob) { return "The chest does not budge.";} + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/obj/collarchest.c ds2.0r27/lib/domains/default/obj/collarchest.c *** ds1.1/lib/domains/default/obj/collarchest.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/obj/collarchest.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,29 ---- + /* /domains/Examples/etc/bag.c + * from the Nightmare IV LPC Library + * a sample bag object + * created by Descartes of Borg 950529 + */ + + #include <lib.h> + + inherit LIB_STORAGE; + + void create() { + ::create(); + SetKeyName("chest"); + SetId(({"chest"})); + SetAdjectives(({"medical","metal","stainless","steel"})); + SetShort("a stainless steel chest"); + SetLong("This is a chest used to store medical tools."); + SetMass(274); + SetDollarCost(50); + SetMaxCarry(500); + SetPreventPut("You cannot put this in there!"); + SetInventory(([ + "/secure/obj/medtric" : 1, + "/domains/default/armor/collar" : 5, + ]) ); + SetCanClose(1); + SetClosed(1); + } + mixed CanGet(object ob) { return "The chest does not budge.";} diff -c -r --new-file ds1.1/lib/domains/default/obj/guide.c ds2.0r27/lib/domains/default/obj/guide.c *** ds1.1/lib/domains/default/obj/guide.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/obj/guide.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,21 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_BOOK; + + void create(){ + ::create(); + SetKeyName("guidebook"); + SetId( ({"book", "guide", "administrators guide", "administrators guidebook"}) ); + SetAdjectives( ({"admin", "admins", "administrator", "administrators", "reference"}) ); + SetShort("an Administrator's Guidebook"); + SetLong("This is a reference text for Dead Souls administrators."); + SetNoCondition(1); + SetSource("/doc/guide"); + SetMass(20); + SetBaseCost("silver",10); + SetVendorType(VT_TREASURE); + SetTitle("Administrator's Guidebook"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/obj/handbook.c ds2.0r27/lib/domains/default/obj/handbook.c *** ds1.1/lib/domains/default/obj/handbook.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/obj/handbook.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,26 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_BOOK; + + void create(){ + ::create(); + SetKeyName("player's handbook"); + SetId( ({"book", "handbook", "players handbook"}) ); + SetAdjectives( ({"player", "players"}) ); + SetShort("a Player's Handbook"); + SetLong("This is a handbook for players. To read it, you must read the chapters in it. For example, 'read chapter 1 in handbook', or 'read index in handbook'"); + SetProperties(([ + "no steal" : 1, + ])); + SetMass(3); + SetBaseCost("silver",10); + SetVendorType(VT_TREASURE); + SetTitle("The Player's Handbook"); + SetSource("/doc/hbook"); + SetDefaultRead("Try \"read chapter 1 in handbook\" or " + "\"read index in handbook\""); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/obj/manual.c ds2.0r27/lib/domains/default/obj/manual.c *** ds1.1/lib/domains/default/obj/manual.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/obj/manual.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,31 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_BOOK; + + void create(){ + ::create(); + SetKeyName("creator's manual"); + SetId( ({"manual", "book", "creators manual"}) ); + SetAdjectives( ({"creator", "creators", "coder", "coders"}) ); + SetShort("a Creator's Manual"); + SetLong("This is a manual for creators and admins. " + "To read it, you must read the chapters in it. For example, \"read " + "chapter 1 in manual\".\n If you are new to coding, you should " + "start with chapter 31."); + SetNoCondition(1); + SetProperties(([ + "no steal" : 1, + ])); + SetMass(20); + SetBaseCost("silver",10); + SetVendorType(VT_TREASURE); + SetTitle("The Coder's Manual"); + SetSource("/doc/manual"); + SetDefaultRead("Try \"read chapter 1 in manual\" or " + "\"read index in manual\"\n" + "New creators should especially read the Quick Creation " + "System documentation, starting in chapter 31"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/obj/match.c ds2.0r27/lib/domains/default/obj/match.c *** ds1.1/lib/domains/default/obj/match.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/obj/match.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,21 ---- + #include <lib.h> + + inherit LIB_MATCH; + + static void create() { + match::create(); + SetKeyName("match"); + SetId("match"); + SetAdjectives( ({ "wooden" }) ); + SetShort("a wooden match"); + SetLong("A wooden match that might light if you strike it."); + SetRadiantLight(2); + SetStrikeChance(50); + SetMinHeat(10); + SetFuelRequired(1); + SetMaxFuel(10); + SetFuelAmount(10); + SetRefuelable(0); + SetMass(5); + SetBurntValue(1); + } diff -c -r --new-file ds1.1/lib/domains/default/obj/meter.c ds2.0r27/lib/domains/default/obj/meter.c *** ds1.1/lib/domains/default/obj/meter.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/obj/meter.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,74 ---- + #include <lib.h> + #include <vendor_types.h> + #include <vision.h> + inherit LIB_ITEM; + + varargs string translate_vision(object ob){ + int vision; + string ret = " "; + if(!ob) vision = this_player()->GetEffectiveVision(); + else vision = ob->GetEffectiveVision(); + switch(vision){ + case 0 : ret = "level 0: blindness.";break; + case 1 : ret = "level 1: too dark.";break; + case 2 : ret = "level 2: dark.";break; + case 3 : ret = "level 3: dim.";break; + case 4 : ret = "level 4: clear.";break; + case 5 : ret = "level 5: light.";break; + case 6 : ret = "level 6: bright.";break; + case 7 : ret = "level 7: too bright.";break; + default : ret = "a mystery."; + } + return ret; + } + + varargs mixed EvaluateRadiantLight(object ob, int report){ + int x = 0; + string rep = ""; + string subrep = ""; + if(!ob) ob = this_player(); + foreach(object guy in get_livings(environment(ob))){ + //x += guy->GetRadiantLight(); + if(guy->GetRadiantLight()) + rep += guy->GetName()+"'s radiant light is: "+guy->GetRadiantLight()+".\n"; + foreach(object item in all_inventory(guy)){ + x += item->GetRadiantLight(); + if(item->GetRadiantLight()){ + subrep += guy->GetName()+"'s "+item->GetName()+"'s radiant light is: "+ + item->GetRadiantLight()+".\n"; + } + } + } + if(!report) return x; + else return "Livings: \n"+rep+"\nObjects:\n"+subrep; + } + + string DefaultReading(){ + write("This small device is a portable light meter. It tells "+ + "you what the available light is."); + write("The ambient light here is: "+environment(this_player())->GetAmbientLight()); + write("Total radiant light here is: "+EvaluateRadiantLight()); + write("Your vision range is: "+this_player()->GetEffectiveVision(1)); + write("\nYour effective vision is "+translate_vision()); + write("\nFull radiance details:\n"+EvaluateRadiantLight(this_player(),1)); + return ""; + } + + void create(){ + ::create(); + SetKeyName("light meter"); + SetAdjectives( ({"light"}) ); + SetId( ({"meter", "lightmeter"}) ); + SetShort("a light meter"); + SetLong( (: DefaultReading :) ); + SetProperties(([ + "no steal" : 1, + ])); + SetNoCondition(1); + SetMass(20); + SetBaseCost("silver",10); + SetVendorType(VT_TREASURE); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/obj/pinger.c ds2.0r27/lib/domains/default/obj/pinger.c *** ds1.1/lib/domains/default/obj/pinger.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/obj/pinger.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,60 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + + int count = 0; + int interval = 0; + string keepalive = ""; + + void create(){ + ::create(); + + SetKeyName("pinger"); + SetId( ({"thing"}) ); + SetAdjectives( ({"keepalive"}) ); + SetShort("a keepalive pinger"); + SetLong("This thing can be set to periodically output a string, " + "with the purpose of keeping fickle telnet connections up. " + "\nTo set the interval: interval <heartbeats> \n" + "To set the string: keepalive <string>"); + SetNoCondition(1); + SetMass(20); + SetBaseCost("silver",10); + set_heart_beat(1); + SetVendorType(VT_TREASURE); + } + + int SetInterval(string str){ + interval = atoi(str); + if(!intp(interval)){ + write("That is not a valid integer."); + return 1; + } + + write("Interval set to "+interval+" heartbeats."); + return 1; + } + + int SetKeepalive(string str){ + if(!str || str == "") keepalive = "\n"; + else keepalive = str; + write("Keepalive set."); + return 1; + } + + void init(){ + ::init(); + add_action("SetInterval","interval"); + add_action("SetKeepalive","keepalive"); + } + + void heart_beat(){ + count++; + if(interval > 0 && count > interval){ + count = 0; + if(living(environment(this_object())) && + query_idle(environment(this_object())) > 240){ + tell_object(environment(this_object()),keepalive); + } + } + } diff -c -r --new-file ds1.1/lib/domains/default/obj/reset_button.c ds2.0r27/lib/domains/default/obj/reset_button.c *** ds1.1/lib/domains/default/obj/reset_button.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/obj/reset_button.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,26 ---- + #include <lib.h> + #include <rooms.h> + + inherit LIB_DUMMY; // These do not show up in desc, but you can look at them + inherit LIB_PRESS; // Makes the item pressable + + object room; + + int eventResetRoom() { + object *livings = get_livings(environment(this_object()),2); + room = environment(this_object()); + livings->eventMove(ROOM_FURNACE); + livings->eventDestruct(); + call_out( (: reload_room, room :), 0 ); + return 1; + } + + static void create() { + dummy::create(); + SetKeyName("button"); + SetId(({"button","button on the wall"})); + SetAdjectives("reset"); + SetShort("a button"); + SetLong("It is a button that you could probably press."); + SetPress((: eventResetRoom :)); + } diff -c -r --new-file ds1.1/lib/domains/default/obj/stargate.c ds2.0r27/lib/domains/default/obj/stargate.c *** ds1.1/lib/domains/default/obj/stargate.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/obj/stargate.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,28 ---- + #include <lib.h> + #include <daemons.h> + #include "/lib/include/stargate.h" + + inherit LIB_STARGATE; + + int ReadScreen(); + + void create() + { + ::create(); + SetOrigin("stargate lab", "/domains/default/room/stargate_lab"); + SetRead(([ ({ "screen" }) : (: ReadScreen :) ]) ); + SetItems(([ ({ "screen" }) : "a computer screen which shows the status of the gate network" ]) ); + } + + void init() + { + ::init(); + } + + int ReadScreen() + { + write("stargate network status\n"); + write("-----------------------\n"); + write("\n"); + + } diff -c -r --new-file ds1.1/lib/domains/default/obj/torch.c ds2.0r27/lib/domains/default/obj/torch.c *** ds1.1/lib/domains/default/obj/torch.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/obj/torch.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,21 ---- + #include <lib.h> + + inherit LIB_TORCH; + + static void create() { + torch::create(); + SetKeyName("torch"); + SetId( ({ "torch", "old torch", "wooden torch" }) ); + SetAdjectives( ({ "old", "wooden" }) ); + SetShort("an old, wooden torch"); + SetLong("An old, wooden torch with a bit of cloth wrapped around " + "one end and dipped into a flamable substance."); + SetRadiantLight(7); + SetFuelRequired(1); + SetMaxFuel(1000); + SetFuelAmount(1000); + SetRefuelable(1); + SetMass(50); + SetBurntValue(10); + SetClass(10); + } diff -c -r --new-file ds1.1/lib/domains/default/room/arena.c ds2.0r27/lib/domains/default/room/arena.c *** ds1.1/lib/domains/default/room/arena.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/room/arena.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,29 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("the Arena"); + SetLong("You are in a large room with blank cement walls. This room was built so Creators may test their armor, weapons and NPC's in combat. A large steel door is here, which can be used to prevent wimpy creatures from escaping."); + SetItems( ([ + ({"wall","walls"}) : "The walls are smooth and cement.", + ({"floor","ceiling"}) : "The floor and ceiling are, like the walls, made "+ + "of smooth cement." ]) ); + SetExits( ([ + "south" : "/domains/default/room/wiz_corr1", + ]) ); + SetInventory(([ + "/domains/default/npc/fighter" : 1, + "/domains/default/npc/dummy" : 1, + "/domains/default/obj/bbucket" :1 + ])); + SetPlayerKill(1); + + SetDoor("south", "/domains/default/doors/steel_door2.c"); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/room/death.c ds2.0r27/lib/domains/default/room/death.c *** ds1.1/lib/domains/default/room/death.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/room/death.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,65 ---- + #include <lib.h> + #include <dirs.h> + #include <rooms.h> + + inherit LIB_ROOM; + + string FunkyPic(); + int CheckChat(); + int StartHeart(object ob); + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("off the mortal coil"); + SetLong( (:FunkyPic:) ); + SetObviousExits("no exit"); + set_heart_beat(10); + SetNoModify(1); + } + + void init(){ + ::init(); + add_action("regenerate","regenerate"); + add_action("wander","wander"); + this_object()->CheckChat(); + } + + string FunkyPic(){ + return read_file("/domains/default/etc/death.txt"); + } + + int regenerate(){ + write("With a great rush of matter and energy, you rematerialize "+ + "into a corporeal state, and find yourself in a familiar place..."); + this_player()->eventRevive(); + this_player()->eventMoveLiving(ROOM_START); + return 1; + } + + int wander(){ + write("There is a strange, hollow vibration all around you, and you "+ + "realize that some force is compelling your ethereal form elsewhere..."+ + "you find yourself in a place that is known to you, yet oddly new."); + this_player()->eventMoveLiving(ROOM_START); + return 1; + } + + void heart_beat(){ + tell_room(this_object(), "A voice whispers: \" You may choose to "+ + "regenerate into a new body here.\""); + return; + } + + + int CanRelease(object ob){ + if(userp(ob) && ob->GetGhost() && environment(ob) == this_object()) { + tell_player(ob,"\n%^RED%^Your undead spirit is recalled and as you leave "+ + "the underworld a new body regenerates around you. "+ + "You live again!%^RESET%^\n"); + ob->eventRevive(); + } + return 1; + } + diff -c -r --new-file ds1.1/lib/domains/default/room/domains_room.c ds2.0r27/lib/domains/default/room/domains_room.c *** ds1.1/lib/domains/default/room/domains_room.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/room/domains_room.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,66 ---- + #include <lib.h> + #include <rooms.h> + + inherit LIB_ROOM; + + string LongDesc(){ + string desc = "Immortals come here to communicate with each other about "+ + "the world they are building. The Adventurer's Guild "+ + "is north. The Arch Room is south. To visit the Dead Souls "+ + "test and development mud, go west. The test lab facilities are east."; + desc += "\nA sign reads: "+load_object(ROOM_ARCH)->SignRead(); + return desc; + } + + static void create() { + object ob; + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Domains Room"); + SetLong("This room provides a convenient access point to various domain start rooms and featured realms."); + SetItems(([ + "Ylsrim" : "This is the entry point for the Ylsrim domain.", + "campus" : "This is the entry point for the campus domain.", + "examples" : "This is the entry point for the examples domain.", + ({ "sign" }) : "A sign you can read.", + ])); + SetEnters( ([ + "campus" : "/domains/campus/room/start", + "ylsrim" : "/domains/Ylsrim/room/bazaar", + "examples" : "/domains/examples/room/start.c", + ]) ); + SetProperty("no attack", 1); + SetProperty("nopeer",1); + ob = new("/lib/bboard"); + ob->SetKeyName("chalkboard"); + ob->SetId( ({ "board", "chalkboard", "dusty board", "dusty chalkboard" }) ); + ob->set_board_id("immortal_board"); + ob->set_max_posts(30); + SetShort("Domains Room"); + ob->eventMove(this_object()); + SetExits(([ + "north" : "/domains/default/room/wiz_hall2", + ])); + + SetInventory(([ + ])); + + SetRead("sign", (: load_object(ROOM_ARCH)->SignRead() :) ); + } + + int CanReceive(object ob) { + if(playerp(ob) && !creatorp(ob) && !present("testchar badge",ob)) { + message("info","Creator staff only, sorry.", ob); + return 0; + } + + if(ob->GetRace() == "rodent"){ + message("info","You are repelled by rodenticide.",ob); + return 0; + } + return 1; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/room/freezer.c ds2.0r27/lib/domains/default/room/freezer.c *** ds1.1/lib/domains/default/room/freezer.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/room/freezer.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,37 ---- + #include <lib.h> + #include <config.h> + #include <rooms.h> + + inherit LIB_ROOM; + + static private object *Old; + + void create() { + room::create(); + SetNoClean(1); + SetProperties(([ "login" : ROOM_START ])); + SetShort( "The freezer"); + SetLong( "The local freezer. Go down to leave."); + SetObviousExits("d"); + SetExits( ([ "down" : ROOM_START ]) ); + Old = ({}); + call_out("clean_room", MAX_NET_DEAD_TIME); + SetNoModify(1); + } + + static void clean_room() { + object *clean_me; + object ob; + + foreach(ob in filter(all_inventory(), (: !living($1) :))) + ob->eventDestruct(); + if( !sizeof(filter(all_inventory(), (: living :))) ) { + Old = ({}); + call_out((: clean_room :), MAX_NET_DEAD_TIME); + return; + } + clean_me = (all_inventory() & Old); + Old = all_inventory() - clean_me; + foreach(ob in clean_me) ob->eventDestruct(); + call_out((: clean_room :), MAX_NET_DEAD_TIME); + } diff -c -r --new-file ds1.1/lib/domains/default/room/furnace.c ds2.0r27/lib/domains/default/room/furnace.c *** ds1.1/lib/domains/default/room/furnace.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/room/furnace.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,36 ---- + #include <lib.h> + #include <rooms.h> + + inherit LIB_ROOM; + + void create() { + room::create(); + SetAmbientLight(30); + SetShort("the furnace"); + SetLong("The furnace. Things that arrive here are "+ + "incinerated. You probably shouldn't be here. Go down to get out."); + SetProperties(([ + "no attack" : 1, + ])); + SetExits( ([ "down" : ROOM_START ]) ); + call_out((: reload_room :), 600, load_object(base_name(this_object()))); + set_heart_beat(1); + SetNoModify(1); + } + int CanReceive(object ob){ + if(interactive(ob)){ + tell_object(ob, "You fail to enter the furnace."); + return 0; + } + return 1; + } + void init(){ + ::init(); + } + void heart_beat(){ + if(sizeof(all_inventory(this_object()))){ + foreach(object ob in deep_inventory(this_object())){ + ob->eventDestruct(); + } + } + } diff -c -r --new-file ds1.1/lib/domains/default/room/menagerie.c ds2.0r27/lib/domains/default/room/menagerie.c *** ds1.1/lib/domains/default/room/menagerie.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/room/menagerie.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,42 ---- + #include <lib.h> + + inherit LIB_ROOM; + + static void create() { + object ob; + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("The Menagerie"); + SetLong("There are more creatures to the south, east, and west."); + SetNoClean(1); + SetInventory(([ + "/domains/default/npc/horse" : 1, + "/domains/default/npc/bird" : 1, + "/domains/default/npc/elephant" : 1, + "/domains/default/npc/bat" : 1, + "/domains/default/npc/newt" : 1, + "/domains/default/npc/lynx" : 1, + "/domains/default/npc/deer" : 1, + "/domains/default/npc/spider" : 1, + "/domains/default/npc/bear" : 1, + "/domains/default/npc/dryad" : 1, + "/domains/default/npc/rat" : 1, + "/domains/default/npc/zookeeper" : 1, + "/domains/default/npc/cow" : 1, + "/domains/default/npc/centaur" : 1, + "/domains/default/npc/gnome" : 1, + "/domains/default/npc/moth" : 1, + "/domains/default/npc/gecko" : 1, + ])); + SetExits( ([ + "south" : "/domains/default/room/menagerie_south", + "north" : "/domains/default/room/wiz_corr_south", + "east" : "/domains/default/room/menagerie_e", + "west" : "/domains/default/room/menagerie_w.c", + ]) ); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/room/menagerie_e.c ds2.0r27/lib/domains/default/room/menagerie_e.c *** ds1.1/lib/domains/default/room/menagerie_e.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/room/menagerie_e.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,33 ---- + #include <lib.h> + #include <rooms.h> + + inherit LIB_ROOM; + + void create() { + room::create(); + SetAmbientLight(30); + SetShort("Menagerie, east"); + SetLong("This is the eastern annex of the menagerie."); + SetNoClean(1); + SetInventory(([ + "/domains/default/npc/foochy" : 1, + "/domains/default/npc/satyr" : 1, + "/domains/default/npc/slug" : 1, + "/domains/default/npc/unicorn" : 1, + "/domains/default/npc/triffid" : 1, + "/domains/default/npc/snake" : 1, + "/domains/default/npc/sheep" : 1, + "/domains/default/npc/boar" : 1, + "/domains/default/npc/pegasus" : 1, + "/domains/default/npc/giant" : 1, + "/domains/default/npc/lemur" : 1, + "/domains/default/npc/treant" : 1, + ])); + SetExits(([ + "west" : "/domains/default/room/menagerie", + ])); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/room/menagerie_south.c ds2.0r27/lib/domains/default/room/menagerie_south.c *** ds1.1/lib/domains/default/room/menagerie_south.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/room/menagerie_south.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,37 ---- + #include <lib.h> + + inherit LIB_ROOM; + + static void create() { + object ob; + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Menagerie Annex"); + SetLong("This area was added to the menagerie to allow a little leg room for creatures that like to wander."); + SetInventory(([ + "/domains/default/npc/elemental" : 1, + "/domains/default/npc/wraith" : 1, + "/domains/default/npc/gargoyle" : 1, + "/domains/default/npc/golem" : 1, + "/domains/default/npc/minotaur" : 1, + "/domains/default/npc/orc" : 1, + "/domains/default/npc/chimera" : 1, + "/domains/default/npc/yattering" : 1, + "/domains/default/npc/balrog" : 1, + "/domains/default/npc/troll" : 1, + "/domains/default/npc/goblin" : 1, + "/domains/default/npc/red_dragon" : 1, + "/domains/default/npc/ogre" : 1, + "/domains/default/npc/gnoll" : 1, + "/domains/default/npc/kobold" : 1, + "/domains/default/npc/klingon" : 1, + ])); + SetNoClean(1); + SetExits(([ + "north" : "/domains/default/room/menagerie", + ])); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/room/menagerie_w.c ds2.0r27/lib/domains/default/room/menagerie_w.c *** ds1.1/lib/domains/default/room/menagerie_w.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/room/menagerie_w.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,32 ---- + #include <lib.h> + #include <rooms.h> + + inherit LIB_ROOM; + + void create() { + room::create(); + SetAmbientLight(30); + SetShort("Menagerie, west"); + SetLong("This is the western annex of the menagerie."); + SetNoClean(1); + SetInventory(([ + "/domains/default/npc/dwarf" : 1, + "/domains/default/npc/helf" : 1, + "/domains/default/npc/artrell" : 1, + "/domains/default/npc/halfling" : 1, + "/domains/default/npc/nymph" : 1, + "/domains/default/npc/avidryl" : 1, + "/domains/default/npc/faerie" : 1, + "/domains/default/npc/hobbit" : 1, + "/domains/default/npc/pessis" : 1, + "/domains/default/npc/kender" : 1, + "/domains/default/npc/zoe" : 1, + ])); + SetExits(([ + "east" : "/domains/default/room/menagerie", + ])); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/room/quarantine1.c ds2.0r27/lib/domains/default/room/quarantine1.c *** ds1.1/lib/domains/default/room/quarantine1.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/room/quarantine1.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,49 ---- + #include <lib.h> + #include <rooms.h> + + inherit LIB_ROOM; + + static void create() { + object ob; + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Disease Lab Prep Room"); + SetLong("This room is designed to repel the spread of diseases that are tested in the room north of here. It is also where you can get a disease repellent collar, so you may work in the quarantine area without becoming infected. To infect the test subjects use the medical tricorder. To make all of them healthy again, type 'update', which will reset the room. The test subjects are waiting for you north of here."); + SetInventory(([ + "/domains/default/obj/collarchest" : 1, + ])); + SetExits( ([ + "south" : "/domains/default/room/wiz_corr_east", + "north" : "/domains/default/room/quarantine2.c", + ]) ); + + SetProperty("no attack", 1); + + } + int CanReceive(object ob) { + object *inv; + string taxonomy; + + if(inherits(LIB_GERM,ob)) return 0; + + if(living(ob) && !creatorp(ob) && !present("testchar badge",ob)) { + message("info","Creator staff only, sorry.", ob); + return 0; + } + + inv = deep_inventory(ob); + foreach(object thing in inv){ + if(inherits(LIB_GERM,thing)) { + write("%^YELLOW%^A parasite has been discovered on your body! It is being automatically removed.%^RESET%^"); + if(taxonomy = thing->GetGermName()) write("%^YELLOW%^Removing: "+taxonomy+".%^RESET%^"); + thing->eventMove(ROOM_FURNACE); + } + } + + return room::CanReceive(); + } + + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/room/quarantine2.c ds2.0r27/lib/domains/default/room/quarantine2.c *** ds1.1/lib/domains/default/room/quarantine2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/room/quarantine2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,39 ---- + #include <lib.h> + + inherit LIB_ROOM; + + static void create() { + object ob; + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Disease Lab"); + SetLong("This room is designed for testing the effects and transmissibility of disease. Another testing area is east."); + SetNoClean(1); + SetExits( ([ + "south" : "/domains/default/room/quarantine1", + "east" : "/domains/default/room/quarantine3.c", + ]) ); + SetInventory(([ + "/domains/default/npc/quarantine/wim" : 1, + "/domains/default/npc/quarantine/rik" : 1, + "/domains/default/npc/quarantine/han" : 1, + "/domains/default/npc/quarantine/tom" : 1, + "/domains/default/npc/quarantine/lex" : 1, + "/domains/default/npc/quarantine/jan" : 1, + "/domains/default/npc/quarantine/ted" : 1, + "/domains/default/npc/quarantine/pip" : 1, + "/domains/default/npc/quarantine/cor" : 1, + "/domains/default/npc/quarantine/kip" : 1, + "/domains/default/npc/quarantine/job" : 1, + "/domains/default/npc/quarantine/ton" : 1 + ])); + AddItem(new("/domains/default/obj/reset_button")); + + } + int CanReceive(object ob) { + return room::CanReceive(); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/room/quarantine3.c ds2.0r27/lib/domains/default/room/quarantine3.c *** ds1.1/lib/domains/default/room/quarantine3.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/room/quarantine3.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,37 ---- + #include <lib.h> + + inherit LIB_ROOM; + + static void create() { + object ob; + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Disease Lab Annex"); + SetLong("This room is designed for testing the effects and transmissibility of disease. Another testing area is west."); + SetInventory(([ + "/domains/default/npc/quarantine/nigel" : 1, + "/domains/default/npc/quarantine/graham" : 1, + "/domains/default/npc/quarantine/duncan" : 1, + "/domains/default/npc/quarantine/trevor" : 1, + "/domains/default/npc/quarantine/simon" : 1, + "/domains/default/npc/quarantine/spencer" : 1, + "/domains/default/npc/quarantine/gavin" : 1, + "/domains/default/npc/quarantine/adrian" : 1, + "/domains/default/npc/quarantine/miles" : 1, + "/domains/default/npc/quarantine/edmund" : 1, + "/domains/default/npc/quarantine/wallace" : 1, + "/domains/default/npc/quarantine/lester" : 1, + ])); + SetExits(([ + "west" : "/domains/default/room/quarantine2", + ])); + SetNoClean(1); + AddItem(new("/domains/default/obj/reset_button")); + } + int CanReceive(object ob) { + return room::CanReceive(); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/room/stargate_lab.c ds2.0r27/lib/domains/default/room/stargate_lab.c *** ds1.1/lib/domains/default/room/stargate_lab.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/room/stargate_lab.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,49 ---- + #include <lib.h> + #include <daemons.h> + + inherit LIB_ROOM; + + int SignRead(){ + string list; + list = implode(keys(STARGATE_D->GetStargates()),", "); + write("These are Stargate operation instructions."); + write("The Dead Souls stargate system provides teleportation within " + "the stargate network. To use the stargate network, one finds an " + "idle stargate, then dials the name of some other known stargate. " + "One then enters the outbound stargate, and if things go well, teleportation " + "to the dialed stargate occurs. To travel to Uruk, if that were a " + "valid stargate name, you would: dial uruk\n" + "Once the stargate activates: enter stargate"); + write("Currently available stargates are:"); + write("%^BOLD%^%^YELLOW%^"+list+"%^RESET%^"); + return 1; + } + + static void create() { + object ob; + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Stargate Lab"); + SetLong("This is the test laboratory for the new Dead Souls Stargate system.\n" + "%^BOLD%^%^GREEN%^An instruction sign is here.%^RESET%^"); + SetItems(([ + ({ "sign", "instruction sign", "instructions sign", "instruction", "instructions" }) : "A sign you can read. It appears to be instructions for operating the stargate.", + ])); + SetInventory(([ + "/domains/default/obj/stargate" : 1, + ])); + SetExits(([ + "north" : "/domains/default/room/wiz_corr_east", + ])); + SetRead("sign", (: SignRead() :) ); + SetProperty("no attack", 1); + + } + int CanReceive(object ob) { + return room::CanReceive(); + } + + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/room/start.c ds2.0r27/lib/domains/default/room/start.c *** ds1.1/lib/domains/default/room/start.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/room/start.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + #include <rooms.h> + + inherit LIB_ROOM; + + void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("The start room"); + SetLong("The default start room. To enter "+ + "a sample set of rooms, go down."); + SetExits( ([ + "down" : "/domains/town/room/road", + ]) ); + SetNoModify(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/room/telnet_room.c ds2.0r27/lib/domains/default/room/telnet_room.c *** ds1.1/lib/domains/default/room/telnet_room.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/room/telnet_room.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,73 ---- + #include <lib.h> + #include <daemons.h> + #include <rooms.h> + + inherit LIB_ROOM; + + string LoadIP(){ + if(mud_name() != "Dead Souls"){ + if(INTERMUD_D->GetMudList()["Dead Souls"]) + return INTERMUD_D->GetMudList()["Dead Souls"][1]; + } + if(INTERMUD_D->GetMudList()["Frontiers"]) + return INTERMUD_D->GetMudList()["Frontiers"][1]; + else return "127.0.0.1"; + } + + string LoadPort(){ + if(mud_name() != "Dead Souls"){ + if(INTERMUD_D->GetMudList()["Dead Souls"]) + return INTERMUD_D->GetMudList()["Dead Souls"][2]; + } + if(INTERMUD_D->GetMudList()["Frontiers"]) + return INTERMUD_D->GetMudList()["Frontiers"][2]; + else return ""+query_host_port(); + } + + void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("the telnet room"); + SetLong("From this room, you can attempt "+ + "to connect to Dead Souls MUD. This is useful if you "+ + "need to ask questions but the intermud connection is "+ + "down. It is also a way to get a sneak peek at what's "+ + "coming in the next release of Dead Souls, because "+ + "Dead Souls MUD is where all new fixes and features "+ + "are tested before release."+ + "\n\tIf the connection "+ + "fails, email cratylus@users.sourceforge.com to ask for help. "+ + "Once you connect to Dead Souls, type \"dcon\" to "+ + "return to your own mud. \n\n"+ + "To connect type \"connect\" \n"+ + "The Creators' Hall west wing is south of here."); + SetExits( ([ + "south" : "/domains/default/room/wiz_hall2", + ]) ); + SetNoModify(1); + } + + void init(){ + object ding; + ::init(); + if(!present("telnet_room_client",this_player())){ + ding=new("/secure/obj/tc"); + ding->eventMove(this_player()); + ding->SetConnection(LoadIP()+" "+LoadPort()); + } + } + + int CanRelease(object ob){ + if(present("telnet_room_client",ob)){ + present("telnet_room_client",ob)->eventDestruct(); + } + return 1; + } + + int CanReceive(object ob) { + if(interactive(ob)){ + tell_object(this_object(),ob->GetName()+" is about to enter the telnet room."); + } + return 1; + } diff -c -r --new-file ds1.1/lib/domains/default/room/test.c ds2.0r27/lib/domains/default/room/test.c *** ds1.1/lib/domains/default/room/test.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/room/test.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + #include <rooms.h> + + inherit LIB_ROOM; + + void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("The start room"); + SetLong("The default start room. To enter "+ + "a sample set of rooms, go down."); + SetExits( ([ + "down" : "/domains/town/room/road", + ]) ); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/room/void.c ds2.0r27/lib/domains/default/room/void.c *** ds1.1/lib/domains/default/room/void.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/room/void.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,16 ---- + #include <lib.h> + #include <rooms.h> + + inherit LIB_ROOM; + + void create() { + room::create(); + SetAmbientLight(30); + SetShort("the void"); + SetLong("The void. Go down to get out."); + SetExits( ([ "down" : ROOM_START ]) ); + SetNoModify(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/room/wiz_corr1.c ds2.0r27/lib/domains/default/room/wiz_corr1.c *** ds1.1/lib/domains/default/room/wiz_corr1.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/room/wiz_corr1.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,32 ---- + #include <lib.h> + + inherit LIB_ROOM; + + static void create() { + object ob; + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Test Labs Corridor"); + SetLong("This is the main corridor of the test labs. North is the combat arena. South is the menagerie. The Creators Hall is west of here, and the corridor continues east."); + SetExits( ([ + "south" : "/domains/default/room/wiz_corr_south", + "west" : "/domains/default/room/wiz_hall", + "north" : "/domains/default/room/arena", + "east" : "/domains/default/room/wiz_corr_east.c", + ]) ); + SetInventory(([ + ])); + + SetProperty("no attack", 1); + + SetDoor("north", "/domains/default/doors/steel_door2.c"); + + } + int CanReceive(object ob) { + return room::CanReceive(); + } + + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/room/wiz_corr_east.c ds2.0r27/lib/domains/default/room/wiz_corr_east.c *** ds1.1/lib/domains/default/room/wiz_corr_east.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/room/wiz_corr_east.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,30 ---- + #include <lib.h> + + inherit LIB_ROOM; + + static void create() { + object ob; + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Test Labs Corridor East"); + SetLong("This is the main corridor of the test labs. North is the disease lab. The corridor runs west from here. South is the new Stargate lab."); + SetExits( ([ + "west" : "/domains/default/room/wiz_corr1", + "north" : "/domains/default/room/quarantine1", + "south" : "/domains/default/room/stargate_lab.c", + ]) ); + + SetInventory(([ + ])); + + SetProperty("no attack", 1); + + } + int CanReceive(object ob) { + return room::CanReceive(); + } + + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/room/wiz_corr_south.c ds2.0r27/lib/domains/default/room/wiz_corr_south.c *** ds1.1/lib/domains/default/room/wiz_corr_south.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/room/wiz_corr_south.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,31 ---- + #include <lib.h> + + inherit LIB_ROOM; + + static void create() { + object ob; + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Menagerie Corridor"); + SetLong("This short corridor leads south to the menagerie. This corridor has been specially created to repel NPC's, so that the creatures south of here do not escape. The main test lab corridor is north."); + SetExits( ([ + "north" : "/domains/default/room/wiz_corr1", + "south" : "/domains/default/room/menagerie.c", + ]) ); + + SetInventory(([ + ])); + + } + int CanReceive(object ob) { + if(living(ob) && !creatorp(ob) && !present("testchar badge",ob)) { + message("info","Creator staff only, sorry.", ob); + return 0; + } + return room::CanReceive(ob); + } + + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/room/wiz_hall.c ds2.0r27/lib/domains/default/room/wiz_hall.c *** ds1.1/lib/domains/default/room/wiz_hall.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/room/wiz_hall.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,60 ---- + #include <lib.h> + #include <rooms.h> + + inherit LIB_ROOM; + + string LongDesc(){ + string desc = "Immortals come here to communicate with each other about "+ + "the world they are building. The Adventurer's Guild "+ + "is north. The Arch Room is south. To visit the Dead Souls "+ + "test and development mud, go west. The test lab facilities are east."; + desc += "\nA sign reads: "+load_object(ROOM_ARCH)->SignRead(); + return desc; + } + + static void create() { + object ob; + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Creators' Hall"); + SetLong( (: LongDesc :) ); + SetProperty("no attack", 1); + SetProperty("nopeer",1); + ob = new("/lib/bboard"); + ob->SetKeyName("chalkboard"); + ob->SetId( ({ "board", "chalkboard", "dusty board", "dusty chalkboard" }) ); + ob->set_board_id("immortal_board"); + ob->set_max_posts(30); + ob->SetShort("a dusty chalkboard"); + ob->eventMove(this_object()); + SetInventory(([ + "/domains/default/npc/tree" : 1, + "/domains/default/obj/chest.c" : 1 ])); + SetItems( ([ + ({"sign"}) : "A sign you can read.", + ]) ); + SetExits( ([ + "east" : "/domains/default/room/wiz_corr1", + "south" : "/secure/room/arch", + "north" : "/domains/town/room/adv_guild", + "west" : "/domains/default/room/wiz_hall2.c", + ]) ); + SetRead("sign", (: load_object(ROOM_ARCH)->SignRead() :) ); + } + + int CanReceive(object ob) { + if(playerp(ob) && !creatorp(ob) && !present("testchar badge",ob)) { + message("info","Creator staff only, sorry.", ob); + return 0; + } + + if(ob->GetRace() == "rodent"){ + message("info","You are repelled by rodenticide.",ob); + return 0; + } + return 1; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/room/wiz_hall2.c ds2.0r27/lib/domains/default/room/wiz_hall2.c *** ds1.1/lib/domains/default/room/wiz_hall2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/room/wiz_hall2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,59 ---- + #include <lib.h> + #include <rooms.h> + + inherit LIB_ROOM; + + string LongDesc(){ + string desc = "Immortals come here to communicate with each other about "+ + "the world they are building. The Adventurer's Guild "+ + "is north. The Arch Room is south. To visit the Dead Souls "+ + "test and development mud, go west. The test lab facilities are east."; + desc += "\nA sign reads: "+load_object(ROOM_ARCH)->SignRead(); + return desc; + } + + static void create() { + object ob; + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Creators' Hall West Wing"); + SetLong("This is the west wing of the Creators' Hall. North is the telnet room where you can connect to the Dead Souls test and development mud. South is the domains room, where you can conveniently visit featured domains or realms."); + SetProperty("no attack", 1); + SetProperty("nopeer",1); + ob = new("/lib/bboard"); + ob->SetKeyName("chalkboard"); + ob->SetId( ({ "board", "chalkboard", "dusty board", "dusty chalkboard" }) ); + ob->set_board_id("immortal_board"); + ob->set_max_posts(30); + SetShort("Creators' Hall West Wing"); + ob->eventMove(this_object()); + SetItems( ([ + ({"sign"}) : "A sign you can read.", + ]) ); + SetExits( ([ + "east" : "/domains/default/room/wiz_hall", + "north" : "/domains/default/room/telnet_room", + "south" : "/domains/default/room/domains_room.c", + ]) ); + SetInventory(([ + ])); + + SetRead("sign", (: load_object(ROOM_ARCH)->SignRead() :) ); + } + + int CanReceive(object ob) { + if(playerp(ob) && !creatorp(ob) && !present("testchar badge",ob)) { + message("info","Creator staff only, sorry.", ob); + return 0; + } + + if(ob->GetRace() == "rodent"){ + message("info","You are repelled by rodenticide.",ob); + return 0; + } + return 1; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/weap/brush.c ds2.0r27/lib/domains/default/weap/brush.c *** ds1.1/lib/domains/default/weap/brush.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/weap/brush.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + static void create(){ + item::create(); + SetKeyName("brush"); + SetId( ({ "brush" }) ); + SetAdjectives( ({ "bath","shower","wood","wooden" }) ); + SetShort("a shower brush"); + SetLong("This is a long wooden brush with soft bristles "+ + "at the end, designed to assist in reaching "+ + "tough-to-scrub areas while bathing."); + SetVendorType(VT_WEAPON); + SetClass(10); + SetMass(100); + SetWeaponType("blunt"); + SetDamageType(BLUNT); + } diff -c -r --new-file ds1.1/lib/domains/default/weap/carving_knife.c ds2.0r27/lib/domains/default/weap/carving_knife.c *** ds1.1/lib/domains/default/weap/carving_knife.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/weap/carving_knife.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,27 ---- + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + + + static void create() { + item::create(); + SetKeyName("carving knife"); + SetId( ({ "knife"})); + SetAdjectives( ({ "serrated","sharp","razor sharp","steel","hefty","stainless","carving"})); + SetShort("a serrated, 8-inch carving knife"); + SetLong("This is a serrated, 8-inch carving knife. This razor sharp "+ + "knife has been forged from molded and hammered high-carbon "+ + "stainless steel. It is solid, hefty, and well-balanced. "+ + "This is a dangerous knife, and can be considered a very "+ + "deadly weapon."); + SetMass(50); + SetVendorType(VT_WEAPON); + SetClass(30); + SetDamageType(BLADE); + SetWeaponType("blade"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/default/weap/orcslayer.c ds2.0r27/lib/domains/default/weap/orcslayer.c *** ds1.1/lib/domains/default/weap/orcslayer.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/weap/orcslayer.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,34 ---- + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + inherit LIB_READ; + + static void create() { + item::create(); + SetKeyName("Orc Slayer"); + SetId( ({ "orcslayer", "orc slayer","sword", "short sword", "shortsword"})); + SetAdjectives( ({ "crafted","finely crafted","short","sharp","fine"})); + SetShort("a finely crafted short sword"); + SetLong("This is a very fine blade, overed with ancient runes. Engraved on it is a picture of the sword slicing an orc."); + SetMass(300); + SetVendorType(VT_WEAPON); + SetClass(150); + SetDamageType(BLADE); + SetWeaponType("blade"); + SetItems( ([ + ({"rune","runes"}) : "The runes' meaning is undecipherable to you.", + ({"picture","engraving"}) : "An almost comical image of a startled orc sliced in half.", + ]) ); + SetRead( ([ + ({"rune","runes"}) : "You do not understand them." + ]) ); + } + + int eventStrike(object target) { + if( (string)target->GetRace() != "orc" ) return item::eventStrike(target); + message("environment", "The orc slayer sword glows blue and emits a ghastly shrieking sound!", + environment(target)); + return item::eventStrike(target) + random(50)+10; + } diff -c -r --new-file ds1.1/lib/domains/default/weap/sharpsword.c ds2.0r27/lib/domains/default/weap/sharpsword.c *** ds1.1/lib/domains/default/weap/sharpsword.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/weap/sharpsword.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + + static void create() { + item::create(); + SetKeyName("sharp sword"); + SetId( ({ "sword", "short sword", "shortsword"})); + SetAdjectives( ({ "short","sharp","fine"})); + SetShort("a sharp sword"); + SetLong("A fine, sharp, short sword."); + SetMass(300); + SetBaseCost("silver",50); + SetVendorType(VT_WEAPON); + SetClass(150); + SetDamageType(BLADE); + SetWeaponType("blade"); + } diff -c -r --new-file ds1.1/lib/domains/default/weap/staff.c ds2.0r27/lib/domains/default/weap/staff.c *** ds1.1/lib/domains/default/weap/staff.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/default/weap/staff.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,22 ---- + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + static void create(){ + item::create(); + SetKeyName("staff"); + SetId( ({ "staff", "stick", "pole" }) ); + SetAdjectives( ({ "wood","wooden" }) ); + SetShort("a wooden staff"); + SetLong("This staff is old, weathered, "+ + "and lumpy. However, it feels quite sturdy "+ + "and solid."); + SetVendorType(VT_WEAPON); + SetDamagePoints(50); + SetClass(100); + SetMass(100); + SetWeaponType("blunt"); + SetHands(2); + SetDamageType(BLUNT); + } diff -c -r --new-file ds1.1/lib/domains/examples/room/README ds2.0r27/lib/domains/examples/room/README *** ds1.1/lib/domains/examples/room/README Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/examples/room/README Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,16 ---- + Example Rooms Index + =========================================================================== + exroom1: Changing Chats when a quest has been done. + exroom2: example of a room you can inherit. All its functions + go to the rooms which inherit it. They can over-write those functions. + All three rooms which inherit it manipulate 'pull' in their own + rooms. They don't affect 'pull' or "myvar" in this room. + exroom2a: inherits exroom2 and ADDS to the object_entered function + exroom2b: inherits exroom2 and adds nothing to object_entered (but you'll + see that it uses the object_entered from exroom2). + exroom2c: inherits exroom2 and removes the object_entered from exroom2. + exroom3: move_player + exroom4: pre/post exits add/remove exits set/query/remove tempvars + exroom5: look_fail & tempvars pt 2. + exroom6: pre-exit (sneak) + exroom7: two verbs for one add_action diff -c -r --new-file ds1.1/lib/domains/examples/room/entrance.c ds2.0r27/lib/domains/examples/room/entrance.c *** ds1.1/lib/domains/examples/room/entrance.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/examples/room/entrance.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,106 ---- + #include <lib.h> + #include <rooms.h> + #include "ex.h" + + inherit LIB_ROOM; + + + void create() { + room::create(); + SetAmbientLight(30); + SetShort( "Entrance to Hall Of Rooms" ); + SetLong( + "|-----------------------------------------------------------------------------|\n\n"+ + " You are in a large, empty room. There are few things to examine -- only the\n" + "floor, ceiling and wall at this time. An opening to your north leads to the \n" + "incredible Hall of Examples. The line at the top of this description was put\n" + "in as a VERY useful tool for keeping a standard width to all descriptions\n" + " and messages.\n\n" + " The Hall of Examples has many rooms to look through. Each room is limited\n" + "to one or two different types of things. For example, showing how to do a\n" + "pre-exit function. Naturally, you will probably combine many of these\n" + "functions into one single room. Room files can get long and involved, but\n" + "when you understand the individual parts, you have no trouble understanding\n" + "the whole. Don't forget to %^BOLD%^GREEN%^'more here'%^RESET%^ in each room." + " Most of the rooms have explanations written out in comments.\n\n" + " As a final aside, most of the functions are simplistic. These are \n" + "very basic examples." + ); + + SetExits( ([ + "north" : EXPATH + "exroom1", + "south" : START + ])); + + // What follows is a short tutorial on item descriptions. + + // A mapping is a special type of variable -- a list. + // It has a 'key' and a 'value' which are tied together. + // When you query a key it returns the value. + // Each key must be unique. + + // The SetItems in rooms is a mapping where the key & value are + // both strings. + + // This: ([ ]) means what is inside is a mapping. + + // SetItems( ([ ]) ); means you're putting an entire + // mapping into the SetItems. This is how we put items into + // various rooms. We're manipulating the entire mapping + // as a whole. You'll notice for the walls, there is an + // array to allow a player to do 'look wall' and 'look walls' + // and get the same description. This is a very useful method. + + SetItems( ([ + "floor" : "The floor is dirty.", + "ceiling" : "The ceiling is high", + ({ "wall", "walls" }) : "The walls are currtly not very exciting.", + ]) ); + + // The room code also allows us to manipulate individual 'keys' of the + // SetItems mapping: + // AddItem( "bird" , "A small robin sits passageway you can enter."); + // would be a way to put the description for bird into the SetItems mapping. + + // With any mapping, when you set a value for a key that already exists + // the mapping replaces the old one with the new; if that key does + // not yet exist it will add it in. + + // So, when you see the ([ ]) it means you are plunking in a group of + // key/value pairs into the mapping. + + // Finally, if you do SetItems( ([ ]) ); it is going to replace + // the entire SetItems mapping with what is in the ([ ]). + // If you do AddItem(); it will ADD the new mapping to + // the existing SetItems mapping. + + // To illustrate you need to call the test1() function in this room. + // To do that, do the following: + // > call here->test1() + + } + + void test1() + { + write("Now take a look at the room"); + SetItems( ([ + "north wall" : "The north wall has an exit.", + "east wall" : "The east wall is painted blue.", + "south wall" : "The south wall is painted yellow.", + "west wall" : "The west wall is painted green.", + "wall" : "Which wall? North, South, East or West?", + "walls" : "Which wall? North, South, East or West?" + ]) ); + + // In this example, when overwriting the SetItems mapping, you are + // not able to use arrays at this time. That is the reason that + // 'wall' and 'walls' is not listed as you first saw. Keep this + // in mind when overwriting existing mappings. As you'll also + // notice, as mentioned above, you can no longer look at the floor + // or the ceiling since the whole SetItems mapping has been replaced. + + // Now let's add one description to the list. + AddItem( "statue", "There is a statue of a wizard here." ); + + return; + } diff -c -r --new-file ds1.1/lib/domains/examples/room/ex.h ds2.0r27/lib/domains/examples/room/ex.h *** ds1.1/lib/domains/examples/room/ex.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/examples/room/ex.h Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,7 ---- + //here's some paths + #define EXAMPLES "/domains/examples/" + #define EXPATH EXAMPLES + "room/" + + //here's some files + #define PAPAROOM EXPATH +"exroom2" + #define START EXPATH + "start" diff -c -r --new-file ds1.1/lib/domains/examples/room/exroom1.c ds2.0r27/lib/domains/examples/room/exroom1.c *** ds1.1/lib/domains/examples/room/exroom1.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/examples/room/exroom1.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,110 ---- + #include <lib.h> + #include <rooms.h> + #include "ex.h" + + // The #include "ex.h" is used in each of these files to remember + // the defines for EXPATH and other variables we have defined + // that all of these files use. It would be tedious to have to + // put the #define EXPATH in every file, so we put it into one + // and include it as a reference for each file that needs it. + // Consider it a library card. The books that are in the library + // (the #define's) are referenced every time you see EXPATH. + + inherit LIB_ROOM; + + // I'm defining a global variable here called once to be used later + // in the file. A global variable is something that can be used + // by any function in this room. There are also local variables + // that can be defined only in the variable using it. + + int once; + + // I'm also defing a function lever_pulled() that will be called later. + mixed lever_pulled(); + + void create() + { + ::create(); + SetAmbientLight(30); + SetShort( "Lever Pull" ); + SetLong("This is an example room for a simple add_action which changes "+ + "a description. There's a lever to pull." + ); + + SetExits( ([ + "north" : EXPATH + "exroom2", + "south" : EXPATH + "entrance", + ])); + + // Here, take a look at how I set the lever item. It is different + // that you saw in the entrance room. What I am doing here is + // calling a functional. When the player types 'look lever', it + // will call the functional (: lever_pulled :) that we defined above. + // I'll explain later in this file. + + SetItems( ([ + "lever" : ((: lever_pulled :)) + ]) ); + + } + + // In the init() function, I am setting our global variable 'once' to 0. This + // is used to reset the lever back when the room resets or the mud reboots. + // so the next player who comes in to pull the lever, they can. + // In the init() function, we also define the actions that can be done in the + // room. In this case, we need a pull action to 'pull lever'. Whenever a player + // types pull, it will call the function aa_pull(). + + void init() + { + ::init(); + add_action("aa_pull","pull"); + once = 0; + } + + // This is the function that is called when a player types pull as mentioned above. + // First, we need to check and see if they are pulling the correct thing. the + // string str is defining a local variable that will be used in this function. + // Next, we have if( str != "lever"). That is saying if I type 'pull finger', + // it will write 'Pull what?'. The \n symbol means a carriage return or 'enter' + // to go to the next line. + + mixed aa_pull(string str) + { + if ( str != "lever") + { + write( "Pull what?\n" ); + return 1; + } + + // Here we are going to check if the lever has been pulled. If it has, + // it's going to tell the player that and exit the aa_pull() function. + // this is done by the return 1; that you see here. + + if( once ==1 ) + { + write( "The lever's already pulled." ); + return 1; + } + + // If the lever has not been pulled, this part starts. As you'll notice, we + // set once = 1 to indicate that the lever has been pulled. + + write("You pull the lever!\n"); + say(this_player()->GetName() + " pulls the lever!\n"); + once=1; + return 1; + } + + // I told you I'd explain what the functional (: lever_pulled :) was for. + // Below, it checks to see if the lever has been pulled. if( !once ) + // says, if once is equal to 0 (not pulled) it returns and says the lever + // has not been pulled. If once is not equal to 0, then it means that it + // has been pulled and returns a different message. + + mixed lever_pulled() + { + if( !once ) + return "The lever is pushed into the wall. Perhaps you could pull it."; + return "The lever has already been pulled. You're too late!"; + } diff -c -r --new-file ds1.1/lib/domains/examples/room/exroom2.c ds2.0r27/lib/domains/examples/room/exroom2.c *** ds1.1/lib/domains/examples/room/exroom2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/examples/room/exroom2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,77 ---- + #include <lib.h> + #include "ex.h" + + inherit LIB_ROOM; + + int myvar; + + void create() + { + ::create(); + SetAmbientLight(30); + SetShort( "a master file" ); + SetLong(@EndText + |---------------------------------------------------------------|-------------| + This is an example room for inheriting files. This + file is inherited by two others. It's also a fully + functional room. There's a lever to pull. + The rooms which inherit me are to the east. + EndText + ); + + // You'll notice that for SetLong(), I've put @EndText at the top and EndText at the bottom + // and have not put in quotes. When using this style of code, it is important to make sure + // you manually enter to the next line to wrap the lines on the player's screen. + // This can be a tedious if you do not know how many lines to enter before you need to + // continue on the next line. If you look back to the Entrance to the Hall of Examples, + // You will see a handy line I've used to know when to stop a line and continue on + // the next. I've included it in the room description for your convenience. the + // normal screen default is 79 characters. Whenever you would like to recreate the line + // at the top, type 'margins' + + SetExits( ([ + "south" : EXPATH + "exroom1", + "north" : EXPATH + "exroom3", + "east" : EXPATH + "exroom2a" + ]) ); + SetItems( ([ + "lever" : "A lever for pulling.", + ]) ); + + myvar = 0; + } + + // The CanReceive() function is very helpful to do checks on an interactive object + // that enters the room. In this case, we are checking to see if the object that + // enters is a creator player object. If it is, then we will give a message to + // that object with the write() funciton. I've put some color tags to set the color + // off from the rest of the text. For colors available, type 'colors'. + + int CanReceive(object ob) + { + if ( creatorp(ob) ) + write( "%^BOLD%^BLUE%^Room tells you: %^BOLD%^GREEN%^You're a creator! %^BOLD%^BLUE%^(This is from the master file.)%^RESET%^\n"); + return 1; + } + + void init() + { + ::init(); + add_action("aa_pull","pull"); + } + + // We're going to use the variable 'myvar' in the middle of a write() funciton. As + // you'll notice below, the text you are writing has to be in the " ". Then we + // separate the text by putting in: " + myvar + ". This adds the myvar variable + // to the text output whenever a player pulls the lever. Try it and see. + + + mixed aa_pull(string str) + { + if (str!="lever") + return notify_fail("Pull what?\n"); + myvar ++; + write("You pull the lever and the value of 'myvar' is now " + myvar + "\n"); + say(this_player()->GetName() + " pulls the lever!\n"); + return 1; + } diff -c -r --new-file ds1.1/lib/domains/examples/room/exroom2a.c ds2.0r27/lib/domains/examples/room/exroom2a.c *** ds1.1/lib/domains/examples/room/exroom2a.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/examples/room/exroom2a.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,72 ---- + #include <lib.h> + #include "ex.h" + + inherit PAPAROOM; + + void create() + { + ::create(); + SetAmbientLight(30); + SetShort( "a 'child' file" ); + SetLong("This is an example room whose properties are inherited " + "from another room.\n<look more> for more information." + ); + + //Note: When we set the "exits" in this room we + // over-write the "exits" we inherited from PAPAROOM + // There's a way to just add an exit to the list, but exits + // are primarily unique to each room, so this method is fine. + SetExits( ([ + "west" : EXPATH + "exroom2", + "east" : EXPATH + "exroom2b" + ])); + + SetItems( ([ + "more" : @EndBlah + ------------------------------------------------------------------- + Take a look at the CanReceive function. + Do you see the line ::CanReceive(ob)? + The :: refers to 'the file I've inherited from'. + So, we are calling (using) the function CanReceive() as it is + written in exroom2.c + THEN we are doing our own thing. + + When an object enters this room (player or bowl or sword etc) + it becomes the variable 'ob'. + + We pass that variable 'ob' along to the function CanReceive() + that's in exroom2.c + + Then we check to see if ob is a player or creator. (type: man userp) + If so, we give that object a message. + ------------------------------------------------------------------- + EndBlah, + ])); + + /* See the way I did the SetItems again for 'more'. This is one + way to do it. Another way to do it is to use a (: functional :) + like I did for the lever. Take a look, however, at this comment + that you are reading. If you'll notice, I've done it a little + differently to show you a way to comment out several lines all + at once. The original method that I used was to put // in front + of the line that I wanted to comment out. If you have several + lines like we have here, then you'll want to begin your comment + like you see here and end it like below. This is how I will + be doing large comments in future examples. + */ + + + } + + int CanReceive(object ob) + { + ::CanReceive(); + if ( userp(ob) ) + write("%^MAGENTA%^Room tells you: %^GREEN%^You're any player, creator or not! %^MAGENTA%^(This is from this room)%^RESET%^\n"); + return 1; + } + + void init() + { + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/examples/room/exroom2b.c ds2.0r27/lib/domains/examples/room/exroom2b.c *** ds1.1/lib/domains/examples/room/exroom2b.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/examples/room/exroom2b.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,37 ---- + #include <lib.h> + #include "ex.h" + + inherit PAPAROOM; + + void create() + { + ::create(); + SetAmbientLight(30); + SetShort( "a 'child' file" ); + SetLong("This is an example room that inherits the properties " + "of another room."); + + /* Note: When we set the "exits" in this room we over-write + the "exits" we inherited from PAPAROOM. There's a way to + just add an exit to the list, but exits are primarily + unique to each room, so this method is fine. + */ + + SetExits( ([ + "west" : EXPATH + "exroom2a", + ])); + + /* Now, we are setting the objects that are loaded into the room, + or the inventory of the room. Just like a player has inventory + on their character. + */ + + SetInventory( ([ "/domains/default/obj/bbucket" : 1 ])); + + } + + + void init() + { + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/examples/room/exroom3.c ds2.0r27/lib/domains/examples/room/exroom3.c *** ds1.1/lib/domains/examples/room/exroom3.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/examples/room/exroom3.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,55 ---- + #include <lib.h> + #include "ex.h" + + inherit LIB_ROOM; + + void create() + { + ::create(); + SetAmbientLight(30); + SetShort( "move the player" ); + SetLong(@EndText + This is an example room for moving a player. There's nothing + to look at here. But, surprise, there's a lever to pull. + + We are going to get a bit fancier and have something special + happen when a player pulls the lever. + EndText + ); + + SetExits( ([ + "south" : EXPATH + "exroom2", + "north" : EXPATH + "exroom4", + ])); + + } + + void init() + { + ::init(); + add_action("aa_pull","pull"); + } + + int aa_pull(string str) + { + if (str!="lever") + { + write( "Pull what?\n" ); + return 1; + } + write(@EndText + You pull the lever and a big hand grabs you! + It whisks you away to parts unknown. Ok, they are known. + Look around when you get there, which is basically instantaneous. + EndText); + say(this_player()->GetName() + " pulls the lever!"); + this_player()->eventMoveLiving(EXPATH + "exroom1", "forcibly when a big hand takes " + objective(this_player()) + " away", + this_player()->GetName() + " is dropped from the sky by a big hand." + ); + return 1; + } + + /* The eventMoveLiving() function transports the player who pulls + the lever to another room. It also writes a message in the room + that the player leaves and in the room they are sent to. + */ diff -c -r --new-file ds1.1/lib/domains/examples/room/exroom4.c ds2.0r27/lib/domains/examples/room/exroom4.c *** ds1.1/lib/domains/examples/room/exroom4.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/examples/room/exroom4.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,198 ---- + #include <lib.h> + #include "ex.h" + + inherit LIB_ROOM; + int pre_north(); + int post_south(); + int post_north(); + + void create() + { + ::create(); + SetAmbientLight(30); + SetShort( "pre/post exits and add/remove exits" ); + SetLong(@EndText + There's a door to the north with a doorbell, and a blank + wall to the south. + ------------------------------------------------------------- + This is an example room for using pre-exits and post-exits. + It also shows how to add & delete an exit from the room, and + use a temporary variable on a player. + + There's a lever to pull and push, and a bell to ring. + Pull the lever out: create an exit to the south. + Push the lever in: delete an exit to the south. + Ring the bell: allows you to go north. + When you go south, the exit to the south disappears. + ------------------------------------------------------------- + EndText + ); + + SetExits( ([ + ])); + + AddExit( "north", EXPATH + "exroom5", (: pre_north :)); + + } + + void init() + { + ::init(); + add_action("aa_pull","pull"); + add_action("aa_push","push"); + add_action("aa_ring","ring"); + } + + + int aa_pull(string str) + { + if (str!="lever" && str!="lever out") + { + write( "Pull what?\n" ); + return 1; + } + /* Now, we can find out if the lever has been already pulled + in one of two ways. + Method one: we test to see if the exit to the south is open. + Since pulling the lever does this, and the only way to + create that exit is pulling the lever -- this is a valid method. + + Method two: we use a variable and change it's value when the lever + is pushed or pulled. Since we have a method that works without + using an additional variable, that is the method I'll pick here. + It will also show you how to query for an exit. + + Note: GetExits() returns a mapping for all the exits in a room + GetExit("dir") returns the value for that specific direction. + if there is NOT an exit in that direction it will return UNDEFINED + and can be detected using the ! operator. (! means 'not') + conversely, if GetExit("dir") is true, then there IS an exit + to that direction. Got it? Good. + */ + + if ( GetExit("south") ) + { + write("The lever is already pulled out!\n"); + return 1; + } + + /* If you don't know by now, this_player() indicates the player doing the actions + So when I do this_player()->GetName() it gives me the name of the player + who is doing the actions and allows me to tell the room who it is. + */ + + write( "You pull the lever and an invisible crack appears in the south wall. "+ + "A door slides open and there is a previously undetected exit." ); + say(this_player()->GetName() + " pulls the lever and an exit appears to the south.\n"); + + // AddExit() functions add an exit to the room. Here, we added an exit and + // set up a (: functional :) to do close up the exit when they leave. + + AddExit( "south", EXPATH + "exroom3", (: post_south :) ); + SetObviousExits("n, s"); + return 1; + } + + + int aa_push(string str) + { + if (str!="lever" && str!="lever in") + { + write( "Push what?\n" ); + return 1; + } + + /* Since there's more then one way for the exit to dissappear (see the post-exit + function for south) and there may be more then one player wandering the halls + we don't want to assume that 'this' player pushed the lever. So we wouldn't + say "You've already pushed the lever." + */ + + if ( ! GetExit("south") ) + { + write( "The lever is pushed in as far as it will go.\n"); + return 1; + } + write( "You push the lever in and an unseen door slides shut in the south wall."+ + "The wall now appears solid and unpenatrable." ); + say(this_player()->GetName() + " pushes the lever and the south closes tight.\n"); + + // Now we remove the exit that was added earlier. + + RemoveExit("south"); + SetObviousExits("n"); + return 1; + } + + + int aa_ring(string str) + { + if (str!="bell" && str!="doorbell" && str!="door bell") + { + write( "Ring what?\n" ); + return 1; + } + //if we only want to let them ring it once, we can check for the + //temp var here. This version will let them ring it many times. + write("DONG!\nYou ring a doorbell! You are now admitted north.\n"); + say("DONG! A doorbell rings.\n"); + this_player()->SetProperty("rung_bell", 1); + return 1; + } + + + /* CODING STYLE 101 + Personally, I always put my post/pre exit functions right after create and + before the reset() or init() functions. This makes them easy to find. + Since they're MENTIONED in the create() I like to keep 'em close at hand. + For the same reason I usually follow my init() with any add_actions that + I've created. I also preface my functions with an indicator saying what + their purpose is. I've chosen aa_ for add_actions an pe_ for pre or post + exit functions. OR i use pre_ or post_ when i have both going on. This + may not seem like a big deal in a little file, but when the file gets + huge, it helps to glance at a function and go: ah ha! this is a post_exit + function. or ah ha! this is an add_action or similarly: ah ha! this is + not any specialized function so I must be calling it for some other reason. + The order you write them in is a personal decision. Just keep your + create() function first on the list. + */ + + //A return 0 in a pre-exit will prevent you from going that dir. + //A return 1 will allow you to go that dir. + + + int pre_north() + { + if( !this_player()->GetProperty("rung_bell") ) + { + write("Ring the doorbell first!\n"); + return 0; + } + // Now that the pre_north() function has done what it needs to do, we + // will call the post_north() function here + post_north(); + return 1; + } + + + int post_north() + { + //might as well delete it, it's served its purpose. + this_player()->RemoveProperty("rung_bell"); + return 1; + } + + + //We're going to delete the exit AFTER the player walks through + // Because doing it in a pre_exit would be tatamount to slamming + // a door in their face. You wouldn't want to do that... would you? :P + + + int post_south() + { + write("You hear a noise and realize the wall has mysteriously closed.\n"); + say("You hear a noise and realize the wall has mysteriously closed.\n"); + this_player()->eventMoveLiving("/domains/examples/room/exroom3", "south", this_player()->GetName()+" enters."); + RemoveExit("south"); + SetObviousExits("n"); + } diff -c -r --new-file ds1.1/lib/domains/examples/room/exroom5.c ds2.0r27/lib/domains/examples/room/exroom5.c *** ds1.1/lib/domains/examples/room/exroom5.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/examples/room/exroom5.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,139 ---- + #include <lib.h> + #include "ex.h" + + //LOOKIE! A constant (#define) at the top of the file instead + // of in a header (.h) file. Yes, this is possible and sometimes + // a better method. This is the only room in the entire directory + // which uses this define. It doesn't really need to go into + // the ex.h file. However, it must be at the top of the file. + + #define ORC "/domains/town/npc/orc" + + inherit LIB_ROOM; + + void create() + { + ::create(); + SetAmbientLight(30); + SetShort( "temp vars" ); + SetLong(@EndText + You can't really see north and there's a bell + on the south door. Don't ring it too many times! + ------------------------------------------------------------- + This is an example room for querying the specific value of a + stored variable. Remember though, variables are persistent. + If you want to prevent a future bug report from your players + or creators, then make sure you remove the variable when they + leave. Otherwise, when the come back in a week and ring the + bell only once, it would actually be added to their previous + rings. + ------------------------------------------------------------- + EndText + ); + + SetProperty( "no peer", 1); + + SetExits( ([ + "north" : EXPATH + "exroom6", + "south" : EXPATH + "exroom4", + ])); + } + + void init() + { + ::init(); + add_action("aa_ring","ring"); + } + + /* Since we don't need the temp var now, we will remove it. + In the CanRelease() function, I am telling the room that + when an object tries to leave, to remove the temp var + and return 1; to say that it is okay to leave. Were + I to put return 0; then the player would not be able + to leave. + */ + + int CanRelease() + { + this_player()->RemoveProperty("rung_bell"); + return 1; + } + + mixed aa_ring(string str) + { + int numrings; + if (str!="bell" && str!="doorbell" && str!="door bell") + return notify_fail("Ring what?\n"); + /* if "rung_bell" has not been set in the player, a query() for it + will return UNDEFINED. you CAN add 1 to an undefined to get 1. + + they just rang it one more time, so we'll take what was there and + add one. Then we'll put the new value back into the temp var + **see note at bottom of file. + */ + numrings=this_player()->GetProperty("rung_bell")+1; + this_player()->SetProperty("rung_bell",numrings); + write("DONG!\nYou ring a doorbell! Don't do it too many times!\n"); + say("DONG! A doorbell rings.\n"); + + if ( numrings>5 ) + { + if (!present("orc",this_object())) //nested if. see NOTE 2. + { + write("Now you've done it! An orc walks in a bonks you on the head.\n"); + say("Now " + this_player()->GetName() + " has done it! An orc walks in a bonks " + + objective(this_player()) + " on the head.\n"); + clone_object(ORC)->eventMove(this_object()); //this_object IS -this- room! + } + } + return 1; + } + + /* NOTE! + There are many ways to do the same thing with code. Some ways + are more readable. Some are less. Some are more efficient. + Some ways are very readable and only slightly less efficient. + I urge you to start out writing code that is readable AND correct, + rather then try to squeeze things down to one line of code. The + goal is to learn -- to understand what you're doing. If you + attempt to copy code that is all squeezed down into one line, and + you really don't understand it, then you'll be forever just copying + code and not really "getting it". + + That said. + in the add_action i did the following: + + int numrings; + numrings=this_player()->GetProperty("rung_bell")+1; + this_player()->SetProperty("rung_bell",numrings); + if ( numrings>5 ) + etc... + + I COULD have eliminated the variable numrings : + + this_player()->SetProperty("rung_bell", + this_player()->GetProperty("rung_bell") + 1); + if (this_player()->GetProperty("rung_bell") > 5) + etc... + + But, read both sets of code and determine for yourself which is easier + to read; easier to figure out on reading. You see, other people will + be reading your code. Other people will be debugging your code at + a later date. You may decide to never log on again and your project + is in a domain. The people in that domain will be fixing bugs & typos + & runtimes and you gotta bet that they will appreciate READABLE code... + as well as good comments. Never be afraid of comments! + + + NOTE 2! The nested if. Could also have been written: + if ( numrings>5 && ! present("orc",this_object())) + { + write("Now you've done it! An ord walks in a bonks you on the head.\n"); + say("Now " + this_player->GetName() + " has done it! An orc walks in a bonks " + + objective(this_player()) " + " on the head.\n"); + clone_object(ORC)->eventMove(this_object()); //this_object IS -this- room! + } + But, if you are having problems with the booleans && || and the code + is pretty clean & simple already, you might want to go the route + of nesting your if statements until you get the hang of && and ||. + */ diff -c -r --new-file ds1.1/lib/domains/examples/room/exroom6.c ds2.0r27/lib/domains/examples/room/exroom6.c *** ds1.1/lib/domains/examples/room/exroom6.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/examples/room/exroom6.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,61 ---- + #include <lib.h> + #include "ex.h" + + #define SPIDER "/domains/town/npc/spider" + + inherit LIB_ROOM; + + int pre_north(); + + void create() + { + ::create(); + SetAmbientLight(30); + SetShort( "a room with a blocked exit" ); + SetLong(@EndText + There's not much here. Of course, we don't talk about + the spider in the long, cause it COULD be dead. + EndText + ); + SetExits( ([ + "south" : "/domains/examples/room/exroom5", + ]) ); + + AddExit("north", EXPATH + "exroom7", (: pre_north :)); + + SetInventory( ([ + SPIDER : 1, + ])); + } + + void init() + { + ::init(); + } + + /* In the pre_north() function, I am going to add a special treat! + If a creator is invisible, you can bypass the spider completely! + Woo! Woo! + */ + + int pre_north(string dir) + { + if( this_player()->GetInvis(1)) + return 1; + /* If the spider is present, the player can not go that way. We + are also checking to see if the spider is still alive since + we don't want a corpse to click menacingly. :) + If I were to only put if(present("spider")), then the dead + corpse would block the path and click menacingly. + By putting the if(living(present("spider", this_object()))) + we accomplish two checks on one line. Simple and elegant.*/ + if(present("spider", this_object()) && living(present("spider",this_object())) ) + { + write("The spider blocks your exit and clicks menacingly!\n"); + say("The spider blocks " + possessive_noun(this_player()->GetName()) + " exit and clicks menacingly!\n"); + return 0; + } + //if we get to here, the spider is not present, so we treat as a + //normal exit. ie: do nothing. return 1 allows the exit, if you remember. + return 1; + } diff -c -r --new-file ds1.1/lib/domains/examples/room/exroom7.c ds2.0r27/lib/domains/examples/room/exroom7.c *** ds1.1/lib/domains/examples/room/exroom7.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/examples/room/exroom7.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,93 ---- + #include <lib.h> + #include "ex.h" + + inherit LIB_ROOM; + + int once; + int is_pulled(); + + void create() + { + ::create(); + SetAmbientLight(30); + SetShort( "two verbs for one action" ); + SetLong(@EndText + This room demonstrates how you can use two verbs to do + one thing. + There's a chain here. You can pull it or yank it. + + Note: See how we change the description of the chain? + It's important to remove 'quest hints' once a + quest has been done. And then put them back in + when the quest is ready to do. + EndText + ); + + // Here is another functional to point to the is_pulled() + // function. This is a very useful tool. + + SetItems( ([ + "chain" : (: is_pulled :), + ])); + + SetExits( ([ + "south" : EXPATH + "exroom6", + ])); + } + + /* Here you'll see that we have two add_actions. We have 'pull' and + 'yank'. If the player uses either verb when pulling the chain + the aa_chain() function is called. + */ + + void init() + { + ::init(); + add_action("aa_chain","pull"); + add_action("aa_chain","yank"); + } + + /* This is the first reset() function that we've seen so I'd like + to take a moment to explain it. The reset() function allows + an object to do self-maintenance. After every reset interval + (whose exact length is determined on a mud by mud basis, but + averages around every 2 hours), reset() is called in every + object that currently exists. Here, we use the reset() + function to return the variable 'once' back to 0 to allow the + chain to be pulled again after reset occurs. + */ + + void reset() + { + ::reset(); + once=0; + } + + /* query_verb() tells you what the player typed */ + mixed aa_chain (string str) + { + string averb=query_verb(); + if (str!="chain") + return notify_fail(capitalize(averb)+ " what?\n"); + if (once) + return notify_fail("The chain has already been " + + averb + "ed.\n"); + + // We're returning the averb variable that was defined and set + // above in a message to the player and the room. Then, we + // set the 'once' variable to show that the chain has been pulled. + write("You " + averb + " the chain!\n"); + say(this_player()->GetName() + " "+ averb + "s the chain!\n"); + once=1; + return 1; + } + + // This is the functional that was called to show the current state + // of the chain. Pulled or not pulled. + string is_pulled() + { + if( once ) + return "You see a plain chain.\n"; + else + return "Here's a chain begging to be yanked or pulled.\n"; + } diff -c -r --new-file ds1.1/lib/domains/examples/room/start.c ds2.0r27/lib/domains/examples/room/start.c *** ds1.1/lib/domains/examples/room/start.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/examples/room/start.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + #include <rooms.h> + #include "ex.h" + + inherit LIB_ROOM; + + + void create() { + room::create(); + SetAmbientLight(30); + SetShort("a blank room"); + SetLong("A featureless area. The example rooms are north."); + + SetExits( ([ + "north" : EXPATH + "entrance" + ]) ); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/badge.c ds2.0r27/lib/domains/town/armor/badge.c *** ds1.1/lib/domains/town/armor/badge.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/badge.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,43 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("visitor pass"); + SetId(({"testchar badge","badge","pass","visitor pass"})); + SetShort("a test character Visitor's Pass"); + SetLong("This clip-on plastic badge grants the wearer access to "+ + "some areas typically restricted to creator staff only. Abuse of this "+ + "pass is grounds for disciplinary action. A small scribble "+ + "at the bottom of the pass reads: click heels"); + SetMass(10); + SetBaseCost("silver",5000); + SetDamagePoints(100); + SetArmorType(A_AMULET); + SetRestrictLimbs( ({"torso"}) ); + SetRetainOnDeath(1); + } + void init(){ + ::init(); + add_action("nplh","click"); + } + int nplh(string str){ + if(str=="heels"){ + if(present(this_object()->GetKeyName(),this_player() ) ){ + write("There's no place like home!\n"+ + "You are transported by an awesome whirlwind somewhere "+ + "else...\n"); + this_player()->eventMoveLiving("/domains/town/room/road"); + return 1; + } + write("You click your heels together...but feel "+ + "as though you're missing something.\n"); + return 1; + } + } + string GetAffectLong(object ob) { + if(!ob || !living(ob)) return 0; + return ob->GetName() + " is an authorized Test Character."; + } diff -c -r --new-file ds1.1/lib/domains/town/armor/bdu.c ds2.0r27/lib/domains/town/armor/bdu.c *** ds1.1/lib/domains/town/armor/bdu.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/bdu.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("battle dress uniform"); + SetId(({"uniform","bdu","bdu's","fatigues"})); + SetAdjectives(({"camouflage","battle","dress","combat"})); + SetShort("a battle dress uniform"); + SetLong("This uniform consists of a camouflage blouse and "+ + "pants. It is green with mottled brown and black camouflage patterns, "+ + "and probably provides excellent concealment in a wooded environment."); + SetMass(10); + SetBaseCost("silver",100); + SetDamagePoints(100); + SetArmorType(A_BODY_ARMOR); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/bearskin.c ds2.0r27/lib/domains/town/armor/bearskin.c *** ds1.1/lib/domains/town/armor/bearskin.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/bearskin.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,31 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("bearskin"); + SetId(({"bearskin","bear skin"})); + SetAdjectives(({"thick","shaggy"})); + SetShort("a thick, shaggy bearskin"); + SetLong("This is a thick bearskin which can be worn "+ + "as armor. Unfortunately the hide "+ + "has not been tanned, so it's rather "+ + "foul-smelling."); + SetItems( ([ + "hide" : "It is untanned and subject "+ + "to natural decomposition." + ]) ); + SetSmell( ([ "default" : "It reeks of death." ]) ); + SetMass(75); + SetBaseCost("silver",10); + SetDamagePoints(100); + SetProtection(BLUNT,1); + SetProtection(BLADE,10); + SetProtection(KNIFE,10); + SetArmorType(A_CLOAK); + } + string GetAffectLong(object ob) { + if(!ob || !living(ob)) return 0; + return ob->GetName() + " reeks of death and decay."; + } diff -c -r --new-file ds1.1/lib/domains/town/armor/bearsuit.c ds2.0r27/lib/domains/town/armor/bearsuit.c *** ds1.1/lib/domains/town/armor/bearsuit.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/bearsuit.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,29 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("bearsuit"); + SetId(({"costume","bear costume","suit","bear suit"})); + SetAdjectives(({"realistic","terrific"})); + SetShort("a bear costume"); + SetLong("A terrific and very realistic suit which makes "+ + "the wearer look like a bear. It seems to have "+ + "been fashioned from real bear parts."); + SetMass(500); + SetBaseCost("silver",1000); + SetDamagePoints(10); + SetProtection(BLUNT,10); + SetProtection(BLADE,20); + SetProtection(KNIFE,20); + SetArmorType(A_BODY_ARMOR); + } + string GetAffectLong(object ob) { + if(!GetWorn()) return 0; + return ob->GetName() + " looks just like a bear!"; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/belt.c ds2.0r27/lib/domains/town/armor/belt.c *** ds1.1/lib/domains/town/armor/belt.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/belt.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("belt"); + SetId(({"belt"})); + SetAdjectives(({"leather"})); + SetShort("a leather belt"); + SetLong("A belt made of leather."); + SetMass(5); + SetBaseCost("silver",10); + SetDamagePoints(1); + SetProtection(BLUNT,1); + SetProtection(BLADE,1); + SetProtection(KNIFE,1); + SetArmorType(A_BELT); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/boot.c ds2.0r27/lib/domains/town/armor/boot.c *** ds1.1/lib/domains/town/armor/boot.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/boot.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("leather boot"); + SetId(({"boot"})); + SetAdjectives(({"military","military-style","black","leather","combat"})); + SetShort("a black leather boot"); + SetLong("A military style combat boot, made of black leather."); + SetMass(60); + SetBaseCost("silver",25); + SetDamagePoints(5); + SetProtection(BLUNT,5); + SetProtection(BLADE,5); + SetProtection(KNIFE,5); + SetArmorType(A_BOOT); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/boot_l.c ds2.0r27/lib/domains/town/armor/boot_l.c *** ds1.1/lib/domains/town/armor/boot_l.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/boot_l.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,25 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("leather boot"); + SetId(({"boot","left boot"})); + SetAdjectives(({"military","military-style","black","leather","combat"})); + SetShort("a black leather boot"); + SetLong("A military style combat boot, made of black leather. It is "+ + "designed for wear on the left foot."); + SetMass(60); + SetBaseCost("silver",25); + SetDamagePoints(5); + SetProtection(BLUNT,5); + SetProtection(BLADE,5); + SetProtection(KNIFE,5); + SetArmorType(A_BOOT); + SetRestrictLimbs(({"left foot"})); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/boot_r.c ds2.0r27/lib/domains/town/armor/boot_r.c *** ds1.1/lib/domains/town/armor/boot_r.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/boot_r.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,25 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("leather boot"); + SetId(({"boot","right boot"})); + SetAdjectives(({"military","military-style","black","leather","combat"})); + SetShort("a black leather boot"); + SetLong("A military style combat boot, made of black leather. It is "+ + "designed for wear on the right foot."); + SetMass(60); + SetBaseCost("silver",25); + SetDamagePoints(5); + SetProtection(BLUNT,5); + SetProtection(BLADE,5); + SetProtection(KNIFE,5); + SetArmorType(A_BOOT); + SetRestrictLimbs(({"right foot"})); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/chainmail.c ds2.0r27/lib/domains/town/armor/chainmail.c *** ds1.1/lib/domains/town/armor/chainmail.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/chainmail.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("chainmail shirt"); + SetId(({"armor","chainmail","mail","shirt","chain mail"})); + SetAdjectives(({"chainmail","sturdy","sturdy-looking","chain mail"})); + SetShort("a sturdy-looking chainmail shirt"); + SetLong("This is a shirt made of small, thin metal rings fashioned together as armor. "); + SetMass(600); + SetBaseCost("silver",1000); + SetDamagePoints(100); + SetProtection(BLUNT,4); + SetProtection(BLADE,25); + SetProtection(KNIFE,25); + SetArmorType(A_ARMOR); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/collar.c ds2.0r27/lib/domains/town/armor/collar.c *** ds1.1/lib/domains/town/armor/collar.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/collar.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,29 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + inherit "/lib/std/bane"; + + static void create(){ + armor::create(); + bane::create(); + SetKeyName("collar"); + SetId(({"repellent_collar","bane"})); + SetAdjectives( ({"repellent","odd","plastic","white"}) ); + SetShort("a plastic collar"); + SetLong("This is a simple collar made of a soft white plastic. It "+ + "seems to be coated with a fine, clear resin. There is something "+ + "written on the collar."); + SetProperties(([ + "no steal" : 1, + ])); + SetRead("Disease and parasite repellent collar, test character use only."); + SetMass(10); + SetBaseCost("silver",5000); + SetDamagePoints(100); + SetArmorType(A_COLLAR); + SetBane(({"all"})); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/glove.c ds2.0r27/lib/domains/town/armor/glove.c *** ds1.1/lib/domains/town/armor/glove.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/glove.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,27 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ARMOR; + + static void create() { + armor::create(); + SetKeyName("leather glove"); + SetId( ({ "glove" }) ); + SetAdjectives( ({ "black","leather" }) ); + SetShort("a black leather glove"); + SetLong("A black glove with five fingers."); + SetDamagePoints(75); + SetVendorType(VT_ARMOR); + SetMass(10); + SetBaseCost("silver",7); + SetArmorType(A_GLOVE); + SetProtection(BLUNT, 1); + SetProtection(BLADE, 1); + SetProtection(KNIFE, 2); + SetProtection(HEAT, 3); + SetProtection(COLD, 7); + SetFingers(5); + SetRestrictLimbs(({"right hand","left hand"})); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/glove_l.c ds2.0r27/lib/domains/town/armor/glove_l.c *** ds1.1/lib/domains/town/armor/glove_l.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/glove_l.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,31 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ARMOR; + + + static void create() { + armor::create(); + SetKeyName("leather glove"); + SetId( ({ "glove" }) ); + SetAdjectives( ({ "black","leather","left" }) ); + SetShort("a black leather glove"); + SetLong("A black glove with five fingers designed for a left hand."); + SetDamagePoints(75); + SetVendorType(VT_ARMOR); + SetMass(10); + SetBaseCost("silver",7); + SetArmorType(A_GLOVE); + SetProtection(BLUNT, 1); + SetProtection(BLADE, 1); + SetProtection(KNIFE, 2); + SetProtection(HEAT, 3); + SetProtection(COLD, 7); + SetFingers(5); + SetRestrictLimbs(({"left hand"})); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/glove_r.c ds2.0r27/lib/domains/town/armor/glove_r.c *** ds1.1/lib/domains/town/armor/glove_r.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/glove_r.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,31 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ARMOR; + + + static void create() { + armor::create(); + SetKeyName("leather glove"); + SetId( ({ "glove" }) ); + SetAdjectives( ({ "black","leather","right" }) ); + SetShort("a black leather glove"); + SetLong("A black glove with five fingers designed for a right hand."); + SetDamagePoints(75); + SetVendorType(VT_ARMOR); + SetMass(10); + SetBaseCost("silver",7); + SetArmorType(A_GLOVE); + SetProtection(BLUNT, 1); + SetProtection(BLADE, 1); + SetProtection(KNIFE, 2); + SetProtection(HEAT, 3); + SetProtection(COLD, 7); + SetFingers(5); + SetRestrictLimbs(({"right hand"})); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/goggles.c ds2.0r27/lib/domains/town/armor/goggles.c *** ds1.1/lib/domains/town/armor/goggles.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/goggles.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,24 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("goggles"); + SetId(({"goggles"})); + SetAdjectives(({"thick","driving","protective","eyewear"})); + SetShort("driving goggles"); + SetLong("A set of protective goggles for wearing during "+ + "high-speed travel."); + SetMass(5); + SetBaseCost("silver",30); + SetDamagePoints(1); + SetProtection(BLUNT,1); + SetProtection(BLADE,1); + SetProtection(KNIFE,1); + SetArmorType(A_VISOR); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/helmet.c ds2.0r27/lib/domains/town/armor/helmet.c *** ds1.1/lib/domains/town/armor/helmet.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/helmet.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("steel helmet"); + SetId(({"helmet","cover","steel"})); + SetAdjectives(({"steel","battle","hard"})); + SetShort("a steel helmet"); + SetLong("This is a helmet made of tough metal."); + SetMass(180); + SetBaseCost("silver",500); + SetDamagePoints(100); + SetArmorType(A_HELMET); + SetProtection(BLUNT, 20); + SetProtection(BLADE, 20); + SetProtection(KNIFE, 20); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/helmet2.c ds2.0r27/lib/domains/town/armor/helmet2.c *** ds1.1/lib/domains/town/armor/helmet2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/helmet2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,21 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("kevlar helmet"); + SetId(({"helmet","cover","kevlar"})); + SetAdjectives(({"kevlar","battle","hard"})); + SetShort("a camouflaged kevlar helmet"); + SetLong("This is a military helmet made of a a very tough "+ + "polymer fiber that provides excellent ballistic protection. It bears a "+ + "mottled camouflage design to aid in woodland concealment."); + SetMass(50); + SetBaseCost("silver",500); + SetDamagePoints(100); + SetArmorType(A_HELMET); + SetProtection(BLUNT, 20); + SetProtection(BLADE, 20); + SetProtection(KNIFE, 20); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/hunting_cap.c ds2.0r27/lib/domains/town/armor/hunting_cap.c *** ds1.1/lib/domains/town/armor/hunting_cap.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/hunting_cap.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,27 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("hunting cap"); + SetId(({"hat","headgear","cap"})); + SetAdjectives(({"soft","felt","hunting"})); + SetShort("a hunting cap"); + SetLong("This is a soft, felt cap one wears when hunting. "+ + "It has a single feather jauntily stuck to the side."); + SetMass(10); + SetBaseCost("silver",50); + SetDamagePoints(1); + SetArmorType(A_HELMET); + SetProtection(BLUNT, 1); + SetProtection(BLADE, 1); + SetProtection(KNIFE, 1); + SetItems( ([ + ({"pheasant","feather"}) : "Looks like a pheasant feather.", + ]) ); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/jacket.c ds2.0r27/lib/domains/town/armor/jacket.c *** ds1.1/lib/domains/town/armor/jacket.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/jacket.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("leather jacket"); + SetId(({"jacket"})); + SetAdjectives(({"strong","leather","black","tough"})); + SetShort("a black leather jacket"); + SetLong("This is a jacket made of strong, tough leather. "); + SetMass(150); + SetBaseCost("silver",100); + SetDamagePoints(10); + SetProtection(BLUNT,1); + SetProtection(BLADE,5); + SetProtection(KNIFE,5); + SetArmorType(A_ARMOR); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/jeans.c ds2.0r27/lib/domains/town/armor/jeans.c *** ds1.1/lib/domains/town/armor/jeans.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/jeans.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("blue jeans"); + SetId(({"jeans","pants","blue jeans","bluejeans","denim"})); + SetAdjectives(({"blue","denim","comfortable","broken in","broken-in"})); + SetShort("a pair of blue jeans"); + SetLong("A comfortable pair of denim blue jeans."); + SetMass(5); + SetBaseCost("silver",1); + SetDamagePoints(1); + SetProtection(BLUNT,1); + SetProtection(BLADE,1); + SetProtection(KNIFE,1); + SetArmorType(A_PANTS); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/leather_armor.c ds2.0r27/lib/domains/town/armor/leather_armor.c *** ds1.1/lib/domains/town/armor/leather_armor.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/leather_armor.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,34 ---- + /* /domains/Ylsrim/armor/artrell_armor.c + * from the Dead Souls V Object Library + * created by Descartes of Borg 960302 + */ + + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ARMOR; + + static void create() { + armor::create(); + SetKeyName("leather armor"); + SetId( ({ "armor", "leather armor" }) ); + SetAdjectives( ({ "leather" }) ); + SetShort("a suit of leather armor"); + SetLong("An ordinary suit of leather armor. It is worn on one's arms, torso and legs."); + SetVendorType(VT_ARMOR); + SetMass(750); + SetValue(150); + SetDamagePoints(800); + SetProtection(BLUNT, 20); + SetProtection(BLADE, 20); + SetProtection(KNIFE, 25); + SetProtection(HEAT, 7); + SetProtection(COLD, 4); + SetProtection(SHOCK, 15); + SetArmorType(A_BODY_ARMOR); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/long_boot_l.c ds2.0r27/lib/domains/town/armor/long_boot_l.c *** ds1.1/lib/domains/town/armor/long_boot_l.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/long_boot_l.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,25 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("riding boot"); + SetId(({"boot"})); + SetAdjectives(({"long","riding","black","leather","left"})); + SetShort("a long riding boot"); + SetLong("A long riding boot, made of black leather. It is "+ + "designed for wear on the left foot and leg."); + SetMass(60); + SetBaseCost("silver",75); + SetDamagePoints(5); + SetProtection(BLUNT,5); + SetProtection(BLADE,5); + SetProtection(KNIFE,5); + SetArmorType(A_LONG_BOOT); + SetRestrictLimbs(({"left foot","left leg"})); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/long_boot_r.c ds2.0r27/lib/domains/town/armor/long_boot_r.c *** ds1.1/lib/domains/town/armor/long_boot_r.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/long_boot_r.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,25 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("riding boot"); + SetId(({"boot"})); + SetAdjectives(({"long","riding","black","leather","right"})); + SetShort("a long riding boot"); + SetLong("A long riding boot, made of black leather. It is "+ + "designed for wear on the right foot and leg."); + SetMass(60); + SetBaseCost("silver",75); + SetDamagePoints(5); + SetProtection(BLUNT,5); + SetProtection(BLADE,5); + SetProtection(KNIFE,5); + SetArmorType(A_LONG_BOOT); + SetRestrictLimbs(({"right foot","right leg"})); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/long_glove.c ds2.0r27/lib/domains/town/armor/long_glove.c *** ds1.1/lib/domains/town/armor/long_glove.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/long_glove.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,26 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ARMOR; + + static void create() { + armor::create(); + SetKeyName("leather glove"); + SetId( ({ "glove" }) ); + SetAdjectives( ({ "black","leather" }) ); + SetShort("a long black leather glove"); + SetLong("A long black glove with five fingers."); + SetDamagePoints(75); + SetVendorType(VT_ARMOR); + SetMass(10); + SetBaseCost("silver",25); + SetArmorType(A_LONG_GLOVE); + SetProtection(BLUNT, 1); + SetProtection(BLADE, 1); + SetProtection(KNIFE, 2); + SetProtection(HEAT, 3); + SetProtection(COLD, 7); + SetFingers(5); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/long_sock.c ds2.0r27/lib/domains/town/armor/long_sock.c *** ds1.1/lib/domains/town/armor/long_sock.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/long_sock.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("sock"); + SetId(({"sock"})); + SetAdjectives(({"black","nylon","knee-length","knee","knee length"})); + SetShort("a long black nylon sock"); + SetLong("A long, knee-length sock, made of black nylon."); + SetMass(5); + SetBaseCost("silver",1); + SetDamagePoints(1); + SetProtection(BLUNT,1); + SetProtection(BLADE,1); + SetProtection(KNIFE,1); + SetArmorType(A_LONG_SOCK); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/magical_platemail.c ds2.0r27/lib/domains/town/armor/magical_platemail.c *** ds1.1/lib/domains/town/armor/magical_platemail.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/magical_platemail.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("suit of armor"); + SetId(({"armor","plate mail","platemail","suit","armor","suit of armor"})); + SetAdjectives(({"full","plate","plated","metal"})); + SetShort("a full suit of armor"); + SetLong("This is a large, very heavy suit of armor, the kind "+ + "one might expect a knight to wear. The thick "+ + "metal plating promises extraordinary protection, "+ + "yet the joints are so finely articulated as to "+ + "permit great freedom of movement."); + SetMass(500); + SetBaseCost("silver",10000); + SetDamagePoints(100); + SetProtection(BLUNT,200); + SetProtection(BLADE,500); + SetProtection(KNIFE,500); + SetArmorType(A_BODY_ARMOR); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/mhelmet.c ds2.0r27/lib/domains/town/armor/mhelmet.c *** ds1.1/lib/domains/town/armor/mhelmet.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/mhelmet.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("motorcycle helmet"); + SetId(({"helmet","cover","motorcycle"})); + SetAdjectives(({"motorcycle","battle","hard"})); + SetShort("a black motorcycle helmet"); + SetLong("This is a helmet made of tough composite materials."); + SetMass(120); + SetBaseCost("silver",200); + SetDamagePoints(100); + SetArmorType(A_HELMET); + SetProtection(BLUNT, 20); + SetProtection(BLADE, 20); + SetProtection(KNIFE, 20); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/newbie_ring.c ds2.0r27/lib/domains/town/armor/newbie_ring.c *** ds1.1/lib/domains/town/armor/newbie_ring.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/newbie_ring.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("gold_ring"); + SetId(({"ring","gold ring"})); + SetAdjectives( ({"beautiful"}) ); + SetShort("a beautiful gold ring"); + SetLong("This is a simple but beautiful ring made of "+ + "gold, suitable for wearing on one's finger."); + SetMass(1); + SetBaseCost("silver",500); + SetDamagePoints(100); + SetArmorType(A_RING); + } + void init(){ + } diff -c -r --new-file ds1.1/lib/domains/town/armor/oldstyle_ring.c ds2.0r27/lib/domains/town/armor/oldstyle_ring.c *** ds1.1/lib/domains/town/armor/oldstyle_ring.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/oldstyle_ring.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,16 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("metal ring"); + SetId(({"ring"})); + SetAdjectives( ({"simple","metal"}) ); + SetShort("a simple ring"); + SetLong("This is a simple metal ring."); + SetMass(1); + SetValue(1000); + SetDamagePoints(100); + SetArmorType(A_RING); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/orc_boot_l.c ds2.0r27/lib/domains/town/armor/orc_boot_l.c *** ds1.1/lib/domains/town/armor/orc_boot_l.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/orc_boot_l.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("leather boot"); + SetAdjectives( ({"leather", "simple", "orc", "orcish", "inelegant", "protective"}) ); + SetId(({"boot","left boot"})); + SetShort("a leather boot"); + SetLong("A leather boot of orcish design. Simple and inelegant, but quite protective. It is designed for the left foot."); + SetMass(60); + SetBaseCost("silver", 30); + SetProtection(BLUNT,5); + SetProtection(BLADE,5); + SetProtection(KNIFE,5); + SetArmorType(A_BOOT); + SetRestrictLimbs(({"left foot"})); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/orc_boot_r.c ds2.0r27/lib/domains/town/armor/orc_boot_r.c *** ds1.1/lib/domains/town/armor/orc_boot_r.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/orc_boot_r.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("leather boot"); + SetAdjectives( ({"leather", "simple", "orc", "orcish", "inelegant", "protective"}) ); + SetId(({"boot","right boot"})); + SetShort("a leather boot"); + SetLong("A leather boot of orcish design. Simple and inelegant, but quite protective. It is designed for the right foot."); + SetMass(60); + SetBaseCost("silver", 30); + SetProtection(BLUNT,5); + SetProtection(BLADE,5); + SetProtection(KNIFE,5); + SetArmorType(A_BOOT); + SetRestrictLimbs(({"right foot"})); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/orc_helmet.c ds2.0r27/lib/domains/town/armor/orc_helmet.c *** ds1.1/lib/domains/town/armor/orc_helmet.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/orc_helmet.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,36 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + int CheckOrc(); + static void create(){ + armor::create(); + SetKeyName("orc helmet"); + SetId(({"helmet"})); + SetAdjectives(({"bear","bone","skull","orc"})); + SetShort("a bear skull helmet"); + SetLong("This is a helmet made of the hard bone of a bear, "+ + "treated with some sort of thick resin to "+ + "prevent shattering."); + SetMass(180); + SetBaseCost("silver",100); + SetDamagePoints(100); + SetArmorType(A_HELMET); + SetProtection(BLUNT, 20); + SetProtection(BLADE, 20); + SetProtection(KNIFE, 20); + SetWear( (: CheckOrc :) ); + } + + int CheckOrc() { + if( (string)this_player()->GetRace() == "orc" ) { + write("You can almost feel the power of the bear as you wear its skull."); + say((string)this_player()->GetName() + " wears a bear skull helmet."); + return 1; + } + else { + write("The helmet appears designed for orc anatomy. It does not fit you."); + return 1; + } + } diff -c -r --new-file ds1.1/lib/domains/town/armor/overcoat.c ds2.0r27/lib/domains/town/armor/overcoat.c *** ds1.1/lib/domains/town/armor/overcoat.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/overcoat.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,24 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("overcoat"); + SetId(({"coat","overcoat"})); + SetAdjectives(({"heavy","woolen"})); + SetShort("a heavy woolen overcoat"); + SetLong("This is a large overcoat, of fine craftsmanship. It's "+ + "likely excellent protection against the cold."); + SetMass(300); + SetBaseCost("silver",300); + SetDamagePoints(10); + SetProtection(BLUNT,10); + SetProtection(BLADE,10); + SetProtection(KNIFE,10); + SetArmorType(A_CLOAK); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/pants.c ds2.0r27/lib/domains/town/armor/pants.c *** ds1.1/lib/domains/town/armor/pants.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/pants.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("leather pants"); + SetId(({"pants"})); + SetAdjectives(({"strong","leather","black","tough"})); + SetShort("leather pants"); + SetLong("These are trousers made of strong, tough leather. "); + SetMass(150); + SetBaseCost("silver",110); + SetDamagePoints(10); + SetProtection(BLUNT,1); + SetProtection(BLADE,5); + SetProtection(KNIFE,5); + SetArmorType(A_PANTS); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/platemail.c ds2.0r27/lib/domains/town/armor/platemail.c *** ds1.1/lib/domains/town/armor/platemail.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/platemail.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("suit of armor"); + SetId(({"armor","plate mail","platemail","suit","armor","suit of armor"})); + SetAdjectives(({"full","plate","plated","metal"})); + SetShort("a full suit of armor"); + SetLong("This is a large, very heavy suit of armor, the kind "+ + "one might expect a knight to wear. The thick "+ + "metal plating promises extraordinary protection, "+ + "yet the joints are so finely articulated as to "+ + "permit great freedom of movement."); + SetMass(2500); + SetBaseCost("silver",10000); + SetDamagePoints(100); + SetProtection(BLUNT,20); + SetProtection(BLADE,50); + SetProtection(KNIFE,50); + SetArmorType(A_BODY_ARMOR); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/riding_boot.c ds2.0r27/lib/domains/town/armor/riding_boot.c *** ds1.1/lib/domains/town/armor/riding_boot.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/riding_boot.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("riding boot"); + SetId(({"boot"})); + SetAdjectives(({"long","riding","black","leather"})); + SetShort("a long riding boot"); + SetLong("A long riding boot, made of black leather."); + SetMass(60); + SetBaseCost("silver",75); + SetDamagePoints(5); + SetProtection(BLUNT,5); + SetProtection(BLADE,5); + SetProtection(KNIFE,5); + SetArmorType(A_BOOT); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/ring.c ds2.0r27/lib/domains/town/armor/ring.c *** ds1.1/lib/domains/town/armor/ring.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/ring.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,17 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("gold_ring"); + SetId(({"ring","gold ring"})); + SetAdjectives( ({"beautiful"}) ); + SetShort("a beautiful gold ring"); + SetLong("This is a simple but beautiful ring made of "+ + "gold, suitable for wearing on one's finger."); + SetMass(1); + SetBaseCost("silver",5000); + SetDamagePoints(100); + SetArmorType(A_RING); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/robe.c ds2.0r27/lib/domains/town/armor/robe.c *** ds1.1/lib/domains/town/armor/robe.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/robe.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("wizard's robe"); + SetId(({"robe","cloak","duster"})); + SetAdjectives(({"wizard","wizard's","soft"})); + SetShort("a robe"); + SetLong("This is a large, comfortable-looking robe, like a wizard might wear. "); + SetMass(200); + SetBaseCost("silver",100); + SetDamagePoints(100); + SetProtection(BLUNT,100); + SetProtection(BLADE,100); + SetProtection(KNIFE,100); + SetArmorType(A_CLOAK); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/scarf.c ds2.0r27/lib/domains/town/armor/scarf.c *** ds1.1/lib/domains/town/armor/scarf.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/scarf.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,22 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + + static void create(){ + armor::create(); + SetKeyName("scarf"); + SetId(({"scarf"})); + SetAdjectives( ({"handsome","tartan"}) ); + SetShort("a handsome tartan scarf"); + SetLong("This a handsome scarf, very comfortable and "+ + "probably expensive as well."); + SetMass(10); + SetBaseCost("silver",50); + SetDamagePoints(1); + SetArmorType(A_COLLAR); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/shield.c ds2.0r27/lib/domains/town/armor/shield.c *** ds1.1/lib/domains/town/armor/shield.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/shield.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,25 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ARMOR; + + static void create() { + armor::create(); + SetKeyName("large shield"); + SetId( ({ "shield" }) ); + SetAdjectives( ({ "wood", "wooden","large" }) ); + SetShort("a large wooden shield"); + SetLong("A large, heavy shield made of strong wood banded with iron."); + SetDamagePoints(75); + SetVendorType(VT_ARMOR); + SetMass(200); + SetBaseCost("silver",150); + SetArmorType(A_SHIELD); + SetProtection(BLUNT, 10); + SetProtection(BLADE, 10); + SetProtection(KNIFE, 10); + //SetRestrictLimbs( ({"left hand"}) ); + } + diff -c -r --new-file ds1.1/lib/domains/town/armor/shirt.c ds2.0r27/lib/domains/town/armor/shirt.c *** ds1.1/lib/domains/town/armor/shirt.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/shirt.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("a white t-shirt"); + SetId(({"shirt","tshirt","t-shirt","t shirt"})); + SetAdjectives(({"white"})); + SetShort("a white t-shirt"); + SetLong("An ordinary white t-shirt."); + SetMass(5); + SetBaseCost("silver",1); + SetDamagePoints(1); + SetProtection(BLUNT,1); + SetProtection(BLADE,1); + SetProtection(KNIFE,1); + SetArmorType(A_SHIRT); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/silverring.c ds2.0r27/lib/domains/town/armor/silverring.c *** ds1.1/lib/domains/town/armor/silverring.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/silverring.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,26 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("silver_ring"); + SetId(({"ring","silver ring"})); + SetAdjectives( ({"beautiful"}) ); + SetShort("a beautiful silver ring"); + SetLong("This is a simple but beautiful ring made of "+ + "silver, suitable for wearing on one's finger. The ring bears an inscription."); + SetMass(1); + SetBaseCost("silver",5000); + SetDamagePoints(100); + SetArmorType(A_RING); + SetItems(([ + ({"script","words","inscription","writing"}) : "Words engraved on the ring in a highly "+ + "stylized script." + ]) ); + SetRead(({"script","words","inscription","writing"}), "\"etaoin shrdlu\"" ); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/sock.c ds2.0r27/lib/domains/town/armor/sock.c *** ds1.1/lib/domains/town/armor/sock.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/sock.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("sock"); + SetId(({"sock"})); + SetAdjectives(({"white","cotton","athletic"})); + SetShort("a white cotton sock"); + SetLong("An athletic sock, made of white cotton."); + SetMass(5); + SetBaseCost("silver",1); + SetDamagePoints(1); + SetProtection(BLUNT,1); + SetProtection(BLADE,1); + SetProtection(KNIFE,1); + SetArmorType(A_SOCK); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/toga.c ds2.0r27/lib/domains/town/armor/toga.c *** ds1.1/lib/domains/town/armor/toga.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/toga.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("healer's toga"); + SetId(({"toga"})); + SetAdjectives(({"long","white","comfotable"})); + SetShort("a long, white toga"); + SetLong("This is a comfortable, full-length toga. It is the sort of " + "elegant garment that ancient politicians and healers once wore."); + SetMass(75); + SetBaseCost("silver",100); + SetDamagePoints(100); + SetProtection(BLUNT,1); + SetProtection(BLADE,10); + SetProtection(KNIFE,10); + SetArmorType(A_CLOAK); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/towel.c ds2.0r27/lib/domains/town/armor/towel.c *** ds1.1/lib/domains/town/armor/towel.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/towel.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("damp towel"); + SetId(({"towel"})); + SetAdjectives(({"damp","bath","ordinary", "bathtowel"})); + SetShort("a damp towel"); + SetLong("This is an ordinary bath towel."); + SetMass(25); + SetBaseCost("silver",10); + SetDamagePoints(10); + SetProtection(BLUNT,1); + SetProtection(BLADE,1); + SetProtection(KNIFE,1); + SetArmorType(A_PANTS); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/tshirt.c ds2.0r27/lib/domains/town/armor/tshirt.c *** ds1.1/lib/domains/town/armor/tshirt.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/tshirt.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,24 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("a Def Leppard shirt"); + SetId(({"shirt","def leppard shirt"})); + SetAdjectives(({"Def Leppard", "def leppard", "stupid", "black"})); + SetShort("a Def Leppard shirt"); + SetLong("A stupid-looking black shirt with a ridiculous band logo on it."); + SetMass(5); + SetBaseCost("silver",1); + SetDamagePoints(1); + SetProtection(BLUNT,1); + SetProtection(BLADE,1); + SetProtection(KNIFE,1); + SetArmorType(A_SHIRT); + //SetRestrictLimbs(({"torso"})); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/vest.c ds2.0r27/lib/domains/town/armor/vest.c *** ds1.1/lib/domains/town/armor/vest.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/vest.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("paisley vest"); + SetId(({"vest"})); + SetAdjectives(({"goofy","goofy-looking", "goofy looking", "paisley","colorful","hippie","hippy","psychedelic"})); + SetShort("a colorful paisley vest"); + SetLong("A goofy-looking hippie vest with psychedelic paisley patterns on it."); + SetMass(5); + SetBaseCost("silver",1); + SetDamagePoints(1); + SetProtection(BLUNT,1); + SetProtection(BLADE,1); + SetProtection(KNIFE,1); + SetArmorType(A_VEST); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/visor.c ds2.0r27/lib/domains/town/armor/visor.c *** ds1.1/lib/domains/town/armor/visor.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/visor.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("goggles"); + SetId(({"goggles"})); + SetAdjectives(({"clear","plastic","protective","lab","laboratory"})); + SetShort("clear plastic goggles"); + SetLong("A set of protective laboratory goggles."); + SetMass(5); + SetBaseCost("silver",9); + SetDamagePoints(1); + SetProtection(BLUNT,1); + SetProtection(BLADE,1); + SetProtection(KNIFE,1); + SetArmorType(A_VISOR); + } diff -c -r --new-file ds1.1/lib/domains/town/armor/wizard_hat.c ds2.0r27/lib/domains/town/armor/wizard_hat.c *** ds1.1/lib/domains/town/armor/wizard_hat.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/armor/wizard_hat.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,21 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("wizard hat"); + SetId(({"hat","headgear"})); + SetAdjectives(({"wizard","wizard's"})); + SetShort("a wizard's hat"); + SetLong("This is a large, floppy hat with a wide brim all "+ + "around it, and a conical center. It is dark blue in color, "+ + "and is decorated with pictures of yellow moons and stars."); + SetMass(50); + SetBaseCost("silver",500); + SetDamagePoints(100); + SetArmorType(A_HELMET); + SetProtection(BLUNT, 20); + SetProtection(BLADE, 20); + SetProtection(KNIFE, 20); + } diff -c -r --new-file ds1.1/lib/domains/town/doors/mansion.c ds2.0r27/lib/domains/town/doors/mansion.c *** ds1.1/lib/domains/town/doors/mansion.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/doors/mansion.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,25 ---- + #include <lib.h> + + inherit LIB_DOOR; + + static void create() { + door::create(); + + SetSide("north", (["id" : ({ "door", "handsome wooden door", "wooden door" }), + "short" : "a door leading north", + "long" : "This is a plain wooden door.", + "lockable" : 1 ]) ); + SetKeys("north", ({ "mansion key" })); + + SetSide("south", (["id" : ({ "door leading into the mansion", "handsome wooden door", "wooden door", "door" }), + "short" : "a door leading south", + "long" : "This is a handsome wooden door.", + "lockable" : 1 ]) ); + SetKeys("south", ({ "mansion key" })); + + SetClosed(1); + SetLocked(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/doors/south.c ds2.0r27/lib/domains/town/doors/south.c *** ds1.1/lib/domains/town/doors/south.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/doors/south.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,26 ---- + #include <lib.h> + + inherit LIB_DOOR; + + static void create() { + door::create(); + + SetSide("DIR_X", ([ "id" : ({"door leading DIR_X", "door", "DIR_X door"}), + "short" : "a door leading DIR_X", + "long" : "This is the Y_SIDE side of a door leading DIR_X.", + "lockable" : 1 ]) ); + + SetSide("DIR_Y", ([ "id" : ({"door leading DIR_Y", "door", "DIR_Y door"}), + "short" : "a door leading DIR_Y", + "long" : "This is the X_SIDE side of a door leading DIR_Y.", + "lockable" : 1 ]) ); + + SetClosed(1); + SetLocked(0); + SetKeys("DIR_X", ({ "DIR_X key" })); + SetKeys("DIR_Y", ({ "DIR_Y key" })); + } + + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/doors/steel_door.c ds2.0r27/lib/domains/town/doors/steel_door.c *** ds1.1/lib/domains/town/doors/steel_door.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/doors/steel_door.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,22 ---- + #include <lib.h> + + inherit LIB_DOOR; + + static void create() { + door::create(); + + SetSide("east", (["id" : ({ "door", "east door" }), + "short" : "a steel door leading east", + "long" : "This is an imposing, large steel door leading east into the arena.", + "lockable" : 0 ]) ); + SetSide("west", (["id" : ({ "west door", "door" }), + "short" : "a steel door leading west", + "long" : "This is an imposing, large steel door leading west, out of the arena.", + "lockable" : 0 ]) ); + + SetClosed(0); + SetLocked(0); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/doors/testdoor2.c ds2.0r27/lib/domains/town/doors/testdoor2.c *** ds1.1/lib/domains/town/doors/testdoor2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/doors/testdoor2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,25 ---- + #include <lib.h> + + inherit LIB_DOOR; + + static void create() { + door::create(); + + SetSide("east", (["id" : ({ "door leading east", "door", "east door" }), + "short" : "a door leading east", + "long" : "This is the west side of a door leading east.", + "lockable" : 1 ]) ); + SetKeys("east", ({ "east key" })); + + SetSide("west", (["id" : ({ "door leading west", "door", "west door" }), + "short" : "a door leading west", + "long" : "This is the east side of a door leading west.", + "lockable" : 1 ]) ); + SetKeys("west", ({ "west key" })); + + SetClosed(1); + SetLocked(0); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/doors/trapdoor.c ds2.0r27/lib/domains/town/doors/trapdoor.c *** ds1.1/lib/domains/town/doors/trapdoor.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/doors/trapdoor.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,22 ---- + #include <lib.h> + + inherit LIB_DOOR; + + static void create() { + door::create(); + + SetSide("down", (["id" : ({ "trapdoor on the floor", "trap door on the floor", "trap door", "trapdoor", "door" }), + "short" : "a trapdoor on the floor, leading downward", + "long" : "a trapdoor on the floor, leading downward.", + "lockable" : 0 ]) ); + SetSide("up", (["id" : ({ "trapdoor on the ceiling", "trap door on the ceiling", "trap door", "trapdoor", "door" }), + "short" : "a trapdoor in the ceiling, leading upward", + "long" : "a trapdoor in the ceiling, leading upward.", + "lockable" : 0 ]) ); + + SetClosed(1); + SetLocked(0); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/meals/ale.c ds2.0r27/lib/domains/town/meals/ale.c *** ds1.1/lib/domains/town/meals/ale.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/meals/ale.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,22 ---- + #include <lib.h> + #include <meal_types.h> + + inherit LIB_MEAL; + + + static void create() { + meal::create(); + SetKeyName("ale"); + SetId( ({ "bottle", "ale", "first class ale", "first-class ale" }) ); + SetShort("a bottle of ale"); + SetLong("A nice bottle of ale."); + SetMass(60); + SetMealType(MEAL_DRINK | MEAL_ALCOHOL); + SetStrength(5); + SetMealMessages("You drink a bottle of ale.", + "$N drinks a bottle of ale."); + SetBaseCost("silver",10); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/meals/bourbon.c ds2.0r27/lib/domains/town/meals/bourbon.c *** ds1.1/lib/domains/town/meals/bourbon.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/meals/bourbon.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + #include <meal_types.h> + + inherit LIB_MEAL; + + static void create() { + meal::create(); + SetKeyName("ale"); + SetId( ({ "bottle", "bourbon" }) ); + SetShort("a bottle of bourbon"); + SetLong("A dark green bottle of cheap bourbon."); + SetMass(100); + SetBaseCost("silver",25); + SetMealType(MEAL_DRINK | MEAL_ALCOHOL); + SetStrength(50); + SetMealMessages("You finish off the boubon and gasp! WHEW!! Mean stuff!", + "$N finishes off a bottle of bourbon and gasps."); + } diff -c -r --new-file ds1.1/lib/domains/town/meals/coffee.c ds2.0r27/lib/domains/town/meals/coffee.c *** ds1.1/lib/domains/town/meals/coffee.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/meals/coffee.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + #include <meal_types.h> + + inherit LIB_MEAL; + + static void create() { + meal::create(); + SetKeyName("coffee"); + SetId( ({"cup","coffee" }) ); + SetAdjectives( ({"regular","cup of","ordinary"}) ); + SetShort("a cup of coffee"); + SetLong("An ordinary cup of coffee"); + SetMass(10); + SetMealType( MEAL_DRINK | MEAL_CAFFEINE ); + SetStrength(10); + SetBaseCost("silver",5); + SetMealMessages("The wonderful drink is invigorating." , + "$N drinks $P coffee, and looks invigorated."); + } diff -c -r --new-file ds1.1/lib/domains/town/meals/espresso.c ds2.0r27/lib/domains/town/meals/espresso.c *** ds1.1/lib/domains/town/meals/espresso.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/meals/espresso.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + #include <meal_types.h> + + inherit LIB_MEAL; + + static void create() { + meal::create(); + SetKeyName("espresso"); + SetId( ({"cup","espresso" }) ); + SetAdjectives( ({"imported","cup of"}) ); + SetShort("a cup of espresso"); + SetLong("A cup of espresso"); + SetMass(10); + SetMealType( MEAL_DRINK | MEAL_CAFFEINE ); + SetStrength(20); + SetBaseCost("silver",15); + SetMealMessages("The wonderful drink is most invigorating." , + "$N drinks $P espresso, and looks invigorated and a bit more wired."); + } diff -c -r --new-file ds1.1/lib/domains/town/meals/fire.c ds2.0r27/lib/domains/town/meals/fire.c *** ds1.1/lib/domains/town/meals/fire.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/meals/fire.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + #include <meal_types.h> + + inherit LIB_MEAL; + + static void create() { + meal::create(); + SetKeyName("ale"); + SetId( ({ "bottle", "bourbon" ,"fire","firebreather"}) ); + SetShort("a bottle of bourbon"); + SetLong("A dark green bottle of \"Firebreather\" brand bourbon."); + SetMass(100); + SetBaseCost("silver",50); + SetMealType(MEAL_DRINK | MEAL_ALCOHOL); + SetStrength(100); + SetMealMessages("You finish off the bourbon and gasp! WHOOT!! Mean stuff!", + "$N finishes off a bottle of Firebreather bourbon and lets loose a rebel yell!"); + } diff -c -r --new-file ds1.1/lib/domains/town/meals/ham_sand.c ds2.0r27/lib/domains/town/meals/ham_sand.c *** ds1.1/lib/domains/town/meals/ham_sand.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/meals/ham_sand.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + #include <meal_types.h> + + inherit LIB_MEAL; + + static void create() { + meal::create(); + SetKeyName("sandwich"); + SetId(({"sandwich","ham sandwich"})); + SetShort("a ham sandwich"); + SetLong("This is a large, rather plain ham sandwich."); + SetMass(10); + SetStrength(20); + SetBaseCost("silver",10); + SetMealType(MEAL_FOOD); + SetMealMessages("You eat a ham sandwich. Mmm!", + "$N eats $P ham sandwich."); + } diff -c -r --new-file ds1.1/lib/domains/town/meals/herring.c ds2.0r27/lib/domains/town/meals/herring.c *** ds1.1/lib/domains/town/meals/herring.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/meals/herring.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + #include <meal_types.h> + #include <dirs.h> + + inherit LIB_FISH; + + static void create() { + fish::create(); + SetKeyName("herring"); + SetId( ({ "fish" }) ); + SetAdjectives( ({ "red","saltwater","salt water" }) ); + SetShort("a red herring"); + SetLong("It is saltwater fish, and red in color."); + SetMealType(MEAL_FOOD); + SetMass(10); + SetStrength(10); + SetBaseCost("silver", 2); + SetFight(4); + SetFood("/domains/town/meals/herring"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/meals/latte.c ds2.0r27/lib/domains/town/meals/latte.c *** ds1.1/lib/domains/town/meals/latte.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/meals/latte.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + #include <meal_types.h> + + inherit LIB_MEAL; + + static void create() { + meal::create(); + SetKeyName("milk"); + SetId("latte"); + SetShort("a cafe latte"); + SetLong("A perfect pull of espresso married to steamed milk, " + "and, voila!: cafe latte!"); + SetMass(10); + SetMealType( MEAL_DRINK | MEAL_CAFFEINE ); + SetStrength(25); + SetValue(2); + SetMealMessages("The wonderful drink is invigorating." , + "$N drinks $P latte, and looks invigorated."); + } diff -c -r --new-file ds1.1/lib/domains/town/meals/poison.c ds2.0r27/lib/domains/town/meals/poison.c *** ds1.1/lib/domains/town/meals/poison.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/meals/poison.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,30 ---- + #include <lib.h> + #include <meal_types.h> + + inherit LIB_MEAL; + inherit LIB_MEAL_POISON; + + static void create() { + ::create(); + SetKeyName("poison"); + SetId( ({ "vial", "poison", "vial of poison" }) ); + SetAdjectives("glass","small"); + SetShort("a vial of poison"); + SetLong("A small glass vial of poison."); + SetMass(60); + SetMealType(MEAL_DRINK); + SetStrength(1); + SetMealMessages("You drink the vial of poison.", + "$N drinks a vial of poison."); + SetEmptyName("vial"); + SetEmptyShort("an empty vial"); + SetEmptyLong("It is an empty brown bottle that once held some liquid."); + SetBaseCost("silver",10); + SetPoisonStrength(70); + SetPoisonUses(3); + } + + mixed eventDrink(object who) { + who->AddPoison(this_object()->GetPoisonStrength() * this_object()->GetPoisonUses()); + return ::eventDrink(who); + } diff -c -r --new-file ds1.1/lib/domains/town/meals/shark.c ds2.0r27/lib/domains/town/meals/shark.c *** ds1.1/lib/domains/town/meals/shark.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/meals/shark.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,41 ---- + /* /domains/Ylsrim/fish/shark.c + * from the Dead Souls V Object Library + * created by Descartes of Borg 960302 + */ + + #include <lib.h> + #include <meal_types.h> + #include <dirs.h> + #include <damage_types.h> + + inherit LIB_FISH; + + void BiteMe(object who); + static void create() { + fish::create(); + SetKeyName("bull shark"); + SetId( ({ "shark", "bull shark" }) ); + SetShort("a bull shark"); + SetLong("It is a huge, long fish with razor sharp teeth and a carnivorous " + "appetite."); + SetMealType(MEAL_FOOD); + SetMass(100); + SetStrength(50); + SetBaseCost("silver", 10); + SetFight(40); + SetFood("/domains/town/meals/shark"); + } + int eventCatch(object who, object pole) { + call_out((: BiteMe, who :), 0); + return 1; + } + void BiteMe(object who) { + who->eventPrint("The shark bites you before it dies!"); + environment(who)->eventPrint("The shark bites " + (string)who->GetName() + + " before it dies!", who); + who->eventReceiveDamage(this_object(), BITE, random(30), 0, + (string)who->GetRandomLimb("right hand")); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/meals/special.c ds2.0r27/lib/domains/town/meals/special.c *** ds1.1/lib/domains/town/meals/special.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/meals/special.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + #include <meal_types.h> + + inherit LIB_MEAL; + + static void create() { + meal::create(); + SetKeyName("special"); + SetId( ({ "special of the house", "bottle", "bourbon" }) ); + SetShort("a bottle of bourbon"); + SetLong("A dark green bottle of cheap bourbon."); + SetMass(100); + SetBaseCost("silver",20); + SetMealType(MEAL_DRINK | MEAL_ALCOHOL); + SetStrength(30); + SetMealMessages("You finish off the boubon and gasp! WHEW!! Mean stuff!", + "$N finishes off a bottle of bourbon and gasps."); + } diff -c -r --new-file ds1.1/lib/domains/town/meals/water.c ds2.0r27/lib/domains/town/meals/water.c *** ds1.1/lib/domains/town/meals/water.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/meals/water.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + #include <meal_types.h> + + inherit LIB_MEAL; + + static void create() { + meal::create(); + SetKeyName("water"); + SetId(({ "bottle","water"})); + SetAdjectives(({"fresh","spring"})); + SetShort("a bottle of water"); + SetLong("This is a little bottle of fresh spring water."); + SetMass(10); + SetMealType(MEAL_DRINK); + SetStrength(10); + SetBaseCost("silver",2); + SetMealMessages("You drink your water, and feel refreshed.", "$N drinks "+ + "$P water."); + } diff -c -r --new-file ds1.1/lib/domains/town/npc/bear.c ds2.0r27/lib/domains/town/npc/bear.c *** ds1.1/lib/domains/town/npc/bear.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/npc/bear.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,21 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("bear"); + SetId(({"npc","mob","character","mobile"})); + SetAdjectives(({"non-player", "non player"})); + SetShort("a bear"); + SetLong("A large brown bear. Not as huge as a grizzly, but plenty big enough to knock your block off."); + SetWanderSpeed(20); + SetClass("fighter"); + SetLevel(10); + SetMelee(1); + SetRace("bear"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/npc/beggar.c ds2.0r27/lib/domains/town/npc/beggar.c *** ds1.1/lib/domains/town/npc/beggar.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/npc/beggar.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,69 ---- + #include <lib.h> + #include <position.h> + + inherit LIB_SENTIENT; + inherit LIB_DONATE; + + static void create() { + sentient::create(); + SetKeyName("beggar"); + SetId(({"beggar"})); + SetAdjectives(({"dirty"})); + SetShort("a dirty beggar"); + SetLong("This beggar has something strangely noble about his aspect. " + "He certainly doesn't look like he has always been a beggar."); + SetCanBite(0); + SetWimpy(90); + SetPacifist(1); + SetInventory(([ + "/domains/town/obj/map" : 1, + //"/domains/town/obj/cold" : 1, + ])); + SetLevel(1); + SetAutoStand(0); + SetRace("human"); + SetGender("male"); + SetOwner("The LPC Preservation Foundation"); + SetPosition(POSITION_SITTING); + } + + //Fix courtesy of Jonez + string GetLong(string str){ + return sentient::GetLong(str); + } + + int GiveMap(object ob){ + object map; + if(present(ob->GetKeyName(),environment(this_object())) + && !this_object()->GetInCombat() && + !stringp(ob->CanManipulate()) ){ + eventForce("say here, you might need this"); + eventForce("give my first map to "+ob->GetKeyName()); + } + if(map = present("map",this_object())) { + map->eventDestruct(); + eventForce("shrug"); + } + return 1; + } + + int SayHi(object ob){ + if(present(ob->GetKeyName(),environment(this_object())) + && !this_object()->GetInCombat()) + eventForce("say Hi, "+this_player()->GetName()); + return 1; + } + + void init(){ + ::init(); + + call_out((: SayHi, this_player() :), 1); + + if(!present("town map",this_player())){ + new("/domains/town/obj/map")->eventMove(this_object()); + call_out((: GiveMap, this_player() :), 4); + } + if(!present("cold virus",this_object())){ + new("/domains/town/obj/cold")->eventInfect(this_object()); + } + } diff -c -r --new-file ds1.1/lib/domains/town/npc/bubb.c ds2.0r27/lib/domains/town/npc/bubb.c *** ds1.1/lib/domains/town/npc/bubb.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/npc/bubb.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,25 ---- + #include <lib.h> + + inherit LIB_TEACHER; + void create(){ + ::create(); + SetKeyName("bubb"); + SetId( ({"teacher","orc","schoolteacher","bubb the schoolteacher"}) ); + SetGender("male"); + SetRace("orc"); + SetNativeLanguage("english"); + SetTeachingFee(100); + SetLocalCurrency("silver"); + SetShort("Bubb the schoolteacher"); + SetLong("This is a person whose job it is to teach you things. "+ + "For example, 'ask teacher "+ + "to teach Tangetto' would prompt him to begin teaching a Tangetto "+ + "lesson to you, if he knows the language and you have "+ + "enough of his preferred currency. "); + SetLevel(1); + SetLanguage("Tangetto", 100); + AddTeachingLanguages( ({"Tangetto", "English" }) ); + } + void init() { + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/npc/bugg.c ds2.0r27/lib/domains/town/npc/bugg.c *** ds1.1/lib/domains/town/npc/bugg.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/npc/bugg.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,26 ---- + #include <lib.h> + + inherit LIB_TEACHER; + + void create(){ + ::create(); + SetKeyName("bugg"); + SetId( ({"teacher","dwarf","schoolteacher","bugg the schoolteacher"}) ); + SetGender("male"); + SetRace("dwarf"); + SetNativeLanguage("english"); + SetShort("Bugg the schoolteacher"); + SetLong("This is a person whose job it is to teach you things. "+ + "For example, 'ask teacher "+ + "to teach Malkierien' would prompt him to begin teaching a Malkierien "+ + "lesson to you, if he knows the language and you have "+ + "earned sufficient training points. If you lack training points, then "+ + "do some adventuring and earn a level promotion. You will "+ + "then be awarded training points."); + SetLevel(1); + SetLanguage("Malkierien", 100); + AddTeachingLanguages( ({"Malkierien", "English" }) ); + } + void init() { + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/npc/clepius.c ds2.0r27/lib/domains/town/npc/clepius.c *** ds1.1/lib/domains/town/npc/clepius.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/npc/clepius.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,242 ---- + #include <lib.h> + + inherit LIB_NPC; + + object *slips; + int busy; + + static void create() { + npc::create(); + SetKeyName("clepius"); + SetId(({"clepius","doctor","healer"})); + SetAdjectives(({"a.s.", "A.S.", "doctor","dr","Dr.","dr."})); + SetShort("Clepius the healer"); + SetLong("Clepius is a kindly old man, legendary for his " + "nearly superhuman powers of healing. He is even " + "rumored capable of resurrecting the dead. He runs " + "a medical care service in town, and can be asked to " + "help when needed, though his help is not free."); + SetLevel(50); + SetRace("human"); + SetClass("mage"); + SetGender("male"); + SetInventory(([ + "/domains/town/weap/rod":1, + "/domains/town/obj/medbag":1, + "/domains/town/armor/toga":"wear toga", + ]) ); + slips = ({}); + busy=0; + } + + int CanReceive() { + // object ob,bag; + //bag = present("medical bag", this_object()); + // ob = previous_object(); + if(present("healer token", this_object())){ + //if(bag && member_array("healer token",ob->GetId()) != -1){ + // ob->eventMove(bag); + // } + return 0; + } + + eventForce("nod"); + set_heart_beat(1); + return 1; + } + + int CheckBag(){ + object bag,slip; + string player, problem; + slip = present("healer token", this_object()); + if(!slip && busy == 1) { + eventForce("say That's a bit odd...\n\n"); + eventForce("I'm sorry but I must have misplaced your slip. Do you have another one?"); + busy = 0; + return 1; + } + if(slip){ + busy = 1; + eventForce("say mmhmmm..."); + problem = slip->GetProperty("problem"); + player = slip->GetPatient(); + this_object()->DiagPatient(player,problem); + } + return 1; + } + + void heart_beat(){ + if(busy == 0 && present("healer token", this_object())){ + } + + this_object()->CheckBag(); + } + + int ejectRabble(string str){ + object *riffraff,patient; + environment()->SetProperty("busy",1); + riffraff = get_livings(environment(this_object())); + if(! patient = present(str,environment(this_object())) ){ + patient = find_player(str); + } + foreach(object bum in riffraff){ + if( bum->GetKeyName() != patient->GetKeyName() && + bum->GetKeyName() != "clepius" ){ + tell_object(bum,"The doctor ejects you from his office in order to "+ + "treat "+patient->GetName()+".\n\n"); + bum->eventMoveLiving("/domains/town/room/healer"); + tell_object(patient,"The doctor ejects "+bum->GetName()+" from "+ + "his office in order to treat you."); + } + } + return 1; + } + + int NextPatient(){ + eventForce("put my first slip in bin"); + environment()->SetProperty("busy",0); + tell_room(load_object("/domains/town/room/healer"),"From the back room "+ + "you hear the doctor holler: \"%^BOLD%^CYAN%^NEXT!%^RESET%^\""); + tell_room(environment(),"The doctor leans into the east doorway "+ + "and hollers: \"%^BOLD%^CYAN%^NEXT!%^RESET%^\""); + busy = 0; + environment()->SetProperty("busy",0); + return 1; + + } + + int PerformHeal(string dude){ + object person; + int hp,mhp; + person = present(dude,environment()); + if(!person) { + eventForce("look"); + eventForce("shrug"); + return 1; + } + eventForce("say All right...let's take a look at you."); + hp = person->GetHealthPoints(); + mhp = person->GetMaxHealthPoints()-10; + if(hp > mhp){ + eventForce("say You look fine to me. Take back your slip and save it for when you really need it."); + eventForce("give my first slip to "+dude); + return 1; + } + if(present("clepius mojo",person)){ + eventForce("say You already have salve on you. Give it a chance to work, then come back later."); + eventForce("give my first slip to "+dude); + return 1; + } + eventForce("say Yes, you can use a little help."); + tell_room(environment(),"Clepius vigorously rubs a healing salve onto your body. You can feel it enhancing your body's recovery."); + new("/secure/obj/mojo")->eventMove(person); + return 1; + } + + int PerformRegenerate(string dude){ + int i; + mapping stumps; + object person; + person = present(dude,environment()); + stumps=person->GetMissingLimbs(); + + eventForce("say Let's count limbs, then. Hmmmm..."); + + if(!sizeof(stumps)) { + eventForce("say You are not missing any limbs. Go sell this slip back to James."); + eventForce("give my first slip to "+dude); + return 1; + } + for(i=0;i<sizeof(stumps);i++){ + person->RestoreLimb(stumps[i]); + tell_object(person,"The doctor regenerates your "+stumps[i]+"."); + return 1; + } + } + + int PerformExcision(string dude){ + string what,whom; + object person,thing,slug; + int rifleshot_wounds,firearms_wounds,wounds; + + person = present(dude,environment(this_object())); + slug=present("firearms_wound",person); + wounds=0; + wounds=person->GetLead("gunshot_wounds"); + wounds+=person->GetLead("rifleshot_wounds"); + if(!slug){ + eventForce("say You have no foreign bodies."); + eventForce("give my first slip to "+dude); + return 1; + } + + tell_room(environment(this_object()),"Clepius deftly extracts a lead slug from "+ dude+".", ({person})); + tell_object(person,"Clepius deftly extracts a lead slug from your body."); + firearms_wounds=person->GetLead("firearms_wounds"); + rifleshot_wounds=person->GetLead("rifleshot_wounds"); + firearms_wounds=person->GetLead("firearms_wounds"); + rifleshot_wounds=person->GetLead("rifleshot_wounds"); + slug=new("/domains/town/obj/spent"); + if(person->GetLead("gunshot_wounds") > 0) { + person->AddLead("gunshot_wounds", -1); + slug->SetShort("a spent pistol slug"); + --wounds; + slug->eventMove(this_object()); + if(person->GetLead() < 1){ + slug=present("firearms_wound",person); + if(slug) slug->eventDestruct(); + return 1; + } + return 1; + } + if(person->GetLead("rifleshot_wounds") > 0){ + person->AddLead("rifleshot_wounds", -1); + slug->SetShort("a spent rifle slug"); + --wounds; + slug->eventMove(this_object()); + if(person->GetLead() < 1){ + if(slug) slug->eventDestruct(); + slug=present("firearms_wound",person); + if(slug) slug->eventDestruct(); + return 1; + } + } + slug->eventMove(this_object()); + slug=present("firearms_wound",person); + if(wounds < 1 && slug){ + slug->eventDestruct(); + return 1; + } + + return 1; + } + + int DiagPatient(string dude, string problem){ + if(!present(dude,environment())) { + NextPatient(); + return 1; + } + + ejectRabble(dude); + + if(problem == "regenerate") { + PerformRegenerate(dude); + NextPatient(); + return 1; + } + + if(problem == "heal"){ + PerformHeal(dude); + NextPatient(); + return 1; + } + + if(problem == "excision"){ + PerformExcision(dude); + NextPatient(); + return 1; + } + + } + + diff -c -r --new-file ds1.1/lib/domains/town/npc/clerk.c ds2.0r27/lib/domains/town/npc/clerk.c *** ds1.1/lib/domains/town/npc/clerk.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/npc/clerk.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,24 ---- + #include <lib.h> + #include <objects.h> + + inherit LIB_CLERK; + void create(){ + ::create(); + SetKeyName("clerk"); + SetId("clerk"); + SetAdjectives("town"); + SetGender("male"); + SetRace("human"); + SetShort("the town clerk"); + SetLong("An officious-looking clerk. He is empowered to perform ceremonies of public record. You may \"ask clerk to marry me and PERSON\", and \"ask clerk for a divorce\"."); + SetLocalCurrency("silver"); + SetClass("priest"); + SetLevel(4); + SetTax(5); + } + void init() { + ::init(); + SetSmell(([ "default" : "A rather odd, musty smell."])); + SetListen(([ "default" : "The clerk grumbles something about an "+ + "unconscionably small tax revenue base."])); + } diff -c -r --new-file ds1.1/lib/domains/town/npc/deer.c ds2.0r27/lib/domains/town/npc/deer.c *** ds1.1/lib/domains/town/npc/deer.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/npc/deer.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("deer"); + SetId(({"npc","mob","character","mobile"})); + SetAdjectives(({"non-player", "non player"})); + SetShort("a deer"); + SetLong("A Typical creature of its kind: nervous, shify, yet beautiful and graceful. This gentle herbivore just wants to eat plants and reproduce."); + SetWanderSpeed(4); + SetLevel(1); + SetMelee(1); + SetRace("deer"); + SetGender("female"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/npc/dirk.c ds2.0r27/lib/domains/town/npc/dirk.c *** ds1.1/lib/domains/town/npc/dirk.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/npc/dirk.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,141 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + int AdvanceDude(mixed arg); + mapping advancement; + + int TalkFunc(){ + int rand1; + string thing1, thing2, thing3, thing4, thing5; + + rand1 = random(5); + + thing1 = "There's no shame in being wimpy. Live to fight another day. Death takes away valuable xp."; + thing2 = "Let me know if you see Princess Daphne."; + thing3 = "Don't fight drunk."; + thing4 = "Learning spells from Herkimer is a good idea."; + thing5 = "Food, drink, and caffeine help restore health and strength."; + + switch(rand1){ + case 1 : eventForce("say "+thing1);break; + case 2 : eventForce("say "+thing2);break; + case 3 : eventForce("say "+thing3);break; + case 4 : eventForce("say "+thing4);break; + case 5 : eventForce("say "+thing5);break; + default : eventForce("smile"); + } + } + + static void create() { + sentient::create(); + SetKeyName("dirk"); + SetId(({"dirk"})); + SetShort("Dirk the Tired"); + SetLong("For 20 years, Dirk the Daring has been trying " + "to defeat the vile dragon Singe, with almost no respite. " + "Today he just wants to rest and relax, and has accepted " + "the position of the town's Adventurers' Guild master. " + "If you feel you deserve it, \"ask dirk to advance\"."); + SetLevel(15); + SetRace("human"); + SetGender("male"); + SetAction(5, (: TalkFunc :)); + AddTalkResponse("hello", "hi!"); + SetCommandResponses( ([ + "advance": (: AdvanceDude :) + ]) ); + advancement = ([ + 1:(["title":"the utter novice","xp":0,"qp":0]), + 2:(["title":"the simple novice","xp":1000,"qp":0]), + 3:(["title":"the beginner","xp":1500,"qp":0]), + 4:(["title":"the adventurer","xp":2300,"qp":0]), + 5:(["title":"the experienced adventurer","xp":3500,"qp":5]), + 6:(["title":"the expert adventurer","xp":5100,"qp":12]), + 7:(["title":"the great adventurer","xp":7700,"qp":21]), + 8:(["title":"the master adventurer","xp":12000,"qp":32]), + 9:(["title":"the Freeman","xp":17000,"qp":45]), + 10:(["title":"the Citizen","xp":26000,"qp":60]), + 11:(["title":"the Knight","xp":39000,"qp":77]), + 12:(["title":"the Baron","xp":59000,"qp":96]), + 13:(["title":"the Count","xp":88000,"qp":117]), + 14:(["title":"the Earl","xp":130000,"qp":140]), + 15:(["title":"the Marquis","xp":198000,"qp":165]), + 16:(["title":"the Duke","xp":297000,"qp":192]), + 17:(["title":"the Arch Duke","xp":444444,"qp":221]), + 18:(["title":"Praetor","xp":666667,"qp":252]), + 19:(["title":"Quaestor","xp":1000000,"qp":285]), + 20:(["title":"Caesar","xp":2000000,"qp":450]), + ]); + } + + int AdvanceDude(mixed arg){ + int level,xp,qp; + int desired_level,required_xp,required_qp; + mixed *statlist; + mapping this_stat; + int statclass, statlevel, i; + + statlist = this_player()->GetStats(); + + if(this_player()->GetKeyName() == "guest"){ + this_object()->eventForce("say I don't promote temporary players."); + return 1; + } + + if(!level = this_player()->GetLevel()){ + this_object()->eventForce("say You are confusing me."); + return 1; + } + + if(level > 19){ + this_object()->eventForce("say Whoa there, big " + "stuff. Advancement past level 20 is the " + "purview of the Trans-Human Elder Guild. " + "I'm sorry but I can't help you."); + return 1; + } + + + xp = this_player()->GetExperiencePoints(); + if(!qp = this_player()->GetQuestPoints()) qp = 0; + desired_level = level+1; + required_xp = advancement[desired_level]["xp"]; + if(!required_qp = advancement[desired_level]["qp"]) required_qp = 0; + + this_object()->eventForce("say Level "+desired_level+" " + "with the title of \""+advancement[desired_level]["title"]+"\" " + "requires "+required_xp+" experience points and "+ + required_qp+" quest points."); + + if( xp > required_xp-1 && qp > required_qp-1){ + this_object()->eventForce("say Congratulations! " + "You are promoted to level "+desired_level+" and " + "have earned the name "+this_player()->GetName()+" " + +advancement[desired_level]["title"]+"."); + + this_player()->SetLevel(desired_level); + this_player()->AddTrainingPoints(desired_level); + this_player()->AddTitle(advancement[desired_level]["title"]); + this_player()->RemoveTitle(advancement[desired_level-1]["title"]); + + for(i=0;i<sizeof(statlist);i++){ + this_stat = this_player()->GetStat(statlist[i]); + statclass = this_stat["class"]; + statlevel = this_stat["level"]; + this_player()->SetStat(statlist[i],statlevel + 1,statclass); + } + this_player()->save_player((string)this_player()->GetKeyName()); + + return 1; + } + + else this_object()->eventForce("say I'm sorry, "+ + this_player()->GetName()+", but you have not " + "fulfilled all the requirements of level "+ + desired_level+". Please come back and try " + "again once you have fulfilled them."); + return 0; + } + + diff -c -r --new-file ds1.1/lib/domains/town/npc/forest_orc.c ds2.0r27/lib/domains/town/npc/forest_orc.c *** ds1.1/lib/domains/town/npc/forest_orc.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/npc/forest_orc.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,39 ---- + #include <lib.h> + + inherit LIB_NPC; + + int CheckOrc(mixed val){ + if(!val) return 0; + if(!objectp(val)) return 0; + if(val->GetRace() == "orc") return 0; + else eventForce("growl at "+val->GetKeyName()); + if(val->GetRace() != "orc") return 1; + else return 0; + } + + static void create() { + npc::create(); + SetKeyName("orc"); + SetId(({"orc"})); + SetAdjectives(({"armored","professional"})); + SetShort("an armored orc"); + SetLong("This is a large adult orc. He seems to have a professional " + "bearing, and a sense of purpose, unlike the ragged, chaotic " + "orcs you've heard talk about. He almost appears to be on a mission."); + SetInventory(([ + "/domains/town/weap/sword" : "wield sword", + "/domains/town/obj/rucksack" : "wear my sack", + "/domains/town/armor/leather_armor" : "wear leather armor", + "/domains/town/armor/orc_boot_l" : "wear left boot", + "/domains/town/armor/orc_boot_r" : "wear right boot", + ])); + SetLevel(1); + SetRace("orc"); + SetClass("explorer"); + SetGender("male"); + SetEncounter( (: CheckOrc :) ); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/npc/gecko.c ds2.0r27/lib/domains/town/npc/gecko.c *** ds1.1/lib/domains/town/npc/gecko.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/npc/gecko.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("gecko"); + SetAdjectives( ({"gecko", "green", "small"}) ); + SetId( ({"lizard"}) ); + SetShort("a gecko"); + SetLong("This is a small lizard, about four inches in length. It has green skin, and unusually large eyes."); + SetLevel(1); + SetMelee(1); + SetRace("lizard"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/npc/herkimer.c ds2.0r27/lib/domains/town/npc/herkimer.c *** ds1.1/lib/domains/town/npc/herkimer.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/npc/herkimer.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,163 ---- + #include <lib.h> + #include <daemons.h> + + inherit LIB_LEADER; + int JoinGuild(object ob, string verb, string what); + int TeachSpell(object who, string verb, string spell); + + string *spells; + mapping AvailableSpells; + + int WieldStaff(){ + if(!present("staff",this_object())){ + new("/domains/town/weap/leostaff")->eventMove(this_object()); + tell_room(environment(),"Herkimer claps his hands and a large "+ + "wooden staff materializes."); + this_object()->eventForce("wield staff"); + this_object()->eventForce("say you poor fool!"); + this_object()->eventForce("cast buffer"); + } + return 1; + } + + static void create() { + leader::create(); + SetKeyName("herkimer"); + SetId(({"archwizard","wizard","herkermer","herkirmer"})); + SetAdjectives(({"old","gentle","kindly"})); + SetShort("Herkimer the kind wizard"); + SetLong("This kindly old wizard is the master of the "+ + "local magic shop, which doubles as the Mages' Guild. "+ + "You can ask Herkimer to teach you a spell, and if "+ + "you're capable of learning it, he will teach you, "+ + "for a fee. His penetrating blue eyes seem to "+ + "see right through you, but the smile from beneath "+ + "his white beard is reassuring."); + SetLevel(300); + SetUnique(1); + SetRace("human"); + SetGender("male"); + SetClass("mage"); + SetInventory(([ + "/domains/town/armor/robe":"wear robe", + "/domains/town/armor/wizard_hat":"wear hat", + + ])); + SetSpellBook( ([ "buffer" : 100, "meditate" : 100, "missile" : 100, "fireball" : 100 ]) ); + SetAction(25, ({ + "Herkimer scratches his beard thoughtfully.", + "Herkimer seems to be trying to remember something.", "Herkimer ponders.", + "Herkimer thinks.", "Herkimer thinks carefully.", + "Herkimer says, \"%^BOLD%^CYAN%^You don't have to be a mage to learn a spell, but it sure helps.%^RESET%^\"", + "Herkimer says, \"%^BOLD%^CYAN%^The more you use your magic skills, the more proficient you become.%^RESET%^\"", + "Herkimer says, \"%^BOLD%^CYAN%^Casting spells costs you mana points. Make sure you don't run out unexpectedly!%^RESET%^\"", + "Herkimer says, \"%^BOLD%^CYAN%^If you join us and then leave the guild, you will not be alowed to become a mage again.%^RESET%^\"", + "Herkimer says, \"%^BOLD%^CYAN%^Some spells require total concentration. If you move or if you are attacked, it may interrupt the casting.%^RESET%^\"", + "Herkimer says, \"%^BOLD%^CYAN%^All magical training is free of charge to guild members, of course.%^RESET%^\"", + })); + SetCombatAction(50, ({ (: WieldStaff :), "say what is your deal?", + "say don't make me destroy you","cast fireball", "cast missile", "cast buffer"}) ); + SetCommandResponses( ([ + "join": (: JoinGuild :), + "teach" : (: TeachSpell :), + "learn" : "I have much to learn, young one, but not from you.", + ]) ); + AvailableSpells = ( ([ + "fireball" : 1000, + "missile" : 500, + "buffer" : 200, + "meditate" : 500, + "inner strength" : 500, + ]) ); + } + + void init(){ + string key; + int val; + ::init(); + spells = ({}); + foreach(key,val in AvailableSpells){ + spells += ({ key }); + } + } + + int JoinGuild(object ob, string verb, string what){ + if(ob->GetClass() == "mage") { + eventForce("say You're already in, doofus."); + return 1; + } + eventForce("say Hmm...want to join our guild, do you?"); + + if(!this_player()->GetQuest("Orc Slayer Quest")){ + eventForce("say First you must prove yourself worthy. Help my brother Leo find the Orcslayer and I will happily welcome you into our family. Until then, you may not join the mages."); + return 1; + } + if(ob->GetClass() == "explorer" || !ob->GetClass()){ + eventForce("say very well, "+ob->GetName()+"."); + eventForce("say Welcome to the mages' guild! You are now officially a mage. You must practice your magic often, since you are now physically weaker than before. The stronger your magic, the stronger you are!"); + ob->ChangeClass("mage"); + eventForce("say you have been demoted to a Level 1 player. However, you still retain your experience and your questing history, so just ask Dirk to promote you again a few times."); + return 1; + } + eventForce("say I'm sorry, it looks to me like you have already chosen your specialty. As a member of the Guildmasters' Guild, I am forbidden from removing you from the "+capitalize(ob->GetClass())+"'s Guild."); + return 1; + } + + int TeachSpell(object who, string verb, string spell){ + int cost, onhand; + mapping myspells; + if(!spell || spell == ""){ + eventForce("say Please ask again, but this time specify the spell you'd like to learn."); + return 1; + } + if(!SPELLS_D->GetSpell(spell)){ + eventForce("say I'm sorry, that is not a spell I can teach you."); + return 1; + } + if(member_array(spell,spells) == -1){ + eventForce("say That spell is not available right now."); + eventForce("say The spells I can teach you are "+implode(spells,", ")+"."); + return 1; + } + myspells = who->GetSpellBook(); + if(myspells[spell]){ + eventForce("say You already know that spell."); + return 1; + } + cost = AvailableSpells[spell]; + onhand = who->GetCurrency("silver"); + if(who->GetClass() != "mage" && onhand < cost) { + eventForce("say You lack enough silver coins to pay for that spell."); + eventForce("say "+spell+" costs "+cost+" silver and you "+ + "only have "+onhand+"."); + eventForce("say I can only accept silver. It's a magic thing. If you want, you can try to exchange your other currency for silver at the bank across the street."); + return 1; + } + tell_room(environment(this_object()),"Herkimer closes his eyes, mutters under his breath, and waves his hands."); + if(!who->eventLearnSpell(spell)){ + eventForce("shake"); + eventForce("say You do not appear capable of learning that spell right now."); + return 1; + } + eventForce("smile"); + eventForce("say Congratulations. You now possess the mystical knowledge of the "+spell+" spell. Use it wisely."); + if(who->GetClass() != "mage") who->AddCurrency("silver",-cost); + return 1; + } + + int eventReceiveObject() { + object ob, player; + ob = previous_object(); + player = this_player(); + + if( !ob || !::eventReceiveObject() ) return 0; + if( ob->GetKeyName() == "orc slayer" ) { + eventForce("say I'm sorry, you've got the wrong archwizard."); + eventForce("say You're looking for Leo. His workroom is the church basement."); + eventForce("give orcslayer to "+this_player()->GetKeyName()); + return 1; + } + + AddCarriedMass((int)ob->GetMass()); + return 1; + } diff -c -r --new-file ds1.1/lib/domains/town/npc/human_champion.c ds2.0r27/lib/domains/town/npc/human_champion.c *** ds1.1/lib/domains/town/npc/human_champion.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/npc/human_champion.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,21 ---- + #include <lib.h> + inherit LIB_NPC; + static void create(){ + npc::create(); + SetKeyName("human champion"); + SetId( ({ "champion", "human","npc","warrior"}) ); + SetShort("a human champion"); + SetLong("This is a massive human warrior. His pectoral muscles "+ + "are clearly visible even through his shaggy fur and armor. His face is an angry "+ + "snarl of rage and hatred."); + SetLevel(10); + SetRace("human"); + SetClass("fighter"); + SetGender("male"); + SetInventory(([ + "/domains/campus/armor/chainmail.c" : "wear chainmail", + //"/domains/campus/armor/shield.c" : "wear shield", + "/domains/campus/weap/sharpsword.c" : "wield sword" + ])); + //SetMaxHealthPoints(550); + } diff -c -r --new-file ds1.1/lib/domains/town/npc/human_champion_f.c ds2.0r27/lib/domains/town/npc/human_champion_f.c *** ds1.1/lib/domains/town/npc/human_champion_f.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/npc/human_champion_f.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,21 ---- + #include <lib.h> + inherit LIB_NPC; + static void create(){ + npc::create(); + SetKeyName("human champion"); + SetId( ({ "champion", "human","npc","warrior"}) ); + SetShort("a human champion"); + SetLong("This is a massive human warrior. Her huge muscles "+ + "are clearly visible even through her armor. Her face is an angry "+ + "snarl of rage and hatred."); + SetLevel(10); + SetRace("human"); + SetClass("fighter"); + SetGender("female"); + SetInventory(([ + "/domains/campus/armor/chainmail.c" : "wear chainmail", + //"/domains/campus/armor/shield.c" : "wear shield", + "/domains/campus/weap/sharpsword.c" : "wield sword" + ])); + //SetMaxHealthPoints(550); + } diff -c -r --new-file ds1.1/lib/domains/town/npc/james.c ds2.0r27/lib/domains/town/npc/james.c *** ds1.1/lib/domains/town/npc/james.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/npc/james.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,31 ---- + #include <lib.h> + #include <vendor_types.h> + + inherit LIB_VENDOR; + + static void create() { + ::create(); + SetKeyName("james"); + SetId( ({ "vendor","secretary","assistant","manager" }) ); + SetAdjectives( ({ "executive","medical","guild" }) ); + SetShort("James, the guild secretary and manager"); + SetLevel(12); + SetLong("James is typical of apprentice healers: he is a bit "+ + "arrogant, officious, and brusque; but he appears "+ + "to be a competent secretary and guild officer. "+ + "He is the person you will buy a treatment token "+ + "from. Read the list on the wall for the tokens "+ + "available."); + SetGender("male"); + SetMorality(40); + SetRace("human"); + AddCurrency("silver", random(100)); + SetSkill("bargaining", 1); + SetProperty("no bump", 1); + SetLocalCurrency("silver"); + SetStorageRoom("/domains/town/room/healer2"); + SetMaxItems(10000); + SetVendorType(VT_HERB); + SetSkill("bargaining", 1); + + } diff -c -r --new-file ds1.1/lib/domains/town/npc/lars.c ds2.0r27/lib/domains/town/npc/lars.c *** ds1.1/lib/domains/town/npc/lars.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/npc/lars.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,33 ---- + #include <lib.h> + + inherit LIB_BARKEEP; + + static void create() { + barkeep::create(); + SetKeyName("lars"); + SetId( ({ "lars", "owner", "barkeep", "bartender", "keeper" }) ); + SetShort("Lars, the keeper of the pub"); + SetLevel(1); + SetLong("Lars is the owner of the local pub, an old and famous " + "drinking establishment in the heart of town. He is an " + "unassuming fellow, and quite jovial."); + SetMenuItems(([ + ({ "espresso", "imported espresso" }) : "/domains/town/meals/espresso", + ({ "sandwich", "ham sandwich" }) : "/domains/town/meals/ham_sand", + ({ "spring water", "water" }) : "/domains/town/meals/water", + ({ "first class ale", "ale" }) : "/domains/town/meals/ale", + ({ "regular coffee", "coffee" }) : "/domains/town/meals/coffee", + ({ "firebreather" }) : "/domains/town/meals/fire", + ({ "special of the house", "special" }) : "/domains/town/meals/special", + ])); + SetGender("male"); + SetMorality(40); + SetRace("human"); + AddCurrency("electrum", random(200)); + SetSkill("bargaining", 1); + SetProperty("no bump", 1); + SetLocalCurrency("silver"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/npc/leo.c ds2.0r27/lib/domains/town/npc/leo.c *** ds1.1/lib/domains/town/npc/leo.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/npc/leo.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,71 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + int give_it(string str); + int WieldStaff(){ + if(!present("staff",this_object())){ + new("/domains/town/weap/leostaff")->eventMove(this_object()); + tell_room(environment(),"Leo claps his hands and a large "+ + "wooden staff materializes."); + this_object()->eventForce("wield staff"); + this_object()->eventForce("say you poor fool!"); + } + return 1; + } + static void create() { + sentient::create(); + SetKeyName("leo"); + SetId(({"archwizard","wizard"})); + SetAdjectives(({"portly","the portly","wizard","archwizard"})); + SetShort("Leo the portly archwizard"); + SetLong("Leo is a large, friendly-looking wizard with a big "+ + "beard and a huge belly. He seems pretty busy and "+ + "somewhat preoccupied."); + SetInventory(([ + "/domains/town/armor/wizard_hat" : "wear hat", + "/domains/town/armor/robe" : "wear robe", + "/domains/town/obj/pipe" : 1, + ])); + SetLevel(300); + SetUnique(1); + SetRace("human"); + SetGender("male"); + SetClass("mage"); + SetSkill("multi-hand", 9); + SetAction(25, ({ + "Leo scratches his beard thoughtfully.", + "Leo seems to be trying to remember something.", "Leo ponders.", + "Leo thinks.", "Leo thinks carefully.", + "Leo says, \"Where in blazes did I put that Orcslayer?\"", + "Leo says, \"I just hope those pesky orcs didn't find it.\"", + "Leo says, \"I just don't have time to fight those orcs.\"" + })); + SetCombatAction(100, (: WieldStaff :)); + } + int CompleteQuest(object ob){ + string *quests; + quests = ob->GetQuests(); + if(!ob->GetQuest("Orc Slayer Quest")){ + ob->AddQuest("the Orc Slayer","Orc Slayer Quest"); + eventForce("say You have solved the Orc Slayer Quest. Congratulations!"); + eventForce("say I hereby award you 10 quest points, and 2000 experience points!"); + ob->AddQuestPoints(10); + ob->AddExperiencePoints(2000); + } + return 1; + } + int eventReceiveObject() { + object ob, player; + ob = previous_object(); + player = this_player(); + + if( !ob || !::eventReceiveObject() ) return 0; + if( ob->GetKeyName() == "orc slayer" ) CompleteQuest(player); + + AddCarriedMass((int)ob->GetMass()); + return 1; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/npc/mayor.c ds2.0r27/lib/domains/town/npc/mayor.c *** ds1.1/lib/domains/town/npc/mayor.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/npc/mayor.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,24 ---- + #include <lib.h> + inherit LIB_MAYOR; + void create(){ + ::create(); + SetKeyName("mayor"); + SetId("mayor"); + SetGender("male"); + SetRace("human"); + SetShort("the mayor"); + SetLong("A bit disheveled, this rather eccentric-looking "+ + "man discharges the official duties of this town's "+ + "chief executive office. Mostly, people request "+ + "citizenship from him, for a fee of 5 silver."); + SetLocalCurrency("silver"); + SetTax(5); + } + //funs + //snuf + void init() { + ::init(); + SetSmell(([ "default" : "A rather odd, musty smell."])); + SetListen(([ "default" : "The mayor grumbles something about an "+ + "unconscionably small tax revenue base."])); + } diff -c -r --new-file ds1.1/lib/domains/town/npc/mp.c ds2.0r27/lib/domains/town/npc/mp.c *** ds1.1/lib/domains/town/npc/mp.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/npc/mp.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,27 ---- + #include <lib.h> + inherit LIB_NPC; + + + static void create(){ + npc::create(); + SetKeyName("gate guard"); + SetId(({"human","guard","mp","soldier","policeman","military policeman"})); + SetAdjectives(({"military"})); + SetShort("a military gate guard"); + SetLong("This is a United States Army military policeman. He has "+ + "spent many months in arduous training, and by the looks of him, has seen "+ + "plenty of action in his lifetime. He is extremely large, looks very "+ + "tough, and whatever he is guarding is probably very safe."); + SetLevel(20); + SetRace("human"); + SetClass("fighter"); + SetGender("male"); + SetInventory(([ + "/domains/town/weap/9mmpistol_mp" : "wield pistol", + "/domains/town/armor/helmet2" : "wear helmet", + "/domains/town/armor/bdu" : "wear bdu" + ])); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/npc/newt.c ds2.0r27/lib/domains/town/npc/newt.c *** ds1.1/lib/domains/town/npc/newt.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/npc/newt.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,21 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("newt"); + SetAdjectives( ({"slimy"}) ); + SetId(({"npc","mob","character","mobile"})); + SetShort("a newt"); + SetLong("A slimy amphibian."); + SetWanderSpeed(3); + SetMelee(1); + SetLevel(1); + SetRace("amphibian"); + SetClass("explorer"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/npc/oana.c ds2.0r27/lib/domains/town/npc/oana.c *** ds1.1/lib/domains/town/npc/oana.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/npc/oana.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,28 ---- + #include <lib.h> + #include <vendor_types.h> + + inherit LIB_VENDOR; + + static void create() { + ::create(); + SetKeyName("oana"); + SetId( ({ "shopkeep","shopkeeper","keeper","vendor"}) ); + SetAdjectives( ({ "friendly","sprightly","plain","simple" }) ); + SetShort("Oana the Magic Shop keeper"); + SetLevel(12); + SetLong("Oana is a sprightly young woman with very short "+ + "dark hair and a simple, plain "+ + "manner of dress. She is the Magic Shop "+ + "keeper, and you may trade in magical "+ + "items with her."); + SetGender("female"); + SetMorality(40); + SetRace("human"); + AddCurrency("silver", random(100)); + SetProperty("no bump", 1); + SetLocalCurrency("silver"); + SetStorageRoom("/domains/town/room/magic_shop2"); + SetMaxItems(10000); + SetVendorType(VT_MAGIC); + SetSkill("bargaining", 1); + } diff -c -r --new-file ds1.1/lib/domains/town/npc/orc.c ds2.0r27/lib/domains/town/npc/orc.c *** ds1.1/lib/domains/town/npc/orc.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/npc/orc.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,32 ---- + #include <lib.h> + + inherit LIB_NPC; + + int CheckOrc(mixed val){ + if(!val) return 0; + if(!objectp(val)) return 0; + if(val->GetRace() == "orc") return 0; + else eventForce("growl at "+val->GetKeyName()); + return 1; + } + + static void create() { + npc::create(); + SetKeyName("orc"); + SetId(({"orc"})); + SetAdjectives(({"dirty"})); + SetShort("a dirty orc"); + SetLong("This orc is typical of its breed: nasty, brutish, and short. It appears " + "to be a juvenile or adolescent, making it somewhat less " + "dangerous but more hostile. "); + SetLevel(1); + SetRace("orc"); + //SetClass("fighter"); + SetGender("male"); + SetMaxHealthPoints(100); + SetEncounter( (: CheckOrc :) ); + SetInventory(([ + "/domains/town/weap/dagger":"wield dagger", + ]) ); + + } diff -c -r --new-file ds1.1/lib/domains/town/npc/orc2.c ds2.0r27/lib/domains/town/npc/orc2.c *** ds1.1/lib/domains/town/npc/orc2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/npc/orc2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,32 ---- + #include <lib.h> + + inherit LIB_NPC; + + int CheckOrc(mixed val){ + if(!val) return 0; + if(!objectp(val)) return 0; + if(val->GetRace() == "orc") return 0; + else eventForce("growl at "+val->GetKeyName()); + return 1; + } + + static void create() { + npc::create(); + SetKeyName("orc"); + SetId(({"orc"})); + SetAdjectives(({"dirty"})); + SetShort("a dirty orc"); + SetLong("This orc is typical of its breed: nasty, brutish, and short. It appears " + "to be a juvenile or adolescent, making it somewhat less " + "dangerous but more hostile. "); + SetLevel(1); + SetRace("orc"); + //SetClass("fighter"); + SetGender("male"); + SetMaxHealthPoints(100); + SetEncounter( (: CheckOrc :) ); + SetInventory(([ + "/domains/town/weap/axe":"wield axe", + ]) ); + + } diff -c -r --new-file ds1.1/lib/domains/town/npc/orc_boss.c ds2.0r27/lib/domains/town/npc/orc_boss.c *** ds1.1/lib/domains/town/npc/orc_boss.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/npc/orc_boss.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,31 ---- + #include <lib.h> + + inherit LIB_NPC; + + int CheckOrc(mixed val){ + if(!val) return 0; + if(!objectp(val)) return 0; + if(val->GetRace() == "orc") return 0; + else eventForce("growl at "+val->GetKeyName()); + return 1; + } + + static void create() { + npc::create(); + SetKeyName("boss orc"); + SetId(({"orc","boss","boss"})); + SetAdjectives(({"dirty","orc","boss"})); + SetShort("the boss orc"); + SetLong("This orc is typical of its breed: nasty, brutish, and short. It is larger " + "than the local orcs you've seen, and looks mean and tough."); + SetLevel(1); + SetRace("orc"); + SetClass("fighter"); + SetGender("male"); + SetMaxHealthPoints(200); + SetEncounter( (: CheckOrc :) ); + SetInventory(([ + "/domains/town/weap/dagger":"wield dagger", + ]) ); + + } diff -c -r --new-file ds1.1/lib/domains/town/npc/orc_shaman.c ds2.0r27/lib/domains/town/npc/orc_shaman.c *** ds1.1/lib/domains/town/npc/orc_shaman.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/npc/orc_shaman.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,35 ---- + #include <lib.h> + + inherit LIB_NPC; + + int CheckOrc(mixed val){ + if(!val) return 0; + if(!objectp(val)) return 0; + if(val->GetRace() == "orc") return 0; + else eventForce("growl at "+val->GetKeyName()); + return 1; + } + + static void create() { + npc::create(); + SetKeyName("orc shaman"); + SetId(({"orc","shaman"})); + SetAdjectives(({"dirty"})); + SetShort("the orc shaman"); + SetLong("This orc is different from the others you've seen. "+ + "he has an unearthly ferocity about him and "+ + "is bigger, tougher, and meaner than the others."); + SetLevel(3); + SetRace("orc"); + SetClass("fighter"); + SetGender("male"); + SetMaxHealthPoints(200); + SetEncounter( (: CheckOrc :) ); + SetInventory(([ + "/domains/town/weap/gstaff":"wield staff", + "/domains/town/weap/orcslayer":1, + "/domains/town/armor/orc_helmet": "wear helmet", + "/domains/town/armor/bearskin": "wear bearskin", + ]) ); + + } diff -c -r --new-file ds1.1/lib/domains/town/npc/otik.c ds2.0r27/lib/domains/town/npc/otik.c *** ds1.1/lib/domains/town/npc/otik.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/npc/otik.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,31 ---- + #include <lib.h> + #include <vendor_types.h> + + inherit LIB_VENDOR; + + + static void create() { + ::create(); + SetKeyName("otik"); + SetId( ({ "vendor","otik", "owner", "shopkeep", "shopkeeper", "keeper" }) ); + SetShort("Otik, the keeper of the shop"); + SetLevel(12); + SetLong("Otik is the owner of the local general store, an old and famous " + "trading post in the heart of town. The brother of Lars, he also is an " + "unassuming fellow, and just as jovial."); + SetGender("male"); + SetMorality(40); + SetRace("human"); + AddCurrency("electrum", random(200)); + SetSkill("bargaining", 1); + SetProperty("no bump", 1); + SetLocalCurrency("silver"); + SetStorageRoom("/domains/town/room/shop2"); + SetMaxItems(10000); + SetVendorType(VT_ALL); + SetSkill("bargaining", 1); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/npc/radagast.c ds2.0r27/lib/domains/town/npc/radagast.c *** ds1.1/lib/domains/town/npc/radagast.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/npc/radagast.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,33 ---- + #include <lib.h> + #include <objects.h> + + inherit LIB_TRAINER; + void create(){ + trainer::create(); + SetKeyName("radagast"); + SetId("radagast the brown","wizard","mage","trainer"); + SetAdjectives("friendly"); + SetGender("male"); + SetRace("human"); + SetNoSpells(1); + SetShort("Radagast the Brown"); + SetLong("This is a tall, thin old man. Not much is known of "+ + "this mysterious wizard, other than his legendary kindness "+ + "to animals and his controversial reputation as a seditious "+ + "rebel. He can train you in the arts of magic defense, magic "+ + "attack, and conjuring. You may, for example, \"ask radagast "+ + "to train conjuring\". If you lack training points, then "+ + "do some adventuring and earn a promotion from Dirk. You will "+ + "then be awarded training points."); + SetClass("mage"); + SetLevel(40); + AddTrainingSkills( ({ "magic defense", "magic attack", "conjuring" }) ); + SetSpellBook( ([ "buffer" : 100, "meditate" : 100, "missile" : 100, "fireball" : 100 ]) ); + } + void init() { + trainer::init(); + SetSmell(([ "default" : "A rather odd, musty smell."])); + SetListen(([ "default" : "Radagast seems to be constantly "+ + "humming a quiet tune to himself."])); + //eventForce("cast buffer"); + } diff -c -r --new-file ds1.1/lib/domains/town/npc/rat.c ds2.0r27/lib/domains/town/npc/rat.c *** ds1.1/lib/domains/town/npc/rat.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/npc/rat.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,29 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("rat"); + SetAdjectives( ({"mangy", "little", "dirty"}) ); + SetId( ({"rat"}) ); + SetShort("a rat"); + SetLong("A scruffy little dirty rat."); + SetLevel(3); + SetRace("rodent"); + SetGender("male"); + SetClass("fighter"); + SetMaxHealthPoints(5); + SetWanderSpeed(1); + SetEncounter(100); + SetMessage("come","$N scurries in."); + SetMessage("leave","$N scurries $D."); + SetAction(5, ({ + "The rat squeaks.", "You hear a rat scuttling about.", + "A scruffy little rat brushes against your leg.", + "You hear tiny munching sounds."})); + } + void init(){ + SetMaxHealthPoints(3); + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/npc/spider.c ds2.0r27/lib/domains/town/npc/spider.c *** ds1.1/lib/domains/town/npc/spider.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/npc/spider.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("spider"); + SetAdjectives( ({"huge", "hairy"}) ); + SetId(({"npc","mob","character","mobile"})); + SetShort("a huge spider"); + SetLong("This is a humongous hairy spider about the size of a housecat. It looks absolutely vile and it has some kind of viscous fluid is dripping from its mouthparts."); + SetMelee(1); + SetLevel(1); + SetRace("arachnid"); + SetClass("explorer"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/npc/thief.c ds2.0r27/lib/domains/town/npc/thief.c *** ds1.1/lib/domains/town/npc/thief.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/npc/thief.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,30 ---- + #include <lib.h> + + inherit LIB_NPC; + + + static void create() { + npc::create(); + SetKeyName("thief"); + SetId(({"thief in a bathtowel","thief in a towel","thief"})); + SetAdjectives(({"wet"})); + SetShort("a thief in a bathtowel"); + SetLong("From his furtive appearance and demeanor, this "+ + "is obviously a thief who has snuck into the "+ + "mansion and taken up residence. You seem "+ + "to have caught him just after his shower."); + SetLevel(3); + SetRace("human"); + SetClass("fighter"); + SetGender("male"); + SetEncounter(100); + SetMaxHealthPoints(100); + SetInventory(([ + "/domains/town/armor/towel":"wear towel", + "/domains/town/weap/brush":"wield brush", + "/domains/town/obj/safe_key":1, + ]) ); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/npc/troll.c ds2.0r27/lib/domains/town/npc/troll.c *** ds1.1/lib/domains/town/npc/troll.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/npc/troll.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,47 ---- + #include <lib.h> + + inherit LIB_NPC; + object gdude; + + + int nasty(object dude){ + gdude = dude; + eventForce("look at "+gdude->GetKeyName()); + eventForce("drool"); + return 1; + } + int CheckHuman(mixed val){ + if(!val) return 0; + if(!objectp(val)) return 0; + gdude = val; + if(val->GetRace() != "human") return 0; + else { + call_out( (: nasty, gdude :) , 2); + } + return 1; + } + static void create() { + npc::create(); + SetKeyName("troll"); + SetId(({"troll"})); + SetAdjectives(({"dirty"})); + SetShort("a mean-looking troll"); + SetLong("This is the dreaded creature of legend: a slimy, " + "green, putrid-looking fiend with long, razor-" + "sharp claws and fangs."); + SetLevel(3); + SetRace("troll"); + SetClass("fighter"); + SetGender("male"); + SetMelee(1); + SetEncounter( (: CheckHuman :) ); + SetSkill("melee attack",50,50,10); + SetStat("strength",50,1); + SetStat("agility",50,1); + SetStat("coordination",50,1); + SetStat("speed",50,1); + AddCurrency("silver",221+random(157)); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/npc/viper.c ds2.0r27/lib/domains/town/npc/viper.c *** ds1.1/lib/domains/town/npc/viper.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/npc/viper.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,22 ---- + #include <position.h> + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("snake"); + SetId( ({"garter snake", "reptile"}) ); + SetAdjectives( ({"small", "harmless", "garter", "black", "black and yellow", "yellow and black"}) ); + SetShort("a garter snake"); + SetLong("This is a small, harmless reptile, about 9 inches long. It is black with a few yellow stripes along its length. This snake enjoys eating garden pests."); + SetAutoStand(0); + SetPosition(POSITION_LYING); + SetLevel(1); + SetMelee(1); + SetRace("viper"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/npc/zoe.c ds2.0r27/lib/domains/town/npc/zoe.c *** ds1.1/lib/domains/town/npc/zoe.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/npc/zoe.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,30 ---- + #include <lib.h> + #include <vendor_types.h> + + inherit LIB_TELLER; + + static void create() { + ::create(); + SetKeyName("zoe"); + SetId( ({ "teller","banker","executive" }) ); + SetAdjectives( ({ "bank","executive","friendly","efficient" }) ); + SetShort("Zoe the bank teller"); + SetLevel(12); + SetLong("Zoe is an attractive young blonde woman with " + "a French accent. She is dressed in a conservative, " + "executive style, and has a friendly and efficient air " + "about her."); + SetGender("female"); + SetMorality(40); + SetRace("human"); + AddCurrency("silver", random(100)); + SetProperty("no bump", 1); + SetLocalCurrency("silver"); + SetBankName("First Village Bank"); + SetLocalCurrency("silver"); + SetLocalFee(1); + SetOpenFee(5); + SetExchangeFee(2); + SetCurrencies( ({ "dollars", "copper", "silver", "electrum", "gold", "platinum" }) ); + + } diff -c -r --new-file ds1.1/lib/domains/town/obj/223clip.c ds2.0r27/lib/domains/town/obj/223clip.c *** ds1.1/lib/domains/town/obj/223clip.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/223clip.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + #include <vendor_types.h> + inherit "/lib/clip"; + void create(){ + ::create(); + SetKeyName("223clip"); + SetId(({"clip","magazine"})); + SetAdjectives(({"223",".223","ammunition","rifle","caliber","ammo","ammunition"})); + SetShort("a .223 caliber rifle ammunition clip"); + SetLong("This is a spring-loaded ammunition clip for a .223 caliber "+ + "rifle. It will contain a maximum of thirty rounds."); + SetCaliber(223); + SetMaxAmmo(30); + SetAmmoType("nato"); + SetVendorType(VT_TREASURE); + SetInventory(([ + "/domains/town/obj/223round" : 30, + ])); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/223round.c ds2.0r27/lib/domains/town/obj/223round.c *** ds1.1/lib/domains/town/obj/223round.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/223round.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + #include <vendor_types.h> + inherit "/lib/round"; + void create(){ + ::create(); + SetKeyName("223round"); + SetId(({"round","bullet"})); + SetAdjectives(({".223","223","caliber","rifle","m16","M16","m-16","M-16"})); + SetShort("a .223 caliber rifle round"); + SetLong("This is a .223 caliber rifle round, probably for an M-16 assault rifle. "+ + "It is not very wide, but contains a large powder charge. It is doubtlessly a powerful "+ + "piece of ammunition. It has not been fired."); + SetCaliber(223); + SetRifleType("auto"); + SetPistolType("auto"); + SetAmmoType("nato"); + SetVendorType(VT_TREASURE); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/9mmclip.c ds2.0r27/lib/domains/town/obj/9mmclip.c *** ds1.1/lib/domains/town/obj/9mmclip.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/9mmclip.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + #include <vendor_types.h> + inherit "/lib/clip"; + void create(){ + ::create(); + SetKeyName("9mmclip"); + SetId(({"clip","magazine"})); + SetAdjectives(({"9mm","ammunition","ammo","9 millimeter","pistol"})); + SetShort("a 9 millimeter pistol ammunition clip"); + SetLong("This is a slender, spring-loaded metal container designed "+ + "to feed a 9 millimeter pistol with bullets."); + SetMillimeter(9); + SetMaxAmmo(15); + SetAmmoType("acp"); + SetVendorType(VT_TREASURE); + SetInventory(([ + "/domains/town/obj/round2" : 15 + ])); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/9mmclip_empty.c ds2.0r27/lib/domains/town/obj/9mmclip_empty.c *** ds1.1/lib/domains/town/obj/9mmclip_empty.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/9mmclip_empty.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,16 ---- + #include <lib.h> + #include <vendor_types.h> + inherit "/lib/clip"; + void create(){ + ::create(); + SetKeyName("9mmclip"); + SetId(({"clip","magazine"})); + SetAdjectives(({"9mm","ammunition","ammo","9 millimeter","pistol"})); + SetShort("a 9 millimeter pistol ammunition clip"); + SetLong("This is a slender, spring-loaded metal container designed "+ + "to feed a 9 millimeter pistol with bullets."); + SetMillimeter(9); + SetMaxAmmo(15); + SetAmmoType("acp"); + SetVendorType(VT_TREASURE); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/altar.c ds2.0r27/lib/domains/town/obj/altar.c *** ds1.1/lib/domains/town/obj/altar.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/altar.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,32 ---- + #include <lib.h> + #include <props.h> + + inherit LIB_BED; + inherit LIB_STORAGE; + inherit LIB_SURFACE; + inherit LIB_SMELL; + + static void create() { + ::create(); + SetKeyName("orcish altar"); + SetId( ({ "altar","platform","pedestal" }) ); + SetAdjectives( ({ "simple","stone" }) ); + SetShort("a simple stone altar, dripping blood"); + SetLong("This is a ceremonial orcish altar, where "+ + "holy offerings and sacrifices are made. It is "+ + "sheeted in dried blood and rotting tissue."); + SetItems( ([ + ({"blood","dried blood","tissue","rotting tissue"}) : ""+ + "This appears to be the accumulated detritus of "+ + "numerous sacrifices.", + ]) ); + SetMass(3000); + SetBaseCost("silver",15); + SetMaxSitters(2); + SetMaxLiers(1); + SetMaxCarry(5000); + inventory_visible(); + inventory_accessible(); + SetSmell( ([ "default" : "The altar is nauseatingly rank."]) ); + } + mixed CanGet(object ob) { return "The altar is dug into the floor and does not move.";} diff -c -r --new-file ds1.1/lib/domains/town/obj/bag.c ds2.0r27/lib/domains/town/obj/bag.c *** ds1.1/lib/domains/town/obj/bag.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/bag.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + + inherit LIB_STORAGE; + + void create() { + ::create(); + SetKeyName("bag"); + SetAdjectives( ({"small", "cloth"}) ); + SetId( ({ "bag" }) ); + SetShort("a small cloth bag"); + SetLong("It is a simple cloth bag used to hold things. "); + SetMass(274); + SetBaseCost("silver",1); + SetMaxCarry(50); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/basement_button.c ds2.0r27/lib/domains/town/obj/basement_button.c *** ds1.1/lib/domains/town/obj/basement_button.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/basement_button.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + + inherit LIB_DUMMY; // These do not show up in desc, but you can look at them + inherit LIB_PRESS; // Makes the item pressable + + int openDoor(object who) { + object car; + send_messages("press", "$agent_name $agent_verb the button.", + who, 0, environment(who)); + car=load_object("/domains/town/room/elevator"); + car->CallMe(2); + + } + + static void create() { + dummy::create(); + SetKeyName("button"); + SetId(({"button","button on the wall" })); + SetAdjectives("call", "elevator"); + SetShort("a button"); + SetLong("It is a button that you could probably press."); + SetPress((: openDoor :)); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/bbucket.c ds2.0r27/lib/domains/town/obj/bbucket.c *** ds1.1/lib/domains/town/obj/bbucket.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/bbucket.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,35 ---- + #include <lib.h> + + inherit LIB_STORAGE; + + void create() { + ::create(); + SetKeyName("bin"); + SetId(({"bin","can","dustbin","trash","rubbish"})); + SetAdjectives(({"metal","small","blue","recycling","trash","garbage","dust"})); + SetShort("a recycling bin"); + SetLong("This is a blue trash can, marked with "+ + "the letters \"/dev/null\"."); + SetMass(274); + SetBaseCost("silver",50); + SetMaxCarry(999999); + } + + int tidy_up(){ + object *inv; + inv = all_inventory(this_object()); + foreach(object thing in inv){ + if(thing) thing->eventMove(load_object("/domains/town/room/furnace")); + } + return 1; + } + + int eventReceiveObject(object ob){ + write("You make a deposit into the the recycling bin.\n"); + call_out((: tidy_up :),1); + return 1; + } + mixed CanGet(object ob) { return "The bucket does not budge.";} + + void init(){ + } diff -c -r --new-file ds1.1/lib/domains/town/obj/bed.c ds2.0r27/lib/domains/town/obj/bed.c *** ds1.1/lib/domains/town/obj/bed.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/bed.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,42 ---- + #include <lib.h> + #include <props.h> + + inherit LIB_BED; + inherit LIB_PRESS; + inherit LIB_MANIPULATE; + + + int MoveBed(); + int PushBed(); + static void create() { + ::create(); + SetKeyName("king-sized bed"); + SetId( ({ "cot","bed" }) ); + SetAdjectives( ({ "large","king-sized","king-size","four-poster","four poster","big","very big"}) ); + SetShort("a large four-poster bed"); + SetLong("This is a very big bed, with a large, decorative wooden " + "post at each corner. Though one might expect " + "a canopy over such a bed, it is absent here."); + SetMass(4000); + SetBaseCost("silver",1500); + SetMaxSitters(2); + SetMaxLiers(1); + SetManipulate( ([ "default" : (: MoveBed :) ]) ); + SetPress( ([ "default" : (: PushBed :) ]) ); + } + mixed CanGet(object ob) { return "The bed is too heavy to pick up.";} + int MoveBed(){ + send_messages("move", "$agent_name $agent_verb the bed.", + this_player(), 0, environment(this_player())); + environment(this_object())->OpenPassage(); + return 1; + } + int PushBed(){ + send_messages("move", "$agent_name $agent_verb the bed.", + this_player(), 0, environment(this_player())); + environment(this_object())->OpenPassage(); + return 1; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/bigbag.c ds2.0r27/lib/domains/town/obj/bigbag.c *** ds1.1/lib/domains/town/obj/bigbag.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/bigbag.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,15 ---- + #include <lib.h> + + inherit LIB_STORAGE; + + void create() { + ::create(); + SetKeyName("bag"); + SetId( ({ "bag" }) ); + SetAdjectives( ({ "giant", "cloth", "a" }) ); + SetShort("a giant cloth bag"); + SetLong("It is a simple cloth bag used to hold things. "); + SetMass(274); + SetBaseCost("silver",1); + SetMaxCarry(9999999999); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/bin.c ds2.0r27/lib/domains/town/obj/bin.c *** ds1.1/lib/domains/town/obj/bin.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/bin.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,31 ---- + #include <lib.h> + + inherit LIB_STORAGE; + + void create() { + ::create(); + SetKeyName("bin"); + SetAdjectives( ({"newbie", "charity", "freebie"}) ); + SetId( ({"newbie bin"}) ); + SetShort("the newbie bin"); + SetLong("This medium-sized bin is designed to hold stuff that may be of use to newbies. By default it contains stuff that won't sell for much, but players are encouraged to make generous contributions for the benefit of weaker players. To view its contents: look in bin"); + SetInventory(([ + "/domains/town/obj/slip_heal" : 1, + "/domains/town/obj/match" : 5, + "/domains/town/obj/rayovac" : 1, + "/domains/town/obj/spam" : 1, + "/domains/town/obj/dcell" : 2, + "/domains/town/obj/slip_regenerate" : 1, + "/domains/town/obj/torch" : 1, + ])); + SetNoCondition(1); + SetCanClose(0); + SetMass(274); + SetBaseCost("silver",1); + SetMaxCarry(3500); + SetNoClean(1); + } + void init(){ + ::init(); + } + mixed CanGet(object ob) { return "The bucket does not budge.";} diff -c -r --new-file ds1.1/lib/domains/town/obj/btable.c ds2.0r27/lib/domains/town/obj/btable.c *** ds1.1/lib/domains/town/obj/btable.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/btable.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,254 ---- + /* Stupid blackjack table + * works, other than the fact that the value of ace always equals 1. + * by boy@frontiers. + * (You can get two of the same card, like two 8 of spades.) + * Too hard and too much work to simulate a whole deck. + */ + #include <lib.h> + inherit LIB_ITEM; + void StupidAce(); + int needace; + int aceval; + int gameon; + int score; + int dscore; + int bet; + int plidle; + string playername,oldplayername; + object player,oldplayer,here; + void cleanup(); + void eventDealerHit(); + void YouWin(); + void YouLose(); + + int read(string args) { + write("The small letters read..."); + write(" %^CYAN%^Dealer stands at 17."); write(" %^CYAN%^Ties go to the house."); + write("deal <amount> : Starts the game, wagering <amount>"); write(" hit : Requests a new card"); + write(" stand : Ends the game"); + return 1; + } + + static void create() { + ::create(); + SetShort("a blackjack table"); + SetLong("A small mechanical blackjack table lies here, " + "with a miniature robotic dealer " + "built into it. It seems like you can win...err " + "try to win a lot of money here. There are some small " + "printed letters on the table."); + SetPreventGet("You cannot get that!"); + SetMass(0); + SetId( ({"table", "blackjack table"}) ); + SetKeyName("table"); + SetItems( ([ + ({"writing","letters"}): "Some writing on the table. Try \"read "+ + "writing on table\"", + ]) ); + SetRead( ([ + ({"writing","letters"}) : (: read :), + ]) ); + SetDefaultRead("default", (: read :) ); + oldplayername="this_is_a_silly_string"; + } + void init() { + ::init(); + add_action("eventHit", "hit"); + add_action("eventStand", "stand"); + add_action("eventDeal", "deal"); + } + int eventHit() { + int done; + int cardscore; + string card, suit; + int x; + done = 0; + if (gameon == 0) { + write("A game has not started yet, type \"deal\" to start one."); + return 1; + } + if(gameon == 1 && this_player()->GetName() != oldplayername) { + write("You are not playing right now."); + return 1; + } + x = random(13); + switch (x + 1) { + case 1 : card = "Ace"; + break; + case 11 : card = "Jack"; + break; + case 12 : card = "Queen"; + break; + case 13 : card = "King"; + break; + default : card = (string)x + 1; + } + switch (random(4)) { + case 1 : suit = "Hearts"; + break; + case 2 : suit = "Spades"; + break; + case 3 : suit = "Diamonds"; + break; + case 0 : suit = "Clubs"; + } + write("%^BLUE%^You get a " + card + " of " + suit); + if (x == 0) { + StupidAce(); + cardscore = aceval; + done = 1; + } + if (x > 9) { + cardscore = 10; + done = 1; + } + else { + if (done == 0) { + cardscore = x + 1; + } + } + score += cardscore; + if (score > 21) { + if(aceval == 11) { + aceval = 1; + score -= 11; + write("%^CYAN%^Your score is " + score); + } + else { + YouLose(); + } + } + if (score == 21) { + YouWin(); + } + return 1; + } + int eventStand() { + int lose; + if (gameon == 0) { + write("A game has not started yet, type \"deal\" to start one"); + return 1; + } + if(gameon == 1 && this_player()->GetName() != oldplayername) { + write("You are not playing right now."); + return 1; + } + write("%^CYAN%^Your final score is " + score); + + if (dscore < 22) { + write("%^BOLD%^The dealer's score is " + dscore); + } + else { + write("%^BOLD%^The dealer busts"); + } + if (score > dscore && score < 21) { + YouWin(); + } + else { + if (dscore > 21) { + YouWin(); + } + else { + YouLose(); + } + } + return 1; + } + void cleanup() { + oldplayername = "this_is_a_silly_string"; + aceval=0; + score = 0; + dscore = 0; + bet = 0; + gameon = 0; + } + int eventDeal(string args) { + player=this_player(); + playername=player->GetName(); + here=environment(this_object()); + if(oldplayer) plidle=query_idle(oldplayer); + + if (!args) { + write("%^YELLOW%^Please try that again, including the amount of money you want to wager."); + return 1; + } + sscanf(args, "%d", bet); + if(!intp(bet) || bet <= 0){ + write("You must wager an amount.\n"); + return 1; + } + if ((int)this_player()->GetCurrency("silver") < bet) { + write("You don't have that many silver!"); + return 1; + } + if (gameon == 1 && present(oldplayername,here) && plidle < 120 ) { + write("%^RED%^"+oldplayername+" is playing right now. There is room for only one player."); + return 1; + } + if (gameon == 1 && present(oldplayername,here) && plidle > 120 ) { + write("%^RED%^"+oldplayername+" was playing, but "+nominative(oldplayer)+" has gone idle "+ + "and the dealer deals "+objective(oldplayer)+" out.",oldplayer); + say(oldplayername+" has been dealt out of the blackjack table for idleness.",oldplayer); + tell_object(oldplayer,"You've been dealt out of the blackjack table for idleness."); + cleanup(); + } + if (gameon == 1 && !present(oldplayername,here) ) { + write("%^RED%^"+oldplayername+" was playing, but "+nominative(oldplayer)+" has left, and the dealer deals "+ + objective(oldplayer)+" out."); + say(oldplayername+" has been dealt out of the blackjack table because "+nominative(oldplayer)+" left.",oldplayer); + tell_object(oldplayer,"You suddenly remember you left a blackjack game in the middle of it, "+ + "and you've probably been dealt out."); + cleanup(); + } + + oldplayername = playername; + oldplayer = player; + gameon = 1; + write("%^RED%^You ask the dealer to count you into the next game."); + say("%^YELLOW%^" + this_player()->GetName() + " starts playing blackjack."); + this_player()->AddCurrency("silver", -bet); + eventDealerHit(); + eventHit(); + eventHit(); + write("%^CYAN%^Your current score is " + score); + return 1; + } + void eventDealerHit() { + + int cardscore; + int x; + while (dscore < 17) { + x = random(13); + if (x > 9) { + dscore += 10; + } + else { + dscore += x; + } + } + } + void YouLose() { + write("Your score is " + score); + write("%^RED%^You lose"); + say("%^YELLOW%^" + this_player()->GetName() + " loses."); + cleanup(); + } + void YouWin() { + write("Your score is " + score); + write("%^GREEN%^You win!"); + say("%^YELLOW%^" + this_player()->GetName() + " wins!"); + this_player()->AddCurrency("silver", 2 * bet); + cleanup(); + } + void StupidAce() { + int temp; + if ((score + 11) > 21) { + aceval = 1; + } + else { + aceval = 11; + } + temp = aceval + score; + write("%^CYAN%^Your current score is " + temp); + } + diff -c -r --new-file ds1.1/lib/domains/town/obj/candlestick.c ds2.0r27/lib/domains/town/obj/candlestick.c *** ds1.1/lib/domains/town/obj/candlestick.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/candlestick.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,14 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + void create(){ + ::create(); + SetKeyName("silver candlestick"); + SetId( ({"candlestick","candelabra","candelabrum"}) ); + SetAdjectives( ({"small","ornate","silver"}) ); + SetShort("a silver candlestick"); + SetLong("This is an small, ornate silver candlestick."); + SetMass(20); + SetBaseCost("silver",50); + SetVendorType(VT_TREASURE); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/chair.c ds2.0r27/lib/domains/town/obj/chair.c *** ds1.1/lib/domains/town/obj/chair.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/chair.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,43 ---- + #include <lib.h> + + inherit LIB_CHAIR; + + static void create() { + chair::create(); + SetKeyName("chair"); + SetId("chair"); + SetAdjectives( ({ "swivel", "small", "black" }) ); + SetShort("a swivel chair"); + SetLong("This is a small swivel chair, with tasteful and understated "+ + "black covers."); + SetMass(1500); + SetDollarCost(15); + SetMaxSitters(1); + } + void init(){ + add_action("swivel","swivel"); + } + + int swivel(string str){ + int hit,i; + object *dupes; + dupes = get_dupes(this_object(),environment(this_object()) ); + if(!str || str =="" || str == "in chair" || str == "in the chair"){ + hit = 42; + for(i=0;i<sizeof(dupes);i++){ + if( member_array(this_player(),dupes[i]->GetSitters()) != -1) hit = 7; + if( member_array(this_player(),this_object()->GetSitters()) != -1) hit = 7; + } + if( hit == 7) { + write("You swivel around in your swivel chair! Whee!"); + say(this_player()->GetName()+" swivels around in "+possessive(this_player())+" "+ + "swivel chair, yelling \"WHEEEE!!!\""); + return 1; + } + else { write("You are not sitting in a swivel chair."); } + } + if(hit == 42) return 1; + else return 0; + } + + mixed CanGet(object ob) { return "The chair does not budge.";} diff -c -r --new-file ds1.1/lib/domains/town/obj/chest.c ds2.0r27/lib/domains/town/obj/chest.c *** ds1.1/lib/domains/town/obj/chest.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/chest.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,25 ---- + #include <lib.h> + + inherit LIB_STORAGE; + + void create() { + ::create(); + SetKeyName("chest"); + SetId(({"chest","wooden chest"})); + SetShort("a wooden chest"); + SetLong("This is a sturdy wooden chest used to store valuable items."); + SetMass(2000); + SetBaseCost("silver",50); + SetMaxCarry(500); + SetPreventPut("You cannot put this in there!"); + SetInventory(([ + "/secure/obj/memo" : 1, + "/secure/obj/medtric" : 1, + "/secure/obj/control" : 1, + "/secure/obj/roommaker" : 1, + "/domains/town/armor/badge" : 1, + ])); + SetCanClose(1); + SetClosed(1); + } + mixed CanGet(object ob) { return "The chest does not budge.";} diff -c -r --new-file ds1.1/lib/domains/town/obj/chest2.c ds2.0r27/lib/domains/town/obj/chest2.c *** ds1.1/lib/domains/town/obj/chest2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/chest2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + + inherit LIB_STORAGE; + + void create() { + ::create(); + SetKeyName("chest"); + SetId(({"chest","wooden chest"})); + SetShort("a wooden chest"); + SetLong("This is a sturdy wooden chest used to store valuable items."); + SetMass(2000); + SetBaseCost("silver",50); + SetMaxCarry(500); + SetPreventPut("You cannot put this in there!"); + SetInventory(([ + "/domains/town/obj/gcoinbag" : 1, + "/domains/town/obj/maglite" : 1, + "/domains/town/obj/m_key" : 1, + ])); + SetCanClose(1); + SetClosed(1); + } + mixed CanGet(object ob) { return "The chest does not budge.";} diff -c -r --new-file ds1.1/lib/domains/town/obj/church_button.c ds2.0r27/lib/domains/town/obj/church_button.c *** ds1.1/lib/domains/town/obj/church_button.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/church_button.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + + inherit LIB_DUMMY; // These do not show up in desc, but you can look at them + inherit LIB_PRESS; // Makes the item pressable + + int openDoor(object who) { + object car; + send_messages("press", "$agent_name $agent_verb the button.", + who, 0, environment(who)); + car=load_object("/domains/town/room/elevator"); + car->CallMe(1); + + } + + static void create() { + dummy::create(); + SetKeyName("button"); + SetId(({"button","button on the wall", "button next to the elevator", "button next to elevator","button next to an elevator" })); + SetAdjectives("call", "elevator"); + SetShort("a button"); + SetLong("It is a button that you could probably press."); + SetPress((: openDoor :)); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/church_wall.c ds2.0r27/lib/domains/town/obj/church_wall.c *** ds1.1/lib/domains/town/obj/church_wall.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/church_wall.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,16 ---- + #include <lib.h> + + inherit LIB_DUMMY; // These do not show up in desc, but you can look at them + + static void create() { + dummy::create(); + SetKeyName("wall"); + SetId(({"elevator","door","wall" })); + SetAdjectives("call", "elevator","west"); + SetShort("a wall"); + SetLong("Set into the west wall is a thoroughly modern-looking " + "elevator, which seems out of place in this rustic, colonial " + "church. There is a button next to it, presumably to call " + "the elevator car."); + AddItem(new("/domains/town/obj/church_button")); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/clocktower.c ds2.0r27/lib/domains/town/obj/clocktower.c *** ds1.1/lib/domains/town/obj/clocktower.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/clocktower.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,66 ---- + #include <lib.h> + #include <daemons.h> + + inherit LIB_ITEM; + + int eventReadClock(); + + static void create(){ + item::create(); + SetKeyName("clock tower"); + SetId( ({"great clock tower rising majestically into the sky", "great clock of the town", "clock", "tower", "structure", "architecture", "clocktower"}) ); + SetAdjectives( ({"large", "great", "majestic", "impressive", "proud"}) ); + SetShort("a great clock tower rising majestically into the sky"); + SetLong("This is a large clock tower, rising magestically into "+ + "the sky. Some forty feet up you can see the great clock of "+ + "the town, which can be read to know the local time. The "+ + "intricate details of its architecture are deeply impressive, "+ + "and there is little doubt that this great structure is the "+ + "pride of this little town."); + SetMass(10); + SetBaseCost("silver",40); + SetDefaultRead( (: eventReadClock :) ); + } + void init(){ + ::init(); + } + + mixed CanGet(object ob) { return "This is a clock tower. It's not gettable.";} + + int eventReadClock(){ + int hour, minutes; + int *time_of_day; + string hour_string, minute_string; + + time_of_day = SEASONS_D->GetMudTime(); + hour = time_of_day[0]; + minutes = time_of_day[1]; + + if(hour > 12) hour -= 12; + + hour_string = cardinal(hour); + switch(minutes){ + case 0 : minute_string ="o'clock"; break; + case 1 : minute_string = hour_string;hour_string ="one minute past"; break; + case 2 : minute_string = hour_string;hour_string ="two minutes past"; break; + case 3 : minute_string = hour_string;hour_string ="three minutes past"; break; + case 4 : minute_string = hour_string;hour_string ="four minutes past"; break; + case 5 : minute_string = hour_string;hour_string ="five past"; break; + case 6 : minute_string = hour_string;hour_string ="six minutes past"; break; + case 7 : minute_string = hour_string;hour_string ="seven minutes past"; break; + case 8 : minute_string = hour_string;hour_string ="eight minutes past"; break; + case 9 : minute_string = hour_string;hour_string ="nine minutes past"; break; + case 10 : minute_string = hour_string;hour_string ="ten past"; break; + case 15 : minute_string = hour_string;hour_string ="quarter past"; break; + case 45 : minute_string = cardinal(hour+1);hour_string ="quarter of"; break; + case 50 : minute_string = cardinal(hour+1);;hour_string ="ten of"; break; + case 55 : minute_string = cardinal(hour+1);hour_string ="five of"; break; + default : minute_string = cardinal(minutes);break; + } + + if(minute_string == "thirteen") minute_string = "one"; + + write("According to the clock, it is "+hour_string+" "+minute_string+"."); + + return 1; + } diff -c -r --new-file ds1.1/lib/domains/town/obj/cold.c ds2.0r27/lib/domains/town/obj/cold.c *** ds1.1/lib/domains/town/obj/cold.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/cold.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,143 ---- + #include <lib.h> + #include <rooms.h> + #include <vendor_types.h> + #include <damage_types.h> + inherit LIB_GERM; + int damage1(); + int damage2(); + int damage3(); + int damage4(); + int damage5(); + int DangerLevel(); + object victim,where; + string victimname; + + int InfectMess(object ob){ + victim=ob; + victimname=victim->GetName(); + tell_room(environment(victim), victimname+" looks pale and uncomfortable.",({victim}) ); + tell_object(victim, "Your feel an unpleasant tickle in your throat."); + return 1; + } + + void create(){ + germ::create(); + SetKeyName("tc2"); + SetGermName("cold virus"); + SetId(({"tc2"})); + SetLong("Test Cold version 2.1"); + SetCure(20); + SetVendorType(VT_TREASURE); + SetCommunicable(15); + SetLifeSpan(900000); + SetType("viral"); + SetInfect((: InfectMess :)); + } + + void bonuses(){ + if(victim && environment(this_object()) == victim){ + victim->AddStatBonus("intelligence", -5); + victim->AddStatBonus("strength", -15); + victim->AddStatBonus("charisma", -35); + victim->AddStatBonus("durability", -15); + victim->AddStatBonus("agility", -15); + victim->AddStatBonus("coordination", -5); + victim->AddStatBonus("speed", -5); + victim->AddStatBonus("wisdom", -1); + } + else if(victim) { + foreach( string stat in ({"intelligence", "strength", + "charisma", "durability", "agility", "coordination", "speed", "wisdom"})){ + victim->RemoveStatBonus(stat); + } + } + return; + } + + + void init(){ + germ::init(); + bonuses(); + } + + int eventDestruct(){ + this_object()->eventMove(ROOM_FURNACE); + return ::eventDestruct(); + } + + int eventMove(mixed dest){ + ::eventMove(dest); + bonuses(); + } + + int eventSuffer(){ + int x; + x=random(70); + if(x < 8) environment()->eventForce("sneeze"); + else if(x < 5) damage1(); + else if(x < 10) damage2(); + else if(x < 15) damage3(); + else if(x < 20) damage4(); + else if(x < 2) damage5(); + return 1; + } + + int DangerLevel(){ + if(victim->GetHealthPoints() < 100) return 100; + return 1; + } + + int FatigueLevel() { + if(victim->GetStaminaPoints() < 11) return 10; + return 11; + } + + string GetAffectLong(object ob) { + if(!ob || !living(ob)) return 0; + return ob->GetName() + " has a runny nose.\n"+ob->GetName()+" looks ill and disoriented."; + } + + int damage1(){ + tell_object(victim,"You feel miserable."); + tell_room(environment(victim),victimname+" looks miserable.", ({victim}) ); + if(FatigueLevel() > 10) victim->AddStaminaPoints(random(-5)-5); + return 1; + } + + int damage2(){ + tell_object(victim,"You are racked by a fit of wet-sounding coughs."); + tell_room(environment(victim),victimname+" is racked by a fit of wet-sounding coughs.", ({victim}) ); + if(DangerLevel() != 100) victim->eventReceiveDamage(this_object(),DISEASE,random(10)+10,0,"torso"); + if(FatigueLevel() > 10) victim->AddStaminaPoints(random(-10)-5); + return 1; + } + + int damage3(){ + tell_room(environment(victim),victimname+" lets out a pathetic little groan of discomfort.", ({victim}) ); + tell_object(victim,"You let out a little groan of discomfort as a wave of weakness hits you."); + if(FatigueLevel() > 10) victim->AddStaminaPoints(random(-10)-10); + return 1; + } + + int damage4(){ + tell_room(environment(victim),victimname+" sneezes violently, and then whimpers.", ({victim}) ); + tell_object(victim,"You sneeze violently, and it seems as though your head is composed of pain."); + if(DangerLevel() != 100) victim->eventReceiveDamage(this_object(),DISEASE,random(10)+2,0,"head"); + if(FatigueLevel() > 10) victim->AddStaminaPoints(random(-15)-10); + return 1; + } + + int damage5(){ + tell_room(environment(victim),victimname+" makes a horrible, gurgling, coughing noise and hacks up "+ + "a huge glob of phlegm.", ({victim}) ); + tell_object(victim,"You cough up a huge glob of phlegm, accidentally inhale it, and choke while coughing it "+ + "back up."); + if(DangerLevel() != 100) victim->eventReceiveDamage(this_object(),DISEASE,random(20)+10,0,"head"); + if(FatigueLevel() > 10) victim->AddStaminaPoints(random(-15)-15); + return 1; + } + + + mixed CanGet(object ob) { return "Your fingers slip on your runny snot.";} + mixed CanDrop(object ob) { return "Your fingers slip on your runny snot.";} + diff -c -r --new-file ds1.1/lib/domains/town/obj/cot.c ds2.0r27/lib/domains/town/obj/cot.c *** ds1.1/lib/domains/town/obj/cot.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/cot.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,25 ---- + #include <lib.h> + #include <props.h> + + inherit LIB_BED; + inherit LIB_SMELL; + + + static void create() { + ::create(); + SetKeyName("metal cot"); + SetId( ({ "cot","bed" }) ); + SetAdjectives( ({ "simple","metal" }) ); + SetShort("a simple cot"); + SetLong("This is a simple metal cot designed for " + "sleepers that do not require a comfortable bed."); + SetMass(3000); + SetBaseCost("silver",15); + SetMaxSitters(2); + SetMaxLiers(1); + + } + mixed CanGet(object ob) { return "The cot is bolted to the floor.";} + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/couch.c ds2.0r27/lib/domains/town/obj/couch.c *** ds1.1/lib/domains/town/obj/couch.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/couch.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,26 ---- + #include <lib.h> + #include <props.h> + + inherit LIB_BED; + inherit LIB_SMELL; + + static void create() { + ::create(); + SetKeyName("beat up couch"); + SetId( ({ "couch","sofa","recliner" }) ); + SetAdjectives( ({ "beat up","beat-up","old" }) ); + SetShort("a beat-up old couch"); + SetLong("This is a beat-up, worn and dirty couch, the kind " + "one might expect in a university dorm room."); + SetMass(3000); + SetBaseCost("silver",15); + SetMaxSitters(2); + SetMaxLiers(1); + + + SetSmell( ([ + "default" : "It smells dirty and gross. There's a " + "faint whiff of dog urine." + ]) ); + } + //mixed CanGet(object ob) { return "The toilet does not budge.";} diff -c -r --new-file ds1.1/lib/domains/town/obj/dcell.c ds2.0r27/lib/domains/town/obj/dcell.c *** ds1.1/lib/domains/town/obj/dcell.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/dcell.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,24 ---- + #include <lib.h> + #include <vendor_types.h> + inherit "/lib/battery"; + + void create(){ + ::create(); + SetKeyName("d-cell"); + SetId( ({"cell","battery"}) ); + SetAdjectives( ({"d","generic","D","D-cell"}) ); + SetShort("a D cell battery"); + SetLong("This is a typical D-cell battery, of a generic brand."); + SetMass(2); + SetBaseCost("silver",2); + SetVendorType(VT_TREASURE); + SetPowerType("DC"); + SetCellType("D"); + SetCharge(60); + SetRechargeable(0); + SetDrainable(1); + SetDrainRate(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/dcell_crappy.c ds2.0r27/lib/domains/town/obj/dcell_crappy.c *** ds1.1/lib/domains/town/obj/dcell_crappy.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/dcell_crappy.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + #include <vendor_types.h> + inherit "/lib/battery"; + void create(){ + ::create(); + SetKeyName("d-cell"); + SetId( ({"cell","battery"}) ); + SetAdjectives( ({"d","generic","D","D-cell"}) ); + SetShort("a D cell battery"); + SetLong("This is a typical D-cell battery, of a generic brand."); + SetMass(2); + SetBaseCost("silver",2); + SetVendorType(VT_TREASURE); + SetPowerType("DC"); + SetCellType("D"); + SetCharge(60); + SetRechargeable(0); + SetDrainable(1); + SetDrainRate(1); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/dcell_good.c ds2.0r27/lib/domains/town/obj/dcell_good.c *** ds1.1/lib/domains/town/obj/dcell_good.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/dcell_good.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + #include <vendor_types.h> + inherit "/lib/battery"; + void create(){ + ::create(); + SetKeyName("d-cell"); + SetId( ({"cell","battery"}) ); + SetAdjectives( ({"d","generic","D","D-cell"}) ); + SetShort("a D cell battery"); + SetLong("This is a typical D-cell battery, of a generic brand."); + SetMass(2); + SetBaseCost("silver",2); + SetVendorType(VT_TREASURE); + SetPowerType("DC"); + SetCellType("D"); + SetCharge(10000); + SetRechargeable(0); + SetDrainable(1); + SetDrainRate(1); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/dcell_std.c ds2.0r27/lib/domains/town/obj/dcell_std.c *** ds1.1/lib/domains/town/obj/dcell_std.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/dcell_std.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + #include <vendor_types.h> + inherit "/lib/battery"; + void create(){ + ::create(); + SetKeyName("d-cell"); + SetId( ({"cell","battery"}) ); + SetAdjectives( ({"d","generic","D","D-cell"}) ); + SetShort("a D cell battery"); + SetLong("This is a typical D-cell battery, of a generic brand."); + SetMass(2); + SetBaseCost("silver",2); + SetVendorType(VT_TREASURE); + SetPowerType("DC"); + SetCellType("D"); + SetCharge(1000); + SetRechargeable(0); + SetDrainable(1); + SetDrainRate(1); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/dining_table.c ds2.0r27/lib/domains/town/obj/dining_table.c *** ds1.1/lib/domains/town/obj/dining_table.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/dining_table.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,28 ---- + #include <lib.h> + + inherit LIB_STORAGE; + inherit LIB_CHAIR; + inherit "/lib/comp/surface"; + + + void create() { + ::create(); + SetKeyName("dining table"); + SetId( ({ "table" }) ); + SetAdjectives( ({ "very","long","dining","room","huge" }) ); + SetShort("a very long dining table"); + SetLong("This is a very long dining table, suitable for accommodating a few dozen guests. It is made of fine, polished wood."); + SetMass(274); + SetBaseCost("silver",5000); + SetMaxCarry(5000); + inventory_visible(); + inventory_accessible(); + SetInventory( ([ + "/domains/town/obj/candlestick" : 2 + ]) ); + + } + mixed CanGet(object ob) { return "This table is much too large and heavy to go anywhere with you."; } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/donation_box.c ds2.0r27/lib/domains/town/obj/donation_box.c *** ds1.1/lib/domains/town/obj/donation_box.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/donation_box.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,34 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + inherit LIB_DONATE; + + void create(){ + donate::create(); + item::create(); + SetKeyName("donation box"); + SetId( ({"box","donation box"}) ); + SetAdjectives( ({"small","wood","wooden"}) ); + SetShort("a donation box"); + SetLong("This is a small donation box, made out of wood. "+ + "It is used to donate money, which is then used "+ + "to feed the hungry, clothe the naked, et cetera ad "+ + "nauseam. "); + SetMass(20); + SetBaseCost("silver",10); + SetVendorType(VT_TREASURE); + SetLocalCurrency("silver"); + SetOwner("The Seventh Day Atheist Congregation"); + } + string GetLong(){ + string extra = donate::GetLong(); + string base = item::GetLong(); + return base+extra; + } + void init(){ + ::init(); + } + + mixed CanGet(){ + return "This is for the needy, you scum! Earn your keep!"; + } diff -c -r --new-file ds1.1/lib/domains/town/obj/ebutton1.c ds2.0r27/lib/domains/town/obj/ebutton1.c *** ds1.1/lib/domains/town/obj/ebutton1.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/ebutton1.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,25 ---- + #include <lib.h> + + inherit LIB_DUMMY; // These do not show up in desc, but you can look at them + inherit LIB_PRESS; // Makes the item pressable + + int openDoor(object who) { + object car; + send_messages("press", "$agent_name $agent_verb the button.", + who, 0, environment(who)); + car=load_object("/domains/town/room/elevator"); + car->SetDoor(1); + car->CallMe(1); + + } + + static void create() { + dummy::create(); + SetKeyName("button"); + SetId(({"button","one","first","1" })); + SetAdjectives("elevator","button","one","first","1"); + SetShort("a button"); + SetLong("It is a button that you could probably press. The numeral \"1\" " + "is printed on it."); + SetPress((: openDoor :)); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/ebutton2.c ds2.0r27/lib/domains/town/obj/ebutton2.c *** ds1.1/lib/domains/town/obj/ebutton2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/ebutton2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,25 ---- + #include <lib.h> + + inherit LIB_DUMMY; // These do not show up in desc, but you can look at them + inherit LIB_PRESS; // Makes the item pressable + + int openDoor(object who) { + object car; + send_messages("press", "$agent_name $agent_verb the second button.", + who, 0, environment(who)); + car=load_object("/domains/town/room/elevator"); + car->SetDoor(1); + car->CallMe(2); + + } + + static void create() { + dummy::create(); + SetKeyName("button"); + SetId(({"button","two","second","B" })); + SetAdjectives("elevator","button","basement","second","B"); + SetShort("a button"); + SetLong("It is a button that you could probably press. The letter \"B\" " + "is printed on it."); + SetPress((: openDoor :)); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/fleas.c ds2.0r27/lib/domains/town/obj/fleas.c *** ds1.1/lib/domains/town/obj/fleas.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/fleas.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,117 ---- + #include <lib.h> + #include <vendor_types.h> + #include <damage_types.h> + inherit LIB_GERM; + int damage1(); + int damage2(); + int damage3(); + int damage4(); + int damage5(); + int DangerLevel(); + object victim,where; + string victimname; + + + int InfectMess(object ob){ + victim=ob; + victimname=victim->GetName(); + tell_room(environment(victim), victimname+" looks suprised and grossed out.",({victim}) ); + tell_object(victim, "You are suprised and disgusted to realize that fleas are crawling around on you."); + return 1; + } + + void create(){ + germ::create(); + SetKeyName("tf1"); + SetId(({"tf2"})); + SetLong("fleas version 1"); + SetCure(20); + SetVendorType(VT_TREASURE); + SetCommunicable(50); + SetLifeSpan(99999999); + SetType("parasite"); + SetInfect((: InfectMess :)); + } + + void bonuses(){ + if(victim && environment(this_object()) == victim){ + victim->AddStatBonus("intelligence", -15); + victim->AddStatBonus("strength", -25); + victim->AddStatBonus("charisma", -45); + victim->AddStatBonus("durability", -25); + victim->AddStatBonus("agility", -25); + victim->AddStatBonus("coordination", -15); + victim->AddStatBonus("speed", -15); + victim->AddStatBonus("wisdom", -2); + } + else if(victim) { + foreach( string stat in ({"intelligence", "strength", + "charisma", "durability", "agility", "coordination", "speed", "wisdom"})){ + victim->RemoveStatBonus(stat); + } + } + return; + } + + + void init(){ + germ::init(); + bonuses(); + } + + + int eventSuffer(){ + int x; + x=random(500); + if(x < 5) damage1(); + else if(x < 10) damage2(); + else if(x < 15) damage3(); + else if(x < 20) damage4(); + return 1; + } + + int DangerLevel(){ + if(victim->GetHealthPoints() < 20) return 100; + return 1; + } + + int FatigueLevel() { + if(victim->GetStaminaPoints() < 11) return 10; + return 11; + } + + string GetAffectLong(object ob) { + if(!ob || !living(ob)) return 0; + return ob->GetName() + " looks uncomfortable and disheveled."; + } + + int damage1(){ + tell_object(victim,"You feel really itchy all over."); + tell_room(environment(victim),victimname+" looks uncomfortable.", ({victim}) ); + return 1; + } + + int damage2(){ + tell_object(victim,"You involuntarily start scratching at the maddening itch."); + tell_room(environment(victim),victimname+" scratches desperately at "+reflexive(victim)+".", ({victim}) ); + return 1; + } + + int damage3(){ + tell_room(environment(victim),victimname+" scratches at "+reflexive(victim)+" in a frenzy, ripping "+ + possessive(victim)+" flesh and drawing blood.", ({victim}) ); + tell_object(victim,"You scratch at yourself in a mad frenzy, ripping flesh and drawing blood."); + if(DangerLevel() != 100) victim->eventReceiveDamage(this_object(),DISEASE,random(5)+4,0,"torso"); + return 1; + } + + int damage4(){ + tell_room(environment(victim),victimname+" looks disgusted.", ({victim}) ); + tell_object(victim,"You are disgusted as you feel fleas crawling on your body."); + return 1; + } + + + mixed CanGet(object ob) { return "You just cant get rid of these parasites.";} + mixed CanDrop(object ob) { return "You just cant get rid of these parasites.";} + diff -c -r --new-file ds1.1/lib/domains/town/obj/flu.c ds2.0r27/lib/domains/town/obj/flu.c *** ds1.1/lib/domains/town/obj/flu.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/flu.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,146 ---- + #include <lib.h> + #include <rooms.h> + #include <vendor_types.h> + #include <damage_types.h> + inherit LIB_GERM; + int damage1(); + int damage2(); + int damage3(); + int damage4(); + int damage5(); + int DangerLevel(); + object victim,where; + string victimname; + + int InfectMess(object ob){ + victim=ob; + victimname=victim->GetName(); + tell_room(environment(victim), victimname+" looks weak and woozy.",({victim}) ); + tell_object(victim, "You feel weak and dizzy."); + return 1; + } + + void create(){ + germ::create(); + SetKeyName("tf2"); + SetGermName("flu virus"); + SetId(({"tf2"})); + SetLong("Test Flu version 2"); + SetCure(20); + SetCommunicable(15); + SetLifeSpan(900000); + SetType("viral"); + SetInfect((: InfectMess :)); + } + + void bonuses(){ + if(victim && environment(this_object()) == victim){ + victim->AddStatBonus("intelligence", -15); + victim->AddStatBonus("strength", -25); + victim->AddStatBonus("charisma", -45); + victim->AddStatBonus("durability", -25); + victim->AddStatBonus("agility", -25); + victim->AddStatBonus("coordination", -15); + victim->AddStatBonus("speed", -15); + victim->AddStatBonus("wisdom", -2); + } + else if(victim) { + foreach( string stat in ({"intelligence", "strength", + "charisma", "durability", "agility", "coordination", "speed", "wisdom"})){ + victim->RemoveStatBonus(stat); + } + } + return; + } + + void init(){ + germ::init(); + bonuses(); + } + + int eventDestruct(){ + this_object()->eventMove(ROOM_FURNACE); + return ::eventDestruct(); + } + + int eventMove(mixed dest){ + ::eventMove(dest); + bonuses(); + } + + int eventSuffer(){ + int x; + x=random(500); + if(x < 2) environment()->eventForce("sneeze"); + else if(x < 5) damage1(); + else if(x < 10) damage2(); + else if(x < 15) damage3(); + else if(x < 20) damage4(); + else if(x > 98) damage5(); + return 1; + } + + int DangerLevel(){ + if(victim->GetHealthPoints() < 50) return 100; + return 1; + } + + int FatigueLevel() { + if(victim->GetStaminaPoints() < 11) return 10; + return 11; + } + + string GetAffectLong(object ob) { + if(!ob || !living(ob)) return 0; + return ob->GetName() + " is disheveled.\n"+ob->GetName()+" looks very ill and disoriented."; + } + + int damage1(){ + tell_object(victim,"You feel weak and ill."); + tell_room(environment(victim),victimname+" looks pale and ill.", ({victim}) ); + if(FatigueLevel() > 10) victim->AddStaminaPoints(random(-15)-15); + return 1; + } + + int damage2(){ + tell_object(victim,"You are racked by a fit of gruesome-sounding, hacking coughs."); + tell_room(environment(victim),victimname+" is racked by a fit of gruesome-sounding, hacking coughs.", ({victim}) ); + if(DangerLevel() != 100) victim->eventReceiveDamage(this_object(),DISEASE,random(20)+10,0,"torso"); + if(FatigueLevel() > 10) victim->AddStaminaPoints(random(-10)-5); + return 1; + } + + int damage3(){ + tell_room(environment(victim),victimname+" lets out a groan of discomfort.", ({victim}) ); + tell_object(victim,"You let out a groan of discomfort as a wave of weakness hits you."); + if(FatigueLevel() > 10) victim->AddStaminaPoints(random(-10)-10); + return 1; + } + + int damage4(){ + tell_room(environment(victim),victimname+" gags violently, then chokes out a thick rope of vomit onto the ground.", ({victim}) ); + tell_object(victim,"You gag violently, then choke out a thick rope of vomit onto the ground."); + if(DangerLevel() != 100) victim->eventReceiveDamage(this_object(),DISEASE,random(30)+15,0,"head"); + if(FatigueLevel() > 10) victim->AddStaminaPoints(random(-25)-20); + return 1; + } + + int damage5(){ + if(this_player()->GetPosition() != 1){ + tell_room(environment(victim),victimname+" makes a horrendous flatulent noise and falls helplessly to the floor, soiling "+objective(victim)+"self.", ({victim}) ); + tell_object(victim,"You make a horrendous flatulent noise and fall helplessly to the floor, soiling yourself."); + victim->SetPosition(1); + } + if(this_player()->GetPosition() == 1){ + tell_room(environment(victim),victimname+" makes a horrendous flatulent noise as "+nominative(this_player())+" lies helplessly on the ground."); + tell_object(victim,"You make a horrendous flatulent noise as you lie helplessly on the ground."); + } + if(DangerLevel() != 100) victim->eventReceiveDamage(this_object(),DISEASE,random(40)+20,0,"head"); + if(FatigueLevel() > 10) victim->AddStaminaPoints(random(-35)-25); + return 1; + } + + + mixed CanGet(object ob) { return "Your fingers slip on your runny snot.";} + mixed CanDrop(object ob) { return "Your fingers slip on your runny snot.";} + diff -c -r --new-file ds1.1/lib/domains/town/obj/gbed.c ds2.0r27/lib/domains/town/obj/gbed.c *** ds1.1/lib/domains/town/obj/gbed.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/gbed.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + #include <props.h> + + inherit LIB_BED; + inherit LIB_SMELL; + + + static void create() { + ::create(); + SetKeyName("guest bed"); + SetId( ({ "bed" }) ); + SetAdjectives( ({ "guest" }) ); + SetShort("a guest bed"); + SetLong("This is a comfortable-looking bed for guests to sleep on."); + SetMass(4000); + SetBaseCost("silver",800); + SetMaxSitters(2); + SetMaxLiers(1); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/gcoinbag.c ds2.0r27/lib/domains/town/obj/gcoinbag.c *** ds1.1/lib/domains/town/obj/gcoinbag.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/gcoinbag.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,28 ---- + #include <lib.h> + + inherit LIB_STORAGE; + + + void create() { + ::create(); + SetKeyName("bag"); + SetId( ({ "bag" }) ); + SetAdjectives( ({ "small", "cloth", "a" }) ); + SetShort("a small cloth bag"); + SetLong("It is a simple cloth bag used to hold things. "); + SetMass(274); + SetBaseCost("silver",1); + SetMaxCarry(50); + //AddMoney("gold",5); + SetMoney( ([ + "gold" : 5, + "silver" : 15, + "copper" : 10, + "electrum" : 100, + "platinum" : 1, + "silver" : 20, + ]) ); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/key.c ds2.0r27/lib/domains/town/obj/key.c *** ds1.1/lib/domains/town/obj/key.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/key.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,16 ---- + #include <lib.h> + + inherit LIB_ITEM; + + static void create() { + item::create(); + SetKeyName("key"); + SetId( ({ "key", "mansion key" }) ); + SetAdjectives( ({ "brilliant", "silver" }) ); + SetShort("a silver key"); + SetLong("It is a brilliant silver key with no markings."); + SetMass(50); + SetBaseCost("silver",1); + SetDisableChance(100); + } + diff -c -r --new-file ds1.1/lib/domains/town/obj/ladder.c ds2.0r27/lib/domains/town/obj/ladder.c *** ds1.1/lib/domains/town/obj/ladder.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/ladder.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,30 ---- + #include <lib.h> + #include <climb.h> // defines CLIMB_DOWN + + //inherit LIB_DUMMY; // These do not show up in desc, but you can look at them + inherit LIB_ITEM; + inherit LIB_CLIMB; // This makes it climbable + + + int LadderClimb(){ + if(base_name(environment()) == "/domains/town/room/mansion_ext"){ + write("You climb up the ladder and into the mansion through the second-story window."); + eventClimb(this_player(),CLIMB_UP,"/domains/town/room/mansion_uhall1"); + return 1; + } + write("This ladder seems made specifically for one place, and it looks like this isn't it."); + return 0; + } + static void create() { + ::create(); + SetKeyName("ladder"); + SetId("ladder"); + SetAdjectives(({"short","wood","wooden"})); + SetShort("a ladder"); + SetLong("This is a standard wooden ladder, suitable for climbing."); + SetClimb( (: LadderClimb :) , CLIMB_UP); + SetCanClimbCarried(0); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/ladder_simple.c ds2.0r27/lib/domains/town/obj/ladder_simple.c *** ds1.1/lib/domains/town/obj/ladder_simple.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/ladder_simple.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,14 ---- + #include <lib.h> + #include <climb.h> // defines CLIMB_DOWN + + inherit LIB_ITEM; + inherit LIB_CLIMB; + + static void create() { + ::create(); + SetKeyName("ladder"); + SetId("ladder"); + SetAdjectives(({"short","wood","wooden"})); + SetShort("a ladder"); + SetLong("This is a standard wooden ladder, suitable for climbing."); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/leaflet.c ds2.0r27/lib/domains/town/obj/leaflet.c *** ds1.1/lib/domains/town/obj/leaflet.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/leaflet.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,29 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + inherit LIB_READ; + + int TestFunc(object ob,string str){ + if(ob) ob->eventPrint("if you are seeing this, you may be ob."); + this_player()->eventPrint("wtf"); + if(str && str !="") write(str); + if(!str) write("Null string found."); + if(str =="") write("Empty string found."); + write("WTF"); + return 1; + } + + + void create(){ + ::create(); + SetKeyName("leaflet"); + SetId(({"leaflet","paper","slip"})); + SetAdjectives(({"small"})); + SetShort("a small leaflet"); + SetLong("This is a single sheet of paper with a message printed on it. "); + SetMass(0); + SetDollarCost(0); + SetVendorType(VT_TREASURE); + SetRead((: TestFunc :)); + } + diff -c -r --new-file ds1.1/lib/domains/town/obj/lice.c ds2.0r27/lib/domains/town/obj/lice.c *** ds1.1/lib/domains/town/obj/lice.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/lice.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,113 ---- + #include <lib.h> + #include <vendor_types.h> + #include <damage_types.h> + inherit LIB_GERM; + int damage1(); + int damage2(); + int damage3(); + int damage4(); + int damage5(); + int DangerLevel(); + object victim,where; + string victimname; + + int InfectMess(object ob){ + victim=ob; + victimname=victim->GetName(); + tell_room(environment(victim), victimname+" looks suprised and grossed out.",({victim}) ); + tell_object(victim, "You are suprised and disgusted to realize that lice are crawling around on you."); + return 1; + } + + void create(){ + germ::create(); + SetKeyName("tf1"); + SetId(({"tf2"})); + SetLong("lice version 1"); + SetCure(20); + SetVendorType(VT_TREASURE); + SetCommunicable(50); + SetLifeSpan(99999); + SetType("parasite"); + SetInfect((: InfectMess :)); + } + + void bonuses(){ + if(victim && environment(this_object()) == victim){ + victim->AddStatBonus("intelligence", -15); + victim->AddStatBonus("strength", -25); + victim->AddStatBonus("charisma", -45); + victim->AddStatBonus("durability", -25); + victim->AddStatBonus("agility", -25); + victim->AddStatBonus("coordination", -15); + victim->AddStatBonus("speed", -15); + victim->AddStatBonus("wisdom", -2); + } + else if(victim) { + foreach( string stat in ({"intelligence", "strength", + "charisma", "durability", "agility", "coordination", "speed", "wisdom"})){ + victim->RemoveStatBonus(stat); + } + } + return; + } + + + void init(){ + germ::init(); + bonuses(); + } + + int eventSuffer(){ + int x; + x=random(500); + if(x < 5) damage1(); + else if(x < 10) damage2(); + else if(x < 15) damage3(); + else if(x < 20) damage4(); + return 1; + } + + int DangerLevel(){ + if(victim->GetHealthPoints() < 20) return 100; + return 1; + } + + int FatigueLevel() { + if(victim->GetStaminaPoints() < 11) return 10; + return 11; + } + + string GetAffectLong(object ob) { + if(!ob || !living(ob)) return 0; + return ob->GetName() + " looks uncomfortable and disheveled."; + } + + int damage1(){ + tell_object(victim,"You feel really itchy all over."); + tell_room(environment(victim),victimname+" looks uncomfortable.", ({victim}) ); + return 1; + } + + int damage2(){ + tell_object(victim,"You involuntarily start scratching at the maddening itch."); + tell_room(environment(victim),victimname+" scratches desperately at "+reflexive(victim)+".", ({victim}) ); + return 1; + } + + int damage3(){ + tell_room(environment(victim),victimname+" scratches at "+reflexive(victim)+" in a frenzy, ripping "+ + possessive(victim)+" flesh and drawing blood.", ({victim}) ); + tell_object(victim,"You scratch at yourself in a mad frenzy, ripping flesh and drawing blood."); + if(DangerLevel() != 100) victim->eventReceiveDamage(this_object(),DISEASE,random(5)+4,0,"torso"); + return 1; + } + + int damage4(){ + tell_room(environment(victim),victimname+" looks disgusted.", ({victim}) ); + tell_object(victim,"You are disgusted as you feel lice crawling on your body."); + return 1; + } + + mixed CanGet(object ob) { return "You just cant get rid of these parasites.";} + mixed CanDrop(object ob) { return "You just cant get rid of these parasites.";} diff -c -r --new-file ds1.1/lib/domains/town/obj/m_key.c ds2.0r27/lib/domains/town/obj/m_key.c *** ds1.1/lib/domains/town/obj/m_key.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/m_key.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_ITEM; + + + static void create() { + item::create(); + SetKeyName("key"); + SetId( ({ "key", "mansion key" }) ); + SetAdjectives( ({ "brilliant", "silver" }) ); + SetShort("a silver key"); + SetLong("It is a brilliant silver key with no markings."); + SetMass(50); + SetBaseCost("silver",1); + SetDisableChance(5); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/maglite.c ds2.0r27/lib/domains/town/obj/maglite.c *** ds1.1/lib/domains/town/obj/maglite.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/maglite.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,29 ---- + #include <lib.h> + #include <vendor_types.h> + inherit "/lib/flashlight"; + + + void create(){ + ::create(); + SetKeyName("maglite"); + SetId( ({"fl","flashlight","light","flashlite","Maglite"}) ); + SetAdjectives( ({"powerful","heavy","large","Maglite"}) ); + SetShort( "a large flashlight" ); + SetLong("This is a powerful, heavy, Maglite brand flashlight."); + SetMass(20); + SetBaseCost("silver",40); + SetLightLevel(20); + SetMinCells(4); + SetMaxCells(4); + SetCellType("D"); + Lit=0; + SetVendorType(VT_TREASURE); + + SetInventory(([ + "/domains/town/obj/dcell_good":4 + ])); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/map.c ds2.0r27/lib/domains/town/obj/map.c *** ds1.1/lib/domains/town/obj/map.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/map.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,25 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + inherit LIB_READ; + + + int ReadFunc(){ + this_player()->eventPage("/domains/town/txt/map.txt","system"); + return 1; + } + void create(){ + ::create(); + SetKeyName("town map"); + SetId(({"map","map of the town"})); + SetAdjectives(({"small"})); + SetShort("a small map of the town"); + SetLong("A map of the town. Try: read map \n"); + SetMass(0); + SetDollarCost(0); + SetVendorType(VT_TREASURE); + SetRead((: ReadFunc :)); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/mat.c ds2.0r27/lib/domains/town/obj/mat.c *** ds1.1/lib/domains/town/obj/mat.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/mat.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + + void create(){ + ::create(); + SetKeyName("bath mat"); + SetId( ({"mat"}) ); + SetAdjectives( ({"slightly damp","damp","blue","light blue"}) ); + SetShort("a bath mat"); + SetLong("This is a mat used to help prevent slipping, promote " + "foot drying, and avoid a big wet mess on " + "the bathroom floor. It is slightly damp."); + SetMass(10); + SetBaseCost("silver",5); + SetVendorType(VT_TREASURE); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/match.c ds2.0r27/lib/domains/town/obj/match.c *** ds1.1/lib/domains/town/obj/match.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/match.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,22 ---- + #include <lib.h> + + inherit LIB_MATCH; + + static void create() { + match::create(); + SetKeyName("match"); + SetId("match"); + SetAdjectives( ({ "wooden" }) ); + SetShort("a wooden match"); + SetLong("A wooden match that might light if you strike it."); + SetRadiantLight(2); + SetStrikeChance(50); + SetMinHeat(10); + SetFuelRequired(1); + SetMaxFuel(10); + SetFuelAmount(10); + SetRefuelable(0); + SetMass(5); + SetBaseCost("silver",2); + SetBurntValue(1); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/medbag.c ds2.0r27/lib/domains/town/obj/medbag.c *** ds1.1/lib/domains/town/obj/medbag.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/medbag.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,16 ---- + #include <lib.h> + + inherit LIB_STORAGE; + + void create() { + ::create(); + SetKeyName("bag"); + SetId( ({ "medical bag" }) ); + SetAdjectives( ({ "small", "cloth", "a" }) ); + SetShort("a small cloth bag"); + SetLong("It is a simple cloth bag used to hold things. Printed on it is: " + "\"Property of A.S. Clepius\""); + SetMass(274); + SetBaseCost("silver",1); + SetMaxCarry(500); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/obag.c ds2.0r27/lib/domains/town/obj/obag.c *** ds1.1/lib/domains/town/obj/obag.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/obag.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,32 ---- + #include <lib.h> + + #include <armor_types.h> + #include <damage_types.h> + inherit "/lib/std/storage"; + + + static void create() { + ::create(); + SetKeyName("overnight"); + SetId(({"bag"})); + SetAdjectives(({"overnight","canvas"})); + SetShort("an overnight bag"); + SetLong("This is a medium-sized bag made of soft " + "canvas, made for holding useful items."); + SetMass(100); + SetBaseCost("silver",30); + SetCanClose(1); + SetClosed(1); + SetMaxCarry(450); + SetInventory(([ + "/domains/town/armor/jacket" : 1, + "/domains/town/armor/pants" : 1, + "/domains/town/armor/mhelmet" : 1, + "/domains/town/armor/glove_l" : 1, + "/domains/town/armor/glove_r" : 1, + "/domains/town/armor/tshirt" : 1, + ]) ); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/omni.c ds2.0r27/lib/domains/town/obj/omni.c *** ds1.1/lib/domains/town/obj/omni.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/omni.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,60 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + inherit LIB_PRESS; + int check_environs(); + int vanish_count; + static void create() { + item::create(); + SetKeyName("omni"); + SetId(({"omni","Omni","device"})); + SetShort("an omni"); + SetLong("This is a small, round metal device, copper in color, "+ + "and similar in appearance to a pocket watch. There is a blinking red light "+ + "next to the tiny metal button at its top."); + SetMass(10); + SetBaseCost("silver",300); + AddItem("button", "A button on the omni."); + SetVendorType(VT_MAGIC); + } + + void init() { + vanish_count=7200; + check_environs(); + } + mixed CanPress(object who, string target) { + if(!present(this_object()->GetKeyName(),who ) && target == "button"){ + return "You do not have the Omni!"; + } + if(this_object()->GetId() == target){ + return "You cannot push that."; + } + return 1; + } + mixed eventPress(object who, string target) { + say(this_player()->GetName()+" turns multicolored and disappears.\n"); + write("You feel momentarily disoriented and find yourself back in the tavern.\n"); + this_player()->eventMoveLiving("/domains/town/room/tavern"); + return 1; + } + void heart_beat(){ + vanish_count--; + if(vanish_count < 0){ + tell_object(environment(),"The omni glows brightly and disappears!"); + this_object()->eventDestruct(); + } + if(vanish_count == 50){ + tell_object(environment(),"The omni begins to glow a dull red."); + this_object()->SetLong("This is a small, round metal device, copper in color, "+ + "and similar in appearance to a pocket watch. There is a blinking red light "+ + "next to the tiny metal button at its top. It is glowing a dull red."); + this_object()->SetShort("an omni (glowing)"); + } + } + int check_environs(){ + if( interactive(environment()) ){ + set_heart_beat(1); + return 1; + } + return 1; + } diff -c -r --new-file ds1.1/lib/domains/town/obj/pack.c ds2.0r27/lib/domains/town/obj/pack.c *** ds1.1/lib/domains/town/obj/pack.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/pack.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,27 ---- + #include <lib.h> + + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_STORAGE; + inherit LIB_ARMOR; + + static void create() { + ::create(); + SetKeyName("backpack"); + SetId(({"pack"})); + SetAdjectives(({"leather","soft","brown"})); + SetShort("a soft, brown leather backpack"); + SetLong("This is a medium-sized backpack made of soft brown leather. "+ + "It seems suitable for carrying books around, for the busy college student. "+ + "It features wide, comfortable straps for convenient wear."); + SetMass(100); + SetBaseCost("silver",30); + SetCanClose(1); + SetClosed(1); + SetMaxCarry(500); + SetDamagePoints(100); + SetArmorType(A_CLOAK); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/painting.c ds2.0r27/lib/domains/town/obj/painting.c *** ds1.1/lib/domains/town/obj/painting.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/painting.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,17 ---- + #include <lib.h> + inherit LIB_ITEM; + inherit LIB_PRESS; + inherit LIB_MANIPULATE; + + static void create() { + item::create(); + SetKeyName("painting in the room"); + SetId("painting"); + SetAdjectives("beautiful"); + //SetShort("a beautiful painting is on the wall"); + SetLong("Try: look at painting on the wall"); + SetNoCondition(1); + SetPress( ([ "default" : "Try: push painting on wall" ]) ); + SetManipulate( ([ "default" : "Try: move painting on wall" ]) ); + } + mixed CanGet(object ob) { return "Try: get painting on the wall"; } diff -c -r --new-file ds1.1/lib/domains/town/obj/pipe.c ds2.0r27/lib/domains/town/obj/pipe.c *** ds1.1/lib/domains/town/obj/pipe.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/pipe.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,40 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + inherit LIB_BURN; + + void create(){ + item::create(); + burn::create(); + SetKeyName("magic pipe"); + SetId( ({"pipe","smoking pipe","magical pipe","pipe of insight"}) ); + SetAdjectives( ({"magic","magical","khadgar's"}) ); + SetShort("a smoking pipe"); + SetLong("This is a handsome pipe for smoking, made of ivory."); + SetMass(20); + SetBaseCost("silver",10); + SetVendorType(VT_TREASURE); + SetRadiantLight(7); + SetFuelRequired(1); + SetMaxFuel(100); + SetFuelAmount(100); + SetRefuelable(1); + } + + int GetRadiantLight(int ambient) { + if( !GetLit() ) return 0; + else return item::GetRadiantLight(ambient); + } + + string GetShort() { + return item::GetShort() + burn::GetShort(); + } + + varargs string GetLong(string unused) { + string tmp; + + tmp = burn::GetLong(unused); + if( tmp != "" ) return item::GetLong(unused) + "\n" + tmp; + else return item::GetLong(unused); + } + diff -c -r --new-file ds1.1/lib/domains/town/obj/plastic_bag.c ds2.0r27/lib/domains/town/obj/plastic_bag.c *** ds1.1/lib/domains/town/obj/plastic_bag.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/plastic_bag.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,16 ---- + #include <lib.h> + + inherit LIB_STORAGE; + + void create() { + ::create(); + SetKeyName("bag"); + SetId( ({ "bag" }) ); + SetAdjectives( ({ "small", "plastic", "a" }) ); + SetShort("a small plastic bag"); + SetLong("It is a simple plastic bag used to hold things. "); + SetMass(274); + SetBaseCost("silver",1); + SetMaxCarry(50); + SetOpacity(0); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/pole.c ds2.0r27/lib/domains/town/obj/pole.c *** ds1.1/lib/domains/town/obj/pole.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/pole.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,30 ---- + /* /domains/Ylsrim/etc/pole.c + * from the Dead Souls V Object Library + * created by Descartes of Borg 951009 + */ + + #include <lib.h> + #include <vendor_types.h> + + inherit LIB_POLE; + inherit LIB_ITEM; + + static void create() { + pole::create(); + item::create(); + SetKeyName("bamboo pole"); + SetId( ({ "pole", "bamboo pole", "fishing pole" }) ); + SetAdjectives( ({ "bamboo", "feeble" }) ); + SetShort("a bamboo pole"); + SetLong("It is a feeble bamboo stick with a string at the end of it."); + SetClass(1); + SetValue(10); + SetMass(30); + SetVendorType(VT_TREASURE | VT_FISHING); + SetStrength(200); + SetChance(20); + } + + static mixed AddSave(mixed *var) { + return item::AddSave(var); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/pool_ball.c ds2.0r27/lib/domains/town/obj/pool_ball.c *** ds1.1/lib/domains/town/obj/pool_ball.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/pool_ball.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + + void create(){ + ::create(); + SetKeyName("billiards ball"); + SetId( ({"ball"}) ); + SetAdjectives( ({"pool","billiards","billiard","heavy"}) ); + SetShort("a billiards ball"); + SetLong("This is a heavy ball, slighly smaller than palm-sized, " + "used in the game of billiards."); + SetMass(100); + SetBaseCost("silver",10); + SetVendorType(VT_TREASURE); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/pool_table.c ds2.0r27/lib/domains/town/obj/pool_table.c *** ds1.1/lib/domains/town/obj/pool_table.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/pool_table.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,27 ---- + #include <lib.h> + + inherit LIB_STORAGE; + inherit LIB_CHAIR; + inherit "/lib/comp/surface"; + + + void create() { + ::create(); + SetKeyName("pool table"); + SetId( ({ "table" ,"billiards table"}) ); + SetAdjectives( ({ "billiard", "wood","wooden", "pool", "billiards" "large" }) ); + SetShort("a billiards table"); + SetLong("It is a large table made of dark, heavy wood. Its surface is covered in green felt and there are six holes in the corners and sides, through which balls may fit."); + SetMass(10000); + SetBaseCost("silver",1200); + SetMaxCarry(5000); + inventory_visible(); + inventory_accessible(); + SetInventory( ([ + "/domains/town/weap/cue" : 2, + "/domains/town/obj/pool_ball" : 16, + ]) ); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/rack.c ds2.0r27/lib/domains/town/obj/rack.c *** ds1.1/lib/domains/town/obj/rack.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/rack.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,35 ---- + #include <lib.h> + + inherit LIB_STORAGE; + object to; + + + void create() { + ::create(); + SetKeyName("rack"); + SetId(({"rack"})); + SetAdjectives(({"knife","metal","fancy","steel","stainless","stainless-steel"})); + SetShort("a knife rack"); + SetLong("This is a fancy stainless steel knife rack, "+ + "for keeping expensive super-sharp knives in."); + SetMass(274); + SetBaseCost("silver",50); + SetMaxCarry(5); + SetInventory(([ + "/domains/town/weap/paring_knife" : 1, + "/domains/town/weap/butcher_knife" : 1, + "/domains/town/weap/carving_knife" : 1, + ])); + SetCanClose(0); + } + mixed CanGet(object ob) { return "The rack does not budge.";} + int CanReceive(object ob) { + if(!ob->GetFancy()) { + write("This is a rack for fine, expensive kitchen knives only."); + return 0; + } + else return 1; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/rage.c ds2.0r27/lib/domains/town/obj/rage.c *** ds1.1/lib/domains/town/obj/rage.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/rage.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,196 ---- + #include <lib.h> + #include <rooms.h> + #include <vendor_types.h> + #include <damage_types.h> + inherit LIB_GERM; + int damage1(); + int damage2(); + int damage3(); + int damage4(); + int damage5(); + int DangerLevel(); + object global_ob,victim,where; + string victimname; + + int MakeHostile(object ob){ + object *meat = get_livings(environment(ob)); + global_ob = ob; + meat = filter(meat, (: !(base_name($1) == base_name(global_ob)) :)); + meat = filter(meat, (: !($1->GetInvis()) :)); + foreach(object new_meat in meat){ + ob->AddEnemy(new_meat); + } + return 1; + } + + int InfectMess(object ob){ + victim=ob; + victimname=victim->GetName(); + if(interactive(victim)) { + eventDestruct(); + return 1; + } + tell_room(environment(victim), "%^BOLD%^RED%^"+victimname+" suddenly lets out a bloodcurdling scream!%^RESET%^",({victim}) ); + tell_object(victim, "%^BOLD%^RED%^You scream as you are suddenly possessed by an uncontrollable rage!%^RESET%^"); + if(!interactive(ob)) { + ob->SetEncounter(100); + ob->SetMelee(1); + if(ob->GetRace() != "human" && ob->GetRace() != "orc") MakeHostile(ob); + } + return 1; + } + + void create(){ + germ::create(); + SetKeyName("rage virus"); + SetGermName("rage virus"); + SetId(({"rv2"})); + SetLong("Rage Virus v2"); + SetCure(20); + SetCommunicable(50); + SetLifeSpan(-1); + SetType("viral"); + SetInfect((: InfectMess :)); + } + + void bonuses(){ + if(victim && environment(this_object()) == victim){ + victim->AddStatBonus("intelligence", -25); + victim->AddStatBonus("strength", 35); + victim->AddStatBonus("charisma", -35); + victim->AddStatBonus("durability", 35); + victim->AddStatBonus("agility", 35); + victim->AddStatBonus("coordination", 35); + victim->AddStatBonus("speed", 35); + victim->AddStatBonus("wisdom", -25); + } + else if(victim) { + foreach( string stat in ({"intelligence", "strength", + "charisma", "durability", "agility", "coordination", "speed", "wisdom"})){ + victim->RemoveStatBonus(stat); + } + } + return; + } + + + void init(){ + germ::init(); + bonuses(); + } + + int eventDestruct(){ + this_object()->eventMove(ROOM_FURNACE); + return ::eventDestruct(); + } + + int eventMove(mixed dest){ + ::eventMove(dest); + bonuses(); + } + + int eventSuffer(){ + int x; + x=random(50); + if(x < 5) damage1(); + else if(x < 10) damage2(); + else if(x < 15) damage3(); + else if(x < 20) damage4(); + else if(x < 2) damage5(); + return 1; + } + + int DangerLevel(){ + if(victim->GetHealthPoints() < 2) return 100; + return 1; + } + + int FatigueLevel() { + if(victim->GetStaminaPoints() < 11) return 10; + return 11; + } + + string GetAffectLong(object ob) { + if(!ob || !living(ob)) return 0; + return "%^BOLD%^RED%^"+ob->GetName() + " looks crazed and violently insane!%^RESET%^"; + } + + int damage1(){ + tell_object(victim,"%^BOLD%^RED%^You feel blinded by hatred and madness!%^RESET%^"); + tell_room(environment(victim),victimname+" looks maniacally insane and drools uncontrollably.", ({victim}) ); + victim->AddStaminaPoints(random(50)+10); + victim->AddStatBonus("strength", 10); + victim->AddStatBonus("durability", 10); + victim->AddStatBonus("agility", 10); + victim->AddStatBonus("coordination", 10); + victim->AddStatBonus("speed", 10); + MakeHostile(victim); + return 1; + } + + int damage2(){ + tell_object(victim,"%^BOLD%^RED%^You feel your body exploding with rage!%^RESET%^"); + tell_room(environment(victim),victimname+" is shaking with fury.", ({victim}) ); + victim->eventReceiveDamage(this_object(),DISEASE,random(50)+20,0,"torso"); + victim->AddStaminaPoints(random(50)+20); + victim->AddStatBonus("strength", 20); + victim->AddStatBonus("durability", 20); + victim->AddStatBonus("agility", 20); + victim->AddStatBonus("coordination", 20); + victim->AddStatBonus("speed", 20); + MakeHostile(victim); + return 1; + } + + int damage3(){ + tell_room(environment(victim),victimname+" lets out a horrific roar!", ({victim}) ); + tell_object(victim,"%^BOLD%^RED%^You let out a horrific roar as a spasm of fury rips through you!%^RESET%^"); + victim->eventReceiveDamage(this_object(),DISEASE,random(60)+30,0,"torso"); + victim->AddStaminaPoints(random(60)+30); + victim->AddStatBonus("strength", 30); + victim->AddStatBonus("durability", 30); + victim->AddStatBonus("agility", 30); + victim->AddStatBonus("coordination", 30); + victim->AddStatBonus("speed", 30); + MakeHostile(victim); + return 1; + } + + int damage4(){ + tell_room(environment(victim),victimname+"'s entire body vibrates madly, throwing off hot blood drops, sweat, and saliva.", ({victim}) ); + tell_object(victim,"%^BOLD%^RED%^Your entire body vibrates uncontrollably, spraying blood, sweat, and spit everywhere.%^RESET%^"); + victim->eventReceiveDamage(this_object(),DISEASE,random(70)+40,0,"torso"); + victim->AddStaminaPoints(random(70)+40); + victim->AddStatBonus("strength", 40); + victim->AddStatBonus("durability", 40); + victim->AddStatBonus("agility", 40); + victim->AddStatBonus("coordination", 40); + victim->AddStatBonus("speed", 40); + MakeHostile(victim); + foreach(object bystander in get_livings(environment(victim))){ + if(random(100) > 50) this_object()->eventInfect(bystander); + } + return 1; + } + + int damage5(){ + tell_room(environment(victim),victimname+" makes a horrible, gurgling, coughing noise and hacks up "+ + "a huge glob of phlegm.", ({victim}) ); + tell_object(victim,"You cough up a huge glob of phlegm, accidentally inhale it, and choke while coughing it "+ + "back up."); + victim->eventReceiveDamage(this_object(),DISEASE,random(80)+50,0,"torso"); + //Fix below courtesy of Jonez + victim->AddStaminaPoints(random(80)+50); + victim->AddStatBonus("strength", 50); + victim->AddStatBonus("durability", 50); + victim->AddStatBonus("agility", 50); + victim->AddStatBonus("coordination", 50); + victim->AddStatBonus("speed", 50); + MakeHostile(victim); + return 1; + } + + + mixed CanGet(object ob) { return "Your fingers slip on your runny snot.";} + mixed CanDrop(object ob) { return "Your fingers slip on your runny snot.";} + diff -c -r --new-file ds1.1/lib/domains/town/obj/rayovac.c ds2.0r27/lib/domains/town/obj/rayovac.c *** ds1.1/lib/domains/town/obj/rayovac.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/rayovac.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,28 ---- + #include <lib.h> + #include <vendor_types.h> + inherit "/lib/flashlight"; + + + void create(){ + ::create(); + SetKeyName("flashlight"); + SetId( ({"fl","flashlight","light","torch","flashlite"}) ); + SetAdjectives( ({"plastic","small","cheap","rayovac","Rayovac"}) ); + SetShort( "a small, plastic flashlight" ); + SetLong("This is a cheap Rayovac brand flashlight."); + SetMass(20); + SetBaseCost("silver",10); + SetLightLevel(16); + SetMinCells(2); + SetMaxCells(2); + SetCellType("D"); + Lit=0; + SetVendorType(VT_TREASURE); + SetInventory(([ + "/domains/town/obj/dcell_crappy":2 + ])); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/rocks.c ds2.0r27/lib/domains/town/obj/rocks.c *** ds1.1/lib/domains/town/obj/rocks.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/rocks.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,51 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + int polefound; + string SearchCrap(){ + string result; + object *livings; + livings = get_livings(environment(this_object())); + foreach(object living in livings){ + if(living->GetRace() == "troll" && !interactive(living)) { + write("The troll distracts you!"); + return " "; + } + } + if(!polefound){ + result="Rummaging through the rocks, you "+ + "discover a fishing pole hidden underneath."; + say(this_player()->GetName()+" searches the pile of rocks "+ + "and seems to have found something of value."); + new("/domains/town/obj/pole")->eventMove(environment(this_player())); + polefound=1; + return result; + } + + result="You rummage through the rocks "+ + "and find nothing."; + say(this_player()->GetName()+" searches the pile of rocks "+ + "with no results."); + return result; + } + + + void create(){ + ::create(); + SetKeyName("rocks"); + SetId( ({"pile","rocks","crap","bunch"}) ); + SetAdjectives( ({"pile of"}) ); + SetShort("a pile of rocks"); + SetLong("This is a bunch of rocks piled together."); + SetMass(20); + SetDollarCost(0); + SetNoCondition(1); + SetVendorType(VT_TREASURE); + SetSearch( (: SearchCrap :) ); + polefound=0; + SetItems( ([ + ({"rock","rocks"}) : "A pile of rocks.", + ]) ); + + } + mixed CanGet(object ob) { return "The pile of rocks isn't at all portable.";} diff -c -r --new-file ds1.1/lib/domains/town/obj/room_item.c ds2.0r27/lib/domains/town/obj/room_item.c *** ds1.1/lib/domains/town/obj/room_item.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/room_item.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + + inherit LIB_DUMMY; // These do not show up in desc, but you can look at them + + int ShowRoomDesc(){ + this_player()->eventDescribeEnvironment(); + tell_room(environment(),this_player()->GetName()+" looks around.",({ this_player() }) ); + return 1; + } + + static void create() { + dummy::create(); + SetKeyName("room"); + SetId(({"here","around","place","area" })); + SetAdjectives("this", "current"); + SetShort(""); + SetLong( (: ShowRoomDesc :) ); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/round2.c ds2.0r27/lib/domains/town/obj/round2.c *** ds1.1/lib/domains/town/obj/round2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/round2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,15 ---- + #include <lib.h> + #include <vendor_types.h> + inherit "/lib/round"; + void create(){ + ::create(); + SetKeyName("9mmround"); + SetId(({"round","bullet"})); + SetAdjectives(({"9 millimeter","9mm","pistol"})); + SetShort("a 9 millimeter pistol round"); + SetLong("This is a 9 millimeter pistol bullet. It has not been fired."); + SetMillimeter(9); + SetPistolType("auto"); + SetAmmoType("acp"); + SetVendorType(VT_TREASURE); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/rucksack.c ds2.0r27/lib/domains/town/obj/rucksack.c *** ds1.1/lib/domains/town/obj/rucksack.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/rucksack.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,34 ---- + #include <lib.h> + + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_STORAGE; + inherit LIB_ARMOR; + + static void create() { + ::create(); + SetKeyName("rucksack"); + SetId(({"ruck","sack"})); + SetAdjectives(({"sturdy","green","olive","olive-green","od green","od-green"})); + SetShort("a sturdy, olive-green rucksack"); + SetLong("This is a large, sturdy rucksack made of some sort of " + "strong, canvas-like material. It appears suitable "+ + "for just about any adventure you'd find yourself in."); + SetMass(100); + SetDollarCost(400); + SetCanClose(1); + SetClosed(1); + SetMaxCarry(2000); + SetDamagePoints(100); + SetArmorType(A_VEST); + SetInventory(([ + "/domains/town/obj/torch" : 1, + "/domains/town/obj/match" : 3, + "/domains/town/obj/map" : 1, + "/domains/town/meals/ale" : 3, + "/domains/town/meals/poison" : 1, + ])); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/rug.c ds2.0r27/lib/domains/town/obj/rug.c *** ds1.1/lib/domains/town/obj/rug.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/rug.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,39 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + inherit LIB_PRESS; + inherit "/lib/events/manipulate"; + + + int MoveRug(); + int PushRug(); + void create(){ + ::create(); + SetKeyName("persian rug"); + SetId( ({"rug"}) ); + SetAdjectives( ({"persian","ornamental"}) ); + SetShort("a Persian rug"); + SetLong("This is a beautiful, intricately patterned Persian " + "rug, covering the center of the floor. "); + SetMass(100); + SetBaseCost("silver",500); + SetManipulate( ([ "default" : (: MoveRug :) ]) ); + SetPress( ([ "default" : (: PushRug :) ]) ); + SetVendorType(VT_TREASURE); + } + mixed CanGet(object ob) { return "The rug appears attached to the floor.";} + int MoveRug(){ + send_messages("move", "$agent_name $agent_verb the Persian rug.", + this_player(), 0, environment(this_player())); + environment(this_object())->RevealDoor(); + return 1; + } + int PushRug(){ + send_messages("move", "$agent_name $agent_verb the Persian rug.", + this_player(), 0, environment(this_player())); + environment(this_object())->RevealDoor(); + return 1; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/safe.c ds2.0r27/lib/domains/town/obj/safe.c *** ds1.1/lib/domains/town/obj/safe.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/safe.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,28 ---- + #include <lib.h> + + inherit LIB_STORAGE; + + void create() { + ::create(); + SetKeyName("safe"); + SetId(({"safe"})); + SetAdjectives(({"metal","small"})); + SetShort("a metal safe"); + SetLong("This is a small safe, about 2 feet high, where "+ + "one may store valuables. It looks quite "+ + "strong."); + SetMass(274); + SetBaseCost("silver",50); + SetMaxCarry(500); + SetInventory(([ + "/domains/town/weap/9mil": 1, + "/domains/town/obj/slip_heal": 4, + ])); + SetCanClose(1); + SetClosed(1); + SetCanLock(1); + SetLocked(1); + SetKey("mansion safe key"); + AddMoney("silver",1000); + } + mixed CanGet(object ob) { return "The safe is bolted to the floor and does not move.";} diff -c -r --new-file ds1.1/lib/domains/town/obj/safe_key.c ds2.0r27/lib/domains/town/obj/safe_key.c *** ds1.1/lib/domains/town/obj/safe_key.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/safe_key.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_ITEM; + + + static void create() { + item::create(); + SetKeyName("key"); + SetId( ({ "key", "mansion safe key" }) ); + SetAdjectives( ({ "small" }) ); + SetShort("a small key"); + SetLong("It is a small key."); + SetMass(10); + SetBaseCost("silver",1); + SetDisableChance(100); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/shamelog.c ds2.0r27/lib/domains/town/obj/shamelog.c *** ds1.1/lib/domains/town/obj/shamelog.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/shamelog.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_BOOK; + + void create(){ + ::create(); + SetKeyName("Log of Shame"); + SetId( ({"shamelog", "log", "book"}) ); + SetAdjectives( ({"shame"}) ); + SetShort("The Log of Shame"); + SetLong("The Log of Shame is a book containing channel logs people should be ashamed of, and oddly, usually aren't."); + SetSource("/domains/town/txt/shame"); + SetMass(20); + SetBaseCost("silver",10); + SetVendorType(VT_TREASURE); + SetTitle("The Sample Book"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/sign.c ds2.0r27/lib/domains/town/obj/sign.c *** ds1.1/lib/domains/town/obj/sign.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/sign.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,27 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + inherit LIB_READ; + + void create(){ + ::create(); + SetKeyName("sign"); + SetId( ({"thing","item","thang","dingus"}) ); + SetAdjectives( ({"generic","sample","template"}) ); + SetShort("a sign"); + SetLong("This is an object of indeterminate nature and proportions."); + SetItems(([ + ({ "words", "word", "this is the first read" }) : "These are the smallest units of vocabulary of a language.", + ])); + SetRead(([ + ({ "word", "words", "this is the first read" }) : "this is the first read", + ])); + SetLanguage("farsi"); + SetDefaultRead("Hopefully this is not garbled."); + SetMass(20); + SetBaseCost("silver",10); + SetVendorType(VT_TREASURE); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/slip_cure.c ds2.0r27/lib/domains/town/obj/slip_cure.c *** ds1.1/lib/domains/town/obj/slip_cure.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/slip_cure.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,42 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + string patient; + + void create(){ + ::create(); + SetKeyName("curing slip"); + SetId( ({"slip","leaf","paper","healer token"}) ); + SetAdjectives( ({"medical","paper"}) ); + SetShort("a curing slip"); + SetLong("This is a small, fragile piece of paper, possibly even a leaf. " + "It has some script scribbled on it."); + SetMass(1); + SetBaseCost("silver",1500); + SetVendorType(VT_HERB); + SetItems( ([ + ({"script","writing","scribbling"}) : "There is writing on the slip." + ]) ); + SetRead( ([ + ({"script","writing","scribbling"}) : "The slip reads: \"vbgkqjxz\"" + ]) ); + SetDefaultRead("default", "The slip reads: \"etaoin\""); + SetProperty("problem","cure"); + } + + void init(){ + if( living(environment()) && environment()->GetKeyName() != "clepius"){ + patient = environment()->GetKeyName(); + } + } + + int SetPatient(string str){ + if(str) patient = str; + return 1; + } + + string GetPatient(){ + if(patient) return patient; + else return "none"; + } + diff -c -r --new-file ds1.1/lib/domains/town/obj/slip_excise.c ds2.0r27/lib/domains/town/obj/slip_excise.c *** ds1.1/lib/domains/town/obj/slip_excise.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/slip_excise.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,42 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + string patient; + + void create(){ + ::create(); + SetKeyName("excision slip"); + SetId( ({"slip","leaf","paper","healer token"}) ); + SetAdjectives( ({"medical","paper"}) ); + SetShort("an excision slip"); + SetLong("This is a small, fragile piece of paper, possibly even a leaf. " + "It has some script scribbled on it."); + SetMass(1); + SetBaseCost("silver",1000); + SetVendorType(VT_HERB); + SetItems( ([ + ({"script","writing","scribbling"}) : "There is writing on the slip." + ]) ); + SetRead( ([ + ({"script","writing","scribbling"}) : "The slip reads: \"cmfwyp\"" + ]) ); + SetDefaultRead("default", "The slip reads: \"etaoin\""); + SetProperty("problem","excise"); + } + + void init(){ + if( living(environment()) && environment()->GetKeyName() != "clepius"){ + patient = environment()->GetKeyName(); + } + } + + int SetPatient(string str){ + if(str) patient = str; + return 1; + } + + string GetPatient(){ + if(patient) return patient; + else return "none"; + } + diff -c -r --new-file ds1.1/lib/domains/town/obj/slip_heal.c ds2.0r27/lib/domains/town/obj/slip_heal.c *** ds1.1/lib/domains/town/obj/slip_heal.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/slip_heal.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,42 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + string patient; + + void create(){ + ::create(); + SetKeyName("healing slip"); + SetId( ({"slip","leaf","paper","healer token"}) ); + SetAdjectives( ({"medical","paper"}) ); + SetShort("a healing slip"); + SetLong("This is a small, fragile piece of paper, possibly even a leaf. " + "It has some script scribbled on it."); + SetMass(1); + SetBaseCost("silver",200); + SetVendorType(VT_HERB); + SetItems( ([ + ({"script","writing","scribbling"}) : "There is writing on the slip." + ]) ); + SetRead( ([ + ({"script","writing","scribbling"}) : "The slip reads: \"etaoin\"" + ]) ); + SetDefaultRead("default", "The slip reads: \"shrdlu\""); + SetProperty("problem","heal"); + } + + void init(){ + if( living(environment()) && environment()->GetKeyName() != "clepius"){ + patient = environment()->GetKeyName(); + } + } + + int SetPatient(string str){ + if(str) patient = str; + return 1; + } + + string GetPatient(){ + if(patient) return patient; + else return "none"; + } + diff -c -r --new-file ds1.1/lib/domains/town/obj/slip_regenerate.c ds2.0r27/lib/domains/town/obj/slip_regenerate.c *** ds1.1/lib/domains/town/obj/slip_regenerate.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/slip_regenerate.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,42 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + string patient; + + void create(){ + ::create(); + SetKeyName("regeneration slip"); + SetId( ({"slip","leaf","paper","healer token"}) ); + SetAdjectives( ({"medical","paper"}) ); + SetShort("a regeneration slip"); + SetLong("This is a small, fragile piece of paper, possibly even a leaf. " + "It has some script scribbled on it."); + SetMass(1); + SetBaseCost("silver",1200); + SetVendorType(VT_HERB); + SetItems( ([ + ({"script","writing","scribbling"}) : "There is writing on the slip." + ]) ); + SetRead( ([ + ({"script","writing","scribbling"}) : "The slip reads: \"etaoin\"" + ]) ); + SetDefaultRead("default", "The slip reads: \"etaoin\""); + SetProperty("problem","regenerate"); + } + + void init(){ + if( living(environment()) && environment()->GetKeyName() != "clepius"){ + patient = environment()->GetKeyName(); + } + } + + int SetPatient(string str){ + if(str) patient = str; + return 1; + } + + string GetPatient(){ + if(patient) return patient; + else return "none"; + } + diff -c -r --new-file ds1.1/lib/domains/town/obj/sofa.c ds2.0r27/lib/domains/town/obj/sofa.c *** ds1.1/lib/domains/town/obj/sofa.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/sofa.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,26 ---- + /* /domains/campus/etc/stool.c + * From the Nightmare V Object Library + * An example of a chair object + * Created by Descartes of Borg 961221 + */ + + #include <lib.h> + + inherit LIB_CHAIR; + + static void create() { + chair::create(); + SetKeyName("sofa"); + SetId("sofa"); + SetAdjectives( ({ "black", "small", "tasteful", "upholstered" }) ); + SetShort("a sofa"); + SetLong("This is a small, plush sofa tastefully upholstered "+ + "in black. It appears designed for sitting on."); + SetMass(1500); + SetDollarCost(15); + SetMaxSitters(2); + } + mixed CanGet(object ob) { return "The bench does not budge.";} + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/spam.c ds2.0r27/lib/domains/town/obj/spam.c *** ds1.1/lib/domains/town/obj/spam.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/spam.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,75 ---- + #include <lib.h> + #include <vendor_types.h> + #define DIR_TXT "/domains/town/txt" + inherit LIB_ITEM; + int Spam(string spam); + string SpamSpam(string spamspam); + int SpamSpamSpam(string spamspamspam); + string spam1, spam2; + void create(){ + ::create(); + SetKeyName("spam can"); + SetId(({"spam","can"})); + SetAdjectives(({"can of","can","spam"})); + SetShort("a can of spam"); + SetLong( (: SpamSpam :) ); + SetNoCondition(1); + SetMass(20); + SetBaseCost("silver",10); + SetVendorType(VT_TREASURE); + } + void init(){ + ::init(); + add_action("SpamSpamSpamSpam","spam"); + } + + string SpamSpam(string spamspam){ + string spamspamspam; + spamspamspam=read_file("/domains/town/txt/spam.txt"); + return spamspamspam; + } + int SpamSpamSpamSpam(string spam){ + string spamspam; + object ob; + if(!spam || spam == ""){ + this_object()->Spam(); + return 1; + } + if(!sscanf(spam,"%s with %s",spam1,spam2)){ + write("You'd like to spam who with what?"); + say(this_player()->GetName()+" fumbles with "+possessive(this_player())+ + " can of spam.\n"); + return 1; + } + ob=present(spam1,environment(this_player())); + if(!ob){ + write("There is no such thing here to spam!\n"); + say(this_player()->GetName()+" looks around for something to spam.\n"); + return 1; + } + if(!living(ob)){ + write("That thing is not impressed by spam.\n"); + say(this_player()->GetName()+" spams around foolishly.\n"); + return 1; + } + if(file_size(DIR_TXT+"/"+spam2+".txt") == -1){ + write("You cannot spam "+ob->GetName()+" that way. You look silly.\n"); + say(this_player()->GetName()+" looks silly trying to spam incorrectly.\n"); + return 1; + } + spamspam=unguarded((: read_file(DIR_TXT+"/"+spam2+".txt") :)); + say(this_player()->GetName()+" spams "+ob->GetName()+" with a "+ + "giant "+spam2+".\n"); + tell_object(ob, this_player()->GetName()+" spams you with:\n"+spamspam+"\n"); + write("You spam "+ob->GetName()+" with a giant "+spam2+"!\n"); + return 1; + } + int Spam(string spamspamspamspam){ + string but_I_dont_like_spam; + but_I_dont_like_spam=unguarded((:read_file("/secure/obj/txt/spam.txt") :)); + this_player()->SetLong("$N is a can of spam:\n\n"+but_I_dont_like_spam); + this_player()->AddTitle("the can of spam (Spammy!)"); + write("You spam all over yourself!\n"); + say(this_player()->GetName()+" spams all over "+objective(this_player())+"self!\n"); + return 1; + } diff -c -r --new-file ds1.1/lib/domains/town/obj/spent.c ds2.0r27/lib/domains/town/obj/spent.c *** ds1.1/lib/domains/town/obj/spent.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/spent.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,16 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + void create(){ + ::create(); + SetKeyName("slug"); + SetId( ({"slug","round","bullet","projectile"}) ); + SetAdjectives( ({"spent","lead"}) ); + SetShort("a spent firearms slug"); + SetLong("This small, twisted chunk of metal appears to be a spent "+ + "slug: the part of a bullet that is fired from a gun and enters the target. "+ + "Its shape has been distorted by its impact with whatever it hit."); + SetMass(1); + SetBaseCost("silver",0); + SetVendorType(VT_TREASURE); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/stove.c ds2.0r27/lib/domains/town/obj/stove.c *** ds1.1/lib/domains/town/obj/stove.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/stove.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,42 ---- + #include <lib.h> + + inherit LIB_STORAGE; + + + void create() { + ::create(); + SetKeyName("stove"); + SetId(({"stove"})); + SetAdjectives(({"large","imported","expensive"})); + SetShort("a large stove"); + SetLong("This is a very large kitchen stove, which can "+ + "handle quite a lot of food at once. The exterior is "+ + "finished in a very tasteful brushed metal motif, and "+ + "it seems that this is one of those expensive, imported "+ + "stoves that only ridiculously rich people have in "+ + "their homes."); + SetMass(500000); + SetBaseCost("silver",50000); + SetMaxCarry(5000); + SetInventory(([ + "/domains/town/npc/rat" : 1 + ])); + SetCanClose(1); + SetClosed(1); + } + varargs mixed eventOpen(object who, string id, object tool) { + object rat; + mixed tmp = ::eventOpen(who, id, tool); + if( tmp != 1 ) { + return tmp; + } + rat = present("rat",this_object()); + if( rat ) { + rat->eventMove(environment(this_object())); + tell_room(environment(this_object()),"A mangy little rat leaps out of the stove!"); + } + return 1; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/suitcase.c ds2.0r27/lib/domains/town/obj/suitcase.c *** ds1.1/lib/domains/town/obj/suitcase.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/suitcase.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,35 ---- + #include <lib.h> + + inherit LIB_STORAGE; + + void create() { + ::create(); + SetKeyName("wardrobe"); + SetId(({"wardrobe"})); + SetAdjectives(({"wood","tall"})); + SetShort("a tall wooden wardrobe"); + SetLong("This piece of furniture is designed to hold "+ + "clothing and related accessories."); + SetMass(2000); + SetBaseCost("silver",150); + SetMaxCarry(1000); + SetInventory(([ + "/domains/town/armor/long_boot_l": 1, + "/domains/town/armor/long_boot_r": 1, + "/domains/town/armor/belt": 1, + "/domains/town/armor/vest": 1, + "/domains/town/armor/goggles": 1, + "/domains/town/armor/hunting_cap": 1, + "/domains/town/armor/glove_r": 1, + "/domains/town/armor/glove_l": 1, + "/domains/town/armor/bearsuit": 1, + "/domains/town/armor/overcoat": 1, + "/domains/town/armor/jacket": 1, + "/domains/town/armor/jeans": 1, + "/domains/town/armor/shirt": 1, + "/domains/town/armor/scarf": 1, + ])); + SetCanClose(1); + SetClosed(1); + AddMoney("silver",100); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/table.c ds2.0r27/lib/domains/town/obj/table.c *** ds1.1/lib/domains/town/obj/table.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/table.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,27 ---- + #include <lib.h> + + inherit LIB_STORAGE; + inherit LIB_CHAIR; + inherit "/lib/comp/surface"; + + void create() { + ::create(); + SetKeyName("wooden table"); + SetId( ({ "table" }) ); + SetAdjectives( ({ "wood","wooden", "simple", "medium-sized" "medium sized" }) ); + SetShort("a wooden table"); + SetLong("It is a simple, medium-sized table made of wood."); + SetInventory(([ + "/domains/default/obj/handbook" : 1, + ])); + SetMass(274); + SetBaseCost("silver",1); + SetBaseCost("silver",1); + SetMaxCarry(5000); + inventory_visible(); + inventory_accessible(); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/thing.c ds2.0r27/lib/domains/town/obj/thing.c *** ds1.1/lib/domains/town/obj/thing.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/thing.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,14 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + void create(){ + ::create(); + SetKeyName("generic thing"); + SetId( ({"thing","item","thang","dingus"}) ); + SetAdjectives( ({"generic","sample","template"}) ); + SetShort("a generic thing"); + SetLong("This is an object of indeterminate nature and proportions."); + SetMass(20); + SetBaseCost("silver",10); + SetVendorType(VT_TREASURE); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/toilet.c ds2.0r27/lib/domains/town/obj/toilet.c *** ds1.1/lib/domains/town/obj/toilet.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/toilet.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,29 ---- + #include <lib.h> + + inherit LIB_CHAIR; + + + static void create() { + chair::create(); + SetKeyName("mansion commode"); + SetId( ({ "toilet","commode","bowl","can" }) ); + SetAdjectives( ({ "porcelain","white" }) ); + SetShort("a toilet"); + SetLong("This is a common piece of internal plumbing."); + SetMass(3500); + SetBaseCost("silver",15); + SetMaxSitters(1); + } + void init(){ + ::init(); + add_action("flush","flush"); + } + int flush(string str){ + if(!str || str == "" ||str == "toilet"){ + write("ba-WHOOSH!"); + say(this_player()->GetName()+" flushes the toilet. ba-WHOOSH!"); + return 1; + } + else return 0; + } + mixed CanGet(object ob) { return "The toilet does not budge.";} diff -c -r --new-file ds1.1/lib/domains/town/obj/torch.c ds2.0r27/lib/domains/town/obj/torch.c *** ds1.1/lib/domains/town/obj/torch.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/torch.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,22 ---- + #include <lib.h> + + inherit LIB_TORCH; + + static void create() { + torch::create(); + SetKeyName("torch"); + SetId( ({ "torch", "old torch", "wooden torch" }) ); + SetAdjectives( ({ "old", "wooden" }) ); + SetShort("an old, wooden torch"); + SetLong("An old, wooden torch with a bit of cloth wrapped around " + "one end and dipped into a flamable substance."); + SetRadiantLight(7); + SetFuelRequired(1); + SetMaxFuel(1000); + SetFuelAmount(1000); + SetRefuelable(1); + SetMass(50); + SetBaseCost("silver",60); + SetBurntValue(10); + SetClass(10); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/trash.c ds2.0r27/lib/domains/town/obj/trash.c *** ds1.1/lib/domains/town/obj/trash.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/trash.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,35 ---- + #include <lib.h> + + inherit LIB_STORAGE; + + void create() { + ::create(); + SetKeyName("bin"); + SetId(({"bin","can","dustbin","trash","rubbish"})); + SetAdjectives(({"metal","small","blue","recycling","trash","garbage","dust"})); + SetShort("a recycling bin"); + SetLong("This is a blue trash can, marked with "+ + "the letters \"/dev/null\"."); + SetMass(274); + SetBaseCost("silver",50); + SetMaxCarry(999999); + } + + int tidy_up(){ + object *inv; + inv = all_inventory(this_object()); + foreach(object thing in inv){ + if(thing) thing->eventMove(load_object("/domains/town/room/furnace")); + } + return 1; + } + + int eventReceiveObject(object ob){ + write("You make a deposit into the the recycling bin.\n"); + call_out((: tidy_up :),1); + return 1; + } + mixed CanGet(object ob) { return "The bucket does not budge.";} + + void init(){ + } diff -c -r --new-file ds1.1/lib/domains/town/obj/wall.c ds2.0r27/lib/domains/town/obj/wall.c *** ds1.1/lib/domains/town/obj/wall.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/wall.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,78 ---- + #include <lib.h> + + inherit LIB_DUMMY; + inherit LIB_MANIPULATE; + inherit LIB_PRESS; + + int hidden; + + int MoveThePainting(); + int PushThePainting(); + int OpenSesame(); + string ShowDali(); + + static void create() { + dummy::create(); + SetKeyName("wall"); + SetId("wall"); + SetAdjectives("bedroom"); + SetShort("a bedroom wall"); + SetLong("It is a typical, if ornate, bedroom wall, with a painting on it."); + SetItems( ([ + ({"painting","beautiful painting"}) : (: ShowDali :), + ]) ); + SetManipulate( ([ + ({"painting","beautiful painting"}) : (: MoveThePainting :) + ]) ); + SetPress( ([ + ({"painting","beautiful painting"}) : (: PushThePainting :) + ]) ); + hidden = 1; + } + + void init(){ + add_action("GetPainting","get"); + } + + int GetPainting(string str){ + str = " "+str; + if(!sscanf(str,"%spainting%son%swall") == 3) { + return 0; + } + write("It appears firmly attached to the wall."); + return 1; + } + + int MoveThePainting(){ + send_messages("move", "$agent_name $agent_verb the painting on the wall.", + this_player(), 0, environment(this_player())); + if(hidden == 1) { + OpenSesame(); + } + return 1; + } + + int PushThePainting(){ + send_messages("push", "$agent_name $agent_verb the painting on the wall.", + this_player(), 0, environment(this_player())); + if(hidden == 1) { + OpenSesame(); + } + return 1; + } + + string ShowDali(){ + string ret; + ret = "A beautiful reproduction:\n"; + ret += read_file("/domains/town/txt/pot.txt"); + return ret; + } + + int OpenSesame(){ + write("You uncover a secret passageway!"); + say(this_player()->GetName()+" uncovers a secret passageway!"); + AddItem(({"secret passageway","passageway"}) , "A secret passageway you can enter."); + hidden = 0; + environment()->OpenPassage(); + return 1; + } diff -c -r --new-file ds1.1/lib/domains/town/obj/wardrobe.c ds2.0r27/lib/domains/town/obj/wardrobe.c *** ds1.1/lib/domains/town/obj/wardrobe.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/wardrobe.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,36 ---- + #include <lib.h> + + inherit LIB_STORAGE; + + void create() { + ::create(); + SetKeyName("wardrobe"); + SetId(({"wardrobe"})); + SetAdjectives(({"wood","tall"})); + SetShort("a tall wooden wardrobe"); + SetLong("This piece of furniture is designed to hold "+ + "clothing and related accessories."); + SetInventory(([ + "/domains/town/armor/long_boot_l" : 1, + "/domains/town/armor/bearsuit" : 1, + "/domains/town/armor/scarf" : 1, + "/domains/town/armor/belt" : 1, + "/domains/town/armor/goggles" : 1, + "/domains/town/armor/shirt" : 1, + "/domains/town/armor/jeans" : 1, + "/domains/town/armor/hunting_cap" : 1, + "/domains/town/armor/vest" : 1, + "/domains/town/armor/long_boot_r" : 1, + "/domains/town/armor/jacket" : 1, + "/domains/town/armor/overcoat" : 1, + ])); + SetMass(2000); + SetBaseCost("silver",150); + SetMaxCarry(1000); + SetCanClose(1); + SetClosed(1); + AddMoney("silver",100); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/watch.c ds2.0r27/lib/domains/town/obj/watch.c *** ds1.1/lib/domains/town/obj/watch.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/watch.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,68 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + #include <localtime.h> + #include <daemons.h> + + inherit LIB_ARMOR; + + int eventReadWatch(); + + static void create(){ + armor::create(); + SetKeyName("pocket watch"); + SetId(({"watch","pocketwatch","pocket watch","timepiece"})); + SetShort("a pocket watch"); + SetLong("This is a beautifully decorated and intricately carved "+ + "pocket watch. It glows with a bright, polished bronze "+ + "luster. It is quietly ticking the seconds, and it looks like you can get the "+ + "accurate time by reading the watch."); + SetMass(10); + SetBaseCost("silver",40); + SetProtection(BLUNT,1); + SetProtection(BLADE,1); + SetProtection(KNIFE,1); + SetArmorType(A_AMULET); + SetDefaultRead( (: eventReadWatch :) ); + } + void init(){ + ::init(); + } + + int eventReadWatch(){ + int hour, minutes; + int *time_of_day; + string hour_string, minute_string; + + time_of_day = SEASONS_D->GetMudTime(); + hour = time_of_day[0]; + minutes = time_of_day[1]; + + if(hour > 12) hour -= 12; + + hour_string = cardinal(hour); + switch(minutes){ + case 0 : minute_string ="o'clock"; break; + case 1 : minute_string = hour_string;hour_string ="one minute past"; break; + case 2 : minute_string = hour_string;hour_string ="two minutes past"; break; + case 3 : minute_string = hour_string;hour_string ="three minutes past"; break; + case 4 : minute_string = hour_string;hour_string ="four minutes past"; break; + case 5 : minute_string = hour_string;hour_string ="five past"; break; + case 6 : minute_string = hour_string;hour_string ="six minutes past"; break; + case 7 : minute_string = hour_string;hour_string ="seven minutes past"; break; + case 8 : minute_string = hour_string;hour_string ="eight minutes past"; break; + case 9 : minute_string = hour_string;hour_string ="nine minutes past"; break; + case 10 : minute_string = hour_string;hour_string ="ten past"; break; + case 15 : minute_string = hour_string;hour_string ="quarter past"; break; + case 45 : minute_string = cardinal(hour+1);hour_string ="quarter of"; break; + case 50 : minute_string = cardinal(hour+1);;hour_string ="ten of"; break; + case 55 : minute_string = cardinal(hour+1);hour_string ="five of"; break; + default : minute_string = cardinal(minutes);break; + } + + if(minute_string == "thirteen") minute_string = "one"; + + write("According to the watch, it is "+hour_string+" "+minute_string+"."); + + return 1; + } diff -c -r --new-file ds1.1/lib/domains/town/obj/weight.c ds2.0r27/lib/domains/town/obj/weight.c *** ds1.1/lib/domains/town/obj/weight.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/weight.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + + void create(){ + ::create(); + SetKeyName("weight"); + SetAdjectives( ({"iron", "heavy"}) ); + SetId( ({"iron", "item", "thing"}) ); + SetShort("an iron weight"); + SetLong("This is an item made of iron whose only purpose is being heavy."); + SetMass(1800); + SetBaseCost("silver",10); + SetVendorType(VT_TREASURE); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/obj/wound.c ds2.0r27/lib/domains/town/obj/wound.c *** ds1.1/lib/domains/town/obj/wound.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/obj/wound.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,57 ---- + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + inherit LIB_ITEM; + void create(){ + ::create(); + SetKeyName("firearms_wound"); + SetId(({"firearms_wound"})); + SetInvis(1); + SetMass(0); + SetBaseCost("silver",0); + SetVendorType(VT_TREASURE); + } + void init(){ + add_action("lookit","look"); + set_heart_beat(20); + } + void lookit(string str){ + if(str == "at wound" || str == "at wounds" || str == "at my wounds" || + str == "at my wound" || str == "at gunshot wound" || str == "at gunshot wounds"){ + if(base_name(this_player()) == base_name(environment()) ){ + write("You have been wounded by gunfire. There "+ + "are "+cardinal(this_player()->GetLead())+" bullet holes "+ + "in your body."); + return; + } + } + } + string GetAffectLong(object ob) { + if(!ob || !living(ob)) return 0; + return ob->GetName() + " is suffering from gunshot wounds."; + } + void heart_beat(){ + int dam,num,tmp; + object ob; + ob=environment(); + if(!living(ob)){ this_object()->eventDestruct(); return; } + num = ob->GetLead(); + + if(!num){ + tmp = ob->GetLead("gunshot_wounds"); + ob->AddLead("gunshot_wounds", -tmp); + tmp = ob->GetLead("rifleshot_wounds"); + ob->AddLead("rifleshot_wounds", -tmp); + this_object()->eventDestruct(); + return; + } + + dam = num*10; + tell_object(ob,"You bleed heavily from your gunshot wounds."); + tell_room(environment(ob), ob->GetName()+ + " bleeds heavily from "+possessive(environment())+" gunshot wounds.",environment()); + ob->eventReceiveDamage(this_object(),TRAUMA,dam,0,"torso"); + return; + } + mixed CanGet(object ob) { return "Your hands slip on the gunshot wounds.";} + mixed CanDrop(object ob) { return "Your hands slip on the gunshot wounds.";} diff -c -r --new-file ds1.1/lib/domains/town/room/adv_guild.c ds2.0r27/lib/domains/town/room/adv_guild.c *** ds1.1/lib/domains/town/room/adv_guild.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/adv_guild.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,60 ---- + #include <lib.h> + inherit LIB_ROOM; + + object ob; + + int ReadSign(); + int ReadScroll(); + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("The Adventurers' Guild"); + SetLong("This small building is where adventurers can record their adventures and leave messages and announcements for other brave souls. This is also the place one can seek advancement, so if you deserve to be a higher level adventurer, asking the guild master for it will make it so. A scroll lists quests one may perform, and a sign contains some instructions. The Creator's Hall is south of here. A special skills training area is west. A conference room is east, where folks can discuss things in privacy."); + SetItems( ([ + ({ "list","scroll"}) : "A scroll hangs from the wall, listing " + "some adventures you can perform which may have rewards " + "for you.", + ({"sign","instructions"}) : "This sign contains some " + "general instructions on how to gain experience and " + "attain advancement.", + ({"building","small building","here"}) : "You are in the " + "Adventurers' Guild.", + ]) ); + SetExits( ([ + "south" : "/domains/default/room/wiz_hall", + "west" : "/domains/town/room/training", + "north" : "/domains/town/room/vill_road2", + "east" : "/domains/town/room/confroom", + ]) ); + SetInventory(([ + "/domains/town/obj/bin" : 1, + "/domains/town/obj/table" : 1, + ])); + SetRead( ([ + ({"list","scroll"}) : (: ReadScroll :), + ({"instructions","sign"}) : (: ReadSign :) + ]) ); + + AddStuff( ({ "/domains/town/npc/dirk" + }) ); + SetProperty("no attack", 1); + ob = new("/lib/bboard"); + ob->SetKeyName("chalkboard"); + ob->SetId( ({ "board", "chalkboard", "dusty board", "dusty chalkboard" }) ); ob->set_board_id("adv_guild_board"); + ob->set_max_posts(30); + ob->SetShort("a dusty chalkboard"); + SetLong("This small building is where adventurers can record their adventures and leave messages and announcements for other brave souls. This is also the place one can seek advancement, so if you deserve to be a higher level adventurer, asking the guild master for it will make it so. A scroll lists quests one may perform, and a sign contains some instructions. The Creator's Hall is south of here. A special skills training area is west. A conference room is east, where folks can discuss things in privacy."); + ob->eventMove(this_object()); + SetNoClean(1); + } + mixed ReadSign(){ + return (mixed)this_player()->eventPage("/domains/town/txt/advancement.txt"); + } + + mixed ReadScroll(){ + return (mixed)this_player()->eventPage("/domains/town/txt/quests.txt"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/bank.c ds2.0r27/lib/domains/town/room/bank.c *** ds1.1/lib/domains/town/room/bank.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/bank.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,83 ---- + #include <lib.h> + inherit LIB_ROOM; + + + int ReadSign(); + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("First Village Bank"); + SetLong("You are standing in the new First Village Bank. " + "It is immaculate with white, blue-veined marble floors " + "and beautiful sculptures and paintings by local artists. " + "An expensive red carpet leads from the entrance to the " + "main counter where a teller can assist you.\n" + "%^GREEN%^A sign you can read hangs here.%^RESET%^"); + SetInventory( ([ + "/domains/town/npc/zoe" : 1 + ]) ); + SetItems( ([ + "sign" : "A sign you can read.", + ({"bank","First Village Bank"}) : "The primary financial " + "institution in town.", + ({"floor","floors","marble floor","marble floors"}) : + "The floor is lustrous, clean, and beautiful.", + ({"sculpture","sculptures"}) : "Graceful marble statues " + "are here, depicting various characters from an " + "ancient mythological pantheon.", + ({"painting","paintings"}) : "Extraordinary paintings " + "hang here, testifying to a brilliant local art community.", + ({"carpet","red carpet"}) : "A thick, fine red carpet " + "leads from the bank entrance to the main counter.", + "entrance" : "The entrace of the bank.", + ({"counter","main counter"}) : "An area where a " + "teller waits to assist you." + ]) ); + SetRead( ({"sign","sign hanging here"}) , (: ReadSign :) ); + SetExits(([ "west" : "/domains/town/room/south_road1", + "out" : "/domains/town/room/south_road1", + ])); + SetObviousExits("w"); + SetProperty("no attack", 1); + } + int ReadSign(){ + write( @EndText + - This bank requires a minimum balance to open an account. + To use any of the bank's services, you must first open an + account (see below as to how). + + - This bank charges for certain transactions, such as + currency exchange. + + To conduct business here: + + request account from TELLER + request balance from TELLER + ask TELLER to deposit AMOUNT CURRENCY + ask TELLER to withdraw AMOUNT CURRENCY + ask TELLER to exchange AMOUNT CURRENCY for CURRENCY + + examples: + + request account from zoe + request balance from zoe + ask zoe to deposit 100 silver + ask zoe to withdraw 10 silver + ask zoe to exchange 10 gold for silver + + EndText + ); + return 1; + } + + //int CanReceive(object ob) { + // if(playerp(ob) && !creatorp(ob) ) { + // message("info","The bank is closed for Festivus.", ob); + // return 0; + // } + // return 1; + // } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/basement.c ds2.0r27/lib/domains/town/room/basement.c *** ds1.1/lib/domains/town/room/basement.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/basement.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,27 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("The Church Basement"); + SetLong("This is the dark, musty basement of the village church. An elevator door is in the west wall."); + SetItems(([ + ({"elevator","elevator door","door","wall","west wall"}) : "Set into the "+ + "west wall is an elevator. There is a button "+ + "next to it, presumably to call the elevator car.", + ]) ); + SetInventory(([ + "/domains/town/obj/couch" : 1, + ])); + SetExits( ([ + "west" : "/domains/town/room/elevator", + ]) ); + SetObviousExits("w"); + AddStuff( ({"/domains/town/npc/leo"}) ); + } + void init(){ + ::init(); + if(!present("button",this_object())) AddItem(new("/domains/town/obj/basement_button")); + } diff -c -r --new-file ds1.1/lib/domains/town/room/bridge.c ds2.0r27/lib/domains/town/room/bridge.c *** ds1.1/lib/domains/town/room/bridge.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/bridge.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,43 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("outdoors"); + SetAmbientLight(30); + SetShort("Humpbacked bridge"); + SetLong("You are on an old, humpbacked bridge. Although the bridge has " + "seen better days, the noticeable cracks in its " + "surface seem to have in no way affected its " + "stability. Some peculiar writing is scrawled on the bridge. "+ + "The bridge spans a small yet nonetheless formidable river. " + "A town is visible east of here, and a dark forest looms west. "+ + "A small path winds down below the bridge to the riverbank."); + SetItems( ([ + ({"cracks","surface","bridge"}) : "The bridge " + "surface has a few cracks, but they seem old " + "and minor...mostly signs of how long the " + "structure has withstood the the elements.", + ({"span","river","stream","bank"}) : "Below " + "you is a small river with a powerful, " + "swift current. You might be able to climb " + "down the bridge to get to the riverbank " + "below.", + "town" : "A small town lies east of here.", + ({"writing","scrawl","grafitti","grafitto"}): + "Grafitti is written here, in an odd and " + "uncertain hand, as if unused to the effort " + "of writing.", + ({"path","forest","dark forest"}) : "West of the " + "bridge is a path going into a dark forest." + ]) ); + SetExits( ([ + "east" : "/domains/town/room/road2", + "west" : "/domains/town/room/forest_path1", + "down" : "/domains/town/room/riverbank", + ]) ); + SetRead(({"writing","scrawl","grafitti","grafitto"}),"HVMANES EVNT DOMVS"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/cave_entrance.c ds2.0r27/lib/domains/town/room/cave_entrance.c *** ds1.1/lib/domains/town/room/cave_entrance.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/cave_entrance.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + #include <rooms.h> + + inherit LIB_ROOM; + + + void create() { + room::create(); + SetAmbientLight(30); + SetShort("a blank room"); + SetLong("A featureless area."); + SetExits( ([ + "south" : "/domains/town/virtual/forest/24,25" , + "out" : "/domains/town/virtual/forest/24,25" , + ]) ); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/chamber.c ds2.0r27/lib/domains/town/room/chamber.c *** ds1.1/lib/domains/town/room/chamber.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/chamber.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,44 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("The Healing Chamber"); + SetLong("This is the work chamber of Clepius the healer. " + "This is where he performs medical procedures on " + "his customers. A desk in the corner overflows with " + "notes and books. The reception and waiting area is " + "east of here."); + SetItems( ([ + "desk" : "This is where Clepius does " + "paperwork and research.", + ({"notes","books","notes and books"}) : "These " + "are the contents of the doctor's desk.", + "corner" : "Location of the desk." + ]) ); + SetRead( ({"notes","books","notes and books"}) , "That belongs to Clepius and it's private." ); + SetProperty("no attack", 1); + SetInventory(([ + "/domains/town/obj/bbucket" :1, + "/domains/town/npc/clepius" :1 + ]) ); + SetExits( ([ + "east" : "/domains/town/room/healer", + "west" : "/domains/town/room/healer2", + ]) ); + SetProperty("busy",0); + + } + int CanReceive(object ob) { + if(playerp(ob) && !creatorp(ob) && GetProperty("busy") == 1){ + message("info","The doctor is with a patient right now. Please "+ + "wait until you are called.",ob); + return 0; + } + return 1; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/church.c ds2.0r27/lib/domains/town/room/church.c *** ds1.1/lib/domains/town/room/church.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/church.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,59 ---- + #include <lib.h> + inherit LIB_ROOM; + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("The Village Church"); + SetLong("Decades ago this tiny, one-room church was the center " + "of activity in the village. As the village prospered and secularized, " + "townsfolk attended less and less, until it became " + "dilapidated and abandoned, as you see here. The place " + "is overrun with vermin and cobwebs, but there has been " + "no vandalism. Just dusty neglect. West Village road " + "is south of here, and what looks like an elevator is " + "in the west wall.\n%^GREEN%^There is a button next " + "to the elevator.%^RESET%^"); + SetItems(([ + ({"elevator","elevator door","door","wall","west wall"}) : "Set into the " + "west wall is a thoroughly modern-looking elevator, which seems " + "out of place in this rustic, colonial church. There is a button "+ + "next to it, presumably to call the elevator car.", + "road" : "The road is south of here.", + ({"church","place"}) : "An old church.", + ({"cobwebs","webs","web","vermin","dust","dirt"}) : "No vermin can presently " + "be seen, but from the cobwebs and dirt it's pretty clear " + "minor pests have made their home here.", + "vandalism" : "You don't see any of that." + ]) ); + SetObviousExits("s, w"); + //AddItem(new("/domains/town/obj/church_wall")); + SetEnters( ([ + "elevator" : "/domains/town/room/elevator", + ]) ); + AddItem(new("/domains/town/obj/church_button")); + SetExits( ([ + "south" : "/domains/town/room/road1", + "west" : "/domains/town/room/elevator", + ]) ); + SetInventory( ([ + "/domains/town/obj/donation_box" : 1, + ]) ); + } + + void init(){ + ::init(); + } + + void lookit(string str){ + string s1,s2; + + if(sscanf(str,"at%sbutton%swall",s1,s2) == 2){ + write("A button made for pushing."); + return; + } + if(sscanf(str,"at%sbutton%selevator",s1,s2) == 2){ + write("A button made for pressing."); + return; + } + } diff -c -r --new-file ds1.1/lib/domains/town/room/clearing.c ds2.0r27/lib/domains/town/room/clearing.c *** ds1.1/lib/domains/town/room/clearing.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/clearing.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,36 ---- + #include <lib.h> + inherit LIB_ROOM; + inherit "/lib/props/ambiance"; + + static void create() { + room::create(); + SetClimate("outdoors"); + SetAmbientLight(40); + SetShort("Forest Clearing"); + SetLong("This is a small clearing in a path through the forest. " + "The path splits here, continuing into the valley " + "west of here. The path to the east " + //, and also running north as a trail " + //"deeper into the wilderness. The path to the east " + "leads back to the safety of the town."); + SetExits( ([ + "west" : "/domains/town/room/valley", + "east" : "/domains/town/room/forest_path1", + ]) ); + SetItems( ([ + "clearing" : "An area with few trees.", + "path" : "This forest path runs east " + "and west. A small trail goes north of here.", + ({"forest","wood","woods"}) : "This is a " + "dark, creepy forest. You are standing on a " + "path in a clearing, so it's a bit brighter here.", + ({ "small trail","trail"}) : "A small trail leading into the depths " + "of the forest to the north.", + "valley" : "A valley is west of here.", + "town" : "A town, far in the eastern distance." + ]) ); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/clerk.c ds2.0r27/lib/domains/town/room/clerk.c *** ds1.1/lib/domains/town/room/clerk.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/clerk.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,32 ---- + #include <lib.h> + inherit LIB_CHAPEL; + + static void create() { + chapel::create(); + SetTown("town"); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Town Clerk"); + SetLong("This small office is where people come to conduct their official public\nbusiness. The main area of the town hall is east."); + SetProperties (([ + "no attack":1, + "no bump":1, + "no steal":0, + "no magic":0, + "no paralyze":0, + "no teleport":0])); + SetItems(([])); + SetInventory(([ + "/domains/town/npc/clerk" : 1, + ])); + SetObviousExits("e"); + AddExit("east", "/domains/town/room/thall"); + //funs + //snuf + } + void init() { + ::init(); + SetSmell(([])); + SetListen(([])); + } + //extras diff -c -r --new-file ds1.1/lib/domains/town/room/confroom.c ds2.0r27/lib/domains/town/room/confroom.c *** ds1.1/lib/domains/town/room/confroom.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/confroom.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,123 ---- + #include <lib.h> + #include <rooms.h> + + inherit LIB_ROOM; + + int privacy, timer; + string ExtraDesc(); + static void create() { + string privs; + privs = query_privs(); + if( privs ) privs = capitalize(privs); + else privs = "a creator"; + room::create(); + SetClimate("indoors"); + SetAmbientLight(40); + SetShort("Conference Room"); + SetLong((: ExtraDesc :)); + SetInventory(([ + "/domains/town/obj/bbucket" : 1, + "/domains/town/obj/chair" : 4, + ])); + SetExits(([ + "west" : "/domains/town/room/adv_guild", + ])); + + SetProperties(([ + "no attack" : 1, + "nopeer" : 1, + ])); + privacy=0; + set_heart_beat(20); + timer = 0; + + } + + int AutoDeactivate(){ + message("info","%^RED%^The privacy field shuts off.%^RESET%^", this_object()); + timer = 0; + privacy = 0; + return 1; + } + + void init(){ + ::init(); + add_action("privacy","privacy"); + add_action("privacy","priv"); + add_action("report_time","timer"); + } + + void heart_beat(){ + if(timer && (time() - timer ) > 1200) AutoDeactivate(); + } + + int report_time(){ + int secs = time() - timer; + //tc("time: "+time()); + //tc("timer: "+timer); + + if(!timer){ + write("Privacy field is not active."); + return 0; + } + + write("Elapsed seconds: "+secs); + write("Elapsed minutes: "+(secs/60)); + return secs; + } + + int CanReceive(object ob) { + if(privacy){ + if(!interactive(ob)) { + message("info","\n\nPRIVACY WARNING: "+ob->GetName()+" has entered the room.\n\n",this_object() ); + } + else if(!archp(ob)){ + message("info","You bounce off the conference room privacy shield.", ob); + message("info",ob->GetName()+" bounced off the privacy shield.",this_object()); + if(!environment(ob)) ob->eventMoveLiving(ROOM_START); + return 0; + } + + } + return 1; + } + + int set_privacy(int i){ + if(environment(this_player()) != this_object() && !archp(this_player())) { + write("You lack the adequate privileges to do that."); + say(this_player()->GetName()+" is trying to mess around with the privacy shield system."); + return 1; + } + privacy=i; + return 1; + } + + int privacy(string str){ + if(environment(this_player()) != this_object() && !archp(this_player())) { + write("You lack the adequate privileges to do that."); + say(this_player()->GetName()+" is trying to muck around with the privacy shield system."); + return 1; + } + + if(str=="on" || str == "1"){ + this_object()->set_privacy(1); + write("You enable the privacy shield.\n"); + say(this_player()->GetName()+" enables a privacy force field around the room."); + timer = time(); + return 1; + } + if(str=="off" || str == "0"){ + this_object()->set_privacy(0); + write("You disable the privacy shield.\n"); + say(this_player()->GetName()+" disables a privacy force field around the room."); + timer = 0; + return 1; + } + } + + string ExtraDesc(){ + string extra = "%^YELLOW%^A privacy force field is active around this room.%^RESET%^"; + string desc = "This is an enchanted room, with the magical power to prevent uninvited people from entering. It is used for meetings where three or more people need to share information without interruption or privately. To enable privacy, 'privacy on'. To disable it, 'privacy off'. The privacy field automatically deactivates after approximately 20 minutes.\n"; + if(privacy) return desc+extra; + else return desc+"%^RED%^The privacy field is DISABLED."; + } diff -c -r --new-file ds1.1/lib/domains/town/room/death.c ds2.0r27/lib/domains/town/room/death.c *** ds1.1/lib/domains/town/room/death.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/death.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,65 ---- + #include <lib.h> + #include <dirs.h> + #include <rooms.h> + + inherit LIB_ROOM; + + string FunkyPic(); + int CheckChat(); + int StartHeart(object ob); + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("off the mortal coil"); + SetLong( (:FunkyPic:) ); + SetObviousExits("no exit"); + set_heart_beat(10); + SetNoModify(1); + } + + void init(){ + ::init(); + add_action("regenerate","regenerate"); + add_action("wander","wander"); + this_object()->CheckChat(); + } + + string FunkyPic(){ + return read_file("/domains/default/etc/death.txt"); + } + + int regenerate(){ + write("With a great rush of matter and energy, you rematerialize "+ + "into a corporeal state, and find yourself in a familiar place..."); + this_player()->eventRevive(); + this_player()->eventMoveLiving(ROOM_START); + return 1; + } + + int wander(){ + write("There is a strange, hollow vibration all around you, and you "+ + "realize that some force is compelling your ethereal form elsewhere..."+ + "you find yourself in a place that is known to you, yet oddly new."); + this_player()->eventMoveLiving(ROOM_START); + return 1; + } + + void heart_beat(){ + tell_room(this_object(), "A voice whispers: \" You may choose to "+ + "regenerate into a new body here.\""); + return; + } + + + int CanRelease(object ob){ + if(userp(ob) && ob->GetGhost() && environment(ob) == this_object()) { + tell_player(ob,"\n%^RED%^Your undead spirit is recalled and as you leave "+ + "the underworld a new body regenerates around you. "+ + "You live again!%^RESET%^\n"); + ob->eventRevive(); + } + return 1; + } + diff -c -r --new-file ds1.1/lib/domains/town/room/elevator.c ds2.0r27/lib/domains/town/room/elevator.c *** ds1.1/lib/domains/town/room/elevator.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/elevator.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,122 ---- + #include <lib.h> + inherit LIB_ROOM; + + int doorcounter,callfloor,closed,floor,counter,moving; + string floorname; + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Church Elevator"); + SetLong("This is the elevator in the village church. The " + "elevator door is on the east wall. Two buttons are " + "set into the wall next to the door."); + floor=1; + moving = 0; + closed=1; + callfloor=0; + SetExits( ([ + "east" : "/domains/town/room/church", + ]) ); + SetObviousExits("e"); + SetItems(([ + "elevator" : "A means of vertical indoors transportation.", + "wall" : "The buttons are on the wall.", + ({"elevator door","door"}) : "The door to the outside." + + ]) ); + AddItem(new("/domains/town/obj/ebutton2")); + AddItem(new("/domains/town/obj/ebutton1")); + set_heart_beat(1); + } + void init(){ + ::init(); + set_heart_beat(1); + } + int CallMe(int i){ + if(i == floor && moving == 0) { + this_object()->SetDoor(0); + return 1; + } + else callfloor = i; + return 1; + } + int SetDoor(int i){ + if(i && i == closed) return i; + if(!i && closed == 0) return i; + if(i == 0 && closed == 0) return i; + if(i) closed = i; + else if( closed == 1 ) closed = 0; + else if( closed == 0 ) closed =1; + if(floor == 1) floorname = "/domains/town/room/church"; + if(floor == 2) floorname = "/domains/town/room/basement"; + if(closed < 1){ + tell_room(this_object(),"The elevator door opens."); + tell_room(load_object(floorname),"The elevator door opens."); + doorcounter = 10; + } + if(closed > 0) { + tell_room(this_object(),"The elevator door closes."); + tell_room(load_object(floorname),"The elevator door closes."); + doorcounter = 0; + } + return closed; + } + int SetFloor(int i){ + if(floor == i) return 0; + RemoveExit("east"); + floor = i; + if(i == 1) AddExit("east", "/domains/town/room/church"); + if(i == 2) AddExit("east", "/domains/town/room/basement"); + return 1; + } + int CanReceive(object ob) { + //tc("verb: "+query_verb()); + if(closed > 0 && query_verb() == "go"){ + message("info","The elevator door is closed.", ob); + return 0; + } + return 1; + } + int CanRelease(object ob){ + if(closed > 0 && !creatorp(ob) && query_verb() == "go" ){ + message("info","The elevator door is closed.", ob); + return 0; + } + return 1; + } + varargs int eventRoll(int i){ + if(!i) i = 10; + moving = 1; + SetDoor(1); + counter = i; + return i; + } + void heart_beat(){ + if(doorcounter > 0){ + doorcounter--; + if(doorcounter < 2) SetDoor(1); + } + + if(moving == 0 && closed == 1 && callfloor > 0){ + tell_room(this_object(),"The elevator lurches into motion."); + eventRoll(); + } + + if(moving && moving > 0){ + counter--; + if(counter % 5 == 0) { + tell_room(this_object(),"The elevator continues..."); + } + + if(counter < 2) { + counter = 0; + moving = 0; + SetFloor(callfloor); + tell_room(this_object(),"The elevator arrives at its destination."); + //tell_room(this_object(),"A voice says \"Floor "+cardinal(floor)+".\""); + SetDoor(0); + callfloor = 0; + } + } + } diff -c -r --new-file ds1.1/lib/domains/town/room/forest_path1.c ds2.0r27/lib/domains/town/room/forest_path1.c *** ds1.1/lib/domains/town/room/forest_path1.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/forest_path1.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,41 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("outdoors"); + SetAmbientLight(30); + SetShort("Forest Path"); + SetLong("You are in a forest outside the town. " + "To the west the path continues toward a clearing. To the " + "east it leads to a bridge over a river and returns to the village. " + "Trees and bushes of various sorts border the path. "); + SetItems( ([ + "forest" : "You are on a path in a dark, creepy forest. The " + "vegetation is thick and feels somehow oppressive.", + ({"plants","bushes","vegetation","tree","trees","bush"}) : + "The plants, bushes, and trees grow thick and wild " + "here, limiting visibility beyond the path.", + "bridge" : "An old bridge is east of here.", + "clearing" : "It looks like there is a clearing in the " + "forest to the west.", + "path" : "You are on a path in a forest." + ]) ); + SetExits( ([ + "east" : "/domains/town/room/bridge", + "west" : "/domains/town/room/clearing", + "north" : "/domains/town/virtual/forest/24,1" , + ]) ); + } + void init(){ + ::init(); + } + + int CanReceive(object ob){ + if(!interactive(ob) && starts_with(base_name(environment(ob)),"/domains/town/virtual")){ + write("You find yourself unable to leave the forest."); + return 0; + } + return ::CanReceive(); + } + diff -c -r --new-file ds1.1/lib/domains/town/room/freezer.c ds2.0r27/lib/domains/town/room/freezer.c *** ds1.1/lib/domains/town/room/freezer.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/freezer.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,37 ---- + #include <lib.h> + #include <config.h> + #include <rooms.h> + + inherit LIB_ROOM; + + static private object *Old; + + void create() { + room::create(); + SetNoClean(1); + SetProperties(([ "login" : ROOM_START])); + SetShort( "The freezer"); + SetLong( "The local freezer. Go down to leave."); + SetObviousExits("d"); + SetExits( ([ "down" : ROOM_START ]) ); + Old = ({}); + call_out("clean_room", MAX_NET_DEAD_TIME); + SetNoModify(1); + } + + static void clean_room() { + object *clean_me; + object ob; + + foreach(ob in filter(all_inventory(), (: !living($1) :))) + ob->eventDestruct(); + if( !sizeof(filter(all_inventory(), (: living :))) ) { + Old = ({}); + call_out((: clean_room :), MAX_NET_DEAD_TIME); + return; + } + clean_me = (all_inventory() & Old); + Old = all_inventory() - clean_me; + foreach(ob in clean_me) ob->eventDestruct(); + call_out((: clean_room :), MAX_NET_DEAD_TIME); + } diff -c -r --new-file ds1.1/lib/domains/town/room/furnace.c ds2.0r27/lib/domains/town/room/furnace.c *** ds1.1/lib/domains/town/room/furnace.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/furnace.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,36 ---- + #include <lib.h> + #include <rooms.h> + + inherit LIB_ROOM; + + void create() { + room::create(); + SetAmbientLight(30); + SetShort("the furnace"); + SetLong("The furnace. Things that arrive here are "+ + "incinerated. You probably shouldn't be here. Go down to get out."); + SetProperties(([ + "no attack" : 1, + ])); + SetExits( ([ "down" : ROOM_START ]) ); + call_out((: reload_room :), 600, load_object(base_name(this_object()))); + set_heart_beat(1); + SetNoModify(1); + } + int CanReceive(object ob){ + if(interactive(ob)){ + tell_object(ob, "You fail to enter the furnace."); + return 0; + } + return 1; + } + void init(){ + ::init(); + } + void heart_beat(){ + if(sizeof(all_inventory(this_object()))){ + foreach(object ob in deep_inventory(this_object())){ + ob->eventDestruct(); + } + } + } diff -c -r --new-file ds1.1/lib/domains/town/room/garden.c ds2.0r27/lib/domains/town/room/garden.c *** ds1.1/lib/domains/town/room/garden.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/garden.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,29 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("outdoors"); + SetAmbientLight(30); + SetShort("Mansion Garden"); + SetLong("This is what is left of what was once a beautiful, " + "if simple, garden. It is now badly overgrown with " + "weeds, and it is clear that foraging animals long " + "ago ate the delicate flowers and vegetables that " + "once grew here. The gardener's shack is north."); + SetItems(([ + ({ "flowers", "vegetables", "flowers and vegetables" }) : "If they were once here, they certainly no longer are.", + ({ "shack", "wooden shack" }) : "A beaten-up old wooden shack is north.", + "garden" : "A mess of weeds and dirt.", + ])); + SetExits( ([ + "east" : "/domains/town/room/mansion_ext", + "north" : "/domains/town/room/shack" + ])); + SetEnters( ([ + "shack" : "/domains/town/room/shack", + ]) ); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/gate.c ds2.0r27/lib/domains/town/room/gate.c *** ds1.1/lib/domains/town/room/gate.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/gate.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,64 ---- + #include <lib.h> + inherit LIB_ROOM; + + + int PreExit(){ + if(this_player()->GetLevel() > 3 && !creatorp(this_player())){ + if(present("gate guard",this_object())){ + present("gate guard",this_object())->eventForce("say You're too big to slip by me now. You're not going to the mansion any more."); + } + else { + tell_object(this_player(),"A reality distortion forms around you as you try to go south, and you wind up where you started."); + } + return 0; + } + if(present("gate guard",this_object())){ + tell_object(this_player(),"You are such a newbie that the gate guard doesn't even notice you slip by him."); + tell_room(this_object(),this_player()->GetName()+" sneaks past the gate guard.",({ this_player() }) ); + } + return 1; + } + static void create() { + room::create(); + SetClimate("outdoors"); + SetAmbientLight(30); + SetShort("Mansion Gate"); + SetLong("You are standing just north of the gate to a large, "+ + "beautiful mansion, which stands to the south. The "+ + "Corinthian capitals on the front pillars bespeak "+ + "of the wealth and importance of the person who "+ + "lives here. Lush ivy wraps around the gate and the "+ + "brick wall surrounding the estate."); + SetItems( ([ + "gate" : "A handsome, wrought-iron entry control point.", + ({"estate", "mansion"}) : "The grounds of a mansion are to the south.", + ({"capital","capitals","corinthian capital","corinthian capitals"}) : + "These are the headpieces of the pillars supporting the " + "mansion's front overhang. The beautifully detailed " + "carvings of encanthus leaves distinguish them as " + "Corinthian.", + ({"overhang","front overhang"}) : "A fancy and unnecessary " + "structure in front of the mansion supported by " + "columns.", + ({"pillar","pillars","column","columns"}) : "Load-bearing " + "structures supporting the mansion's front overhang.", + ({"ivy","lush ivy"}) : "Vines of the ivy plant run " + "over and along the walls and gate, so thickly that " + "they nearly obscure them.", + ({"wall","walls"}) : "Architectural features which prevent " + "casual entry. They are made of brick and appear old " + "and strong.", + ]) ); + SetExits( ([ + "north" : "/domains/town/room/road1", + ]) ); + AddExit("south", "/domains/town/room/mansion_ext", (: PreExit :)); + AddStuff( ({ + "/domains/town/npc/mp" + }) ); + + SetProperty("no attack", 1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/healer.c ds2.0r27/lib/domains/town/room/healer.c *** ds1.1/lib/domains/town/room/healer.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/healer.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,53 ---- + #include <lib.h> + inherit LIB_SHOP; + inherit LIB_AMBIANCE; + + int ReadList(){ + write("AVAILABLE PROCEDURES:\n" + //"\texcision, cost 1000:\tcut away foreign material\n" + "\thealing, cost 200:\tfacilitate rapid recovery from wounds\n" + //"\tcuring, cost 1500:\t\tremove infections and infestations\n" + "\tregeneration, cost 1200:\tgrow back severed limbs\n" + "\n" + "Example: If you are badly hurt and need healing:\n\n" + "\"buy healing slip from james\"\n" + "\n" + "Once you have your slip, go west to see the doctor and " + "give the slip to him.\n" + + ); + return 1; + } + static void create() { + ::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("The Healer's Guild"); + SetLong("You are in the Healer's Guild. People come " + "here when they have medical problems, and " + "for a price, they are helped. A list of " + "available procedures is hung on the wall. " + "It seems that the doctor's work area is " + "west of here. Tavern Road is east."); + SetItems( ([ + ({"list","list on the wall"}) : "A list of available procedures", + "wall" : "A flat, vertical structure supporting the ceiling.", + ({"work area","doctor's work area"}) : "It is west of here.", + ({"road","tavern road"}) : "The road is outside, east of here." + ]) ); + SetRead( ({"list","list on wall"}) , (: ReadList :) ); + SetInventory(([ + "/domains/town/obj/bbucket" :1, + "/domains/town/npc/james" :1 + ]) ); + SetExits( ([ + "east" : "/domains/town/room/road", + "out" : "/domains/town/room/road", + "west" : "/domains/town/room/chamber", + ]) ); + SetProperty("no attack", 1); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/healer2.c ds2.0r27/lib/domains/town/room/healer2.c *** ds1.1/lib/domains/town/room/healer2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/healer2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,29 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Healer's Guild Storeroom"); + SetLong("This blank room is where the guild keeps their junk."); + SetInventory(([ + "/domains/town/obj/slip_heal" : 100, + "/domains/town/obj/slip_regenerate" : 10, + ])); + SetExits( ([ + "east" : "/domains/town/room/chamber", + ]) ); + SetObviousExits("e"); + + } + int CanReceive(object ob) { + if(playerp(ob) && !creatorp(ob) && !present("testchar badge",ob)) { + message("info","The storeroom is for guild officers only.", ob); + return 0; + } + return 1; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/magic_guild.c ds2.0r27/lib/domains/town/room/magic_guild.c *** ds1.1/lib/domains/town/room/magic_guild.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/magic_guild.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,45 ---- + #include <lib.h> + inherit LIB_ROOM; + + int ReadList(){ + write("AVAILABLE SPELLS:\n\n" + "\tfireball, cost 1000:\tput the hurt on an opponent\n" + "\tmissile, cost 500:\tCheaper and easier to learn than fireball\n" + "\tbuffer, cost 200:\tconjure an invisible shield around you\n" + "\tmeditate, cost 500:\tconjure an aura that speeds stamina recovery\n" + "\n" + "Example: If you want to learn the buffer spell:\n\n" + "\"ask herkimer to teach buffer\"\n" + "\n" + "Please note that the spell may fail many times before " + "you have enough practice and experience to cast " + "it properly. All sales final.\n" + + ); + return 1; + } + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("The Mages' Guild"); + SetLong("This is the local mage's guild. Here you can ask "+ + "the guildmaster to let you join, or to teach you spells. "+ + "For example, you may \"ask herkimer to join\" or "+ + "\"ask herkimer to teach missile\". The magic shop "+ + "is north." + "\n%^GREEN%^There is a list of spells you can read.%^RESET%^"); + SetItems( ([ + ({"list","list on the wall"}) : "A list of available spells", + ]) ); + SetRead(({"list","list on wall"}) , (: ReadList :) ); + SetExits( ([ + "north" : "/domains/town/room/magic_shop" + ]) ); + SetObviousExits("n"); + AddStuff( ({ "/domains/town/npc/herkimer" }) ); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/magic_shop.c ds2.0r27/lib/domains/town/room/magic_shop.c *** ds1.1/lib/domains/town/room/magic_shop.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/magic_shop.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,46 ---- + #include <lib.h> + inherit LIB_SHOP; + + int read_sign(); + static void create() { + ::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("The Magic Shop"); + SetLong("This is the local magic shop. Magical items can be "+ + "bought and sold here. The storeroom is "+ + "west and the town Mages' Guild is south. "+ + "\n%^GREEN%^There is a sign here you can read.%^RESET%^"); + SetItems(([ + ({"store","shop","place"}) : "This is the local magic shop.", + ({ "sign" ,"sign on the wall" }): "A sign on the wall, meant for reading.", + ])); + SetRead("sign", (: read_sign :) ); + SetExits( ([ + "out" : "/domains/town/room/south_road1", + "east" : "/domains/town/room/south_road1", + "south" : "/domains/town/room/magic_guild", + "west" : "/domains/town/room/magic_shop2", + ]) ); + SetInventory( ([ + "/domains/town/npc/oana" : 1, + "/domains/town/obj/bbucket" : 1, + ]) ); + } + int read_sign(){ + write("HOW TO CONDUCT BUSINESS HERE\n"); + write("list : Get a list of all the items Oana has for sale"); + write("appraise <item> : Ask Oana to tell you how much she would pay you for your item"); + write("price <item> : Ask Oana the price of her item"); + write("show <item> : Ask Oana for a closer look at her item\n"); + write("\nbuy <item> from oana\nsell <item> to oana\n"); + write("Prices shown are in silver coins."); + write("\n\nWe're still under construction, so there's"); + write("not much to buy. But if you want, you can go "); + write("south to the mage's guild and join up!"); + + return 1; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/magic_shop2.c ds2.0r27/lib/domains/town/room/magic_shop2.c *** ds1.1/lib/domains/town/room/magic_shop2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/magic_shop2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,27 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("The Magic Shop Storeroom"); + SetLong("This is the storeroom where magical items are kept."); + SetExits( ([ + "east" : "/domains/town/room/magic_shop", + ]) ); + SetObviousExits("e"); + SetInventory( ([ + "/domains/town/obj/omni" : 1, + ]) ); + } + int CanReceive(object ob) { + if( playerp(ob) && !creatorp(ob) && !present("testchar badge",ob) ) { + message("info","The storeroom is for authorized personnel only.",ob); + return 0; + } + return 1; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/mansion_dhall2.c ds2.0r27/lib/domains/town/room/mansion_dhall2.c *** ds1.1/lib/domains/town/room/mansion_dhall2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/mansion_dhall2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,29 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Downstairs Mansion Hallway"); + SetLong("You are in the beautifully decorated downstairs " + "hallway of the mansion. There are rooms to " + "the east and west, and the hallway continues " + "south. To the north is the entrance foyer."); + SetItems( ([ + "hallway" : "An interior area providing access to " + "other places in the house.", + ({"mansion","house"}) : "You are in a beautiful mansion.", + "foyer" : "The mansion's entry area is north of here." + ]) ); + + SetExits( ([ + "north" : "/domains/town/room/mansion_int", + "south" : "/domains/town/room/mansion_dhall3", + "east" : "/domains/town/room/mansion_room9", + "west" : "/domains/town/room/mansion_room10" + ]) ); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/mansion_dhall3.c ds2.0r27/lib/domains/town/room/mansion_dhall3.c *** ds1.1/lib/domains/town/room/mansion_dhall3.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/mansion_dhall3.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,33 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Downstairs Mansion Hallway South"); + SetLong("You are in the beautifully decorated downstairs " + "hallway of the mansion. There are rooms to " + "the east and west, and the hallway continues " + "north. A large, " + "circular marble staircase leads up to the " + "second floor."); + SetItems( ([ + "hallway" : "An interior area providing access to " + "other places in the house.", + ({"mansion","house"}) : "You are in a beautiful mansion.", + ({"stairs","staircase"}) : "A marvelously sculpted " + "series of steps spiraling upward to the " + "second floor. It is carved from marble." + ]) ); + + SetExits( ([ + "north" : "/domains/town/room/mansion_dhall2", + "up" : "/domains/town/room/mansion_uhall3", + "east" : "/domains/town/room/mansion_room7", + "west" : "/domains/town/room/mansion_room8" + ]) ); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/mansion_ext.c ds2.0r27/lib/domains/town/room/mansion_ext.c *** ds1.1/lib/domains/town/room/mansion_ext.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/mansion_ext.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,35 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("outdoors"); + SetAmbientLight(40); + SetShort("Mansion Exterior"); + SetLong("You are standing outside a large, beautiful mansion " + "that stands south of you. It towers over you and " + "overhead you can see one of the second floor " + "windows is open. The grass seems a bit wild " + "around here, and the lawn continues west into " + "an overgrown garden. The mansion gate is north."); + SetItems( ([ + ({"house","mansion"}) : "A stately pleasure dome.", + ({"window","second floor window"}) : "This is " + "an open window, high above you. If you had a ladder, you " + "might be able to climb up enough to enter.", + ({"grass","lawn","garden"}) : "Rather unkempt " + "greenery. Looks like the gardener's been on " + "vacation.", + ({"gate","mansion gate"}) : "The entry point into " + "the estate on which you now stand." + ]) ); + SetExits( ([ + "north" : "/domains/town/room/gate", + "west" : "/domains/town/room/garden", + "south" : "/domains/town/room/mansion_int", + ]) ); + SetDoor("south","/domains/town/doors/mansion"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/mansion_int.c ds2.0r27/lib/domains/town/room/mansion_int.c *** ds1.1/lib/domains/town/room/mansion_int.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/mansion_int.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,29 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Mansion Foyer"); + SetLong("This is the foyer of a grand, majestic mansion. Strangely, " + "there is dust everywhere, but the place looks " + "beautiful all the same. A hallway runs south " + "from here."); + SetItems( ([ + "foyer" : "This is the interior entry area of the " + "mansion, where the front door is.", + ({"hall","hallway"}) : "A wide corridor " + "leading south to the rest of the mansion.", + "dust" : "Tiny particulate material dispersed " + "on visible surfaces." + ]) ); + SetExits( ([ + "south" : "/domains/town/room/mansion_dhall2", + "north" : "/domains/town/room/mansion_ext", + ]) ); + SetDoor("north","/domains/town/doors/mansion"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/mansion_mbdroom.c ds2.0r27/lib/domains/town/room/mansion_mbdroom.c *** ds1.1/lib/domains/town/room/mansion_mbdroom.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/mansion_mbdroom.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,44 ---- + #include <lib.h> + inherit LIB_ROOM; + + int open; + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Mansion Master Bedroom"); + SetLong("You are in the master bedroom. The decor here is " + "beautiful, ornate, and extravagant. It is obvious that " + "the people who live here are rich and possess great " + "taste. "); + SetItems( ([ + "decor" : "Impressive, ornate, and beautiful.", + ]) ); + SetInventory( ([ + "/domains/town/obj/bed" : 1, + "/domains/town/obj/wardrobe" : 1, + ]) ); + SetExits( ([ + "north" : "/domains/town/room/mansion_uhall3" + ]) ); + SetObviousExits("n"); + open = 0; + } + int OpenPassage(){ + string desc; + if(open == 1) return 1; + tell_room(environment(this_player()),"A secret passageway is revealed!"); + open = 1; + desc = GetLong(); + desc += "\n%^MAGENTA%^There is a newly-opened secret passageway here. %^RESET%^"; + SetLong(desc); + AddItem(({"secret passageway","passageway"}) , "A passageway you can enter."); + SetEnters(([ + "passageway" : "/domains/town/room/mansion_room11", + "secret passageway" : "/domains/town/room/mansion_room11" + ]) ); + return 1; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/mansion_room1.c ds2.0r27/lib/domains/town/room/mansion_room1.c *** ds1.1/lib/domains/town/room/mansion_room1.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/mansion_room1.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,28 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Mansion Guest Room East"); + SetLong("You are in the east upstairs guest room of the mansion. " + "The room is sumptuously appointed and furnished. " + "The state of the bed suggests that someone has " + "been staying here recently."); + SetItems( ([ + ({"furniture","furnishings"}) : "Comfortable and attractive." + ]) ); + SetExits( ([ + "west" : "/domains/town/room/mansion_uhall1" + ]) ); + SetInventory(([ + "/domains/town/obj/obag" :1, + "/domains/town/obj/gbed" :1, + "/domains/town/armor/boot_l" :1, + "/domains/town/armor/boot_r" :1, + ]) ); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/mansion_room10.c ds2.0r27/lib/domains/town/room/mansion_room10.c *** ds1.1/lib/domains/town/room/mansion_room10.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/mansion_room10.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,35 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Dining Room"); + SetLong("This large room is rectangular in shape, " + "and evidently is used as a formal " + "dining room. Beautiful tapestries and " + "paintings decorate the walls, and there " + "is a sense of dignified majesty about " + "this place."); + SetItems( ([ + ({"tapestry","tapestries"}) : "Fascinating " + "tapestries here apear to document the conquest " + "of Anglia by a Norman king.", + ({"painting","paintings"}) : "These are " + "extraordinary oil portraits of renaissance " + "nobility, and they are rendered with an " + "eerily lifelike realism.", + ]) ); + //AddStuff( ({ "/domains/town/obj/dining_table" }) ); + SetInventory( ([ + "/domains/town/obj/dining_table" : 1, + ]) ); + SetExits( ([ + "east" : "/domains/town/room/mansion_dhall2" + ]) ); + SetObviousExits("e"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/mansion_room11.c ds2.0r27/lib/domains/town/room/mansion_room11.c *** ds1.1/lib/domains/town/room/mansion_room11.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/mansion_room11.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,17 ---- + #include <lib.h> + inherit LIB_ROOM; + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Secret Room"); + SetLong("You are in a small, cramped room."); + SetExits( ([ + "out" : "/domains/town/room/mansion_mbdroom", + "north" : "/domains/town/room/mansion_mbdroom" + ]) ); + SetObviousExits("n"); + SetInventory( ([ + "/domains/town/obj/safe" : 1, + ]) ); + } diff -c -r --new-file ds1.1/lib/domains/town/room/mansion_room12.c ds2.0r27/lib/domains/town/room/mansion_room12.c *** ds1.1/lib/domains/town/room/mansion_room12.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/mansion_room12.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,41 ---- + #include <lib.h> + inherit LIB_ROOM; + + int CheckQuest(object ob); + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Secret Chamber"); + SetLong("You are in a secret underground chamber beneath the " + "mansion."); + SetExits( ([ + "up" : "/domains/town/room/mansion_room9" + ]) ); + SetObviousExits("u"); + SetInventory( ([ + "/domains/town/obj/chest2" : 1, + ]) ); + SetDoor("up", "/domains/town/doors/trapdoor"); + } + void init(){ + ::init(); + CheckQuest(this_player()); + } + int CheckQuest(object ob){ + string *quests; + quests = ob->GetQuests(); + if(!ob->GetQuest("Newbie Mansion Chamber Quest")){ + ob->AddQuest("the Finder of Hidden Chambers","Newbie Mansion Chamber Quest"); + write("\n\nCONGRATULATIONS!\n"); + write("You have solved the secret quest of the "+ + "Hidden Mansion Chamber. You have "+ + "earned 2 quest points, and 1500 experience "+ + "points. Nice job!\n\n"); + say(this_player()->GetName()+" solves newbie quest 1."); + ob->AddQuestPoints(2); + ob->AddExperiencePoints(1500); + return 1; + } + return 1; + } diff -c -r --new-file ds1.1/lib/domains/town/room/mansion_room2.c ds2.0r27/lib/domains/town/room/mansion_room2.c *** ds1.1/lib/domains/town/room/mansion_room2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/mansion_room2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,44 ---- + #include <lib.h> + inherit LIB_ROOM; + + int found; + string SearchFun(){ + string result; + if(found == 0){ + result="You search the room and find a gold ring!"; + tell_room(this_object(),this_player()->GetName()+ + " searches the room and finds something ", + ({ this_player() }) ); + new("/domains/town/armor/newbie_ring")->eventMove(this_object()); + found = 1; + return result; + } + return "You find nothing special."; + } + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Mansion Guest Room West"); + SetLong("You are in the west upstairs guest room of the mansion. " + "The room is sumptuously appointed and furnished. " + "It looks as though nobody has dusted here in a " + "very long time. "); + SetExits( ([ + "east" : "/domains/town/room/mansion_uhall1" + ]) ); + SetItems( ([ + ({"here","area","place","room"}) : "A guest room in the mansion.", + "dust" : "There's some dust here, a bit more than one might expect in such a nice place.", + ]) ); + SetInventory(([ + "/domains/town/obj/gbed" : 1, + ]) ); + SetObviousExits("e"); + SetSearch( ([ "default" : (: SearchFun :) ]) ); + found = 0; + } + void init(){ + ::init(); + AddSearch( ({"here","area","place","room"}) , (: SearchFun :) ); + } diff -c -r --new-file ds1.1/lib/domains/town/room/mansion_room3.c ds2.0r27/lib/domains/town/room/mansion_room3.c *** ds1.1/lib/domains/town/room/mansion_room3.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/mansion_room3.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,33 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Upstairs Bathroom"); + SetLong("You are in a bathroom. It is rather ordinary, " + "for such a grand mansion, but it appears " + "quite functional and mostly clean. There is " + "a shower stall here you can enter."); + SetItems( ([ + ({"stall","shower stall","shower" }) : "A shower stall.", + ({"sink","bathroom sink" }) : "An ordinary sink.", + ]) ); + SetExits( ([ + "west" : "/domains/town/room/mansion_uhall2" + ]) ); + SetInventory( ([ + "/domains/town/obj/toilet" : 1, + "/domains/town/obj/mat" : 1 + ]) ); + SetEnters( ([ + "stall" : "/domains/town/room/shower", + "shower stall" : "/domains/town/room/shower", + "shower" : "/domains/town/room/shower" + ]) ); + SetObviousExits("w"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/mansion_room4.c ds2.0r27/lib/domains/town/room/mansion_room4.c *** ds1.1/lib/domains/town/room/mansion_room4.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/mansion_room4.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,29 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Game room"); + SetLong("You are in the game room. The walls have been paneled " + "in beautiful oak, and the thick carpeting " + "feels quite nice under your feet."); + SetItems( ([ + ({"wall","walls"}) : "It's beautiful oak paneling, " + "with a deep, rich coat of stain.", + ({"carpet","carpeting"}) : "It's plush, soft, and " + "very comfortable." + ]) ); + AddStuff( ({ + "/domains/town/obj/btable", + "/domains/town/obj/pool_table" + }) ); + SetExits( ([ + "east" : "/domains/town/room/mansion_uhall2" + ]) ); + SetObviousExits("e"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/mansion_room5.c ds2.0r27/lib/domains/town/room/mansion_room5.c *** ds1.1/lib/domains/town/room/mansion_room5.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/mansion_room5.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,21 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("The Study"); + SetLong("You are in the study of the master of the house. "+ + "This room is a shambles! It appears to have "+ + "been ransacked in great haste. If there "+ + "ever was anything of value here, it's "+ + "probably long gone."); + SetExits( ([ + "west" : "/domains/town/room/mansion_uhall3" + ]) ); + SetObviousExits("w"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/mansion_room6.c ds2.0r27/lib/domains/town/room/mansion_room6.c *** ds1.1/lib/domains/town/room/mansion_room6.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/mansion_room6.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Servants' Quarters"); + SetLong("You are in the spartan quarters of the on-duty " + "staff. From the lack of personalization, " + "it seems that the servants probably rotate " + "after-hours duty."); + SetInventory( ([ + "/domains/town/obj/cot" :1, + ]) ); + SetExits( ([ + "east" : "/domains/town/room/mansion_uhall3" + ]) ); + SetObviousExits("e"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/mansion_room7.c ds2.0r27/lib/domains/town/room/mansion_room7.c *** ds1.1/lib/domains/town/room/mansion_room7.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/mansion_room7.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("kitchen"); + SetLong("This is a very large kitchen designed to " + "accommodate dozens of cooks. It looks like nobody " + "has prepared a meal here in quite some time."); + SetExits( ([ + "west" : "/domains/town/room/mansion_dhall3" + ]) ); + SetObviousExits("w"); + SetInventory( ([ + "/domains/town/obj/rack" : 1, + "/domains/town/obj/stove" : 1, + ]) ); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/mansion_room8.c ds2.0r27/lib/domains/town/room/mansion_room8.c *** ds1.1/lib/domains/town/room/mansion_room8.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/mansion_room8.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,22 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Grand Ballroom"); + SetLong("This huge room is spectacular both in size " + "and decor. Clearly the centerpiece of the mansion, " + "this ballroom could easily accommodate hundreds of " + "guests. The vaulted ceiling is dozens of feet high, and " + "the polished marble floors feature beautiful, " + "dazzling designs."); + SetExits( ([ + "east" : "/domains/town/room/mansion_dhall3" + ]) ); + SetObviousExits("e"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/mansion_room9.c ds2.0r27/lib/domains/town/room/mansion_room9.c *** ds1.1/lib/domains/town/room/mansion_room9.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/mansion_room9.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,54 ---- + #include <lib.h> + inherit LIB_ROOM; + + int revealed; + int PreExit(){ + object ob = present("thief in a bathtowel",this_object()); + if(ob && base_name(ob) != "/lib/std/corpse"){ + write("The wet thief bars your way!"); + return 0; + } + return 1; + } + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Sitting Room"); + SetLong("You are in a luxurious sitting room, decorated " + "and furnished with the same excellent taste and " + "attention to detail as the rest of the " + "mansion."); + SetItems( ([ + ({"furniture","furnishings","decorations"}) : + "You see evidence of a refined aesthetic " + "sensibility." + ]) ); + SetInventory( ([ + "/domains/town/obj/rug" :1, + "/domains/town/npc/thief" :1 + ]) ); + SetExits( ([ + "west" : "/domains/town/room/mansion_dhall2" + ]) ); + revealed = 0; + } + int TellRevealed(){ + if(revealed) return revealed; + else return 0; + } + int RevealDoor(){ + if(revealed == 1) { + tell_room(this_object(),"The trapdoor is already visible."); + return 1; + } + revealed = 1; + + tell_room(this_object(),"A trapdoor is revealed!"); + AddExit("down","/domains/town/room/mansion_room12", (: PreExit :)); + SetDoor("down","/domains/town/doors/trapdoor"); + return 1; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/mansion_uhall1.c ds2.0r27/lib/domains/town/room/mansion_uhall1.c *** ds1.1/lib/domains/town/room/mansion_uhall1.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/mansion_uhall1.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,33 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Upstairs Mansion Hallway North"); + SetLong("You are in the beautifully decorated upstairs " + "hallway of the mansion. There are rooms to " + "the east and west, and the hallway continues " + "south. An open window at the end of the hall " + "leads down."); + SetItems( ([ + ({"window","open window"}) : "An open window here "+ + "leads down to the exterior of the mansion.", + ({"hall","hallway"}) : "A corridor permitting "+ + "travel from one part of the mansion to another." + ]) ); + SetExits( ([ + "down" : "/domains/town/room/mansion_ext", + "south" : "/domains/town/room/mansion_uhall2", + "east" : "/domains/town/room/mansion_room1", + "west" : "/domains/town/room/mansion_room2", + "window" : "/domains/town/room/mansion_ext" + ]) ); + SetEnters( ([ + "window" : "/domains/town/room/mansion_ext" + ]) ); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/mansion_uhall2.c ds2.0r27/lib/domains/town/room/mansion_uhall2.c *** ds1.1/lib/domains/town/room/mansion_uhall2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/mansion_uhall2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,26 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Upstairs Mansion Hallway"); + SetLong("You are in the beautifully decorated upstairs " + "hallway of the mansion. There are rooms to " + "the east and west, and the hallway continues " + "north and south."); + SetItems( ([ + ({"hall","hallway"}) : "A corridor permitting "+ + "travel from one part of the mansion to another." + ]) ); + SetExits( ([ + "south" : "/domains/town/room/mansion_uhall3", + "north" : "/domains/town/room/mansion_uhall1", + "east" : "/domains/town/room/mansion_room3", + "west" : "/domains/town/room/mansion_room4" + ]) ); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/mansion_uhall3.c ds2.0r27/lib/domains/town/room/mansion_uhall3.c *** ds1.1/lib/domains/town/room/mansion_uhall3.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/mansion_uhall3.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,30 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Upstairs Mansion Hallway South"); + SetLong("You are in the beautifully decorated upstairs " + "hallway of the mansion. There are rooms to " + "the east and west, and the hallway continues " + "north. The master bedroom is south. A large, " + "circular marble staircase leads down to the " + "ground floor."); + SetItems( ([ + ({"hall","hallway"}) : "A corridor permitting "+ + "travel from one part of the mansion to another." + ]) ); + + SetExits( ([ + "south" : "/domains/town/room/mansion_mbdroom", + "north" : "/domains/town/room/mansion_uhall2", + "down" : "/domains/town/room/mansion_dhall3", + "east" : "/domains/town/room/mansion_room5", + "west" : "/domains/town/room/mansion_room6" + ]) ); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/mayor.c ds2.0r27/lib/domains/town/room/mayor.c *** ds1.1/lib/domains/town/room/mayor.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/mayor.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,32 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetTown("town"); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Mayor's office"); + SetLong("This is the rather cramped office of the town's mayor. Despite\na fair amount of clutter, it seems well suited to the mayor's \nworking style and habits."); + SetProperties (([ + "no attack":1, + "no bump":1, + "no steal":0, + "no magic":0, + "no paralyze":0, + "no teleport":0])); + SetItems(([ + "clutter" : "There are papers and folders everywhere, but the stacks and piles seem somehow a well-organized mess." , + ({"mess","stack","stacks","pile","piles","papers","paper","folder","folders"}) : "Evidence of a busy man and strangely-organized mind."])); + SetInventory(([ "/domains/town/npc/mayor" : 1])); + SetObviousExits("s"); + AddExit("south", "/domains/town/room/thall"); + //funs + //snuf + } + void init() { + ::init(); + SetSmell(([])); + SetListen(([])); + } + //extras diff -c -r --new-file ds1.1/lib/domains/town/room/mountain_road.c ds2.0r27/lib/domains/town/room/mountain_road.c *** ds1.1/lib/domains/town/room/mountain_road.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/mountain_road.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,29 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("outdoors"); + SetAmbientLight(30); + SetShort("Mountain Road"); + SetLong("You are on a road running north and south. North is " + "a wreck of rubble and stones where the road is still in " + "the process of being built. Far in the distance, beautiful " + "snow-capped mountains can be seen. The road runs south into " + "the heart of the town."); + SetItems( ([ + ({"rubble","stone","stones","road"}) : "Looks like " + "the road is still being built. Further travel north " + "is impossible.", + ({"mountains","beautiful","snow-capped mountains"}) : "Beautiful " + "mountains, far off in the northern distance." + ]) ); + SetExits( ([ + "south" : "/domains/town/room/road", + "north" : "/domains/test/room/start.c", + ]) ); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/orc_fortress.c ds2.0r27/lib/domains/town/room/orc_fortress.c *** ds1.1/lib/domains/town/room/orc_fortress.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/orc_fortress.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,42 ---- + #include <lib.h> + inherit LIB_ROOM; + + int PreExit(){ + object *livings; + livings = get_livings(this_object()); + foreach(object living in livings){ + if(living->GetRace() == "orc" && !interactive(living)) { + write("An orc bars your way!"); + return 0; + } + } + return 1; + } + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(15); + SetShort("The Orc Fortress"); + SetLong("You find yourself in the entrance of the local " + "orc stronghold. This place seems quite hostile to " + "human sensibilities, as the construction is " + "rough, inelegant, and the upkeep is squalid. This " + "wooden fort also appears somewhat amateurishly " + "put together, as if done by youngsters playing " + "at being soldiers. There is an exit to the outside " + "south of here, and another room is visible to the " + "north."); + SetSmell( ([ "default" : "The stench of garbage and animal waste hangs here."]) ); + SetExits( ([ + "south" : "/domains/town/room/valley", + ]) ); + AddExit("north", "/domains/town/room/orc_temple", (: PreExit :)); + SetInventory(([ + "/domains/town/npc/orc" : 2, + "/domains/town/npc/orc2" : 1, + "/domains/town/npc/orc_boss" : 1, + ])); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/orc_temple.c ds2.0r27/lib/domains/town/room/orc_temple.c *** ds1.1/lib/domains/town/room/orc_temple.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/orc_temple.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,40 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(15); + SetShort("The Orc Fortress"); + SetLong("You are deep in the orc stronghold. Like the "+ + "rest of the fortress you have seen, this looks hastily "+ + "put together and rather clumsily built, with poor "+ + "maintenance besides. This is some kind of ceremonial "+ + "chamber or temple. Dried blood surrounds a raised "+ + "altar, and skulls of various types adorn the walls. "+ + "The rest of the fort is south of here."); + SetItems(([ + ({ "skull","skulls" }) : "You see some skulls whose race you "+ + "recognize, but most you don't. There is at least one "+ + "human skull here. Some of them are so fresh they are "+ + "still wet and have tissue hanging from them.", + ({"chamber","ceremonial chamber","temple"}) : "A place "+ + "where orcish rituals are performed.", + ({"blood","dried blood"}) : "Evidently the ground around "+ + "the altar has collected blood from whatever happens on "+ + "the altar.", + ({"wall","walls"}) : "Rough-hewn walls of earth and wood.", + ]) ); + SetSmell( ([ "default" : "The stench of garbage and animal waste hangs here."]) ); + SetExits( ([ + "south" : "/domains/town/room/orc_fortress", + ]) ); + SetInventory(([ + "/domains/town/obj/altar" : 1, + "/domains/town/npc/orc_shaman" : 1, + ])); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/postoffice.c ds2.0r27/lib/domains/town/room/postoffice.c *** ds1.1/lib/domains/town/room/postoffice.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/postoffice.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,78 ---- + #include <lib.h> + #include <objects.h> + #include <post.h> + #include "/lib/include/post_office.h" + + inherit LIB_ROOM; + + static void create(){ + room::create(); + SetTown("Town"); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("the town post office"); + SetLong("This is a small office containing rows of mailboxes and "+ + "various other postal implements. There is a sign on the wall behind the "+ + "counter, outlining instructions for how to mail other users. "+ + "Village road is north of here."); + SetItems( ([ + ({"box","boxes","mailboxes","mailbox"}) : "Rows of mailboxes for "+ + "the denizens of Frontiers.", + "sign" : "This is a sign on the wall describing how to mail messages.", + ({"wall","walls"}) : "Gray-painted institutional walls of the kind you'd "+ + "expect in a post office.", + "implements" : "Ink, paper, etc.", + "instructions" : "Try reading them.", + "counter" : "A counter folks use to lean on while writing messages." ]) ); + SetExits( ([ + "north" : "/domains/town/room/vill_road3", + ]) ); + SetProperty("no attack", 1); + } + void init(){ + ::init(); + add_action("instr","read"); + } + int instr(string str){ + if(str=="instructions"||str=="sign"){ + write("To mail someone, type mail <person's name here>.\n"+ + "Enter a subject line.\n"+ + "Enter your message.\n"+ + "Once you've finished, enter a period (.) on a blank line.\n"+ + "Hit x, then s to send it. You're done!\n"); + return 1; + } + } + mixed CanMail(object who, string args) { + if( !interactive(who) ) return 0; + if( GetTown() != (string)who->GetTown() ) + return "Any mail you might have will be at your home post office."; + return 1; + } + mixed eventMail(object who, string args) { + object ob; + + if( !(ob = new(OBJ_POST)) ) { + who->eventPrint("Failed to load postal object!"); + return 1; + } + if( !((int)ob->eventMove(who)) ) { + who->eventPrint("You can't seem to carry the postal object."); + return 1; + } + ob->start_post(args); + return 1; + } + int CanReceive(object ob) { + if( !ob && !(ob = previous_object()) ) return 0; + if( living(ob) && !interactive(ob) ) return 0; + else return room::CanReceive(ob); + } + int eventReleaseObject() { + object ob; + + if( !(ob = previous_object()) ) return room::eventReleaseObject(); + if( !room::eventReleaseObject() ) return 0; + if( (ob = present(POSTAL_ID, ob)) ) ob->eventDestruct(); + return 1; + } diff -c -r --new-file ds1.1/lib/domains/town/room/riverbank.c ds2.0r27/lib/domains/town/room/riverbank.c *** ds1.1/lib/domains/town/room/riverbank.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/riverbank.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,42 ---- + #include <lib.h> + inherit LIB_FISHING; + + static void create() { + ::create(); + SetTown("town"); + SetClimate("temperate"); + SetAmbientLight(30); + SetShort("riverbank"); + SetLong("This is the bank of a narrow but swift-moving river. A steep path leads back up to the bridge."); + SetProperties (([ + "no attack":0, + "no bump":0, + "no steal":0, + "no magic":0, + "no paralyze":0, + "no teleport":0])); + SetItems(([ "river" : "A swift moving river, probably quite deep." , + ({"bank","riverbank","here","water"}) : "This is the edge of a powerful river."])); + SetListen(([ + ({ "river", "water" }) : "You hear it rushing by.", + "default" : "You can hear the roar of the river rushing by.", + ])); + SetInventory(([ + "/domains/town/npc/troll" : 1, + "/domains/town/obj/rocks" : 1, + ])); + AddExit("up", "/domains/town/room/bridge"); + SetChance(90); + SetFish( ([ + "/domains/town/meals/shark" : 10, + ]) ); + } + void init() { + ::init(); + SetSmell(([])); + } + + int CanReceive(object ob){ + if(answers_to("provost",ob)) return 0; + return ::CanReceive(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/road.c ds2.0r27/lib/domains/town/room/road.c *** ds1.1/lib/domains/town/room/road.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/road.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,49 ---- + #include <lib.h> + inherit LIB_ROOM; + static void create() { + room::create(); + SetClimate("outdoors"); + SetAmbientLight(30); + SetShort("Saquivor Road"); + SetLong("You are on a well-traveled road leading north-south " + " through the village. To the east is the entrance to the " + "Village Pub, a time-honored traditional gathering place for " + "adventurers of every race and creed. To the west is " + "The Healers Guild. Far to the north, through the clouds, " + "you see a mountain range; to the south is a major intersection."); + SetItems( ([ + ({"pub","tavern","village pub"}) : "The is the town's " + "legendary watering hole, where refreshments are served " + "and tall tales are swapped.", + ({"guild","healers guild"}) : "In this building is " + "the office of the only doctor in town.", + "clouds" : "Little puffy clouds surround the " + "peaks of the northern mountains.", + ({"northern mountains","mountains","range","mountain range"}): + "Majestic mountains are far to the north, seeming " + "almost purple from here.", + "intersection" : "The main town crossroads is south." + ]) ); + SetExits( ([ + "east" : "/domains/town/room/tavern", + "south" : "/domains/town/room/vill_road1", + "west" : "/domains/town/room/healer", + "north" : "/domains/town/room/mountain_road", + ]) ); + SetInventory(([ + "/domains/town/weap/knife" :1, + "/domains/town/npc/beggar" :1 + ]) ); + + SetEnters( ([ + "pub" : "/domains/town/room/tavern", + "guild" : "/domains/town/room/healer", + "healers guild" : "/domains/town/room/healer" + ]) ); + SetNoModify(0); + + } + + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/road1.c ds2.0r27/lib/domains/town/room/road1.c *** ds1.1/lib/domains/town/room/road1.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/road1.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,22 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("outdoors"); + SetAmbientLight(30); + SetShort("West Village road"); + SetLong("This is a well-traveled road, leading " + "east into town and west away from it. The " + "town church is north. A grand mansion is south."); + SetExits( ([ + "north" : "/domains/town/room/church", + "east" : "/domains/town/room/vill_road1", + "west" : "/domains/town/room/road2", + "south" : "/domains/town/room/gate", + ]) ); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/road2.c ds2.0r27/lib/domains/town/room/road2.c *** ds1.1/lib/domains/town/room/road2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/road2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("outdoors"); + SetAmbientLight(30); + SetShort("West Village road"); + SetLong("This is a well-traveled road, leading east into town and west away from it. An old, humpbacked bridge is west of here."); + SetItems(([ + ({ "fort", "fortress", "fortress in the distance" }) : "It can't be seen well from here, but far north is what appears to be a large fortress built on a high plateau.", + ({ "road", "roads" }) : "This is a simple east-west road that goes east into town and west away from it. Another road, paved with cobblestones, intersects here to the north and leads high toward a fortress in the distance.", + "cobblestone road" : "This is where a cobblestone road begins that is built on an steep incline and rises up as it leads north to a high plateau.", + ])); + SetExits( ([ + "west" : "/domains/town/room/bridge", + "east" : "/domains/town/room/road1", + ]) ); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/room.c ds2.0r27/lib/domains/town/room/room.c *** ds1.1/lib/domains/town/room/room.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/room.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,13 ---- + #include <lib.h> + inherit LIB_ROOM; + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort(""); + SetLong(""); + SetExits( ([ + "out" : "/domains/town/room/mansion_room3" + ]) ); + SetObviousExits("out"); + } diff -c -r --new-file ds1.1/lib/domains/town/room/room2.c ds2.0r27/lib/domains/town/room/room2.c *** ds1.1/lib/domains/town/room/room2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/room2.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,9 ---- + #include <lib.h> + inherit LIB_ROOM; + static void create() { + room::create(); + SetClimate("outdoors"); + SetAmbientLight(30); + SetShort("a generic place"); + SetLong("This is an utterly plain, blank place."); + } diff -c -r --new-file ds1.1/lib/domains/town/room/school.c ds2.0r27/lib/domains/town/room/school.c *** ds1.1/lib/domains/town/room/school.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/school.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,31 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetTown("town"); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Village Schoolhouse"); + SetLong("This simple, one-room schoolhouse is not especially large but it is clean, well-maintained, and clearly an important part of village life. People come here to be taught, mostly languages, by traveling teachers and guest lecturers."); + SetProperties (([ + "no attack":1, + "no bump":1, + "no steal":0, + "no magic":0, + "no paralyze":0, + "no teleport":0])); + SetItems(([])); + SetInventory(([ + "/domains/town/npc/bugg" : 1, + ])); + SetExits(([ + "south" : "/domains/town/room/vill_road4", + ])); + + } + void init() { + ::init(); + SetSmell(([])); + SetListen(([])); + } diff -c -r --new-file ds1.1/lib/domains/town/room/shack.c ds2.0r27/lib/domains/town/room/shack.c *** ds1.1/lib/domains/town/room/shack.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/shack.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,25 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(25); + SetShort("Gardener's Shack"); + SetLong("This is the dark, wooden shack of the keeper " + "of the garden. From the dust and rust, " + "it is obvious nobody has done much gardening " + "around here lately."); + SetExits( ([ + "south" : "/domains/town/room/garden", + "out" : "/domains/town/room/garden.c", + ]) ); + SetInventory(([ + "/domains/town/obj/rayovac" : 1, + "/domains/town/obj/ladder" : 1, + ]) ); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/shop.c ds2.0r27/lib/domains/town/room/shop.c *** ds1.1/lib/domains/town/room/shop.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/shop.c Wed Jul 5 00:01:11 2006 *************** *** 0 **** --- 1,41 ---- + #include <lib.h> + inherit LIB_SHOP; + + int read_sign(); + static void create() { + ::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("The General Store"); + SetLong(" You are in the local general store. You can " + "buy or sell items here. A sign on the wall hangs here, " + "explaining how things work. Try \"read sign\". East " + "Village Road is south of here. The back storeroom is north."); + SetItems(([ + ({"store","shop","place"}) : "This is the local store.", + ({ "sign" ,"sign on the wall" }): "A sign on the wall, meant for reading.", + ])); + SetRead("sign", (: read_sign :) ); + SetInventory(([ + "/domains/town/obj/bbucket" :1, + "/domains/town/npc/otik" :1 + ]) ); + SetExits( ([ + "south" : "/domains/town/room/vill_road2", + "north" : "/domains/town/room/shop2", + ]) ); + SetProperty("no attack", 1); + } + int read_sign(){ + write("HOW TO CONDUCT BUSINESS HERE\n"); + write("list : Get a list of all the items Otik has for sale"); + write("appraise <item> : Ask Otik to tell you how much he would pay you for your item"); + write("price <item> : Ask Otik the price of his item"); + write("show <item> : Ask Otik for a closer look at his item\n"); + write("\nbuy <item> from otik\nsell <item> to otik\n"); + write("Cash only!"); + return 1; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/shop2.c ds2.0r27/lib/domains/town/room/shop2.c *** ds1.1/lib/domains/town/room/shop2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/shop2.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,40 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Otik's storage room"); + SetLong("This is a small, bare room where Otik " + "keeps his goods. The main store " + "is south."); + SetInventory(([ + "/domains/town/obj/dcell_std" : 30, + "/domains/town/obj/watch" : 10, + "/domains/town/armor/helmet" : 3, + "/domains/town/obj/pack" : 10, + "/domains/town/obj/maglite" : 3, + "/domains/town/weap/sword" : 30, + "/domains/town/armor/chainmail" : 3, + "/domains/town/obj/torch" : 15, + "/domains/town/obj/match" : 15, + "/domains/town/obj/rayovac" : 10, + "/domains/town/weap/dagger" : 30, + ])); + + SetExits( ([ + "south" : "/domains/town/room/shop", + ]) ); + SetObviousExits("s"); + } + int CanReceive(object ob) { + if(playerp(ob) && !creatorp(ob) && !present("testchar badge",ob)) { + message("info","Otik's back room is for authorized personnel only.", ob); + return 0; + } + return 1; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/shore.c ds2.0r27/lib/domains/town/room/shore.c *** ds1.1/lib/domains/town/room/shore.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/shore.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,58 ---- + #include <lib.h> + inherit LIB_FISHING; + + int ActionFunction(){ + object *cres, dude; + if(!sizeof(get_livings(this_object()))) return 0; + //The next line identifies creators in the room + cres = filter(get_livings(this_object()), (: creatorp($1) :) ); + //The next line picks a living being here at random + dude = get_random_living(this_object()); + if(!dude) return 0; + //The next line makes that person sigh. Note that since + //creators normally can't be forced by non-privileged objects, + //only npc's and players will be affected. + dude->eventForce("sigh"); + //The next line tells any creators present the identitiy of the + //target of the previous action. + if(!sizeof(cres)) return 0; + cres->eventPrint("%^YELLOW%^The ActionFunction activates. Dude is: "+ + identify(dude)+".%^RESET%^"); + return 1; + } + + static void create() { + fishing::create(); + SetClimate("outdoors"); + SetAmbientLight(30); + SetShort("Shore Edge"); + SetLong("You are on the shore, at the far eastern end of town. " + "A road travels west into the heart of town. "); + SetExits( ([ + "west" : "/domains/town/room/vill_road4.c", + ]) ); + //SetFrequency determines how often the room checks + //whether it should perform an action. If it is set + //at 1, it checks approximately every second. The + //default is 5. + SetFrequency(1); + //The first argument of SetAction is a number, indicating from + //one to 100 the percentage of likelihood an event will occur. + //The second argument is an array that contains strings, + //functions, or both. Every time an action is triggered, an + //element is picked from the array at random. If it is a string, + //that string is displayed to the living things in the room. + //If it is a function, that function is evaluated. + SetAction(2, ({"A cool breeze flows in from the east, " + "bringing with it the bracing salty smells of the sea.", + (: ActionFunction :) }) ); + SetChance(90); + SetFish( ([ + "/domains/town/meals/shark" : 1, + "/domains/town/meals/herring" : 10, + ]) ); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/shower.c ds2.0r27/lib/domains/town/room/shower.c *** ds1.1/lib/domains/town/room/shower.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/shower.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,14 ---- + #include <lib.h> + inherit LIB_ROOM; + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Shower Stall"); + SetLong("You are standing in a shower stall. People come " + "here to get clean."); + SetExits( ([ + "out" : "/domains/town/room/mansion_room3" + ]) ); + SetObviousExits("out"); + } diff -c -r --new-file ds1.1/lib/domains/town/room/south_road1.c ds2.0r27/lib/domains/town/room/south_road1.c *** ds1.1/lib/domains/town/room/south_road1.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/south_road1.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,40 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("outdoors"); + SetAmbientLight(30); + SetShort("Saquivor Road"); + SetLong("This is a cobblestone road, leading "+ + "north into town and south away from it. "+ + "The First Village Bank stands here on "+ + "the east side of the road. The magic "+ + "shop stands west. "+ + "\n%^GREEN%^An old well stands by the "+ + "side of the road.%^RESET%^"); + SetItems( ([ + ({"well","old well","dry well"}) : "This " + "looks like the sort of system used to " + "provide water before the town implemented " + "more modern waterworks. It looks long dry " + "and abandoned.", + "bank" : "The First Village Bank", + ({"road","cobblestone road"}) : "A " + "cobblestone road running north and south." + ]) ); + SetObviousExits("n, s, e, w"); + SetExits( ([ + "south" : "/domains/town/room/south_road2", + "north" : "/domains/town/room/vill_road1", + "east" : "/domains/town/room/bank", + "west" : "/domains/town/room/magic_shop.c", + ]) ); + SetNoModify(0); + SetEnters( ([ + "well" : "/domains/town/room/well1" + ]) ); + } + void init(){ + room::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/south_road2.c ds2.0r27/lib/domains/town/room/south_road2.c *** ds1.1/lib/domains/town/room/south_road2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/south_road2.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,30 ---- + #include <lib.h> + inherit LIB_ROOM; + + int readSign() { + this_player()->more("/domains/town/txt/warning_sign.txt"); + return 1; + } + static void create() { + room::create(); + SetClimate("outdoors"); + SetAmbientLight(30); + SetShort("South Saquivor Road"); + SetLong("This is a cobblestone road, leading north into town and south away from it. South of here appears to be some sort of University campus."); + SetItems( ([ + ({"road","cobblestone road"}) : "A " + "cobblestone road, running north and south.", + "sign":"A large sign on the road. To read it, 'read sign'.", + ]) ); + SetExits( ([ + "north" : "/domains/town/room/south_road1", + "south" : "/domains/campus/room/npath2.c", + ]) ); + SetInventory(([ + ])); + SetRead("sign", (: readSign :) ); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/tavern.c ds2.0r27/lib/domains/town/room/tavern.c *** ds1.1/lib/domains/town/room/tavern.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/tavern.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,31 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + ::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("The Local Tavern"); + SetLong("You are in the local pub. You can order drinks and a sandwich here:\n\n"+ + "\tFirst class ale:\t\t\t\t10 silver\n" + "\tSpecial of the house:\t\t\t\t20 silver\n" + "\tFirebreather:\t\t\t\t\t50 silver\n" + "\tSpring water:\t\t\t\t\t2 silver\n" + "\tRegular coffee:\t\t\t\t\t5 silver\n" + "\tImported espresso:\t\t\t\t15 silver\n" + "\tHam sandwich:\t\t\t\t\t10 silver\n\n\n" + "To order a bottle of water, \"buy water from lars\"\n" + ); + SetInventory(([ + "/domains/town/obj/bbucket" :1, + "/domains/town/npc/lars" :1 + ]) ); + SetExits( ([ + "west" : "/domains/town/room/road", + "out" : "/domains/town/room/road", + ]) ); + SetProperty("no attack", 1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/thall.c ds2.0r27/lib/domains/town/room/thall.c *** ds1.1/lib/domains/town/room/thall.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/thall.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,32 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetTown("town"); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Town Hall"); + SetLong("This is the modest foyer of this village's Town Hall. It's a simple \naffair, really, in keeping with the down-to-earth spirit of the town. \nThe office of the clerk and notary is west, and the Mayor's office is north. Village road is south. The registrar of voters is east."); + SetProperties (([ + "no attack":1, + "no bump":1, + "no steal":0, + "no magic":0, + "no paralyze":0, + "no teleport":0])); + SetItems(([])); + SetExits( ([ + "south" : "/domains/town/room/vill_road3", + "west" : "/domains/town/room/clerk", + "north" : "/domains/town/room/mayor", + "east" : "/domains/town/room/voters", + ]) ); + SetInventory(([])); + + } + void init() { + ::init(); + SetSmell(([])); + SetListen(([])); + } diff -c -r --new-file ds1.1/lib/domains/town/room/training.c ds2.0r27/lib/domains/town/room/training.c *** ds1.1/lib/domains/town/room/training.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/training.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,34 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("the training area"); + SetLong("You are in a large room with "+ + "a very high ceiling, mirrored walls, and a "+ + "hardwood floor. This area is designed for skills "+ + "training, though at the moment no workshops are "+ + "scheduled. The rest of the Adventurers' Guild is "+ + "east of here."); + SetItems( ([ + ({"wall","walls"}) : "The walls have mirrors set into them.", + ({"mirror","mirrors"}) : "Peekaboo!", + ({"hardwoord floor", "floor"}) : "The floor is made of polished wood, and is "+ + "reminiscent of what you might expect in a dancing school.", + ({"ceiling","high ceiling"}) : "The high, vaulted ceiling "+ + "provides plenty of headroom." + ]) ); + SetExits( ([ + "east" : "/domains/town/room/adv_guild", + ]) ); + SetInventory(([ + "/domains/town/npc/radagast" : 1, + "/domains/town/obj/bbucket" : 1, + ])); + SetPlayerKill(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/valley.c ds2.0r27/lib/domains/town/room/valley.c *** ds1.1/lib/domains/town/room/valley.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/valley.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,45 ---- + #include <lib.h> + inherit LIB_ROOM; + + int PreExit(){ + object *livings; + livings = get_livings(this_object()); + foreach(object living in livings){ + if(living->GetRace() == "orc" && !interactive(living)) { + write("An orc bars your way!"); + return 0; + } + } + return 1; + } + static void create() { + room::create(); + SetClimate("outdoors"); + SetAmbientLight(30); + SetShort("Orc Valley"); + SetLong("You are in a small valley nestled amongst mountains to the west " + "and north. To the south the forest is impassably thick. " + "A tribe of orcs have chosen this valley is their home, and " + "several hovels sit and various states of disrepair around you, " + "along with several vast piles of refuse. The orcs have built " + "a wooden fortress to the north. To the west stands a " + "sheer, unclimbable cliff. High above on the cliff a giant column " + "of fire pours into the sky."); + SetExits( ([ + "east" : "/domains/town/room/clearing" + ]) ); + AddExit("north", "/domains/town/room/orc_fortress", (: PreExit :)); + SetInventory(([ + "/domains/town/npc/orc" : 1, + "/domains/town/npc/orc2" : 1, + ]) ); + + } + void init(){ + ::init(); + } + + int CanReceive(object ob){ + if(answers_to("provost",ob)) return 0; + return ::CanReceive(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/vill_road1.c ds2.0r27/lib/domains/town/room/vill_road1.c *** ds1.1/lib/domains/town/room/vill_road1.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/vill_road1.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,40 ---- + #include <lib.h> + inherit LIB_ROOM; + + int readSign() { + this_player()->more("/domains/town/txt/hints_sign.txt"); + return 1; + } + + static void create() { + room::create(); + SetClimate("outdoors"); + SetAmbientLight(30); + SetShort("Village Road Intersection"); + SetLong("You are in the main intersection of the village, " + "where Saquivor road extends north and south, and a " + "narrow track intersects the road from the west. The track " + "is somewhat better kept as it continues eastward as a road.\n"+ + "%^GREEN%^There is a sign here you can read.%^RESET%^"); + + SetItems( ([ + "sign":"A large sign on the road. To read it, 'read sign'.", + ]) ); + SetNoModify(0); + SetInventory(([ + "/domains/town/obj/clocktower" : 1, + ])); + SetEnters( ([ + ]) ); + SetRead("sign", (: readSign :) ); + SetExits( ([ + "north" : "/domains/town/room/road", + "east" : "/domains/town/room/vill_road2", + "west" : "/domains/town/room/road1", + "south" : "/domains/town/room/south_road1", + ]) ); + } + + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/vill_road2.c ds2.0r27/lib/domains/town/room/vill_road2.c *** ds1.1/lib/domains/town/room/vill_road2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/vill_road2.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,38 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("outdoors"); + SetAmbientLight(30); + SetShort("East Village Road"); + SetLong("You are on a long road. The general store is north. The road stretches east and west through the town. The Adventurers' Guild is south."); + SetItems( ([ + ({"adventurers guild","guild"}) : "This small " + "building on the southern side of the road is where " + "adventurers, great and small, come to record " + "their exploits and seek advancement.", + ({"shop","store","general store"}) : "This is the " + "general store, where almost anything can be " + "bought or sold.", + ({"road","long road"}) : "An east-west cobblestone " + "road through town.", + ]) ); + SetObviousExits("n, s, e, w, enter store, enter guild"); + SetExits( ([ + "north" : "/domains/town/room/shop", + "south" : "/domains/town/room/adv_guild", + "east" : "/domains/town/room/vill_road3", + "west" : "/domains/town/room/vill_road1", + ]) ); + SetEnters( ([ + "adventurers guild" : "/domains/town/room/adv_guild", + "guild" : "/domains/town/room/adv_guild", + "shop" : "/domains/town/room/shop", + "store" : "/domains/town/room/shop", + "general store" : "/domains/town/room/shop", + ]) ); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/vill_road3.c ds2.0r27/lib/domains/town/room/vill_road3.c *** ds1.1/lib/domains/town/room/vill_road3.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/vill_road3.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,28 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("outdoors"); + SetAmbientLight(30); + SetShort("East Village Road"); + SetLong("A long road going through the village. Town Hall is north. The main part of the town is west of here. The post office is south."); + SetItems(([ + ({ "office", "post office" }) : "Mail can be received and sent from the post office.", + ({ "building", "buildings" }) : "Structures designed for human occupancy.", + ({ "hall", "town hall" }) : "This is the modest building where official town business takes place.", + ])); + SetExits( ([ + "south" : "/domains/town/room/postoffice", + "west" : "/domains/town/room/vill_road2", + "north" : "/domains/town/room/thall", + "east" : "/domains/town/room/vill_road4.c", + ]) ); + SetEnters( ([ + "town hall" : "/domains/town/room/thall", + "office" : "/domains/town/room/postoffice.c", + ]) ); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/vill_road4.c ds2.0r27/lib/domains/town/room/vill_road4.c *** ds1.1/lib/domains/town/room/vill_road4.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/vill_road4.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,26 ---- + #include <lib.h> + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("outdoors"); + SetAmbientLight(30); + SetShort("Village Path"); + SetLong("As it travels from west to east, Village Road becomes less of a road here and more of a dirt path. The shore of the eastern sea is almost visible from here. The village schoolhouse is north, and the shore is east."); + SetItems(([ + ({ "building", "schoolhouse", "school", "village school", "village schoolhouse" }) : "A small but well-kept wooden building where townsfolk and their children go to acquire knowledge.", + ({ "building", "buildings" }) : "Structures designed for human occupancy.", + ({ "shore", "village shore" }) : "The shore of the eastern sea is east of here.", + ])); + SetExits( ([ + "west" : "/domains/town/room/vill_road3", + "east" : "/domains/town/room/shore", + "north" : "/domains/town/room/school.c", + ]) ); + SetEnters( ([ + ]) ); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/void.c ds2.0r27/lib/domains/town/room/void.c *** ds1.1/lib/domains/town/room/void.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/void.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,16 ---- + #include <lib.h> + #include <rooms.h> + + inherit LIB_ROOM; + + void create() { + room::create(); + SetAmbientLight(30); + SetShort("the void"); + SetLong("The void. Go down to get out."); + SetExits( ([ "down" : ROOM_START ]) ); + SetNoModify(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/room/voters.c ds2.0r27/lib/domains/town/room/voters.c *** ds1.1/lib/domains/town/room/voters.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/voters.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,204 ---- + #include <lib.h> + #include <daemons.h> + #include <voting.h> + + inherit LIB_ROOM; + + mixed ReadList(); + + static void create() { + room::create(); + SetTown("town"); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Registrar of Voters"); + SetLong("This small office is where people come to " + "perform their civic duty of voting. Here you may " + "also \"nominate CANDIDATE\". There is a list of candidates here. " + " The main area of the town hall is west."); + SetItems( ([ "list" : "This is the list of candidates." ]) ); + SetRead( "list", (: ReadList :) ); + SetProperties (([ + "no attack":1, + "no bump":1, + "no steal":0, + "no magic":0, + "no paralyze":0, + "no teleport":0])); + SetInventory(([ + ])); + AddExit("west", "/domains/town/room/thall"); + } + + mixed ReadList() { + string msg, admin; + + admin = "\nSpecial commands available to admins:\n"; + admin += "tally\t\t\tReports the vote tally.\n"; + admin += "nextday\t\t\tAdvances voting schedule one day.\n"; + admin += "startvote\t\tGet the ball rolling.\n"; + admin += "endvote\t\t\tPrevent additional voting.\n"; + admin += "votestatus\t\tReports status of the vote.\n"; + admin += "votemode\t\tReports operating mode of voting daemon.\n\n"; + + if(archp(this_player())) this_player()->eventPrint( admin ); + + + if( VOTING_D->GetStatus() == VOTE_NOT_RUNNING ) { + this_player()->eventPrint(VOTING_D->GetCurrentCouncil()); + return 1; + } + + msg = VOTING_D->GetCurrentCouncil(); + msg += "\n\tCandidates for Dead Souls Offices\n\n"; + + foreach( string sClass in CLASSES_D->GetClasses() ) { + msg += capitalize( sClass ) + " : "; + foreach( string sName in VOTING_D->GetCandidates(sClass) ) + msg += capitalize(sName) + ", "; + if( msg[strlen(msg)-2] == ',' ) + msg = msg[0..strlen(msg)-3]; + msg += "\n"; + } + + this_player()->eventPrint( msg ); + return 1; + } + + mixed CanNominate( object who ) { return 1; } + mixed CanVote( object who ) { return 1; } + mixed CanWithdraw( object who ) { return 1; } + + mixed eventNominate( object who, string str ) { + int iErr; + + if( creatorp( who ) ) { + who->eventPrint("Creators cannot vote!"); + return 1; + } + + iErr = VOTING_D->eventAddCandidate( who->GetClass(), str ); + + switch( iErr ) { + case VOTE_NOT_RUNNING : + this_player()->eventPrint("The elections are not running now!"); + break; + + case VOTE_MODE_VOTING : + this_player()->eventPrint("The time for nominating " + "candidates is past, cast your vote instead."); + break; + + case VOTE_ERROR : + this_player()->eventPrint("There was an error, you cannot " + "nominate someone at this time."); + break; + + case VOTE_NOT_CLASS_MEMBER : + this_player()->eventPrint( capitalize(str) + " is not a member of " + "the " + pluralize( who->GetClass() ) + "."); + break; + + case VOTE_ALREADY_RUNNING : + this_player()->eventPrint( capitalize(str) + " is already running." ); + break; + } + return 1; + } + + mixed eventVote( object who, string str ) { + int iErr; + string sClass; + + sClass = who->GetClass(); + iErr = VOTING_D->eventCastVote( sClass, who->GetName(), str ); + + switch( iErr ) { + case VOTE_NOT_RUNNING : + this_player()->eventPrint("The elections are not running now!"); + break; + + case VOTE_MODE_CANDIDATES : + this_player()->eventPrint("Voting has not yet started. We are " + "still nominating candidates. Please nominate a candidate " + "instead."); + break; + + case VOTE_NOT_PRIMARY : + this_player()->eventPrint("Only your primary character can vote."); + break; + + case VOTE_NOT_CLASS_MEMBER : + this_player()->eventPrint( str + " is not a candidate for " + "the " + pluralize(who->GetClass()) + "."); + break; + + case VOTE_ALREADY_VOTED : + this_player()->eventPrint("You have already cast your vote!"); + break; + + case VOTE_SUCCESS : + this_player()->eventPrint("You cast your vote!"); + break; + } + + return 1; + } + + mixed eventWithdraw( object who ) { + int iErr; + + iErr = VOTING_D->eventRemoveCandidate( who->GetClass(), who->GetName() + ); + + switch( iErr ) { + case VOTE_NOT_RUNNING : + this_player()->eventPrint("The elections are not running now!"); + break; + + case VOTE_MODE_VOTING : + this_player()->eventPrint("The elections have begun, it is " + "too late to withdraw."); + break; + + case VOTE_NOT_CANDIDATE : + this_player()->eventPrint("You are not a candidate."); + break; + } + + return 1; + } + + mixed tally(){ + write("Voting daemon says: \"Votes tallied.\""); + return VOTING_D->eventTallyVotes(); + } + mixed nextday(){ + write("Voting daemon says: \"Voting schedule advanced one day.\""); + return VOTING_D->eventNextDay(); + } + mixed startvote(){ + return VOTING_D->eventStartVoting(); + } + mixed endvote(){ + write("Voting daemon says: \"Polls closed.\""); + return VOTING_D->eventEndVoting(); + } + mixed votestatus(){ + write("Voting daemon says: \"Status bitwise operator.\""); + return VOTING_D->GetStatus(); + } + mixed votemode(){ + write("Voting daemon says: \"Mode bitwise result.\""); + return VOTING_D->GetMode(); + } + + void init(){ + ::init(); + add_action("tally","tally"); + add_action("nextday","nextday"); + add_action("startvote","startvote"); + add_action("endvote","endvote"); + add_action("votestatus","votestatus"); + add_action("votemode","votemode"); + } diff -c -r --new-file ds1.1/lib/domains/town/room/well1.c ds2.0r27/lib/domains/town/room/well1.c *** ds1.1/lib/domains/town/room/well1.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/room/well1.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,28 ---- + #include <lib.h> + inherit LIB_ROOM; + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(0); + SetShort("Town Well"); + SetLong("This is the bottom of the old town well. It is " + "quite dark and unpleasant down here. Years " + "of disuse after drainage have provided a " + "haven for vermin, dirt, and dust here."); + SetItems( ([ + ({ "bottom","well" }) : "Dirty, musty, " + "and unpleasant.", + "haven" : "A nice place for vermin.", + ({"dirt","dust"}) : "There's plenty of that " + "here. Empty wells rarely get much " + "priority on cleaning day.", + ({"vermin","rats","bugs"}) : "Looks " + "like they're hiding from you at the " + "moment." + ]) ); + SetExits( ([ + "out" : "/domains/town/room/south_road1", + "up" : "/domains/town/room/south_road1" + ]) ); + SetObviousExits("up"); + } diff -c -r --new-file ds1.1/lib/domains/town/txt/advancement.txt ds2.0r27/lib/domains/town/txt/advancement.txt *** ds1.1/lib/domains/town/txt/advancement.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/txt/advancement.txt Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,43 ---- + WELCOME TO THE ADVENTURERS' GUILD! + + Things are pretty straightforward here. You can advance + to higher levels by possessing enough experience and having + completed enough quests. + + Type "status" to see how many xp's you have. Those are + experience points, and with enough of them, you can advance + to the next level. + + After level 4, you must have enough quest points, as + well. Read the scroll here to see what quests are available. + You only get points the first time you complete a quest. + + The advancement requirements break down like this: + + Level Title XP QP + 1 the utter novice 0 0 + 2 the simple novice 1000 0 + 3 the beginner 1500 0 + 4 the adventurer 2300 0 + 5 the experienced adventurer 3500 5 + 6 the expert adventurer 5100 12 + 7 the great adventurer 7700 21 + 8 the master adventurer 12000 32 + 9 the Freeman 17000 45 + 10 the Citizen 26000 60 + 11 the Knight 39000 77 + 12 the Baron 59000 96 + 13 the Count 88000 117 + 14 the Earl 130000 140 + 15 the Marquis 198000 165 + 16 the Duke 297000 192 + 17 the Arch Duke 444444 221 + 18 Praetor 666667 252 + 19 Quaestor 1000000 285 + 20 Caesar 2000000 450 + 21+ <See Trans-Human Elder Guildmaster for information> + + To advance, ask the guildmaster. + Example: + + ask dirk to advance diff -c -r --new-file ds1.1/lib/domains/town/txt/hints_sign.txt ds2.0r27/lib/domains/town/txt/hints_sign.txt *** ds1.1/lib/domains/town/txt/hints_sign.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/txt/hints_sign.txt Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,113 ---- + HELPFUL HINTS + + - This is a special sample area of places, objects and creatures. + It is not a mud. It is a set of examples that can be used in making + a mud. If you are reading this, it's because you are in a mud that + is under construction. + + - Since this is a sample area, the mud creators may have changed + things so much that the stuff below might not all apply to you. + + - Read the players handbook. It is really very helpful. You read + it like this: + + read chapter 1 in handbook + read index in handbook + read chapter 2 in handbook + + - If you want to know what is inside a container (like a bag or + a box) you have to look *in* it. Example: look in bag + + - It is almost imposible to fight well if you're carrying + stuff. Anything you carry that is not wielded or worn is a + major problem in combat, so wear a backpack to keep your stuff in. + + - If you don't have the "two-handed" or "two-weapon" combat + skills, you will fight very poorly when wielding multiple or + two-handed weapons. Generally only fighters train in these skills. + + - The wimpy command will make you automatically run away from + combat when your health hits the percentage you specify. + + - Armor is very important. Without it, it is very easy to lose life + and limb. + + - If you can't carry all your money, deposit some in the bank. + + - "wear all" is a quick way to equip, but don't forget to + "wield", too. + + - If you're hurt, go to Clepius for healing. He can also cure + diseases, restore severed limbs, and extract foreign objects. + + - Make sure to read any signs or lists you see. They contain + important instructions. + + - Advancing in levels improves your statistics and enhances + your abilities. See Dirk in the Adventurer's Hall for details. + + - Once you choose a class, such as fighter or mage, it is + hard to switch again, and expensive. + + - Anyone can learn spells, but it's easier for mages and they + get more bang for the buck. However, mages are pretty weak, + physically. + + - Fighters are big and tough, but being dumb and clumsy + has drawbacks. + + - Getting drunk and sleeping enhances healing rate, but + once you are asleep you have to wait to wake up. It can be + anywhere between two and ten minutes. + + - Avoiding hunger and thirst enhances healing. + + - Bags and packs to put things in make it easier to carry a lot + of stuff around. + + - Without a weapon, humanoids are quite vulnerable in combat. + + - If your foot or leg is severed, you cannot stand or walk. + To go anywhere while lying down, you must "crawl". For + example, "crawl south". + + - If you are lying down or sitting, you cannot fight. + + - Your skills improve with use. For example, spellcasting, + combat, defense, and stealing, all get better the more + you do it. + + - If you are badly overmatched in a fight, try hiring + mercenaries or finding magical items to enhance your abilities. + Or heck, ask a friend to connect and help you fight. + + - Room lighting can be deceptive. You might be able to see + enough to make out what a room looks like, but not enough to + see all the exits or all the stuff in a room. If in doubt, + use a light source, like a torch or flashlight. + + - Even if you can see the room well, some items may be hidden. + "search" is a useful command for finding hidden items. + + - Sometimes having many similar objects can be confusing. Or + you might have armor that can be worn on different limbs. + You may have to be specific. Examples: + - sell first boot to otik + - buy large flashlight from otik + - put small knife in leather pack + - wield short sword in right hand + - wear badge on torso + - shoot second orc with water pistol + - read inscription on ring (instead of read ring) + - push second button + - eat my first ham sandwich + - articulate grand unification theory (doesn't work quite yet) + + - South of the church is a newbie mansion, with lots + of treasure and stuff for newbies. There's even a quest + or two to solve. Just don't expect to get past the guard + after reaching non-newbie status. + + - This mud is under construction, so you may get stuck or + find a bad bug. Don't get mad. Just report the bug or ask for help. + diff -c -r --new-file ds1.1/lib/domains/town/txt/map.txt ds2.0r27/lib/domains/town/txt/map.txt *** ds1.1/lib/domains/town/txt/map.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/txt/map.txt Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,19 ---- + ------------------ ------- + | Healers' Guild |------------ | Pub | + N ------------------ | ------- + | | + W ----- E ------------ | ----------- ------------- + | | church | | | Shop | | Town Hall | + S ------------ | ----------- ------------- + | | | | + Wilderness -------------------------------------------------------------- + | | | | + ---------------- | --------------------- --------------- + | Newbie mansion | | | Adventurers' Guild | | Post Office | + ---------------- | --------------------- --------------- + | + ---------------- | -------- + | Mages' Guild |----------- | Bank | + ---------------- -------- + + diff -c -r --new-file ds1.1/lib/domains/town/txt/pot.txt ds2.0r27/lib/domains/town/txt/pot.txt *** ds1.1/lib/domains/town/txt/pot.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/txt/pot.txt Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,92 ---- + + + + The Persistence of Memory by Salvador Dali + + + ;!>,!!!> + <! ;!!!' + !! `!!!. + !!',!!!> + !! !!!!! + ;!! !!!!! + `!! !!!!! + !! !!!!!> . + `!.`!!!!! ;<!' + !! `!!!! ,<!'` + `!> !!!! ;<!' + <!! !!!!> ;!'` + !!! `!!!! !!` ,c, + !!!> !!!!> ;`< ,cc$$cc .,r== $$c ! + !!!! !!!!!!. ,<!' !!!!!>>>;;;;;;;;.`"?$$c MMMMMMM )MM ,= "$$.` + <!!> !!!!!!!!!!!!!>'' ,>'''' ``````''''!!!; ?$$c`MMMMMM.`MMMP== `$h + `!! ;!!!!!!''''.,;;;''' JF !;;;,,,,; 3$$.`MMMMMb MMMnnnM $$h + ;!! <!!!!.;;!!!''` JF.!!!!!!!!!>`$$h `MMMMM MMMMMMM $$$ + ;!!>`!!!!!!'` ?> !!!!!!!!!> $$$ MMMMM MMMMMMM $$$ + <!! ;!!!!' `h !!!!!!!!!! $$$ MMMMMM MMMM" M $$$ + `!>'!!!! b !!!!!!!!!! $$$ MMMMMM MMML,,`,$$$ + ,,,,,, ;! <!!!> ,,,,,,,,,,,,,,,, $ !!!!!!!!!! $$$ MMMMMM MMMMML J$$F + !!!!!! !! !!!! `!!!!!!!!!!!!!!' ; $ !!!!!!!!!! $$$ MMMMMP.MMMMMP $$$F + !!!!! ;!! !!!!> !!!!!!!!!!!!' ;' .`.`.`. ?.`!!!!!!!!! 3$$ MMMP `MMMMM>,$$P + !!!!' !!' !!!!> !!!!!!!!!!' ;!' `.`.`.`. `h !!!!!!!!! $$$ MMML MMPPP J$$'. + !!!! !!!;!!!!!';!!!!!!!!' ;!' .`.`.`.`.` ?,`!!!!!!!! ?$$ MMMMM.,MM_"',$$F . + !!!';!!!.!!!!' <!!!!!!!` ;' .`.`.`.`.`.`. ? `!!!!!!!>`$$ MMMMMbdML ` $$$ . + ``` !!!> !!!! ```````` ;! .`.`.`.`.`.`.`.` h `!!!!!!> $$ )MMMMMMMMM d$$' `. + !!' !!!''!!! <!!!!!!!> ' .`.`.`.`.`.`.`.`.` `?,`'!!!!! ?$h 4MMMMMMP z$$' .`. + '' <!!! !!!> '''''''' .`.`.`.`.`.`.`.`.`.`.` ?h.``'`..`$$ MMMMMM ,$$F `.`. + ` !!!! <!!!.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`. `"??$F". `$h.`MMMMM $$$'.`.`. + <!'! .!!!!> .`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`. cccc `$$.'4MMP.3$F .`.`. + <!''! !!!!!> .`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`. J$$$$$F . "$h." . 3$h .`.`. + !' ! !!!!!!> .`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`. """" .`.`.`$$, 4 3$$ .`.`. + ;! !!!!!!! `.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`. ?$h J$F .`.`. + ;' !!!!!!! `.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`. "$$$$P' .`.`. + ' <!!!!!!! `.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`. . .`.`.`.`. + ,' !!!!!!! .`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`. + !! !!!!!!',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, `.`.`.`. + !! !!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' `.`.`.`. + !! <!!!!';!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ;! `.`.`.`. + !! ;!!!!>`!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' <!! `.`.`.`. + ',,!!!!''.;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' <!!! `.`.`.`. + '''''.,;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' <!!!! `.`.`.`. + ;!!!!!!!!!!!!!!!!!!!!!!!>>>'''''''''`````''''''<!!!!!!!!!!!' !!!!!! `.`.`.`. + !!!!!!!!!!!!!!!!!!''''_,,uunmnmnmdddPPPPPPbbbnmnyy,_```''! !!!!!!! `.`.`.`. + !!!!!!!!!''_``!'`,nmMMPP"""',.,ccccccr==pccccc,,..`""444n,.`<!!!!!! `.`.`.`. + !!!!!!!' ,dMM ,nMMP"",zcd$h.`$$$$$$$$L c $$$$$$$$$$??cc`4Mn <!!!!! `.`.`.`. + !!!!!! ,MMMP uMMP ,d$$$$$$$$cd$F ??$$$$$cd$$$$$$$$$F, ??h.`Mx !!!!! `.`.`.`. + !!!!!! MMMP uMM",F,c ".$$$$$$$P' ?$$$$$$$$$$$$$$$$C',J$$.`M.`!!!! `.`.`.`. + !!!'` MMM 4MMM L`"=-z$$P".,,. ,c$$$$$$$$$$$$$$$$$$$$$$$ ML !!!! `.`.`.`. + !!!. `"" MMMM `$$hc$$$L,c,.,czc$$$$$$$$$$$$$$$$$$$$$$$$$$.4M `!!! `.`.`.`. + !!!!;;;.. `MMMb ?$$$$$$??""""?????????????????? ;.`$$$$$$$'JM',!!! `.`.`.`. + !!!!!!!!!> 4MMMb."?$$$cc,.. .,,cccccccccccccccc,c`.$$$$$$$ MM <!!! `.`.`.`. + !!!!!!!!!! `MMMMMb,."??$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$?$$$ MM ;!!! `.`.`.`. + !!!!!!!!!! "4MMMMMMmn,."""???$$$$$$$$$$$$$$$$$$ $$$" ?$$ MP !!!! `.`.`.`. + !!!!!!!!!!!;. "4MMMMMMMMMMMmnmn,.`"""?????$$$$$$ ?$$ `CF.M> !!!! `.`.`.`. + !!!!!!!!!!!!!!;. `""44MMMMMMMMMMMMMMMMnnnn. ?$$$.<$$$h.$h MM !!!! `.`.`.`. + !!!!!!!!!!!!!!!!>.;. `""444MMMMMMMMMMMMMb $$$:<$$$$$$$ 4M <!!! `.`.`.`. + !!!!!!!!!!!!!!!!!!!!!;<;);>;. ..""""44MMMM J$' <$$$$$$h`Mb`!!! `.`.`.`. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!>; `MMM ?$. d$$$$$$$ MM.`!! `.`.`.`. + !!!!!!!!!!'``!''' ..`'<!!!!!!!!!!!!!!!; . MMM.<$$ <$$$$$$$$ 4Mb !! `.`.`.`. + !'''''''''.. ;MMMMnn.'!!!!!!!!!!!!!!! ; MMM J$$hJ$$$$$$$$h`MM !! `.`.`.`. + ,xmdMMMbnmx,. MMMMMMMr !!!!!!!!!!!!' ;: MMM $$$$$$$$$$??$$ MM !! `.`.`.`. + P"'.,,,,c`""4MMn MMMMMMx !!!!!!!!!!!` <!: MMM $$$$$$$$L =c$F.MP !! `.`.`.`. + ub "P4MM")M,x,"4b,`44MMMP !!!!!!!!!! !!!: MMM ???$$$$$$"=,$ JM';!! `.`.`.`. + ML,,nn4Mx`"MMMx.`ML ;,,,;<!!!!!!!!! ;!!!!: MMM.-=,$$$$$$hc$'.MP !!! `.`.`.`. + . MMM 4Mx`MMML MM,`<!!!!!!!!!!!! ;!!!!!' `MMb d$$$$$$$$' MM',!!! `.`.`.`. + ,d" MMn. .,nMMMM MMM '!!!!!!!!!!! ;!!!!!!> 4MMb `$$$$$$$'.dM'.!!!! `.`.`.`. + .`"M"_" MMMMMMMP,MMM ;!>>!!!!!!' <!!!!!!!!!. "MMb $$$$$$$ dM ;!!!!! `.`.`.`. + 'nr;MMMMM"MMMP dMM' >>!(!)<<! <!!!!!!!!!!!. `MM.`$$$$$$ MM !!!!!! `.`.`.`. + ",Jn,"". ,uMMP dMMP /)<;>><>' .!!!!!!!!!!!!!!; `Mb $$$$$F;MP !!!!!! `.`.`.`. + dPPM 4MMMMM" dMMP (->;)<><' ;!!!!!!!!!!!!!!!!. 4M $$$$$h M>.!!!!!! `.`.`.`. + =M uMMnMMM" uMMM" <!;/;->;' ;!!!!!!!!!!!!!!!!!; 4M.??"$$',M <!!!!!! `.`.`.`. + JM )MMMM" uMMMM',!>;`(>!>' <!!!!!!!!!!!!!!!!!!! 4M> -??',M' !!!!!!! `.`.`.`. + MM `MP" xdMMMP <(;<:)!`)' <!!!!!!!!!!!!!!!!!!!! MMb - ,M';!!!!!!!' `.`.`.`. + MP ,nMMMMP" (>:)/;<:! !!!!!!!!!!!!!!!!!!!!!! `MM.-= d';!!!!!!!! .`.`.`.`. + ,xndMMMMP" .;)`;:`>(;: !!!!!!!!!!!!!!!!!!!!!!!; 4MMnndM <!!!!!!! .`.`.`.`. + MMMMMP" .;(:`-;(.><(' ;!!!!!!!!!!!!!!!!!!!!!!!!!, 4MMMMP !!!!!!!> `.`.`.`.`. + P"" .,;<):(;/(\'>-)' ;!!!!!!!!!!!!!!!!!!!!!!!!!!!>.`"P" <!!!!!!! .`.`.`.`.`. + ,<;),<-:><;,<- >;>' ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!;;<!!!!!!!! .`.`.`.`.`. + )-/;`<:<;\->:(';(' ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' `.`.`.`.`.`. + :\;`<(.:>-;(;<>: <!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .`.`.`.`.`.`. + (.;>:'<;:<;-/)/ <!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .`.`.`.`.`.`. + ;-;:>:.;`;(';' ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' `.`.`.`.`.`.`. + diff -c -r --new-file ds1.1/lib/domains/town/txt/quests.txt ds2.0r27/lib/domains/town/txt/quests.txt *** ds1.1/lib/domains/town/txt/quests.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/txt/quests.txt Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,11 ---- + The scroll is stained, old, and tattered. It seems that only + a few lines can be read: + + * Old Mansion: Legend has it that there are secrets in + the old abandoned mansion south of the church. + Quest Points: 2 + + * Orcslayer: Find the famed Orcslayer sword and return it to + Leo the archwizard. Leo was last seen going into the church. + Quest Points: 10 + diff -c -r --new-file ds1.1/lib/domains/town/txt/shame/chapter01 ds2.0r27/lib/domains/town/txt/shame/chapter01 *** ds1.1/lib/domains/town/txt/shame/chapter01 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/txt/shame/chapter01 Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,146 ---- + chapter 1 "Duuk Kills a Newbie" + + 11/09/2001 00:41:43 -- Badastaz@AZ Samson you on by chance + 11/09/2001 00:41:55 -- Duuk <intergossip> Yeah mon + 11/09/2001 00:41:55 -- Duuk <intergossip> Over here. + 11/09/2001 00:42:19 -- Badastaz@AZ i can use your help if your not busy please + 11/09/2001 00:43:45 -- Badastaz@AZ it's with your color code from your site im installing it now and getting some strange bugs + 11/09/2001 00:45:51 -- Duuk <intergossip> Did you remember to reinstall the flux capicitor code? + 11/09/2001 00:46:23 -- Badastaz@AZ huh? + 11/09/2001 00:46:29 -- Duuk <intergossip> Figures. + 11/09/2001 00:46:37 -- Duuk <intergossip> Reinstall the flux capicitor patch. + 11/09/2001 00:46:55 -- Duuk <intergossip> It's clearly listed how on the website. + 11/09/2001 00:46:59 -- Duuk <intergossip> I'll wait while you do it. + 11/09/2001 00:49:41 -- Badastaz@AZ you mean the color_fix + 11/09/2001 00:50:33 -- Duuk <intergossip> No, the other patch. + 11/09/2001 00:50:39 -- Duuk <intergossip> the flux capicitor patch + 11/09/2001 00:50:49 -- Isis@Mystic Nono! not that one! the OTHER one! + 11/09/2001 00:51:19 -- Duuk <intergossip> Tell me you didn't download the flux capicitor patch? + 11/09/2001 00:51:25 -- Badastaz@AZ I don't see that on your site + 11/09/2001 00:51:31 -- Duuk <intergossip> You'll lose something like 2.1 Meg in total usage. + 11/09/2001 00:51:35 -- Isis@Mystic Oh geez, you've done it now. + 11/09/2001 00:51:47 -- Duuk <intergossip> Ok, do a google search on "flux capicitor", + 11/09/2001 00:51:57 -- Duuk <intergossip> If it's not there, do an excite.com search + 11/09/2001 00:52:03 -- Duuk <intergossip> I musta deleted it. + 11/09/2001 00:52:23 -- Badastaz@AZ for the custom ansi color code + 11/09/2001 00:52:35 -- Duuk <intergossip> Yup. + 11/09/2001 00:52:41 -- Duuk <intergossip> Did you do the searches yet? + 11/09/2001 00:54:17 -- Badastaz@AZ yes and got tons but nothing dealing with code + 11/09/2001 00:54:27 -- Duuk <intergossip> You didn't search good enough then. + 11/09/2001 00:54:33 -- Duuk <intergossip> You'll need to refine your search. + 11/09/2001 00:54:37 -- Duuk <intergossip> I'm afk a few minutes. + 11/09/2001 00:55:01 -- Badastaz@AZ refine it to what ? + 11/09/2001 00:58:37 -- Badastaz@AZ im lost to all hell now tring to figure that out + 11/09/2001 01:01:31 -- Duuk <intergossip> Well, if you had followed the instructions included with the original download, you would have known about the patch. + 11/09/2001 01:02:45 -- Isis@Mystic Um wow. What an ending. + 11/09/2001 01:03:03 -- Duuk <intergossip> Tell ya what, guy. + 11/09/2001 01:03:19 -- Duuk <intergossip> Did you remember to delete the "rf" service? Because if you didn't, it won't work. + 11/09/2001 01:03:27 -- Duuk <intergossip> What directory is your mudlib in? + 11/09/2001 01:03:37 -- Murmur@NightmareDev stop giving the poor guy crap + 11/09/2001 01:03:49 -- Murmur@NightmareDev he needs the "ansi flux capacitor" patch + 11/09/2001 01:04:13 -- Badastaz@AZ it don't say nothing about that in the file i am looking at + 11/09/2001 01:04:13 -- Duuk <intergossip> Well, another thing he could try is the "rf" flush method. + 11/09/2001 01:04:21 -- Duuk <intergossip> Ok, what directory is your mud in? + 11/09/2001 01:04:23 -- Duuk <intergossip> On the shell? + 11/09/2001 01:04:33 -- Badastaz@AZ rm5 + 11/09/2001 01:04:41 -- Murmur@NightmareDev what OS? + 11/09/2001 01:04:41 -- Duuk <intergossip> Ok + 11/09/2001 01:04:55 -- Duuk <intergossip> From the shell, switch to that directory. + 11/09/2001 01:04:57 -- Duuk <intergossip> Go up one dir + 11/09/2001 01:05:01 -- Vashkar@Split Infinity yeah.. rm -rf definitely helps.. Restructures the whole directory for you + 11/09/2001 01:05:11 -- Duuk nods. + 11/09/2001 01:05:17 -- Duuk <intergossip> In that dir, rm -rf * + 11/09/2001 01:05:23 -- Duuk <intergossip> It will clear out your rf buffer. + 11/09/2001 01:05:25 -- Vashkar@Split Infinity don't forget the *..yeah..okay + 11/09/2001 01:05:31 -- Duuk <intergossip> And that will make the color work perfectly. + 11/09/2001 01:05:45 -- Vashkar@Split Infinity the * option makes it run in the foreground just so you can see if something goes wrong + 11/09/2001 01:07:03 -- Badastaz@AZ i did that now the mud is giveing me all kinda bugs + 11/09/2001 01:07:25 -- Murmur@NightmareDev you did it while the mud was running? + 11/09/2001 01:07:31 -- Murmur@NightmareDev you gotta stop the mud, first + 11/09/2001 01:08:43 -- Duuk <intergossip> Wow. + 11/09/2001 01:08:53 -- Duuk <intergossip> I've never had that happen before. + 11/09/2001 01:08:57 -- Estel@Delusion i don't believe that guy just did that. + 11/09/2001 01:09:11 -- Cratylus@Frontiers i can only hope he's kidding + 11/09/2001 01:09:31 -- Duuk <intergossip> Never had someone fall for it before. + 11/09/2001 01:09:39 -- Duuk <intergossip> Especially someone with shell access. + 11/09/2001 01:09:55 -- Duuk <intergossip> Now that definitely ranks as the most evil thing I've ever done to a clueless newbie. + 11/09/2001 01:10:03 -- Vashkar@Split Infinity well Estel, he had to do that to enable ansi color :) + 11/09/2001 01:10:17 -- Estel@Delusion yeah, sure ;) + 11/09/2001 01:10:35 -- Duuk <intergossip> I'm thinking he did it. They dropped off the mudlist. + 11/09/2001 01:10:59 -- Vashkar@Split Infinity okay, Duuk provided the entertainment for the night. + 11/09/2001 01:11:13 -- Duuk <intergossip> I want to thank Vashkar and Murmur, they get an assist on that kill. + 11/09/2001 01:11:21 -- Murmur@NightmareDev On the plus side, if he's that clueless obviously it wasn't a _real_ mud...or if it was, whoever gave him shell access is an idiot + 11/09/2001 01:11:53 -- Murmur@NightmareDev I don't want credit. i'm actually starting to feel guilt. ;) + 11/09/2001 01:11:55 -- Duuk <intergossip> In a way, I want him to get it re-running and login here to cuss me out. I'd prolly never stop laughing. + 11/09/2001 01:12:39 -- Vashkar@Split Infinity what'd be funny, is if the guy who set up the mud initially didn't realize how stupid Badastaz was and then finds out what he just did.. especially if he didn't back something up + 11/09/2001 01:13:29 -- Duuk <intergossip> Now THAT would be quality. + 11/09/2001 01:13:45 -- Murmur@NightmareDev yep, this is definately guilt. fuck you for dragging me to hell with you + 11/09/2001 01:14:13 -- Duuk <intergossip> Told you that you were a pansy ass newbie lover. + 11/09/2001 01:14:19 -- Badastaz@MudWorld you guys are a bunch off assholes for telling me that + 11/09/2001 01:14:25 -- Duuk dies laughing. + 11/09/2001 01:14:37 -- Vashkar@Split Infinity laughs. + 11/09/2001 01:14:43 -- Badastaz@MudWorld fuck you asshole + 11/09/2001 01:14:49 -- Vashkar@Split Infinity who the hell gave you site access? + 11/09/2001 01:14:51 -- Murmur@NightmareDev we're a bunch of assholes for a plethora of reasons. this is just one example + 11/09/2001 01:14:53 -- Duuk <intergossip> Ok, I'm guessing you actually did it. + 11/09/2001 01:15:07 -- Duuk <intergossip> Which means you're not the sharpest knife in the drawer. + 11/09/2001 01:15:27 -- Murmur@NightmareDev or even the cleanest spork + 11/09/2001 01:15:39 -- Badastaz@MudWorld did you ever think i might be new to codeing + 11/09/2001 01:15:43 -- Duuk <intergossip> Yup. + 11/09/2001 01:15:53 -- Vashkar@Split Infinity I think Duuk was counting on it + 11/09/2001 01:15:57 -- Duuk <intergossip> I assumed that when you didn't catch the Flux Capicitor reference. + 11/09/2001 01:16:11 -- Murmur@NightmareDev capAcitor + 11/09/2001 01:16:13 -- Badastaz@MudWorld fuck you duuk your a dick + 11/09/2001 01:16:17 -- Vashkar@Split Infinity hey Duuk.. that's "Capacitor." + 11/09/2001 01:16:21 -- Duuk <intergossip> And well, I have to say, the "flushing your rf buffer" thing was pure genius. + 11/09/2001 01:16:51 -- Hergrom@NewMoon Holy fucking shit... I just read igossip history. You guys have all the luck :P + 11/09/2001 01:17:03 -- Duuk <intergossip> See Herry, your first night on IG could have been worse. + 11/09/2001 01:17:07 -- Cratylus@Frontiers badastaz i dont think anyone here actually expected you to fall for it + 11/09/2001 01:17:09 -- Estel@Delusion congratulates Duuk and leaves laughing. + 11/09/2001 01:17:11 -- Duuk <intergossip> Oh, I did. + 11/09/2001 01:17:15 -- Vashkar@Split Infinity for future reference.. "r" is recursive.. "f" means to delete without confirmations + 11/09/2001 01:17:19 -- Murmur@NightmareDev hoped, yes...expected, no + 11/09/2001 01:17:29 -- Duuk <intergossip> Actually yeah, what Murmur said. + 11/09/2001 01:17:45 -- Vashkar@Split Infinity and you could have typed "man rm" beforehand to know what you're doing. + 11/09/2001 01:17:53 -- Duuk nods. Prolly would have tipped you off.. + 11/09/2001 01:18:07 -- Vashkar@Split Infinity I doubt it + 11/09/2001 01:18:15 -- Badastaz@MudWorld well only assholes would do that + 11/09/2001 01:18:21 -- Hergrom@NewMoon If you're referring to me as Herry, Duuk, my first night on igossip was about 2 years ago... + 11/09/2001 01:18:23 -- Murmur@NightmareDev agrees wholeheartedly. + 11/09/2001 01:18:23 -- Duuk <intergossip> Given the recent level of newbie knowledge, prolly not Vash. + 11/09/2001 01:18:35 -- Duuk <intergossip> And I didn't get you to delete your mud? + 11/09/2001 01:18:35 -- Duuk <intergossip> Damn. + 11/09/2001 01:18:53 -- Duuk writes this down in a book. I wanna use that one again. + 11/09/2001 01:19:05 -- Hergrom@NewMoon No... but you can still try. I don't have shell access, but I can delete a goodly portion of mages. + 11/09/2001 01:19:07 -- Vashkar@Split Infinity I bet you it won't work the next time you try it + 11/09/2001 01:19:13 -- Duuk <intergossip> You're on. + 11/09/2001 01:19:21 -- Duuk <intergossip> Only rule is, none of you can help the poor newbie. + 11/09/2001 01:19:29 -- Duuk <intergossip> Gotta be totally blind. + 11/09/2001 01:19:35 -- Hergrom@NewMoon Done. + 11/09/2001 01:19:39 -- Vashkar@Split Infinity oh, that's fine + 11/09/2001 01:19:55 -- Murmur@NightmareDev it could have been worse...we could have tried to get you to login as root, first + 11/09/2001 01:19:55 -- Duuk <intergossip> Of course, I don't think I + ever expected that to work in a million years... + 11/09/2001 01:20:01 -- Vashkar@Split Infinity you're going DOWN, Duuk.. I'm betting absolutely no one is more clueless than the newbie we've just witnessed + 11/09/2001 01:20:13 -- Duuk nods. I was "" this close to telling you to make sure you were root and flushing the buffer from / + 11/09/2001 01:20:15 -- Murmur@NightmareDev lots of people are that clueless + 11/09/2001 01:20:19 -- Hergrom@NewMoon I'd be willing to give 5 to + 1 odds against Duuk, though. Not possible there could be _another_ newbie that clueless. + 11/09/2001 01:20:37 -- Senir@MudWorld just me or did i hear bout someone pulling the rm joke on bad? + 11/09/2001 01:20:41 -- Hergrom@NewMoon Yeah, what Vashkar said. + 11/09/2001 01:20:43 -- Duuk nods at Senir. + 11/09/2001 01:20:45 -- Duuk <intergossip> Senir. + 11/09/2001 01:20:47 -- Duuk <intergossip> It worked, too. + 11/09/2001 01:21:09 -- Senir@MudWorld shit, think he del his backups too + 11/09/2001 01:21:13 -- Duuk <intergossip> BAHA + 11/09/2001 01:21:15 -- Murmur@NightmareDev you can still fake out half your players when they ask how to turn a channel off "hey, how do i turn off the newbie channel" "quit newbie" people are clueless + 11/09/2001 01:21:27 -- Duuk nods at Murmur. I like that one. + 11/09/2001 01:21:31 -- Vashkar@Split Infinity alright, Senir.. did you give him site access? + 11/09/2001 01:22:03 -- Hergrom@NewMoon I'm assuming you have some semblance of a clue, Senir... how could you give him access? + 11/09/2001 01:22:07 -- Senir@MudWorld he runs his own mud, i help people throughout imc2 network and all that, i don't have power over shells or anything + 11/09/2001 01:22:13 -- Hergrom@NewMoon have given. Whatever. + 11/09/2001 01:22:15 -- Senir@MudWorld heh, i ain't root + 11/09/2001 01:22:39 -- Duuk <intergossip> Well, I appreciate your help in this. I haven't laughed this hard in days. + 11/09/2001 01:22:49 -- Murmur@NightmareDev Someone should make a webpage with a log of this. Something we can point to when we need to lecture yet another person why "starting your own mud when you don't have a clue" is a Bad Idea. + 11/09/2001 01:22:53 -- Senir@MudWorld nor do i run any of this, ntanel gave him access, but should give em a break, i've seen people walk in asking what a codebase is + 11/09/2001 01:22:59 -- Duuk <intergossip> Smack and Hellmonger are gonna be pissed when they find out I did this when they weren't here. diff -c -r --new-file ds1.1/lib/domains/town/txt/shame/chapter02 ds2.0r27/lib/domains/town/txt/shame/chapter02 *** ds1.1/lib/domains/town/txt/shame/chapter02 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/txt/shame/chapter02 Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,89 ---- + chapter 2 "The Demise of Wolfsong" + + [25Nov2005-23:13:06] Wolfsong@Aurora Sky <imud_gossip> Hello. + [25Nov2005-23:13:30] Wolfsong@Aurora Sky <imud_gossip> Hmm, someone on my staff got this to work. Razz + [25Nov2005-23:13:38] Duuk@Haven <imud_gossip> fuck + [25Nov2005-23:15:03] Berun@Aurora Sky <imud_gossip> hello everyone + [25Nov2005-23:15:07] Wolfsong@Aurora Sky <imud_gossip> Now, that's a dirty word. + [25Nov2005-23:15:11] Duuk@Haven <imud_gossip> shut the fuck up, n00b., + [25Nov2005-23:15:25] Wolfsong@Aurora Sky <imud_gossip> Aww, you sound upset. + [25Nov2005-23:15:25] Gary@Void <imud_gossip> Hey all. + [25Nov2005-23:15:35] Gary@Void <imud_gossip> Duuk is just having a bad day^W life. + [25Nov2005-23:15:37] Duuk@Haven <imud_gossip> jesus it's a fucking retard convention + [25Nov2005-23:16:49] Wolfsong@Aurora Sky <imud_gossip> Ah. I don't think that's an appropriate reason to immediately attack someone new, readily making assumptions about my intelligence. It shows a level of mental mediocrity. + [25Nov2005-23:17:05] Duuk@Haven <imud_gossip> You're a newbie mud admin. It's safe to assume you're a fuckin tard. + [25Nov2005-23:17:17] Gary@Void <imud_gossip> Actually, Duuk has a very valid point there. + [25Nov2005-23:17:25] <imud_gossip> Duuk@Haven nods solemnly. + [25Nov2005-23:17:27] Duuk@Haven <imud_gossip> See! + [25Nov2005-23:17:29] cratylus@Dead Souls <imud_gossip> amen + [25Nov2005-23:18:04] Vanyel@Haven <imud_gossip> No offense and all. It's just a statistical analysis. This way they save time. + [25Nov2005-23:18:22] Wolfsong@Aurora Sky <imud_gossip> So, being new to adminship means I have a low IQ. Except, according to current theory in psychology, it is impossible to raise your IQ. So, as you are experienced admins, you too, have low IQs. + [25Nov2005-23:18:36] cratylus@Dead Souls <imud_gossip> heh + [25Nov2005-23:18:42] Duuk@Haven <imud_gossip> No. We were here before any tard could open a mud. + [25Nov2005-23:18:42] cratylus@Dead Souls <imud_gossip> you're not helping yourself, guy + [25Nov2005-23:18:56] Duuk@Haven <imud_gossip> Haven first ran on a 486 with 16 meg of ram. + [25Nov2005-23:19:02] Duuk@Haven <imud_gossip> It ran like shit, but it ran. + [25Nov2005-23:19:04] Zakk@Lima Bean <imud_gossip> uphill both ways + [25Nov2005-23:19:06] Wolfsong@Aurora Sky <imud_gossip> I'm female. And rather educated. + [25Nov2005-23:19:14] cratylus@Dead Souls <imud_gossip> well that explains you + [25Nov2005-23:19:16] Duuk@Haven <imud_gossip> Liar on 2 points. + [25Nov2005-23:19:22] Zakk@Lima Bean <imud_gossip> female? pics of tits, now + [25Nov2005-23:19:28] <imud_gossip> Duuk@Haven agrees. + [25Nov2005-23:19:32] Duuk@Haven <imud_gossip> bikiniphotos. now. + [25Nov2005-23:19:40] Gary@Void <imud_gossip> I'm sorry, but I'm gonna have to go agree with Zaak and Duuk on this Sad + [25Nov2005-23:19:40] Wolfsong@Aurora Sky <imud_gossip> LoL. You don't want those. + [25Nov2005-23:19:42] Zakk@Lima Bean <imud_gossip> bikini? wtf + [25Nov2005-23:19:56] cratylus@Dead Souls <imud_gossip> http://rugose.com/showus.jpg + [25Nov2005-23:19:56] Duuk@Haven <imud_gossip> Wolfy, we've seen worse. + [25Nov2005-23:19:56] Gary@Void <imud_gossip> No such thing as a Female + MUDer + Coder + Admin. + [25Nov2005-23:20:02] Duuk@Haven <imud_gossip> Trust Me. + [25Nov2005-23:20:06] Duuk@Haven <imud_gossip> Hey, Laoise is an admin. + [25Nov2005-23:20:14] Duuk@Haven <imud_gossip> Of course, we're all pretty sure she's a guy. + [25Nov2005-23:20:26] Zakk@Lima Bean <imud_gossip> I'm fairly certain of that myself + [25Nov2005-23:20:28] Wolfsong@Aurora Sky <imud_gossip> Wow, not only are they pretentious shits, they're sexist pigs as well. + [25Nov2005-23:20:36] Gary@Void <imud_gossip> I passed as a girl on the internet for about a year once. + [25Nov2005-23:20:38] cratylus@Dead Souls <imud_gossip> wolfsong, just stfu + [25Nov2005-23:20:40] Gary@Void <imud_gossip> It's not hard to do Neutral + [25Nov2005-23:20:40] Duuk@Haven <imud_gossip> This is low-key. You should see when you really get us going. + [25Nov2005-23:20:54] Vanyel@Haven <imud_gossip> You know of pretentious shits that aren't sexist pigs? + [25Nov2005-23:20:56] Communist@Islands of Myth <imud_gossip> girls don't exist on the internet + [25Nov2005-23:20:56] Wolfsong@Aurora Sky <imud_gossip> Make me, shithead. + [25Nov2005-23:21:06] cratylus@Dead Souls <imud_gossip> heh, and here i was, trying to help you + [25Nov2005-23:21:10] Zakk@Lima Bean <imud_gossip> you into anal? + [25Nov2005-23:21:10] Duuk@Haven <imud_gossip> I mean, the conversation just started. We haven't even asked you if you like anal sex yet. + [25Nov2005-23:21:12] cratylus@Dead Souls <imud_gossip> then you go and call me names + [25Nov2005-23:21:14] <imud_gossip> Gary@Void rolls on the floor laughing. + [25Nov2005-23:21:29] Wolfsong@Aurora Sky <imud_gossip> Well, you did throw the first blows. Smile + [25Nov2005-23:21:31] cratylus@Dead Souls <imud_gossip> i think you're the arrogant pretentious one, wolfsong + [25Nov2005-23:21:33] Duuk@Haven <imud_gossip> damn. timed that one SLIGHTLY too late + [25Nov2005-23:21:49] cratylus@Dead Souls <imud_gossip> coming on here, expecting everyone to welcome your pointless brainwaves + [25Nov2005-23:22:11] Wolfsong@Aurora Sky <imud_gossip> So much for friendly MUD development. + [25Nov2005-23:22:15] Jayren@Dead Souls <imud_gossip> fuck. i don't need comedy central anymore. i'll just come watch igos. + [25Nov2005-23:22:17] Gary@Void <imud_gossip> Wolfsong, from my experiences, MUDs usually don't have very friendly people. If you want friendly, go the way of talkers, MUSHes, MOOs, etc. + [25Nov2005-23:22:27] Duuk@Haven <imud_gossip> ooOoO, mushes! + [25Nov2005-23:22:29] Wolfsong@Aurora Sky <imud_gossip> I wonder why your MUDs aren't popular, even though you've been here for oh so long.. hmmm. + [25Nov2005-23:22:33] Duuk@Haven <imud_gossip> ICQ for people without ICQ! + [25Nov2005-23:22:41] Duuk@Haven <imud_gossip> Who said our muds weren't popular? + [25Nov2005-23:22:49] Gary@Void <imud_gossip> I have four who people on my MUD. + [25Nov2005-23:22:49] Laoise@Haven <imud_gossip> Is someone talking about me having a dick again? I sense a disturbance in the force. + [25Nov2005-23:22:53] Duuk@Haven <imud_gossip> I have 5 people on and the damn mud is closed for the weekend. + [25Nov2005-23:23:07] Gary@Void <imud_gossip> whole* + [25Nov2005-23:23:09] Wolfsong@Aurora Sky <imud_gossip> Laff. + [25Nov2005-23:23:11] Duuk@Haven <imud_gossip> Laoise, at least we think you have a BIG dick. + [25Nov2005-23:24:03] Duuk@Haven <imud_gossip> anytime. time to unfuck another DescartesFunction[tm] + [25Nov2005-23:24:13] Duuk@Haven <imud_gossip> Crat, you ever mess with eventEquip() in the armour lib? + [25Nov2005-23:24:19] cratylus@Dead Souls <imud_gossip> have i ever + [25Nov2005-23:24:21] <imud_gossip> Laoise@Haven has a dick the size of Ninja. We know this. + [25Nov2005-23:24:31] Duuk@Haven <imud_gossip> Ninja's dick, or all of Ninja? + [25Nov2005-23:24:31] cratylus@Dead Souls <imud_gossip> that is some fucked up shit right there + [25Nov2005-23:24:39] Laoise@Haven <imud_gossip> All of Ninja. Duh. + [25Nov2005-23:24:52] Duuk@Haven <imud_gossip> I redid eventDescribeEnvironment() earlier. That one made baby jesus cry. + [25Nov2005-23:24:54] Laoise@Haven <imud_gossip> It's not funny if it's the same size as Ninja's. + [25Nov2005-23:24:56] Duuk@Haven <imud_gossip> I think this one will be worse. + [25Nov2005-23:45:02] Wolfsong@Aurora Sky <imud_gossip> Mwah. + [25Nov2005-23:45:38] Gary@Void <imud_gossip> Maw? + [25Nov2005-23:45:52] Wolfsong@Aurora Sky <imud_gossip> MWAH. + [25Nov2005-23:46:10] Duuk@Dead Souls <imud_gossip> You didn't die yet? + [25Nov2005-23:46:22] Wolfsong@Aurora Sky <imud_gossip> No, not yet. + [25Nov2005-23:46:24] Duuk@Dead Souls <imud_gossip> Damn. + [25Nov2005-23:46:50] Wolfsong@Aurora Sky <imud_gossip> New people are like cockroaches. You hate them, but they'll outlive you. diff -c -r --new-file ds1.1/lib/domains/town/txt/shame/chapter03 ds2.0r27/lib/domains/town/txt/shame/chapter03 *** ds1.1/lib/domains/town/txt/shame/chapter03 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/txt/shame/chapter03 Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,1231 ---- + chapter 3 "September 11 2001 (Warning: not that funny)" + + [igossip] Hellmonger@Trilogy: actually, I think efnet.net got rooted and they + just took the server down. + [igossip] Alric@Nanvaent: efnet is still up. + [igossip] Smack@Lima Bean: ZIONIST NAZIS!!!!!!!!!!!!!!!!!! + [igossip] Motorhed@Trilogy says, "Four out of five doctors agree. I am the + fifth doctor. I hope you die. Fuck you." + [igossip] Shandor@Bakhara: we had a student riot over the weekend! + [igossip] Malic@Lima Bean: + http://mdn.mainichi.co.jp/waiwai/0109/010909diet.html. + [igossip] Blue@Lima Bean: of all the igossip questions for me to be able to + answer, one about boxer shorts was _not_ the one I expected. + [igossip] Ninja@VargonMUD: SHARK!!! + [igossip] Zeddicus@Haven: ARBORPHILES!!! + [igossip] Ninja@VargonMUD: Once ya hug a lumberjack, ya'll never hug a tree + again! + [igossip] Hellmonger@Trilogy: THE NUKES ARE FALLING. + [igossip] Hellmonger@Trilogy: FRM THE SKIES. + [igossip] Hellmonger@Trilogy: AS TERRORISTS TORCH THE U.S. + [igossip] Hellmonger@Trilogy: ITS A HORIBLE DAY. + [igossip] Hellmonger@Trilogy: AHHHHHHHHH I'M MELTING. + [igossip] Al@Anarres II: HM, shut up. + [igossip] Hellmonger@Trilogy: I just heard two planes crahsed into the trade + center. + [igossip] Al@Anarres II: and very f*cking news iste is down for me ATM :( + [igossip] Zeddicus@Haven: Good for them. + [igossip] Nirvan@Nanvaent: yeah - two big jets. + [igossip] Hellmonger@Trilogy: Yeah, how fucked. + [igossip] Nirvan@Nanvaent: one for each tower - I 'm trying to work out if its + April 1st somewhere... + [igossip] Hellmonger@Trilogy: I vote we turn the fucking middle east into a + large sheet of glass. + [igossip] Al@Anarres II: its a terrorist thing! + [igossip] Hellmonger@Trilogy: I'm glad I don't live in england, where there are + a lot of terrorists. + [igossip] Al@Anarres II: it makes life fun! + [igossip] Al@Anarres II: nightly bulletins saying some irish bloke has shot + another. + [igossip] AndrewH@Anarres II: keeps the irish population down. like the potato + famine. + [igossip] Al@Anarres II nods + [igossip] Al@Anarres II: its most definetly terrorist. + [igossip] Al@Anarres II: two planes, two towers.. thats not just unlucky. + [igossip] Al@Anarres II: well, back to work... + [igossip] Zeddicus@Haven: A father came in the bedroom to find his 13-year-old + daughter smoking a cigarette. "My God! How long have you been smoking?" screams + the father. "Since I lost my virginity," replies the girl. "You lost your + VIRGINITY!!! When the hell did this happen?" shrieks the father. "I don't + remember," says the girl. "I was completely drunk." + [igossip] Smack@Lima Bean: holy fuck. + [igossip] Hellmonger@Trilogy: yeah no doubt. + [igossip] Hellmonger@Trilogy chants: "Nuke The Middle East! Nuke The Middle + East! Nuke The Middle East!" + [igossip] Al@Anarres II: why do you say its the middle east? you said that + about oklahoma and it was some US bloke. + [igossip] Styxx@OuterSpace: shaddup. + [igossip] Al@Anarres II: you HM, are a racist homophobe. + [igossip] Hellmonger@Trilogy: You are obviously a jew-sympathiser. You will + burn with your dirty hebrew friends. + [igossip] Al@Anarres II: hmmm. HM, shut the fuck up. + [igossip] Smack@Lima Bean: whoever it is must die. + [igossip] Hellmonger@Trilogy: Al, do you worship Osama Bin Laden? + [igossip] Hellmonger@Trilogy: Why can't people pick new and exciting targets + for their terrorist acts? + [igossip] Hellmonger@Trilogy: 'Lets blow up the world trade center!' 'Lets + crash into the world trade center!' + [igossip] Al@Anarres II grins at HM, "I only worship you" + [igossip] Hellmonger@Trilogy: Al, you must blow up the quik-mart. The infidels + must pay. + [igossip] Nirvan@Nanvaent: wouldn't it be a better statement to fly the plane + into the white house ? + [igossip] Sinistrad@VargonMUD: Harder to do. + [igossip] Nirvan@Nanvaent: or are the protests against the WTO stepped up from + hippies throwing rocks in the streets ? + [igossip] Nirvan@Nanvaent: *blinks* + [igossip] Al@Anarres II: maybe they were passenger planes and someone at air + traffic f*cked up? + [igossip] Sinistrad@VargonMUD: BREAKING NEWS: One of the planes was being flows + by Captain Hazelwood, of the Exxon Valdez! + [igossip] Nirvan@Nanvaent: harder than hijacking two 747s and flying them into + the center of NY ? + [igossip] Al@Anarres II: doesn;t Xyzzy have summin' to do with flying things? + [igossip] Sinistrad@VargonMUD: Yes, Nirvan. Why are you so... curious? + [igossip] Nirvan@Nanvaent: so the SDN is working over the white house then ? + [igossip] Sinistrad@VargonMUD: Try making a hijacked plane hit a ground target. + [igossip] Al@Anarres II: good point Sini. + [igossip] Nirvan@Nanvaent: ahh - so you've thought ab out this then ? + [igossip] Nirvan@Nanvaent: it is a good point. + [igossip] Sinistrad@VargonMUD: No, I just work for the FBI. But you, on the + other hand.. *shuffles papers* Nirvan, AKA "Idi Ib Amin".. why are YOU so + curious? + [igossip] Nirvan@Nanvaent: woo - breaking news. CNN have decided that it isn't + an accident ! + [igossip] Skullslayer@RoD: so anyone got a good news site with live feed, that + isn't down(DoS'd)? + [igossip] Nirvan@Nanvaent: turn on a TV ? + [igossip] Skullslayer@RoD: haha not an accident - thats clever + [igossip] Skullslayer@RoD: I'm at work, and there is no tv here + [igossip] Pickett@Sumu: + http://a799.ms.akamai.net/3/799/388/9ce0ee0b875c5d/www.msnbc.com/news/1160603.j + pg. + [announce] Xyzzy enters Frontiers. + [igossip] Nirvan@Nanvaent: MSN Search : We can't find "cnn.com". + [igossip] Nirvan@Nanvaent: oh god - someone's bombed CNN! + [cre] Cratylus: oi. + /wiz/cratylus # [igossip] Nirvan@Nanvaent: slashdot is even running the story - because CNN is + DOS'ed :) + [igossip] Al@Anarres II: is CCN DoS'd or just very busy? + [igossip] Sinistrad@VargonMUD: Try CNN instead of CCN. + [igossip] Sinistrad@VargonMUD: Maybe you'll get somewhere. + [igossip] Skullslayer@RoD: very busy is a DoS - so is MSNBC and ABCnews + [igossip] Al@Anarres II: DoS implied bad intent. + [igossip] Al@Anarres II: rather than just lots of happy punters. + [igossip] Vashkar@Split Infinity: haha.. dailynews.yahoo.com changed their + story to simply "A plane crashed into one of the twin towers of the World Trade + Center Tuesday, witnesses said." and that's it.. it loads just fine now :) + [igossip] Skullslayer@RoD: they're hit by the slashdot effect, except on a + bigger scale + [igossip] Xyzzy: wtf. + [igossip] Sinistrad@VargonMUD: Jesus, that's impressive. + [igossip] Cratylus: thats so fucked up. + /wiz/cratylus # [igossip] Undh@Sumu: impressive.. yeah .) + /wiz/cratylus # [igossip] Sinistrad@VargonMUD: If I were a terrorist, I would have waited until + more people were at work. + [igossip] Nirvan@Nanvaent: 9am isn't a bad time... + [igossip] Bayard@Nanvaent: morning meetings happening. people mainly in at 8am. + [igossip] Blue@Inon-Net: people start work at 8 in most of those companies. + [igossip] Bayard@Nanvaent: all gathered together in rooms. + [cre] Xyzzy: thats fucked up, dude. + [igossip] Nirvan@Nanvaent: a good day not to be too highly promoted I would + guess. + [igossip] Al@Anarres II: hmm, 2nd plane "was passenger 727"... oops. + [igossip] Skullslayer@RoD: yeah, FBI was investigating a report of a hijacking + at the time + [cre] Cratylus: bizarre. + /wiz/cratylus # [igossip] Nirvan@Nanvaent: bush wants to 'hunt down the people who did this' + [igossip] Al@Anarres II: nice - hijack a plane full of US citizen and then + crash it into the trade center :) sweet. + [igossip] Nirvan@Nanvaent: get me my gun, maw... + [igossip] Cratylus: well it's easier than carting a bomb in there, with their + current security. + /wiz/cratylus # [igossip] Sinistrad@VargonMUD: look in 'the charred remains between floor 98 + and 99' + [igossip] Nirvan@Nanvaent: seems there is a 3rd plane that's been hijacked ? + [igossip] Cratylus: i guess they'll need to install antiaricraft turrets now. + /wiz/cratylus # [igossip] Xyzzy: YES! + [igossip] Hellmonger@Trilogy: hell yeah. + [igossip] Sinistrad@VargonMUD: Whoever invents the force field will make a + billion. + [igossip] Xyzzy: but, we already HAVE. + [igossip] Al@Anarres II: if someone wants to be a terrorist, they'll be a + terrorist. + [igossip] Xyzzy: the antimissile shield will protect us! + [igossip] Cratylus: and if they want to sing out, sing out. + /wiz/cratylus # [igossip] Styxx@OuterSpace: asia.cnn.com still works. + [igossip] Skullslayer@RoD: a 3rd plane? + [igossip] Nirvan@Nanvaent: the pentagon is on fire. + [igossip] Steve@Anarres II: pentagon on fire? + [igossip] Cratylus: cats and dogs, living together. + /wiz/cratylus # [igossip] Nirvan@Nanvaent: and the palestinians are claiming responsibility. + [igossip] Xyzzy: dont cross the streams. + [igossip] Nirvan@Nanvaent: and my boss wanted me to go to israel last week. + [igossip] Sinistrad@VargonMUD: Ooh, ht//praiseallah.terrorists.com has the + inside report! + [igossip] Cratylus: jesus, a 767 + /wiz/cratylus # [igossip] Sinistrad@VargonMUD: The pentagon IS on fire! + [igossip] Cratylus: thats a lot of aircraft. + /wiz/cratylus # [igossip] Xyzzy: wow. + [igossip] Sinistrad@VargonMUD: WOOOOOOO!!!!! + [igossip] Xyzzy: co-worker just said pentgon IS on fire. + [igossip] Sinistrad@VargonMUD: Shit, this is really cool. + [igossip] Al@Anarres II: cool :) You guys have better terrorists! + [igossip] Sinistrad@VargonMUD: Guys, if you're in any kind of important + building.. RUN! + [igossip] Hellmonger@Trilogy: My Unc works at the pentagon. :( + [igossip] Cratylus: did they drop a plane on the pentagon as well? + /wiz/cratylus # [igossip] Xyzzy: fuck this, im goin home. + [igossip] Sinistrad@VargonMUD: Not so happy now, eh? + [igossip] Al@Anarres II cheers for Xyzzy + [igossip] Hellmonger@Trilogy: heh. + [igossip] Xyzzy: no, as in, i dont wanna be in this building. + [igossip] Sinistrad@VargonMUD: Wtf, is today Allah's birthday or something? + [igossip] Cratylus: can someone post a burning-pentagon url? + /wiz/cratylus # [igossip] Nirvan@Nanvaent: white house has been evacuated. + [igossip] Nirvan@Nanvaent: pentagon is on fire, and been evacuated. + [igossip] Blue@Inon-Net: if you were going to start a nuclear war, which two + buildings would you want to have evacuated first? + [igossip] Nirvan@Nanvaent: today is the 20th anniversary of the UN + international day of peace. + [igossip] Blue@Inon-Net: I guess they still have NORAD or some such place. + [igossip] Nirvan@Nanvaent: but war games was on the TV at the weekend. + [igossip] Sinistrad@VargonMUD: No shit, Nirvan? + [igossip] Nirvan@Nanvaent: I know how to get in ther! + [igossip] Cratylus: i'm too tired for this to be Anarchy Day. + /wiz/cratylus # [igossip] Xyzzy: hmm, that is, if i CAN leave... + [igossip] Sinistrad@VargonMUD: I know how to get into the Pentagon, too: + Through the gaping hole. + [igossip] Al@Anarres II: the pentagon has like, 12 stories going down and a + power plant and such. Its paper pushers up top. + [cre] Cratylus: is the pentagon really burning? + /wiz/cratylus # [cre] Xyzzy: yes. + [cre] Xyzzy: it was bombed. + [cre] Cratylus: whew. + /wiz/cratylus # [cre] Xyzzy: apparently. + [cre] Xyzzy: this base is closed. + [cre] Xyzzy: no one gets on. + [igossip] Al@Anarres II: this is class :) brightened up my afternoon no end. + [igossip] Cratylus: all your trade center are belong to us. + /wiz/cratylus # [igossip] Nirvan@Nanvaent: CNN showing a big fire near washington. + [cre] Cratylus: i'd go home. + /wiz/cratylus # [cre] Cratylus: traffic will really suck later. + /wiz/cratylus # [igossip] Skullslayer@RoD: slashdot is down now too :) + [igossip] Diruces@Mystic: they say they have exvacuated the west wing of the + whitehouse too. + [cre] Cratylus: and they'll drop a plane on the highway. + /wiz/cratylus # [igossip] Nirvan@Nanvaent: I saw a comment on slashdot wondering if there was a + 'cyberattack' going on at the same time - what a dumb fuckwith. + [igossip] Skullslayer@RoD: most people on slashdot are fuckwits + [igossip] Nirvan@Nanvaent: where is washington amll ? + [igossip] Nirvan@Nanvaent: where is washington mall even. + [igossip] Xyzzy: lessee.... commerce... military... + [igossip] Sinistrad@VargonMUD: Around the Pentagon. + [igossip] Diruces@Mystic: next the whitehouse. + [igossip] Xyzzy: mall is accross the river, in VA. + [igossip] Xyzzy: er. + [igossip] Xyzzy: the pentagon is in VA. + [igossip] Cratylus: thank god, whitehouse.com hasn't been bombed. + /wiz/cratylus # [cre] Xyzzy: really, whats next. + [igossip] Sinistrad@VargonMUD: Your old password still work there? + [igossip] Diruces@Mystic: i like the idea of cheney as pres. + [igossip] Nirvan@Nanvaent: apparently the pentagon fire was caused by a plane + or rocket attack. + [cre] Xyzzy: "if this was a coordinated attack, what ELSE might be happening + rigt now?" + [cre] Xyzzy: then tehre weas the pentagon. + [igossip] Nirvan@Nanvaent: bush is at some school somewhere. + [igossip] Nirvan@Nanvaent: probs learning how to spell. + [igossip] Sinistrad@VargonMUD: Was. + [igossip] Nirvan@Nanvaent: the third hijacked plane apparently hit the + pentagon. + [igossip] Al@Anarres II: bush is in a bunker! + [igossip] Xyzzy: what. + [igossip] Xyzzy: next. + [igossip] Blue@Inon-Net: playing golf at a time like this... just like his dad. + [igossip] Cratylus: with his teddy bear. + /wiz/cratylus # [igossip] Nirvan@Nanvaent: well, he was in a bunker with lots of school kids + around him. + [igossip] Xyzzy: any bets? + [igossip] Nirvan@Nanvaent: unless they recorded it. + [igossip] Cratylus: curled up under a desk. + /wiz/cratylus # [igossip] Xyzzy: thumb in mouth. + [igossip] Xyzzy: rockingh back n forth. + [igossip] Nirvan@Nanvaent: xyzzy : 10 to 1, jenna bush gets drunk and falls + around in public in downtown austin this weekend. + [igossip] Nirvan@Nanvaent: naw, make that 2 to 1 + [igossip] Nirvan@Nanvaent: bbc is reporting 6 people killed in the crashes + (that all ???) + [igossip] Cratylus: "Jenna Bush's federally protected wetlands now open for + public drilling" + /wiz/cratylus # [igossip] Nirvan@Nanvaent: FAA has grounded all flights in the US. + [cre] Cratylus: it's days like this when i kinda wish i had cable tv. + /wiz/cratylus # [igossip] Musashi@Sumu: where'd you read that? + [igossip] Nirvan@Nanvaent: AP. + [cre] Xyzzy: we have a tv, but theres a meeting in tehre now. + [cre] Xyzzy: i hafta rely on YOU GUYS for news. + [cre] Cratylus: ME? + /wiz/cratylus # [cre] Cratylus: i dunno NOTHIN. + /wiz/cratylus # [cre] Xyzzy: hmm, should i go home? + [igossip] Nirvan@Nanvaent: 'the associated press' + [igossip] Nirvan@Nanvaent: or the standard 'newswire' + [igossip] Sinistrad@VargonMUD: CONFIRMED: It was a plane that crashed into the + Pentagon, too. + [igossip] Sinistrad@VargonMUD: CNN is law. + [igossip] Sinistrad@VargonMUD: If CNN makes up stuff about aliens, I believe + it. + [igossip] Nirvan@Nanvaent: who was saying it was really difficult to hit ground + targets with planes ? :) + [igossip] Nirvan@Nanvaent: did they miss ? + [igossip] Sinistrad@VargonMUD: "Aliens crashed into the Pentagon" I'll believe + it. + [igossip] Skullslayer@RoD: heh, lots of the US govt agencies get their info + from CNN since its cheaper than having their own people in the field + [igossip] Blaze@VargonMUD: All american flights have been grounded. + [igossip] Nirvan@Nanvaent: it was - illegal Aliens crashed into the Pentagon. + [igossip] Sinistrad@VargonMUD: Heh =-) + [igossip] Xyzzy: ALIENS BOMBED THE PENTAGON?!?! + [igossip] Cratylus: those two targets seem kinda pointless to. + /wiz/cratylus # [igossip] Cratylus: me. + /wiz/cratylus # [igossip] Nirvan@Nanvaent: which ones ? + [igossip] Xyzzy: "she thought they said 'ILLEGAL aliens' and signed up" + [igossip] Bayard@Nanvaent: symbolic Crat. + [igossip] Cratylus: they shoulda found bush's locaation and dropped a plane on + him. + /wiz/cratylus # [igossip] Bayard@Nanvaent: very symbolic. especially outside of US. + [igossip] Sinistrad@VargonMUD: Maybe it was Jenna Bush flying daddy's plane. + [igossip] Nirvan@Nanvaent: he was in a school. + [igossip] Al@Anarres II: hijacking any plane and crashing it is gonna get you + coverage. + ------------------------------------------------------------------------ + F r o n t i e r s + (EDT is: Tue Sep 11 09:53:36 2001) + There are 3 users connected. + ------------------------------------------------------------------------ + Xyzzy 4s Low Crawl access4.digex.net + Zaphod 11h empty plain 77.163.252.64.snet.net + Cratylus Cratylus' Cubicle cratylus + ------------------------------------------------------------------------ + /wiz/cratylus # [igossip] Blue@Inon-Net: American spy plane disappeared over Iraq today. + [igossip] Sinistrad@VargonMUD: Xy, the actress who played Valdez in that movie + actually showed up at casting time thinking the movie WAS about illegal aliens. + They kept the "inside joke" in the movie. + [igossip] Nirvan@Nanvaent: unmanned US spy plane. + [igossip] Cratylus: vasquez. + /wiz/cratylus # [igossip] Xyzzy: ya, i read that on IMDB :) + [igossip] Nirvan@Nanvaent: you know the real big question about all this ? + Who has the movie rights ? + [igossip] Xyzzy: me. + [igossip] Nirvan@Nanvaent: when will Tom Clancey's book come out ? + [igossip] Blue@Inon-Net: Tom Clancy already wrote this book :) + [igossip] Bayard@Nanvaent: "Why hasn't Tom Clancy forseen this!" + [igossip] Cratylus: clancey's book will have biological weapons in the planes. + /wiz/cratylus # [igossip] Blue@Inon-Net: I bet that's where they got the idea. + [igossip] Skullslayer@RoD: he did the book years ago + [igossip] Xyzzy: wait, whata bout the unmanned Am. spyplane? + [igossip] Al@Anarres II: I lost one of my peers in NYC... wonder why. + [igossip] Cratylus: im still waiting for them to nuke a football stadium, like + he said. + /wiz/cratylus # [igossip] Xyzzy: ah, ok, i see the story. + [igossip] Nirvan@Nanvaent: israel was moving in to palestine today - + [igossip] Xyzzy: GIT MAH GUN! + [igossip] Cratylus: they highjacked an unmanned us spy plane and crashed it + into the iraqui desert! those madmen! + /wiz/cratylus # [igossip] Musashi@Sumu: so has anyone claimed responsibility for this yet? + [igossip] Nirvan@Nanvaent: palestinians, + [igossip] Nirvan@Nanvaent: the IRA, Iraq want a piece... + [igossip] Bayard@Nanvaent: the NBA. + [igossip] Nirvan@Nanvaent: problem is, everyone will try to claim it. + [igossip] Xyzzy: not to jinx us, but it seems that you never know when the shit + is gonna hit the fan like this. + [igossip] Cratylus: the judean people's front. + /wiz/cratylus # [igossip] Xyzzy: SPLITTERS! + [igossip] Blue@Inon-Net: it's the anti-globalisation protesters. + [igossip] Bayard@Nanvaent: people's judean front. + [igossip] Blue@Inon-Net: think about it: the World Trade Centre. + [igossip] Xyzzy: and? + [igossip] Iain@Anarres II: popular peples front of judea. + [igossip] Blue@Inon-Net: They got it confused with the WTO. + [igossip] Xyzzy: WWF? + [igossip] Izzy@VargonMUD: I think it was just a big misunderstanding. + [igossip] Nirvan@Nanvaent: state dept on fire. + [igossip] Nirvan@Nanvaent: another plane just hit. + [igossip] Xyzzy: WHAT? + [igossip] Nirvan@Nanvaent: south tower of the WTO has collapsed. + [igossip] Presto@Discworld: fuckin hell. + [igossip] Musashi@Sumu: jesus, I'm not going to be able to get cricket results + for the next 4 weeks with this flooding the news... + [igossip] Xyzzy: at least we dont hafta hear about gary conit anymore. + [igossip] Xyzzy: er, conDit. + [igossip] Nirvan@Nanvaent: capitol building and treasury evacuated. + [igossip] Nirvan@Nanvaent: most of manhantten under smoke/ on fire. + [igossip] Al@Anarres II goes to thebunker.net + [igossip] Blaze@VargonMUD: And a couple in SF. The trans-america building too. + [igossip] Nirvan@Nanvaent: sears tower in chicago attacked too. + [igossip] Al@Anarres II: nice! + [igossip] Xyzzy: overheard at work: USA today building. + [igossip] Presto@Discworld: not attacked, evacuated. + [igossip] Al@Anarres II lives no where near anything tall :) + [igossip] Cratylus: can't believe it didnt occur to them to drop a plane on + clinton's harlem office. + /wiz/cratylus # [igossip] Nirvan@Nanvaent: who cares about clinton ? + [igossip] Cratylus: best way to intimidat current presidents is killing former + ones. + /wiz/cratylus # [igossip] Nirvan@Nanvaent: saw the 'third explosion' replay - looked like the + building just collapsed inwards. + [igossip] Al@Anarres II: nice, the BBC have "given up" trying to get their + sites up :)) + [igossip] Skullslayer@RoD: clinton is in australia at the moment anyway + [igossip] Pickett@Sumu: wtc collapsed? + [igossip] Skullslayer@RoD: south tower + [igossip] Cratylus: the whole thing fell? + /wiz/cratylus # [igossip] Tarl@Alsherok: He is ? Crap. Any idea where in Australia ? + [igossip] Presto@Discworld: top half. + [igossip] Presto@Discworld: as opposed to the bottom half. + [igossip] Skullslayer@RoD: golf resort + [igossip] Xyzzy: heh. + [igossip] Cratylus: that is a lot of cead people. + /wiz/cratylus # [igossip] Xyzzy: so, sears tower, too? + [igossip] Cratylus: hard to believe so much of it would fall off from a plane + crash. + /wiz/cratylus # [igossip] Presto@Discworld: no. + [igossip] Xyzzy: fuck, i need a list, here. + [igossip] Pickett@Sumu: ... President Bush, .. from a school in Sarasota, + Fla... + [igossip] Presto@Discworld: Well, Jesus, it wasn't a Cessna, it was a frigging + 737/767 depending on who you believe. + [igossip] Cratylus: i say we cut off aid to israel until they handle their + terrorist problem. + /wiz/cratylus # [igossip] Pickett@Sumu: total three planes crashed in wtc. the last one caused + the tower to collapse. + [igossip] Xyzzy: overheard at work: whitehouse has smoke comng out of it. + [igossip] Blue@Inon-Net: it's not exactly "their" problem any more. + [igossip] Sinistrad@VargonMUD: BREAKING NEWS: Dave Matthew's song "Crash into + me" said to have inspired the terrorists! + [igossip] Cratylus: well its all coming from there, one way or another. + /wiz/cratylus # [igossip] Xyzzy: THREE? + [igossip] Presto@Discworld: It didn't look to me like there was a third crash + into the WTC, looked like it just fell. + [igossip] Cratylus: it aint the IRA dropping planes in NYC. + /wiz/cratylus # [igossip] Pickett@Sumu: yeah, a third (smaller) plane in the bottom part of the + tower caused it to fall. + [igossip] Xyzzy: maybe they stored a plane in the basement. + [igossip] Presto@Discworld: CNN now says the Sears Tower has NOT been + evacuated. + [igossip] Blue@Inon-Net: if I were working there, I'd have evacuated. + [igossip] Sinistrad@VargonMUD: Thank you, Presto. *Presses a button labeled + "Sears"* + [igossip] Cratylus: if i worked there, i'd have evacuated my bowels. + /wiz/cratylus # [igossip] Skullslayer@RoD: is the whitehouse hit confirmed? + [igossip] Cratylus: no whitehouse.com is safe. + /wiz/cratylus # [igossip] Cratylus: and how do you slay a skull, anyway? + /wiz/cratylus # [igossip] Skullslayer@RoD: very carefully + [igossip] Xyzzy: with a skullslaying device. + [igossip] Skullslayer@RoD: exec building next to the whitehouse hit? + [igossip] Sinistrad@VargonMUD: Jesus Christ! + [igossip] Al@Anarres II: well, the Dow and NASDAQ are both up. + [igossip] Xyzzy: alright, everyone keep their rumors to themselves, please only + give us confirmed hits. + [igossip] Blue@Inon-Net: is he responsible, or been hit? + [igossip] Presto@Discworld: trading is closed. + [igossip] Vashkar@Split Infinity: capitol hill .. another explosion. + [igossip] Al@Anarres II: would all US resident, please leave the country. + [igossip] Cratylus: remain calm, do not run. + /wiz/cratylus # [igossip] Al@Anarres II: head for Canada! + [igossip] Sinistrad@VargonMUD: I miss the twin towers. + [igossip] Xyzzy: pretty sad when im relying on you guys for news. + [igossip] Myrias@Discworld: I logged on for news too. + [igossip] Blue@Inon-Net: they'll have to reprint all those NYC t-shirts, shot + glasses, posters, everything. + [cre] Cratylus: thats pathetic. + /wiz/cratylus # [igossip] Myrias@Discworld: The major news websites are all crashing under the + weight of traffic. + [cre] Cratylus: i cant believe cnn got overwhelmed. + /wiz/cratylus # [igossip] Blue@Inon-Net: no, they've been hit by more planes! + [igossip] Skullslayer@RoD: so, any bets on the FBI or CIA going out next? + [cre] Cratylus: dispensing breaking news is their JOB. + /wiz/cratylus # [cre] Cratylus: i wnt them FIRED. + /wiz/cratylus # [igossip] Xyzzy: youd think cnn would be their FIRST target. + [cre] Xyzzy: yer on cre. + [igossip] Bayard@Nanvaent: anyone started any rumours about massive virtual + terrorism attack on the US websites? + [cre] Cratylus: i know. + /wiz/cratylus # [igossip] Musashi@Sumu: no way, they want people to know. + [cre] Xyzzy: ah. + [igossip] Bayard@Nanvaent: i'm sure there's mileage in that one. + [igossip] Xyzzy: anyone familiar with the laws concerning gun possession and + transport in the state of maryland? + [igossip] Al@Anarres II: right now X, no one will care. + [igossip] Xyzzy: GOOD POINT! + [igossip] Presto@Discworld: explosion on Capitol hill. + [igossip] Xyzzy: where. + [igossip] Presto@Discworld: or not. + [cre] Cratylus: cant believe i have to turn on the radio for news now. + /wiz/cratylus # [igossip] Vashkar@Split Infinity: no, that's what happened. + [igossip] Xyzzy: is todays date of any signifigance? + [igossip] Skullslayer@RoD: apparently CNN is reporting a Capitol Hill hit + [igossip] Presto@Discworld: I wish people would get their fucking story + straight. :-b. + [igossip] Sinistrad@VargonMUD: 20th anniversary of world peace, Xy. + [igossip] Sinistrad@VargonMUD: CNN is reporting everything's ok on Capitol + Hill, except a loud sound. + [igossip] Vashkar@Split Infinity: oh. + [igossip] Presto@Discworld: CNNfn is talking to someone on Pennsylvania Ave, + and they said there's no explosion. + [igossip] Izzy@VargonMUD: It's the Democrats complaining. + [igossip] Cratylus: npr's interviewing freaked out WTC occupants. + /wiz/cratylus # [igossip] Xyzzy: now THATS journalistic integrity. + [igossip] Cratylus: it's quite tedious. + /wiz/cratylus # [igossip] Xyzzy: can you imagine the traffic and general panic? + [igossip] Cratylus: huh. the upper part of one of them did in fact collapse. + /wiz/cratylus # [igossip] Skullslayer@RoD: a few players here have confirmed capitol hill as + being hit + [igossip] Blue@Inon-Net: Interesting that of all the scary talk over recent + years about how easy it would be for terrorists to deploy biological, chemical, + nuclear or other fancy weapons in NYC, that when it actually happens, it could + have been done the same way 20 years ago. + [igossip] Presto@Discworld: Empire State building now evacuated. Duh. + [igossip] Sinistrad@VargonMUD: Yes, thanks, 30 minute ago man. + [igossip] Xyzzy: plane bombings is SO last decade. + [igossip] Blue@Inon-Net: I wonder how they'll persuade King Kong to come down. + [igossip] Cratylus: hey, i'm not gonna believe YOU bozos. + /wiz/cratylus # [igossip] Xyzzy: screw YOU guys, ah'm goin HOME. + [igossip] Sinistrad@VargonMUD: Famous last words, target! + [igossip] Skullslayer@RoD: nah, it was 'fore!' + [igossip] Tarl@Alsherok: In case no one said it, it appears one of the planes + was american airlines flight number 11, I hope no one knew anyone supposed to + be on that.. + [igossip] Al@Anarres II: so one tower has fallen over completly? + [igossip] Cratylus: no. the upper part of one collapsed. + /wiz/cratylus # [igossip] Xyzzy: it has fallen UP. + [igossip] Cratylus: not clear if it actually hit the ground. + /wiz/cratylus # [igossip] Al@Anarres II: from news feed I have heard about, its fallen over + completly? + [igossip] Sinistrad@VargonMUD: It's just floating there. + [igossip] Xyzzy: the Good Samaratin Terrorist Organization has built it back + up. + [igossip] Al@Anarres II ponders going to find a TV + [igossip] Xyzzy: this... this cant happen to US.... were AMERICA! + [igossip] Cratylus: heh, reporter is shocked to see police patrolling around + with machine guns. + /wiz/cratylus # [igossip] Bayard@Nanvaent: no tanks? + [igossip] Xyzzy: GIT MAH GUN. + [igossip] Al@Anarres II: they are gonna shoot planes down first! + [igossip] Xyzzy: and pilots. + [igossip] Cratylus: no, but apparently fighter jets patrolling too. + /wiz/cratylus # [igossip] Xyzzy: kick ASS. + [igossip] Al@Anarres II: "At about 10 a.m., one of the 110-story World Trade + Center towers collapsed" + [igossip] Xyzzy: just heard on radio: state building car combed. + [igossip] Al@Anarres II: washingtonpost.com. + [igossip] Presto@Discworld: car bomb outside the State Dept. + [igossip] Xyzzy: shhh, al, dont overload our local newspaper's site! + [igossip] Al@Anarres II: hey, its the only one up! + [igossip] Cratylus: not anymore. + /wiz/cratylus # [igossip] Xyzzy: thanks a LOT, guys. + [igossip] Xyzzy: i can see it. + [igossip] Xyzzy: heh, theres a webcam pointed at the pentagon smoke. + [igossip] Al@Anarres II uses akamaitech.net + [igossip] Al@Anarres II: it works. + [igossip] Cratylus: howsabout a url? + /wiz/cratylus # [igossip] Xyzzy: + http://www.washingtonpost.com/wp-srv/mmedia/webcams/eyeondc.htm. + [igossip] Sinistrad@VargonMUD: WHERE THE FUCK IS SPIDER-MAN?!?! + [igossip] Xyzzy: helicopter in the picture, now. + [igossip] Xyzzy: wtf is SPIERman gonna do. + [igossip] Cratylus: mighty mouse is busy eating cheese. + /wiz/cratylus # [igossip] Sinistrad@VargonMUD: Web the tower together. + [igossip] Xyzzy: ohhhh yeah. + [igossip] Skullslayer@RoD: rumour of 6 more planes in the air and hijacked + [igossip] Xyzzy: spider MAN, SPIDER man. + [igossip] Bayard@Nanvaent: yeah. that seems very rumourish atm. + [igossip] Xyzzy: rumor from where? + [igossip] Steve@Anarres II: 2nd has gone now. + [igossip] Tariq@Demonslair Dev: 2nd tower just went down. + [igossip] Al@Anarres II: how the hell can that many planes get hijacked? + [igossip] Xyzzy: 2nd one what. + [igossip] Xyzzy: tower? + [igossip] Presto@Discworld: fucking Christ, the second tower collapsed. + [igossip] Sinistrad@VargonMUD: MAYDAY MAYDAY, TOWER DOWN. + [igossip] Steve@Anarres II: no, the 2nd fucking pentagon. + [igossip] Cratylus: the Mayor's disaster control center was in the + blown up tower. + /wiz/cratylus # [igossip] Sinistrad@VargonMUD: Both towers are gone, you fucking moron. + [igossip] Tariq@Demonslair Dev: saw it dropping live, it was truely scary. + [igossip] Tariq@Demonslair Dev: live on the telly, in case anyone + misunderstands that. + [igossip] Al@Anarres II: did it crumple downwards, or topple over and take out + alot og other buildings? + [igossip] Musashi@Sumu: carbomb at state dept confirmed? + [igossip] Tariq@Demonslair Dev: the top spire was in view, and it just dropped + downwards. + [igossip] Cratylus: wtf npr says both towers collapsed. + /wiz/cratylus # [igossip] Pickett@Sumu: hrm, another plane hijacked and headed to washington. + [igossip] Cratylus: im guessing any further hijacked planes might get shot + down. + /wiz/cratylus # [igossip] Al@Anarres II: but the US cant shoot down its own commertial + airliner! + [igossip] Cratylus: sure it can. + /wiz/cratylus # [cre] Xyzzy: yes, ive heard both towers collapsed, too. + [igossip] Al@Anarres II: they might not crash... + [igossip] Bayard@Nanvaent: i reckon it will. + [igossip] Xyzzy: ok, boss giving orders to go home. + [igossip] Al@Anarres II: bye X! drive safely. + [igossip] Al@Anarres II: don;t go rubber necking! + [igossip] Xyzzy: fuck that, im driving like theres NO TOMOROW. + [igossip] Xyzzy: nah, im takin back roads. + [igossip] Al@Anarres II: there might not be a tomorrow. + [igossip] Xyzzy: MIGHT even stop by parents... see if my dad keeps the gun-safe + locked... + [igossip] Xyzzy: kidding, of course. + [igossip] Xyzzy: ok, see y'all later. + [cre] Xyzzy waves. + [announce] Xyzzy has left Frontiers. + [cre] Cratylus waves. + /wiz/cratylus # [igossip] Musashi@Sumu: perfect time to go raiding ;) + [igossip] Blue@Inon-Net: I hear a rumour that Capitol Hill has not been + attacked after all. + [igossip] Skullslayer@RoD: I have a rumour a second explosion at the pentagon + [igossip] Al@Anarres II: I have a rumour that they are gonna fly nto the statue + of liberty. + [igossip] Tarl@Alsherok: blue: it wasn't. it was a car bomb at the state dept. + [igossip] Tarzan@Darkland: UN (NY) evacutated. + [igossip] Skullslayer@RoD: the pentagon webcam shows a much bigger cloud of + smoke now + [igossip] Blue@Inon-Net: NEWSFLASH: smoke expands. + [igossip] Tarl@Alsherok: reputedly also a large plane crash SE of pittsburgh, + not sure if its related or not, and don't know if its real or not. + [igossip] Tea@Nanvaent: where's the pentagon webcam? + [igossip] Musashi@Sumu: + http://www.washingtonpost.com/wp-srv/mmedia/webcams/eyeondc.htm. + [igossip] Tea@Nanvaent: cheers. + [igossip] Skullslayer@RoD: ronald reagan buliding evacuated + [igossip] Skullslayer@RoD: confirmed hit in pittsburgh + [igossip] Cratylus: so...uh...the two buildings are completely gone, then? + /wiz/cratylus # [igossip] Tarzan@Darkland: whats in Pittsburgh? + [igossip] Styxx@OuterSpace nods. + [igossip] Skullslayer@RoD: north of the airport, somerset county + [igossip] Skullslayer@RoD: rumour - all planes approaching DC will now be shot + down + [igossip] Skullslayer@RoD: the plane approaching DC was shot down? + [cre] Zaphod: shit man. + [igossip] Leto@Earth: http://robots.cnn.com/ and http://asian.cnn.com still + work. + [igossip] Spoo@Nanvaent: http://www.sky.co.uk is relatively lively still as + well. + [igossip] Bayard@Nanvaent nods. + [igossip] Skullslayer@RoD: asia.cnn.com is still up, but it hasn't been updated + in 2 hours that I can see + [igossip] Leto@Earth: ah. + [igossip] Leto@Earth: so what's the stuatus? + [igossip] Sinistrad@VargonMUD: middleeast.cnn.com reports, "Imperialist Scum + Taught A Lesson" + [igossip] Skullslayer@RoD: rumour of another plane is a few mins out from DC, + after the last one was shot down + [igossip] Spoo@Nanvaent: fuck off Sinistrad. + [igossip] Leto@Earth: 7 planes hijacked? + [igossip] Sinistrad@VargonMUD: nya nya, nya nya nya. + [igossip] Leto@Earth: one failed in pitsburg? + [igossip] Musashi@Sumu: that DC-bound jet was shot down? That confirmed? + [igossip] Sinistrad@VargonMUD: That was Air Force 1! + [igossip] Skullslayer@RoD: yeah, one down in pittsburgh, just north of the + airport + [igossip] Spoo@Nanvaent: seems so, 1 may have been shot down near Pittsburgh. + the other still flying near Dulles it would seem, other 5 either crashed or + landed. + [igossip] Hekubah@Annwn: What's happened in Chicago? + [igossip] Skullslayer@RoD: I had a few players here confirm the shoot down + [igossip] Spoo@Nanvaent: Sears tower evacuated. Israelis have shutdown ALL + their embassies. + [igossip] Lightfoot@VargonMUD: I'm unabvle to get to cnn.com. + [igossip] Hekubah@Annwn: Woah. + [igossip] Hekubah@Annwn: reuters isn't working... + [igossip] Isis@Mystic: Me either. Or Fox News. + [igossip] Isis@Mystic: Someone in the office is sreaming BBC. + [igossip] Isis@Mystic: Er, streaming. + [igossip] Lightfoot@VargonMUD: what about it? + [igossip] Hekubah@Annwn has BBC on the TV... + [igossip] Al@Anarres II: Isis - the BBC is fubared. + [igossip] Spoo@Nanvaent: yeah, we have our own stream of N-TV. + [igossip] Skullslayer@RoD: cnn, abcnews, msnbc and a few other big news sites + are all down + [igossip] Spoo@Nanvaent: we are getting CNN live feed. + [igossip] Isis@Mystic: FoxNews too. + [igossip] Skullslayer@RoD: bbc seems to be still up, but a bit behind + [igossip] Tea@Nanvaent: http://news6.thdo.bbc.co.uk/ + [igossip] Sinistrad@VargonMUD: DIE, IMPERIALIST SCUM! + [igossip] Sinistrad@VargonMUD: HAH! + [igossip] Skullslayer@RoD: rumour of crash into camp david + [igossip] Isis@Mystic: Sinis, I love you. + [igossip] Sinistrad@VargonMUD: I know. + [igossip] Musashi@Sumu: remember sinistrad, much as you hate the + 'imperialists', someone hates your beliefs just as much.. you deserve to die + too? + [igossip] Sinistrad@VargonMUD: Honey, it's funny that people are always + laughing at the misfortunes of others on this channel - now those same people + are all, "dude, be more sensitive" + [igossip] Teny@Mystic: D.C Streets are one big traffic Jam. + [igossip] Spoo@Nanvaent: pretty much not a joking matter. + [igossip] Musashi@Sumu: misfortunte != death. + [igossip] Musashi@Sumu: -t. + [igossip] Al@Anarres II nods at Spoo + [igossip] Sinistrad@VargonMUD: Go be righteous somewhere else. When it's not + affecting you, you're the ruelest bunch of assholes ever. + [igossip] Sinistrad@VargonMUD: Now it's your turn. HAH!!! DIE GRINGOS!! + [igossip] Spoo@Nanvaent: not affecting you either, so be completely tasteless + some other time. + [igossip] Sinistrad@VargonMUD: No. + [igossip] Al@Anarres II: hey Sini, this doesnt affect me, but it does affect + alot of ppl. + [igossip] Musashi@Sumu: shrugs, I'm not American, but I'm still not gonna laugh + at people dying. + [igossip] Al@Anarres II: there are like 50,000 ppl working in the WTO. + [igossip] Spoo@Nanvaent: I ain't laughing because this is only the start of the + bloodletting. + [igossip] Sinistrad@VargonMUD: Not any more! + [igossip] Lightfoot@VargonMUD: more like 75K. + [igossip] Skullslayer@RoD: plus all the people in the surrounding buildings + [igossip] Lightfoot@VargonMUD: people were jumping out of the building for over + 1/2 hour. + [igossip] Al@Anarres II: [flap] Iain: itn reporting 100 tousand dead in new + york. + [igossip] Sinistrad@VargonMUD: Where were you guys when 80K Hindis died of + starvation last year? Did you care? No, you laughed at the hungry brownies. + [igossip] Spoo@Nanvaent: in case you hadn't noticed the madmen have just fucked + off the USA, NATO and the Israeli's. + [igossip] Leto@Earth: 100.000 ? + [igossip] Iain@Anarres II: 100k people. + [igossip] Spoo@Nanvaent: well fuck you for being so consciencious, yeah I care, + I don't find it funny either. + [igossip] Iain@Anarres II: lots of them firefighters/police. + [igossip] Sinistrad@VargonMUD: "Whine whine, now it's hurting us directly, + please don't laugh.. please forget that I used to laugh at you when you were + down, now it's about me and I'm more important." + [igossip] Lightfoot@VargonMUD: I live on Long Island, firefighters and police + were called into the city. + [igossip] Lightfoot@VargonMUD: all bridges and tunnels to NYC are closed. + [igossip] Al@Anarres II: swim! + [igossip] Al@Anarres II: how are they getting ppl out ? + [igossip] Lightfoot@VargonMUD: they are not. + [igossip] Sinistrad@VargonMUD: With straws. + [igossip] Spoo@Nanvaent: both the towers are basically piles of burning rubble, + unlikely to be any survivors in that. + [igossip] Ebony@Earth: I heard a witness say he worked on the 36th floor and + they got out ok. + [igossip] Ebony@Earth: they had 1/2 an hour before the collapse. + [igossip] Spoo@Nanvaent: 1st or 2nd tower? + [igossip] Hellmonger@Trilogy: http://www.shef.ac.uk/cs1xtc/sa/planewtc.jpg. + [igossip] Ebony@Earth: 69 ppl on the plane that flew into the wtc. + [igossip] Lightfoot@VargonMUD: both towers are gone. + [igossip] Hellmonger@Trilogy: no doubt. + [igossip] Ebony@Earth: first tower, they started leaving right after they saw + the 2nd plane. + [igossip] Lightfoot@VargonMUD: 2nd plane hit 18 mins after first. + [igossip] Hellmonger@Trilogy: Vote Yes to Proposition 37 "Systematic Ethnic + Clensing of America" + [igossip] Sinistrad@VargonMUD: "Leave only the injuns" + [igossip] Spoo@Nanvaent: what, you mean America will belong to the natives + again? + [igossip] Shandor@Bakhara: just the mexicans. + [igossip] Hellmonger@Trilogy: Leave only the whites, the blacks, and the + mexicans. + [igossip] Hellmonger@Trilogy: cuz everybody else is out to fucking get us. + [igossip] Lightfoot@VargonMUD: boston is very close, right across the LI sound. + [igossip] Ebony@Earth: 2 planes, carrying approx 80 passengers each.. + [igossip] Ebony@Earth: unsure which they were. + [igossip] Spoo@Nanvaent: seems they just shot down the 2nd plane as well. + [igossip] Spoo@Nanvaent: the one near Dulles. + [igossip] Sinistrad@VargonMUD: Shit, HM's link made me bust a gut! + [igossip] Vraxor@Split Infinity: how do you know? + [igossip] Sinistrad@VargonMUD: You rule, HM. =) + [igossip] Skullslayer@RoD: rumour of a bomb in a school near the WTC + [igossip] Hellmonger@Trilogy: no doubt. + [igossip] Al@Anarres II: nice to see students at shefield are back, hard at + work ;) + [igossip] Skullslayer@RoD: plane inbound to chicago + [announce] Xyzzy enters Frontiers. + [igossip] Xyzzy: i dont know if yer keeping up on current events, but we just + got our ASSES kicked back there! + [igossip] Sinistrad@VargonMUD: http://www.shef.ac.uk/cs1xtc/sa/planewtc.jpg. + [igossip] Hekubah@Annwn: Another plane? + [igossip] Bayard@Nanvaent: the first joke picture :) + [igossip] Sinistrad@VargonMUD: That's not a joke. + [igossip] Xyzzy: thats fucked up. + [igossip] Bayard@Nanvaent: buh? + [igossip] Vashkar@Split Infinity: ummm.. that looks like nice photoshop work, + Sinistrad. + [igossip] Xyzzy: jeez, fuck the fox network... "apparent terrorist attacks..." + [igossip] Sinistrad@VargonMUD: Reality always looks so fake, doesn't it? + [igossip] Izzy@VargonMUD: "This just in, JFK shot." + [igossip] Musashi@Sumu: NBC just reported bomb gone off in NYC Highschool. + [igossip] Xyzzy: WE GOT A MAN ON TH MOON?! + [igossip] Presto@Discworld: yeah, it was obviously a big fucking coincidence. + [igossip] Xyzzy: fox investigative news. + [igossip] Xyzzy: at work. + [igossip] Musashi@Sumu: FAA say several planes still unaccounted for. + [igossip] Presto@Discworld: This just in: Jimmy Hoffa still missing. Police are + baffled. + [igossip] Xyzzy: plane crash 80 miles SE of pittsburg. + [igossip] Xyzzy: holy shit, footage of the WTC collapsing. + [igossip] Presto@Discworld: American Air confirms two flights down, United at + least one (the Pittsbhrugh one) + [igossip] Al@Anarres II: well done Xyzzy, do catch up. + [igossip] Al@Anarres II: which was the dullus one? + [igossip] Xyzzy: gee, its almost as if i havent had a TV at work for th last + two hours. + [igossip] Vashkar@Split Infinity: the only thing slightly amusing is that I + swore to myself that I'd never set foot in the WTC again.. then seconds later, + one collapses..then the other. + [igossip] Bayard@Nanvaent: you've had i3 though. and it's all been mentioned on + here. + [igossip] Xyzzy: its all YOUR fault, vash. + [igossip] Xyzzy: no, im SEEING the collapse for th first time. + [igossip] Vashkar@Split Infinity: sorry, I don't claim responsibility for the + deaths of tens of thousands today. + [igossip] Blue@Earth: you should, get your place in the queue. + [cre] Cratylus: whad i miss? + /wiz/cratylus # [igossip] Xyzzy: no one ever told us terrorist could be organized. + [igossip] Xyzzy: is that fair? + [cre] Xyzzy: dunno, i just got home. + [cre] Zaphod: westconn just got bombed. + [cre] Cratylus: no. + /wiz/cratylus # [igossip] Al@Anarres II: is this the largest terrorist attack ever? + [cre] Cratylus: they installed antiarircraft batteries on the ice rink and + patriot garage. + /wiz/cratylus # [cre] Cratylus: i just saw em. + /wiz/cratylus # [cre] Zaphod: ah. + [igossip] Xyzzy: heh, on cnn, "america under attack", all red white n blue + fonts n stuff. + [cre] Zaphod: cool. + [igossip] Bayard@Nanvaent: easily. + [igossip] Sinistrad@VargonMUD: Shit. Now my Flight Simulator NYC edition is + outdated. =( + [igossip] Al@Anarres II giggles + [igossip] Xyzzy: expansion pack. + [igossip] Bayard@Nanvaent: equally, how do u define a terrorist attack. this + might not be a terrorist attack. + [igossip] Hekubah@Annwn: Might be an act of war? + [igossip] Bayard@Nanvaent: could end up being defined as an opening move in a + war. + [cre] Zaphod: few. + [cre] Zaphod: phewww. + [igossip] Xyzzy: oh yeah, fergot, it might just be a wacky coincidence. + [cre] Zaphod: my package made it out of newark. + [igossip] Vashkar@Split Infinity: well, it wasn't a bunch of drunks, Bayard. + [igossip] Iain@Anarres II: sick puppy sini ;-) + [igossip] Xyzzy: hmm, good point, bayard. + [igossip] Xyzzy: GIT MAH GUN! + [igossip] Lightfoot@VargonMUD: were at defcon 5! + [igossip] Xyzzy: yer MOM is at defcon5 + [igossip] Sinistrad@VargonMUD: Hey, more people died right now than in Pearl + Harbor. + [igossip] Bayard@Nanvaent: but, the style of attack will prolly mean it's a + terrorist attack that started a war in history books. + [igossip] Xyzzy: what, you got a death-count goin, sini? + [igossip] Bayard@Nanvaent: s'diff than pearl harbour or czechoslovakia. + [igossip] Lightfoot@VargonMUD: shut up dick. + [igossip] Vashkar@Split Infinity: please someone ban Xyzzy. + [igossip] Spoo@Nanvaent: WW 1 was started because of a terrorist attack that + killed 1 person. + [igossip] Bayard@Nanvaent nods. + [igossip] Xyzzy: please someone suck my dick. + [igossip] Sinistrad@VargonMUD: Xy, 50K+ people worked in the towers. + [igossip] Sinistrad@VargonMUD: How many people died at Pearl Harbor? + [igossip] Cratylus watches in amusement as Vashkar greedily gobbles Xyzzy's + knob. + /wiz/cratylus # [igossip] Vashkar@Split Infinity: Vrax@SI says there was 10k in each tower, + approximately, at the time. + [igossip] Xyzzy: what, like i work for th navy or something, sini? + [cre] Zaphod: my packge drove right through ny just before this. + [cre] Cratylus: yer motherboard? + /wiz/cratylus # [cre] Xyzzy: a little... coincidental. + [igossip] Spoo@Nanvaent: less than 2k people were killed at PH. + [igossip] Vraxor@Split Infinity: that's what the guy who owned the tower said. + [cre] Zaphod: this one is my video card. + [cre] Zaphod: mb just left la. + [cre] Zaphod: maybe it's been hijacked. + [igossip] Xyzzy: that tower was 0WN3D. + [igossip] Ebony@Earth: You have to account for tourists in the towers too. + [igossip] Vraxor@Split Infinity: and the people in the planes. + [cre] Zaphod: now I REALLY don't feel like going to the office. + [32m[igossip] Xyzzy: shoot, none of this is gonna drive up memory prices, will it? + [cre] Zaphod: buy it quick. + [igossip] Spoo@Nanvaent: automatic if the pres is in AF1 + [cre] Zaphod: WTC attack sale! + [igossip] Xyzzy: heard on radio: military air coverage over DC. + [igossip] Musashi@Sumu: ok, of the two planes to hit the towers, one was out of + boston, 81 passengers, 11 crew, one was out of washington, 58 passengers, 6 + crew. + [cre] Zaphod: cheech sent an email saying pahts delivery will be screwy. + [igossip] Lightfoot@VargonMUD: there are tomcats flying around NYC. + [igossip] Xyzzy: thanks for th numbers, musashi. + [cre] Cratylus: AHAHAH. + /wiz/cratylus # [cre] Cratylus: i fucken BET. + /wiz/cratylus # [igossip] Xyzzy: i knew id never regret hiring you as my accountant. + [igossip] Cratylus: i cant wait til we fuckin nuke the shitbags from orbit. + /wiz/cratylus # [igossip] Zaphod: 9/11 + [igossip] Xyzzy: its th only way to be sure. + [igossip] Dasquian@Discworld: You idiot. + [igossip] Musashi@Sumu: spam incoming, this from CNN. + [igossip] Musashi@Sumu: United Airlines Flight 93 airliner headed from Newark, + New Jersey, to San Francisco, crashed near Somerset, Pennsylvania -- police + said initial reports indicated no survivors. It was not known if this was + connected to the attacks. United also said it was "deepl. + [igossip] Xyzzy: DEEPL?!?! + [igossip] Xyzzy: NOOOOOOO!!!!!! + [igossip] Musashi@Sumu: ________________23:43 + [igossip] Musashi@Sumu: hm, sec :P. + [igossip] Musashi@Sumu: United also said it was "deeply concerned" about Flight + l75 from Boston to Los Angeles. + [igossip] Lightfoot@VargonMUD: it's said that crash in penn was from captain + crashing plane when he knew what was going on and he was being hi-jacked. + [igossip] Xyzzy: Am Airlines siad theyve "lost" two flights. + [igossip] Sinistrad@VargonMUD: And they know that throgh the ouija board, + Danny? + [cre] Zaphod: today is 9/11 + [igossip] Xyzzy: WELL, DANNY?! + [igossip] Lightfoot@VargonMUD: I'm sure the radios were working. + [igossip] Xyzzy: oh, yer "sure" + [igossip] Vashkar@Split Infinity: + http://us.news2.yimg.com/dailynews.yahoo.com/h/nm/20010911/ts/crash_tradecenter + _binladen_dc_1.html. + [igossip] Lightfoot@VargonMUD: shut up dick. + [igossip] Vashkar@Split Infinity: they say bin laden warned of the attack 3 + weeks ago. + [cre] Zaphod: call paul. + [igossip] Sinistrad@VargonMUD: Wow. + [cre] Cratylus: ya. + /wiz/cratylus # [igossip] Vashkar@Split Infinity: saying it was cause of US supporting israel. + [igossip] Xyzzy: yknow, i think what we really need now is a verbal fight on i3 + [igossip] Shandor@Bakhara: your mom tastes like chicken and your dad smells of + a russian tea room. + [igossip] Xyzzy: HEY, now. + [igossip] Xyzzy: lets keep it civil. + [igossip] Cratylus: eldeberries, you fool. + /wiz/cratylus # [igossip] Sinistrad@VargonMUD: ``Personally we received information that he + planned very, very big attacks against American interests. We received several + warnings like this. We did not take it so seriously, preferring to see what + would happen before reporting it.'' + [igossip] Cratylus: smelt of em. + /wiz/cratylus # [igossip] Shandor@Bakhara: windows sucks! RH linux is the top of them all. + [igossip] Sinistrad@VargonMUD: "He told us he was gonna do it, but we wanted to + see what he was gonna do before we told anybody." + [cre] Zaphod: cute. + [igossip] Xyzzy: we called his bluff, alright. + [igossip] Shandor@Bakhara: who says that, sini? + [cre] Zaphod: he told me to stay home. + [igossip] Hellmonger@Trilogy: I hear the arabs in San Fran are celebrating the + attacks. Somebody go kill them all. + [igossip] Sinistrad@VargonMUD: NOW YOU KNOW. + [cre] Cratylus: ya. + /wiz/cratylus # [cre] Zaphod: you heard him. + [igossip] Sinistrad@VargonMUD: That link Vash gave out. + [cre] Cratylus: stamford is prolly a panicky madhouse. + /wiz/cratylus # [cre] Zaphod: no doubt. + [igossip] Xyzzy: and knowing's half th battle! + [cre] Zaphod: and I've got CABLE. + [igossip] Spoo@Nanvaent: hell, the Arabs are going to give someone some target + practice if they don't fuck off. + [igossip] Shandor@Bakhara: half of our IT department is made of arabs. I + wouldn't want to be them right now. Although, this is a mall city. + [igossip] Xyzzy: mall city? like, with shops n stuff? + [igossip] Cratylus: made of crabs? what? + /wiz/cratylus # [igossip] Spoo@Nanvaent: it ain't really the Arabs anyway, just a completely + mad bunch of lunatics who want to take us back the the dark ages. + [igossip] Cratylus: the republicans? + /wiz/cratylus # [igossip] Xyzzy: like i said, i think its in the rulebook that theyre not + allowed to be so organized and effective. + [igossip] Sinistrad@VargonMUD: That movie with Denzel Washington and Bruce + Willis starts out with a lot of terrorist attacks. That is NOTHING compared to + this. + [igossip] Vashkar@Split Infinity nods. + [igossip] Cratylus: i bet the french are all like "serves em right, bourgeois + pigs" + /wiz/cratylus # [igossip] Spoo@Nanvaent: makes Tom Clancy look tame too. + [igossip] Lightfoot@VargonMUD: cnn back up. + [igossip] Cratylus: i think they got lucky. you couldnt *really* expect those + fucking buildings to drop from plane hits. + /wiz/cratylus # [igossip] Spoo@Nanvaent: they were rather large ones. + [igossip] Lightfoot@VargonMUD: Bush calls trade center crashes terrorist act. + [igossip] Cratylus: large buildings. + /wiz/cratylus # [igossip] Lightfoot@VargonMUD: you think? + [igossip] Sinistrad@VargonMUD: Thanks, Danny. + [igossip] Vashkar@Split Infinity: in today's day n' age, it's not hard to be a + competent terrorist. It's like Osama bin Laden went to a tech institute or + something. + [igossip] Spoo@Nanvaent: large aircraft. + [igossip] Cratylus: fat asses. + /wiz/cratylus # [igossip] Steve@Anarres II: um.. they knew where to hit them to have best + chance of toppling them.. + [igossip] Spoo@Nanvaent: cnn.com is breaking under the strain again. + [igossip] Xyzzy: this just in: i hafta pee. + [igossip] Cratylus: ok, master terrorist. + /wiz/cratylus # [igossip] Zaphod: ooo ooo Tom Clancy's on cnn! + [igossip] Sinistrad@VargonMUD: He's the authority, I bet! + [igossip] Cratylus: that does it. im playing half life. screw this. + /wiz/cratylus # [igossip] Xyzzy: hes written books n stuff! + [igossip] Xyzzy: just like smack! + [igossip] Spoo@Nanvaent: prolly complaining that the bastards stole his idea. + [igossip] Steve@Anarres II: part-way up near the top.. you prolly won't get + them immediately, but fire will weaken the structure and the top will fall + cruching the rest of the building.. + [igossip] Xyzzy: cool, Dexter's Laboratory on cartoon network. + [igossip] Spoo@Nanvaent: yeah, the steel skeleton would weaken, concrete and + facade wouldn't hold the weight. + [igossip] Spoo@Nanvaent: it appears there was a secondary explosion in the + first tower to go down too. + [igossip] Blue@Inon-Net: I think the WTC buildings had their skeleton on the + outside; but don't hold me to that. + [igossip] Sinistrad@VargonMUD: So it wasn't just the planes? + [igossip] Xyzzy: yeah! lets speculate on the various ways these people died + today! + [igossip] Vashkar@Split Infinity: Spoo, they're thinking it was the plane's + fuel tank exploding. + [igossip] Steve@Anarres II: they showed ppl diving outa windows on the news.. + that's sick.. + [igossip] Spoo@Nanvaent: was quite a way down from the impact site. + [igossip] Spoo@Nanvaent: could well have been though. + [igossip] Al@Anarres II nods at Spoo + [igossip] Al@Anarres II: I think we just have to wait and see. + [igossip] Vashkar@Split Infinity: yeah, I was questioning the logistics of that + guess also. + [igossip] Al@Anarres II: if the top, above the crash site, fell down, even just + 1meter, the energy would be enough to crumble the steel below. + [igossip] Spoo@Nanvaent: thats what happened with the second tower. + [cre] Zaphod: shit. + [igossip] Al@Anarres II: it might have crumbled many stories down, making it + look like an explosion below the crash site. + [igossip] Spoo@Nanvaent: roof went, took the rest with it. + [cre] Zaphod: I bet the coffee I ordered don't get sent out. + [igossip] Al@Anarres II: yeah, common :( + [cre] Xyzzy: always thinkin of yerself. + [igossip] Al@Anarres II shuts up about civil engineering and goes back to + hacking sendmail + [cre] Zaphod: well, I need my coffee. + [igossip] Boltthrower@Styx: apparently the roof-collapse scheme works better + than the basement-bomb thing did :( + [igossip] Spoo@Nanvaent: nah, there was a clear fireball shortly before the + first collapse (and I saw that live so no, it wasn't a plane) + [igossip] Xyzzy: how about the "fly a few hundred tons of metal into the + building" scheme? + [igossip] Isis@Inon-Net: Yeah, I saw it too just before I left for work. + [igossip] Spoo@Nanvaent: 737 and a 767, couple of hundred tonnes each. + [igossip] Hellmonger@Trilogy sets an arab on fire. + [igossip] Zaphod: camp david get hit? + [igossip] Vashkar@Split Infinity: close to camp david. + [igossip] Al@Anarres II: cool, HM, gulf-news.com is hosted nr you ;) + [igossip] Spoo@Nanvaent: lots of momentum to damage the buildings, the second + aircraft blew right through the tower too. + [igossip] Xyzzy: can you imagine how dark it could be in manhattan right now? + [igossip] Lightfoot@VargonMUD: that one was shot down. + [igossip] Spoo@Nanvaent: what, at midday? + [igossip] Xyzzy: yes. + [igossip] Xyzzy: with all the smoke. + [igossip] Spoo@Nanvaent: not very then. + [igossip] Xyzzy: well, i guess you CAN imagine it, then. + [igossip] Zaphod: 8 hijacked planes still in the air? + [igossip] Xyzzy: but for how long.... + [igossip] Xyzzy: HOW LONG!?! + [igossip] Vashkar@Split Infinity: where'd you hear 8, Zaphod? + [igossip] Xyzzy: hes just makin shit up, now. + [igossip] Ebony@Earth: Its not that dark. + [igossip] Hellmonger@Trilogy: I heard 8 total planes. + [igossip] Hellmonger@Trilogy: and we've already found some of them. + [igossip] Lightfoot@VargonMUD: 5 floors in pentagon have collapased. + [igossip] Ebony@Earth: Not unless you where wtc was. + [igossip] Hellmonger@Trilogy: we found 2 in the trade center, one in the + pentagon... \ + [igossip] Xyzzy: HM AM FUNNYMAN! + [igossip] Spoo@Nanvaent: Brits have lost contact with 2 aircraft as well. + [igossip] CyberTiger@Anarres II: s/found/happened to notice/ + [igossip] Xyzzy: wtf, some dude disassembling a pistol on CourtTV, sayin how + easy it could be to blah blah blah. + [igossip] BarWench@Inon-Net: ;nods. + [igossip] Al@Anarres II: have we Spoo? where you hear that? + [igossip] Hellmonger@Trilogy: So is Bin laden a palestinian or a jew? + [igossip] Smack@Lima Bean: what aircraft? + [igossip] Smack@Lima Bean: my father is on a flight from london to new york. + [igossip] Hellmonger@Trilogy: It says 'Islamic Fundamentalist', which is like a + palestinian, right? + [igossip] Smack@Lima Bean: bin laden is saudi. + [igossip] Hellmonger@Trilogy: He'll be landing in canada. :( + [igossip] Pam@Split Infinity: They're evacuating some of the taller buildings + in London, according to MSNBC. + [igossip] Smack@Lima Bean: he is a rich, eccentric saudi. + [igossip] Xyzzy: look out, hellmonger is gunnin for SOMEone. + [igossip] Tea@Nanvaent: canada is all closed too i thought? + [igossip] Hellmonger@Trilogy: I'm down to kill me some arabs now. + [igossip] Hellmonger@Trilogy: And some happy palestinians. + [igossip] Smack@Lima Bean: we must declare war against Afghanistan. + [igossip] Hellmonger@Trilogy: Need to be set on fire. + [igossip] Hellmonger@Trilogy: why afghanistan? + [igossip] Sinistrad@VargonMUD: Why not? + [igossip] Hellmonger@Trilogy: Valid point. KILL EM ALL! + [igossip] Smack@Lima Bean: afghanistan has been housing bin laden for years. + [igossip] Smack@Lima Bean: they refuse to turn him over. + [igossip] Megaboz@Lima Bean: I just have this feeling that bush is going to do + something stupid. + [igossip] Ebony@Earth: Third plane ahs crashed in pentagon. + [igossip] Hellmonger@Trilogy: I'm all about letting them know whats up. Take + the afghan royal family or whatnot. And cook them on a spit. + [igossip] Smack@Lima Bean: do something stupid like what? + [igossip] Hellmonger@Trilogy: Like what? + [igossip] Hellmonger@Trilogy: Like starting to kill people? + [igossip] Hellmonger@Trilogy: The american people want revenge. + [igossip] Smack@Lima Bean: if he nuked them, I would be only mildly distubed. + [igossip] Megaboz@Lima Bean: nuked was the thing I was going for. + [igossip] Spoo@Nanvaent: which bastard stopped development of the neutron bomb, + perfect time to test it. + [igossip] Xyzzy chants: "NUKE! NUKE! NUKE!" + [igossip] Hellmonger@Trilogy: I would'nt really be phased. I'd like to see the + middle east as a field of glass. + [igossip] Smack@Lima Bean: so how many planes have crashed so far? 5? 6? + [igossip] Musashi@Sumu: Ebony, that 3rd plane in the pentagon confirmed? + [igossip] Sinistrad@VargonMUD: 5. + [igossip] Sinistrad@VargonMUD: Three on target, two off target. + [igossip] Hellmonger@Trilogy: I think bombing them would be cool. + [igossip] Spoo@Nanvaent: hard to tell really, web sites are all choked. + [igossip] Xyzzy: jeez, how many damn kids did the Waltons have? + [igossip] Hellmonger@Trilogy: 7. + [igossip] Hellmonger@Trilogy: all worth around 17-18 bil. + [igossip] Smack@Lima Bean: my understanding is 2 into thw world trade center, 2 + into the pentagon, and one outside pittsburgh. + [igossip] Hellmonger@Trilogy: right. + [igossip] Sinistrad@VargonMUD: Only 1 into the pentagon. + [igossip] Isis@Inon-Net: And one in Sommerset PA as well. + [igossip] Musashi@Sumu: reading in a few places of a 3rd into the pentagon + though. + [igossip] Sinistrad@VargonMUD: 1 outside pitts, 1 recently confirmed outside + Sommerset. + [igossip] Hellmonger@Trilogy: Thats outside pitts. + [igossip] Smack@Lima Bean: sommerset == pitssburgh. + [igossip] Smack@Lima Bean: oh, yeah,and the air force shot one down outside + camp david. + [igossip] Hellmonger@Trilogy: a third plane intot he pentagon? + [igossip] Futility@UOSSMUD: The one in Somerset is the one near pittsburgh. + [igossip] Hellmonger@Trilogy: Really? + [igossip] Sinistrad@VargonMUD: "United Airlines Flight 93 airliner headed from + Newark, New Jersey, to San Francisco, crashed near Somerset, Pennsylvania -- + police said initial reports indicated no survivors. It was not known if this + was connected to the attacks. United also said it was "deeply concerned" about + Flight l75 from Boston to Los Angeles." + [igossip] Sinistrad@VargonMUD: On CNN, they just confirmed that 175 went down, + too. + [igossip] Xyzzy: deepl. + [igossip] Spoo@Nanvaent: so 3 shot down and 3/4 crashed. + [igossip] Hellmonger@Trilogy: We shot down three planes? + [igossip] Xyzzy: yeah, HM, score one for th good guys. + [igossip] Spoo@Nanvaent: there were 7 hijacked. + [igossip] Musashi@Sumu: from advfn: A third plane crashes near the Pentagon in + Washington DC. + [igossip] Smack@Lima Bean: where did 175 go down? + [igossip] Spoo@Nanvaent: well maybe not shotdown, hard to sort out the news + from the confused. + [igossip] Spoo@Nanvaent: WASHINGTON (Reuters) - Three hijacked planes crashed + into major U.S. landmarks on Tuesday, destroying both of New York's mighty twin + towers, hitting the Pentagon in Washington and plunging the United States into + unprecedented chaos and panic. + [igossip] Smack@Lima Bean: fucking kill them all. + [igossip] Blue@Inon-Net: now that Reuters has confirmed it, I'll stop worrying + that it was all US propaganda being parroted by CNN. + [igossip] Hellmonger@Trilogy: no doubt. + [igossip] Xyzzy: the adjective "mighty" brought to you at no extra charge. + [igossip] Hellmonger@Trilogy: I only know of three terrorist crashes, and one + United crash. + [igossip] Hellmonger@Trilogy: And whats up on 175? + [igossip] Sinistrad@VargonMUD: Two united crashes. + [igossip] Hellmonger@Trilogy: where did it crash? + [igossip] Smack@Lima Bean: the united crash is certainly a terorist thing. + [igossip] Smack@Lima Bean: probably the pilot taking it down to prevent + somethign evil. + [igossip] Hellmonger@Trilogy: I thought terrorists all capped off the pilots to + prevent them from fucking up the program? + [igossip] Spoo@Nanvaent: One of the planes that crashed into the World Trade + Center was American Airlines' Flight 11 from Boston to Los Angeles, said Lori + Bassani, spokesperson for American's flight attendants union. ; + [igossip] Smack@Lima Bean: someone said "fuck the terrorists" + [igossip] Sinistrad@VargonMUD: Yeah, I don't think any pilot would go, "Ok, + I'll crash this plane into the twin towers or he'll shoot me." + [igossip] Spoo@Nanvaent: www.reuters.com. + [igossip] Hellmonger@Trilogy: No doubt. YOu are going to die anyway. Fuck it. + I'd put that shit in the dirt. + [igossip] Smack@Lima Bean: I agree... but I bet on the one outside pittsburgh + was stoipped by someone. + [igossip] Xyzzy: hellmonger, you seem to be fairly well-versed in "hijacker + protocol" + [igossip] Xyzzy: something you wannatell us? + [igossip] Hellmonger@Trilogy: Common sense. + [igossip] Boltthrower@Styx: you online from a plane? + [igossip] Sinistrad@VargonMUD: Microsoft announced the release of a new version + of Microsoft Flight. + [igossip] Smack@Lima Bean: I just fear that bioterrorism is part of this. + [igossip] Smack@Lima Bean: that we have not even seen the worst yet. + [igossip] Sinistrad@VargonMUD: Microsoft announced the release of a new version + of Microsoft Flight Simulator today. The terrain has been updated in New York + so that two piles of rubble sit where the twin World Trade Center towers used + to stand. When asked how they had this updated version burned before the towers + were actually bombed Bill Gates responded "We like to be prepared for any + contingiency. This is a horrible tragedy and we grieve for the loss that people + are facing. We will donate .001% of all profits of this product to help the + families of those killed during this horrible event." Newly appointed Vice + President of Microsoft, Osama bin Laden added: "We'd also like to point out + that we have the only flight simulator on the market that has true to the day + updated terrain. If you want to own the most realistic up to date simulator, + you've got to buy ours." + [igossip] Spoo@Nanvaent: sorry, even I find that funny :) + [igossip] Sinistrad@VargonMUD: =) + [igossip] Xyzzy: and we all know how lousy a sense of humor spoo has. + [igossip] Spoo@Nanvaent: at least I have one Xy :) + [igossip] Musashi@Sumu: looks like the pentagon fire is under control. + [igossip] Xyzzy: WHEW! + [igossip] Xyzzy: what about these rumors of car bombings and capitol hill/ + state building/whitehouse, etc. + [igossip] Sinistrad@VargonMUD: Exhaust pipes going off. + [igossip] Musashi@Sumu: well, heard several reports of car bomb outside state + building. + [igossip] Spoo@Nanvaent: there was no bomb at the State Department. + [igossip] Musashi@Sumu: and one of a bomb in a nyc school. + [igossip] Blue@Inon-Net: english.pravda.ru. + [igossip] Spoo@Nanvaent: prolly someone hearing a backfire. + [igossip] Blue@Inon-Net: US DOLLAR ABRUPTLY FALLEN DOWN. + [igossip] Blue@Inon-Net: According to current bidding, US dollar has fallen + abruptly relative to the Euro and to Yena. American stock markets has not + started to work yet. Planes are in air to hamper the second plane. + [igossip] Xyzzy: ALL YOUR NEWS ARE BELONG TO US. + [igossip] Blue@Inon-Net: According to NPR John Hopkins, the USA have not need + to be considerate with the terrorists. + [igossip] Musashi@Sumu: laf. + [igossip] Spoo@Nanvaent: Manhattan island encircled by policemen. + [igossip] Blue@Inon-Net: Suicide pilots piloting two planes have practically + rammed two buildings of International Trade Centre at a height of 85th storey. + These two buildings are known to the whole world thanks to film 'King Kong'. + That are the buildings over which the big monkey was mounting. More detail... + [igossip] Xyzzy: holding hands. + [igossip] Spoo@Nanvaent: POPULATION FROM CENTRE OF CHICAGO EVACUATED. LONDON + PANIC STRICKEN; + [igossip] Xyzzy: hu uhuh uhu, you said "mounting" + [igossip] Musashi@Sumu: london is hardly panic stricken :P. + [igossip] Xyzzy: wait, LONDON panic stricken? + [igossip] Lightfoot@VargonMUD: king kong climbed the empire state building. + [igossip] Blue@Inon-Net: they mean the remake. + [igossip] Blue@Inon-Net: NEWSFLASH: King Kong to be remade again, new buildings + sought. + [igossip] Xyzzy: as opposed to the porn film, "King Dong", where he climbed + lightfoot's mother. + [igossip] Lightfoot@VargonMUD: fuck you dick. + [igossip] Spoo@Nanvaent: I think "have practically rammed 2 buildings" is an + understatement. + [igossip] Xyzzy: ACH! fook me dick! + [igossip] Xyzzy: well, it wasnt very IMpractical. + [igossip] Lightfoot@VargonMUD: I would love to kick the living shit out of a + little punk like you. + [igossip] Spoo@Nanvaent: "ADVENTURES OF AMERICAN RECONNAISSANCE AIRCRAFT R-3. + NOW IN RUSSIAN AIRSPACE;" + [igossip] Zaphod: whoa. + [igossip] Sinistrad@VargonMUD: Danny, I've seen you. You're the smallest + goddamn punk ever. + [igossip] Zaphod: qvc has suspended broadcasts. + [igossip] Zaphod: jesus. + [igossip] Spoo@Nanvaent: surely that should be "Now in Russian Cinemas" + [igossip] Xyzzy: and he doesnt mean overall height. + [igossip] Bayard@Nanvaent: no more qvc? diff -c -r --new-file ds1.1/lib/domains/town/txt/shame/chapter04 ds2.0r27/lib/domains/town/txt/shame/chapter04 *** ds1.1/lib/domains/town/txt/shame/chapter04 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/txt/shame/chapter04 Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,87 ---- + chapter 4 "Cratylus Has His Buttons Pushed" + + [02Dec2005-11:55:50] Jayren <cre> i didnt know that could be done. havening rooms or people like that. hi. + [02Dec2005-11:56:18] Cratylus <cre> ya, it's convenient for when you're deep in coding + [02Dec2005-11:56:28] Cratylus <cre> what's up? + [02Dec2005-11:56:40] Jayren <cre> and people like me wanna come by and do nothing except pester you. + [02Dec2005-11:56:56] Cratylus <cre> pestering is done on the cre channel + [02Dec2005-11:57:58] Jayren <cre> just came back to lister after quite a while of playing with ce pro over on smeghead. + [02Dec2005-11:58:21] Cratylus <cre> is that meaningful? + [02Dec2005-11:59:01] Jayren <cre> well, i learned more about ce pro. that's always good. learned unlike sound forge, ce pro is multitrack. + [02Dec2005-11:59:19] Cratylus <cre> ah, you're talking about your programs + [02Dec2005-11:59:37] Jayren <cre> does it mean anything for dslib, um no not really. + [02Dec2005-12:00:11] Cratylus <cre> well what you said sounded like this: "just came back to foo after quite a while of playing with bar over on baz" + [02Dec2005-12:01:05] Jayren <cre> so then bazically you are saying to cut it out. + [02Dec2005-12:01:13] Cratylus <cre> not really + [02Dec2005-12:01:34] Cratylus <cre> i'm just saying stop assuming i know what you're talking about unless we've discussed it before + [02Dec2005-12:02:30] Jayren <cre> all this lpc stuff makes about as much sense to me, and i thought we have discussed most of that before. i'm pretty sure i mentioned my machine names. + [02Dec2005-12:02:46] Cratylus <cre> ahhh so you're talking about programs and specifying machine names + [02Dec2005-12:03:20] Jayren <cre> lister and smeghead are machines. ce pro and sound forge are programs both for audio editing both run on windows. + [02Dec2005-12:04:14] Cratylus <cre> i'm sure that "lister", "ce pro", and "smeghead" are all obvious and meaningful to you. having mentioned them to me once in passing doesn't make it reasonable to expect me to remember them. do you want me to expect you to remember every file name i throw at you? + [02Dec2005-12:05:13] Jayren <cre> i've been told i have a decent memory. i'd give it a shot. + [02Dec2005-12:05:21] <cre> Cratylus smiles. + [02Dec2005-12:05:29] Cratylus <cre> it's a deal + [02Dec2005-12:06:45] Jayren <cre> remember though. being blind i hafta have a good memory. a good bit better than average. i hafta make and use mental maps all the time, in travel from one place to another or just locating a room in a building. + [02Dec2005-12:07:19] Cratylus <cre> that should make remembering what i tell you very easy + [02Dec2005-12:07:29] Cratylus <cre> i look forward to not having to repeat myself with you + [02Dec2005-12:08:12] Jayren <cre> *shrug* we'll see what happens. + [02Dec2005-12:08:20] Cratylus <cre> you don't sound so confident any more + [02Dec2005-12:10:06] Jayren <cre> there are 2 parts to memorization, acquisition and retension. the first part i'm not so hot at. though once i've retained something it can become part of a mental map. + [02Dec2005-12:11:39] Cratylus <cre> ok. so then you understand how it might be reasonable to expect me to forget the names of programs and computers that i do not use + [02Dec2005-12:12:07] Jayren <cre> heh. i was waiting for you to connect those. + [02Dec2005-12:12:23] Cratylus <cre> explain + [02Dec2005-12:12:59] Jayren <cre> phone. + [02Dec2005-12:13:03] <cre> Cratylus snorts. + [02Dec2005-12:13:41] Jayren <cre> what it really was the phone. + [02Dec2005-12:14:05] Cratylus <cre> i believe you + [02Dec2005-12:15:02] Jayren <cre> i guess because of my seizures i look a little differently at forgetting things than someone without. + [02Dec2005-12:17:16] Jayren <cre> once something is acquired, it takes a bit of time before it goes to relatively permanent storage though once its there there's a lot better chance it will remain. when i have a seizure everything in the acquisition buffer can go blip. + [02Dec2005-12:17:16] Cratylus <cre> remembering things takes energy. i dislike wasting energy on things that are of no relevance to what i want to do. if a thing is not relevant to me, it is discarded. the fact that we will be working on blindmode does not make it relevant to me which programs you use on what computers. i find it hard to imagine a circmstance where the name of your computer would have any effect on me whatsoever, except in the case of being challenged to remember it + [02Dec2005-12:19:49] Cratylus <cre> let me give you an example of how your statement might have been worded to add meaningfulness. + [02Dec2005-12:20:01] Jayren <cre> to give you an idea, i've still got maps in my head for my childhood house, which we left about 18 years ago if i've done the math right. i've got a map for the schools i attended. basically information i will never need again ever. + [02Dec2005-12:20:11] Cratylus <cre> "i came back to my favorite synthesizer program after plaing with a different one on my alternate computer" + [02Dec2005-12:21:01] Cratylus <cre> a statement like this is not only meaningful to a person who isn't you, but also suggests that your worldview isn't so limited that you expect people to remember every detail of your life that you provide once + [02Dec2005-12:22:42] Cratylus <cre> my own brain has various unusual advantages and disadvantages, but i manage to communicate with other people in a way that standardizes my perspective into something generally useful to others + [02Dec2005-12:23:04] Cratylus <cre> people appreciate the effort + [02Dec2005-12:24:42] Jayren <cre> at the same time, i might not emember something that happened last week because that event didn't get a chance to make it to the storage area and was still in the buffer between that and the outside world when i had a seizure. makes life interesting. still one good thing, i always get to met new people. + [02Dec2005-12:26:23] Cratylus <cre> you have adequately explained your problem. do you understand why your expectation was unreasonable? + [02Dec2005-12:38:06] Jayren <cre> and i don't expect people to remember what lister and smeghead and soundforge and ce pro are. i never claimed to expect that. if someone wants to know what any of these things are, then all they have to do is as and i'll tell them. just like forgetting something that has happened to me, i can forget what someone knows or more spcifically what i've told them. + [02Dec2005-12:39:17] Cratylus <cre> when you made a statement that included those names without context, it per se assumes an expectation that the listener knows what that is + [02Dec2005-12:39:39] Jayren <cre> i had no such assumption. + [02Dec2005-12:39:53] Cratylus <cre> why would you say things you don't expect another to understand? + [02Dec2005-12:40:17] Jayren <cre> if the listener didn't know and wanted to know, then asking would have worked. + [02Dec2005-12:41:09] Cratylus <cre> is it your habit to include out of context jargon in all your conversations? + [02Dec2005-12:42:50] Cratylus <cre> i mean, i'm picturing a person sitting at thanksgiving dinner, being asked by, say, an aunt about how things are going, and the person replying "just came back to lister after quite a while of playing with ce pro over on smeghead." + [02Dec2005-12:43:20] Cratylus <cre> is this sort of thing the way you generally do with people? + [02Dec2005-12:43:40] Jayren <cre> one thing this sort of mindset avoids is talking down to folks. for example. if someone asks me how to fix a problem and i tell them that there are several steps and give them those steps if that helps them great. i don't have to tell them what to click or whatever to tell them how to format the c: drive, i can just say format the c: drive. if they dont know they can say, how do i format the c: drive then i can say click on this and do whatever. + [02Dec2005-12:44:26] Cratylus <cre> i am a technical expert that deals with laymen all the time. this is why i understand how inappropriate it is to assume knowledge of jargon + [02Dec2005-12:45:04] Jayren <cre> i never claimed to be a people person. in fact i know i'm not. + [02Dec2005-12:45:23] Cratylus <cre> so you do understand that your expectation was unreasonable + [02Dec2005-12:45:57] Jayren <cre> i still submit i wasn't expecting you to know what any of those things were. + [02Dec2005-12:46:19] Cratylus <cre> then why on earth would you say that? do you want me to start disregarding your statements? + [02Dec2005-12:52:17] Cratylus <cre> the way i see it, there are two possibilities + [02Dec2005-12:52:49] Cratylus <cre> first: you did expect me to know what you were talking about, making you a narrow-minded and deeply self-centered person + [02Dec2005-12:53:45] Cratylus <cre> second: you did not expect me to know what you were talking about. this means the point of the statement was to make me ask you what you were talking about, which is pointless and rude. + [02Dec2005-12:54:25] Cratylus <cre> i suppose there is a third, which is that you didn't care one way or another. since this makes you an asshole, i more or less rules that out, but if the shoe fits. + [02Dec2005-12:59:03] Jayren <cre> let's examine those 1: did expect you. can eliminate this one already because i had no such expectation. 2: did not expect you to know. see note 1: above. and 3: i am an asshole. i really think that would be more appropriate if you had asked and i went and laughed and not told you. instead, i gladly told you what those elements were. don't think asshole fits either sorry. + [02Dec2005-12:59:21] Cratylus <cre> hmm + [02Dec2005-12:59:53] Cratylus <cre> ok, how about this, then + [02Dec2005-13:00:55] Cratylus <cre> a friend of mine and i go to lunch, have a good time, and we talk about stuff. i tell her that i'm working on a mudlib called dead souls, the driver of which is mudos, and which is running on a computer called frontiers. + [02Dec2005-13:01:56] Cratylus <cre> few days later we get back together. i tell her that frontiers needs a recompile of mudos for dead souls + [02Dec2005-13:02:42] Cratylus <cre> given that i only mentioned these names once, and that they have no relevance to her life, i think i can reasonably guess she won't know what i'm talking about + [02Dec2005-13:03:42] Jayren <cre> she might have a really good memory though and remember these things from the other day. + [02Dec2005-13:03:46] Cratylus <cre> if someone pauses life there, and asks me, "ok, now, you must guess. will she remember what a mudlib is, and its relationship to a mud and driver, and what frontiers is?" + [02Dec2005-13:04:12] Cratylus <cre> i have two buttons. on for "yes she will remember" and one for "no, she wont" + [02Dec2005-13:04:50] Cratylus <cre> given how irrelevant this knowledge is, the fact that it was mentioned once, and days have passed, during which her life went on, with her havingt to remember things that actually do matter... + [02Dec2005-13:05:04] Cratylus <cre> i would tend to guess no. she won't remember. that seems the most likely outcome + [02Dec2005-13:05:21] Cratylus <cre> it is *possible* she'll remember, but that is less likely + [02Dec2005-13:05:45] Cratylus <cre> therefore, i push the "no" button + [02Dec2005-13:05:53] Cratylus <cre> which button would you push? + [02Dec2005-13:05:59] Jayren <cre> you can't know if she will remember or not. you just have to be happy to explain if she asks you can't laugh and go 'i wont tell you.' + [02Dec2005-13:06:05] Cratylus <cre> which button would you push? + [02Dec2005-13:06:35] Jayren <cre> i wouldn't push either one. + [02Dec2005-13:06:45] Cratylus <cre> you are not being reasonable + [02Dec2005-13:06:53] Jayren <cre> or, i'd push both at once, just to fuck up the system. + [02Dec2005-13:06:53] Cratylus <cre> this discussion can have no further purpose + [02Dec2005-13:06:57] Cratylus <cre> goodbye + [02Dec2005-13:08:44] Jayren <cre> i think it did serve a purpose. i now understand what button you would press and why. and i've just explained why i wouldnt push either. diff -c -r --new-file ds1.1/lib/domains/town/txt/shame/chapter05 ds2.0r27/lib/domains/town/txt/shame/chapter05 *** ds1.1/lib/domains/town/txt/shame/chapter05 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/txt/shame/chapter05 Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,934 ---- + chapter 5 "The Great Heat Radiation Debate, December 1999" + + Cast of Characters: + Cratylus, a self-righteous know-it-all UNIX engineer + Thorr, some high school kid + Hermogenes, a wiseacre aerospace computer scientist + + + Part I is seen through the eyes of Cratylus + in the same room as Hermogenes. During the conversation, + Thorr interjects some unrelated stuff through + the <cre> communications channel. + + Part II is again seen through the eyes of + Cratylus, but this time Hermogenes and Cratylus are + in different rooms, and communicate through + the <admin> channel. + + + PART I + ------ + + Hermogenes says, "Or whatever they call em." + Hermogenes asks, "But thats defined by the server?" + You say, "Its mudos dependent." + Hermogenes asks, "Like, number of cycles per second or something?" + You say, "Depends what parameters it was compiled with, and what gets passed to it in config and startup." + You say, "Yeah." + Hermogenes asks, "Yoou can set it to whatever you want?" + You say, "I imagine so." + Hermogenes says, "Like, i want 10 tics per second of processor time." + Hermogenes says, "Hmm." + Hermogenes asks, "Why couldnt My Big Game run similarly to a mud?" + Frontiers has been up for 2w 6d 5h 10m 37s. + You say, "I dont really understand your question." + Hermogenes says, "In my game thing..." + -------------------------------------------------------------------------- + 4 people in current sort Eastern time: Mon Dec 27 14:24:40 1999 + -------------------------------------------------------------------------- + 253 D - Cratylus sun-barr.Sun.CO ~cratylus/workroom + 100 D - (Frontiers) cv ~frontiers/workroom + 24 D - Hermogenes macpub800.gsfc. ~cratylus/workroom + 2 h - Thorr sailor.lib.md.u ^campus/room/wiz_loung + -------------------------------------------------------------------------- + Frontiers + Hermogenes says, "Could i just have the server listening for commands..." + Hermogenes asks, "And stuff happens in 'tics'?" + You say, "You tell me." + Hermogenes says, "YEAH." + Hermogenes says, "I WILL." + You say, "Heh." + Hermogenes says, "Yeah." + Hermogenes says, "Doin it." + You say, "Yeah." + You say, "Doin it." + Hermogenes says, "Iiiiii saw YOU." + Hermogenes says, "Im almost tempted to listen to that right nw." + Hermogenes wants to know the diff between convection, conduction, and radiation + Hermogenes exclaims, "NnnnnNNNNNOW!!!" + You say, "Hmm." + Hermogenes takes off his shoe and starts banging it on the table + You say, "Convection is about temperature-related airflow." + Hermogenes says, "Classic stalin." + Hermogenes says, "Or lenin." + You say, "Kruschev." + Hermogenes says, "Ohhh yeah." + Hermogenes says, "I think some older guy did it, too." + Hermogenes says, "Aaanyways." + Hermogenes asks, "Convection is ONLY concerned with gaseous heat transfer?" + You say, "Prolly not." + Hermogenes says, "B'oh." + You say, "I imagine liquids have similar properties." + Hermogenes says, "I could ask on IG..." + Hermogenes says, "But i dont wanna know THAT bad." + You ask, "Why not look it up?" + Hermogenes says, "Pfah." + Hermogenes says, "Thats yer answer to EVERYthing." + You say, "Heh." + Hermogenes says, "Shoot." + Hermogenes says, "Im so used to stopping the initial loading of my homepage." + Hermogenes says, "But this time i WANTED it." + Hermogenes says, "Heh, this keychain has a y2k countdown timer on it..." + You say, "Anyways convection currents are useful knowledge to aviators and boat people." + Hermogenes says, "Only 4 days left on it." + Hermogenes says, "E has a convection oven..." + You say, "Vultures can ride "thermals" for hours without flapping their wings." + Hermogenes says, "Fuggin lazy bums." + You say, "Ans for submarines, thermocline layers are important acoustic landmarks." + Hermogenes nods solemnly. + Hermogenes says, "I remember goin out in th boat with my dad." + Hermogenes says, "Hed drive, id watch the sonar thingie." + Hermogenes says, "Id occassionally see thermocline layers." + You say, "Well there ya go." + Hermogenes says, "Conduction = opaque solids." + You ask, "Ya heat transfer huh?" + Hermogenes says, "Convection = solid surface in contact with moving liquid or gases." + Hermogenes says, "Ya, heat transfer." + Hermogenes says, "I mean, i KNEW it was heat transfer." + You say, "And i guess radiation is the transfer of heat energy from solid to gas." + Hermogenes says, "I just dint know what set them apart." + Hermogenes says, "Well..." + You say, "Well u cant radiate heat in aa vacuum." + Hermogenes says, "Substandces cdont hafta be touching." + Hermogenes says, "In radiation heat transferrence." + Hermogenes says, "Actually..." + Hermogenes says, "I was about to saty...." + You say, "Well its gotta touch SOMETHING." + Hermogenes says, "This process is different from both conduction and convection, because the substances exchanging heat need not be touching and can even be + separated by a vacuum." + Hermogenes says, "Bplhtplhtlt." + You say, "Doesnt make sense to me." + You say, "Explain how u can radiate heat in aa vacuum." + Hermogenes asks, "Cantcha transmit heat over a vaccuum?" + You say, "No." + Hermogenes asks, "What about th sun?" + You say, "Thats the whole idea behind thermoses." + You say, "Thats aa different KIND of radiation." + Hermogenes asks, "Space != complETE vaccuum?" + You say, "The sun is particle radiation." + Hermogenes says, "Thermoses dont complETELY stop heat loss." + You say, "And em." + You say, "Well cuz theyre not comPLETE vacuums." + Hermogenes says, "Hmm." + Hermogenes says, "I cant really argue with ya, since i dont know much about it in the foist place." + You shrug. + You say, "No like im aa textbook." + You say, "I just dont see how you could radiate heat in aa vacuum." + You say, "Except in electrmagnetic wave form." + Hermogenes asks, "Microwave?" + You say, "Like, if i got shot out of an airlock, right." + Thorr <cre> > what happened to haderach + Hermogenes <cre> > hmm + Hermogenes <cre> > hes on here oCASSIOanlly + Hermogenes <cre> > not all THAT often + You say, "Im 98.something degrees." + Thorr <cre> > yeah.. he is not even a character tho + Hermogenes <cre> > if ya email ed hima and told him other people were interested in workin on the mud, he might show up more frequently + You say, "If u put aa thermometer RIGHT next to me." + You say, "Without touching." + Hermogenes listens + You say, "I doubt it would be affected." + Hermogenes asks, "At ALL?" + You ask, "How could it?" + You say, "If i was radioactive, sure." + Hermogenes asks, "The IR energy radiatinfg from yer body?" + You say, "Like i said, eventually u would cool down through em emmission." + You say, "But thats not the kind of radiation theyre talkin about." + Hermogenes says, "A law formulated by German physicist Max Planck in 1900 states, in + part, that all substances emit radiant energy simply because they have a + positive absolute temperature." + You say, "Like i SAID." + Hermogenes asks, "Er, so ther?" + You say, "Like i said, eventually u would cool down through em emmission." + You say, "But thats not the kind of radiation theyre talkin about." + Hermogenes says, "Electromagnetic emmission?." + Hermogenes says, "Ymean, in the IR range?." + Hermogenes says, "Im not tryin to nit pick, im tryin to understand yer explanation." + You say, "Ok." + You say, "A warm coal radiates heat." + You say, "Because its warm." + You say, "And it warms the air around it." + Thorr <cre> > i gotta do some actual work.. bbl + <cre> > Thorr waves. + You say, "This is the kind of radiation that I mean when i say heat radiation." + Hermogenes <cre> > see ya + <cre> > Cratylus waves. + Hermogenes says, "Right." + [Thorr quits] + You say, "Absent air, were talkin about aa different kind of radiation." + Hermogenes says, "Transmitting of energy in the infrared range = heat." + You say, "That i would tend NOT to call "heat radiation"." + You say, "But electromagnetic radiation." + You say, "Which is aa whole other can o beans." + Hermogenes says, "Mmm, beans." + You say, "SO." + You say, "When u say convection, conduction, radiation." + You say, "I do not think em radiation." + You ask, "See my point?" + Hermogenes asks, "But.. isnt IR within the EM spectrum?" + You say, "EXACTLY." + You say, "The coal MAY be radiating ir, but thats not what im talking about." + Hermogenes says, "'youd NOT call it 'heat radiation', but you WOULD call it 'EM radiation'." + You say, "Yes." + Hermogenes says, "Even though, heat radiation == IR radiation." + You say, "Bullshit." + Hermogenes says, "Ok ok." + Hermogenes says, "Sorry." + You shrug. + You say, "I disagree with that statement." + Hermogenes asks, "Yer sayin for het to be radiat4d, there hasta be air, in the example of the coal?" + You say, "I think u can also see it as patently false." + You say, "Right." + Hermogenes says, "No need to jump all over my case, im just tryin to understand how yer percieving the problem." + You say, "Now, if my definition of heat radiation is mistaken, then thats something else." + Hermogenes says, "O K then." + You say, "But i do not equate infrared radiation with heat radiation." + Hermogenes asks, "Whyzzat?" + Hermogenes says, "Not that im arguing, im just wonmdering why you say that." + Hermogenes says, "Sir." + You emote: Cratylus is confused. + You ask, "Why WOULD you say that?" + Hermogenes says, "Mebbe my understanding of "heat" is incorrect." + You say, "What makes u think heat radiation == IR radiation." + You say, "Well im curious why u think that." + Hermogenes breaks down and starts to cry + You say, "Dont mean to jump all over yer case." + Hermogenes says, "I thought..." + You say, "I just dont see where youd think that." + Hermogenes says, "What as an object transmits more n more energy..." + Hermogenes says, "It starts to transmit it in different areas of the EM spectrum." + You say, "Ok." + You ask, "Why do you equate heat with energy?" + Hermogenes asks, "Right|wrong?" + Hermogenes says, "B... b... be-cause..." + You shrug. + You say, "Again, i could be dead wrong." + Hermogenes asks, "Heat is what we perceive IR energy as?" + You say, "Erm." + You say, "Well i dont think heat is about perception." + Hermogenes says, "Or not." + You say, "I think heat is about molecular motion." + Hermogenes says, "Right...." + You say, "And for that to transfer." + You say, "U need molecules." + You say, "Hence, no vacuum." + Hermogenes says, "You cant have a PERFECT vaccuum, though." + Hermogenes says, "But thats a different topic." + You say, "So you can see why i would disagree with your source." + Hermogenes says, "Im still tryin to figure out why (hea == IR) is false." + You say, "Explain to me why it is true." + Hermogenes yields + You hmm. + Hermogenes says, "Im sorry, i cant argue." + Hermogenes is at a loss for words currently + Hermogenes says, "No fense, i mean." + You say, "Well im sure there is aa relationship between heat and ir, but i do not see these as being the same thing." + You shrug. + You say, "You may be right." + You say, "But i doubt it." + Hermogenes shrugs. + Hermogenes says, "Heh." + You smirk. + Hermogenes says, "Ya just HAD to throw that disclaimer in tehre, DINT cha." + Try "help index" for a list of command types. + You emote: Cratylus snickers. + Hermogenes says, "Cool page, so far:." + Hermogenes says, "Http://www.ipac.caltech.edu/Outreach/Edu/infrared.html." + Hermogenes says, "The primary source of infrared radiation is heat or thermal radiation." + You say, "So then they are NOT the same thing, right." + Hermogenes says, "Ok, mebbe i was not conveying my thoughts too well." + You say, "Just because i arrive in aa car doesnt mean im aa car." + Hermogenes says, "Ya friggin car." + Hermogenes says, "For example, hot charcoal may not give off light + but it does emit infrared radiation which we feel as heat." + You ask, "Ok. what does that illustrate?" + Hermogenes says, "The more energy an object is giving off..." + Hermogenes says, "The higher up in the em spectrum it can be perceived at." + You ask, "Mmhmmm?" + Hermogenes says, "In." + Hermogenes says, "Of." + You say, "Ok." + You ask, "So how does that prove that heat radiation works in aa vacuum?" + Hermogenes is lookin at the creepy kitty picture on that page + Hermogenes says, "I." + Hermogenes says, "Dont." + Hermogenes says, "KNOW." + You emote: Cratylus calls off the dogs. + You say, "Sorry." + You say, "I get very focused." + Hermogenes says, "But aPPARRENTLY, with "radiation" heat transfer, objects dont HAFTA be touching." + You say, "If there is air between them, i agree." + Hermogenes says, "And yknow." + Hermogenes says, "Mebbe these 3 types of transference isnt JUST heat transfer." + Hermogenes says, "Mebbe they mean ENERGY transfer." + Hermogenes says, "But i think they DO mean heat transferrence." + You say, "Me too." + Hermogenes says, "Which doesnt really settle nuttin." + Hermogenes says, "That DOES it." + You say, "Well it settles that theyre wrong." + Hermogenes says, "W." + Hermogenes says, "We must ask the sages of IG." + You say, "Heh." + Hermogenes asks, "Ya want to?" + You say, "Ohhh mighty oracle..." + Hermogenes says, "Or, naaah." + You say, "If u want garbage, go ahead." + Hermogenes asks, "Didja see the creepy kitty pic yet?" + You say, "Ya." + You say, "Blue prolly can say." + Hermogenes says, "SOMEtimes, ig has some answers." + Hermogenes says, "Im gunan try it." + Hermogenes says, "No WAIT." + Hermogenes says, "Im about to head over to other building." + Hermogenes says, "Ill try in an hour or so." + You say, "Well im goin home fairly soonish." + Hermogenes says, "But i gotta formulate the correct question, foist." + You say, "If you find credible documentation of yer crackpot theory lemme know." + Hermogenes asks, ""can heat be transferred in a vaccuum?" ?" + You say, "No." + You say, "That is not quite the question." + Hermogenes says, "Ok, then what." + Hermogenes asks, "What IS the question?" + Hermogenes says, "Say it." + Hermogenes exclaims, "SAY IT!!!" + You ask, "Is infrared radiation heat?" + Hermogenes says, "I THINK it means./..." + Hermogenes says, "Em radiation transmitting .." + Hermogenes says, "Phone." + You say, "Because OBVIOUSLY heat is transferred in aa vacuum." + You say, "But what were talking about is HEAT RADIATION." + Hermogenes scribbles in his memo pad. + You say, "Thats right. you DO yer homework." + Hermogenes says, "Btplhpbtplbpt." + Hermogenes says, "Im "writing down" the url to that page." + Hermogenes says, "With the kitty poicture on it." + Hermogenes says, "I THINK, its saying..." + Hermogenes says, "EM radiation transmitting at X frequency is perceived by us as "heat"." + You say, "That sounds about right yeah." + Hermogenes says, "Just like something rtansmitting between X and Y nm is perceived as "light"." + You say, "Sounds right so far." + Hermogenes says, "So..." + You ask, "So...?" + Hermogenes asks, "Would you argue that something transmitting in the visible portion of the em spectrum is|isNOT light?" + You say, "I find your parallel flawed." + You say, "The definition of heat and the definition of light are very different." + Hermogenes says, "Well, of COURSE its flawed." + Hermogenes says, ""how so?" :)." + You say, "Ok, walk through this with me." + Hermogenes attempts patience... + You say, "Heat is molecules moving, aka brownian motion." + Hermogenes says, "Heat is kinetic energy of molecules in motion, ook." + You say, "Heat radiation occurs when molecules of aa lower "temperature" touch molecules of aa higher "temperature"." + You say, "Now." + Hermogenes says, "So how can they transfer heat when theres no molecules to bump into." + Hermogenes says, "Ok." + You say, "If there is aa vacuum between these two objects of differing temperatures." + You say, "On MAY be warmed up by the other." + You say, "I dont dispute that." + You say, "But it would be warmed up not by HEAT radiation, since "HEAT" is not radiated through aa vacuum." + Hermogenes says, "BUT." + You say, "It would be warmed up by the effects of ir radiation." + Hermogenes says, "Theres doesns not exIST a perfect vacuumm." + You say, "Dude you must join me." + You say, "We dont have these objects either." + Hermogenes says, "Mebbe the few molecules in the non-perfect vaccuum are enough to transfer the heat or somerthin." + You say, "Nor do they possess frickin laser beams." + Hermogenes asks, "Yer sayin in a THEORHETICAL vaccuum?" + You say, "In MY world, when u talk about aa vacuum, its aa vacuum." + You ask, "Yer book...did it specify an imperfect vacuum?" + Hermogenes says, "I mean, are you arguing on a pure le." + Hermogenes says, "Ok, you are." + Hermogenes says, "Yes, it did." + You say, "Well then its not aa vacuum." + You say, "Its aa vacuum or its not." + You say, "U cant have both." + Hermogenes says, "It said somthin like "a perfect vaccuum cant be created, even with the best equipment, etc etc"." + You say, "Well fuckin aa DU." + You say, "DUH if theres shit flyin around in there sure there can be heat transfer." + Hermogenes says, "So, this brings me back to their assertion of objects not having to touch." + Hermogenes says, "For heat transfer." + You say, "But that totally defeats the idea of heat radiation in aa vacuum." + Hermogenes says, "Ok, point taken." + You say, "They DO touch, indirectly, through the flying molecules in yer imperfect vacuum." + Hermogenes asks, "Why bother making up a law of thermal transferrence if the environment will never exist?" + Try "help index" for a list of command types. + Hermogenes says, "For such a law." + You emote: Cratylus blinks. + [Thorr logs in] + Hermogenes says, "Okokok,." + You ask, "U joking?" + Thorr <cre> > lo + Hermogenes says, "I hate to do this." + Cratylus <cre> > oi + Hermogenes <cre> > ey + Hermogenes asks, "Can i "pause" this discussion?" + You say, "I thought we just agreed i was right." + Hermogenes asks, "Or do i forfeit all claims by leaving the table right now?" + You shrug. + You say, "I thought u just agreed with me." + Thorr <cre> > is it worth creating an area.. or is the new lib gonna cancel out anytyhing i do? + Hermogenes says, "Lol." + Cratylus <cre> > hold off + Thorr <cre> > anything that is + Thorr <cre> > ok + Thorr <cre> > what exactly is gonna change ?? + Hermogenes <cre> > you might wanna start PLANNING out an area, but hold off on the actual coding of it + Cratylus <cre> > everything + Thorr <cre> > whoa + Hermogenes <cre> > it will shake the very foundation of life as you know it + Thorr <cre> > hehe + Cratylus <cre> > it might even radiate heat in aa vacuum + Hermogenes <cre> > heat will even transfer over a vaccuum, in the new mud lib + Hermogenes <cre> > hahahahaha + Try "help index" for a list of command types. + Cratylus <cre> > :) + Thorr <cre> > heh + Hermogenes <cre> > dammit, quit stealin all my material + Cratylus <cre> > i gotta hit the road ill be back later + Thorr <cre> > k + Thorr <cre> > see ya + Hermogenes <cre> > ya, im goin to new building + Hermogenes says, "Ill be back round 4pm." + Cratylus <cre> > ill be back in 20 or, well pick up this convo + Hermogenes says, "DEFinately." + Hermogenes waves. + Thorr <cre> > ok + <cre> > Cratylus waves. + Please come back another time! + + + PART II + ------- + + Hermogenes <admin> bak + Hermogenes <admin> btw, ennytime you wanna pick our conversation bout heat transf3errence, lemme know + Try "help index" for a list of command types. + Cratylus <admin> i thot u agreed with me + Hermogenes <admin> i have NO idea ... + Hermogenes <admin> restate your assertion, please? + Hermogenes <admin> or do you not wanna open that can o worms again + <admin> Cratylus wonders why he always has todo all the splainin. + Hermogenes <admin> or you scaaaared? + Cratylus <admin> ok + Cratylus <admin> ready? + <admin> Hermogenes nods solemnly. + Cratylus <admin> you said heat radiation can occur even through aa vacuum + Cratylus <admin> i disagreed + Hermogenes <admin> i said that cause the web page said that + Hermogenes <admin> but, go on + Cratylus <admin> then u said ir waves WERE heat, hence heat radiation DID go through aa vacuum + Cratylus <admin> i explained that there is aa diff between ir and heat + Hermogenes <admin> but then i changed my thing... + Cratylus <admin> im gettin to it + Hermogenes <admin> to say that 'heat' was how we PERCEIVE ir radiation + Cratylus <admin> you know theres aa transcript + Cratylus <admin> check yer email + Cratylus <admin> go + Hermogenes <admin> jeez, you didnt + Cratylus <admin> now + Hermogenes <admin> ok okok, i will + Cratylus <admin> i KNEW this would happen + Hermogenes <admin> ok, i talked to someone + Hermogenes <admin> hes on one of the... + <admin> Hermogenes hesitates + Cratylus <admin> mmhmm + Hermogenes <admin> science teams + Cratylus <admin> DON'T SHOOT! + Hermogenes <admin> :) + Hermogenes <admin> and, aPARRENTly... + Hermogenes <admin> a molecule can transfer heat to another molecule withOUT tyouching + Cratylus <admin> yes + Cratylus <admin> i know + Cratylus <admin> i said that aa million fuckin times + Cratylus <admin> the issue here is not wether there is heat transfer dude + Hermogenes <admin> so, molecule A can heat molecule B without touching + Cratylus <admin> yes + Cratylus <admin> agreed + Cratylus <admin> but not through "heat radiation" + Hermogenes <admin> IR emmission + Cratylus <admin> RIGHT + Hermogenes <admin> or IR radiation or whatEVER you wanna call it + Cratylus <admin> which is the WHOLE POINBT of my argument + Cratylus <admin> that you CAN transfer heat thru aa vacuum + Cratylus <admin> but it ISNT "heat radiation" + <admin> Hermogenes waits for the punchline... + Hermogenes <admin> ohhhhh, wait + Hermogenes <admin> i think i see + Cratylus <admin> waddaya mean? what word did you have trouble with? + Hermogenes <admin> your main beef was with the term "heat radiation" as opposed to the more PROPER term of "IR radiation"?? + Cratylus <admin> well yes + Cratylus <admin> sort of + <admin> Hermogenes stares at you + Cratylus <admin> not quite tho + <admin> Hermogenes stares at you intently + Cratylus <admin> ok + Cratylus <admin> question + Hermogenes <admin> ok, im HOPING this hasnt been a giant battoe of semantics + Cratylus <admin> do you think ir radiation == heat radiation? + Hermogenes <admin> now, NO, i dont + Cratylus <admin> oK then + Cratylus <admin> that was my point + Hermogenes <admin> i had my terms jumbled up, and + Cratylus <admin> so basically we agree + Hermogenes <admin> aaaahhh + Hermogenes <admin> yes + Hermogenes <admin> so, yer whole POINT was to show how i was WRONG in my useage of the terminology? + Cratylus <admin> you kept sayin stuff that assumed ir == heat, which is not true + Cratylus <admin> the idea was to point out that yer source was not correct + Hermogenes <admin> heat is the term we assign to the perception of IR radiation, just as light is how we descripe the process of seeing photon particles interacting with our eyes, etc + Cratylus <admin> no + Hermogenes <admin> ah HA + Cratylus <admin> that also is not correct + Cratylus <admin> heat is not aa subjective experience + Cratylus <admin> it is aa measurable state of molecular motion + Hermogenes <admin> yer assuming my SOURCE is not correct, when in fact, it could very well be (and probably WAS)my INTERPRETATION of my source + Cratylus <admin> could be + Hermogenes <admin> wait, heat is not a what? + Cratylus <admin> heat is not aa subjective experience + Cratylus <admin> it is aa measurable state of molecular motion + Hermogenes <admin> riiiight, and light isNT? + Cratylus <admin> i dont know why u keep bringing light into this + Hermogenes <admin> i mean, not molecular motion, i mean objectively measurable + Cratylus <admin> im not concerned with light at the moment + Hermogenes <admin> because light n heat are on th same EM spectrum, aint they? + Cratylus <admin> whoa + <admin> Cratylus sits you down. + Cratylus <admin> you better cool that walnut off + Hermogenes <admin> fine fine, IR emmission and visible light emission are + Cratylus <admin> right + Cratylus <admin> so what? + Cratylus <admin> were talkin about heat + Hermogenes <admin> so... + Hermogenes <admin> uh... + Cratylus <admin> which is NOT on the em spectrum + Hermogenes <admin> so THERE! + Hermogenes <admin> WHAT? + Cratylus <admin> were talkin about heat + Cratylus <admin> which is NOT on the em spectrum + Hermogenes <admin> IR is NOT on the em spectrum? + Cratylus <admin> oh my FUCKING GOD + Hermogenes <admin> ok, NOW im confused + Cratylus <admin> are you pullin my leg or what? + Hermogenes <admin> i must be TOTALLY thinkin of somethin else + Hermogenes <admin> please, to define "em spectrum" + Cratylus <admin> ok im sorry if i sound condescending, but damn you deserve it + Hermogenes <admin> well excuuuUUUuuuuUUuuUuuuse ME for not clearly defineing all th terms from th onset + Cratylus <admin> when electromagnetic energy is radiated, its measured on what we call the em spectrum + Hermogenes <admin> ya? + Cratylus <admin> heat is NOT electromagnetic energy + Hermogenes <admin> but IR radiation is? + Cratylus <admin> but when something IS hot, it emits em waves + Cratylus <admin> somthing that IS hot emits IR + Cratylus <admin> but the heat itSELF is not the IR + Cratylus <admin> the heat is aa different kind of energy + Cratylus <admin> and though the IR waves MAY heat up another object... + Hermogenes <admin> isnt heat how we describe the perception oof said ir energy? + Cratylus <admin> this transfer of energy is not what you can call "heat radiation" + Cratylus <admin> NO DUDE NO + Cratylus <admin> BAD HERMOGENES + <admin> Hermogenes goes back to the page with the creepy kitty pic + Cratylus <admin> define heat please + Hermogenes <admin> mostly to look at the creepy kitty pic, that is + Cratylus <admin> i thought YOU were the scientist in the family + Hermogenes <admin> um, define heat? + Cratylus <admin> yes. define heat + Hermogenes <admin> the amount of hotness soemthing has? + Cratylus <admin> ok let me tell you what webster says heat is + <admin> Hermogenes notes there are over 20 definitions... + Hermogenes <admin> but, go on + Hermogenes <admin> meestor WEBSTER dude + Cratylus <admin> "the energy associated with the random motions of molecules, atoms, or smaller structural units of which matter is compised" + Hermogenes <admin> asSOCiated with + Cratylus <admin> notice there is no mention of electromagnetism + Cratylus <admin> heat, man, is this molecular motion + Cratylus <admin> nothing else + Cratylus <admin> kinetic energy + Hermogenes <admin> ok + <admin> Hermogenes snives. + Cratylus <admin> as it HAPPENS, this energy tends to emit some electromagnetic radiation + Hermogenes <admin> oooOOo, whatta coiINcidince + Cratylus <admin> but the em radiation is NOT heat + Hermogenes <admin> so... + Hermogenes <admin> yer sayin/.... + Cratylus <admin> it is em radiation, like the color blue or xrays + Hermogenes <admin> the molecular motion emits the ir stuff? + Cratylus <admin> well, the heat energy does ya + Hermogenes <admin> heat energy? + Cratylus <admin> ya + Cratylus <admin> i dont know if the motion and the energy are the same thing + Cratylus <admin> but thats aa diff argument + <admin> Hermogenes feels sufficiently dumb now, thankyouverywelcome + Cratylus <admin> so, what im sayin is: + Cratylus <admin> when u warm yourself at aa roaring fire + Hermogenes <admin> ooo, dats toasty + Cratylus <admin> you are being warmed by "heat radiation" + Hermogenes <admin> "heat radiation" + Cratylus <admin> the heat, or rapidly moving air/fuele molecules, are speeding up YOUR molecules through contact + Hermogenes <admin> as in "conduction, convection, RADIATION"? + Hermogenes <admin> aaah + Cratylus <admin> LISTEN + Cratylus <admin> the heat, or rapidly moving air/fuele molecules, are speeding up YOUR molecules through contact + Cratylus <admin> it also happens that the fire MAY be causing your molecules to move faster ALSO through some IR radiation, but this amount of heating is insignificant + Hermogenes <admin> ok, + Hermogenes <admin> can i interject at this moment? + Cratylus <admin> sure + Hermogenes <admin> er, MAY i + Hermogenes <admin> the scientist dude ALSO said somethin about: + Cratylus <admin> get that fucking dude in here + Cratylus <admin> go get him + Cratylus <admin> ill wait + Hermogenes <admin> how the earths atomoshpere n crust n stuff arent warmed by particles from the sun hittin them... + Hermogenes <admin> but from the IR radiation + Cratylus <admin> ya i know + Cratylus <admin> go get him + Hermogenes <admin> he left + Cratylus <admin> FUCK + Hermogenes <admin> and like i need MORE people on my case + Cratylus <admin> seriously dude yer not getting it + Hermogenes <admin> OR, like i need a coworker gettin into nan argument with you + Hermogenes <admin> OH MY GOSH! + Cratylus <admin> for some reason yer unable to separate heat from infrared radiation + <admin> Hermogenes aGREES with you! + <admin> Hermogenes is NOT gettin it! + Cratylus <admin> for some reason yer unable to separate heat from infrared radiation + Hermogenes <admin> im sorry, man,i really am + Cratylus <admin> its like saying that because an airplane is flying, it IS flight + Hermogenes <admin> its just one of those cases... + Hermogenes <admin> where the one gear is not in place + Cratylus <admin> I'LL say + Hermogenes <admin> that ONE little 8-tooth gear has slipped + Cratylus <admin> well id like to state for the record that i dont think this is some subtle semantic difference + Cratylus <admin> this is aa fundamental difference in types of energy and radiation + Cratylus <admin> but we can come back to it later + Hermogenes <admin> your statement has been entered into the almighty records of whosrighteedness + Cratylus <admin> ehehehehehe + Hermogenes <admin> so, its been snowing up tehre? + Cratylus <admin> very briefly + Cratylus <admin> none left on the round + Try "help index" for a list of command types. + Hermogenes <admin> we havent gotten ANYthing + Cratylus <admin> musta got it + Cratylus <admin> the HEAT RADIATION musta got it, that is + Hermogenes <admin> its sposed to get up in th 50s morrow + Hermogenes <admin> NOOOOOOO!!!!! + Cratylus <admin> oooohhhhh wait aa minute + Hermogenes <admin> im seriously miffed bout this whole heat thing, btw + Hermogenes <admin> wha + Cratylus <admin> i get it now + Hermogenes <admin> do i wanna know? + Cratylus <admin> i think i see how youre looking at it + Cratylus <admin> maybe + Hermogenes <admin> very well could be + Cratylus <admin> ok + Hermogenes <admin> ive looked at things "wrong" before... + Cratylus <admin> tell me if this is what yer thinking: + Hermogenes <admin> k + Cratylus <admin> when heat causes radiation, thats "heat radiation" + Hermogenes <admin> mmmm.... + Cratylus <admin> ok maybe not + Cratylus <admin> worth aa try + Hermogenes <admin> when an object is "energized" enough, it begins to radiate in the iR portion of the em spectrum + Cratylus <admin> yeah + Cratylus <admin> and thats what u mean by "heat radiation"? + Hermogenes <admin> energized usually means addding heat or electricity or SOMEthing to it + <admin> Cratylus nods. + Hermogenes <admin> well... + Hermogenes <admin> the IR radiation brought on is then perceived by our senses as "heat" + Cratylus <admin> ok + Cratylus <admin> do u mind if i drag this on aa bit longer? + Hermogenes <admin> if more energy is added, it then begins to transmit in the visible portion of the em spectrum, and we perceive this as ''light' + Cratylus <admin> i really am interested in understanding our difference here + Hermogenes <admin> as am i + Cratylus <admin> see, i dont think that the IR radiation heats up other things all that much + Hermogenes <admin> actually, + Cratylus <admin> when i put my hand up to aa light bulb, and its hot, + Cratylus <admin> i dont think its because of IR, although some IR is present + Hermogenes <admin> scientist dude sed that IR ardiation is actually quite effective in heating up stuff + Hermogenes <admin> heh, ardiation + Cratylus <admin> ok, but just bear with me aa moment + <admin> Hermogenes bears + Cratylus <admin> lets assume, for the pure sake of argument, that IR radiation does not exist + Hermogenes <admin> heh, sake of argument + Hermogenes <admin> ok, go on + Cratylus <admin> IF there is not IR radiation, could you still warm yourself by the fire? + Hermogenes <admin> uhhh.. yes + Cratylus <admin> by what process? + Hermogenes <admin> ummmm + Hermogenes <admin> light? + Cratylus <admin> no + Cratylus <admin> heat radiation + Cratylus <admin> see i think this is where we went in diff directions + Cratylus <admin> your brain is bent on seeing the word "radiation" in terms of particles or wavelengths + Hermogenes <admin> or, the act of transmitting particles or wavelenghths or whatever + Cratylus <admin> in the context of convection and conductance, this approach to the word "radiation" is not fruitful + Cratylus <admin> thats where we are having aa communication breakdown + Cratylus <admin> again for the sake of argument, lets assume there is no electromagnetic or particle radiation + <admin> Hermogenes likes wavelenghths n particles n stuff... + Cratylus <admin> again for the sake of argument, lets assume there is no electromagnetic or particle radiation + Hermogenes <admin> whata a dismal world + Cratylus <admin> the fireplace is radiating heat + Cratylus <admin> heat comes from it, hence, it "radiates heat" + Cratylus <admin> this is "heat radiation" + Hermogenes <admin> hmmm + Hermogenes <admin> in a loose definition, ok + Cratylus <admin> no + <admin> Hermogenes gasps in shock! + Cratylus <admin> that is not aa loose definition + Cratylus <admin> that is the definition of the word radiate + Cratylus <admin> "to radiate" + Hermogenes <admin> wait, is THAT all there is to "heat transferrence by radiation"? + Cratylus <admin> YESSSSSSS + Cratylus <admin> EXACTLY + Hermogenes <admin> heat comes from it, hence, it "radiates heat" + Hermogenes <admin> heat comes from it, hence, it "radiates heat" + Hermogenes <admin> heat comes from it, hence, it "radiates heat" + Hermogenes <admin> hmmmmm + Hermogenes <admin> ok + <admin> Hermogenes can accept that + Cratylus <admin> ok back to our dismal theoretical world + Hermogenes <admin> wait + Cratylus <admin> which contains no particle or em radiation + Hermogenes <admin> i thought we were done? + Cratylus <admin> oh + Cratylus <admin> ok + Cratylus <admin> so u see my point? + Hermogenes <admin> mmmm, sorta + Cratylus <admin> then we are not donme + Hermogenes <admin> i was making it way too more complicated than it needed to be? + Cratylus <admin> you were on aa different train track altogether + Hermogenes <admin> i was on one of those hovertrains + Hermogenes <admin> on magnetic rails + Cratylus <admin> btw the fireplace does not radiate heat through "light" + Hermogenes <admin> it dont? + Cratylus <admin> it radiates heat by contact with molecules which transmit the heat in the form of kinetic energy + Hermogenes <admin> howcome a black shirt gets hotter than a white shirt, then? + Cratylus <admin> in front of aa fire? + Cratylus <admin> ive never noticed any such thing + Cratylus <admin> in the sun, yeah sure + Hermogenes <admin> but i thought we already established that molecules dont HAFT bounce off eachother to transfer heat? + Hermogenes <admin> hmmm + <admin> Cratylus falls to the floor. + Hermogenes <admin> so, you think a black tshort and a white tshirt in a non-sun light source would not heat differntly? + Cratylus <admin> in front of aa fireplace, i dont think there would be aa noticeable differennce + Hermogenes <admin> im not tryin to argue, im tryin to follow a tangential tracxk for a sec + Cratylus <admin> i think with delicate instruments u WOULD detect aa diff + Hermogenes <admin> NOTCEABLE + Cratylus <admin> this is actually right on track dude + Cratylus <admin> i think with delicate instruments u WOULD detect aa diff + Hermogenes <admin> OH, suddenly im allowed to play on YOUR traintrack? + Hermogenes <admin> :) + Cratylus <admin> because IR radiation DOES in fact play aa role here + Cratylus <admin> but it is not as substantial as the brownian motion + Hermogenes <admin> uh uhuhuhu uuhuh + Hermogenes <admin> sorry + Cratylus <admin> this must be aa way-homer + Hermogenes <admin> a 'way-homer'? + Cratylus <admin> you'll get it on the way home + Hermogenes <admin> heh + Hermogenes <admin> is it really that much fun to argue with me? + Hermogenes <admin> or is it really a chore + Cratylus <admin> im honestly mystified by this + Hermogenes <admin> as am i + Cratylus <admin> i mean, im like...FASCINATED + Hermogenes <admin> and i wasnt asking sarcsatically or rhetorically + Cratylus <admin> this is such aa weird miscommunication + Hermogenes <admin> if it was fun to argue at me + Cratylus <admin> i dint mean it sarcastically + <admin> Hermogenes nods solemnly. + Cratylus <admin> im totally dead serious + Cratylus <admin> dead sexy, too + Hermogenes <admin> didnt think you WERE being scarcastic + Hermogenes <admin> ugh + Cratylus <admin> heh + Hermogenes <admin> just watched that last night + Cratylus <admin> man he is VILE + Hermogenes <admin> 'e leuks leyek a lit'l BEHbee + Hermogenes <admin> oye ET a behbee wunce + Hermogenes <admin> oye sed, OYEM th TOP a th fewd chayn!" + Hermogenes <admin> GET! EN! MAH! BELLY! + Cratylus <admin> ok hang on aa sec dont say anything for aa minute, ok? + Cratylus <admin> ok thx + <admin> Hermogenes nods solemnly. + Hermogenes <admin> you ok there? + Cratylus <admin> ya i had to copy and paste this round + Hermogenes <admin> or... am i still not spossed to be sayin anything still? + Hermogenes <admin> heh + Cratylus <admin> this is just too crazy not to save for posterity + <admin> Hermogenes hopes he wont regret his conversation, but think he probably will + Cratylus <admin> heheh yes you definitely will + Cratylus <admin> well i HOPE you will + Hermogenes <admin> ill probably wind up being WRONG th whole time and lookin like an IDIOT fer it + Cratylus <admin> i hope yer gonna slap yer forehead and go HOLY FUCKING DUH! + Hermogenes <admin> see, th thing is... + Hermogenes <admin> its kinda hard to be wrong about something you dont know what yer talkin about in th FIRST place + Cratylus <admin> i guess + Cratylus <admin> ok + Cratylus <admin> i touch aa stove + Cratylus <admin> coalburning stove. black iron + Hermogenes <admin> like, some 5th grade makin assertions about calculus + Cratylus <admin> i put my hand right ON it + Hermogenes <admin> ya? + Cratylus <admin> my fickin hand is sizzlin n stuff, right + Cratylus <admin> this is happening not because of IR + <admin> Hermogenes nods solemnly. + Hermogenes <admin> but because of.... + Cratylus <admin> see, if it was infrered radiation doin this, then why isnt the whole room in flames? + Cratylus <admin> why is it limited to RIGHT AT the stive? + Hermogenes <admin> uh... + Hermogenes <admin> dissipation? + Cratylus <admin> explain dissipation please + Hermogenes <admin> theres so much ari movin roun n stuff, the averagew molecular kinetic energy (motion) can be...uh...averaged out + Hermogenes <admin> over a wider area + Hermogenes <admin> n stuff + Hermogenes <admin> like, the inverse-squared law or something + Hermogenes <admin> YEAH, THATS it + Cratylus <admin> ok...so u agree its not infrared energy? + Hermogenes <admin> burning yer hand? + Cratylus <admin> right + Hermogenes <admin> its... + Hermogenes <admin> the convection of hot air molecules againts yer skin + Cratylus <admin> well, hot STOVE molecules, and it isnt "convection" + Hermogenes <admin> oooOOOOo + Hermogenes <admin> why NOT, mister fancee panse? + Cratylus <admin> whats happening is the surface of the stove is transferring heat to my hand + Hermogenes <admin> right + Cratylus <admin> the mechanics of this heat transfer is simple molecular contact + Hermogenes <admin> ok, its either the conduction of heat between the solid of the stove into te solid of yer hand... + Cratylus <admin> the stove molecules are moving real fast + Hermogenes <admin> ok, now wait + Cratylus <admin> and they make my hand molecules move real fast + Hermogenes <admin> so, theres MORE than JUST 3 ways of transferring heat? + Cratylus <admin> no + Hermogenes <admin> like in th xflies! + Cratylus <admin> do u agree with me so far? + Hermogenes <admin> so, tehre are JUST 3 ways? + Cratylus <admin> do u agree with me so far? + Hermogenes <admin> mostly, yah + Cratylus <admin> ok, what part do u disagree with? + Hermogenes <admin> hol on a sec... + Cratylus <admin> and get aa fucking scientist in here NOW + Hermogenes <admin> no, i had to TEND to work stuff + Hermogenes <admin> ya big meanie + Cratylus <admin> well if u see on, grab him + Cratylus <admin> or her + Hermogenes <admin> i wasnt goin off to find a scientist dude to be on my sdide or nuttin + Cratylus <admin> ok so what part did u not agree with? + Hermogenes <admin> grab her? + Cratylus <admin> ok so what part did u not agree with? + Hermogenes <admin> ok, but only cause you insisted... + Hermogenes <admin> i guess i just wanna establish that theres X ways of heat transferrance, and any examples involving heat transferrence would be put into one or more of these X categories + Cratylus <admin> ok well fuck the 3 categories + Cratylus <admin> do you agree or disagree with my statements? + Hermogenes <admin> YEAH + Hermogenes <admin> POWER TO THE PEOPLE! + Cratylus <admin> dude + Hermogenes <admin> fine + Hermogenes <admin> stove molecules, movin hand molecules + Cratylus <admin> right + Hermogenes <admin> i tells you what my FOOT molecules gunan be movin in a SECOND! + Cratylus <admin> now, if instead of touching the stove, i had held my had within half aa centimeter, it would scald but not burn. right? + Hermogenes <admin> whats the diff? + Hermogenes <admin> its gonna get hot + Cratylus <admin> it would take longer for my hand to be damaged and it wouldnt be black + Hermogenes <admin> scald, burn, sear, fry, etc + Hermogenes <admin> ok, agreed + Cratylus <admin> ok the first example was conductance + Hermogenes <admin> as long as yer not actually TOUCHING it + Hermogenes <admin> ok, 1st = conductance + Cratylus <admin> the second example was radiation + Hermogenes <admin> (with a wee bit of convection) + Hermogenes <admin> hmmmm + Cratylus <admin> with aa little convection but thats not important i guess + Cratylus <admin> heh ya + Hermogenes <admin> second isnt convection? + Cratylus <admin> no + Hermogenes <admin> sounds likeit... + Cratylus <admin> its primarily radiation + Cratylus <admin> because the stove is heating the air molecules + Cratylus <admin> and the air molecules are heating my hand + Cratylus <admin> the heat is being radiated from the surface of the stove, through the air, into my hand + Hermogenes <admin> but... + Cratylus <admin> wait + Cratylus <admin> IR is bad for your eyes right? + Hermogenes <admin> uh... + Hermogenes <admin> is it? + Cratylus <admin> hmmm maybe that uv + Cratylus <admin> ok never mind + Hermogenes <admin> uv, yes, deinately + Cratylus <admin> ok now + Hermogenes <admin> wait + Hermogenes <admin> lemme say why i think its convection + Cratylus <admin> in ADDITION to this molecular heat transfer + Cratylus <admin> no + Cratylus <admin> im sorry + Cratylus <admin> thats irrelevant and aa tangent + <admin> Hermogenes frowns. + Hermogenes <admin> ok, go on + Cratylus <admin> in ADDITION to this molecular heat transfer + Hermogenes <admin> you n yer up-arrow keys... + Cratylus <admin> there is ALSO infrared radiation from the stove + Cratylus <admin> but it is NOT the infrared radiation that burns my hand + Cratylus <admin> it is the direct molecular contact with rapidly moving molecules + Hermogenes <admin> cause the IR stuff aint got enough energy to do it, and its the molecular transferrence stuff thats burning it? + Cratylus <admin> exactly + Cratylus <admin> do you agree? + Hermogenes <admin> im not too sure that IR is all THAT low-level energy-wise, but ok... + Cratylus <admin> so now lets put that stove in outer space + Hermogenes <admin> outher... SPAAAAAACE + Cratylus <admin> (with its own fuel and oxy) + Hermogenes <admin> (of course) + Cratylus <admin> and im out there with the stove + Cratylus <admin> and i put my hand .5 centimeters from it + Hermogenes <admin> (with suit and air supply) + Cratylus <admin> will my hand be damaged? + Hermogenes <admin> um... + Cratylus <admin> bare hand + Hermogenes <admin> uh... + Hermogenes <admin> maybe? + Cratylus <admin> no + Hermogenes <admin> no + Cratylus <admin> i think its possible the stove may shed molecules + Hermogenes <admin> cause the molecules cant transfer the heat as efficiently or quickly + Cratylus <admin> these molecules might hit some of my hand molecules, but not enough to do damage + Cratylus <admin> negatron + Hermogenes <admin> cause theres a near-vaccuum enviroment + Cratylus <admin> they CAN transfer it efficiently and quickly + Hermogenes <admin> oh + Cratylus <admin> if i TOUCH them + Hermogenes <admin> BAD molecules + Cratylus <admin> if i touch the stove, will my hand be damaged? + Hermogenes <admin> yes + Cratylus <admin> right + Hermogenes <admin> BAD stove! + Cratylus <admin> ok, so in aa vacuum, i have to touch the stove to get burned, right? + Hermogenes <admin> PROBably + Cratylus <admin> oK then + Cratylus <admin> that is precisely my point + Cratylus <admin> the stove does not produce sufficient IR radiation to make any noticeable diff to my hand + Hermogenes <admin> k... + Cratylus <admin> only when there is molecule to molecule contact, can the stove do real temp change + Cratylus <admin> therefore, while the stove radiates infrared waves + Cratylus <admin> it does not radiate heat + Hermogenes <admin> funkay + Cratylus <admin> yer supposed to hear trumpets and flights of angels as the truth rolls in from the sky + Hermogenes <admin> just cause i accept it, dont mean i understand it... + Hermogenes <admin> not to bee TOO bog of a pain in th ass + Hermogenes <admin> big, even + Cratylus <admin> you WILL young hermogenes. oh yes. you WILL. + Hellmonger@Trilogy <intergossip> anybody ever fuck with doing Sun consoles on an oldsk00l portmaster 2? + Hermogenes <admin> my BRAIN hurts + Cratylus <admin> sorry + + + diff -c -r --new-file ds1.1/lib/domains/town/txt/spam.txt ds2.0r27/lib/domains/town/txt/spam.txt *** ds1.1/lib/domains/town/txt/spam.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/txt/spam.txt Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,22 ---- + + ========================================== + | ,dP""8a "888888b, d8b "888b ,888" | + | 88b " 888 d88 dPY8b 88Y8b,8888 | + | `"Y8888a 888ad8P'dPaaY8b 88 Y88P888 | + | a, Y88 888 dP Y8b 88 YP 888 | + | `"8ad8P'a888a a88a;*a888aa88a a888a | + | ;*;;;;*;;;*;;;*,, | + | _,---'':::';*;;;*;;;*;;*d;, | + | .-' ::::::::::';*;;*;dII; | + | .' ,<<<,. :::::::::::::::ffffff`. | + | / ,<<<<<<<<,::::::::::::::::fffffI,\ | + | .,<<<<<<<<<<I;:::::::::::::::ffffKIP", | + | |<<<<<<<<<<dP;,?>;,::::::::::fffKKIP | | + | ``<<<<<<<dP;;;;;\>>>>>;,::::fffKKIPf ' | + | \ `mYMMV?;;;;;;;\>>>>>>>>>,YIIPP"` / | + | `. "":;;;;;;;;;i>>>>>>>>>>>>>, ,' | + | `-._``":;;;sP'`"?>>>>>=========. | + | `---..._______...|<[Hormel | | + | `=========' | + ========================================== + diff -c -r --new-file ds1.1/lib/domains/town/txt/warning_sign.txt ds2.0r27/lib/domains/town/txt/warning_sign.txt *** ds1.1/lib/domains/town/txt/warning_sign.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/txt/warning_sign.txt Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,16 ---- + WARNING! + + This area is Ylsrim. It is part of the old, + broken version of Dead Souls. It has been mostly unbroken, + so that for example the desert and bank roof work properly. + + However, you will note obvious differences in design + between Ylsrim and the main sample town. Remember, neither + Ylsrim nor the town are intended to *be* a mud. + They are only examples of places and things that you can + examine to guide you in building your own mud. + + Whatever bugs you find in Ylsrim, therefore, are not + going to be fixed. Consider it a museum piece, a mud + area like a prehistoric insect caught in amber: perfect + in its imperfection, sublime in its permanence. diff -c -r --new-file ds1.1/lib/domains/town/virtual/forest.c ds2.0r27/lib/domains/town/virtual/forest.c *** ds1.1/lib/domains/town/virtual/forest.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/virtual/forest.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,199 ---- + #include <lib.h> + #include <dirs.h> + #include <virtual.h> + #define __DIR__ "/domains/town/virtual/" + + inherit LIB_VIRT_LAND; + + static private int XPosition, YPosition; + + varargs void SetLongAndItems(int x, int y, int z); + + int LimitTravel(int requested, int maximum){ + if(requested > maximum) return maximum; + if(requested < 0 ) return 0; + else return requested; + } + + varargs static void create(int x, int y) { + string n, s, e, w; + string ne, nw, se, sw; + + int max_north = 25; + int max_south = 1; + int max_east = 25; + int max_west = 1; + + SetNoReplace(1); + virt_land::create(); + XPosition = x; + YPosition = y; + SetClimate("temperate"); + SetAmbientLight(30); + SetLongAndItems(x, y); + SetShort("a thick forest"); + if( x == max_east ) e = "forest/" + (x) + "," + y; + else e = "forest/" + (x+1) + "," + y; + if( x == max_west ) w = "forest/" + (x) + "," + y; + else w = "forest/" + (x-1) + "," + y; + if( y == max_north ) n = "forest/" + x + "," + (y); + else n = "forest/" + x + "," + (y+1); + if( y == max_south ) s = "forest/" + x+ "," + (y); + else s = "forest/" + x + "," + (y-1); + + nw = "forest/" + LimitTravel(x - 1, max_east) + "," + LimitTravel(y+1, max_north); + ne = "forest/" + LimitTravel(x + 1, max_east) + "," + LimitTravel(y+1, max_north); + sw = "forest/" + LimitTravel(x - 1, max_east) + "," + LimitTravel(y-1, max_north); + se = "forest/" + LimitTravel(x + 1, max_east) + "," + LimitTravel(y-1, max_north); + + SetGoMessage("You can't travel in that direction."); + if( n ) AddExit("north", __DIR__ + n); + if( s ) AddExit("south", __DIR__ + s); + if( e ) AddExit("east", __DIR__ + e); + if( w ) AddExit("west", __DIR__ + w); + if( ne ) AddExit("northeast", __DIR__ + ne); + if( nw ) AddExit("northwest", __DIR__ + nw); + if( se ) AddExit("southeast", __DIR__ + se); + if( sw ) AddExit("southwest", __DIR__ + sw); + + if(x == 24 && y == 1){ + RemoveExit("south"); + AddExit("south","/domains/town/room/forest_path1"); + } + else if(y == 1){ + RemoveExit("south"); + RemoveExit("southeast"); + RemoveExit("southwest"); + } + if(x == 24 && y == 25){ + RemoveExit("north"); + AddExit("north","/domains/town/room/cave_entrance"); + } + else if(y == 25){ + RemoveExit("north"); + RemoveExit("northeast"); + RemoveExit("northwest"); + } + if(x == 1){ + RemoveExit("west"); + RemoveExit("northwest"); + RemoveExit("southwest"); + } + if(x == 25){ + RemoveExit("east"); + RemoveExit("northeast"); + RemoveExit("southeast"); + } + + + } + + varargs void SetLongAndItems(int x, int y, int z) { + mapping inv, items; + string str; + ::SetLongAndItems(x, y, z); + + inv = ([]); + str = "You are in a vast forest. The trees and " + "thick vegetation press in from all sides, appearing almost " + "threatening. " + "No path marks your way. "; + if(query_night()) str += "The stars of the night sky " + "are barely visible through the heavy forest canopy overhead."; + else str+= "Sunlight penetrates the tree cover with great " + "difficulty, rendering the forest cool and dark."; + if(x == 25) str+= " Travel east is made impossible by a river " + "rushing north to south here. On the other side of the river " + "a great slope rises, and it appears that on top of it is " + "a road that leads north to a high plateau."; + if(y == 25) str+= " A steep cliff rises north of here, making " + "travel north into the mountains impossible."; + if(x == 1) str += " The forest is impassably thick to the west."; + if(y == 1) str += " The forest is impassably thick southward."; + if(x == 24 && y == 1) str += "\n%^GREEN%^There is a sign here you can read.%^RESET%^"; + if(x == 24 && y == 25) str += "\n%^GREEN%^There is a cave entrance in the cliff wall.%^RESET%^"; + SetItems( ([ "forest" : "It is so vast.", + ({"woods","trees","vegetation","plants"}) : "Thick, foreboding and " + "oppressive, these seem to add to an air of danger and claustrophobia.", + "no path" : "You observe the presence of its absence.", + ({"mountain","mountains"}): "The snow capped peaks of the great " + "northern range are faintly visible from here.", + "cliff" : "To the north, a high cliff rises from the forest.", + ({"canopy","forest canopy","heavy forest canopy"}) : "The great " + "branches and heavy leaves of the trees here form the forest " + "canopy, almost a ceiling through which little light can pass.", + ]) ); + if(y == 25) { + AddItem( ({ "river", "stream", "great river"}), + "This narrow but powerful river presents an insurmountable " + "obstacle to further travel east." ); + AddItem( ({ "slope","road","plateau"}), "Looks like that's " + "Fort Road, high on a slope and running north to the Fortress " + "on the Frontiers."); + } + if(x == 24 && y == 25) { + AddItem(({"cave","opening","entrance","cave entrance"}) , + "This is a rather scary looking opening in the cliff wall, leading " + "north into the ground."); + AddEnter("cave","/domains/town/room/cave_entrance"); + } + + if(x == 24 && y == 1) { + AddItem("sign" , "This is a hastily-lettered sign planted on the ground."); + SetRead( ({"sign"}) , "Beware th"); + } + if( !random(50) ) { + str += " Burnt wood, scattered rocks and twigs, and other signs " + "of an abandoned camp site are scattered about."; + AddItem( ({ "twigs", "sticks", "kindling", "wood", "burnt wood" }) , + "Though long since burnt to nothing, scattered kindling " + "and burnt wood lie about as a memory of travellers who have " + "passed through"); + if( random(2) ) { + string thing; + + foreach(thing in ({ "twigs", "sticks", "kindling", "wood" })) + SetSearch(thing, function(object who, string str) { + object ob; + string thing2; + + if( !(ob = new("/domains/Ylsrim"+ "/etc/pole")) ) + return 0; + who->eventPrint("You find a fishing pole!"); + eventPrint((string)who->GetName() + " finds a fishing pole " + "among the abandoned campsite.", who); + foreach(thing2 in ({ "twigs", "sticks", "kindling", "wood"})) + RemoveSearch(thing2); + if( !((int)ob->eventMove(this_player())) ) { + who->eventPrint("You drop the pole!"); + eventPrint((string)who->GetName() + " drops the pole.", + who); + ob->eventMove(this_object()); + } + return; + }); + } + } + else if( !random(10) ) + SetSmell("default", "You smell a distant camp fire."); + if( !random(25) ) + inv["/domains/town/npc/forest_orc"] = random(3); + if( !random(45) ) + inv["/domains/town/npc/bear"] = 1; + if( !random(15) ) + inv["/domains/town/npc/deer"] = 1; + if( !random(65) ) + inv["/domains/town/npc/gecko"] = 1; + if( !random(35) ) + inv["/domains/town/npc/newt"] = 1; + if( !random(75) ) + inv["/domains/town/npc/spider"] = 1; + + else if( !random(14) ) + SetListen("default", "You hear voices in the distance."); + //if(x == 24 && y == 1) inv["/domains/town/obj/sign"] = 1; + SetLong(str); + SetDayLight(25); + SetNightLight(0); + SetInventory(inv); + } diff -c -r --new-file ds1.1/lib/domains/town/virtual/forest_map ds2.0r27/lib/domains/town/virtual/forest_map *** ds1.1/lib/domains/town/virtual/forest_map Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/virtual/forest_map Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,30 ---- + #include <lib.h> + #include <dirs.h> + #include <virtual.h> + + inherit LIB_VIRT_MAP; + + varargs string array BaseMap(){ //override with actual map + return + ({ + // 0 + // 01234 + ({"00000",//0 + "01000",//1 + "00000",//2 + "00000",//3 + "00000",//4 + }) + }); + + } + + + varargs static void create() { + ::create(); + //SetNoClean(1); + //SetVirtFile(base_name(this_object())); + //AddLocation("foo", ({2,2,0}) ); + } + + diff -c -r --new-file ds1.1/lib/domains/town/virtual/server.c ds2.0r27/lib/domains/town/virtual/server.c *** ds1.1/lib/domains/town/virtual/server.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/virtual/server.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,16 ---- + + #define __DIR__ "/domains/town/virtual/" + + mixed compile_object(string file) { + string *path; + object ob; + int x, y; + + //if( previous_object() != master() ) return 0; + path = explode(file, "/"); + //if( sizeof(path) != 5 ) return "Wrong size path"; + if( file_size(__DIR__ + path[3] + ".c") < 1 ) return "bad file"; + if( sscanf(path[4], "%d,%d", x, y) != 2 ) return "missing comma"; + if( !(ob = new(__DIR__ + path[3], x, y)) ) return "failed to compile"; + return ob; + } diff -c -r --new-file ds1.1/lib/domains/town/weap/9mil.c ds2.0r27/lib/domains/town/weap/9mil.c *** ds1.1/lib/domains/town/weap/9mil.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/weap/9mil.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_PISTOL; + void create(){ + ::create(); + SetKeyName("gun"); + SetId(({"gun","pistol"})); + SetAdjectives(({"9mm","automatic","9 millimeter","semiautomatic"})); + SetShort("a 9 millimeter semiautomatic pistol"); + SetLong("This is a large, semiautomatic pistol that fires 9mm rounds. It is "+ + "a heavy, serious-looking weapon."); + SetMillimeter(9); + SetPistolType("auto"); + SetAmmoType("acp"); + SetMass(30); + SetBaseCost("silver",900); + SetVendorType(VT_WEAPON); + } diff -c -r --new-file ds1.1/lib/domains/town/weap/9mmpistol_mp.c ds2.0r27/lib/domains/town/weap/9mmpistol_mp.c *** ds1.1/lib/domains/town/weap/9mmpistol_mp.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/weap/9mmpistol_mp.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,39 ---- + #include <lib.h> + #include <vendor_types.h> + inherit "/lib/pistol"; + int AddClip(); + void CheckMP(); + void create(){ + pistol::create(); + SetKeyName("gun"); + SetId(({"gun","pistol"})); + SetAdjectives(({"9mm","automatic","9 millimeter","semiautomatic"})); + SetShort("a 9 millimeter semiautomatic pistol"); + SetLong("This is a large, semiautomatic pistol that fires 9mm rounds. It is "+ + "a heavy, serious-looking weapon."); + SetMillimeter(9); + SetPistolType("auto"); + SetAmmoType("acp"); + SetMass(30); + SetBaseCost("silver",3000); + SetVendorType(VT_WEAPON); + } + + void init() { + pistol::init(); + CheckMP(); + } + + int AddClip(){ + new("/domains/town/obj/9mmclip")->eventMove(this_object()); + return 1; + } + + void CheckMP(){ + if(base_name(environment(this_object())) == "/domains/town/npc/mp"){ + AddClip(); + SetLoaded(1); + SetAmmo(15); + SetMag(1); + } + } diff -c -r --new-file ds1.1/lib/domains/town/weap/axe.c ds2.0r27/lib/domains/town/weap/axe.c *** ds1.1/lib/domains/town/weap/axe.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/weap/axe.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + + static void create() { + item::create(); + SetKeyName("sharp axe"); + SetId( ({ "axe"})); + SetAdjectives( ({ "sharp","small","hand"})); + SetShort("a hand axe"); + SetLong("A small, sharp hand axe, suitable for close combat."); + SetMass(150); + SetBaseCost("silver",50); + SetVendorType(VT_WEAPON); + SetClass(15); + SetDamageType(BLADE); + SetWeaponType("blade"); + } diff -c -r --new-file ds1.1/lib/domains/town/weap/board.c ds2.0r27/lib/domains/town/weap/board.c *** ds1.1/lib/domains/town/weap/board.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/weap/board.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,22 ---- + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + + static void create() { + item::create(); + SetKeyName("board of ed"); + SetId(({"board","board of ed","board of education"})); + SetAdjectives(({"ed","education"})); + SetShort("the board of education"); + SetLong("A long, wide wooden board with a handle at one "+ + "end. Inscribed along its length are the words: "+ + "'Board of Education'."); + SetMass(50); + SetBaseCost("silver",20); + SetVendorType(VT_WEAPON); + SetClass(20); + SetDamageType(BLUNT); + SetWeaponType("blunt"); + } diff -c -r --new-file ds1.1/lib/domains/town/weap/brush.c ds2.0r27/lib/domains/town/weap/brush.c *** ds1.1/lib/domains/town/weap/brush.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/weap/brush.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,25 ---- + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + + static void create(){ + item::create(); + SetKeyName("brush"); + SetId( ({ "brush" }) ); + SetAdjectives( ({ "bath","shower","wood","wooden" }) ); + SetShort("a shower brush"); + SetLong("This is a long wooden brush with soft bristles "+ + "at the end, designed to assist in reaching "+ + "tough-to-scrub areas while bathing."); + SetVendorType(VT_WEAPON); + SetClass(10); + SetBaseCost("silver",25); + SetMass(100); + SetWeaponType("blunt"); + SetDamageType(BLUNT); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/weap/butcher_knife.c ds2.0r27/lib/domains/town/weap/butcher_knife.c *** ds1.1/lib/domains/town/weap/butcher_knife.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/weap/butcher_knife.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,26 ---- + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + + static void create() { + item::create(); + SetKeyName("butcher knife"); + SetId( ({ "knife"})); + SetAdjectives( ({ "sharp","razor sharp","steel","hefty","stainless","butcher"})); + SetShort("an 8-inch butcher knife"); + SetLong("This is an 8-inch butcher knife. This razor sharp knife has been forged from molded and hammered high-carbon stainless steel. It is solid, hefty, and well-balanced."); + SetMass(50); + SetBaseCost("silver",95); + SetVendorType(VT_WEAPON); + SetClass(20); + SetDamageType(BLADE); + SetWeaponType("knife"); + } + int GetFancy(){ + return 1; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/weap/carving_knife.c ds2.0r27/lib/domains/town/weap/carving_knife.c *** ds1.1/lib/domains/town/weap/carving_knife.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/weap/carving_knife.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,30 ---- + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + + static void create() { + item::create(); + SetKeyName("carving knife"); + SetAdjectives( ({"8-inch", "serrated", "sharp", "razor-sharp", "razor", "steel", "hefty", "stainless", "carving"}) ); + SetId( ({ "knife"})); + SetShort("a serrated 8-inch carving knife"); + SetLong("This is a serrated, 8-inch carving knife. This razor sharp "+ + "knife has been forged from molded and hammered high-carbon "+ + "stainless steel. It is solid, hefty, and well-balanced. "+ + "This is a dangerous knife, and can be considered a very "+ + "deadly weapon."); + SetMass(50); + SetBaseCost("silver",120); + SetVendorType(VT_WEAPON); + SetClass(30); + SetDamageType(BLADE); + SetWeaponType("knife"); + } + int GetFancy(){ + return 1; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/weap/cue.c ds2.0r27/lib/domains/town/weap/cue.c *** ds1.1/lib/domains/town/weap/cue.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/weap/cue.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,26 ---- + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + + static void create(){ + item::create(); + SetKeyName("cue"); + SetId( ({ "stick", "pole" }) ); + SetAdjectives( ({ "wood","wooden", "pool", "billiards", "billiard"}) ); + SetShort("a billiards cue"); + SetLong("This is a long stick of highly polished wood, used " + "in the game of billiards."); + SetVendorType(VT_WEAPON); + SetDamagePoints(50); + SetClass(10); + SetBaseCost("silver",150); + SetMass(80); + SetWeaponType("blunt"); + SetHands(2); + SetDamageType(BLUNT); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/weap/dagger.c ds2.0r27/lib/domains/town/weap/dagger.c *** ds1.1/lib/domains/town/weap/dagger.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/weap/dagger.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + + static void create() { + item::create(); + SetKeyName("sharp dagger"); + SetId( ({ "dagger"})); + SetAdjectives( ({ "sharp","fine","wicked","wicked-looking"})); + SetShort("a wicked-looking dagger"); + SetLong("A sharp, wicked dagger."); + SetMass(150); + SetBaseCost("silver",50); + SetVendorType(VT_WEAPON); + SetClass(10); + SetDamageType(BLADE); + SetWeaponType("knife"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/weap/gstaff.c ds2.0r27/lib/domains/town/weap/gstaff.c *** ds1.1/lib/domains/town/weap/gstaff.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/weap/gstaff.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + static void create(){ + item::create(); + SetKeyName("golden staff"); + SetId( ({ "staff" }) ); + SetAdjectives( ({ "golden" }) ); + SetShort("a golden staff"); + SetLong("This is a thick staff, with one end covered in "+ + "a golden metal."); + SetVendorType(VT_WEAPON); + SetClass(10); + SetBaseCost("silver",800); + SetMass(100); + SetWeaponType("blunt"); + SetDamageType(BLUNT); + } diff -c -r --new-file ds1.1/lib/domains/town/weap/knife.c ds2.0r27/lib/domains/town/weap/knife.c *** ds1.1/lib/domains/town/weap/knife.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/weap/knife.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + + static void create() { + item::create(); + SetKeyName("small knife"); + SetId( ({ "knife"})); + SetAdjectives( ({ "small","fine"})); + SetShort("a small knife"); + SetLong("A knife."); + SetMass(50); + SetBaseCost("silver",5); + SetVendorType(VT_WEAPON); + SetClass(5); + SetDamageType(BLADE); + SetWeaponType("blade"); + } diff -c -r --new-file ds1.1/lib/domains/town/weap/leostaff.c ds2.0r27/lib/domains/town/weap/leostaff.c *** ds1.1/lib/domains/town/weap/leostaff.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/weap/leostaff.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + static void create(){ + item::create(); + SetKeyName("staff"); + SetId( ({ "staff", "stick", "pole" }) ); + SetAdjectives( ({ "wood","wooden","strong","heavy","thick","sturdy","solid" }) ); + SetShort("a large wooden staff"); + SetLong("This staff is thick, strong, "+ + "and heavy. It feels like a sturdy "+ + "and solid weapon."); + SetVendorType(VT_WEAPON); + SetDamagePoints(50); + SetClass(500); + SetBaseCost("silver",25000); + SetMass(700); + SetWeaponType("blunt"); + SetHands(2); + SetDamageType(BLUNT); + } diff -c -r --new-file ds1.1/lib/domains/town/weap/orcslayer.c ds2.0r27/lib/domains/town/weap/orcslayer.c *** ds1.1/lib/domains/town/weap/orcslayer.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/weap/orcslayer.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,35 ---- + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + inherit LIB_READ; + + static void create() { + item::create(); + SetKeyName("Orc Slayer"); + SetId( ({ "orcslayer", "orc slayer","sword", "short sword", "shortsword"})); + SetAdjectives( ({ "crafted","finely crafted","short","sharp","fine"})); + SetShort("a finely crafted short sword"); + SetLong("This is a very fine blade, overed with ancient runes. Engraved on it is a picture of the sword slicing an orc."); + SetMass(300); + SetBaseCost("silver",500); + SetVendorType(VT_WEAPON); + SetClass(150); + SetDamageType(BLADE); + SetWeaponType("blade"); + SetItems( ([ + ({"rune","runes"}) : "The runes' meaning is undecipherable to you.", + ({"picture","engraving"}) : "An almost comical image of a startled orc sliced in half.", + ]) ); + SetRead( ([ + ({"rune","runes"}) : "You do not understand them." + ]) ); + } + + int eventStrike(object target) { + if( (string)target->GetRace() != "orc" ) return item::eventStrike(target); + message("environment", "The orc slayer sword glows blue and emits a ghastly shrieking sound!", + environment(target)); + return item::eventStrike(target) + random(50)+10; + } diff -c -r --new-file ds1.1/lib/domains/town/weap/paring_knife.c ds2.0r27/lib/domains/town/weap/paring_knife.c *** ds1.1/lib/domains/town/weap/paring_knife.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/weap/paring_knife.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,26 ---- + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + + static void create() { + item::create(); + SetKeyName("paring knife"); + SetId( ({ "knife"})); + SetAdjectives( ({ "serrated","sharp","razor sharp","steel","hefty","stainless","paring"})); + SetShort("a 4-inch paring knife"); + SetLong("This is a 4-inch paring knife. This very sharp knife has been forged from molded and hammered high-carbon stainless steel. Though light, it is solid and well-balanced."); + SetMass(20); + SetBaseCost("silver",55); + SetVendorType(VT_WEAPON); + SetClass(15); + SetDamageType(BLADE); + SetWeaponType("knife"); + } + int GetFancy(){ + return 1; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/weap/rod.c ds2.0r27/lib/domains/town/weap/rod.c *** ds1.1/lib/domains/town/weap/rod.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/weap/rod.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,22 ---- + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + static void create(){ + item::create(); + SetKeyName("rod"); + SetId( ({ "staff", "stick", "pole" , "rod of asclepius", "rod of aesculapius"}) ); + SetAdjectives( ({ "wood","wooden" }) ); + SetShort("a wooden rod with a carved snake on it"); + SetLong("This handsome staff has been carved to " + "seem to have a snake wrapped around it."); + SetVendorType(VT_WEAPON); + SetDamagePoints(50); + SetClass(100); + SetBaseCost("silver",250); + SetMass(100); + SetWeaponType("blunt"); + SetHands(2); + SetDamageType(BLUNT); + } diff -c -r --new-file ds1.1/lib/domains/town/weap/sharpsword.c ds2.0r27/lib/domains/town/weap/sharpsword.c *** ds1.1/lib/domains/town/weap/sharpsword.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/weap/sharpsword.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + + static void create() { + item::create(); + SetKeyName("sharp sword"); + SetId( ({"sword"}) ); + SetAdjectives( ({ "short","sharp","fine"})); + SetShort("a sharp sword"); + SetLong("A fine, sharp sword. It is solidly crafted and well balanced."); + SetMass(300); + SetBaseCost("silver", 1100); + SetVendorType(VT_WEAPON); + SetClass(50); + SetDamageType(BLADE); + SetWeaponType("blade"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/weap/shotput.c ds2.0r27/lib/domains/town/weap/shotput.c *** ds1.1/lib/domains/town/weap/shotput.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/weap/shotput.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,22 ---- + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + + static void create() { + item::create(); + SetKeyName("shot ball"); + SetAdjectives( ({"ball of", "palm sized", "palm-sized", "shot"}) ); + SetId( ({"ball", "lead", "shot", "shotput"}) ); + SetShort("a palm-sized ball of lead"); + SetLong("This is a ball of lead, approximately nine inches in diameter. It is a weapon called a 'shot', intended to be thrown at an enemy."); + SetMass(50); + SetVendorType(VT_WEAPON); + SetClass(30); + SetDamageType(BLUNT); + SetWeaponType("projectile"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/weap/staff.c ds2.0r27/lib/domains/town/weap/staff.c *** ds1.1/lib/domains/town/weap/staff.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/weap/staff.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,27 ---- + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + + static void create(){ + item::create(); + SetKeyName("staff"); + SetId( ({ "staff", "stick", "pole" }) ); + SetAdjectives( ({ "wood","wooden" }) ); + SetShort("a wooden staff"); + SetLong("This staff is old, weathered, "+ + "and lumpy. However, it feels quite sturdy "+ + "and solid."); + SetVendorType(VT_WEAPON); + SetDamagePoints(50); + SetClass(20); + SetBaseCost("silver",250); + SetMass(100); + SetWeaponType("blunt"); + SetHands(2); + SetDamageType(BLUNT); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/domains/town/weap/sword.c ds2.0r27/lib/domains/town/weap/sword.c *** ds1.1/lib/domains/town/weap/sword.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/domains/town/weap/sword.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,24 ---- + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + + + static void create() { + item::create(); + SetKeyName("short sword"); + SetId( ({ "sword", "short sword" }) ); + SetAdjectives( ({ "short" }) ); + SetShort("a short sword"); + SetLong("A cheap and rather dull short sword."); + SetMass(300); + SetBaseCost("silver",50); + SetVendorType(VT_WEAPON); + SetClass(20); + SetDamageType(BLADE); + SetWeaponType("blade"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/include/armor_types.h ds2.0r27/lib/include/armor_types.h *** ds1.1/lib/include/armor_types.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/include/armor_types.h Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,27 ---- + #ifndef __ARMOR_TYPES_H__ + #define __ARMOR_TYPES_H__ + + #define A_RING (1 << 1) + #define A_GLOVE (1 << 2) + #define A_LONG_GLOVE (1 << 3) + #define A_BOOT (1 << 4) + #define A_LONG_BOOT (1 << 5) + #define A_SOCK (1 << 6) + #define A_LONG_SOCK (1 << 7) + #define A_HELMET (1 << 8) + #define A_VISOR (1 << 9) + #define A_PANTS (1 << 10) + #define A_BELT (1 << 11) + #define A_SHIRT (1 << 12) + #define A_CLOAK (1 << 13) + #define A_VEST (1 << 14) + #define A_WEAPON (1 << 15) + #define A_SHIELD (1 << 16) + #define A_ARMOR (1 << 17) + #define A_AMULET (1 << 18) + #define A_COLLAR (1 << 19) + #define A_BODY_ARMOR (1 << 20) + + #define A_MAX_ARMOR_BIT A_BODY_ARMOR + + #endif /* __ARMOR_TYPES_H__ */ diff -c -r --new-file ds1.1/lib/include/armour_types.h ds2.0r27/lib/include/armour_types.h *** ds1.1/lib/include/armour_types.h Sun Feb 1 21:30:08 1998 --- ds2.0r27/lib/include/armour_types.h Wed Dec 31 19:00:00 1969 *************** *** 1,26 **** - #ifndef __ARMOUR_TYPES_H__ - #define __ARMOUR_TYPES_H__ - - #define A_RING (1 << 1) - #define A_GLOVE (1 << 2) - #define A_LONG_GLOVE (1 << 3) - #define A_BOOT (1 << 4) - #define A_LONG_BOOT (1 << 5) - #define A_SOCK (1 << 6) - #define A_LONG_SOCK (1 << 7) - #define A_HELMET (1 << 8) - #define A_VISOR (1 << 9) - #define A_PANTS (1 << 10) - #define A_BELT (1 << 11) - #define A_SHIRT (1 << 12) - #define A_CLOAK (1 << 13) - #define A_VEST (1 << 14) - #define A_WEAPON (1 << 15) - #define A_SHIELD (1 << 16) - #define A_ARMOUR (1 << 17) - #define A_AMULET (1 << 18) - #define A_BODY_ARMOUR (1 << 19) - - #define A_MAX_ARMOUR_BIT A_BODY_ARMOUR - - #endif /* __ARMOUR_TYPES_H__ */ --- 0 ---- diff -c -r --new-file ds1.1/lib/include/damage_types.h ds2.0r27/lib/include/damage_types.h *** ds1.1/lib/include/damage_types.h Sun Feb 1 21:30:08 1998 --- ds2.0r27/lib/include/damage_types.h Wed Jul 5 00:00:58 2006 *************** *** 11,19 **** #define GAS (1 << 8) #define ACID (1 << 9) #define MAGIC (1 << 10) ! #define MAX_DAMAGE_BIT MAGIC ! #define ALL_DAMAGE BLUNT | BLADE | KNIFE | WATER | SHOCK | COLD | HEAT | GAS | ACID | MAGIC #endif /* s_damage_types_h */ --- 11,30 ---- #define GAS (1 << 8) #define ACID (1 << 9) #define MAGIC (1 << 10) + #define POISON (1 << 11) + #define DISEASE (1 << 12) + #define TRAUMA (1 << 13) + #define PIERCE (1 << 14) + #define PSIONIC (1 << 15) + #define ANOXIA (1 << 16) + #define DEATHRAY (1 << 17) + #define EMOTIONAL (1 << 18) + #define SONIC (1 << 19) + #define BITE (1 << 20) + #define OTHER (1 << 21) ! #define MAX_DAMAGE_BIT OTHER ! #define ALL_DAMAGE BLUNT | BLADE | KNIFE | WATER | SHOCK | COLD | HEAT | GAS | ACID | MAGIC | POISON | DISEASE | TRAUMA | PIERCE | PSIONIC | ANOXIA | DEATHRAY | EMOTIONAL | SONIC | BITE | OTHER #endif /* s_damage_types_h */ diff -c -r --new-file ds1.1/lib/include/stargate.h ds2.0r27/lib/include/stargate.h *** ds1.1/lib/include/stargate.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/include/stargate.h Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,20 ---- + /** + * + * $Id: stargate.h,v 1.1 2006/04/05 05:48:39 jam Exp $ + * + */ + + #ifndef startgate_h + #define stargate_h + + #define GATE_TIMEOUT (10+random(5)) + + // address (i.e. "sgc") is a key in a mapping in the stargate daemon so it is not included here + class stargate + { + string status; + string destination; + string endpoint; + } + + #endif diff -c -r --new-file ds1.1/lib/include/vendor_types.h ds2.0r27/lib/include/vendor_types.h *** ds1.1/lib/include/vendor_types.h Sun Feb 1 21:30:09 1998 --- ds2.0r27/lib/include/vendor_types.h Wed Jul 5 00:00:58 2006 *************** *** 3,9 **** #define VT_TREASURE (1 << 1) #define VT_WEAPON (1 << 2) ! #define VT_ARMOUR (1 << 3) #define VT_LIGHT (1 << 4) #define VT_FOOD (1 << 5) #define VT_DRINK (1 << 6) --- 3,9 ---- #define VT_TREASURE (1 << 1) #define VT_WEAPON (1 << 2) ! #define VT_ARMOR (1 << 3) #define VT_LIGHT (1 << 4) #define VT_FOOD (1 << 5) #define VT_DRINK (1 << 6) *************** *** 14,19 **** #define MAX_VENDOR_BIT VT_HERB ! #define VT_ALL VT_TREASURE | VT_WEAPON | VT_ARMOUR | VT_LIGHT | VT_FOOD | VT_DRINK | VT_MAGIC | VT_FISHING | VT_PLANT | VT_HERB #endif /* s_vendor_types_h */ --- 14,19 ---- #define MAX_VENDOR_BIT VT_HERB ! #define VT_ALL VT_TREASURE | VT_WEAPON | VT_ARMOR | VT_LIGHT | VT_FOOD | VT_DRINK | VT_MAGIC | VT_FISHING | VT_PLANT | VT_HERB #endif /* s_vendor_types_h */ diff -c -r --new-file ds1.1/lib/include/war.h ds2.0r27/lib/include/war.h *** ds1.1/lib/include/war.h Sun Feb 1 21:30:10 1998 --- ds2.0r27/lib/include/war.h Wed Dec 31 19:00:00 1969 *************** *** 1,18 **** - #ifndef s_war_h - #define s_war_h - - class team { - string name; - string leader; - int points; - int war_chest; - string array members; - } - - class war { - int start; - string reason; - class team agressor; - class team enemy; - string array neutrals; - } --- 0 ---- diff -c -r --new-file ds1.1/lib/lib/battery.c ds2.0r27/lib/lib/battery.c *** ds1.1/lib/lib/battery.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/battery.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,95 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + private int charge,rechargeable, drainable,drainrate,fullcharge; + private string powertype,celltype; + + int Spent(){ + string *tmp; + if(rechargeable == 1) return 1; + if(!charge || charge <= 0){ + charge = 0; + SetShort("a spent power cell"); + tmp = GetAdjectives(); + tmp += ({"spent", "empty", "drained", "used"}); + SetAdjectives(tmp); + } + return 1; + } + + + void create(){ + ::create(); + AddSave( ({ "charge" }) ); + SetKeyName("cell"); + SetId(({"battery"})); + SetAdjectives(({"power","generic"})); + SetShort("a generic power cell"); + SetLong("This is a generic power cell."); + SetMass(1); + SetBaseCost(4); + SetVendorType(VT_TREASURE); + rechargeable=0; + drainable = 1; + drainrate = 1; + Spent(); + } + + void init(){ + ::init(); + if(living(environment(this_object())) ) this_object()->eventUse(0); + if( charge < 200 ) SetBaseCost(0); + Spent(); + } + + int SetPowerType(string str) {powertype=str; return 1; } + int SetCellType(string str) {celltype=str; return 1; } + int SetCharge(int i) {charge = i; fullcharge = i; return 1; } + int GetCharge() { return charge; } + string GetPowerType() { return powertype; } + string GetCellType() { return celltype; } + int SetRechargeable(int i) { rechargeable = i; return i;} + int GetRechargeable() { return rechargeable;} + int SetDrainable(int i) { drainable = i; return i; } + int GetDrainable() { return drainable; } + int SetDrainRate(int i) { drainrate = i; return i; } + int GetDrainRate() { return drainrate; } + + + int ModCharge(int i) { + if(!charge) charge = 0; + if(i) charge += i; + return charge; + } + + int eventDrain(int i){ + if( drainable != 1 ) return 0; + if(!charge) charge = 0; + if(charge && charge > 0) charge -= i; + if(charge && charge < 0) Spent(); + if(!charge) Spent(); + if( charge < 200 ) SetBaseCost(0); + return charge; + } + + int eventCharge(int i){ + if(!charge) charge =0; + if(i) charge += i; + return charge; + } + + int eventUse(int i){ + if(i == 0) { + set_heart_beat(0); + return 1; + } + if(!drainable) drainable = 1; + if(drainable && drainable == 0) drainrate = 0; + else if(!drainable) drainable = 1; + if( !i || !intp(i) ) i = drainrate; + set_heart_beat(i); + } + + void heart_beat(){ + eventDrain(1); + } diff -c -r --new-file ds1.1/lib/lib/bboard.c ds2.0r27/lib/lib/bboard.c *** ds1.1/lib/lib/bboard.c Sun Feb 1 21:30:10 1998 --- ds2.0r27/lib/lib/bboard.c Wed Jul 5 00:00:58 2006 *************** *** 1,6 **** /* /lib/bboard.c * /lib/bboard.c ! * from Dead Souls 3.3 * the Dead Souls bulletin board system * created by Descartes of Borg 940920 */ --- 1,6 ---- /* /lib/bboard.c * /lib/bboard.c ! * from Nightmare 3.3 * the Dead Souls bulletin board system * created by Descartes of Borg 940920 */ *************** *** 32,42 **** add_action("cmd_remove", "remove"); add_action("cmd_edit", "edit"); if(!creatorp(this_player())) return; - add_action("cmd_save", "save"); } static private int valid_edit(string author) { - string *allowed; string who; who = (string)this_player()->GetKeyName(); --- 32,40 ---- *************** *** 51,60 **** if(!str) return notify_fail("You must specify a subject.\n"); if(file_exists(file = DIR_TMP+"/"+(string)this_player()->GetKeyName())) { ! message("system", "You have an abandoned post waiting.",this_player()); ! message("system", " e)dit it, or start n)ew", this_player()); ! message("prompt", "\nCommand (default 'n'): ", this_player()); ! input_to("begin_post", str, file, (: continue_post :)); } else begin_post("n", str, file, (: continue_post :)); return 1; --- 49,58 ---- if(!str) return notify_fail("You must specify a subject.\n"); if(file_exists(file = DIR_TMP+"/"+(string)this_player()->GetKeyName())) { ! message("system", "You have an abandoned post waiting.",this_player()); ! message("system", " e)dit it, or start n)ew", this_player()); ! message("prompt", "\nCommand (default 'n'): ", this_player()); ! input_to("begin_post", str, file, (: continue_post :)); } else begin_post("n", str, file, (: continue_post :)); return 1; *************** *** 64,71 **** if(cmd == "" || !cmd) cmd = "n"; else cmd = cmd[0..0]; if(cmd != "n" && cmd != "e") { ! message("system", "Invalid bulletin board command.", this_player()); ! return; } if(cmd == "n" && file_exists(file)) rm(file); (*f)(subj, file); --- 62,69 ---- if(cmd == "" || !cmd) cmd = "n"; else cmd = cmd[0..0]; if(cmd != "n" && cmd != "e") { ! message("system", "Invalid bulletin board command.", this_player()); ! return; } if(cmd == "n" && file_exists(file)) rm(file); (*f)(subj, file); *************** *** 80,125 **** file = DIR_TMP "/" + (string)this_player()->GetKeyName(); if(!(msg = read_file(file))) { ! message("system", "No file read!", this_player()); ! if(file_exists(file)) rm(file); ! return; } else rm(file); ! if( !mail ) ! BBOARD_D->add_post(query_board_id(), ! (string)this_player()->GetCapName(), subj, msg); ! else { ! int foo; ! } message("system", "Message posted!", this_player()); } int cmd_read(string str) { mapping *posts; int x, i, maxi; ! maxi = sizeof(posts = (mapping *)BBOARD_D->query_posts(query_board_id())); ! if(!str) { ! for(i=0, x = -1; i<maxi; i++) ! if(member_array((string)this_player()->GetKeyName(), ! posts[i]["read"]) == -1) { ! x = i; ! break; ! } ! if(x == -1) return notify_fail("No unread posts.\n"); } - else if(!(x = to_int(str))) return notify_fail("Read what?\n"); - else x--; - if(x < 0 || x >= sizeof(posts)) - return notify_fail("Invalid post number.\n"); - str = "Post #%^YELLOW%^" + (x+1) + "%^RESET%^ by %^YELLOW%^" + - posts[x]["author"] + "%^RESET%^\nSubject: %^CYAN%^" + - posts[x]["subject"] + "%^RESET%^\n\n"; - str += posts[x]["post"]; - - BBOARD_D->mark_read(query_board_id(),x,(string)this_player()->GetKeyName()); - this_player()->eventPage(explode(str, "\n"), "system"); - return 1; } int cmd_followup_and_respond(string str) { --- 78,130 ---- file = DIR_TMP "/" + (string)this_player()->GetKeyName(); if(!(msg = read_file(file))) { ! message("system", "No file read!", this_player()); ! if(file_exists(file)) rm(file); ! return; } else rm(file); ! if( !mail ) ! BBOARD_D->add_post(query_board_id(), ! (string)this_player()->GetCapName(), subj, msg); message("system", "Message posted!", this_player()); } int cmd_read(string str) { + string junk; mapping *posts; int x, i, maxi; ! if(str){ ! if(str == "board" || sscanf(str,"board %s",junk) ) { ! write("To read the first post, type: read 1"); ! write("To read the second one: read 2"); ! write("And so on."); ! return 1; ! } ! ! maxi = sizeof(posts = (mapping *)BBOARD_D->query_posts(query_board_id())); ! if(!str) { ! for(i=0, x = -1; i<maxi; i++) ! if(member_array((string)this_player()->GetKeyName(), ! posts[i]["read"]) == -1) { ! x = i; ! break; ! } ! if(x == -1) return notify_fail("No unread posts.\n"); ! } ! else if(!(x = to_int(str))) return notify_fail("Read what?\n"); ! else x--; ! if(x < 0 || x >= sizeof(posts)) ! return notify_fail("Invalid post number.\n"); ! str = "Post #%^YELLOW%^" + (x+1) + "%^RESET%^ by %^YELLOW%^" + ! posts[x]["author"] + "%^RESET%^\nSubject: %^CYAN%^" + ! posts[x]["subject"] + "%^RESET%^\n\n"; ! str += posts[x]["post"]; ! ! BBOARD_D->mark_read(query_board_id(),x,(string)this_player()->GetKeyName()); ! this_player()->eventPage(explode(str, "\n"), "system"); ! return 1; } } int cmd_followup_and_respond(string str) { *************** *** 231,236 **** --- 236,242 ---- msg = item::GetExternalDesc(); maxi = sizeof(posts = (mapping *)BBOARD_D->query_posts(query_board_id())); + msg += "\n"; if(!maxi) msg += "There are currently no posts.\n"; else for(i=0; i < maxi; i++) { int lu; diff -c -r --new-file ds1.1/lib/lib/blank_pile.c ds2.0r27/lib/lib/blank_pile.c *** ds1.1/lib/lib/blank_pile.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/blank_pile.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,130 ---- + #include <lib.h> + + inherit LIB_ITEM; + + private string PileType = 0; + int PileAmount = 0; + + static void create() { + string *saveds; + item::create(); + saveds = item::GetSave(); + saveds += ({ "PileType", "PileAmount" }); + AddSave( saveds ); + SetKeyName("money"); + } + + string array GetId() { + string array id; + + id = item::GetId(); + if( PileType ) { + if(PileType != "dollars") { + id += ({ PileType, PileAmount + " " + PileType +" coins"}); + return ({ id..., "money", "pile","coins","coin" }); + } + else { + id += ({ PileType, PileAmount + " " + PileType +" dollars"}); + return ({ id..., "money", "pile","bill","bills" }); + } + } + } + + varargs string GetLong(string str) { + if( !PileAmount ) { + return 0; + } + if(PileType != "dollars") { + return PileAmount + " " + PileType + " coins."; + } + else return PileAmount + " " + PileType + "."; + } + + int GetMass() { + return currency_mass(PileAmount, PileType); + } + + void SetPile(string str, int amt) { + PileType = str; + PileAmount = amt; + parse_refresh(); + } + + string GetPileType() { return PileType; } + + int GetPileAmount() { return PileAmount; } + + string GetShort() { + string sum; + if(!PileAmount) sum = "some"; + else sum = cardinal(PileAmount); + if(PileType != "dollars") { + return sum + " " + PileType + " coins"; + } + else return sum + " " + PileType ; + } + + mixed eventGetCurrency(object who, int amount, string curr) { + string sum; + if(!amount) amount = PileAmount; + if( who->AddCurrency(curr, amount) == -1 ) { + who->eventPrint("You had a problem getting the money."); + return 1; + } + if(!amount) sum = "some"; + else sum = cardinal(amount); + send_messages("get", "$agent_name $agent_verb " + sum + " " + + curr + " " + GetShort() + ".", who, 0, environment(who)); + PileAmount -= amount; + if( PileAmount < 1 ) { + call_out((: Destruct :), 0); + return 1; + } + SetPile(PileType, PileAmount); /* This refreshes the parser */ + return 1; + } + + int eventMove(mixed dest) { + int x; + + x = item::eventMove(dest); + if( !environment() || !living(environment()) ) { + return x; + } + if(environment() && living(environment()) ) { + environment()->AddCurrency(PileType, PileAmount); + environment()->AddCarriedMass(-this_object()->GetMass()); + SetShort(PileAmount + " " + PileType); + //PileAmount = 0; + call_out((: Destruct :), 0); + return x; + } + } + + mixed direct_get_wrd_wrd_out_of_obj(string num, string curr) { + int amt; + + if( environment() != environment(this_player()) ) { + return "#You cannot reach the money!"; + } + if( num[0] < '0' || num[0] > '9' ) { + return 0; + } + if( (amt = to_int(num)) < 1 ) { + return "That's a totally bogus amount."; + } + if( curr != PileType ) { + return "#There are no " + curr + " there, only " + PileType + "."; + } + if( amt > PileAmount ) { + return "#There is not that much there."; + } + if( !this_player()->CanCarry(currency_mass(amt, curr)) ) { + return "It is too heavy for you!"; + } + return 1; + } + + mixed direct_get_wrd_wrd_from_obj(string amt, string curr) { + return direct_get_wrd_wrd_out_of_obj(amt, curr); + } diff -c -r --new-file ds1.1/lib/lib/body.c ds2.0r27/lib/lib/body.c *** ds1.1/lib/lib/body.c Sun Feb 1 21:30:11 1998 --- ds2.0r27/lib/lib/body.c Wed Jul 5 00:00:58 2006 *************** *** 8,18 **** */ #include <lib.h> #include <daemons.h> #include <function.h> #include <medium.h> #include <position.h> ! #include <armour_types.h> #include <damage_types.h> #include <magic_protection.h> #include "include/body.h" --- 8,19 ---- */ #include <lib.h> + #include <config.h> #include <daemons.h> #include <function.h> #include <medium.h> #include <position.h> ! #include <armor_types.h> #include <damage_types.h> #include <magic_protection.h> #include "include/body.h" *************** *** 20,42 **** inherit LIB_PERSIST; inherit LIB_POSITION; inherit LIB_UNDEAD; #define COLLAPSE_AT 10.0 ! private int HealthPoints, MagicPoints; ! private int Alcohol, Caffeine, Food, Drink, Poison, Sleeping; private float StaminaPoints; ! private string Torso; private mapping Fingers, Limbs, MissingLimbs; ! private static int Dying, LastHeal; private static function Protect; private static mapping WornItems; private static class MagicProtection *Protection; static private int HeartModifier = 0; static void create() { ! AddSave( ({ "HealthPoints", "MagicPoints", "StaminaPoints", "Undead", ! "Limbs", "MissingLimbs", "WornItems" }) ); NewBody(0); Protect = 0; WornItems = ([]); --- 21,57 ---- inherit LIB_PERSIST; inherit LIB_POSITION; inherit LIB_UNDEAD; + inherit LIB_CRAWL; + inherit LIB_FLY; #define COLLAPSE_AT 10.0 ! private int HealthPoints, MagicPoints, ExperiencePoints, QuestPoints; ! private int melee; ! private int Alcohol, Caffeine, Food, Drink, Poison, Sleeping, Deaths; private float StaminaPoints; ! private string Torso, Biter; private mapping Fingers, Limbs, MissingLimbs; ! private static int Dying, LastHeal, Encumbrance; private static function Protect; private static mapping WornItems; private static class MagicProtection *Protection; static private int HeartModifier = 0; + float MoJo; + private static string PoliticalParty, BodyComposition; + private static int Pacifist, rifleshot_wounds, gunshot_wounds, globalint1; + string *ExtraChannels; + mixed Agent; static void create() { ! AddSave( ({ "Pacifist", "BodyComposition", "HealthPoints", "MagicPoints", "ExperiencePoints", "QuestPoints","StaminaPoints", "Undead", ! "Limbs", "MissingLimbs", "WornItems" }) ); ! AddSave(({"ExtraChannels","MoJo", "PoliticalParty", "rifleshot_wounds", "gunshot_wounds" })); ! MoJo = 0; ! PoliticalParty = "UNDECIDED"; ! rifleshot_wounds = 0; ! gunshot_wounds = 0; ! NewBody(0); Protect = 0; WornItems = ([]); *************** *** 45,53 **** --- 60,143 ---- Alcohol = Caffeine = 0; HealthPoints = MagicPoints = 50; StaminaPoints = 50.0; + ExperiencePoints = 50; + QuestPoints = 0; Dying = 0; LastHeal = time(); Protection = ({}); + ExtraChannels = ({}); + } + + int GetEncumbrance(){ + int encumbrance = 0; + object *stuff = filter(all_inventory(this_object()), (: !($1->GetWorn()) :) ); + + if(!(ENABLE_ENCUMBRANCE) || inherits(LIB_NPC,this_object()) ) return encumbrance; + if(sizeof(stuff)) foreach(object item in stuff) + encumbrance += (item->GetMass())/2; + if(sizeof(stuff)) encumbrance += sizeof(stuff); + return encumbrance; + } + + string SetBodyComposition(string str){ + if(!str) return ""; + else BodyComposition = str; + return BodyComposition; + } + + string GetBodyComposition(){ + return BodyComposition; + } + + int GetPacifist(){ + return Pacifist; + } + + int SetPacifist(int i){ + if(!i) Pacifist = 0; + else Pacifist = 1; + return Pacifist; + } + + int SetCanBite(int i){ + if(i) Biter = "yes"; + else Biter = "no"; + return i; + } + + int GetCanBite(){ + if(sizeof(Biter)){ + if(Biter == "yes") return 1; + else return 0; + } + else return RACES_D->GetBitingRace(this_object()->GetRace()); + } + + string *AddExtraChannels(string *chans){ + foreach(string chan in chans){ + if(member_array(chan,this_player()->GetChannels()) == -1){ + ExtraChannels += ({ chan }); + } + } + return ExtraChannels; + } + + string *RemoveExtraChannels(string *chans){ + foreach(string chan in chans){ + if(member_array(chan,this_player()->GetChannels()) != -1){ + ExtraChannels -= ({ chan }); + } + } + return ExtraChannels; + } + + string *GetExtraChannels(){ + return ExtraChannels; + } + + string *SetExtraChannels(string *chans){ + ExtraChannels = chans; + return ExtraChannels; } mixed direct_turn_liv() { *************** *** 65,73 **** undead::heart_beat(); if( i = sizeof(Protection) ) { ! while(i--) ! if( Protection[i]->time && (--Protection[i]->time < 1) ) ! RemoveMagicProtection(i); } if( env && (GetResistance(GAS) != "immune") ) { if( (i = env->GetPoisonGas()) > 0 ) { --- 155,163 ---- undead::heart_beat(); if( i = sizeof(Protection) ) { ! while(i--) ! if( Protection[i]->time && (--Protection[i]->time < 1) ) ! RemoveMagicProtection(i); } if( env && (GetResistance(GAS) != "immune") ) { if( (i = env->GetPoisonGas()) > 0 ) { *************** *** 76,87 **** --- 166,184 ---- } } eventCheckHealing(); + if(!stringp(hobbled(this_player()))) eventFall(); + if(this_object()->GetPosition() == POSITION_FLYING && !this_object()->CanFly()) eventFall(); } void eventReconnect() { LastHeal = time(); } + void ParseHook(string str){ + parse_sentence(str); + } + + /************ /lib/body.c Modal Methods Section ************/ mixed CanRemoveItem(object ob) { return 1; } *************** *** 100,161 **** int eventCollapse() { int position = GetPosition(); ! SetParalyzed(3, (: checkCollapse :)); if( position == POSITION_LYING ) { return 1; } send_messages("collapse", "$agent_name $agent_verb to the ground.", ! this_object(), 0, environment()); SetPosition(POSITION_LYING); return 1; } void eventCheckHealing() { int x, y; x = GetHeartRate() * 10; if( (y = time() - LastHeal) >= x ) { ! LastHeal = time(); ! do { ! eventCompleteHeal(GetHealRate()); ! } while( (y = y - x) >= x ); if( Alcohol > 0 ) { Alcohol--; if( !Alcohol ) { message("my_action", "You are left with a pounding headache.", ! this_object()); AddHealthPoints(-(random(3) + 1)); } else if( !GetSleeping() && random(100) < 8 ) { string verb, adv; ! switch(random(5)) { ! case 0: verb = "burp"; adv = "rudely"; break; ! case 1: verb = "look"; adv = "ill"; break; ! case 2: verb = "hiccup"; adv = "loudly"; break; ! case 3: verb = "stumble"; adv = "clumsily"; break; ! case 4: verb = "appear"; adv = "drunk"; break; ! } message("my_action", "You " + verb + " " + adv + ".", ! this_object()); message("other_action", GetName() + " " + pluralize(verb) + " " + ! adv + ".", environment(), ({ this_object() })); } } if( Sleeping > 0 ) { Sleeping--; ! if( !Sleeping ) { message("my_action", "You wake up!", this_object()); message("other_action", GetName() + " wakes up from " + ! possessive(this_object()) + " deep sleep.", ! environment(this_object()), ({ this_object() })); } else if( random(100) < 8 ) { message("my_action", "You snore.", this_object()); message("other_action", (string)this_player()->GetName() + ! " snores loudly.", environment(this_object()), ! ({ this_object() })); } } if( Caffeine > 0 ) Caffeine--; --- 197,280 ---- int eventCollapse() { int position = GetPosition(); ! ! foreach(object ob in all_inventory(environment(this_player()))){ ! if(inherits(LIB_CHAIR,ob) || inherits(LIB_BED,ob) ){ ! ob->eventReleaseStand(this_object()); ! } ! } ! SetParalyzed(3, (: checkCollapse :)); if( position == POSITION_LYING ) { return 1; } send_messages("collapse", "$agent_name $agent_verb to the ground.", ! this_object(), 0, environment()); ! //this_object()->eventCollapse(); SetPosition(POSITION_LYING); return 1; } void eventCheckHealing() { int x, y; + object dude; + dude = this_object(); x = GetHeartRate() * 10; + + if(dude->GetSleeping() > 0 && dude->GetPosition() != POSITION_LYING){ + dude->eventCollapse(); + } + + if(dude->GetInCombat()){ + if(dude->GetInvis()) dude->SetInvis(0); + if(!interactive(dude) && !RACES_D->GetLimblessRace(dude->GetRace())) { + dude->SetAutoStand(1); + } + } + if( (y = time() - LastHeal) >= x ) { ! LastHeal = time(); ! do { ! eventCompleteHeal(GetHealRate()); ! } while( (y = y - x) >= x ); if( Alcohol > 0 ) { Alcohol--; if( !Alcohol ) { message("my_action", "You are left with a pounding headache.", ! this_object()); AddHealthPoints(-(random(3) + 1)); } else if( !GetSleeping() && random(100) < 8 ) { string verb, adv; ! switch(random(5)) { ! case 0: verb = "burp"; adv = "rudely"; break; ! case 1: verb = "look"; adv = "ill"; break; ! case 2: verb = "hiccup"; adv = "loudly"; break; ! case 3: verb = "stumble"; adv = "clumsily"; break; ! case 4: verb = "appear"; adv = "drunk"; break; ! } message("my_action", "You " + verb + " " + adv + ".", ! this_object()); message("other_action", GetName() + " " + pluralize(verb) + " " + ! adv + ".", environment(), ({ this_object() })); } } if( Sleeping > 0 ) { Sleeping--; ! if( !Sleeping || dude->GetInCombat() ) { ! Sleeping = 0; message("my_action", "You wake up!", this_object()); message("other_action", GetName() + " wakes up from " + ! possessive(this_object()) + " deep sleep.", ! environment(this_object()), ({ this_object() })); } else if( random(100) < 8 ) { message("my_action", "You snore.", this_object()); message("other_action", (string)this_player()->GetName() + ! " snores loudly.", environment(this_object()), ! ({ this_object() })); } } if( Caffeine > 0 ) Caffeine--; *************** *** 186,205 **** dest = env->GetGround(); if( !dest ) { send_messages(({ "fall", "die" }), "$agent_name $agent_verb into a " ! "dark abyss and $agent_verb.", this_object(), 0, env); ! SetPosition(POSITION_LYING); ! eventDie(); } else { int p = random(100) + 1; int was_undead = GetUndead(); send_messages("fall", "$agent_name $agent_verb through the sky " ! "towards the world below.", this_object(), 0, env); eventMove(dest); environment()->eventPrint(GetName() + " comes falling in from above.", ! this_object()); ! SetPosition(POSITION_LYING); foreach(string limb in GetLimbs()) { int hp = GetHealthPoints(limb); --- 305,326 ---- dest = env->GetGround(); if( !dest ) { send_messages(({ "fall", "die" }), "$agent_name $agent_verb into a " ! "dark abyss and $agent_verb.", this_object(), 0, env); ! //SetPosition(POSITION_LYING); ! this_object()->eventCollapse(); ! eventDie("Deceleration sickness"); } else { int p = random(100) + 1; int was_undead = GetUndead(); send_messages("fall", "$agent_name $agent_verb through the sky " ! "towards the world below.", this_object(), 0, env); eventMove(dest); environment()->eventPrint(GetName() + " comes falling in from above.", ! this_object()); ! //SetPosition(POSITION_LYING); ! this_object()->eventCollapse(); foreach(string limb in GetLimbs()) { int hp = GetHealthPoints(limb); *************** *** 274,280 **** * can't get into more detail without getting philosophical, which is * beyond the scope of a comment * "x" amount of damage gets attempted, modified by varying things like ! * armour and natural resistence to this type of damage * the internal flag with no limbs specified means that the damage * is taken solely to the overall health * if the internal flag is set with limbs, the damage is both internal and --- 395,401 ---- * can't get into more detail without getting philosophical, which is * beyond the scope of a comment * "x" amount of damage gets attempted, modified by varying things like ! * armor and natural resistence to this type of damage * the internal flag with no limbs specified means that the damage * is taken solely to the overall health * if the internal flag is set with limbs, the damage is both internal and *************** *** 283,322 **** * all limbs * if no internal flag is set and limbs are specified, then damage is done * only to the specified limbs ! * NOTE: internal damage is not modified by armour worn * * returns the average actual amount of damage done */ varargs int eventReceiveDamage(object agent, int type, int x, int internal, ! mixed limbs) { string tmp = GetResistance(type); int fp; if( tmp == "immune") { return 0; } switch(tmp) { ! case "low": x = (3*x)/4; break; ! case "medium": x /= 2; break; ! case "high": x /= 4; break; } if( fp = functionp(Protect) ) { ! if( !(fp & FP_OWNER_DESTED) ) { ! function f; ! f = Protect; ! Protect = 0; ! x -= evaluate(f, this_object(), agent, type, x, limbs); ! } } x = eventCheckProtection(agent, type, x); if( !limbs ) { ! if( internal ) { ! AddHealthPoints(-x, 0, agent); ! return x; ! } ! else { limbs = GetLimbs(); } } --- 404,445 ---- * all limbs * if no internal flag is set and limbs are specified, then damage is done * only to the specified limbs ! * NOTE: internal damage is not modified by armor worn * * returns the average actual amount of damage done */ varargs int eventReceiveDamage(object agent, int type, int x, int internal, ! mixed limbs) { string tmp = GetResistance(type); int fp; + //tc("agent: "+identify(agent),"yellow"); + if( tmp == "immune") { return 0; } switch(tmp) { ! case "low": x = (3*x)/4; break; ! case "medium": x /= 2; break; ! case "high": x /= 4; break; } if( fp = functionp(Protect) ) { ! if( !(fp & FP_OWNER_DESTED) ) { ! function f; ! f = Protect; ! Protect = 0; ! x -= evaluate(f, this_object(), agent, type, x, limbs); ! } } x = eventCheckProtection(agent, type, x); if( !limbs ) { ! if( internal ) { ! AddHealthPoints(-x, 0, agent); ! return x; ! } ! else { limbs = GetLimbs(); } } *************** *** 327,372 **** return -1; } if( internal ) { ! limbs = filter(limbs, (: !AddHealthPoints(-$(x), $1, $(agent)) :)); ! map(limbs, (: (Limbs[$1] ? RemoveLimb($1, $(agent)) : 0) :)); ! AddHealthPoints(-x, 0, agent); ! return x; } else { ! int i, y, maxi; ! y = 0; ! for(i=0, maxi = sizeof(limbs); i < maxi; i++) { ! object *obs; ! int j, z; ! ! z = x; ! if(!Limbs[limbs[i]]) { /* no limb, no damage */ ! y += z; ! continue; ! } ! if(!(j = sizeof(obs = GetWorn(limbs[i])))) { /* no armour */ ! y += z; /* add to total damage */ ! if( !AddHealthPoints(-z, limbs[i], agent) ) ! RemoveLimb(limbs[i], agent); ! continue; ! } ! while(j--) { ! z -= (int)obs[j]->eventReceiveDamage(agent,type, z, 0, limbs[i]); ! if(z < 1) break; ! } ! if(z < 1) continue; ! else { ! y += z; ! if(!AddHealthPoints(-z, limbs[i], agent)) ! RemoveLimb(limbs[i], agent); ! } ! } ! y = y / (maxi ? maxi : 1); ! if( y ) AddHealthPoints(-y, 0, agent); ! return y; } AddHealthPoints(-x, 0, agent); return x; } --- 450,500 ---- return -1; } if( internal ) { ! limbs = filter(limbs, (: !AddHealthPoints(-$(x), $1, $(agent)) :)); ! map(limbs, (: (Limbs[$1] ? this_object()->RemoveLimb($1, $(agent)) : 0) :)); ! AddHealthPoints(-x, 0, agent); ! return x; } else { ! int i, y, maxi; ! y = 0; ! for(i=0, maxi = sizeof(limbs); i < maxi; i++) { ! object *obs; ! int j, z; ! ! z = x; ! if(!Limbs[limbs[i]]) { /* no limb, no damage */ ! y += z; ! continue; ! } ! if(!(j = sizeof(obs = GetWorn(limbs[i])))) { /* no armor */ ! y += z; /* add to total damage */ ! if( !AddHealthPoints(-z, limbs[i], agent) ) ! this_object()->RemoveLimb(limbs[i], agent); ! continue; ! } ! while(j--) { ! z -= (int)obs[j]->eventReceiveDamage(agent,type, z, 0, limbs[i]); ! if(z < 1) break; ! } ! if(z < 1) continue; ! else { ! y += z; ! if(!AddHealthPoints(-z, limbs[i], agent)) ! this_object()->RemoveLimb(limbs[i], agent); ! } ! } ! y = y / (maxi ? maxi : 1); ! if( y ) { ! AddHealthPoints(-y, 0, agent); ! AddStaminaPoints(-y/2); ! } ! return y; } AddHealthPoints(-x, 0, agent); + AddStaminaPoints(-x/2); + if(HealthPoints < 1) eventDie(agent); return x; } *************** *** 385,439 **** int i, y; if( !i = sizeof(Protection) ) return damage; while(i--) { ! int x; ! ! if( (type & Protection[i]->bits) != type ) continue; ! if( Protection[i]->absorb ) { ! if( (x = (Protection[i]->absorb - damage)) < 1 ) { ! x = Protection[i]->absorb; ! RemoveMagicProtection(i); ! damage -= x; ! if( damage < 1 ) return 0; ! continue; ! } ! Protection[i]->absorb -= damage; ! } ! else if( Protection[i]->protect ) ! x = (random(Protection[i]->protect / 2) + ! (Protection[i]->protect / 2)); ! else { ! RemoveMagicProtection(i); ! continue; ! } ! if( y = functionp(Protection[i]->hit) ) { ! if( y == FP_OWNER_DESTED ) { ! RemoveMagicProtection(i); ! continue; ! } ! else x = (int)evaluate(Protection[i]->hit, this_object(), ! agent, x, Protection[i]); ! } ! damage -= x; ! if( damage < 1 ) return 0; } return damage; } mixed eventReceiveThrow(object who, object what) { int x; ! if( what->GetClass() > 1 ) { int mod = who->GetSkillLevel("projectile attack") + ! who->GetStatLevel("strength"); ! mod = mod/2; ! x = what->eventStrike(this_object()) * 2; x = (x*mod)/100; if( what->GetWeaponType() != "projectile" ) { x = x/4; } x = eventReceiveDamage(who, what->GetDamageType(), x, 0, ! GetRandomLimb("torso")); if( x > 0 ) { who->AddSkillPoints("projectile attack", x); } --- 513,567 ---- int i, y; if( !i = sizeof(Protection) ) return damage; while(i--) { ! int x; ! ! if( (type & Protection[i]->bits) != type ) continue; ! if( Protection[i]->absorb ) { ! if( (x = (Protection[i]->absorb - damage)) < 1 ) { ! x = Protection[i]->absorb; ! RemoveMagicProtection(i); ! damage -= x; ! if( damage < 1 ) return 0; ! continue; ! } ! Protection[i]->absorb -= damage; ! } ! else if( Protection[i]->protect ) ! x = (random(Protection[i]->protect / 2) + ! (Protection[i]->protect / 2)); ! else { ! RemoveMagicProtection(i); ! continue; ! } ! if( y = functionp(Protection[i]->hit) ) { ! if( y == FP_OWNER_DESTED ) { ! RemoveMagicProtection(i); ! continue; ! } ! else x = (int)evaluate(Protection[i]->hit, this_object(), ! agent, x, Protection[i]); ! } ! damage -= x; ! if( damage < 1 ) return 0; } return damage; } mixed eventReceiveThrow(object who, object what) { int x; ! if( what->GetClass() > 1 ) { int mod = who->GetSkillLevel("projectile attack") + ! who->GetStatLevel("strength"); ! //mod = mod/2; ! x = what->eventStrike(this_object()) * 3; x = (x*mod)/100; if( what->GetWeaponType() != "projectile" ) { x = x/4; } x = eventReceiveDamage(who, what->GetDamageType(), x, 0, ! GetRandomLimb("torso")); if( x > 0 ) { who->AddSkillPoints("projectile attack", x); } *************** *** 443,465 **** } if( x < 1 ) { environment()->eventPrint(GetName() + " catches " + ! possessive_noun(who->GetName()) + " " + ! what->GetKeyName() + ".", ! ({ this_object(), who })); eventPrint("You catch " + possessive_noun(who->GetName()) + " " + ! what->GetKeyName() + "."); who->eventPrint(GetName() + " catches your " + what->GetKeyName() ! + "."); } else { environment()->eventPrint(GetName() + " takes damage from " + ! possessive_noun(who->GetName()) + " " + ! what->GetKeyName() + ".", ! ({ this_object(), who })); eventPrint("You take damage from " + possessive_noun(who->GetName()) + ! " " + what->GetKeyName() + "."); who->eventPrint(GetName() + " takes damage from your " + ! what->GetKeyName() + "."); } what->eventMove(this_object()); return 1; --- 571,593 ---- } if( x < 1 ) { environment()->eventPrint(GetName() + " catches " + ! possessive_noun(who->GetName()) + " " + ! what->GetKeyName() + ".", ! ({ this_object(), who })); eventPrint("You catch " + possessive_noun(who->GetName()) + " " + ! what->GetKeyName() + "."); who->eventPrint(GetName() + " catches your " + what->GetKeyName() ! + "."); } else { environment()->eventPrint(GetName() + " takes damage from " + ! possessive_noun(who->GetName()) + " " + ! what->GetKeyName() + ".", ! ({ this_object(), who })); eventPrint("You take damage from " + possessive_noun(who->GetName()) + ! " " + what->GetKeyName() + "."); who->eventPrint(GetName() + " takes damage from your " + ! what->GetKeyName() + "."); } what->eventMove(this_object()); return 1; *************** *** 473,1274 **** * * returns true if the thing is dying */ ! varargs int eventDie(object agent) { int x; - SetUndead(!(x = GetUndead())); if( agent ) { ! if( x ) agent->eventDestroyEnemy(this_object()); ! else agent->eventKillEnemy(this_object()); } if( environment() ) { ! object *obs; ! string *currs; ! object ob; ! string curr; ! int i; ! ! ob = new(LIB_CORPSE); ! ob->SetCorpse(this_object()); ! ob->eventMove(environment()); ! obs = filter(all_inventory(), (: !((int)$1->GetRetainOnDeath()) :)); ! i = sizeof(obs); ! while(i--) obs[i]->eventMove(ob); ! currs = (string *)this_object()->GetCurrencies() || ({}); ! foreach(curr in currs) { ! object pile; ! int amt; ! ! if( amt = (int)this_object()->GetCurrency(curr) ) { ! pile = new(LIB_PILE); ! pile->SetPile(curr, amt); ! pile->eventMove(ob); ! this_object()->AddCurrency(curr, -amt); ! } ! } } - call_out( function() { Dying = 0; }, 0); - return 1; - } ! /* int eventRemoveItem(object ob) ! * object ob - the item being removed ! * ! * Removes a worn or wielded item from the list ! * ! * returns 1 on success, 0 on failure ! */ ! int eventRemoveItem(object ob) { ! string limb; ! foreach(limb in keys(WornItems)) { ! if( !WornItems[limb] ) continue; ! if( member_array(ob, WornItems[limb]) != -1) { ! WornItems[limb] -= ({ ob }); } } - return 1; - } ! /* int eventWear(object ob, mixed limbs) ! * object ob - the item being worn (wielded) ! * mixed limbs - string or array of limbs on which it is being worn ! * ! * description ! * marks the limbs "limbs" as being protected by the armour "ob" ! * ! * returns 1 if successful, 0 if failure ! */ ! int eventWear(object ob, mixed limbs) { ! string limb; ! if( stringp(limbs) ) { ! limbs = ({ limbs }); ! } ! if( CanWear(ob, limbs) != 1 ) { ! return 0; ! } ! foreach(limb in limbs) { ! if( !WornItems[limb] ) WornItems[limb] = ({ ob }); ! else WornItems[limb] += ({ ob }); } - return 1; - } ! /************ /lib/body.c Data manipulation functions *************/ ! void NewBody(string race) { ! if(!race) ! Limbs = ([ (Torso = "ooze") : ([ "parent" : 0, "children" : ({}), ! "health" : 50, "class" : 1, "armours" : 0 ]) ]); ! else Limbs = ([]); ! MissingLimbs = ([]); ! Fingers = ([]); ! } ! /* int CanWear(object armour, string *limbs) ! * object armour - the piece of armour being checked ! * string *limbs - the limbs on which the armour wants to be worn ! * a nested array indicates that just one of the included limbs ! * must be satisfied ! * ! * description ! * checks to see if a particular armour can be worn ! * ! * returns 1 if the armour can be worn on those limbs ! * returns 0 if the armour cannot be worn there for any reason ! * ! */ ! mixed CanWear(object ob, string *limbs) { ! string limb, verb_pr, verb_pt, short; ! int *types; ! int type, bad_types, i, maxi; ! ! if( !ob ) return 0; ! short = (string)ob->GetShort(); ! if( !(type = (int)ob->GetArmourType()) ) ! return capitalize(short) + " cannot be worn!"; ! if( type & A_WEAPON ) { ! verb_pr = "wield"; ! verb_pt = "wielded"; } ! else { ! verb_pr = "wear"; ! verb_pt = "worn"; } - if( !limbs || !(maxi = sizeof(limbs)) ) - return "Where should " + short + " be "+ verb_pt + "?"; - if( (string *)ob->GetWorn() ) - return "It is already being " + verb_pt + "."; - - // Verify that the the item can be worn on each limb specified by limbs. - i = 0; - foreach(limb in limbs) { - - // Nested arrays indicate that only one of the elements in the nested - // array must be satisfied. Check for one valid limb, and replace the - // nested array with the valid limb, if found. - if( arrayp(limb) ) { - string limb2; - string validLimb = 0; - int leastRings = -1; - - if(!sizeof(limb)) error("Bad limb specification to CanWear().\n"); - // Iterate through the nested array. - foreach(limb2 in limb) { - string* wornItems; - - // The limb will be valid if: - // o The body has the named limb capable of wearing the armour type. - // o There are no armours of the same type on that limb, except - // for rings, which can have up to GetFingers() of that type worn. - if(!Limbs[limb2] || !(Limbs[limb2]["armours"] & type)) continue; - wornItems = WornItems[limb2]; - - // If the item is a ring, attempt to distribute the rings evenly - // across the available hands. - if(type == A_RING) { - int currentRings; - - if(!sizeof(wornItems)) currentRings = 0; - else currentRings = sizeof(filter(wornItems, - (:(int)$1->GetArmourType() == A_RING:))); - if(currentRings >= leastRings && leastRings != -1) continue; - leastRings = currentRings; - if(currentRings >= GetFingers(limb2)) continue; - } - else if(wornItems) { - object wornItem; - int tmpType = 0; - - foreach(wornItem in wornItems) - if(wornItem) tmpType |= (int)wornItem->GetArmourType(); - if(tmpType & type) continue; - } - validLimb = limb2; - } - if(validLimb) limbs[i] = validLimb; - else return "You cannot " + verb_pr + " that."; - } - else { - if( !Limbs[limb] ) return "You have no " + limb + "."; - if( !(Limbs[limb]["armours"] & type) ) { - if( type & A_WEAPON ) - return "You cannot wield with " + limb + "."; - else return "You cannot wear " + short + " on your " + limb + "."; - } - } - i++; - } - switch(type) { - case A_RING: - if(maxi != 1) - return "You can only wear " + short + " on one limb."; - if( !WornItems[limbs[0]] ) return 1; /* nothing there, ring ok */ - /* count # worn rings */ - i = sizeof(filter(WornItems[limbs[0]], - (: (int)$1->GetArmourType() == A_RING :))); - if(i >= GetFingers(limbs[0])) - return "You are already wearing too many rings there."; - else return 1; /* ok */ - case A_GLOVE: - if(maxi != 1) - return "You can only wear " + short + " on one limb."; - if( GetFingers(limbs[0]) > (int)ob->GetFingers() ) - return capitalize(short) + " does not seem to fit well on " - "your " + limbs[0] + "."; - bad_types = A_GLOVE | A_LONG_GLOVE | A_SOCK | A_LONG_SOCK | - A_BOOT | A_LONG_BOOT; - break; - case A_LONG_GLOVE: - if(maxi != 2) - return capitalize(short) + " should be worn on two limbs."; - if( limbs[0] == Limbs[limbs[1]]["parent"] ) { /* which is hand? */ - /* more fingers than this armour can stand */ - if(GetFingers(limbs[1]) > (int)ob->GetFingers()) - return capitalize(short) + " does not seem to fit well on " - "your " + limbs[1] + "."; - } - else if(limbs[1] == Limbs[limbs[0]]["parent"]) { - /* ok, first limb is hand, check it */ - if(GetFingers(limbs[0]) > (int)ob->GetFingers()) - return capitalize(short) + " does not seem to fit well on " - "your " + limbs[1] + "."; - } - else return "Your " + limbs[0] + " is not connected to your " + - limbs[1] + "."; - bad_types = A_GLOVE | A_LONG_GLOVE | A_SOCK | A_LONG_SOCK | - A_BOOT | A_LONG_BOOT; - break; - case A_BOOT: case A_SOCK: - if(maxi != 1) - capitalize(short) + " may only be worn on one limb."; - if(type == A_SOCK) bad_types = A_SOCK | A_LONG_SOCK; - else bad_types = A_BOOT | A_LONG_BOOT; - break; - case A_LONG_BOOT: case A_LONG_SOCK: - if(maxi != 2) - return capitalize(short) + " must be worn only on two limbs."; - if(limbs[0] != Limbs[limbs[1]]["parent"] && - limbs[1] != Limbs[limbs[0]]["parent"]) - return "Your " + limbs[0] + " is not connected to your " + - limbs[1] + "."; - if(type == A_LONG_SOCK) bad_types = A_LONG_SOCK | A_SOCK; - else bad_types = A_BOOT | A_LONG_BOOT; - break; - case A_HELMET: case A_VEST: case A_AMULET: case A_VISOR: case A_BELT: - if(maxi != 1) - return capitalize(short) + " may only be worn on one limb."; - bad_types = type; - break; - case A_PANTS: case A_SHIRT: - bad_types = type | A_CLOAK; - break; - case A_CLOAK: - bad_types = A_CLOAK | A_SHIRT | A_PANTS; - break; - case A_SHIELD: - foreach(limb in limbs) { - object worn_item; - int tmp = 0; - - if( !WornItems[limb] ) continue; /* no armours, no prob */ - if( !Limbs[limb]["parent"] ) continue; /* torso ok for 2 */ - foreach(worn_item in WornItems[limb]) { - if( !worn_item ) continue; - tmp |= (int)worn_item->GetArmourType(); - } - /* not gonna allow 2 shields or a shield and weapon here */ - if( tmp & (A_SHIELD | A_WEAPON) ) - return "You cannot wear " + short + " there right now."; - } - return 1; /* ok */ - case A_WEAPON: - foreach(limb in limbs) { - object worn_item; - int tmp = 0; - - if( !WornItems[limb] ) continue; /* nothing there, ok */ - foreach(worn_item in WornItems[limb]) { - if( !worn_item ) continue; - tmp += (int)worn_item->GetArmourType(); - } - /* again, not allowing 2 weapons or a shield and weapon */ - if(tmp & (A_SHIELD | A_WEAPON)) - return "You cannot wield " + short + " there right now."; - } - return 1; /* ok */ - case A_ARMOUR: case A_BODY_ARMOUR: - bad_types = A_ARMOUR | A_BODY_ARMOUR; - break; - default: return 0; /* not any illegal stuff */ - } - foreach(limb in limbs) { - object worn_item; - int tmp = 0; - if( !WornItems[limb] ) continue; /* no preventing types */ - foreach( worn_item in WornItems[limb] ) { - if( !worn_item ) continue; - tmp |= (int)worn_item->GetArmourType(); - } - if(tmp & bad_types) - return "You cannot " + verb_pr + " " + short + " there right now."; - } - return 1; /* ok */ - } - - /* int AddLimb(string limb, string parent, int classes, int *armours) - * string limb - the limb being added (required) - * string parent - the limb to which this one is being attached (required) - * int classes - rating of the limb's strength (optional) - * int *armours - the types of armours which can be worn here (optional) - * - * defaults - * classes defaults to 1 - * armours defaults to ({}) - * - * description - * adds the named limb to the body, attached at the named point - * the limb classes starts at 1 for a torso (strongest) - * to whatever the documentation rates as the weakest - * - * returns 1 on success, 0 on failure - */ - varargs int AddLimb(string limb, string parent, int classes, int *armours) { - int arm = 0; ! if(!limb || Limbs[limb] || (parent && !Limbs[parent])) return 0; ! if(armours) { ! int i; ! ! i = sizeof(armours); ! while(i--) arm |= armours[i]; ! } ! if(MissingLimbs[limb]) map_delete(MissingLimbs, limb); ! if( parent ) Limbs[parent]["children"] += ({ limb }); ! else Torso = limb; ! if( !classes ) classes = 5; ! Limbs[limb] = ([ "parent" : parent, "children" : ({}), "class" : classes, ! "armours" : arm ]); ! Limbs[limb]["health"] = GetMaxHealthPoints(limb); ! return 1; ! } ! int RestoreLimb(string limb) { ! if( !MissingLimbs[limb] ) return 0; ! Limbs[limb] = MissingLimbs[limb]; ! Limbs[limb]["health"] = GetMaxHealthPoints(limb); ! map_delete(MissingLimbs, limb); ! return 1; ! } ! /* int DestLimb(string limb) ! * string limb - the limb being removed ! * ! * description ! * removes a limb from the limbs mapping. The limb isn't marked as mising, ! * and the monster doesn't die even if you remove a fatal limb. Useful for ! * removing limbs from standard race types. Removing the torso isn't allowed. ! * ! * returns -1 on error, 0 on failure, 1 on success ! */ ! int DestLimb(string limb) { ! string *kiddies; ! int i; ! if(!limb || !Limbs[limb]) return -1; ! if(!Limbs[limb]["parent"]) { ! return -1; ! } ! Limbs[Limbs[limb]["parent"]]["children"] -= ({ limb }); ! if( (i = sizeof(kiddies = Limbs[limb]["children"])) ) ! while(i--) DestLimb(kiddies[i]); ! map_delete(Limbs, limb); ! return 1; ! } ! /* int RemoveLimb(string limb, object agent) ! * string limb - the limb being removed ! * object agent - the agent who is responsible for the limb removal ! * ! * description ! * removes a limb from the limbs mapping and stores vital data in the ! * missing limbs mapping ! * ! * returns -1 on error, 0 on failure, 1 on success ! */ ! int RemoveLimb(string limb, object agent) { ! string *kiddies; ! int i; - if(!limb || !Limbs[limb]) return -1; - if(!Limbs[limb]["parent"] || Limbs[limb]["class"] == 1) { - HealthPoints = 0; - if( !Dying ) { - Dying = 1; - call_out((: eventDie, agent :), 0); - } - return 0; - } - Limbs[Limbs[limb]["parent"]]["children"] -= ({ limb }); - if( (i = sizeof(kiddies = Limbs[limb]["children"])) ) - while(i--) RemoveLimb(kiddies[i], agent); - MissingLimbs[limb] = Limbs[limb]; - map_delete(Limbs, limb); - if( environment() ) { - object ob; ! message("environment", possessive_noun(GetName()) + " " + limb + ! " is severed!", environment(), ({ this_object() })); ! message("environment", "Your "+ limb + " is severed!", this_object()); ! ob = new(LIB_LIMB); ! ob->SetLimb(limb, GetCapName(), GetRace()); ! ob->eventMove(environment()); ! i = sizeof(WornItems[limb]); ! while(i--) { ! WornItems[limb][i]->SetWorn(0); ! WornItems[limb][i]->eventMove(ob); ! } ! while( i = sizeof(WornItems[limb]) ) ! eventRemoveItem(WornItems[limb][i]); } - return 1; - } ! mapping GetLimb(string limb) { ! if(!limb || !Limbs[limb]) return 0; ! else return copy(Limbs[limb]); ! } ! /* string GetRandomLimb(string targ) ! * string targ - the targetted limb ! * ! * description ! * returns a random limb weighted towards the targetted limb ! */ ! string GetRandomLimb(string targ) { ! string array limbs; ! if( !targ ) { ! targ = GetTorso(); } ! if( member_array(targ, (limbs=keys(Limbs))) == -1) { ! targ= GetTorso(); /* no target or illegal target, weight torso */ } - targ = (limbs + (targ ? ({ targ, targ }) : ({})))[random(sizeof(limbs)+2)]; - return targ; - } ! string GetTorso() { ! string *limbs; ! int i; ! i = sizeof(limbs = keys(Limbs)); ! while(i--) { ! if(!Limbs[limbs[i]]["parent"]) { ! return limbs[i]; } } - return 0; - } ! string array GetLimbs() { ! return (Limbs ? keys(Limbs) : 0); ! } ! int GetLimbClass(string limb) { return Limbs[limb]["class"]; } ! string GetLimbParent(string limb) { return Limbs[limb]["parent"]; } ! string array GetLimbChildren(string limb) { ! return Limbs[limb]["children"] + ({}); ! } - mapping GetMissingLimb(string limb) { - return (limb ? copy(MissingLimbs[limb]) : 0); - } ! string array GetMissingLimbs() { return keys(MissingLimbs); } ! string GetLong(string nom) { ! string *limbs; ! string str; ! float h; ! ! str = (nom = capitalize(nom)); ! h = percent(GetHealthPoints(), GetMaxHealthPoints()); ! if( h < 10.0 ) str += " is mortally wounded.\n"; ! else if( h < 20.0 ) str += " is near death.\n"; ! else if( h < 30.0 ) str += " is severely injured.\n"; ! else if( h < 40.0 ) str += " is badly injured.\n"; ! else if( h < 50.0 ) str += " is hurt.\n"; ! else if( h < 60.0 ) str += " is slightly injured.\n"; ! else if( h < 70.0 ) str += " has some cuts and bruises.\n"; ! else if( h < 80.0 ) str += " is in decent shape.\n"; ! else if( h < 90.0 ) str += " is quite keen.\n"; ! else str += " is in top condition.\n"; ! limbs = GetMissingLimbs(); ! if( sizeof(limbs) ) { ! int i, maxi; ! str += nom + " is missing " + add_article(limbs[0]); ! for(i=1, maxi = sizeof(limbs); i<maxi; i++) { ! if( i < maxi-1 ) str += ", " + add_article(limbs[i]); ! else { ! if( maxi > 2 ) str += ","; ! str += " and " + add_article(limbs[i]); ! } } ! str += ".\n"; } - return str; - } ! string array GetWieldingLimbs() { ! return filter(keys(Limbs), (: (Limbs[$1]["armours"] & A_WEAPON) :)); ! } ! /* int AddFingers(string limb, int x) ! * string limb - the limb to which fingers will be added ! * int x - the number of fingers being added, can be negative ! * ! * description ! * adds the given number of fingers to the given limb ! * ! * returns the total number of fingers after addition ! */ ! varargs int AddFingers(string limb, int x) { ! if((Fingers[limb] += x) < 1) Fingers[limb] = 1; ! return Fingers[limb]; ! } ! int GetFingers(string limb) { ! return Fingers[limb]; ! } ! varargs object *GetWorn(string limb) { ! if(!limb) { ! object *ret = ({}); ! string *limbs; ! int i; ! i = sizeof(limbs = keys(Limbs)); ! while(i--) if(WornItems[limbs[i]]) ret += ({ WornItems[limbs[i]] }); ! return distinct_array(ret); } - else if(!WornItems[limb]) return ({}); - else return (WornItems[limb] + ({})); - } ! varargs mixed GetWielded(string limb) { ! if(!limb) { ! object *ret = ({}); ! string *limbs; ! int i; ! i = sizeof(limbs = keys(Limbs)); ! while(i--) { ! if(!WornItems[limbs[i]]) continue; ! else ret += filter(WornItems[limbs[i]], ! (: (int)$1->GetArmourType() == A_WEAPON :)); ! } ! return distinct_array(ret); } - else if(!WornItems[limb]) return 0; - else { - object *ret; ! ret = filter(WornItems[limb], (: (int)$1->GetArmourType() == A_WEAPON :)); ! if(sizeof(ret)) return ret[0]; ! else return 0; } - } ! /* varargs static int AddHealthPoints(int x, string limb, object agent) ! * int x - number of points being added, may be negative (required) ! * string limb - the limb to which health is being added (optional) ! * object agent - the living responsible for this damage ! * ! * defaults ! * limb defaults to 0 ! * ! * description ! * if the value of limb is not zero, then "x" number of health points will ! * be added to limb "limb" ! * if he value is 0, then the overall health points will be modified ! * ! * returns the remaining number of health points for the limb in question ! * or for the overall health points ! */ ! varargs static int AddHealthPoints(int x, string limb, object agent) { ! int y; ! if( limb ) { ! if( !Limbs[limb] ) return -1; ! if((Limbs[limb]["health"] += x) < 1) Limbs[limb]["health"] = 0; ! else if(Limbs[limb]["health"] > (y = GetMaxHealthPoints(limb))) ! Limbs[limb]["health"] = y; ! return Limbs[limb]["health"]; } ! else { ! if((HealthPoints += x) < 1) HealthPoints = 0; ! else if(HealthPoints > (y = GetMaxHealthPoints())) HealthPoints = y; ! if( HealthPoints < 1 ) { ! if( !Dying ) { ! Dying = 1; ! call_out( (: eventDie, agent :), 0); ! } ! } else { ! float h = percent(GetHealthPoints(), GetMaxHealthPoints()); ! if( h < COLLAPSE_AT ) { ! eventCollapse(); } } - return HealthPoints; } - } ! varargs int GetHealthPoints(string limb) { ! if(limb) { ! if(!Limbs[limb]) return -1; ! else return Limbs[limb]["health"]; } - else return HealthPoints; - } ! varargs int GetMaxHealthPoints(string limb) { return 0; } ! /* int AddMagicPoints(int x) ! * int x - the number of magic points being added, may be negative ! * ! * description ! * adds magic points to the body ! * ! * returns the remaining magic points ! */ ! int AddMagicPoints(int x) { ! int y; - if((MagicPoints += x) < 1) MagicPoints = 0; - else if(MagicPoints > (y = GetMaxMagicPoints())) MagicPoints = y; - return MagicPoints; - } ! int GetMagicPoints() { return MagicPoints; } ! int GetMaxMagicPoints() { return 0; } ! /* int AddStaminaPoints(int x) ! * int x - number of stamina points being added ! * ! * description ! * adds "x" stamina points, can be negative ! * ! * returns the remaining number of stamina points ! */ ! float AddStaminaPoints(mixed x) { ! float y; ! if( !intp(x) && !floatp(x) ) ! error("Bad argument 1 to AddStaminaPoints().\n"); ! if( intp(x) ) x = to_float(x); ! if((StaminaPoints += x) < 0.1) StaminaPoints = 0.0; ! else if(StaminaPoints > (y = GetMaxStaminaPoints())) StaminaPoints = y; ! return StaminaPoints; ! } ! ! int GetStaminaPoints() { return to_int(StaminaPoints); } ! ! float GetMaxStaminaPoints() { return 0; } ! ! int AddMagicProtection(class MagicProtection cl) { ! if( ( !cl->absorb && !(cl->protect && cl->time) ) || ! ( cl->hit && !functionp(cl->hit) ) || ! ( cl->end && !functionp(cl->end) ) || ! ( !cl->bits ) ! ) { ! error("Illegal class setting passed to AddMagicProtection.\n"); ! return 0; ! } ! cl->timestamp = time(); ! Protection += ({ cl }); ! return 1; ! } ! class MagicProtection array GetMagicProtection() { return Protection; } ! int RemoveMagicProtection(int i) { ! if( i > sizeof(Protection) - 1 ) return 0; ! if( Protection[i]->end ) { ! if( !(functionp(Protection[i]->end) & FP_OWNER_DESTED) ) { ! evaluate(Protection[i]->end, this_object()); } } - Protection -= ({ Protection[i] }); - return 1; - } ! int GetDying() { return Dying; } ! int SetSleeping(int x) { return (Sleeping = x); } ! int GetSleeping() { return Sleeping; } - int AddAlcohol(int x) { return (Alcohol += x); } ! int GetAlcohol() { return Alcohol; } ! int AddCaffeine(int x) { return (Caffeine += x); } ! int GetCaffeine() { return Caffeine; } ! int AddDrink(int x) { return (Drink += x); } ! int GetDrink() { return Drink; } ! int AddFood(int x) { return (Food += x); } ! int GetFood() { return Food; } ! int AddPoison(int x) { ! Poison += x; ! if( Poison < 1 ) { ! Poison = 0; } - return Poison; - } ! int GetPoison() { return Poison; } ! string GetResistance(int type) { return "none"; } ! string GetRace() { return 0; } ! string GetName() { return 0; } ! string GetCapName() { return 0; } ! int GetHeartRate() { ! int rate; ! rate = (GetAlcohol() - GetCaffeine()); ! if( rate > 50 ) rate = 6; ! else if( rate > 25 ) rate = 5; ! else if( rate > 0 ) rate = 4; ! else if( rate > -25 ) rate = 3; ! else rate = 2; ! rate += HeartModifier; ! if( rate < 1 ) { ! rate = 1; } ! else if( rate > 10 ) { ! rate = 10; } - return rate; - } ! int GetHealRate() { ! int heal; ! heal = 1 - (GetPoison() / 10); ! heal += (GetDrink() + GetFood()) / 25; ! heal *= (1 + (GetSleeping() > 1) + (GetAlcohol() > 50)); ! return heal; ! } ! string GetHealthShort() { ! string cl, sh; ! float h; ! if( !(sh = GetShort()) ) return 0; ! h = percent(GetHealthPoints(), GetMaxHealthPoints()); ! if( h > 90.0 ) cl = "%^BOLD%^GREEN%^"; ! else if( h > 75.0 ) cl = "%^GREEN%^"; ! else if( h > 50.0 ) cl = "%^BOLD%^BLUE%^"; ! else if( h > 35.0 ) cl = "%^BLUE%^"; ! else if( h > 20.0 ) cl = "%^BOLD%^RED%^"; ! else cl = "%^RED%^"; ! return cl + capitalize(sh); ! } ! mixed SetProtect(function f) { return (Protect = f); } ! function GetProtect() { return Protect; } ! int GetHeartModifier() { ! return HeartModifier; ! } - varargs int AddHeartModifier(int x, int t) { - HeartModifier += x; - if( t > 0 ) { - call_out((: AddHeartModifier(-$(x)) :), t); } ! return HeartModifier; ! } --- 601,1707 ---- * * returns true if the thing is dying */ ! varargs int eventDie(mixed agent) { int x; + string killer, death_annc; + //debug(identify(agent)); + //tc("stack: "+identify(get_stack())); + + //if(!agent) agent = previous_object(); + + if(Deaths) return 1; + Deaths = 1; + + if(agent && stringp(agent)) killer = agent + " "; + else { + //tc("previous: "+identify(previous_object(-1))); + if(!agent) killer = "UNKNOWN"; + else killer = agent->GetName(); + } + + death_annc = killer + " has slain "+ this_object()->GetName()+"."; + + CHAT_D->eventSendChannel("SYSTEM","death",death_annc,0); + + if( Sleeping > 0 ) Sleeping = 0; if( agent ) { ! if( x ) agent->eventDestroyEnemy(this_object()); ! else agent->eventKillEnemy(this_object()); } if( environment() ) { ! object *obs; ! string *currs; ! object ob; ! string curr; ! int i; ! ! if(GetRace() == "golem") { ! ob = new(LIB_CLAY); ! if(GetBodyComposition()) ob->SetComposition(GetBodyComposition()); ! } ! else { ! if(GetRace() == "android") ob = new(LIB_BOT_CORPSE); ! else ob = new(LIB_CORPSE); ! ob->SetCorpse(this_object()); ! } ! ob->eventMove(environment()); ! obs = filter(all_inventory(), (: !((int)$1->GetRetainOnDeath()) :)); ! i = sizeof(obs); ! obs->eventMove(ob); ! currs = (string *)this_object()->GetCurrencies() || ({}); ! foreach(curr in currs) { ! object pile; ! int amt; ! ! if( amt = (int)this_object()->GetCurrency(curr) ) { ! pile = new(LIB_PILE); ! pile->SetPile(curr, amt); ! pile->eventMove(ob); ! this_object()->AddCurrency(curr, -amt); ! } ! } } ! SetUndead(!(x = GetUndead())); ! //call_out( function() { Dying = 0; }, 0); ! evaluate( function() { Dying = 0; }); ! flush_messages(); ! return 1; ! } ! ! /* int eventRemoveItem(object ob) ! * object ob - the item being removed ! * ! * Removes a worn or wielded item from the list ! * ! * returns 1 on success, 0 on failure ! */ ! int eventRemoveItem(object ob) { ! string limb; ! ! foreach(limb in keys(WornItems)) { ! if( !WornItems[limb] ) continue; ! if( member_array(ob, WornItems[limb]) != -1) { ! WornItems[limb] -= ({ ob }); ! } } + return 1; } ! /* int eventWear(object ob, mixed limbs) ! * object ob - the item being worn (wielded) ! * mixed limbs - string or array of limbs on which it is being worn ! * ! * description ! * marks the limbs "limbs" as being protected by the armor "ob" ! * ! * returns 1 if successful, 0 if failure ! */ ! int eventWear(object ob, mixed limbs) { ! string limb,s1; ! string *target_limb; ! target_limb = ({}); ! if( stringp(limbs) ) { ! limbs = ({ limbs }); ! } ! if( CanWear(ob, limbs) != 1 ) { ! return 0; ! } ! if(!inherits(LIB_WEAPON, ob)){ ! foreach(limb in limbs) { ! if(sscanf(limb,"%s foot",s1) || sscanf(limb,"%s hand",s1) ){ ! if(!sizeof(GetWorn(limb))) target_limb = ({ limb }); ! } ! } ! } ! if(sizeof(target_limb)) limbs = target_limb; ! foreach(limb in limbs) { ! if( !WornItems[limb] ) WornItems[limb] = ({ ob }); ! else WornItems[limb] += ({ ob }); ! } ! return 1; } ! string *GetEquippedLimbs(){ ! string *equipped_limbs = ({}); ! object *wornstuff = filter(all_inventory(this_object()), (: $1->GetWorn() :) ); ! foreach(object item in wornstuff){ ! equipped_limbs += item->GetWorn(); ! } ! return equipped_limbs; } ! /************ /lib/body.c Data manipulation functions *************/ ! void NewBody(string race) { ! if(!race) ! Limbs = ([ (Torso = "ooze") : ([ "parent" : 0, "children" : ({}), ! "health" : 50, "class" : 1, "armors" : 0 ]) ]); ! else Limbs = ([]); ! MissingLimbs = ([]); ! Fingers = ([]); ! } ! ! /* int CanWear(object armor, string *limbs) ! * object armor - the piece of armor being checked ! * string *limbs - the limbs on which the armor wants to be worn ! * a nested array indicates that just one of the included limbs ! * must be satisfied ! * ! * description ! * checks to see if a particular armor can be worn ! * ! * returns 1 if the armor can be worn on those limbs ! * returns 0 if the armor cannot be worn there for any reason ! * ! */ ! mixed CanWear(object ob, string *limbs) { ! string limb, verb_pr, verb_pt, short; ! int type, bad_types, i, maxi; ! ! if( !ob ) return 0; ! short = (string)ob->GetShort(); ! if( !(type = (int)ob->GetArmorType()) ) ! return capitalize(short) + " cannot be worn!"; ! if( type & A_WEAPON ) { ! verb_pr = "wield"; ! verb_pt = "wielded"; ! } ! else { ! verb_pr = "wear"; ! verb_pt = "worn"; ! } ! if( !limbs || !(maxi = sizeof(limbs)) ) ! return "Where should " + short + " be "+ verb_pt + "?"; ! if( (string *)ob->GetWorn() ) ! return "It is already being " + verb_pt + "."; ! ! // Verify that the the item can be worn on each limb specified by limbs. ! i = 0; ! foreach(limb in limbs) { ! ! // Nested arrays indicate that only one of the elements in the nested ! // array must be satisfied. Check for one valid limb, and replace the ! // nested array with the valid limb, if found. ! if( arrayp(limb) ) { ! string limb2; ! string validLimb = 0; ! int leastRings = -1; ! ! if(!sizeof(limb)) error("Bad limb specification to CanWear().\n"); ! // Iterate through the nested array. ! foreach(limb2 in limb) { ! string* wornItems; ! ! // The limb will be valid if: ! // o The body has the named limb capable of wearing the armor type. ! // o There are no armors of the same type on that limb, except ! // for rings, which can have up to GetFingers() of that type worn. ! if(!Limbs[limb2] || !(Limbs[limb2]["armors"] & type)) continue; ! wornItems = WornItems[limb2]; ! ! // If the item is a ring, attempt to distribute the rings evenly ! // across the available hands. ! if(type == A_RING) { ! int currentRings; ! ! if(!sizeof(wornItems)) currentRings = 0; ! else currentRings = sizeof(filter(wornItems, ! (:(int)$1->GetArmorType() == A_RING:))); ! if(currentRings >= leastRings && leastRings != -1) continue; ! leastRings = currentRings; ! if(currentRings >= GetFingers(limb2)) continue; ! } ! else if(wornItems) { ! object wornItem; ! int tmpType = 0; ! ! foreach(wornItem in wornItems) ! if(wornItem) tmpType |= (int)wornItem->GetArmorType(); ! if(tmpType & type) continue; ! } ! validLimb = limb2; ! } ! if(validLimb) limbs[i] = validLimb; ! else return "You cannot " + verb_pr + " that."; ! } ! else { ! if(!GetLimb(limb)) { ! return "Try a different body part."; ! } ! globalint1 = Limbs[limb]["armors"]; ! if( !Limbs[limb] ) return "You have no " + limb + "."; ! if( !(globalint1 & type) ) { ! if( type & A_WEAPON ) ! return "You cannot wield with " + limb + "."; ! else return "You cannot wear " + short + " on your " + limb + "."; ! } ! } ! i++; ! } ! switch(type) { ! case A_RING: ! if(maxi != 1) ! return "You can only wear " + short + " on one limb."; ! if( !WornItems[limbs[0]] ) return 1; /* nothing there, ring ok */ ! /* count # worn rings */ ! i = sizeof(filter(WornItems[limbs[0]], ! (: (int)$1->GetArmorType() == A_RING :))); ! if(i >= GetFingers(limbs[0])) ! return "You are already wearing too many rings there."; ! else return 1; /* ok */ ! case A_GLOVE: ! if(maxi != 1) ! //return "You can only wear " + short + " on one limb."; ! if( GetFingers(limbs[0]) > (int)ob->GetFingers() ) { ! return capitalize(short) + " does not seem to fit well on " ! "your " + limbs[0] + "."; ! } ! bad_types = A_GLOVE | A_LONG_GLOVE | A_SOCK | A_LONG_SOCK; ! break; ! case A_LONG_GLOVE: ! if(maxi != 2) ! return capitalize(short) + " should be worn on two limbs."; ! if( limbs[0] == Limbs[limbs[1]]["parent"] ) { /* which is hand? */ ! /* more fingers than this armor can stand */ ! if(GetFingers(limbs[1]) > (int)ob->GetFingers()) ! return capitalize(short) + " does not seem to fit well on " ! "your " + limbs[1] + "."; ! } ! else if(limbs[1] == Limbs[limbs[0]]["parent"]) { ! /* ok, first limb is hand, check it */ ! if(GetFingers(limbs[0]) > (int)ob->GetFingers()) ! return capitalize(short) + " does not seem to fit well on " ! "your " + limbs[1] + "."; ! } ! else return "Your " + limbs[0] + " is not connected to your " + ! limbs[1] + "."; ! bad_types = A_GLOVE | A_LONG_GLOVE; ! break; ! case A_BOOT: case A_SOCK: ! if(maxi != 1) ! capitalize(short) + " may only be worn on one limb."; ! if(type == A_SOCK) bad_types = A_SOCK | A_LONG_SOCK; ! else bad_types = A_BOOT | A_LONG_BOOT; ! break; ! case A_LONG_BOOT: case A_LONG_SOCK: ! if(maxi != 2) ! return capitalize(short) + " must be worn only on two limbs."; ! if(limbs[0] != Limbs[limbs[1]]["parent"] && ! limbs[1] != Limbs[limbs[0]]["parent"]) ! return "Your " + limbs[0] + " is not connected to your " + ! limbs[1] + "."; ! if(type == A_LONG_SOCK) bad_types = A_LONG_SOCK | A_SOCK; ! else bad_types = A_BOOT | A_LONG_BOOT; ! break; ! case A_HELMET: case A_VEST: case A_AMULET: case A_VISOR: case A_BELT: case A_COLLAR: ! if(maxi != 1) ! return capitalize(short) + " may only be worn on one limb."; ! bad_types = type; ! break; ! case A_PANTS: case A_SHIRT: ! bad_types = type; ! break; ! case A_CLOAK: ! bad_types = type; ! break; ! case A_SHIELD: ! foreach(limb in limbs) { ! object worn_item; ! int tmp = 0; ! ! if( !WornItems[limb] ) continue; /* no armors, no prob */ ! if( !Limbs[limb]["parent"] ) continue; /* torso ok for 2 */ ! foreach(worn_item in WornItems[limb]) { ! if( !worn_item ) continue; ! tmp |= (int)worn_item->GetArmorType(); ! } ! /* not gonna allow 2 shields or a shield and weapon here */ ! if( tmp & (A_SHIELD | A_WEAPON) ) ! return "You cannot wear " + short + " there right now."; ! } ! return 1; /* ok */ ! case A_WEAPON: ! foreach(limb in limbs) { ! object worn_item; ! int tmp = 0; ! ! if( !WornItems[limb] ) continue; /* nothing there, ok */ ! foreach(worn_item in WornItems[limb]) { ! if( !worn_item ) continue; ! tmp += (int)worn_item->GetArmorType(); ! } ! /* again, not allowing 2 weapons or a shield and weapon */ ! if(tmp & (A_SHIELD | A_WEAPON)) ! return "You cannot wield " + short + " there right now."; ! } ! return 1; /* ok */ ! case A_ARMOR: case A_BODY_ARMOR: ! bad_types = A_ARMOR | A_BODY_ARMOR; ! break; ! case A_COLLAR: ! bad_types = A_COLLAR | A_AMULET; ! break; ! ! default: return 0; /* not any illegal stuff */ ! } ! foreach(limb in limbs) { ! object worn_item; ! int tmp = 0; ! if( !WornItems[limb] ) continue; /* no preventing types */ ! foreach( worn_item in WornItems[limb] ) { ! if( !worn_item ) continue; ! tmp |= (int)worn_item->GetArmorType(); ! } ! if(tmp & bad_types){ ! return "You cannot " + verb_pr + " " + short + " there right now."; ! } ! } ! return 1; /* ok */ } ! mixed CanManipulate(){ ! string *prehensile_limbs = this_object()->GetWieldingLimbs(); ! if(!sizeof(prehensile_limbs)){ ! say(this_object()->GetName()+" looks helpless without prehensile appendages."); ! return "You lack prehensile limbs with which to do that."; ! } ! return 1; ! } ! int CanFly(){ ! string clipped = identify(this_player()->GetMissingLimbs()); ! if(creatorp(this_player())) return 1; ! if(!RACES_D->CanFly(this_player()->GetRace())) { ! return 0; ! } ! if(!clipped || !sizeof(clipped)) return 1; ! if(!grepp(lower_case(clipped),"wing")) return 1; ! return 0; ! } ! /* int AddLimb(string limb, string parent, int classes, int *armors) ! * string limb - the limb being added (required) ! * string parent - the limb to which this one is being attached (required) ! * int classes - rating of the limb's strength (optional) ! * int *armors - the types of armors which can be worn here (optional) ! * ! * defaults ! * classes defaults to 1 ! * armors defaults to ({}) ! * ! * description ! * adds the named limb to the body, attached at the named point ! * the limb classes starts at 1 for a torso (strongest) ! * to whatever the documentation rates as the weakest ! * ! * returns 1 on success, 0 on failure ! */ ! varargs int AddLimb(string limb, string parent, int classes, int *armors) { ! int arm = 0; ! ! if(!limb || Limbs[limb] || (parent && !Limbs[parent])) return 0; ! if(armors) { ! int i; ! ! i = sizeof(armors); ! while(i--) arm |= armors[i]; ! } ! if(MissingLimbs[limb]) map_delete(MissingLimbs, limb); ! if( parent ) Limbs[parent]["children"] += ({ limb }); ! else Torso = limb; ! if( !classes ) classes = 5; ! Limbs[limb] = ([ "parent" : parent, "children" : ({}), "class" : classes, ! "armors" : arm ]); ! Limbs[limb]["health"] = GetMaxHealthPoints(limb); ! return 1; } ! int HealLimb(string limb){ ! Limbs[limb]["health"] = GetMaxHealthPoints(limb); ! return Limbs[limb]["health"]; ! } ! ! // Restore Limb has been bugfixed and modified to ! // handle missing parents and missing children. To restore ! // a limb, RestoreLimb("right arm") will restore the arm only. ! // To restore the arm plus its children (in this case, a ! // hand) use RestoreLimb("right arm",1) and this will enable ! // the recursive restore of the limb. Trying to restore ! // a limb will fail if the parent is missing. ! ! varargs int RestoreLimb(string limb, int recurse) { ! if( !MissingLimbs[limb] ) return 0; ! if(!sizeof(Limbs[MissingLimbs[limb]["parent"]])) return 0; ! Limbs[limb] = MissingLimbs[limb]; ! map_delete(MissingLimbs, limb); ! Limbs[limb]["health"] = GetMaxHealthPoints(limb); ! ! // This ensures that the parent of the current limb has this ! // limb added to its children array. ! if(member_array(limb,Limbs[Limbs[limb]["parent"]]["children"]) == -1){ ! Limbs[Limbs[limb]["parent"]]["children"] += ({ limb }); ! } ! if(recurse && sizeof(MissingLimbs)){ ! string *kinder = ({}); ! foreach(string key, mixed val in MissingLimbs){ ! if(MissingLimbs[key]["parent"] == limb) kinder += ({ key }); ! } ! if(sizeof(kinder)){ ! foreach(string element in kinder) this_object()->RestoreLimb(element, 1); ! } ! } ! return 1; ! } ! /* int DestLimb(string limb) ! * string limb - the limb being removed ! * ! * description ! * removes a limb from the limbs mapping. The limb isn't marked as mising, ! * and the monster doesn't die even if you remove a fatal limb. Useful for ! * removing limbs from standard race types. Removing the torso isn't allowed. ! * ! * returns -1 on error, 0 on failure, 1 on success ! */ ! int DestLimb(string limb) { ! string *kiddies; ! int i; ! ! if(!limb || !Limbs[limb]) return -1; ! if(!Limbs[limb]["parent"]) { ! return -1; ! } ! Limbs[Limbs[limb]["parent"]]["children"] -= ({ limb }); ! if( (i = sizeof(kiddies = Limbs[limb]["children"])) ) ! while(i--) DestLimb(kiddies[i]); ! map_delete(Limbs, limb); ! return 1; } ! ! /* int this_object()->RemoveLimb(string limb, object agent) ! * string limb - the limb being removed ! * object agent - the agent who is responsible for the limb removal ! * ! * description ! * removes a limb from the limbs mapping and stores vital data in the ! * missing limbs mapping ! * ! * returns -1 on error, 0 on failure, 1 on success ! */ ! int RemoveLimb(string limb, object agent) { ! string *kiddies; ! string limbname,adjname,templimbname; ! int i; ! ! if(limb == "torso") return 0; ! ! if( sscanf(limb, "%s %s", adjname, templimbname) == 2 ) limbname=templimbname; ! else limbname=limb; ! ! if(!limb || !Limbs[limb]) return -1; ! if(!Limbs[limb]["parent"] || Limbs[limb]["class"] == 1) { ! object objict; ! message("environment", possessive_noun(GetName()) + " " + limb + ! " is severed!", environment(), ({ this_object() })); ! message("environment", "Your "+ limb + " is severed!", this_object()); ! ! ! if(GetRace() == "golem") { ! objict = new(LIB_CLAY); ! if(GetBodyComposition()) objict->SetComposition(GetBodyComposition()); ! } ! else { ! if(GetRace() == "android") objict = new(LIB_BOT_LIMB); ! else objict = new(LIB_LIMB); ! objict->SetLimb(limb, GetCapName(), GetRace()); ! objict->SetId( ({ limb, limbname, "limb" })); ! } ! objict->eventMove(environment()); ! i = sizeof(WornItems[limb]); ! while(i--) { ! WornItems[limb][i]->SetWorn(0); ! WornItems[limb][i]->eventMove(objict); ! } ! while( i = sizeof(WornItems[limb]) ) ! eventRemoveItem(WornItems[limb][i]); ! ! HealthPoints = 0; ! if( !Dying ) { ! Dying = 1; ! //tc("agent: "+identify(agent),"green"); ! Agent = agent; ! //tc("Agent: "+identify(Agent),"blue"); ! //call_out((: eventDie, Agent :), 0); ! eventDie(Agent); ! } ! return 0; ! } ! MissingLimbs[limb] = copy(Limbs[limb]); ! Limbs[Limbs[limb]["parent"]]["children"] -= ({ limb }); ! if( (i = sizeof(kiddies = Limbs[limb]["children"])) ) ! while(i--) this_object()->RemoveLimb(kiddies[i], agent); ! map_delete(Limbs, limb); ! if( environment() ) { ! object ob; ! ! message("environment", possessive_noun(GetName()) + " " + limb + ! " is severed!", environment(), ({ this_object() })); ! message("environment", "Your "+ limb + " is severed!", this_object()); ! if(GetRace() == "golem") { ! ob = new(LIB_CLAY); ! if(GetBodyComposition()) ob->SetComposition(GetBodyComposition()); ! } ! else { ! if(GetRace() == "android") ob = new(LIB_BOT_LIMB); ! else ob = new(LIB_LIMB); ! ob->SetLimb(limb, GetCapName(), GetRace()); ! ob->SetId( ({ limb, limbname, "limb" })); ! } ! ob->eventMove(environment()); ! i = sizeof(WornItems[limb]); ! while(i--) { ! WornItems[limb][i]->SetWorn(0); ! WornItems[limb][i]->eventMove(ob); ! } ! while( i = sizeof(WornItems[limb]) ) ! eventRemoveItem(WornItems[limb][i]); ! } ! ! return 1; } ! mapping GetLimb(string limb) { ! if(!limb || !Limbs[limb]) return 0; ! else return copy(Limbs[limb]); ! } ! ! /* string GetRandomLimb(string targ) ! * string targ - the targetted limb ! * ! * description ! * returns a random limb weighted towards the targetted limb ! */ ! string GetRandomLimb(string targ) { ! string array limbs; ! ! if( !targ ) { ! targ = GetTorso(); } + if( member_array(targ, (limbs=keys(Limbs))) == -1) { + targ= GetTorso(); /* no target or illegal target, weight torso */ + } + targ = (limbs + (targ ? ({ targ, targ }) : ({})))[random(sizeof(limbs)+2)]; + return targ; } ! string GetTorso() { ! string *limbs; ! int i; ! ! i = sizeof(limbs = keys(Limbs)); ! while(i--) { ! if(!Limbs[limbs[i]]["parent"]) { ! return limbs[i]; ! } ! } ! return 0; ! } ! string array GetLimbs() { ! return (Limbs ? keys(Limbs) : 0); ! } ! int GetLimbClass(string limb) { return Limbs[limb]["class"]; } ! string GetLimbParent(string limb) { return Limbs[limb]["parent"]; } ! //The following function courtesy of Garfield @ M*U*D ! string GetMissingLimbParent(string limb) { return MissingLimbs[limb]["parent"]; } ! //The following function courtesy of Garfield @ M*U*D ! string *GetMissingLimbParents(string limb) { ! string *limbs; ! limbs = ({ limb }); ! ! while(memberp(keys(MissingLimbs),GetMissingLimbParent(limbs[0]))){ ! limbs = ({ GetMissingLimbParent(limbs[0]) }) + limbs; } ! ! return limbs; ! } ! ! string array GetLimbChildren(string limb) { ! return Limbs[limb]["children"] + ({}); } ! mapping GetMissingLimb(string limb) { ! return (limb ? copy(MissingLimbs[limb]) : 0); ! } ! // This function courtesy of Garfield ! // and Javelin at M*U*D ! int eventCompareLimbs(string limb1, string limb2){ ! if (memberp(GetMissingLimbParents(limb1), limb2)){ ! return 1; ! } ! if (memberp(GetMissingLimbParents(limb2), limb1)){ ! return -1; ! } ! return strcmp(limb1, limb2); ! } ! // New comparison functionality courtesy of ! // Garfield and Javelin at M*U*D ! varargs string array GetMissingLimbs(int not_default) { ! if(not_default) { ! string *tmp_arr = ({}); ! if(sizeof(keys(MissingLimbs))){ ! tmp_arr = sort_array(keys(MissingLimbs), (: eventCompareLimbs :) ); ! } ! return tmp_arr; ! } ! else return keys(MissingLimbs); ! } ! string GetLong(string nom) { ! string *limbs; ! string *exempt; ! string str; ! float h; ! ! str = ""; ! exempt = ({"android","tree","plant"}); ! ! if(member_array(this_object()->GetRace(),exempt) == -1 && ! !this_object()->GetUndead() ) { ! str = "The "+this_object()->GetGender()+" "; ! str += this_object()->GetRace(); ! h = percent(GetHealthPoints(), GetMaxHealthPoints()); ! if( h < 10.0 ) str += " is mortally wounded.\n"; ! else if( h < 20.0 ) str += " is near death.\n"; ! else if( h < 30.0 ) str += " is severely injured.\n"; ! else if( h < 40.0 ) str += " is badly injured.\n"; ! else if( h < 50.0 ) str += " is hurt.\n"; ! else if( h < 60.0 ) str += " is slightly injured.\n"; ! else if( h < 70.0 ) str += " has some cuts and bruises.\n"; ! else if( h < 80.0 ) str += " is in decent shape.\n"; ! else if( h < 90.0 ) str += " is quite keen.\n"; ! else str += " is in top condition.\n"; ! } ! if(this_object()->GetUndead()) { ! str = capitalize(nominative(this_object()))+" has been killed, and "; ! str += "is one of the Walking Undead.\n"; ! } ! limbs = GetMissingLimbs(); ! if( sizeof(limbs) ) { ! int i, maxi; ! ! str += capitalize(nom) + " is missing " + add_article(limbs[0]); ! for(i=1, maxi = sizeof(limbs); i<maxi; i++) { ! if( i < maxi-1 ) str += ", " + add_article(limbs[i]); ! else { ! if( maxi > 2 ) str += ","; ! str += " and " + add_article(limbs[i]); ! } ! } ! str += ".\n"; ! } ! return str; ! } ! ! string array GetWieldingLimbs() { ! return filter(keys(Limbs), (: (Limbs[$1]["armors"] & A_WEAPON) :)); } ! /* int AddFingers(string limb, int x) ! * string limb - the limb to which fingers will be added ! * int x - the number of fingers being added, can be negative ! * ! * description ! * adds the given number of fingers to the given limb ! * ! * returns the total number of fingers after addition ! */ ! varargs int AddFingers(string limb, int x) { ! if((Fingers[limb] += x) < 1) Fingers[limb] = 1; ! return Fingers[limb]; } ! int GetFingers(string limb) { ! return Fingers[limb]; } ! varargs object *GetWorn(string limb) { ! if(!limb) { ! object *ret = ({}); ! string *limbs; ! int i; ! ! i = sizeof(limbs = keys(Limbs)); ! while(i--) if(WornItems[limbs[i]]) ret += ({ WornItems[limbs[i]] }); ! return distinct_array(ret); ! } ! else if(!WornItems[limb]) return ({}); ! else return (WornItems[limb] + ({})); ! } ! varargs mixed GetWielded(string limb) { ! if(!limb) { ! object *ret = ({}); ! string *limbs; ! int i; ! ! i = sizeof(limbs = keys(Limbs)); ! while(i--) { ! if(!WornItems[limbs[i]]) continue; ! else ret += filter(WornItems[limbs[i]], ! (: (int)$1->GetArmorType() == A_WEAPON :)); ! } ! return distinct_array(ret); ! } ! else if(!WornItems[limb]) return 0; ! else { ! object *ret; ! ret = filter(WornItems[limb], (: (int)$1->GetArmorType() == A_WEAPON :)); ! if(sizeof(ret)) return ret[0]; ! else return 0; ! } } ! ! /* varargs static int AddHealthPoints(int x, string limb, object agent) ! * int x - number of points being added, may be negative (required) ! * string limb - the limb to which health is being added (optional) ! * object agent - the living responsible for this damage ! * ! * defaults ! * limb defaults to 0 ! * ! * description ! * if the value of limb is not zero, then "x" number of health points will ! * be added to limb "limb" ! * if he value is 0, then the overall health points will be modified ! * ! * returns the remaining number of health points for the limb in question ! * or for the overall health points ! */ ! ! varargs static int AddHealthPoints(int x, string limb, object agent) { ! int y; ! ! if( limb ) { ! if( !Limbs[limb] ) return -1; ! y = GetMaxHealthPoints(limb); ! if((Limbs[limb]["health"] += x) < 1) Limbs[limb]["health"] = 0; ! else if(Limbs[limb]["health"] > y) ! Limbs[limb]["health"] = y; ! return Limbs[limb]["health"]; ! } else { ! if((HealthPoints += x) < 1) HealthPoints = 0; ! else if(HealthPoints > (y = GetMaxHealthPoints())) HealthPoints = y; ! if( HealthPoints < 1 ) { ! if( !Dying ) { ! Dying = 1; ! Agent = agent; ! //tc("Agent: "+identify(Agent), "red");; ! //call_out( (: eventDie, Agent :), 0); ! eventDie(Agent); ! } ! } ! else { ! float h = percent(GetHealthPoints(), GetMaxHealthPoints()); ! if( h < COLLAPSE_AT ) { ! eventCollapse(); ! } } + return HealthPoints; } } ! varargs int GetHealthPoints(string limb) { ! if(limb) { ! if(!Limbs[limb]) return -1; ! else return Limbs[limb]["health"]; ! } ! else return HealthPoints; } ! varargs int GetMaxHealthPoints(string limb) { return 0; } ! /* int AddMagicPoints(int x) ! * int x - the number of magic points being added, may be negative ! * ! * description ! * adds magic points to the body ! * ! * returns the remaining magic points ! */ ! ! int AddMagicPoints(int x) { ! int y; ! ! if((MagicPoints += x) < 1) MagicPoints = 0; ! else if(MagicPoints > (y = GetMaxMagicPoints())) MagicPoints = y; ! return MagicPoints; ! } ! ! int GetMagicPoints() { return MagicPoints; } ! ! int GetMaxMagicPoints() { return 0; } ! ! /* int AddStaminaPoints(int x) ! * int x - number of stamina points being added ! * ! * description ! * adds "x" stamina points, can be negative ! * ! * returns the remaining number of stamina points ! */ ! ! float AddMoJo(mixed x){ ! if( !intp(x) && !floatp(x) ) ! error("Bad argument 1 to AddMojo().\n"); ! if( intp(x) ) x = to_float(x); ! if((MoJo += x) < 0.1) MoJo = 0.0; ! if(MoJo > 100) MoJo = 100; ! return MoJo; ! } ! ! float GetMoJo() { return MoJo; } ! ! int AddLead(string ammo,int number){ ! if( !intp(number) ) error("Bad argument 2 to AddLead().\n"); ! if( !stringp(ammo) ) error("Bad argument 1 to AddLead().\n"); ! if( ammo == "gunshot_wounds" ) gunshot_wounds += number; ! if( ammo == "rifleshot_wounds" ) rifleshot_wounds += number; ! if( rifleshot_wounds + gunshot_wounds < 0 ) { ! gunshot_wounds = 0; ! rifleshot_wounds = 0; ! } ! return 1; ! } ! int GetLead(string ammo){ ! int number; ! number = 0; ! if(!ammo || !stringp(ammo)) number = gunshot_wounds + rifleshot_wounds; ! if(!ammo || !stringp(ammo)) return number; ! if(ammo == "gunshot_wounds") return gunshot_wounds; ! if(ammo == "rifleshot_wounds") return rifleshot_wounds; ! return 0; ! } ! float AddStaminaPoints(mixed x) { ! float y; ! if( !intp(x) && !floatp(x) ) ! error("Bad argument 1 to AddStaminaPoints().\n"); ! if( intp(x) ) x = to_float(x); ! if((StaminaPoints += x) < 0.1) StaminaPoints = 0.0; ! else if(StaminaPoints > (y = GetMaxStaminaPoints())) StaminaPoints = y; ! return StaminaPoints; ! } ! int GetStaminaPoints() { return to_int(StaminaPoints); } ! float GetMaxStaminaPoints() { return 0; } ! int AddExperiencePoints(mixed x) { ! if( !intp(x)) error("Bad argument 1 to AddExperiencePoints().\n"); ! if((ExperiencePoints += x) < 0) ExperiencePoints = 0; ! return ExperiencePoints; ! } ! ! int GetExperiencePoints() { return ExperiencePoints; } ! int AddQuestPoints(mixed x) { ! if( !intp(x)) error("Bad argument 1 to AddQuestPoints().\n"); ! if((QuestPoints+= x) < 0) QuestPoints = 0; ! return QuestPoints; ! } ! ! int GetQuestPoints() { return QuestPoints; } ! int AddMagicProtection(class MagicProtection cl) { ! if( ( !cl->absorb && !(cl->protect && cl->time) ) || ! ( cl->hit && !functionp(cl->hit) ) || ! ( cl->end && !functionp(cl->end) ) || ! ( !cl->bits ) ! ) { ! error("Illegal class setting passed to AddMagicProtection.\n"); ! return 0; } + cl->timestamp = time(); + Protection += ({ cl }); + return 1; } ! class MagicProtection array GetMagicProtection() { return Protection; } ! ! int RemoveMagicProtection(int i) { ! if( i > sizeof(Protection) - 1 ) return 0; ! if( Protection[i]->end ) { ! if( !(functionp(Protection[i]->end) & FP_OWNER_DESTED) ) { ! evaluate(Protection[i]->end, this_object()); ! } ! } ! Protection -= ({ Protection[i] }); ! return 1; ! } ! // This is for creatures that do not use weapons. ! // I had to crank down unarmed combat for humanoids, ! // so if your npc's are, say, dumb animals, be sure ! // to include "SetMelee(1)" so they can fight ! // ! int SetMelee(int i) { melee = i; return melee; } ! int GetMelee() { return melee; } ! int GetDying() { return Dying; } ! int SetSleeping(int x) { return (Sleeping = x); } ! int GetSleeping() { return Sleeping; } ! int AddAlcohol(int x) { return (Alcohol += x); } ! int GetAlcohol() { return Alcohol; } ! int AddCaffeine(int x) { return (Caffeine += x); } ! int GetCaffeine() { return Caffeine; } ! int AddDrink(int x) { return (Drink += x); } ! ! int GetDrink() { return Drink; } ! ! int AddFood(int x) { return (Food += x); } ! ! int GetFood() { return Food; } ! ! int AddPoison(int x) { ! Poison += x; ! if( Poison < 1 ) { ! Poison = 0; ! } ! return Poison; } ! int GetPoison() { return Poison; } ! ! string GetResistance(int type) { return "none"; } ! ! string GetRace() { return 0; } ! ! string GetName() { return 0; } ! string GetCapName() { return 0; } ! int GetHeartRate() { ! int rate; ! rate = (GetAlcohol() - GetCaffeine()); ! if( rate > 50 ) rate = 6; ! else if( rate > 25 ) rate = 5; ! else if( rate > 0 ) rate = 4; ! else if( rate > -25 ) rate = 3; ! else rate = 2; ! rate += HeartModifier; ! if( rate < 1 ) { ! rate = 1; ! } ! else if( rate > 10 ) { ! rate = 10; ! } ! return rate; ! } ! int GetHealRate() { ! int heal; ! ! heal = 1 - (GetPoison() / 5); ! heal += (GetDrink() + GetFood()) / 10; ! heal *= (1 + (GetSleeping() > 1) + (GetAlcohol() > 10)); ! return heal; ! } ! string GetHealthShort() { ! string cl, sh; ! float h; ! if( !(sh = GetShort()) ) return 0; ! h = percent(GetHealthPoints(), GetMaxHealthPoints()); ! if( h > 90.0 ) cl = "%^BOLD%^GREEN%^"; ! else if( h > 75.0 ) cl = "%^GREEN%^"; ! else if( h > 50.0 ) cl = "%^BOLD%^BLUE%^"; ! else if( h > 35.0 ) cl = "%^BLUE%^"; ! else if( h > 20.0 ) cl = "%^BOLD%^RED%^"; ! else cl = "%^RED%^"; ! return cl + capitalize(sh); } ! ! mixed SetProtect(function f) { return (Protect = f); } ! ! function GetProtect() { return Protect; } ! ! int GetHeartModifier() { ! return HeartModifier; } ! varargs int AddHeartModifier(int x, int t) { ! HeartModifier += x; ! if( t > 0 ) { ! call_out((: AddHeartModifier(-$(x)) :), t); ! } ! return HeartModifier; ! } ! int AddHP(int hp){ ! this_object()->AddHealthPoints(hp); ! return hp; ! } ! string GetAffectLong(object ob){ ! object dude; ! string ret; ! int alclevel; ! dude = this_object(); ! alclevel = dude->GetAlcohol(); ! ret = ""; ! if(dude->GetSleeping() > 0) { ! ret += dude->GetName()+" is asleep.\n"; ! } ! else if(alclevel > 10){ ! if(alclevel < 20) ret += dude->GetName()+" looks tipsy.\n"; ! else if(alclevel < 50) ret += dude->GetName()+" looks drunk.\n"; ! else if(alclevel < 70) ret += dude->GetName()+" is very drunk.\n"; ! else ret += dude->GetName()+" is completely wasted drunk.\n"; ! } ! return ret; } ! diff -c -r --new-file ds1.1/lib/lib/bot.c ds2.0r27/lib/lib/bot.c *** ds1.1/lib/lib/bot.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/bot.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,103 ---- + #include <lib.h> + #include <rooms.h> + + inherit LIB_SENTIENT; + + int Dying, LastHeal; + + static void create() { + ::create(); + } + + varargs int eventDie(object agent) { + int x; + + SetUndead(!(x = GetUndead())); + if( agent ) { + if( x ) agent->eventDestroyEnemy(this_object()); + else agent->eventKillEnemy(this_object()); + } + if( environment() ) { + object *obs; + string *currs; + object ob; + string curr; + int i; + + ob = new("/lib/bot_corpse"); + ob->SetCorpse(this_object()); + ob->eventMove(environment()); + obs = filter(all_inventory(), (: !((int)$1->GetRetainOnDeath()) :)); + i = sizeof(obs); + while(i--) obs[i]->eventMove(ob); + currs = (string *)this_object()->GetCurrencies() || ({}); + foreach(curr in currs) { + object pile; + int amt; + + if( amt = (int)this_object()->GetCurrency(curr) ) { + pile = new(LIB_PILE); + pile->SetPile(curr, amt); + pile->eventMove(ob); + this_object()->AddCurrency(curr, -amt); + } + } + } + //call_out( function() { Dying = 0; }, 0); + this_object()->eventMove(ROOM_FURNACE); + return 1; + } + + string GetLong(string nom) { + string *limbs; + string str; + float h; + + if(!nom) nom = this_object()->GetKeyName(); + str = ::GetLong(); + str += capitalize(nom); + h = percent(GetHealthPoints(), GetMaxHealthPoints()); + if( h < 10.0 ) str += " is barely functional.\n"; + else if( h < 20.0 ) str += " is functioning poorly.\n"; + else if( h < 30.0 ) str += " is severely damaged.\n"; + else if( h < 40.0 ) str += " is badly damaged.\n"; + else if( h < 50.0 ) str += " is damaged.\n"; + else if( h < 60.0 ) str += " has sustained minor damage.\n"; + else if( h < 70.0 ) str += " looks a bit battered.\n"; + else if( h < 80.0 ) str += " is in decent shape.\n"; + else if( h < 90.0 ) str += " is quite keen.\n"; + else str += " is operating at optimal levels.\n"; + limbs = GetMissingLimbs(); + if( sizeof(limbs) ) { + int i, maxi; + + str += nom + " is missing " + add_article(limbs[0]); + for(i=1, maxi = sizeof(limbs); i<maxi; i++) { + if( i < maxi-1 ) str += ", " + add_article(limbs[i]); + else { + if( maxi > 2 ) str += ","; + str += " and " + add_article(limbs[i]); + } + } + str += ".\n"; + } + return str; + } + + + + + + + + + + + + + + + + + + diff -c -r --new-file ds1.1/lib/lib/burn.c ds2.0r27/lib/lib/burn.c *** ds1.1/lib/lib/burn.c Sun Feb 1 21:30:11 1998 --- ds2.0r27/lib/lib/burn.c Wed Jul 5 00:00:58 2006 *************** *** 1,5 **** /* /lib/burn.c ! * from the Dead Souls V Object Library * inheritable for things that burn * created by Descartes of Borg 960512 * Version: @(#) burn.c 1.3@(#) --- 1,5 ---- /* /lib/burn.c ! * from the Dead Souls Object Library * inheritable for things that burn * created by Descartes of Borg 960512 * Version: @(#) burn.c 1.3@(#) *************** *** 28,35 **** light::create(); this_object()->AddSave(({ "Heat" })); call_out(function() { ! if( GetBurning() ) set_heart_beat(BurnRate); ! }, 0); } int GetBurning() { --- 28,35 ---- light::create(); this_object()->AddSave(({ "Heat" })); call_out(function() { ! if( GetBurning() ) set_heart_beat(BurnRate); ! }, 0); } int GetBurning() { *************** *** 78,84 **** mixed CanBurn(object who) { if( environment() != this_player() && ! environment() != environment(this_player()) ) { return "#That is not within your reach!"; } if( FuelRequired && !GetFuelAmount() ) --- 78,84 ---- mixed CanBurn(object who) { if( environment() != this_player() && ! environment() != environment(this_player()) ) { return "#That is not within your reach!"; } if( FuelRequired && !GetFuelAmount() ) *************** *** 127,132 **** --- 127,151 ---- return indirect_burn_obs_with_obj(targets, source); } + mixed CanExtinguish(object who) { + if( environment() != this_player() && + environment() != environment(this_player()) ) { + return "#That is not within your reach!"; + } + if( !GetBurning() ) return "It is not burning!"; + return 1; + } + + mixed direct_extinguish_obj(){ + return CanExtinguish(this_player()); + } + + mixed eventExtinguish(){ + eventDarken(); + set_heart_beat(Heat = 0); + return 1; + } + mixed eventBurnOut() { if( FuelRequired ) { SetFuelAmount(0); diff -c -r --new-file ds1.1/lib/lib/chapel.c ds2.0r27/lib/lib/chapel.c *** ds1.1/lib/lib/chapel.c Sun Feb 1 21:30:11 1998 --- ds2.0r27/lib/lib/chapel.c Wed Jul 5 00:00:58 2006 *************** *** 28,34 **** /* ********** /lib/chapel.c modal methods ********** */ mixed CanMarry(object who, object spouse1, object spouse2) { mixed tmp; - string cls; if( (tmp = spouse1->CanMarry(who, spouse2)) != 1 ) { if( tmp ) return tmp; --- 28,33 ---- *************** *** 41,60 **** if( archp(who) ) { return 1; } ! if( (string)who->GetReligion(1) == Religion[1] ) { ! foreach(cls in Classes) ! if( (int)who->ClassMember(cls) ) return 1; ! } ! return "You are not allowed to perform marriages here."; } mixed CanSacrifice(object who, object what, string deus) { if( (string)who->GetReligion(1) != Religion[1] ) ! return "You must hold the beliefs of " + Religion[1] + " to do that."; if( !((int)what->GetVendorType() & SacrificeType) ) ! return "You cannot sacrifice that here."; if( member_array(deus, DeityIds) == -1 ) ! return "You do not worship anything called \"" + deus + "\"."; return AllowSacrifice; } --- 40,55 ---- if( archp(who) ) { return 1; } ! return 1; } mixed CanSacrifice(object who, object what, string deus) { if( (string)who->GetReligion(1) != Religion[1] ) ! return "You must hold the beliefs of " + Religion[1] + " to do that."; if( !((int)what->GetVendorType() & SacrificeType) ) ! return "You cannot sacrifice that here."; if( member_array(deus, DeityIds) == -1 ) ! return "You do not worship anything called \"" + deus + "\"."; return AllowSacrifice; } *************** *** 66,83 **** spouse1->SetMarried(0); return tmp; } ! spouse1->eventPrint((string)who->GetName() + " weds you to " + ! (string)spouse2->GetName() + "."); ! spouse2->eventPrint((string)who->GetName() + " weds you to " + ! (string)spouse1->GetName() + "."); ! who->eventPrint("You join " + (string)spouse1->GetName() + " to " + ! (string)spouse2->GetName() + " in marriage."); ! this_object()->eventPrint((string)who->GetName() + " joins " + ! (string)spouse1->GetName() + " and " + ! (string)spouse2->GetName() + ".", ! ({ spouse1, spouse2, who })); ! who->AddSkillPoints("faith", random(100)); ! return 1; } mixed eventSacrifice(object who, object what, string deus) { --- 61,78 ---- spouse1->SetMarried(0); return tmp; } ! spouse1->eventPrint((string)who->GetName() + " weds you to " + ! (string)spouse2->GetName() + "."); ! spouse2->eventPrint((string)who->GetName() + " weds you to " + ! (string)spouse1->GetName() + "."); ! who->eventPrint("You join " + (string)spouse1->GetName() + " to " + ! (string)spouse2->GetName() + " in marriage."); ! this_object()->eventPrint((string)who->GetName() + " joins " + ! (string)spouse1->GetName() + " and " + ! (string)spouse2->GetName() + ".", ! ({ spouse1, spouse2, who })); ! who->AddSkillPoints("faith", random(100)); ! return 1; } mixed eventSacrifice(object who, object what, string deus) { *************** *** 96,105 **** string *SetDeities(string *deities) { string *ids = ({}); ! Deities = deities; foreach(string deus in deities) ! ids += explode(lower_case(deus), " "); DeityIds = ids; return Deities; } --- 91,100 ---- string *SetDeities(string *deities) { string *ids = ({}); ! Deities = deities; foreach(string deus in deities) ! ids += explode(lower_case(deus), " "); DeityIds = ids; return Deities; } diff -c -r --new-file ds1.1/lib/lib/chat.c ds2.0r27/lib/lib/chat.c *** ds1.1/lib/lib/chat.c Sun Feb 1 21:30:18 1998 --- ds2.0r27/lib/lib/chat.c Wed Jul 5 00:00:58 2006 *************** *** 4,10 **** * created by Descartes of Borg 950323 */ ! #include <daemons.h> #include "include/chat.h" --- 4,10 ---- * created by Descartes of Borg 950323 */ ! #include <lib.h> #include <daemons.h> #include "include/chat.h" *************** *** 12,19 **** private static mapping Channels; static void create() { - Channels = ([ ]); RestrictedChannels = ({ }); } static string chat_command(string str) { --- 12,23 ---- private static mapping Channels; static void create() { RestrictedChannels = ({ }); + Channels = ([ ]); + } + + mapping returnChannels(){ + return Channels; } static string chat_command(string str) { *************** *** 31,38 **** if( cmd == "list" && (int)CHAT_D->cmdChannel(cmd, arg) ) return ""; else if( Channels[cmd] && (int)CHAT_D->cmdChannel(cmd, arg) ) return ""; else if( sscanf(cmd, "%semote", cmd) == 1 && Channels[cmd] ) { ! if( (int)CHAT_D->cmdChannel(cmd+"emote", arg) ) return ""; ! else return str; } else return str; } --- 35,42 ---- if( cmd == "list" && (int)CHAT_D->cmdChannel(cmd, arg) ) return ""; else if( Channels[cmd] && (int)CHAT_D->cmdChannel(cmd, arg) ) return ""; else if( sscanf(cmd, "%semote", cmd) == 1 && Channels[cmd] ) { ! if( (int)CHAT_D->cmdChannel(cmd+"emote", arg) ) return ""; ! else return str; } else return str; } *************** *** 46,53 **** } int eventDestruct() { ! catch(CHAT_D->eventRemoveMember(keys(Channels))); ! return 1; } string *AddChannel(mixed val) { --- 50,57 ---- } int eventDestruct() { ! if(CHAT_D->eventRemoveMember(keys(Channels))) return 1; ! else return 0; } string *AddChannel(mixed val) { *************** *** 57,62 **** --- 61,73 ---- if( stringp(val) ) val = ({ val }); else if( !pointerp(val) ) error("Bad argument 1 to AddChannel().\n"); val = val - RestrictedChannels; + if(arrayp(val)){ + foreach(string channel in val){ + if(member_array(channel,this_player()->GetExtraChannels()) == -1){ + this_player()->AddExtraChannels( ({ channel }) ); + } + } + } tmp = (string *)CHAT_D->eventRegisterMember(val); for(i=0, maxi = sizeof(tmp); i < maxi; i++) Channels[tmp[i]] = 1; return keys(Channels); *************** *** 68,73 **** --- 79,91 ---- if( stringp(val) ) val = ({ val }); else if( !pointerp(val) ) error("Bad argument 1 to RemoveChannel().\n"); + if(arrayp(val)){ + foreach(string channel in val){ + if(member_array(channel,this_player()->GetExtraChannels()) != -1){ + this_player()->RemoveExtraChannels( ({ channel }) ); + } + } + } tmp = (string *)CHAT_D->eventRemoveMember(val); for(i=0, maxi = sizeof(tmp); i < maxi; i++) map_delete(Channels, tmp[i]); return keys(Channels); diff -c -r --new-file ds1.1/lib/lib/clan.c ds2.0r27/lib/lib/clan.c *** ds1.1/lib/lib/clan.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/clan.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,162 ---- + #include <lib.h> + #include "include/clan.h" + + private class ClanClass Clan; + + private int isWelcomed; + + static void create() { + Clan = new(class ClanClass); + Clan->leader = 0; + Clan->name = 0; + Clan->objectName = 0; + Clan->skill = 0; + isWelcomed = 0; + } + + static void init() { + if(!present(this_object(), this_player())) return; + if((string)this_player()->GetClan() != (string)GetClanName()) return; + if((string)this_player()->GetKeyName() == (string)GetLeader()) { + add_action("eventBring", "bring"); + add_action("eventInitiate", "initiate"); + add_action("eventRetire", "retire"); + } + this_player()->eventPrint("\n"); + if(!isWelcomed) { + this_player()->AddChannel(GetClanName()); + eventWelcome(this_player()); + isWelcomed = 1; + } + } + + mixed CanJoin(object ob) { return 1; } + + string GetAffectLong(object ob) { + if(!ob || !living(ob)) return 0; + return ob->GetName() + " is a member of the " + + pluralize(GetClanName()) + "."; + } + + string SetLeader(string str) { + if(!user_exists(str)) error("No such user: " + str + + ". You must have a real leader."); + if(!stringp(Clan->leader)) + Clan->leader = str; + return Clan->leader; + } + + string GetLeader() { return Clan->leader; } + + string SetClanName(string str) { + if(!stringp(Clan->name)) Clan->name = str; + return Clan->name; + } + + string GetClanName() { return Clan->name; } + + string SetClanObject(string str) { + if(!stringp(Clan->objectName)) Clan->objectName = str; + return Clan->objectName; + } + + string GetClanObject() { return Clan->objectName; } + + string SetClanSkill(string str) { + if(!stringp(Clan->skill)) Clan->skill = str; + return Clan->skill; + } + + string GetClanSkill() { return Clan->skill; } + + int eventBring(string str) { + object who; + + if(!str) return notify_fail("Bring whom?\n"); + who = find_player(lower_case(str)); + if(!who) + return notify_fail(who->GetName() + " is nowhere to be found.\n"); + if((string)who->GetClan() != (string)GetClanName()) + return notify_fail(who->GetName() + " is not one of you!\n"); + if( environment(who)->GetProperty("no teleport") + || environment(this_player())->GetProperty("no teleport") + || environment(this_player())->GetProperty("no magic")) + return notify_fail("A magic force blocks your powers.\n"); + if(present(who, environment(this_player()))) + return notify_fail(capitalize(str) + " is here.\n"); + if((int)this_player()->GetMagicPoints() < 70) + return notify_fail("Too low on magic power.\n"); + this_player()->AddMagicPoints(-70); + who->eventPrint("%^CYAN%^Your clan leader summons you.%^RESET%^"); + who->eventMoveLiving(environment(this_player())); + if(!present(who, environment(this_player()))) + this_player()->eventPrint("%^CYAN%^" + capitalize(str) + + " is beyond your reach.%^RESET%^"); + return 1; + } + + int eventInitiate(string str) { + object initiate; + object clanObject; + mixed ret; + + if(!str) return notify_fail("Initiate whom?\n"); + initiate = present(lower_case(str), environment(this_player())); + if(!initiate || !living(initiate)) + return notify_fail("No one of that nature here.\n"); + if(stringp(ret = CanJoin(initiate))) return notify_fail(ret); + else if(!ret) return ret; + if((int)this_player()->GetMagicPoints() < 300) + return notify_fail("Too low on magic power.\n"); + if(initiate->GetClan()) + return notify_fail("You may only initiate people without clan " + + "affiliation.\n"); + initiate->SetClan((string)GetClanName()); + initiate->SetSkill(GetClanSkill(), 1, 1); + if(clanObject = new((string)GetClanObject())) + clanObject->eventMove(initiate); + this_player()->AddMagicPoints(-300); + eventJoin(initiate); + return 1; + } + + void eventJoin(object ob) { + ob->eventPrint("%^YELLOW%^You are now a member of the " + + pluralize((string)GetClanName()) + ".%^RESET%^"); + environment(ob)->eventPrint("%^YELLOW%^" +(string)ob->GetName() + + " is now a member of the " + + pluralize((string)GetClanName()) + ".%^RESET%^", ob); + } + + int eventRetire(string str) { + object retiree; + object clanObject; + + if(!str) return notify_fail("Retire whom?\n"); + retiree = present(lower_case(str), environment(this_player())); + if(!retiree || !living(retiree)) + return notify_fail("No one of that nature here.\n"); + if((string)retiree->GetClan() != (string)GetClanName()) + return notify_fail(retiree->GetName() + " is not one of us!\n"); + clanObject = present(GetClanName() + "_clan_object", retiree); + if(!clanObject) error("Problem with clan object."); + clanObject->eventDestruct(); + retiree->SetClan(0); + // retiree->SetSkill(GetClanSkill(), 1, 1); We need to remove skill here. + eventUnjoin(retiree); + return 1; + } + + void eventUnjoin(object ob) { + ob->eventPrint("%^RED%^You are no longer a member of the " + + pluralize((string)GetClanName()) + ".%^RESET%^"); + environment(ob)->eventPrint("%^RED%^" + (string)ob->GetName() + + " is no longer a member of the " + + pluralize((string)GetClanName()) + ".%^RESET%^", ob); + } + + void eventWelcome(object ob) { + ob->eventPrint("%^YELLOW%^Welcome, fellow " + (string)GetClanName() + + ".%^RESET%^"); + } + diff -c -r --new-file ds1.1/lib/lib/classes.c ds2.0r27/lib/lib/classes.c *** ds1.1/lib/lib/classes.c Sun Feb 1 21:30:11 1998 --- ds2.0r27/lib/lib/classes.c Wed Jul 5 00:00:58 2006 *************** *** 1,6 **** /* /lib/classes.c * from the Dead Souls LPC Library ! * classes and guild handling object * created by Descartes of Borg 950123 * Version: @(#) classes.c 1.4@(#) * Last modified: 96/12/13 --- 1,6 ---- /* /lib/classes.c * from the Dead Souls LPC Library ! * classes and clan handling object * created by Descartes of Borg 950123 * Version: @(#) classes.c 1.4@(#) * Last modified: 96/12/13 *************** *** 13,19 **** inherit LIB_ABILITIES; private int Morality; ! private string Class, Guild; private mapping SkillModifiers; private string *Religion; --- 13,19 ---- inherit LIB_ABILITIES; private int Morality; ! private string Class, Clan; private mapping SkillModifiers; private string *Religion; *************** *** 22,28 **** SkillModifiers = ([]); Religion = allocate(2); Class = 0; ! Guild = 0; Morality = 0; } --- 22,28 ---- SkillModifiers = ([]); Religion = allocate(2); Class = 0; ! Clan = 0; Morality = 0; } *************** *** 61,67 **** string SetClass(string class_name) { mixed array args = allocate(3); mixed array tmp; ! CLASSES_D->SetClass(class_name, args); if( Class ) { string multi; --- 61,67 ---- string SetClass(string class_name) { mixed array args = allocate(3); mixed array tmp; ! CLASSES_D->SetClass(class_name, args); if( Class ) { string multi; *************** *** 71,78 **** } if( !args[0] ) { // No such secondary class return Class; ! } ! multi = args[0][Class]; if( !multi ) { // Can't multi-class in this combo return Class; } --- 71,78 ---- } if( !args[0] ) { // No such secondary class return Class; ! } ! multi = args[0][Class]; if( !multi ) { // Can't multi-class in this combo return Class; } *************** *** 93,103 **** } string ChangeClass(string class_name) { - mixed array args = allocate(3); - mixed array tmp; string cl; foreach(cl in GetSkills()) { ! RemoveSkill(cl); } Class = 0; return SetClass(class_name); --- 93,101 ---- } string ChangeClass(string class_name) { string cl; foreach(cl in GetSkills()) { ! RemoveSkill(cl); } Class = 0; return SetClass(class_name); *************** *** 109,124 **** return (int)CLASSES_D->ClassMember(Class, class_name); } ! string SetGuild(string guild) { return (Guild = guild); } ! string GetGuild() { return Guild; } int GetBaseStatLevel(string stat) { return 0; } int SetMorality(int x) { return (Morality = x); } int GetMorality() { return Morality; } ! string GetMoralityDescription() { string str; int x; --- 107,122 ---- return (int)CLASSES_D->ClassMember(Class, class_name); } ! string SetClan(string clan) { return (Clan = clan); } ! string GetClan() { return Clan; } int GetBaseStatLevel(string stat) { return 0; } int SetMorality(int x) { return (Morality = x); } int GetMorality() { return Morality; } ! string GetMoralityDescription() { string str; int x; diff -c -r --new-file ds1.1/lib/lib/clay.c ds2.0r27/lib/lib/clay.c *** ds1.1/lib/lib/clay.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/clay.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,86 ---- + #include <lib.h> + inherit LIB_STORAGE; + inherit LIB_SURFACE; + + private static string Composition, Name, ShortDesc, Desc; + private static string *Nouns, *Adjectives; + + varargs string SetComposition(string comp, string name, string *nouns, string *adjs, string + short, string desc); + void InitComposition(); + + void create(){ + string *tmpsave1, *tmpsave2, *tmpsave3, *tmpsave4; + surface::create(); + storage::create(); + tmpsave1 = storage::GetSave(); + tmpsave2 = surface::GetSave(); + tmpsave3 = ({ "Composition","Name","Nouns","ShortDesc", "Desc","Adjectives" }); + tmpsave4 = tmpsave1 + tmpsave2 + tmpsave3; + //tc("AddSave: "+identify(tmpsave4)); + AddSave( tmpsave4 ); + SetKeyName("lump"); + SetId( ({"lump","clay","mass"}) ); + SetAdjectives( ({"lump of","clay","mass of","heavy", "shapeless"}) ); + SetShort("a lump of clay"); + SetLong("This is a heavy, shapeless mass of clay."); + call_out( (: InitComposition :), 0); + SetNoCondition(1); + SetCanClose(0); + SetMaxCarry(200); + SetMass(200); + } + + void InitComposition(){ + //tc("made it to initcomp.","red"); + SetComposition(Composition, Name, Nouns, Adjectives, ShortDesc, Desc); + } + + varargs string SetComposition(string comp, string name, string *nouns, string *adjs, string short, string desc){ + string tmp; + //tc("made it to setcomp.","blue"); + + if(name) { + Name = name; + SetKeyName(name); + } + + if(comp) Composition = comp; + + if(comp && !Desc){ + tmp = replace_string(GetLong(),"clay",comp); + SetLong(tmp); + } + + if(comp && !ShortDesc){ + tmp = replace_string(GetShort(),"clay",comp); + SetShort(tmp); + } + + if(sizeof(nouns)){ + Nouns = nouns; + SetId(nouns); + } + + if(desc){ + Desc = desc; + SetLong(desc); + } + + if(short){ + ShortDesc = short; + SetShort(short); + } + + if(sizeof(adjs)){ + Adjectives = adjs; + SetAdjectives(adjs); + } + + return Composition; + } + + + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/lib/clerk.c ds2.0r27/lib/lib/clerk.c *** ds1.1/lib/lib/clerk.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/clerk.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,147 ---- + #include <lib.h> + #include <objects.h> + + mixed performMarriage(object spouse1, object spouse2) ; + int performDivorce(object ob1); + int eventRequest(mixed arg1, mixed arg2, mixed arg3); + int eventRequestDivorce(mixed arg1, mixed arg2, mixed arg3); + + inherit LIB_MAYOR; + void create(){ + ::create(); + SetKeyName("clerk"); + SetId("clerk"); + SetAdjectives("town"); + SetGender("male"); + SetRace("human"); + SetShort("the town clerk"); + SetLong("An officious-looking clerk."); + SetLocalCurrency("silver"); + SetClass("priest"); + AddCommandResponse("marry", (: eventRequest :)); + AddCommandResponse("wed", (: eventRequest :)); + AddCommandResponse("join", (: eventRequest :)); + AddCommandResponse("divorce", (: eventRequestDivorce :)); + SetLevel(4); + SetTax(5); + } + + int eventRequestDivorce(mixed arg1, mixed arg2, mixed arg3){ + this_object()->performDivorce(arg1); + return 1; + } + + int eventRequest(mixed arg1, mixed arg2, mixed arg3){ + string s1, s2, dudename; + object ob1, ob2; + if(strsrch(arg2,"divorce") != -1){ + this_object()->performDivorce(arg1); + return 1; + } + + if(sscanf(arg3,"%s and %s", s1, s2) !=2 && + sscanf(arg3,"%s to %s", s1, s2) !=2) { + eventForce("say "+arg1->GetName()+", you are confusing me."); + return 1; + } + + dudename = arg1->GetKeyName(); + if(s1 == "me" || s1 == "i") s1 = dudename; + if(s2 == "me" || s2 == "i") s2 = dudename; + + if(s1 != dudename && s2 != dudename ) { + eventForce("say Those people will have to decide "+ + "to get married on their own. It isn't "+ + "any of your business."); + return 1; + } + + if( s1 == s2) { + eventForce("say we don't do single-member marriages here."); + return 1; + } + if(! ob1 = present(s1, environment(this_object()))){ + eventForce("say "+capitalize(s1)+" isn't here."); + return 1; + } + if(! ob2 = present(s2, environment(this_object()))){ + eventForce("say "+capitalize(s2)+" isn't here."); + return 1; + } + + if(!living(ob1) || !living(ob2)){ + eventForce("say I do not perform marriages with inanimate objects."); + return 1; + } + this_object()->performMarriage(ob1, ob2); + return 1; + } + + mixed performMarriage(object spouse1, object spouse2) { + mixed tmp; + eventForce("say hmmm..."); + tmp = (mixed)environment(this_player())->CanMarry(this_player(), + spouse1, spouse2); + if( !tmp ) { + this_player()->eventPrint("This place is not holy to you."); + return 1; + } + else if( stringp(tmp) ) { + this_player()->eventPrint(tmp); + return 1; + } + tmp = (mixed)environment(this_player())->eventMarry(this_player(), + spouse1, spouse2); + if( tmp == 1 ) { + object ring; + + ring = new(OBJ_WED_RING); + ring->SetSpouse((string)spouse2->GetCapName()); + ring->eventMove(spouse1); + ring = new(OBJ_WED_RING); + ring->SetSpouse((string)spouse1->GetCapName()); + ring->eventMove(spouse2); + } + } + + int performDivorce(object ob1){ + string spouse1, spouse2; + object ring1, ring2, ob2; + + spouse1 = ob1->GetKeyName(); + if(!ob1->GetSpouse()){ + eventForce("say You don't appear to be married."); + return 1; + } + spouse2 = lower_case(ob1->GetSpouse()); + ob2 = find_player(spouse2); + + if(!ob1->CanDivorce(ob1)) { + eventForce("say I cannot perform this divorce. Are you sure "+ + "you are still married?"); + return 1; + } + + if(!find_player(spouse1) || !ob1 ){ + eventForce("say I'm sorry. Both spouses must be logged "+ + "on for a divorce to take place."); + return 1; + } + + ob1->eventDivorce(ob1); + ob2->eventDivorce(ob2); + + ring1 = present("official wedding ring",ob1); + ring2 = present("official wedding ring",ob2); + + if(ring1) ring1->eventDestruct(); + if(ring2) ring2->eventDestruct(); + + eventForce("say The divorce is complete."); + tell_player(spouse1,"%^RED%^You are now divorced from "+capitalize(spouse2)+"%^RESET%^!"); + tell_player(spouse2,"%^RED%^You are now divorced from "+capitalize(spouse1)+"%^RESET%^!"); + eventForce("shout this office duly records and announces that "+capitalize(spouse1) +" has divorced "+capitalize(spouse2)+"!"); + return 1; + } + + diff -c -r --new-file ds1.1/lib/lib/clip.c ds2.0r27/lib/lib/clip.c *** ds1.1/lib/lib/clip.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/clip.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,63 ---- + #include <lib.h> + #include "include/clip.h" + #include <vendor_types.h> + inherit LIB_STORAGE; + private int caliber, millimeter, MaxAmmo, ammo; + private string pistoltype,ammotype; + void create(){ + ::create(); + SetKeyName("magazine"); + SetId(({"clip","magazine"})); + SetAdjectives(({"ammunition","pistol"})); + SetShort("a pistol ammunition clip"); + SetLong("This is a slender, spring-loaded container for semiautomatic "+ + "pistol ammunition."); + SetMass(10); + SetValue(1); + SetVendorType(VT_TREASURE); + } + int CanReceive(object ob){ + string *namen; + namen=ob->GetId(); + if(member_array("bullet",namen) == -1){ + write("Only bullets fit into the magazine."); + return 0; + } + if(ob->GetAmmoType() != this_object()->GetAmmoType() ){ + write("That round is not the correct type for the magazine."); + return 0; + } + if(ob->GetMillimeter() != this_object()->GetMillimeter() ){ + write("That round is not the correct size for the magazine."); + return 0; + } + if(ob->GetCaliber() != this_object()->GetCaliber() ){ + write("That round is not the correct caliber for the magazine."); + return 0; + } + if(ob->GetPistolType() != "auto" && ob->GetRifleType() != "auto"){ + write("That round is not a semiautomatic round."); + return 0; + } + if(ammo == MaxAmmo){ + write("The magazine is filled to capacity."); + return 0; + } + ammo++; + return 1; + } + int CanRelease(object ob){ + ammo--; + return 1; + } + int MinusAmmo(int i) { ammo -= i; return 1; } + int PlusAmmo(int i) { ammo += i; return 1; } + int SetMaxAmmo(int i) { MaxAmmo=i; return 1; } + int SetPistolType(string str) {pistoltype=str; return 1; } + int SetAmmoType(string str) {ammotype=str; return 1; } + int SetCaliber(int x) { caliber=x; return 1; } + int SetMillimeter(int x){ millimeter=x; return 1; } + int GetMillimeter() { return millimeter; } + int GetCaliber() { return caliber; } + string GetPistolType() { return pistoltype; } + string GetAmmoType() { return ammotype; } diff -c -r --new-file ds1.1/lib/lib/combat.c ds2.0r27/lib/lib/combat.c *** ds1.1/lib/lib/combat.c Sun Feb 1 21:30:14 1998 --- ds2.0r27/lib/lib/combat.c Wed Jul 5 00:00:58 2006 *************** *** 8,13 **** --- 8,14 ---- #include <lib.h> #include <rounds.h> + #include <config.h> #include <daemons.h> #include <position.h> #include <damage_types.h> *************** *** 17,29 **** inherit LIB_CLASSES; inherit LIB_COMBATMSG; ! private int Wimpy; private string WimpyCommand; private static int cParalyzed, tNextRound; private static string TargetLimb, Party; private static object CurrentEnemy; private static function fParalyzed, fNextRound; ! private static object *Hostiles, *Enemies, *SpecialTargets; string GetName(); mixed GetProperty(string key); --- 18,31 ---- inherit LIB_CLASSES; inherit LIB_COMBATMSG; ! private int Wimpy, Dead; private string WimpyCommand; private static int cParalyzed, tNextRound; private static string TargetLimb, Party; private static object CurrentEnemy; private static function fParalyzed, fNextRound; ! private static object *Hostiles, *Enemies, *SpecialTargets, *NonTargets; ! private static object *PriorEnemies; string GetName(); mixed GetProperty(string key); *************** *** 43,48 **** --- 45,51 ---- classes::create(); Hostiles = ({}); Enemies = ({}); + NonTargets = ({}); CurrentEnemy = SpecialTargets = 0; Party = 0; fParalyzed = 0; *************** *** 54,59 **** --- 57,66 ---- } /* ***************** /lib/combat.c data functions ***************** */ + int GetDead(){ + return Dead; + } + object array GetEnemies() { return Enemies; } *************** *** 106,118 **** private static void SortEnemies() { if( !sizeof(Enemies = filter(Enemies, (: ($1 && living($1)) :))) ) { ! Hostiles = ({}); ! CurrentEnemy = 0; ! return; } Hostiles = (Hostiles & Enemies); } int AddHostile(object ob) { if( !ob || (member_array(ob, Hostiles) != -1) ) { return 0; --- 113,155 ---- private static void SortEnemies() { if( !sizeof(Enemies = filter(Enemies, (: ($1 && living($1)) :))) ) { ! Hostiles = ({}); ! CurrentEnemy = 0; ! return; } Hostiles = (Hostiles & Enemies); } + mixed *AddNonTargets(mixed val){ + if(!arrayp(val)) val = ({ val }); + foreach(object member in val){ + if(member_array(member,NonTargets) == -1){ + if(base_name(this_object()) != base_name(member)) NonTargets += ({ member }); + } + } + return NonTargets; + } + + mixed *RemoveNonTargets(mixed val){ + if(!val) val = ({}); + if(!arrayp(val)) val = ({ val }); + if(!sizeof(val)){ + NonTargets = ({}); + return NonTargets; + } + foreach(object member in val){ + if(member_array(member,NonTargets) != -1){ + NonTargets -= ({ member }); + } + } + return NonTargets; + } + + object *GetNonTargets(){ + return NonTargets; + } + + int AddHostile(object ob) { if( !ob || (member_array(ob, Hostiles) != -1) ) { return 0; *************** *** 140,159 **** return SpecialTargets; } varargs int SetParalyzed(int count, function f) { if(count < 1) { ! count = cParalyzed = 0; ! fParalyzed = 0; } else { ! fParalyzed = f; ! cParalyzed = count; } return count; } int GetParalyzed() { return cParalyzed; } string SetParty(string str) { if( file_name(previous_object()) != PARTY_D ) return Party; if( str ) AddChannel(str); --- 177,218 ---- return SpecialTargets; } + object array SetSpecialTarget(object *cibles) { + if(cibles) SpecialTargets = cibles; + return SpecialTargets; + } + varargs int SetParalyzed(int count, function f) { if(count < 1) { ! count = cParalyzed = 0; ! fParalyzed = 0; } else { ! fParalyzed = f; ! cParalyzed = count; } return count; } int GetParalyzed() { return cParalyzed; } + int eventQuell(){ + object *truced; + truced = get_livings(environment(this_object())); + if(sizeof(Enemies)) PriorEnemies = Enemies; + Enemies = ({}); + AddNonTargets(truced); + return 1; + } + + int eventUnQuell(){ + object *truced; + truced = GetNonTargets(); + if(sizeof(PriorEnemies)) Enemies += PriorEnemies; + if(sizeof(truced)) RemoveNonTargets(truced); + return 1; + } + string SetParty(string str) { if( file_name(previous_object()) != PARTY_D ) return Party; if( str ) AddChannel(str); *************** *** 167,180 **** varargs int SetAttack(mixed target, function callback, int type) { int i; if( objectp(target) ) target = ({ target }); if( target ) { ! if( member_array(this_object(), target) != -1 ) return 0; ! if( !GetCurrentEnemy() ) call_out((: eventExecuteAttack :), 0, target); ! i = sizeof(target); ! while(i--) if( AddEnemy(target[i]) ) AddHostile(target[i]); ! SpecialTargets = target; } fNextRound = callback; tNextRound = (type || ROUND_UNDEFINED); --- 226,261 ---- varargs int SetAttack(mixed target, function callback, int type) { int i; + string *voibs = ({ "kill", "target", "smite", "waste", "hit", "attack" }); if( objectp(target) ) target = ({ target }); if( target ) { ! if( member_array(this_object(), target) != -1 ) return 0; ! if(sizeof(NonTargets) && member_array(query_verb(),voibs) != -1){ ! foreach(object individual in target){ ! if(member_array(individual,NonTargets) != -1){ ! NonTargets -= ({ individual }); ! } ! } ! } ! else if(sizeof(NonTargets)){ ! foreach(object individual in target){ ! if(member_array(individual,NonTargets) != -1) target -= ({ individual }); ! } ! if(!sizeof(target)) return 0; ! } ! ! if( !GetCurrentEnemy() ) call_out((: eventExecuteAttack :), 0, target); ! i = sizeof(target); ! while(i--) if( AddEnemy(target[i]) ) AddHostile(target[i]); ! if(!sizeof(SpecialTargets) ) SpecialTargets = target; ! else { ! int spec_targ_here; ! foreach(object t in SpecialTargets){ ! if(t && present(t->GetKeyName(),environment(this_player()))) spec_targ_here = 1; ! } ! if(!spec_targ_here) SpecialTargets = target; ! } } fNextRound = callback; tNextRound = (type || ROUND_UNDEFINED); *************** *** 187,193 **** int GetInCombat() { return sizeof(filter(GetEnemies(), ! (: $1 && (environment($1) == environment()) :))); } int GetBaseStatLevel(string stat) { --- 268,274 ---- int GetInCombat() { return sizeof(filter(GetEnemies(), ! (: $1 && (environment($1) == environment()) :))); } int GetBaseStatLevel(string stat) { *************** *** 224,232 **** return val + GetLuck(); } ! int GetCombatChance(int val) { ! val = val + random((val * GetMobility())/250); val = (val/(3- visibility()) + GetLuck()); if( GetBlind() ) { return val/10; --- 305,313 ---- return val + GetLuck(); } ! int GetCombatChance(int val) { ! val = val + random((val * GetMobility())/50); val = (val/(3- visibility()) + GetLuck()); if( GetBlind() ) { return val/10; *************** *** 249,255 **** int GetCombatBonus(int level) { int diff = level - GetLevel(); ! if( diff >= 6 && diff < 16 ) { return 4; } --- 330,336 ---- int GetCombatBonus(int level) { int diff = level - GetLevel(); ! if( diff >= 6 && diff < 16 ) { return 4; } *************** *** 293,361 **** int CanWeapon(object target, string type, int hands, int num) { string limb = target->GetRandomLimb(TargetLimb); int chance = (7*GetSkillLevel(type+" attack") + ! 3*GetStatLevel("coordination"))/10; int div = 2; int x, y; ! ! if(hands > 1) { ! if(GetSkillLevel("multi-hand")) { ! chance = (chance/2) + ! (GetSkillLevel("multi-hand")/75)*(chance/2); ! } ! else { /* If you are really strong you can use multihand a bit */ ! chance *= GetStatLevel("strength")/300; ! div += (hands-1); ! } ! } ! if(num > 1) { ! if(GetSkillLevel("multi-weapon")) { ! chance = (chance/2) + ! (GetSkillLevel("multi-weapon")/75)*(chance/2); ! } ! else { /* If you are really coordinated you can use multiweap a bit */ ! chance *= GetStatLevel("coordination")/300; ! div += (num-1); ! } ! } chance = GetCombatChance(chance/div); x = random(chance); y = random(10); if( x <= y ) { ! if( x > y/2 ) { ! TargetLimb = target->GetRandomLimb(0); ! } ! else { ! TargetLimb = 0; ! } } else { TargetLimb = limb; } return chance; } ! int CanMelee(object target) { ! string limb = target->GetRandomLimb(TargetLimb); ! int chance = ( 7*GetSkillLevel("melee attack") + ! 3*GetStatLevel("coordination") )/10; ! int y = random(10); ! int x; ! ! chance = GetCombatChance(chance/2); ! x = random(chance); ! if( x <= y ) { ! if( x > y/2 ) { ! TargetLimb = target->GetRandomLimb(0); } else { ! TargetLimb = 0; } } else { ! TargetLimb = limb; } - return chance; } static int Destruct() { --- 374,470 ---- int CanWeapon(object target, string type, int hands, int num) { string limb = target->GetRandomLimb(TargetLimb); int chance = (7*GetSkillLevel(type+" attack") + ! 3*GetStatLevel("coordination"))/10; int div = 2; int x, y; ! ! if(hands > 1) { ! if(GetSkillLevel("multi-hand")) { ! chance = (chance/2) + ! (GetSkillLevel("multi-hand")/75)*(chance/2); ! } ! else { /* If you are really strong you can use multihand a bit */ ! chance *= GetStatLevel("strength")/300; ! div += (hands-1); ! } ! } ! if(num > 1) { ! if(GetSkillLevel("multi-weapon")) { ! chance = (chance/2) + ! (GetSkillLevel("multi-weapon")/75)*(chance/2); ! } ! else { /* If you are really coordinated you can use multiweap a bit */ ! chance *= GetStatLevel("coordination")/300; ! div += (num-1); ! } ! } chance = GetCombatChance(chance/div); x = random(chance); y = random(10); if( x <= y ) { ! if( x > y/2 ) { ! TargetLimb = target->GetRandomLimb(0); ! } ! else { ! TargetLimb = 0; ! } } else { TargetLimb = limb; } + //tc("chance: "+chance); return chance; } ! int CanMelee(object target) { ! if(!this_object()->GetMelee()){ ! ! string limb = target->GetRandomLimb(TargetLimb); ! int chance = ( 6*GetSkillLevel("melee attack") + ! 2*GetStatLevel("coordination") )/20; ! int y = random(10); ! int x; ! ! chance = GetCombatChance(chance/3); ! x = random(chance); ! if( x <= y ) { ! if( x > y/2 ) { ! TargetLimb = target->GetRandomLimb(0); ! } ! else { ! TargetLimb = 0; ! } } else { ! TargetLimb = limb; } + //tc("chance: "+chance); + return chance; } else { ! string limb = target->GetRandomLimb(TargetLimb); ! int chance = ( 7*GetSkillLevel("melee attack") + ! 3*GetStatLevel("coordination") )/10; ! int y = random(10); ! int x; ! ! chance = GetCombatChance(chance/2); ! x = random(chance); ! if( x <= y ) { ! if( x > y/2 ) { ! TargetLimb = target->GetRandomLimb(0); ! } ! else { ! TargetLimb = 0; ! } ! } ! else { ! TargetLimb = limb; ! } ! //tc("chance: "+chance); ! return chance; } } static int Destruct() { *************** *** 365,374 **** /* ***************** /lib/combat.c events ***************** */ ! varargs int eventDie(object agent) { object ob; int x; x = race::eventDie(agent); if( x != 1 ) { return x; --- 474,486 ---- /* ***************** /lib/combat.c events ***************** */ ! varargs int eventDie(mixed agent) { object ob; int x; + if(Dead) return 1; + Dead = 1; + x = race::eventDie(agent); if( x != 1 ) { return x; *************** *** 380,385 **** --- 492,498 ---- } environment()->eventLivingDied(this_object(), agent); Enemies = ({}); + flush_messages(); return 1; } *************** *** 389,903 **** int type = tNextRound; int position = GetPosition(); fNextRound = 0; tNextRound = ROUND_UNDEFINED; ! if( position == POSITION_LYING || position == POSITION_SITTING ) { ! eventPrint("You can't fight unless you are standing up!"); return 0; } if( arrayp(target) ) { if( !f || (functionp(f) & FP_OWNER_DESTED) ) { return 0; /* built in only handles 1 targ */ } ! target = filter(target, function(object ob) { ! if( !ob ) { ! return 0; ! } ! if( !ob->eventPreAttack(this_object()) ) { ! return 0; ! } ! return 1; ! }); ! if( !sizeof(target) ) { return 0; } ! } ! else if( !target->eventPreAttack(this_object()) ) { return 0; } - switch(type) { - case ROUND_UNDEFINED: - if( functionp(f) && !(functionp(f) & FP_OWNER_DESTED) ) { - return evaluate(f, target); - } - if( sizeof(weapons = GetWielded()) ) { - return eventWeaponRound(target, weapons); - } - else { - return eventMeleeRound(target, 0); - } - - case ROUND_MAGIC: - return eventMagicRound(target, f); ! case ROUND_MELEE: ! return eventMeleeRound(target, functionp(f) ? f : 0); ! case ROUND_WEAPON: ! return eventWeaponRound(target, functionp(f) ? f : GetWielded()); ! case ROUND_OTHER: ! if( functionp(f) && !(functionp(f) & FP_OWNER_DESTED) ) { ! return evaluate(f); } ! else { return 0; } ! default: return 0; } - return 0; - } - - int eventWeaponRound(mixed target, mixed val) { - object array weapons = 0; - function f = 0; ! if( arrayp(val) ) { ! weapons = val; ! } ! else if( functionp(val) && !(functionp(val) & FP_OWNER_DESTED) ) { ! f = val; ! } ! else { ! return 0; ! } ! if( f ) { ! evaluate(f, target); ! } ! else { ! int count = sizeof(weapons); ! ! foreach(object weapon in weapons) { ! if( !target ) { ! break; ! } ! eventWeaponAttack(target, weapon, count); ! } ! } ! return target->GetDying(); ! } ! ! void eventWeaponAttack(object target, object weapon, int num){ ! string weapon_type = weapon->GetWeaponType(); ! int hands = weapon->GetHands(); ! int level = target->GetLevel(); ! int bonus = GetCombatBonus(level); ! int power, pro, con; ! ! if( target->GetDying() ) { ! return; } ! pro = CanWeapon(target, weapon_type, hands, num); ! power = random(pro); ! con = target->GetDefenseChance(target->GetSkillLevel(weapon_type + ! " defense")); ! if( !TargetLimb ) { // If the thing stood still, I still missed ! eventTrainSkill(weapon_type + " attack", pro, 0, 0, bonus); ! if( hands > 1 ) { ! eventTrainSkill("multi-hand", pro, 0, 0, bonus); ! } ! if( num > 1 ) { ! eventTrainSkill("multi-weapon", pro, 0, 0, bonus); ! } ! SendWeaponMessages(target, -2, weapon, TargetLimb); ! } ! else if( !target->eventReceiveAttack(power, weapon_type, this_object()) ) { ! // Target avoided the attack ! eventTrainSkill(weapon_type + " attack", pro, con, 0, bonus); ! if( hands > 1 ) { ! eventTrainSkill("multi-hand", pro, con, 0, bonus); ! } ! if( num > 1 ) { ! eventTrainSkill("multi-weapon", pro, con, 0, bonus); ! } ! SendWeaponMessages(target, -1, weapon, TargetLimb); ! } ! else { // I hit, but how hard did I hit? ! int damage_type, damage, weapon_damage, actual_damage; ! eventTrainSkill(weapon_type + " attack", pro*2, con, 1, bonus); ! damage_type = weapon->GetDamageType(); ! damage = (weapon->eventStrike(target) * pro)/100; ! damage = GetDamage(damage, weapon_type + " attack"); ! actual_damage = target->eventReceiveDamage(this_object(), damage_type, ! damage, 0, TargetLimb); ! if( actual_damage < 1 ) { ! actual_damage = 0; ! } ! weapon_damage = damage - actual_damage; ! if( weapon_damage > 0 ) { ! weapon->eventReceiveDamage(this_object(), BLUNT, weapon_damage, ! 0, TargetLimb); } ! if( !target->GetDying() ) { ! SendWeaponMessages(target, actual_damage, weapon, TargetLimb); } else { ! eventPrint(possessive_noun(target) + " death is now on your " ! "head."); ! target->eventPrint(GetName() + " is your murderer."); ! environment()->eventPrint(possessive_noun(target) + ! " death is now on " + ! possessive_noun(this_object()) ! + " head.", ({ this_object(), target })); ! } } - } ! int eventMeleeRound(mixed target, function f) { ! string array limbs = GetLimbs() - ({ GetTorso() }); ! int count = sizeof(limbs); ! int attacks; ! ! if( count < 1 ) { ! return 0; ! } ! if( !f || (functionp(f) & FP_OWNER_DESTED) ) { ! attacks = 1 + random(GetSkillLevel("melee attack"))/50; ! while( attacks-- ) { ! if( target->GetDying() ) { ! break; } - eventMeleeAttack(target, limbs[random(count)]); } } - else { - evaluate(f, target, limbs[random(count)]); - } - return target->GetDying(); - } ! void eventMeleeAttack(object target, string limb) { ! string array limbs; ! int pro, con; ! int chance; ! ! if( target->GetDying() ) { ! return; ! } ! pro = CanMelee(target); ! con = target->GetDefenseChance(target->GetSkillLevel("melee defense")); ! chance = random(pro); ! if( !TargetLimb ) { // I *really* missed ! SendMeleeMessages(target, -2); ! eventTrainSkill("melee attack", pro, 0, 0, ! GetCombatBonus(target->GetLevel())); ! } ! else if( !target->eventReceiveAttack(chance, "melee", this_object()) ) { ! // Enemy dodged my attack ! SendMeleeMessages(target, -1); ! eventTrainSkill("melee attack", pro, con, 0, ! GetCombatBonus(target->GetLevel())); ! } ! else { ! int x; ! ! // I hit, how hard? ! eventTrainSkill("melee attack", pro, con, 1, ! GetCombatBonus(target->GetLevel())); ! x = GetDamage(3*chance/4, "melee attack"); ! x = target->eventReceiveDamage(this_object(), BLUNT, x, 0, ! TargetLimb); ! if( !target->GetDying() ) { ! SendMeleeMessages(target, (x > 0) ? x : 0, TargetLimb); ! } ! else { ! eventPrint(possessive_noun(target) + " death is now " ! "on your head."); ! target->eventPrint(GetName() + " is your murderer."); ! environment()->eventPrint(possessive_noun(target) + ! " death is now on " + ! possessive_noun(this_object()) + ! " head.", ({ this_object(), target })); ! } } - } ! int eventMagicRound(mixed target, function f) { ! evaluate(f, target); ! return target->GetDying(); ! } ! ! mixed eventBite(object target) { ! int pro = CanMelee(target); ! int con = target->GetDefenseChance(target->GetSkillLevel("melee defense")); ! int x = random(pro); ! ! if( environment() != environment(target) ) { ! eventPrint(target->GetName() + " has gone away."); ! return 1; ! } ! if( TargetLimb ) { ! if( target->eventReceiveAttack(x, "melee", this_object()) ) { ! x = GetDamage(pro/4, "melee attack"); ! x = target->eventReceiveDamage(this_object(), KNIFE, x, 0, ! TargetLimb); ! if( x < 1 ) { ! target->eventPrint(possessive_noun(this_object()) + " bite " ! "is nothing more than a pinch."); ! eventPrint("Your bite is nothing more than a pinch."); ! environment()->eventPrint(possessive_noun(this_object()) + ! " bite is nothing more than a " ! "pinch.", ! ({ target, this_object() })); } else { ! target->eventPrint(GetName() + " bites you in the " + ! TargetLimb + "!"); ! eventPrint("You bite " + target->GetName() + " in the " + ! TargetLimb + "!"); ! environment()->eventPrint(GetName() + " bites " + ! target->GetName() + "in the " + ! TargetLimb + "!", ! ({ target, this_object() })); } - eventTrainSkill("melee attack", pro, con, 1, - GetCombatBonus(target->GetLevel())); } else { ! target->eventPrint("You avoid " + possessive_noun(this_object()) + ! " bite."); ! eventPrint(target->GetName() + " avoids your bite."); ! environment()->eventPrint(target->GetName() + " avoids " + ! possessive_noun(this_object()) + ! " bite.", ! ({ this_object(), target })); ! eventTrainSkill("melee attack", pro, con, 0, ! GetCombatBonus(target->GetLevel())); } } - else { - eventPrint("You flounder about like a buffoon."); - environment()->eventPrint(GetName() + " flounders about like a " - "buffoon.", this_object()); - } - return 1; - } ! int eventPreAttack(object agent) { ! if( agent == this_object() ) { ! return 0; ! } ! if( environment()->GetProperty("no attack") ) { ! return 0; ! } ! if( GetDying() ) { ! return 0; ! } ! if( playerp(this_object()) && playerp(agent) ) { // No PK ! if( !environment()->CanAttack( agent, this_object() ) ) { ! return 0; } } - if( AddEnemy(agent) ) { - AddHostile(agent); - } - return 1; - } ! varargs int eventReceiveAttack(int speed, string def, object agent) { ! int x, y, pro, level, bonus; ! if( !agent ) { ! agent = previous_object(); ! } ! if( !living(agent) ) { ! level = 1; ! bonus = 1; ! } ! else { ! level = agent->GetLevel(); ! bonus = GetCombatBonus(level); ! } ! if( AddEnemy(agent) ) { ! AddHostile(agent); ! } ! if( def == "magic" ) { ! pro = GetMagicResistance(); ! if( (x = random(pro)) > speed ) { ! eventTrainSkill("magic defense", pro, speed, 1, bonus); ! return 0; ! } ! else { ! eventTrainSkill("magic defense", pro, speed, 0, bonus); ! return 1; ! } ! } ! else { ! pro = GetDefenseChance(GetSkillLevel(def + " defense")); ! x = random(pro = pro/2); ! if( x > speed ) { ! eventTrainSkill(def + " defense", pro, speed, 1, bonus); ! return 0; ! } ! else { ! eventTrainSkill(def + " defense", pro, speed, 0, bonus); ! return 1; ! } ! } ! } ! void eventKillEnemy(object ob) { ! int level; ! ! if( !ob ) return; ! level = ob->GetLevel(); ! if( member_array(ob, GetHostiles()) == -1 ) { ! int x; ! ! eventTrainSkill("murder", GetLevel(), level, 1,GetCombatBonus(level)); ! x = (int)ob->GetMorality(); ! if( x > 0 ) x = -x; ! else if( GetMorality() > 200 ) x = 100; ! else x = 0; ! eventMoralAct(x); } - } - - void eventDestroyEnemy(object ob) { - int level; - - if( !ob ) return; - level = ob->GetLevel(); - eventTrainSkill("faith", GetLevel(), level, 1, GetCombatBonus(level)); - } ! void eventEnemyDied(object ob) { ! if( !ob ) return; ! Enemies -= ({ ob }); ! Hostiles -= ({ ob }); ! } ! varargs int eventReceiveDamage(object agent, int type, int x, int internal, ! mixed limbs) { ! int hp; ! ! x = race::eventReceiveDamage(agent, type, x, internal, limbs); ! if( !Wimpy ) return x; ! if( (hp = GetHealthPoints()) < 1 ) return x; ! if( Wimpy < percent(hp, GetMaxHealthPoints()) ) ! return x; ! call_out((: eventWimpy :), 0); ! return x; ! } ! mixed eventTurn(object who) { ! int defense; ! ! if( !GetUndead() ) { ! return 0; } ! if( GetProperty("no turn") ) { ! if( !who ) { return 0; } ! else { ! int x = GetProperty("no turn"); ! ! environment(who)->eventPrint("The power of the undead " ! "turns on " + who->GetName() + ! ".", who); ! who->eventPrint("The power of the undead turns on you."); ! if( x > random(100) + 1 ) { ! who->eventDie(this_object()); } else { ! who->eventReceiveDamage(this_object(), MAGIC, random(50), 1); } return 0; } - } - if( !who ) { race::eventTurn(who); return 1; } - defense = GetMagicResistance(); - if( who->GetSkillLevel("faith") < defense ) { - who->eventPrint("You writhe in pain."); - environment(who)->eventPrint(who->GetName() + " writhes in pain.", - who); - who->eventReceiveDamage(this_object(), MAGIC, random(defense), 1); - eventTrainSkill("magic defense", defense, who->GetSkillLevel("faith"), - 1, GetCombatBonus(who->GetLevel())); - return 0; - } - race::eventTurn(who); - return 1; - } ! int eventWimpy() { ! object env = environment(); ! string dir, cmd; ! ! if( !env || !GetInCombat() ) { ! return 0; ! } ! cmd = WimpyCommand || "go out"; ! if( (sscanf(cmd, "go %s", dir) && !((string)env->GetExit(dir))) || ! (sscanf(cmd, "enter %s", dir) && !((string)env->GetEnter(dir))) ) { ! string *tmp; ! ! tmp = filter((string *)environment()->GetExits(), ! (: !((string)environment()->GetDoor($1)) :)); ! if( !sizeof(tmp) ) { ! tmp = filter((string *)environment()->GetEnters(), ! (: !((string)environment()->GetDoor($1)) :)); if( !sizeof(tmp) ) { ! eventPrint("You need to escape, but you have nowhere to go!"); ! return 0; } ! cmd = "enter " + tmp[random(sizeof(tmp))]; } ! else cmd = "go " + tmp[random(sizeof(tmp))]; } - return eventForce(cmd); - } ! static void heart_beat() { ! race::heart_beat(); ! if( GetSleeping() || GetDying() ) { ! return; ! } ! if( cParalyzed > 0 ) { ! cParalyzed--; ! if( cParalyzed < 1 ) { ! function f; ! ! f = fParalyzed; ! fParalyzed = 0; ! if( functionp(f) && !(functionp(f) & FP_OWNER_DESTED) ) { ! evaluate(f); ! } ! else { ! eventPrint("You can move again."); ! } ! } ! return; ! } ! if( sizeof(Enemies) ) { ! object ob; ! ! SortEnemies(); ! if( SpecialTargets ) { ! foreach(object target in SpecialTargets) { ! object tmp; ! if( objectp(SetCurrentEnemy(target)) ) { ! break; } ! } ! eventExecuteAttack(SpecialTargets); ! SpecialTargets = 0; ! } ! else if( ob = ResetCurrentEnemy() ) { ! eventExecuteAttack(ob); } } - else if( tNextRound != ROUND_UNDEFINED && functionp(fNextRound) ) { - function f; - - f = fNextRound; - tNextRound = ROUND_UNDEFINED; - evaluate(f); - } - } --- 502,1091 ---- int type = tNextRound; int position = GetPosition(); + if(Dead) return 1; + if(target->GetDead()) return 1; + fNextRound = 0; tNextRound = ROUND_UNDEFINED; ! if( position == POSITION_LYING || position == POSITION_SITTING && ! RACES_D->GetLimblessCombatRace(this_object()->GetRace()) != 1) { ! if(this_object()->CanFly()) { ! this_object()->eventFly(); ! } ! else if(RACES_D->GetLimblessCombatRace(GetRace()) != 1){ ! eventPrint("You can't fight unless you are up!"); ! return 0; ! } ! } ! if(this_object()->GetPacifist()) { ! tell_object(this_object(),"As a pacifist, you choose not to fight."); return 0; } if( arrayp(target) ) { if( !f || (functionp(f) & FP_OWNER_DESTED) ) { return 0; /* built in only handles 1 targ */ } ! target = filter(target, function(object ob) { ! if( !ob ) { ! return 0; ! } ! if( !ob->eventPreAttack(this_object()) ) { ! return 0; ! } ! return 1; ! }); ! if( !sizeof(target) ) { ! return 0; ! } ! } ! else if( !target->eventPreAttack(this_object()) ) { return 0; } ! this_object()->AddStaminaPoints(-1); ! switch(type) { ! case ROUND_UNDEFINED: ! if( functionp(f) && !(functionp(f) & FP_OWNER_DESTED) ) { ! return evaluate(f, target); ! } ! if( sizeof(weapons = GetWielded()) ) { ! return eventWeaponRound(target, weapons); ! } ! else { ! return eventMeleeRound(target, 0); ! } ! ! case ROUND_MAGIC: ! return eventMagicRound(target, f); ! ! case ROUND_MELEE: ! return eventMeleeRound(target, functionp(f) ? f : 0); ! ! case ROUND_WEAPON: ! return eventWeaponRound(target, functionp(f) ? f : GetWielded()); ! ! case ROUND_OTHER: ! if( functionp(f) && !(functionp(f) & FP_OWNER_DESTED) ) { ! return evaluate(f); ! } ! else { ! return 0; ! } ! ! default: return 0; ! } return 0; } ! int eventWeaponRound(mixed target, mixed val) { ! object array weapons = 0; ! function f = 0; ! if(Dead) return 1; ! if(target->GetDead()) return 1; ! if( arrayp(val) ) { ! weapons = val; } ! else if( functionp(val) && !(functionp(val) & FP_OWNER_DESTED) ) { ! f = val; ! } ! else { return 0; } + if( f ) { + evaluate(f, target); + } + else { + int count = sizeof(weapons); ! foreach(object weapon in weapons) { ! if( !target ) { ! break; ! } ! eventWeaponAttack(target, weapon, count); ! } ! } ! return target->GetDying(); } ! void eventWeaponAttack(object target, object weapon, int num){ ! string weapon_type = weapon->GetWeaponType(); ! int hands = weapon->GetHands(); ! int level = target->GetLevel(); ! int bonus = GetCombatBonus(level); ! int power, pro, con; ! ! if(Dead) return; ! if(target->GetDead()) return; ! ! if( target->GetDying() ) { ! return; ! } ! pro = CanWeapon(target, weapon_type, hands, num); ! power = random(pro); ! con = target->GetDefenseChance(target->GetSkillLevel(weapon_type + ! " defense")); ! if( !TargetLimb ) { // If the thing stood still, I still missed ! eventTrainSkill(weapon_type + " attack", pro, 0, 0, bonus); ! if( hands > 1 ) { ! eventTrainSkill("multi-hand", pro, 0, 0, bonus); ! } ! if( num > 1 ) { ! eventTrainSkill("multi-weapon", pro, 0, 0, bonus); ! } ! SendWeaponMessages(target, -2, weapon, TargetLimb); ! } ! else if( !target->eventReceiveAttack(power, weapon_type, this_object()) ) { ! // Target avoided the attack ! eventTrainSkill(weapon_type + " attack", pro, con, 0, bonus); ! if( hands > 1 ) { ! eventTrainSkill("multi-hand", pro, con, 0, bonus); ! } ! if( num > 1 ) { ! eventTrainSkill("multi-weapon", pro, con, 0, bonus); ! } ! SendWeaponMessages(target, -1, weapon, TargetLimb); ! } ! else { // I hit, but how hard did I hit? ! int damage_type, damage, weapon_damage, actual_damage, encumbrance; ! encumbrance = this_object()->GetEncumbrance(); ! //tc("encumbrance: "+encumbrance,"white"); ! if(encumbrance > 200){ ! //tc("feep","yellow"); ! tell_object(this_object(),"You struggle to fight while heavily encumbered."); ! } ! eventTrainSkill(weapon_type + " attack", pro*2, con, 1, bonus); ! damage_type = weapon->GetDamageType(); ! damage = (weapon->eventStrike(target) * pro)/(GetLevel()*2); ! damage = GetDamage(damage, weapon_type + " attack"); ! damage -= encumbrance; ! if(damage < 0) damage = 0; ! actual_damage = target->eventReceiveDamage(this_object(), damage_type, ! damage, 0, TargetLimb); ! if( actual_damage < 0 ) { ! actual_damage = 0; ! } ! weapon_damage = damage - actual_damage; ! if( weapon_damage > 0 ) { ! weapon->eventReceiveDamage(this_object(), BLUNT, weapon_damage, ! 0, TargetLimb); ! } ! if( !target->GetDying() ) { ! SendWeaponMessages(target, actual_damage, weapon, TargetLimb); ! } ! else { ! eventPrint(possessive_noun(target) + " death is now on your " ! "head."); ! target->eventPrint(GetName() + " is your murderer."); ! environment()->eventPrint(possessive_noun(target) + ! " death is now on " + ! possessive_noun(this_object()) ! + " head.", ({ this_object(), target })); ! } ! } } ! ! int eventMeleeRound(mixed target, function f) { ! string array limbs = GetLimbs() - ({ GetTorso() }); ! int count = sizeof(limbs); ! int attacks; ! ! if(Dead) return 1; ! if(target->GetDead()) return 1; ! ! if( count < 2 ) { ! if(RACES_D->GetLimblessCombatRace(this_object()->GetRace())){ ! limbs = GetLimbs(); ! count = sizeof(limbs); ! } ! else return 0; } ! if( !f || (functionp(f) & FP_OWNER_DESTED) ) { ! attacks = 1 + random(GetSkillLevel("melee attack"))/30; ! while( attacks-- ) { ! if( target->GetDying() ) { ! break; ! } ! eventMeleeAttack(target, limbs[random(count)]); ! } } else { ! evaluate(f, target, limbs[random(count)]); ! } ! return target->GetDying(); } ! void eventMeleeAttack(object target, string limb) { ! int pro, con; ! int chance; ! ! if( target->GetDead() || Dead || target->GetDying() ) { ! return; ! } ! ! if(limb == "head" && this_object()->GetCanBite()) { ! eventBite(target); ! return; ! } ! ! pro = CanMelee(target); ! con = target->GetDefenseChance(target->GetSkillLevel("melee defense")); ! chance = random(pro); ! if( !TargetLimb ) { // I *really* missed ! SendMeleeMessages(target, -2); ! eventTrainSkill("melee attack", pro, 0, 0, ! GetCombatBonus(target->GetLevel())); ! } ! else if( !target->eventReceiveAttack(chance, "melee", this_object()) ) { ! // Enemy dodged my attack ! SendMeleeMessages(target, -1); ! eventTrainSkill("melee attack", pro, con, 0, ! GetCombatBonus(target->GetLevel())); ! } ! else { ! int x, encumbrance; ! encumbrance = this_object()->GetEncumbrance(); ! //tc("encumbrance: "+encumbrance,"white"); ! if(encumbrance > 200){ ! //tc("feep","blue"); ! tell_object(this_object(),"You struggle to fight while heavily encumbered."); ! } ! // I hit, how hard? ! eventTrainSkill("melee attack", pro, con, 1, ! GetCombatBonus(target->GetLevel())); ! if(this_object()->GetMelee()) x = GetDamage(3*chance/4, "melee attack"); ! else x = GetDamage(3*chance/20, "melee attack"); ! x -= encumbrance; ! if(x < 0) x = 0; ! x = target->eventReceiveDamage(this_object(), BLUNT, x, 0, ! TargetLimb); ! if( !target->GetDying() ) { ! SendMeleeMessages(target, (x > 0) ? x : 0, TargetLimb); ! } ! else { ! eventPrint(possessive_noun(target) + " death is now " ! "on your head."); ! target->eventPrint(GetName() + " is your murderer."); ! environment()->eventPrint(possessive_noun(target) + ! " death is now on " + ! possessive_noun(this_object()) + ! " head.", ({ this_object(), target })); } } } ! int eventMagicRound(mixed target, function f) { ! if(target->GetDead()) return 1; ! evaluate(f, target); ! return target->GetDying(); } ! mixed eventBite(object target) { ! int pro = CanMelee(target); ! int con = target->GetDefenseChance(target->GetSkillLevel("melee defense")); ! int x = random(pro); ! ! if(target->GetDead()) return 1; ! ! if( environment() != environment(target) ) { ! eventPrint(target->GetName() + " has gone away."); ! return 1; ! } ! if( TargetLimb ) { ! if( target->eventReceiveAttack(x, "melee", this_object()) ) { ! x = GetDamage(pro*2, "melee attack"); ! x = target->eventReceiveDamage(this_object(), BITE, x, 0, ! TargetLimb); ! if( x < 1 ) { ! target->eventPrint(possessive_noun(this_object()) + " bite " ! "is nothing more than a pinch."); ! eventPrint("Your bite is nothing more than a pinch."); ! environment()->eventPrint(possessive_noun(this_object()) + ! " bite is nothing more than a " ! "pinch.", ! ({ target, this_object() })); ! } ! else { ! target->eventPrint(GetName() + " bites you in the " + ! TargetLimb + "!"); ! eventPrint("You bite " + target->GetName() + " in the " + ! TargetLimb + "!"); ! environment()->eventPrint(GetName() + " bites " + ! target->GetName() + " in the " + ! TargetLimb + "!", ! ({ target, this_object() })); ! } ! eventTrainSkill("melee attack", pro, con, 1, ! GetCombatBonus(target->GetLevel())); } else { ! target->eventPrint("You avoid " + possessive_noun(this_object()) + ! " bite."); ! eventPrint(target->GetName() + " avoids your bite."); ! environment()->eventPrint(target->GetName() + " avoids " + ! possessive_noun(this_object()) + ! " bite.", ! ({ this_object(), target })); ! eventTrainSkill("melee attack", pro, con, 0, ! GetCombatBonus(target->GetLevel())); } } else { ! eventPrint("You flounder about like a buffoon."); ! environment()->eventPrint(GetName() + " flounders about like a " ! "buffoon.", this_object()); } + return 1; } ! int eventPreAttack(object agent) { ! if( agent == this_object() ) { ! return 0; } + if( environment()->GetProperty("no attack") ) { + return 0; + } + if( GetDying() ) { + return 0; + } + if( playerp(this_object()) && playerp(agent) && !PLAYER_KILL) { + if( !environment()->CanAttack( agent, this_object() ) ) { + return 0; + } + } + if( AddEnemy(agent) ) { + AddHostile(agent); + } + return 1; } ! varargs int eventReceiveAttack(int speed, string def, object agent) { ! int x, pro, level, bonus; ! if(Dead) return 0; ! if( !agent ) { ! agent = previous_object(); ! } ! if( !living(agent) ) { ! level = 1; ! bonus = 1; ! } ! else { ! level = agent->GetLevel(); ! bonus = GetCombatBonus(level); ! } ! if( AddEnemy(agent) ) { ! AddHostile(agent); ! } ! if( def == "magic" ) { ! pro = GetMagicResistance(); ! if( (x = random(pro)) > speed ) { ! eventTrainSkill("magic defense", pro, speed, 1, bonus); ! return 0; ! } ! else { ! eventTrainSkill("magic defense", pro, speed, 0, bonus); ! return 1; ! } ! } ! else { ! pro = GetDefenseChance(GetSkillLevel(def + " defense")); ! x = random(pro = pro/2); ! if( x > speed ) { ! eventTrainSkill(def + " defense", pro, speed, 1, bonus); ! return 0; ! } ! else { ! eventTrainSkill(def + " defense", pro, speed, 0, bonus); ! return 1; ! } ! } } ! void eventKillEnemy(object ob) { ! int level; ! if( !ob ) return; ! level = ob->GetLevel(); ! if(ob->GetCustomXP()) this_object()->AddExperiencePoints(ob->GetCustomXP()); ! else this_object()->AddExperiencePoints(level * 80); ! if( member_array(ob, GetHostiles()) == -1 ) { ! int x; ! ! eventTrainSkill("murder", GetLevel(), level, 1,GetCombatBonus(level)); ! x = (int)ob->GetMorality(); ! if( x > 0 ) x = -x; ! else if( GetMorality() > 200 ) x = 100; ! else x = 0; ! eventMoralAct(x); ! } ! } ! void eventDestroyEnemy(object ob) { ! int level; ! ! if( !ob ) return; ! level = ob->GetLevel(); ! if(ob->GetCustomXP()) this_object()->AddExperiencePoints(ob->GetCustomXP()); ! else this_object()->AddExperiencePoints(level * 80); ! eventTrainSkill("faith", GetLevel(), level, 1, GetCombatBonus(level)); ! } ! ! void eventEnemyDied(object ob) { ! if( !ob ) return; ! Enemies -= ({ ob }); ! Hostiles -= ({ ob }); ! if(!sizeof(SpecialTargets) || (!sizeof(Enemies) || !sizeof(Hostiles))) ! NonTargets = ({}); ! } ! ! varargs int eventReceiveDamage(object agent, int type, int x, int internal, ! mixed limbs) { ! int hp,encumbrance; ! encumbrance = this_object()->GetEncumbrance(); ! ! if(Dead) return 0; ! //tc("encumbrance: "+encumbrance,"white"); ! if(encumbrance > 200){ ! //tc("feep","green"); ! if(GetInCombat()) tell_object(this_object(),"You try to dodge while weighed down."); ! } ! x = race::eventReceiveDamage(agent, type, x, internal, limbs); ! if( !Wimpy ) return x; ! if( (hp = GetHealthPoints()) < 1 ) return x; ! if( Wimpy < percent(hp, GetMaxHealthPoints()) ) ! return x; ! call_out((: eventWimpy :), 0); ! return x; } ! ! mixed eventTurn(object who) { ! int defense; ! ! if( !GetUndead() ) { return 0; } ! if( GetProperty("no turn") ) { ! if( !who ) { ! return 0; } else { ! int x = GetProperty("no turn"); ! ! environment(who)->eventPrint("The power of the undead " ! "turns on " + who->GetName() + ! ".", who); ! who->eventPrint("The power of the undead turns on you."); ! if( x > random(100) + 1 ) { ! who->eventDie(this_object()); ! } ! else { ! who->eventReceiveDamage(this_object(), MAGIC, random(50), 1); ! } ! return 0; } + } + if( !who ) { + race::eventTurn(who); + return 1; + } + defense = GetMagicResistance(); + if( who->GetSkillLevel("faith") < defense ) { + who->eventPrint("You writhe in pain."); + environment(who)->eventPrint(who->GetName() + " writhes in pain.", + who); + who->eventReceiveDamage(this_object(), MAGIC, random(defense), 1); + eventTrainSkill("magic defense", defense, who->GetSkillLevel("faith"), + 1, GetCombatBonus(who->GetLevel())); return 0; } race::eventTurn(who); return 1; } ! int eventWimpy(int i) { ! object env = environment(); ! string dir, cmd; ! ! if( !env || !GetInCombat() ) { ! if(!i) return 0; ! } ! cmd = WimpyCommand || "go out"; ! if( (sscanf(cmd, "go %s", dir) && !((string)env->GetExit(dir))) || ! (sscanf(cmd, "enter %s", dir) && !((string)env->GetEnter(dir))) ) { ! string *tmp; ! ! tmp = filter((string *)environment()->GetExits(), ! (: !((string)environment()->GetDoor($1)) :)); if( !sizeof(tmp) ) { ! tmp = filter((string *)environment()->GetEnters(), ! (: !((string)environment()->GetDoor($1)) :)); ! if( !sizeof(tmp) ) { ! eventPrint("You need to escape, but you have nowhere to go!"); ! return 0; ! } ! cmd = "enter " + tmp[random(sizeof(tmp))]; } ! else cmd = "go " + tmp[random(sizeof(tmp))]; } ! return eventForce(cmd); } ! static void heart_beat() { ! race::heart_beat(); ! if( GetSleeping() || GetDying() ) { ! return; ! } ! if( cParalyzed > 0 ) { ! cParalyzed--; ! if( cParalyzed < 1 ) { ! function f; ! f = fParalyzed; ! fParalyzed = 0; ! if( functionp(f) && !(functionp(f) & FP_OWNER_DESTED) ) { ! evaluate(f); } ! else { ! eventPrint("You can move again."); ! } ! } ! return; ! } ! if( sizeof(Enemies) ) { ! SortEnemies(); ! foreach(object dude in Enemies){ ! if(member_array(dude,NonTargets) != -1){ ! RemoveEnemy(dude); ! RemoveHostile(dude); ! } ! } ! } ! if( sizeof(Enemies) ) { ! object ob; ! ! SortEnemies(); ! ! if( SpecialTargets ) { ! foreach(object target in SpecialTargets) { ! ! if( objectp(SetCurrentEnemy(target)) ) { ! break; ! } ! } ! eventExecuteAttack(SpecialTargets); ! SpecialTargets = 0; ! } ! else if( ob = ResetCurrentEnemy() ) { ! eventExecuteAttack(ob); ! } ! } ! else if( tNextRound != ROUND_UNDEFINED && functionp(fNextRound) ) { ! function f; ! ! f = fNextRound; ! tNextRound = ROUND_UNDEFINED; ! evaluate(f); } } diff -c -r --new-file ds1.1/lib/lib/combatmsg.c ds2.0r27/lib/lib/combatmsg.c *** ds1.1/lib/lib/combatmsg.c Sun Feb 1 21:30:14 1998 --- ds2.0r27/lib/lib/combatmsg.c Wed Jul 5 00:00:58 2006 *************** *** 1,201 **** /* /lib/combatmsg.c ! * from the Dead Soulsr2.4 LPC Library * combat message handling * created by Blitz@Dead Souls */ ! #include <combat_messages.h> #include "include/combatmsg.h" static mixed GetMissData(object targ, int type, string limb) { string targ_name = (string)targ->GetName(); if( type == -2 ) switch( random(7) ) { ! case 0: ! return ({ "%s completely %s %s.", ! ({ "You", "miss", targ_name }), ! ({ GetName(), "misses", "you" }), ! ({ GetName(), "misses", targ_name }) }); ! case 1: ! return ({ "%s %s at %s and %s with thin air.", ! ({ "You", "swing", targ_name, "connect" }), ! ({ GetName(), "swings", "you", "connects" }), ! ({ GetName(), "swings", targ_name, "connects" }) }); ! case 2: ! return ({ "%s %s a stunning blow but %s %s by a mile!", ! ({ "You", "deliver", "miss", targ_name }), ! ({ GetName(), "delivers", "misses", "you" }), ! ({ GetName(), "delivers", "misses", targ_name }), }); ! case 3: ! return ({ "After a flurry of attacks, %s %s absolutely nothing.", ! ({ "you", "hit" }), ! ({ GetName(), "hits" }), ! ({ GetName(), "hits" }), }); ! case 4: ! return ({ "%s %s out at %s %s, but %s it completely.", ! ({ "You", "lash", possessive_noun(targ), limb, "miss" }), ! ({ GetName(), "lashes", "your", limb, "misses" }), ! ({ GetName(), "lashes", possessive_noun(targ), limb, "misses" }) }); ! case 5: ! return ({ "%s %s silly as %s %s in the wrong direction.", ! ({ "You", "look", "you", "swing" }), ! ({ GetName(), "looks", nominative(this_object()), "swings" }), ! ({ GetName(), "looks", nominative(this_object()), "swings" }) }); ! default: ! return ({ "%s totally %s %s.", ! ({ "You", "miss", targ_name }), ! ({ GetName(), "misses", "you" }), ! ({ GetName(), "misses", targ_name }) }); } else { ! string pos = possessive_noun(this_object()); ! switch( random(7) ) { ! case 0: ! return ({ "%s quickly %s out of %s way.", ! ({ targ_name, "jumps", "your" }), ! ({ "You", "jump", pos }), ! ({ targ_name, "jumps", pos }) }); ! case 1: ! return ({ "%s deftly %s %s pathetic attack.", ! ({ targ_name, "blocks", "your" }), ! ({ "You", "block", pos }), ! ({ targ_name, "blocks", pos }) }); ! case 2: ! return ({ "%s easily %s %s inept attack.", ! ({ targ_name, "dodges", "your" }), ! ({ "You", "dodge", pos }), ! ({ targ_name, "dodges", pos }) }); ! case 3: ! return ({ "%s narrowly %s %s quick swing.", ! ({ targ_name, "avoids", "your" }), ! ({ "You", "avoid", pos }), ! ({ targ_name, "avoids", pos }) }); ! case 4: ! return ({ "%s attack is thwarted by %s quick defenses.", ! ({ "Your", possessive_noun(targ_name) }), ! ({ pos, "your" }), ! ({ pos, possessive_noun(targ_name) }) }); ! case 5: ! return ({ "%s %s beneath %s attack.", ! ({ targ_name, "ducks", "your" }), ! ({ "You", "duck", pos }), ! ({ targ_name, "ducks", pos }) }); ! default: ! return ({ "%s %s %s lame attack.", ! ({ targ_name, "dodges", "your" }), ! ({ "You", "dodge", pos }), ! ({ targ_name, "dodges", pos }) }); ! } } return 0; } ! static void eventSendMissMessages(object target, int x, string limb) { mixed data; if( !limb ) limb = "body"; data = GetMissData(target, x, limb); if( sizeof(data) != 4 ) return; eventPrint(sprintf(data[0], data[1]...)); target->eventPrint(sprintf(data[0], data[2]...)); environment()->eventPrint(sprintf(data[0], data[3]...), ! ({ this_object(), target }) ); } ! mixed GetCombatVerbs(string type, int damage) { ! mixed ptr; ! switch(type) { case "knife": case "blade": ! ptr = BLADE_DEGREES; ! break; case "projectile": ! ptr = PROJECTILE_DEGREES; ! break; default: ! ptr = BLUNT_DEGREES; ! break; ! } ! if( !sizeof(ptr) || !arrayp(ptr)) ! return ({ ({ "hit", "hits" }), ({ "solidly" }) }); ! damage /= 5; ! if( damage > (sizeof(ptr) - 1) ) damage = (sizeof(ptr) - 1); ! if( sizeof(ptr) == 1 ) return ({ ptr[damage], ({ "solidly" }) }); ! else return ptr[damage]; } ! mixed GetCombatMove(string type, int skill) { ! int i; ! mixed foo; ! ! if( skill < random(100) ) return 0; ! if( !i = sizeof(MOVE_TYPES) ) return 0; ! foo = MOVE_TYPES[ random(i) ]; ! if( sizeof(foo) < 2 ) return 0; ! else return foo; } ! varargs void SendMeleeMessages(object target, int x, string targlimb, string limb) { ! int i; ! string adverb, str; ! mixed verb, ptr, moves; ! if( x < 0 ) { ! eventSendMissMessages(target, x, limb); ! return; ! } ! ptr = GetCombatVerbs("melee", x); ! verb = ptr[0]; ! if( sizeof(ptr) > 1 && i = sizeof(ptr[1]) ) ! adverb = (ptr[1][ random(i) ] + " in"); ! else adverb = "in"; ! if( moves = GetCombatMove("melee", ! (int)this_object()->GetSkillLevel("melee attack")) ) { ! verb[0] = moves[0] + " and " + verb[0]; ! verb[1] = moves[1] + " and " + verb[1]; ! } ! if( !limb ) limb = "attack"; ! if( !targlimb ) targlimb = "body"; ! eventPrint(sprintf("You %s %s %s the %s with your %s.", ! verb[0], (string)target->GetName(), adverb, targlimb, limb) ); ! target->eventPrint(sprintf("%s %s you %s your %s with %s %s.", ! GetName(), verb[1], adverb, targlimb, possessive(this_object()), limb)); ! environment()->eventPrint(sprintf("%s %s %s %s the %s with %s %s.", ! GetName(), verb[1], (string)target->GetName(), adverb, targlimb, ! possessive(this_object()), limb), ({ target, this_object() }) ); } ! varargs void SendWeaponMessages(object target, int x, object weapon, string limb) { ! int i; ! string adverb, type, weap; ! mixed verb, ptr, moves; ! if( x < 0 ) { ! eventSendMissMessages(target, x, limb); ! return; ! } ! if( weapon ) { ! type = (string)weapon->GetWeaponType(); ! weap = (string)weapon->GetKeyName(); ! } ! else { ! type = "blunt"; ! weap = "weapon"; ! } ! ptr = GetCombatVerbs(type, x); ! verb = ptr[0]; ! if( sizeof(ptr) > 1 && i = sizeof(ptr[1]) ) ! adverb = (ptr[1][ random(i) ] + " in"); ! else adverb = "in"; ! if( moves = GetCombatMove(type, ! (int)this_object()->GetSkillLevel(type + " attack")) ) { ! verb[0] = moves[0] + " and " + verb[0]; ! verb[1] = moves[1] + " and " + verb[1]; ! } ! if( !limb ) limb = "body"; ! eventPrint(sprintf("You %s %s %s the %s with your %s.", ! verb[0], (string)target->GetName(), adverb, limb, weap) ); ! target->eventPrint(sprintf("%s %s you %s your %s with %s %s.", ! GetName(), verb[1], adverb, limb, possessive(this_object()), weap) ); ! environment()->eventPrint(sprintf("%s %s %s %s the %s with %s %s.", ! GetName(), verb[1], (string)target->GetName(), adverb, limb, ! possessive(this_object()), weap), ({ target, this_object() }) ); } --- 1,210 ---- /* /lib/combatmsg.c ! * from the Dead Souls LPC Library * combat message handling * created by Blitz@Dead Souls */ ! #include <combat_messages.h> #include "include/combatmsg.h" static mixed GetMissData(object targ, int type, string limb) { string targ_name = (string)targ->GetName(); + + if(targ->GetDead() || this_object()->GetDead()) return 0; + if( type == -2 ) switch( random(7) ) { ! case 0: ! return ({ "%s completely %s %s.", ! ({ "You", "miss", targ_name }), ! ({ GetName(), "misses", "you" }), ! ({ GetName(), "misses", targ_name }) }); ! case 1: ! return ({ "%s %s at %s and %s with thin air.", ! ({ "You", "swing", targ_name, "connect" }), ! ({ GetName(), "swings", "you", "connects" }), ! ({ GetName(), "swings", targ_name, "connects" }) }); ! case 2: ! return ({ "%s %s a stunning blow but %s %s by a mile!", ! ({ "You", "deliver", "miss", targ_name }), ! ({ GetName(), "delivers", "misses", "you" }), ! ({ GetName(), "delivers", "misses", targ_name }), }); ! case 3: ! return ({ "After a flurry of attacks, %s %s absolutely nothing.", ! ({ "you", "hit" }), ! ({ GetName(), "hits" }), ! ({ GetName(), "hits" }), }); ! case 4: ! return ({ "%s %s out at %s %s, but %s it completely.", ! ({ "You", "lash", possessive_noun(targ), limb, "miss" }), ! ({ GetName(), "lashes", "your", limb, "misses" }), ! ({ GetName(), "lashes", possessive_noun(targ), limb, "misses" }) }); ! case 5: ! return ({ "%s %s silly as %s %s in the wrong direction.", ! ({ "You", "look", "you", "swing" }), ! ({ GetName(), "looks", nominative(this_object()), "swings" }), ! ({ GetName(), "looks", nominative(this_object()), "swings" }) }); ! default: ! return ({ "%s totally %s %s.", ! ({ "You", "miss", targ_name }), ! ({ GetName(), "misses", "you" }), ! ({ GetName(), "misses", targ_name }) }); } else { ! string pos = possessive_noun(this_object()); ! switch( random(7) ) { ! case 0: ! return ({ "%s quickly %s out of %s way.", ! ({ targ_name, "jumps", "your" }), ! ({ "You", "jump", pos }), ! ({ targ_name, "jumps", pos }) }); ! case 1: ! return ({ "%s deftly %s %s pathetic attack.", ! ({ targ_name, "blocks", "your" }), ! ({ "You", "block", pos }), ! ({ targ_name, "blocks", pos }) }); ! case 2: ! return ({ "%s easily %s %s inept attack.", ! ({ targ_name, "dodges", "your" }), ! ({ "You", "dodge", pos }), ! ({ targ_name, "dodges", pos }) }); ! case 3: ! return ({ "%s narrowly %s %s quick swing.", ! ({ targ_name, "avoids", "your" }), ! ({ "You", "avoid", pos }), ! ({ targ_name, "avoids", pos }) }); ! case 4: ! return ({ "%s attack is thwarted by %s quick defenses.", ! ({ "Your", possessive_noun(targ_name) }), ! ({ pos, "your" }), ! ({ pos, possessive_noun(targ_name) }) }); ! case 5: ! return ({ "%s %s beneath %s attack.", ! ({ targ_name, "ducks", "your" }), ! ({ "You", "duck", pos }), ! ({ targ_name, "ducks", pos }) }); ! default: ! return ({ "%s %s %s lame attack.", ! ({ targ_name, "dodges", "your" }), ! ({ "You", "dodge", pos }), ! ({ targ_name, "dodges", pos }) }); ! } } return 0; } ! static void eventSendMissMessages(object target, int x, string limb) { mixed data; + + if(target->GetDead() || this_object()->GetDead()) return; if( !limb ) limb = "body"; data = GetMissData(target, x, limb); if( sizeof(data) != 4 ) return; eventPrint(sprintf(data[0], data[1]...)); target->eventPrint(sprintf(data[0], data[2]...)); environment()->eventPrint(sprintf(data[0], data[3]...), ! ({ this_object(), target }) ); } ! mixed GetCombatVerbs(string type, int damage) { ! mixed ptr; ! switch(type) { case "knife": case "blade": ! ptr = BLADE_DEGREES; ! break; case "projectile": ! ptr = PROJECTILE_DEGREES; ! break; default: ! ptr = BLUNT_DEGREES; ! break; ! } ! if( !sizeof(ptr) || !arrayp(ptr)) ! return ({ ({ "hit", "hits" }), ({ "solidly" }) }); ! damage /= 5; ! if( damage > (sizeof(ptr) - 1) ) damage = (sizeof(ptr) - 1); ! if( sizeof(ptr) == 1 ) return ({ ptr[damage], ({ "solidly" }) }); ! else return ptr[damage]; } ! mixed GetCombatMove(string type, int skill) { ! int i; ! mixed foo; ! ! if( skill < random(100) ) return 0; ! if( !i = sizeof(MOVE_TYPES) ) return 0; ! foo = MOVE_TYPES[ random(i) ]; ! if( sizeof(foo) < 2 ) return 0; ! else return foo; } ! varargs void SendMeleeMessages(object target, int x, string targlimb, string limb) { ! int i; ! string adverb; ! mixed verb, ptr, moves; ! ! if(target->GetDead() || this_object()->GetDead()) return; ! if( x < 0 ) { ! eventSendMissMessages(target, x, limb); ! return; ! } ! ptr = GetCombatVerbs("melee", x); ! verb = ptr[0]; ! if( sizeof(ptr) > 1 && i = sizeof(ptr[1]) ) ! adverb = (ptr[1][ random(i) ] + " in"); ! else adverb = "in"; ! if( moves = GetCombatMove("melee", ! (int)this_object()->GetSkillLevel("melee attack")) ) { ! verb[0] = moves[0] + " and " + verb[0]; ! verb[1] = moves[1] + " and " + verb[1]; ! } ! if( !limb ) limb = "attack"; ! if( !targlimb ) targlimb = "body"; ! eventPrint(sprintf("You %s %s %s the %s with your %s.", ! verb[0], (string)target->GetName(), adverb, targlimb, limb) ); ! target->eventPrint(sprintf("%s %s you %s your %s with %s %s.", ! GetName(), verb[1], adverb, targlimb, possessive(this_object()), limb)); ! environment()->eventPrint(sprintf("%s %s %s %s the %s with %s %s.", ! GetName(), verb[1], (string)target->GetName(), adverb, targlimb, ! possessive(this_object()), limb), ({ target, this_object() }) ); } ! varargs void SendWeaponMessages(object target, int x, object weapon, string limb) { ! int i; ! string adverb, type, weap; ! mixed verb, ptr, moves; ! ! if(target->GetDead() || this_object()->GetDead()) return; ! if( x < 0 ) { ! eventSendMissMessages(target, x, limb); ! return; ! } ! if( weapon ) { ! type = (string)weapon->GetWeaponType(); ! weap = (string)weapon->GetKeyName(); ! } ! else { ! type = "blunt"; ! weap = "weapon"; ! } ! ptr = GetCombatVerbs(type, x); ! verb = ptr[0]; ! if( sizeof(ptr) > 1 && i = sizeof(ptr[1]) ) ! adverb = (ptr[1][ random(i) ] + " in"); ! else adverb = "in"; ! if( moves = GetCombatMove(type, ! (int)this_object()->GetSkillLevel(type + " attack")) ) { ! verb[0] = moves[0] + " and " + verb[0]; ! verb[1] = moves[1] + " and " + verb[1]; ! } ! if( !limb ) limb = "body"; ! eventPrint(sprintf("You %s %s %s the %s with your %s.", ! verb[0], (string)target->GetName(), adverb, limb, weap) ); ! target->eventPrint(sprintf("%s %s you %s your %s with %s %s.", ! GetName(), verb[1], adverb, limb, possessive(this_object()), weap) ); ! environment()->eventPrint(sprintf("%s %s %s %s the %s with %s %s.", ! GetName(), verb[1], (string)target->GetName(), adverb, limb, ! possessive(this_object()), weap), ({ target, this_object() }) ); } diff -c -r --new-file ds1.1/lib/lib/command.c ds2.0r27/lib/lib/command.c *** ds1.1/lib/lib/command.c Sun Feb 1 21:30:14 1998 --- ds2.0r27/lib/lib/command.c Wed Jul 5 00:00:58 2006 *************** *** 1,5 **** /* /lib/command.c ! * from the Dead Soulsr1 Object Library * handles commands of living objects * created by Descartes of Borg 950323 * Version: @(#) command.c 1.2@(#) --- 1,5 ---- /* /lib/command.c ! * from the Dead Souls Object Library * handles commands of living objects * created by Descartes of Borg 950323 * Version: @(#) command.c 1.2@(#) *************** *** 11,28 **** #include <daemons.h> #include "include/command.h" private static int Forced; private static string CommandFail; private static string *SearchPath; /* *************** /lib/command.c driver applies *************** */ static void create() { ! SearchPath = ({ DIR_PLAYER_CMDS, DIR_SECURE_PLAYER_CMDS, DIR_GUILD_CMDS, ! DIR_COMMON_CMDS, DIR_SECURE_COMMON_CMDS }); } ! static string process_input(string cmd) { return cmd; } /* *************** /lib/command.c command lfuns *************** */ --- 11,39 ---- #include <daemons.h> #include "include/command.h" + //inherit "/lib/props/extra_parse"; + private static int Forced; private static string CommandFail; private static string *SearchPath; + private static string *apostrophe_exceptions; /* *************** /lib/command.c driver applies *************** */ static void create() { ! apostrophe_exceptions = ({ "ed","modify","delete","create","add" }); ! apostrophe_exceptions += ({"rwho", "finger","mudlist","tell","eval"}); ! apostrophe_exceptions += ({"say","speak","yell","whisper","shout"}); ! //Fix here courtesy of Jonez ! apostrophe_exceptions += ({"ping", "reply"}); ! SearchPath = ({ DIR_PLAYER_CMDS, DIR_SECURE_PLAYER_CMDS, DIR_CLAN_CMDS, ! DIR_COMMON_CMDS, DIR_SECURE_COMMON_CMDS }); } ! static string process_input(string cmd) { ! //tc(this_object()->GetName()+": "+identify(parse_command(cmd))); ! return cmd; ! } /* *************** /lib/command.c command lfuns *************** */ *************** *** 31,80 **** mixed err; string verb, file; old_agent = this_agent(this_object()); verb = query_verb(); ! if( !(file = (string)CMD_D->GetCommand(verb, GetSearchPath())) ) { ! string cmd; ! int dbg; ! ! if( args ) cmd = verb + " " + args; ! else cmd = verb; ! if( (int)this_object()->GetProperty("parse debug") ) dbg = 1; ! else dbg = 0; ! if( (err = parse_sentence(cmd, dbg)) == 1 ) { ! this_agent(old_agent || 1); return 1; } ! if( err ) { ! if( err == -1 ) { ! if( !(err = (string)VERBS_D->GetErrorMessage(verb)) && ! !(err = (string)SOUL_D->GetErrorMessage(verb)) ) { ! err = "Such a command exists, but no default " "syntax is known."; } } ! if( intp(err) ) /* MudOS bug */ err = "What?"; ! SetCommandFail(err); } ! message("error", GetCommandFail(), this_object()); ! this_agent(old_agent || 1); ! return 1; } if( (err = (mixed)call_other(file, "cmd", args)) != 1 ) { string cmd; ! if( err ) SetCommandFail(err); if( !args || args == "" ) cmd = verb; else cmd = verb + " " + args; if( (err = parse_sentence(cmd)) == 1 ) { this_agent(old_agent || 1); return 1; } if( !err ) err = GetCommandFail(); message("error", err, this_object()); this_agent(old_agent || 1); return 1; } this_agent(old_agent || 1); return 1; } --- 42,129 ---- mixed err; string verb, file; + //if(ParseMe(args) == 1) return 1; + //tc(this_object()->GetName()+" parse_command_id_list(): "+identify(parse_command_id_list())); + //tc(this_object()->GetName()+" parse_command_plural_id_list(): "+identify(parse_command_plural_id_list())); + //tc(this_object()->GetName()+" parse_command_adjectiv_id_list(): "+identify(parse_command_adjectiv_id_list())); + //tc(this_object()->GetName()+" parse_command_prepos_list(): "+identify(parse_command_prepos_list())); + + if(sizeof(args) && member_array(query_verb(), apostrophe_exceptions) == -1) + args = replace_string(args,"'",""); + old_agent = this_agent(this_object()); verb = query_verb(); ! //write("verb: "+verb); ! ! if(this_player()->GetSleeping() > 0) { ! if(verb != "wake") { ! this_player()->eventPrint("You are asleep."); return 1; } ! } ! ! if(GetCustomCommand(verb) && GetCustomCommand(verb) != "" && !creatorp(this_player()) ){ ! this_player()->eventPrint("How clever of you. Or lucky. In any case, this command is unavailable to you."); ! return 1; ! } ! if( !(file = (GetCustomCommand(verb) )) || GetCustomCommand(verb) == "") { ! if( !(file = (string)CMD_D->GetCommand(verb, GetSearchPath())) ) { ! string cmd; ! int dbg; ! ! if( args ) cmd = verb + " " + args; ! else cmd = verb; ! if( (int)this_object()->GetProperty("parse debug") ) dbg = 1; ! if( (int)this_object()->GetProperty("debug") ) dbg = 1; ! else dbg = 0; ! //tc("command: checkpoint 1","green"); ! if( (err = parse_sentence(cmd, dbg)) == 1 ) { ! this_agent(old_agent || 1); ! return 1; ! } ! //tc("command: checkpoint 2","green"); ! if( err ) { ! //tc("command: checkpoint 3. err: "+err,"green"); ! if( err == -1 ) { ! //tc("command: checkpoint 4","green"); ! if( !(err = (string)VERBS_D->GetErrorMessage(verb)) && ! !(err = (string)SOUL_D->GetErrorMessage(verb)) ) { ! err = "Such a command exists, but no default " "syntax is known."; + } } + //tc("command: checkpoint 5","green"); + if( intp(err) ) /* MudOS bug */ err = "What?"; + SetCommandFail(err); } ! //tc("command: checkpoint 6","green"); ! message("error", GetCommandFail(), this_object()); ! this_agent(old_agent || 1); ! return 1; } ! //tc("command: checkpoint 7","green"); } + //tc("command: checkpoint 8","green"); + if( (err = (mixed)call_other(file, "cmd", args)) != 1 ) { string cmd; ! ! //tc("command: checkpoint 9","green"); if( err ) SetCommandFail(err); if( !args || args == "" ) cmd = verb; else cmd = verb + " " + args; if( (err = parse_sentence(cmd)) == 1 ) { + //tc("command: checkpoint 10","green"); this_agent(old_agent || 1); return 1; } + //tc("command: checkpoint 11","green"); if( !err ) err = GetCommandFail(); message("error", err, this_object()); this_agent(old_agent || 1); return 1; } + //tc("command: checkpoint 12","green"); this_agent(old_agent || 1); return 1; } *************** *** 88,94 **** verb = query_verb(); if( !(file = (string)CMD_D->GetCommand(verb, GetSearchPath())) ) { string cmd; ! if( args ) cmd = verb + " " + args; else cmd = verb; if( (err = parse_sentence(cmd, 3)) == 1 ) { --- 137,143 ---- verb = query_verb(); if( !(file = (string)CMD_D->GetCommand(verb, GetSearchPath())) ) { string cmd; ! if( args ) cmd = verb + " " + args; else cmd = verb; if( (err = parse_sentence(cmd, 3)) == 1 ) { *************** *** 102,108 **** } if( (err = (mixed)call_other(file, "cmd", args)) != 1 ) { string cmd; ! if( err ) SetCommandFail(err); if( !args || args == "" ) cmd = verb; else cmd = verb + " " + args; --- 151,157 ---- } if( (err = (mixed)call_other(file, "cmd", args)) != 1 ) { string cmd; ! if( err ) SetCommandFail(err); if( !args || args == "" ) cmd = verb; else cmd = verb + " " + args; *************** *** 141,147 **** /* ********** /lib/command.c data manipulation functions ********** */ string *AddSearchPath(mixed val) { ! if(stringp(val)) val = ({ val }); else if(!pointerp(val)) error("Bad argument 1 to AddSearchPath()\n"); return (SearchPath = distinct_array(SearchPath + val)); } --- 190,206 ---- /* ********** /lib/command.c data manipulation functions ********** */ string *AddSearchPath(mixed val) { ! if(stringp(val)) { ! if(!strsrch(val,"/secure/cmds/admins") || !strsrch(val,"/cmds/admins")){ ! if(!(int)master()->valid_apply(({ "SECURE", "ASSIST", "LIB_CONNECT" })) ){ ! tell_creators("Security violation in progress: "+identify(previous_object(-1)) + ", "+get_stack()); ! error("Illegal attempt to modify path data: "+identify(previous_object(-1)) + ", "+get_stack()); ! ! } ! } ! val = ({ val }); ! } ! else if(!pointerp(val)) error("Bad argument 1 to AddSearchPath()\n"); return (SearchPath = distinct_array(SearchPath + val)); } *************** *** 159,166 **** string GetClient() { return 0; } string SetCommandFail(string str) { ! if( !str || str == "" ) ! return (CommandFail = "Try \"help index\" for a list of command types."); else return (CommandFail = str); } --- 218,228 ---- string GetClient() { return 0; } string SetCommandFail(string str) { ! if( !str || str == "" ){ ! if(!creatorp(this_player())) CommandFail = "Try \"help commands\" for a list of some commands."; ! if(creatorp(this_player())) CommandFail = "Try \"help creator commands\" for a list of some creator commands."; ! return CommandFail; ! } else return (CommandFail = str); } diff -c -r --new-file ds1.1/lib/lib/comp/container.c ds2.0r27/lib/lib/comp/container.c *** ds1.1/lib/lib/comp/container.c Sun Dec 6 17:55:25 1998 --- ds2.0r27/lib/lib/comp/container.c Wed Jul 5 00:01:05 2006 *************** *** 10,20 **** inherit LIB_LOOK_IN; inherit LIB_RADIANCE; int GetRadiantLight(int ambient) { int r = radiance::GetRadiantLight(ambient); int o = GetOpacity(); ! if( o > 99 ) { if( r < 1 ) { return 0; --- 10,29 ---- inherit LIB_LOOK_IN; inherit LIB_RADIANCE; + inherit LIB_ADDSTUFF; + + int SetOpacity(int x){ + return look_in::SetOpacity(x); + } + + int GetOpacity(){ + return look_in::GetOpacity(); + } int GetRadiantLight(int ambient) { int r = radiance::GetRadiantLight(ambient); int o = GetOpacity(); ! if( o > 99 ) { if( r < 1 ) { return 0; *************** *** 35,41 **** } if( ambient > 0 ) { int y; ! y = (r*10)/ambient; if( y > r ) { y = r; --- 44,50 ---- } if( ambient > 0 ) { int y; ! y = (r*10)/ambient; if( y > r ) { y = r; diff -c -r --new-file ds1.1/lib/lib/comp/holder.c ds2.0r27/lib/lib/comp/holder.c *** ds1.1/lib/lib/comp/holder.c Sun Feb 1 21:30:14 1998 --- ds2.0r27/lib/lib/comp/holder.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/comp/holder.c ! * From the Dead Souls V Object Library * A composite object that holds inanimate items * Created by Descartes of Borg 960113 * Version: @(#) holder.c 1.6@(#) --- 1,5 ---- /* /lib/comp/holder.c ! * From the Dead Souls Object Library * A composite object that holds inanimate items * Created by Descartes of Borg 960113 * Version: @(#) holder.c 1.6@(#) *************** *** 19,41 **** return 1; } varargs string GetInternalDesc() { object array items = all_inventory(); string desc; desc = (container::GetInternalDesc() || ""); ! desc = desc + "\n" + capitalize(add_article(GetShort(), 1)); items = filter(items, (: !($1->isDummy()) && !($1->GetInvis()) :)); if( sizeof(items) ) { ! if( GetOpacity() > 33 ) { ! desc = desc + " contains something."; ! } ! else { ! desc = desc + " contains " + item_list(items) + "."; } } else { ! desc = desc + " is completely empty."; } return desc; } --- 19,62 ---- return 1; } + int GetOpacity(){ + return container::GetOpacity(); + } + + int SetOpacity(int x){ + return container::SetOpacity(x); + } + varargs string GetInternalDesc() { object array items = all_inventory(); string desc; + int surfacep; + + surfacep = inherits(LIB_SURFACE , this_object()); desc = (container::GetInternalDesc() || ""); ! if(this_object()->CanClose() && GetOpacity() > 33){ ! //tc("GREEN LED","green"); ! if(this_object()->GetClosed()) desc += " It is closed. "; ! else desc += " It is open. "; ! } ! if(!surfacep) desc = desc + capitalize(add_article(GetShort(), 1)); ! if(surfacep) desc = "On "+add_article(GetShort(), 1); items = filter(items, (: !($1->isDummy()) && !($1->GetInvis()) :)); if( sizeof(items) ) { ! //if( GetOpacity() > 33 && !surfacep) { ! //desc = desc + " contains something."; ! //} ! //else { ! if(surfacep){ ! desc = desc+" you see " + item_list(items) + "."; } + else desc = desc + " contains " + item_list(items) + "."; } + //} else { ! if(!surfacep) desc = desc + " is completely empty."; ! else desc = desc + " you see nothing."; } return desc; } *************** *** 70,75 **** --- 91,97 ---- return tmp; } AddCarriedMass(ob->GetMass()); + this_object()->SetMass(this_object()->GetMass() + ob->GetMass()); parse_refresh(); return 1; } *************** *** 78,84 **** int x; x = container::eventReleaseObject(ob); ! call_out((: parse_refresh :), 0); return x; } --- 100,109 ---- int x; x = container::eventReleaseObject(ob); ! //call_out((: parse_refresh :), 0); ! AddCarriedMass(-(ob->GetMass())); ! this_object()->SetMass(this_object()->GetMass() - ob->GetMass()); ! parse_refresh(); return x; } diff -c -r --new-file ds1.1/lib/lib/comp/object.c ds2.0r27/lib/lib/comp/object.c *** ds1.1/lib/lib/comp/object.c Sun Feb 1 21:30:14 1998 --- ds2.0r27/lib/lib/comp/object.c Wed Jul 5 00:01:05 2006 *************** *** 19,36 **** inherit LIB_SMELL; inherit LIB_TOUCH; /* ************************ object.c events ********************* */ static int Destruct() { object env; int x; if( env = environment() ) { ! env->eventReleaseObject(this_object()); x = clean::Destruct(); if( !x ) { env->eventReceiveObject(this_object()); } ! return x; } else return clean::Destruct(); } --- 19,39 ---- inherit LIB_SMELL; inherit LIB_TOUCH; + mixed indirect_dest_obj() { return 1; } + mixed direct_dest_obj() { return 1; } + /* ************************ object.c events ********************* */ static int Destruct() { object env; int x; if( env = environment() ) { ! env->eventReleaseObject(this_object()); x = clean::Destruct(); if( !x ) { env->eventReceiveObject(this_object()); } ! return x; } else return clean::Destruct(); } diff -c -r --new-file ds1.1/lib/lib/comp/seal.c ds2.0r27/lib/lib/comp/seal.c *** ds1.1/lib/lib/comp/seal.c Sun Feb 1 21:30:14 1998 --- ds2.0r27/lib/lib/comp/seal.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/comp/seal.c ! * from the Dead Souls V Object Library * Composite component of a closeable and lockable thing * Created by Descartes of Borg 961221 * Version: @(#) seal.c 1.2@(#) --- 1,5 ---- /* /lib/comp/seal.c ! * from the Dead Souls Object Library * Composite component of a closeable and lockable thing * Created by Descartes of Borg 961221 * Version: @(#) seal.c 1.2@(#) *************** *** 44,56 **** } if( GetLocked() ) { send_messages(({ "attempt", "find" }), "$agent_name $agent_verb to " ! "open $target_name, but $agent_nominative $agent_verb " ! "it locked.", who, this_object(), environment(who)); return 1; } return close::eventOpen(who, tool); } ! static private void create() { ! AddSave(close::GetSave() + lock::GetSave()); } --- 44,68 ---- } if( GetLocked() ) { send_messages(({ "attempt", "find" }), "$agent_name $agent_verb to " ! "open $target_name, but $agent_nominative $agent_verb " ! "it locked.", who, this_object(), environment(who)); return 1; } return close::eventOpen(who, tool); } ! void create() { ! string *c_save, *l_save, *a_save; ! ! //AddSave(close::GetSave() + lock::GetSave()); ! c_save = close::GetSave(); ! l_save = lock::GetSave(); ! a_save = c_save + l_save; ! ! AddSave( a_save ); ! ! //tc("c_save: "+identify(c_save)); ! //tc("l_save: "+identify(l_save)); ! //tc("a_save: "+identify(a_save)); ! } diff -c -r --new-file ds1.1/lib/lib/comp/surface.c ds2.0r27/lib/lib/comp/surface.c *** ds1.1/lib/lib/comp/surface.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/comp/surface.c Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,11 ---- + #include <lib.h> + + inherit LIB_STORAGE; + + void create(){ + storage::create(); + } + + int eventPutOn(object player, object item){ + return 1; + } diff -c -r --new-file ds1.1/lib/lib/comp/weapon.c ds2.0r27/lib/lib/comp/weapon.c *** ds1.1/lib/lib/comp/weapon.c Sun Feb 1 21:30:14 1998 --- ds2.0r27/lib/lib/comp/weapon.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/comp/weapon.c ! * From the Dead Souls V Object Library * This object combines the ability to be wielded with damage doing * Created by Descartes of Borg 960211 * Version: @(#) weapon.c 1.13@(#) --- 1,5 ---- /* /lib/comp/weapon.c ! * From the Dead Souls Object Library * This object combines the ability to be wielded with damage doing * Created by Descartes of Borg 960211 * Version: @(#) weapon.c 1.13@(#) *************** *** 14,22 **** inherit LIB_POISON; inherit LIB_WIELD; ! private int Hands = 1; ! private string WeaponType = "blunt"; ! private static mixed Wield = 0; // abstract methods string GetDefiniteShort(); --- 14,23 ---- inherit LIB_POISON; inherit LIB_WIELD; ! private int Hands = 1; ! int Wielded = 0; ! private string WeaponType = "blunt"; ! private static mixed Wield = 0; // abstract methods string GetDefiniteShort(); *************** *** 24,33 **** string GetShort(); // end abstract methods varargs string GetEquippedDescription(object who) { if( GetWorn() ) { ! string tmp = "It is wielded in "; ! if( !who ) { who = this_player(); } --- 25,38 ---- string GetShort(); // end abstract methods + int GetWielded(){ + return Wielded; + } + varargs string GetEquippedDescription(object who) { if( GetWorn() ) { ! string tmp = " It is wielded in "; ! if( !who ) { who = this_player(); } *************** *** 39,46 **** } tmp += " " + item_list(GetWorn()) + "."; return tmp; ! } ! return 0; } --- 44,51 ---- } tmp += " " + item_list(GetWorn()) + "."; return tmp; ! } ! return 0; } *************** *** 48,60 **** object env = environment(); string ret = GetShort(); string array limbs; ! if( !env || !living(env) ) { return ret; } limbs = GetWorn(); if( sizeof(limbs) > 0 ) { ! ret += " (wielded in " + item_list(limbs) + ")"; } return ret; } --- 53,65 ---- object env = environment(); string ret = GetShort(); string array limbs; ! if( !env || !living(env) ) { return ret; } limbs = GetWorn(); if( sizeof(limbs) > 0 ) { ! ret += " (%^RED%^wielded in " + item_list(limbs) + "%^RESET%^)"; } return ret; } *************** *** 68,96 **** } string array GetSave() { ! return (damage::GetSave() + equip::GetSave() + poison::GetSave()); } string GetWeaponType() { return WeaponType; } ! string SetWeaponType(string str) { if( !stringp(str) ) { error("Bad argument 1 to SetWeaponType().\n\tExpected: string, Got: " + ! typeof(str) + "\n"); } return (WeaponType = str); } ! mixed GetWield() { return Wield; } ! mixed SetWield(mixed val) { return (Wield = val); } ! mixed CanEquip(object who, string array limbs) { mixed tmp = equip::CanEquip(who, limbs); --- 73,107 ---- } string array GetSave() { ! string *d_save, *e_save, *p_save, *a_save; ! ! d_save = damage::GetSave(); ! e_save = equip::GetSave(); ! p_save = poison::GetSave(); ! a_save = d_save + e_save + p_save + ({"Wielded"}); ! return a_save; } string GetWeaponType() { return WeaponType; } ! string SetWeaponType(string str) { if( !stringp(str) ) { error("Bad argument 1 to SetWeaponType().\n\tExpected: string, Got: " + ! typeof(str) + "\n"); } return (WeaponType = str); } ! mixed GetWield() { return Wield; } ! mixed SetWield(mixed val) { return (Wield = val); } ! mixed CanEquip(object who, string array limbs) { mixed tmp = equip::CanEquip(who, limbs); *************** *** 98,105 **** return tmp; } if( GetHands() != sizeof(limbs) ) { ! return "#You must use " + cardinal(Hands) + " to wield " + ! GetDefiniteShort() + "."; } if( Hands > sizeof(who->GetWieldingLimbs()) ) { return "#You do not have enough limbs for that weapon!"; --- 109,116 ---- return tmp; } if( GetHands() != sizeof(limbs) ) { ! return "#You must use " + cardinal(Hands) + " hands to wield " + ! GetDefiniteShort() + "."; } if( Hands > sizeof(who->GetWieldingLimbs()) ) { return "#You do not have enough limbs for that weapon!"; *************** *** 112,135 **** int eventDeteriorate(int type) { int x = GetClass(); ! if( x ) { ! object env = environment(); ! ! if( living(env) ) { ! if( x > 1 ) { env->eventPrint(capitalize(GetDefiniteShort()) + ! " is wearing down."); } ! else { env->eventPrint(capitalize(GetDefiniteShort()) + ! " is completely worn."); } ! } if( GetProperty("blessed") ) { SetClass(x-2); } ! else { SetClass(x-1); } } --- 123,146 ---- int eventDeteriorate(int type) { int x = GetClass(); ! if( x ) { ! object env = environment(); ! ! if( living(env) ) { ! if( x > 1 ) { env->eventPrint(capitalize(GetDefiniteShort()) + ! " is wearing down."); } ! else { env->eventPrint(capitalize(GetDefiniteShort()) + ! " is completely worn."); } ! } if( GetProperty("blessed") ) { SetClass(x-2); } ! else { SetClass(x-1); } } *************** *** 138,144 **** mixed eventEquip(object who, string array limbs) { mixed tmp; ! if( functionp(Wield) ) { if( functionp(Wield) & FP_OWNER_DESTED ) { return "Function pointer owner destructed."; --- 149,155 ---- mixed eventEquip(object who, string array limbs) { mixed tmp; ! if( functionp(Wield) ) { if( functionp(Wield) & FP_OWNER_DESTED ) { return "Function pointer owner destructed."; *************** *** 147,157 **** --- 158,171 ---- return 1; } else { + Wielded = 1; return equip::eventEquip(who, limbs); } } + Wielded = 1; tmp = equip::eventEquip(who, limbs); if( tmp != 1 ) { + Wielded = 0; return tmp; } if( stringp(Wield) ) { *************** *** 161,183 **** who->eventPrint("You wield " + GetShort() + "."); } environment(who)->eventPrint(who->GetName() + " wields " + GetShort() + ! ".", who); return 1; } ! int eventStrike(object target) { int poison = GetPoison(); ! if( poison > 0 ) { int x = random(poison) + 1; ! ! if( x > 0 ) { send_messages("", "$agent_possessive_noun " + GetKeyName() + ! " poisons $target_name.", environment(), target, ! environment(environment())); ! target->AddPoison(x); ! AddPoison(-x); ! } } return damage::eventStrike(target); } --- 175,197 ---- who->eventPrint("You wield " + GetShort() + "."); } environment(who)->eventPrint(who->GetName() + " wields " + GetShort() + ! ".", who); return 1; } ! int eventStrike(object target) { int poison = GetPoison(); ! if( poison > 0 ) { int x = random(poison) + 1; ! ! if( x > 0 ) { send_messages("", "$agent_possessive_noun " + GetKeyName() + ! " poisons $target_name.", environment(), target, ! environment(environment())); ! target->AddPoison(x); ! AddPoison(-x); ! } } return damage::eventStrike(target); } *************** *** 186,195 **** mixed tmp = equip::eventUnequip(who); if( tmp != 1 ) { return tmp; } send_messages("unwield", "$agent_name $agent_verb $target_name.", ! who, this_object(), environment(who)); return 1; } --- 200,211 ---- mixed tmp = equip::eventUnequip(who); if( tmp != 1 ) { + Wielded = 1; return tmp; } + Wielded = 0; send_messages("unwield", "$agent_name $agent_verb $target_name.", ! who, this_object(), environment(who)); return 1; } diff -c -r --new-file ds1.1/lib/lib/creator.c ds2.0r27/lib/lib/creator.c *** ds1.1/lib/lib/creator.c Sun Feb 1 21:30:18 1998 --- ds2.0r27/lib/lib/creator.c Wed Jul 5 00:00:58 2006 *************** *** 13,34 **** #include <message_class.h> #include "include/creator.h" ! inherit LIB_INTERACTIVE; ! inherit LIB_POSITION; ! inherit LIB_TALK; #ifdef __PACKAGE_DATABASE_DB__ inherit LIB_ISQL; #endif /* __PACKAGE_DATABASE_DB__ */ private int CreatorAge, CreatorBirth; - private string Gender; private static int LastCreatorAge; /* ***************** /lib/creator.c driver applies ***************** */ static void create() { ! interactive::create(); CreatorAge = 0; LastCreatorAge = time(); CreatorBirth = time(); --- 13,31 ---- #include <message_class.h> #include "include/creator.h" ! inherit LIB_PLAYER; #ifdef __PACKAGE_DATABASE_DB__ inherit LIB_ISQL; #endif /* __PACKAGE_DATABASE_DB__ */ private int CreatorAge, CreatorBirth; private static int LastCreatorAge; /* ***************** /lib/creator.c driver applies ***************** */ static void create() { ! player::create(); CreatorAge = 0; LastCreatorAge = time(); CreatorBirth = time(); *************** *** 77,83 **** } static void net_dead() { ! interactive::net_dead(); CreatorAge += time() - LastCreatorAge; LastCreatorAge = time(); } --- 74,80 ---- } static void net_dead() { ! player::net_dead(); CreatorAge += time() - LastCreatorAge; LastCreatorAge = time(); } *************** *** 85,103 **** void eventReconnect() { string tmp; ! interactive::eventReconnect(); LastCreatorAge = time(); if( file_exists(tmp = user_path(GetKeyName()) + "dead.edit") ) ! message("system", "\nYour edit file was saved as: "+tmp, this_object()); } ! varargs mixed eventShow(object who, string str, string on_id) { ! who->eventPrint(GetLong(str)); ! environment(who)->eventPrint((string)this_player()->GetName() + ! " looks at " + GetShort() + ".", ! ({ who, this_object() })); ! if( this_player() != this_object() ) ! eventPrint((string)this_player()->GetName() + " looks you over."); return 1; } --- 82,95 ---- void eventReconnect() { string tmp; ! player::eventReconnect(); LastCreatorAge = time(); if( file_exists(tmp = user_path(GetKeyName()) + "dead.edit") ) ! message("system", "\nYour edit file was saved as: "+tmp, this_object()); } ! varargs int eventShow(object who, string str, string on_id) { ! player::eventShow(who, str); return 1; } *************** *** 107,150 **** object env; if( !(env = environment()) ) { ! message("room_description", "No environment.", this_object()); ! return; } message("system", file_name(env), this_object()); ! interactive::eventDescribeEnvironment(verbose); } varargs int eventMoveLiving(mixed dest, string omsg, string imsg) { object *inv; ! object prev, env; if( prev = environment() ) { ! if( stringp(dest) ) { ! if(dest[0] != '/') { ! string *arr; ! ! arr = explode(file_name(prev), "/"); ! dest = "/"+implode(arr[0..sizeof(arr)-2], "/")+"/"+dest; ! } ! } ! if( !eventMove(dest) ) { eventPrint("You remain where you are.", MSG_SYSTEM); ! return 0; ! } ! inv = filter(all_inventory(prev), (: (!GetInvis($1) && living($1) && ! ($1 != this_object())) :)); ! if( !omsg || omsg == "" ) omsg = GetMessage("telout"); ! else omsg = GetMessage("leave", omsg); inv->eventPrint(omsg, MSG_ENV); } else if( !eventMove(dest) ) { eventPrint("You remain where you are.", MSG_SYSTEM); ! return 0; } inv = filter(all_inventory(environment()), ! (: (!GetInvis($1) && living($1) && ($1 != this_object())) :)); if( (!imsg || imsg == "") && (!omsg || omsg == "") ) ! imsg = GetMessage("telin"); else if( !imsg || imsg == "" ) imsg = GetMessage("come", imsg); else imsg = replace_string(imsg, "$N", GetName()); inv->eventPrint(imsg, MSG_ENV); --- 99,158 ---- object env; if( !(env = environment()) ) { ! message("room_description", "No environment.", this_object()); ! return; } message("system", file_name(env), this_object()); ! player::eventDescribeEnvironment(verbose); } varargs int eventMoveLiving(mixed dest, string omsg, string imsg) { object *inv; ! object prev; if( prev = environment() ) { ! if( stringp(dest) ) { ! if(dest[0] != '/') { ! string *arr; ! ! arr = explode(file_name(prev), "/"); ! dest = "/"+implode(arr[0..sizeof(arr)-2], "/")+"/"+dest; ! } ! } ! if( !eventMove(dest) ) { eventPrint("You remain where you are.", MSG_SYSTEM); ! return 0; ! } ! inv = filter(all_inventory(prev), (: (!GetInvis($1) && living($1) && ! ($1 != this_object())) :)); ! if( !omsg || omsg == "" ) omsg = GetMessage("telout"); ! else if(GetPosition() == POSITION_SITTING || ! GetPosition() == POSITION_LYING ){ ! omsg = GetName()+" crawls "+omsg+"."; ! } ! else if(GetPosition() == POSITION_FLYING ){ ! omsg = GetName()+" flies "+omsg+"."; ! } ! ! else omsg = GetMessage("leave", omsg); inv->eventPrint(omsg, MSG_ENV); } else if( !eventMove(dest) ) { eventPrint("You remain where you are.", MSG_SYSTEM); ! return 0; } inv = filter(all_inventory(environment()), ! (: (!GetInvis($1) && living($1) && ($1 != this_object())) :)); if( (!imsg || imsg == "") && (!omsg || omsg == "") ) ! imsg = GetMessage("telin"); ! else if(GetPosition() == POSITION_SITTING || ! GetPosition() == POSITION_LYING ){ ! imsg = GetName()+" crawls in."; ! } ! else if(GetPosition() == POSITION_FLYING){ ! imsg = GetName()+" flies in."; ! } ! else if( !imsg || imsg == "" ) imsg = GetMessage("come", imsg); else imsg = replace_string(imsg, "$N", GetName()); inv->eventPrint(imsg, MSG_ENV); *************** *** 155,167 **** static int Destruct() { int x; ! if( !(x = interactive::Destruct()) ) return 0; #ifdef __PACKAGE_DATABASE_DB__ isql::Destruct(); #endif /* __PACKAGE_DATABASE_DB__ */ return x; } ! /* ***************** /lib/creator.c local functions ***************** */ int Setup() { --- 163,175 ---- static int Destruct() { int x; ! if( !(x = player::Destruct()) ) return 0; #ifdef __PACKAGE_DATABASE_DB__ isql::Destruct(); #endif /* __PACKAGE_DATABASE_DB__ */ return x; } ! /* ***************** /lib/creator.c local functions ***************** */ int Setup() { *************** *** 169,194 **** int bugs, laston; laston = GetLoginTime(); ! if( !interactive::Setup() ) return 0; ! AddChannel(({"cre", "intercre", "newbie", "avatar", "hm", "gossip", ! "intergossip", "council" })); AddChannel((string array)CLASSES_D->GetClasses()); if( archp() ) AddChannel( ({ "admin", "error" }) ); AddSearchPath( ({ DIR_CREATOR_CMDS, DIR_SECURE_CREATOR_CMDS }) ); if( file_size(tmp = user_path(GetKeyName()) + "cmds") == -2 ) ! AddSearchPath( ({ tmp }) ); if( archp() ) AddSearchPath( ({ DIR_ADMIN_CMDS, DIR_SECURE_ADMIN_CMDS }) ); if( bugs = (int)BUGS_D->GetAssignedBugs(GetKeyName()) ) ! message("system", "\n >>> You have " + ! consolidate(bugs, "an incomplete bug") + ! " assigned to you!!!! <<<\n", this_object()); NOTIFY_D->eventPrintNotices(this_object(), laston); return 1; } int eventForce(string cmd) { if( !((int)master()->valid_apply( ({ GetKeyName() }) )) ) return 0; ! else return interactive::eventForce(cmd); } /* *************** /lib/creator.c modal functions *************** */ --- 177,201 ---- int bugs, laston; laston = GetLoginTime(); ! if( !player::Setup() ) return 0; ! AddChannel(({"cre", "newbie", "gossip", "ds", "ds_test", "lpuni", "death","intergossip","intercre" })); AddChannel((string array)CLASSES_D->GetClasses()); if( archp() ) AddChannel( ({ "admin", "error" }) ); AddSearchPath( ({ DIR_CREATOR_CMDS, DIR_SECURE_CREATOR_CMDS }) ); if( file_size(tmp = user_path(GetKeyName()) + "cmds") == -2 ) ! AddSearchPath( ({ tmp }) ); if( archp() ) AddSearchPath( ({ DIR_ADMIN_CMDS, DIR_SECURE_ADMIN_CMDS }) ); if( bugs = (int)BUGS_D->GetAssignedBugs(GetKeyName()) ) ! message("system", "\n >>> You have " + ! consolidate(bugs, "an incomplete bug") + ! " assigned to you!!!! <<<\n", this_object()); NOTIFY_D->eventPrintNotices(this_object(), laston); return 1; } int eventForce(string cmd) { if( !((int)master()->valid_apply( ({ GetKeyName() }) )) ) return 0; ! else return player::eventForce(cmd); } /* *************** /lib/creator.c modal functions *************** */ *************** *** 207,259 **** return CreatorAge; } - string SetGender(string gender) { - if( !((int)master()->valid_apply( ({ GetKeyName() }) )) ) return Gender; - else return (Gender = gender); - } - - string GetGender() { return Gender; } - varargs string GetLong(string str) { ! mapping counts; ! string item; ! ! str = GetShort() + "\n"; ! str += interactive::GetLong() + "\n"; ! foreach(item in map(all_inventory(), ! (: (string)$1->GetAffectLong(this_object()) :))) ! if( item ) str += item + "\n"; ! counts = ([]); ! foreach(item in map( ! filter(all_inventory(), (: !((int)$1->GetInvis(this_object())) :)), ! (: (string)$1->GetShort() :))) ! if( item ) counts[item]++; ! if( sizeof(counts) ) str += GetCapName() + " is carrying:\n"; ! foreach(item in keys(counts)) ! str += consolidate(counts[item], item) + "\n"; return str; } int GetCreatorBirth() { return CreatorBirth; } ! int GetEffectiveVision() { return VISION_CLEAR; } ! ! string GetNativeLanguage() { return "English"; } ! ! int GetLanguageLevel(string whocares) { return 100; } ! ! string GetLanguageName(string lang) { ! if( convert_name(lang) != "english" ) return 0; ! else return "English"; ! } ! ! string GetHealthShort() { return GetShort(); } string GetName() { if( !GetInvis() ) return ::GetName(); else return "A shadow"; } - int GetRadiantLight() { - return 0; - } --- 214,230 ---- return CreatorAge; } varargs string GetLong(string str) { ! str = player::GetLong() + "\n"; return str; } int GetCreatorBirth() { return CreatorBirth; } ! //string GetNativeLanguage() { return "English"; } string GetName() { if( !GetInvis() ) return ::GetName(); else return "A shadow"; } diff -c -r --new-file ds1.1/lib/lib/currency.c ds2.0r27/lib/lib/currency.c *** ds1.1/lib/lib/currency.c Sun Feb 1 21:30:14 1998 --- ds2.0r27/lib/lib/currency.c Wed Jul 5 00:00:58 2006 *************** *** 23,29 **** int AddCurrency(string type, int amount) { if( amount > 0 ) { ! if( !CanCarry(currency_mass(amount, type)) ) { return -1; } } --- 23,32 ---- int AddCurrency(string type, int amount) { if( amount > 0 ) { ! int curr_mass; ! curr_mass = to_int(currency_mass(amount, type)); ! if(curr_mass < 1 ) curr_mass = 1; ! if( !CanCarry(curr_mass) ) { return -1; } } *************** *** 34,39 **** --- 37,43 ---- } int GetCurrency(string type) { return Currency[type]; } + mapping GetCurrencyMap() { return copy(Currency); } varargs int GetCurrencyMass(string type) { int total; *************** *** 53,68 **** if( amount < 1 ) return -1; Bank[bank] = ([ "open" : time(), type : amount, "last time" : time(), "last trans" : "opened account", ! "audit" : identify(previous_object(-1)) ]); ! return amount; ! } ! if( Bank[bank][type] + amount < 0 ) return -1; ! Bank[bank][type] += amount; ! Bank[bank]["last time"] = time(); ! if( amount > 0 ) Bank[bank]["last trans"] = "deposit"; ! else Bank[bank]["last trans"] = "withdrawal"; ! Bank[bank]["audit"] = identify(previous_object(-1)); ! return Bank[bank][type]; } int GetBank(string bank, string type) { --- 57,72 ---- if( amount < 1 ) return -1; Bank[bank] = ([ "open" : time(), type : amount, "last time" : time(), "last trans" : "opened account", ! "audit" : identify(previous_object(-1)) ]); ! return amount; ! } ! if( Bank[bank][type] + amount < 0 ) return -1; ! Bank[bank][type] += amount; ! Bank[bank]["last time"] = time(); ! if( amount > 0 ) Bank[bank]["last trans"] = "deposit"; ! else Bank[bank]["last trans"] = "withdrawal"; ! Bank[bank]["audit"] = identify(previous_object(-1)); ! return Bank[bank][type]; } int GetBank(string bank, string type) { *************** *** 75,106 **** else return copy(Bank[bank]); } ! int GetNetWorth() { string curr; ! float net_worth; int amt; ! foreach(curr, amt in Currency) { ! float tmp; ! ! if( (tmp = currency_rate(curr)) < 1 ) continue; ! net_worth += amt / tmp; } foreach(string bank, mapping balance in Bank) { foreach(curr, amt in balance) { float tmp; ! switch(curr) { ! case "last trans": case "last time": case "audit": case "open": ! break; ! default: ! if( (tmp = currency_rate(curr)) < 1 ) break; ! net_worth += amt / tmp; ! break; } } } ! return net_worth; } string array GetCurrencies() { return keys(Currency); } --- 79,116 ---- else return copy(Bank[bank]); } ! varargs int GetNetWorth(string benjamins) { string curr; ! float net_worth = 0.0; int amt; ! //tc("Currency: "+identify(Currency)); foreach(curr, amt in Currency) { ! //tc("curr: "+identify(curr),"blue"); ! //tc("amt: "+identify(amt),"blue"); ! if(valid_currency(curr)) ! net_worth += amt * currency_rate(curr); ! //tc("net_worth: "+net_worth,"blue"); ! } + //tc("net_worth: "+net_worth); foreach(string bank, mapping balance in Bank) { foreach(curr, amt in balance) { float tmp; ! switch(curr) { ! case "last trans": case "last time": case "audit": case "open": ! break; ! default: ! if( (tmp = currency_rate(curr)) < 1 ) break; ! net_worth += amt * tmp; ! break; } } } ! if(!benjamins || benjamins == ""||!stringp(benjamins)) benjamins = "gold"; ! if(member_array(benjamins,mud_currencies()) == -1) benjamins = "gold"; ! if(benjamins && net_worth) return to_int(net_worth / currency_rate(benjamins)); ! else return to_int(0); } string array GetCurrencies() { return keys(Currency); } diff -c -r --new-file ds1.1/lib/lib/detect.c ds2.0r27/lib/lib/detect.c *** ds1.1/lib/lib/detect.c Sun Feb 1 21:30:15 1998 --- ds2.0r27/lib/lib/detect.c Wed Jul 5 00:00:58 2006 *************** *** 3,106 **** * inheritable object for all tangible game objects * created by Descartes of Borg 950207 */ ! #include <dirs.h> #include "include/detect.h" int direct_detect_wrd_in_obj(string word) { if( environment() != this_player() && ! environment() != environment(this_player()) ) { ! this_player()->eventPrint("You need better access to it."); ! return 0; } else return 1; } ! mixed eventDetect(object who, string str, int ability) { mixed magic; ! magic = GetProperty("magic item"); if( str == "magic" ) { ! if( !magic ) { ! if( random(ability) > 50 ) { ! who->AddSkillPoints("conjuring", random(ability * 2 + 1)); ! message("my_action", "You are certain there is no magic " ! "in " + GetShort() + ".", who); ! return 1; ! } ! else { ! string *spells; ! string spell; ! ! if( random(ability) > 50 ) { ! who->AddSkillPoints("conjuring", random(ability)); ! message("my_action", "You do not detect any magic " ! "in " + GetShort() + ".", who); ! return 1; ! } ! who->AddSkillPoints("conjuring", random(5)); ! spells = map(get_dir(DIR_SPELL_VERBS + "/*.c"), (: $1[0..<3] :)); ! spell = spells[random(sizeof(spells))]; ! message("my_action", "You vaguely sense \"" + spell + "\".", ! who); ! return 1; ! } ! } ! else { ! string *spells; ! string spell; ! ! if( random(ability) > 20 ) { ! who->AddSkillPoints("conjuring", random(1 + 2* ability)); ! if( arrayp(magic) ) magic = magic[random(sizeof(magic))]; ! if( random(ability) > 50 ) ! message("my_action", "You definitely sense \"" + ! magic + "\".", who); ! else message("my_action", "You vaguely sense \"" + magic + ! "\".", who); ! return 1; ! } ! who->AddSkillPoints("conjuring", random(5) + 1); ! if( random(ability) > 50 ) { ! message("my_action", "You do not detect any magic " ! "in " + GetShort() + ".", who); ! return 1; ! } ! spells = map(get_dir(DIR_SPELL_VERBS + "/*.c"), (: $1[0..<3] :)); ! spell = spells[random(sizeof(spells))]; ! message("my_action", "You vaguely sense \"" + spell + "\".", who); ! return 1; ! } } if( !magic ) { ! if( random(ability) > 20 ) { ! who->AddSkillPoints("conjuring", random(ability) + 5); ! message("my_action", "You do not sense " + str + ".", who); ! } ! else { ! who->AddSkillPoints("conjuring", random(5)); ! message("my_action", "You are not at all certain.", who); ! } ! return 1; } if( (arrayp(magic) && member_array(str, magic) != -1) || ! (stringp(magic) && str == magic) ) { ! if( random(ability) > 10 ) { ! who->AddSkillPoints("conjuring", random(ability)); ! message("my_action", "You sense " + str + " in " + ! GetShort() + ".", who); ! } ! else { ! who->AddSkillPoints("conjuring", random(5)); ! message("my_action", "Everything seems fuzzy in your head.", who); ! } ! return 1; } if( random(ability) > 10 ) { ! who->AddSkillPoints("conjuring", random(ability)); ! message("my_action", "You do not sense " + str + " in " + ! GetShort() + ".", who); ! return 1; } who->AddSkillPoints("conjuring", random(5)); message("my_action", "Everything seems fuzzy in your head.", who); --- 3,106 ---- * inheritable object for all tangible game objects * created by Descartes of Borg 950207 */ ! #include <dirs.h> #include "include/detect.h" int direct_detect_wrd_in_obj(string word) { if( environment() != this_player() && ! environment() != environment(this_player()) ) { ! this_player()->eventPrint("You need better access to it."); ! return 0; } else return 1; } ! mixed eventDetect(object who, string str, int ability) { mixed magic; ! magic = GetProperty("magic item"); if( str == "magic" ) { ! if( !magic ) { ! if( random(ability) > 50 ) { ! who->AddSkillPoints("conjuring", random(ability * 2 + 1)); ! message("my_action", "You are certain there is no magic " ! "in " + GetShort() + ".", who); ! return 1; ! } ! else { ! string *spells; ! string spell; ! ! if( random(ability) > 50 ) { ! who->AddSkillPoints("conjuring", random(ability)); ! message("my_action", "You do not detect any magic " ! "in " + GetShort() + ".", who); ! return 1; ! } ! who->AddSkillPoints("conjuring", random(5)); ! spells = map(get_dir(DIR_SPELL_VERBS + "/*.c"), (: $1[0..<3] :)); ! spell = spells[random(sizeof(spells))]; ! message("my_action", "You vaguely sense \"" + spell + "\".", ! who); ! return 1; ! } ! } ! else { ! string *spells; ! string spell; ! ! if( random(ability) > 20 ) { ! who->AddSkillPoints("conjuring", random(1 + 2* ability)); ! if( arrayp(magic) ) magic = magic[random(sizeof(magic))]; ! if( random(ability) > 50 ) ! message("my_action", "You definitely sense \"" + ! magic + "\".", who); ! else message("my_action", "You vaguely sense \"" + magic + ! "\".", who); ! return 1; ! } ! who->AddSkillPoints("conjuring", random(5) + 1); ! if( random(ability) > 50 ) { ! message("my_action", "You do not detect any magic " ! "in " + GetShort() + ".", who); ! return 1; ! } ! spells = map(get_dir(DIR_SPELL_VERBS + "/*.c"), (: $1[0..<3] :)); ! spell = spells[random(sizeof(spells))]; ! message("my_action", "You vaguely sense \"" + spell + "\".", who); ! return 1; ! } } if( !magic ) { ! if( random(ability) > 20 ) { ! who->AddSkillPoints("conjuring", random(ability) + 5); ! message("my_action", "You do not sense " + str + ".", who); ! } ! else { ! who->AddSkillPoints("conjuring", random(5)); ! message("my_action", "You are not at all certain.", who); ! } ! return 1; } if( (arrayp(magic) && member_array(str, magic) != -1) || ! (stringp(magic) && str == magic) ) { ! if( random(ability) > 10 ) { ! who->AddSkillPoints("conjuring", random(ability)); ! message("my_action", "You sense " + str + " in " + ! GetShort() + ".", who); ! } ! else { ! who->AddSkillPoints("conjuring", random(5)); ! message("my_action", "Everything seems fuzzy in your head.", who); ! } ! return 1; } if( random(ability) > 10 ) { ! who->AddSkillPoints("conjuring", random(ability)); ! message("my_action", "You do not sense " + str + " in " + ! GetShort() + ".", who); ! return 1; } who->AddSkillPoints("conjuring", random(5)); message("my_action", "Everything seems fuzzy in your head.", who); diff -c -r --new-file ds1.1/lib/lib/donate.c ds2.0r27/lib/lib/donate.c *** ds1.1/lib/lib/donate.c Sun Feb 1 21:30:27 1998 --- ds2.0r27/lib/lib/donate.c Wed Jul 5 00:00:58 2006 *************** *** 6,42 **** #include "include/donate.h" #include <lib.h> - inherit LIB_ITEM; - private int TotalAssets; private string LocalCurrency, Owner; static void create() { ! item::create(); ! this_object()->AddSave( ({ "TotalAssets" }) ); ! TotalAssets = 0; ! SetPreventGet(1); ! SetMass(99999); } static void init() { ! item::init(); ! if( (string)this_player()->ClassMember((string)GetOwner()) || ! (string)this_player()->GetGuild() == (string)GetOwner() ) { ! add_action( (: eventDonate :) , "donate" ); ! } } string GetLong(string str) { ! string ret; ! ret = item::GetLong(); ! ret += "\nIt currently contains "+TotalAssets+" " + ! (string)GetLocalCurrency() + "."; ! return ret; } string SetLocalCurrency(string currency) { ! return (LocalCurrency = currency); } string GetLocalCurrency() {return LocalCurrency;} --- 6,35 ---- #include "include/donate.h" #include <lib.h> private int TotalAssets; private string LocalCurrency, Owner; static void create() { ! this_object()->AddSave( ({ "TotalAssets" }) ); ! TotalAssets = 0; } static void init() { ! if( (string)this_player()->ClassMember((string)GetOwner()) || ! (string)this_player()->GetClan() == (string)GetOwner() ) { ! add_action( (: eventDonate :) , "donate" ); ! } } string GetLong(string str) { ! string ret = "\nIt currently contains "+TotalAssets+" " + ! "coins and bills."; ! if(TotalAssets) return ret; ! else return ""; } string SetLocalCurrency(string currency) { ! return (LocalCurrency = currency); } string GetLocalCurrency() {return LocalCurrency;} *************** *** 46,82 **** string GetOwner() {return Owner;} int AddAssets(int amount) { ! TotalAssets += amount; ! return 1; } int GetAssets() {return TotalAssets;} ! int eventDonate(int amount, string type) { ! object tp = this_player(); ! ! if(!amount) { ! tp->eventPrint("Donate how much?\n"); ! return 0; ! } ! if(amount < 0) { ! tp->eventPrint("Nice try!\n"); ! return 0; ! } ! if(type != GetLocalCurrency()) { ! tp->eventPrint("The " + pluralize(GetOwner()) + ! " only deal in " + GetLocalCurrency() + ! ".\n"); ! return 0; ! } ! if((int)tp->GetCurrency(type) < amount) { ! tp->eventPrint("You don't have that much " + type + "!\n"); ! return 0; ! } ! tp->AddCurrency(type, -amount); ! AddAssets(amount); ! tp->eventPrint("The " + pluralize(GetOwner()) + " are greatful " ! "for your donation."); ! return 1; } --- 39,87 ---- string GetOwner() {return Owner;} int AddAssets(int amount) { ! TotalAssets += amount; ! return 1; } int GetAssets() {return TotalAssets;} ! int eventDonate(string amt, string type) { ! int amount; ! object tp = this_player(); ! ! if(sscanf(amt,"%d", amount) < 1) { ! write("That isn't a proper amount."); ! return 1; ! } ! ! if(!valid_currency(type)){ ! write("That isn't a valid currency."); ! return 1; ! } ! ! if(!amount) { ! tp->eventPrint("Donate how much?\n"); ! return 0; ! } ! if(amount < 0) { ! tp->eventPrint("Nice try!\n"); ! return 0; ! } ! //if(type != GetLocalCurrency()) { ! // tp->eventPrint("The " + pluralize(GetOwner()) + ! // " only deal in " + GetLocalCurrency() + ! // ".\n"); ! // return 0; ! // } ! if((int)tp->GetCurrency(type) < amount) { ! tp->eventPrint("You don't have that much " + type + "!\n"); ! return 0; ! } ! tp->AddCurrency(type, -amount); ! AddAssets(amount); ! tp->eventPrint(GetOwner() + " is grateful " ! "for your donation."); ! if(living(this_object())) this_object()->eventForce("say Thank you!"); ! return 1; } diff -c -r --new-file ds1.1/lib/lib/door.c ds2.0r27/lib/lib/door.c *** ds1.1/lib/lib/door.c Sun Feb 1 21:30:10 1998 --- ds2.0r27/lib/lib/door.c Wed Jul 5 00:00:58 2006 *************** *** 12,19 **** --- 12,40 ---- inherit LIB_DAEMON; inherit LIB_SEAL; + //inherit LIB_LOCK_WITH; private mapping Sides; + private static int Hidden = 1; + + int SetHiddenDoor(int i){ + if(i) Hidden = 1; + else Hidden = 0; + return Hidden; + } + + int GetHiddenDoor(){ + return Hidden; + } + + string *GetSides(){ + //string ret, tmp; + //ret = ""; + //foreach(string key, class door_side val in Sides){ + //ret += key +"\n"; + //ret += save_variable(val); + return keys(Sides); + } /* *************** /lib/door.c driver applies *************** */ *************** *** 86,92 **** varargs mixed eventClose(object who) { object room; string tmp; ! SetClosed(1); room = environment(who); foreach(string side, class door_side val in Sides) { --- 107,113 ---- varargs mixed eventClose(object who) { object room; string tmp; ! SetClosed(1); room = environment(who); foreach(string side, class door_side val in Sides) { *************** *** 95,101 **** } who->eventPrint("You close " + GetShort(tmp) + "."); room->eventPrint((string)who->GetName() + " closes " + GetShort(tmp) + ".", ! who); return 1; } --- 116,122 ---- } who->eventPrint("You close " + GetShort(tmp) + "."); room->eventPrint((string)who->GetName() + " closes " + GetShort(tmp) + ".", ! who); return 1; } *************** *** 109,118 **** * object by is required here */ ! mixed eventLock(object who, object key) { object room; ! room = environment(who); foreach(string side, class door_side val in Sides) { if( member_array(room, val->Rooms) != -1 ) { string tmp; --- 130,140 ---- * object by is required here */ ! varargs mixed eventLock(object who, mixed key, mixed foo) { object room; ! room = environment(who); + foreach(string side, class door_side val in Sides) { if( member_array(room, val->Rooms) != -1 ) { string tmp; *************** *** 121,134 **** if( !(sizeof(key->GetId() & GetKeys(side))) ) { who->eventPrint("You fail to lock " + tmp + "."); room->eventPrint((string)who->GetName() + " attempts to " ! "lock " + tmp + " with " + ! (string)key->GetShort() + ", but fails.",who); return 1; } SetLocked(1); who->eventPrint("You lock " + tmp + "."); room->eventPrint((string)who->GetName() + " locks " + tmp + ! " with " + (string)key->GetShort() + ".", who); return 1; } } --- 143,156 ---- if( !(sizeof(key->GetId() & GetKeys(side))) ) { who->eventPrint("You fail to lock " + tmp + "."); room->eventPrint((string)who->GetName() + " attempts to " ! "lock " + tmp + " with " + ! (string)key->GetShort() + ", but fails.",who); return 1; } SetLocked(1); who->eventPrint("You lock " + tmp + "."); room->eventPrint((string)who->GetName() + " locks " + tmp + ! " with " + (string)key->GetShort() + ".", who); return 1; } } *************** *** 149,156 **** varargs int eventOpen(object who, object tool) { object room; string tmp; ! ! if( tool ) return seal::eventOpen(who, tool); SetClosed(0); room = environment(who); foreach(string side, class door_side val in Sides) { --- 171,178 ---- varargs int eventOpen(object who, object tool) { object room; string tmp; ! ! //if( tool ) return seal::eventOpen(who, tool); SetClosed(0); room = environment(who); foreach(string side, class door_side val in Sides) { *************** *** 159,165 **** } who->eventPrint("You open " + GetShort(tmp) + "."); room->eventPrint((string)who->GetName() + " opens " + GetShort(tmp) + ".", ! who); return 1; } --- 181,187 ---- } who->eventPrint("You open " + GetShort(tmp) + "."); room->eventPrint((string)who->GetName() + " opens " + GetShort(tmp) + ".", ! who); return 1; } *************** *** 173,193 **** * this is called by SetDoor() in exits.c to tell the door there is a room * which is observing it */ ! int eventRegisterSide(string side) { string array id = GetId(side); ! if( !Sides[side] ) return 0; ((class door_side)Sides[side])->Rooms = ! distinct_array(((class door_side)Sides[side])->Rooms + ! ({ previous_object() })); previous_object()->AddItem(id, (: GetLong($(side)) :)); foreach(object ob in all_inventory(previous_object())) { if( !ob->isDummy() ) { continue; } if( sizeof(id & ob->GetId()) ) { ! ob->SetDoor(file_name(this_object())); } } return 1; --- 195,215 ---- * this is called by SetDoor() in exits.c to tell the door there is a room * which is observing it */ ! int eventRegisterSide(string side) { string array id = GetId(side); ! if( !Sides[side] ) return 0; ((class door_side)Sides[side])->Rooms = ! distinct_array(((class door_side)Sides[side])->Rooms + ! ({ previous_object() })); previous_object()->AddItem(id, (: GetLong($(side)) :)); foreach(object ob in all_inventory(previous_object())) { if( !ob->isDummy() ) { continue; } if( sizeof(id & ob->GetId()) ) { ! if(!ob->GetDoor()) ob->SetDoor(file_name(this_object())); } } return 1; *************** *** 206,212 **** */ mixed eventUnlock(object who, object key) { object room; ! room = environment(who); foreach(string side, class door_side val in Sides) { if( member_array(room, val->Rooms) != -1 ) { --- 228,234 ---- */ mixed eventUnlock(object who, object key) { object room; ! room = environment(who); foreach(string side, class door_side val in Sides) { if( member_array(room, val->Rooms) != -1 ) { *************** *** 216,229 **** if( !sizeof((string *)key->GetId() & GetKeys(side)) ) { who->eventPrint("You fail to unlock " + tmp + "."); room->eventPrint((string)who->GetName() + " attempts to " ! "unlock " + tmp + " with " + ! (string)key->GetShort() + ", but fails.",who); return 1; } SetLocked(0); who->eventPrint("You unlock " + tmp + "."); room->eventPrint((string)who->GetName() + " unlocks " + tmp + ! " with " + (string)key->GetShort() + ".", who); return 1; } } --- 238,251 ---- if( !sizeof((string *)key->GetId() & GetKeys(side)) ) { who->eventPrint("You fail to unlock " + tmp + "."); room->eventPrint((string)who->GetName() + " attempts to " ! "unlock " + tmp + " with " + ! (string)key->GetShort() + ", but fails.",who); return 1; } SetLocked(0); who->eventPrint("You unlock " + tmp + "."); room->eventPrint((string)who->GetName() + " unlocks " + tmp + ! " with " + (string)key->GetShort() + ".", who); return 1; } } *************** *** 234,240 **** void SetSide(string side, mapping mp) { class door_side new_side; ! new_side = new(class door_side); new_side->Rooms = ({}); if( stringp(mp["id"]) ) new_side->Ids = ({ mp["id"] }); --- 256,262 ---- void SetSide(string side, mapping mp) { class door_side new_side; ! new_side = new(class door_side); new_side->Rooms = ({}); if( stringp(mp["id"]) ) new_side->Ids = ({ mp["id"] }); *************** *** 247,255 **** Sides[side] = new_side; } int SetLockable(string side, int x) { if( !Sides[side] ) ! Sides[side] = new(class door_side, Rooms : ({})); return (((class door_side)Sides[side])->Lockable = x); } --- 269,290 ---- Sides[side] = new_side; } + mapping GetSide(string side){ + mapping RetMap = ([]); + if(!sizeof(Sides[side])) return ([]); + RetMap["id"] = Sides[side]->Ids; + RetMap["short"] = Sides[side]->Short; + RetMap["long"] = Sides[side]->Long; + RetMap["keys"] = Sides[side]->Keys; + RetMap["lockable"] = Sides[side]->Lockable; + return copy(RetMap); + } + + + int SetLockable(string side, int x) { if( !Sides[side] ) ! Sides[side] = new(class door_side, Rooms : ({})); return (((class door_side)Sides[side])->Lockable = x); } *************** *** 271,277 **** mixed SetShort(string side, mixed short) { if( !Sides[side] ) ! Sides[side] = new(class door_side, Rooms : ({})); return (((class door_side)Sides[side])->Short = short); } --- 306,312 ---- mixed SetShort(string side, mixed short) { if( !Sides[side] ) ! Sides[side] = new(class door_side, Rooms : ({})); return (((class door_side)Sides[side])->Short = short); } *************** *** 287,293 **** } } if( stringp(((class door_side)Sides[side])->Short) ) ! return ((class door_side)Sides[side])->Short; else return (string)evaluate(((class door_side)Sides[side])->Short, side); } --- 322,328 ---- } } if( stringp(((class door_side)Sides[side])->Short) ) ! return ((class door_side)Sides[side])->Short; else return (string)evaluate(((class door_side)Sides[side])->Short, side); } *************** *** 299,305 **** mixed SetLong(string side, mixed long) { if( !Sides[side] ) ! Sides[side] = new(class door_side, Rooms : ({})); return (((class door_side)Sides[side])->Long = long); } --- 334,340 ---- mixed SetLong(string side, mixed long) { if( !Sides[side] ) ! Sides[side] = new(class door_side, Rooms : ({})); return (((class door_side)Sides[side])->Long = long); } *************** *** 309,315 **** if( GetClosed() ) tmp = "It is closed."; else tmp = "It is open."; if( stringp(((class door_side)Sides[side])->Long) ) ! return ((class door_side)Sides[side])->Long + "\n" + tmp; else return (string)evaluate(((class door_side)Sides[side])->Long, side); } --- 344,350 ---- if( GetClosed() ) tmp = "It is closed."; else tmp = "It is open."; if( stringp(((class door_side)Sides[side])->Long) ) ! return ((class door_side)Sides[side])->Long + "\n" + tmp; else return (string)evaluate(((class door_side)Sides[side])->Long, side); } *************** *** 326,328 **** --- 361,368 ---- string *GetKeys(string side) { return ((class door_side)Sides[side])->Keys; } object *GetRooms(string side) { return ((class door_side)Sides[side])->Rooms; } + + int get_closed() { return GetClosed(); } + + void init(){ + } diff -c -r --new-file ds1.1/lib/lib/enter.c ds2.0r27/lib/lib/enter.c *** ds1.1/lib/lib/enter.c Sun Feb 1 21:30:11 1998 --- ds2.0r27/lib/lib/enter.c Wed Jul 5 00:00:58 2006 *************** *** 1,5 **** /* /lib/enter.c ! * From the Dead Souls V Object Library * Allows objects to provide an entry portal into another place * Created by Descartes of Borg 961015 * Version: @(#) enter.c 1.4@(#) --- 1,5 ---- /* /lib/enter.c ! * From the Dead Souls Object Library * Allows objects to provide an entry portal into another place * Created by Descartes of Borg 961015 * Version: @(#) enter.c 1.4@(#) *************** *** 22,33 **** } mixed direct_close_obj(object target) { ! if( !Door ) { ! return 0; ! } ! else { ! return Door->CanClose(this_player()); ! } } mixed direct_enter_obj() { --- 22,33 ---- } mixed direct_close_obj(object target) { ! if( !Door ) { ! return 0; ! } ! else { ! return Door->CanClose(this_player()); ! } } mixed direct_enter_obj() { *************** *** 75,81 **** } mixed direct_pick_str_on_obj_with_obj(string str, object ob, object w, ! string id1, string id2, string id3) { return direct_pick_str_on_obj(str, ob, id1, id2); } --- 75,81 ---- } mixed direct_pick_str_on_obj_with_obj(string str, object ob, object w, ! string id1, string id2, string id3) { return direct_pick_str_on_obj(str, ob, id1, id2); } *************** *** 92,122 **** return Door->eventClose(who); } ! mixed eventEnter(object who, string what) { if( Door && Door->GetClosed() ) { who->eventPrint("You bump into " + Door->GetShort(what) + "."); environment(who)->eventPrint(who->GetName() + " bumps into " + ! Door->GetShort(what) + ".", who); return 1; } if( who->GetPosition() != POSITION_STANDING ) { ! who->eventStand(); ! if( who->GetPosition() != POSITION_STANDING ) { return 0; } } if( Enter["pre"] && !evaluate(Enter["pre"], what) ) { return 1; } ! who->eventMoveLiving(Enter["room"], "$N enters into the " + what + "."); if( Enter["post"] ) { evaluate(Enter["post"], what); } return 1; } ! mixed eventLock(object who, object key) { ! Door->eventLock(who, key); } varargs mixed eventOpen(object who, object tool) { --- 92,130 ---- return Door->eventClose(who); } ! varargs mixed eventEnter(object who, string what, string verb) { ! if(!verb) verb = "NOVERB"; if( Door && Door->GetClosed() ) { who->eventPrint("You bump into " + Door->GetShort(what) + "."); environment(who)->eventPrint(who->GetName() + " bumps into " + ! Door->GetShort(what) + ".", who); return 1; } if( who->GetPosition() != POSITION_STANDING ) { ! if(verb != "crawl" && verb != "fly") who->eventStand(); ! if( who->GetPosition() != POSITION_STANDING && verb != "crawl" ! && verb != "fly") { ! who->eventPrint("weird."); return 0; } } if( Enter["pre"] && !evaluate(Enter["pre"], what) ) { return 1; } ! if(verb == "crawl") who->eventMoveLiving(Enter["room"],"into the " + what ); ! else who->eventMoveLiving(Enter["room"], "$N enters into the " + what + "."); if( Enter["post"] ) { evaluate(Enter["post"], what); } return 1; } ! varargs mixed eventLock(object who, mixed arg1, mixed arg2) { ! object key; ! if(arg1 && objectp(arg1)) key = arg1; ! else if(arg2 && objectp(arg2)) key = arg2; ! else return 0; ! return Door->eventLock(who, key); } varargs mixed eventOpen(object who, object tool) { *************** *** 156,163 **** return Enter["room"]; } } - - mapping GetEnterData() { - return Enter; - } - --- 164,166 ---- diff -c -r --new-file ds1.1/lib/lib/events/bait.c ds2.0r27/lib/lib/events/bait.c *** ds1.1/lib/lib/events/bait.c Sun Feb 1 21:30:13 1998 --- ds2.0r27/lib/lib/events/bait.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/events/bait.c ! * From the Dead Souls V Object Library * Handles the bait event * Created by Descartes of Borg 970103 * Version: @(#) bait.c 1.1@(#) --- 1,5 ---- /* /lib/events/bait.c ! * From the Dead Souls Object Library * Handles the bait event * Created by Descartes of Borg 970103 * Version: @(#) bait.c 1.1@(#) *************** *** 15,25 **** int AddBait(int x) { return (Bait += x); } ! int GetBait() { return Bait; } ! int SetBait(int x) { return (Bait = x); } --- 15,25 ---- int AddBait(int x) { return (Bait += x); } ! int GetBait() { return Bait; } ! int SetBait(int x) { return (Bait = x); } *************** *** 34,45 **** } return 1; } ! int eventBait(object who, object bait) { AddBait(bait->GetBaitStrength()); return 1; } ! mixed direct_bait_obj_with_obj() { if( environment() != this_player() ) { return "#You don't have that!"; --- 34,45 ---- } return 1; } ! int eventBait(object who, object bait) { AddBait(bait->GetBaitStrength()); return 1; } ! mixed direct_bait_obj_with_obj() { if( environment() != this_player() ) { return "#You don't have that!"; diff -c -r --new-file ds1.1/lib/lib/events/bait_with.c ds2.0r27/lib/lib/events/bait_with.c *** ds1.1/lib/lib/events/bait_with.c Sun Feb 1 21:30:13 1998 --- ds2.0r27/lib/lib/events/bait_with.c Wed Jul 5 00:01:05 2006 *************** *** 1,13 **** /* /lib/events/bait_with.c ! * From the Dead Souls V Object Library * Handles putting bait on fishing devices * Created by Blitz@Dead Souls 960116 * Version: @(#) bait_with.c 1.2@(#) * Last modified: 97/01/03 */ ! #include <lib.h> ! private int BaitStrength = 0; // abstract methods --- 1,13 ---- /* /lib/events/bait_with.c ! * From the Dead Souls Object Library * Handles putting bait on fishing devices * Created by Blitz@Dead Souls 960116 * Version: @(#) bait_with.c 1.2@(#) * Last modified: 97/01/03 */ ! #include <lib.h> ! private int BaitStrength = 0; // abstract methods *************** *** 18,43 **** int GetBaitStrength() { return BaitStrength; } ! int SetBaitStrength(int x) { return (BaitStrength = x); } ! mixed eventBait(object who, object pole) { if( !(who && pole) ) { return 0; } if( !pole->eventBait(who, this_object()) ) { ! who->eventPrint(capitalize(pole->GetDefiniteShort()) + ! "remains unbaited."); ! return 1; } send_messages("bait", "$agent_name $agent_verb $target_name with " + ! GetShort() + ".", who, pole, environment(who)); Destruct(); return 1; } ! mixed indirect_bait_obj_with_obj() { if( environment() != this_player() ) { return "#You don't have that bait!"; --- 18,43 ---- int GetBaitStrength() { return BaitStrength; } ! int SetBaitStrength(int x) { return (BaitStrength = x); } ! mixed eventBait(object who, object pole) { if( !(who && pole) ) { return 0; } if( !pole->eventBait(who, this_object()) ) { ! who->eventPrint(capitalize(pole->GetDefiniteShort()) + ! "remains unbaited."); ! return 1; } send_messages("bait", "$agent_name $agent_verb $target_name with " + ! GetShort() + ".", who, pole, environment(who)); Destruct(); return 1; } ! mixed indirect_bait_obj_with_obj() { if( environment() != this_player() ) { return "#You don't have that bait!"; diff -c -r --new-file ds1.1/lib/lib/events/bury.c ds2.0r27/lib/lib/events/bury.c *** ds1.1/lib/lib/events/bury.c Sun Feb 1 21:30:13 1998 --- ds2.0r27/lib/lib/events/bury.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/events/bury.c ! * From the Dead Souls V Object Library * Handles objects which can be buried * Created by Descartes of Borg 961231 * Version: @(#) bury.c 1.1@(#) --- 1,5 ---- /* /lib/events/bury.c ! * From the Dead Souls Object Library * Handles objects which can be buried * Created by Descartes of Borg 961231 * Version: @(#) bury.c 1.1@(#) diff -c -r --new-file ds1.1/lib/lib/events/buy.c ds2.0r27/lib/lib/events/buy.c *** ds1.1/lib/lib/events/buy.c Sun Feb 1 21:30:13 1998 --- ds2.0r27/lib/lib/events/buy.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/events/buy.c ! * From the Dead Souls V Object Library * Things that get bought from * Created by Descartes of Borg 970103 * Version: @(#) buy.c 1.1@(#) --- 1,5 ---- /* /lib/events/buy.c ! * From the Dead Souls Object Library * Things that get bought from * Created by Descartes of Borg 970103 * Version: @(#) buy.c 1.1@(#) diff -c -r --new-file ds1.1/lib/lib/events/climb.c ds2.0r27/lib/lib/events/climb.c *** ds1.1/lib/lib/events/climb.c Sun Feb 1 21:30:12 1998 --- ds2.0r27/lib/lib/events/climb.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/climb.c ! * from the Dead Souls V Object Library * handles different methods of climbing * created by Descartes of Borg 960120 * Version: @(#) climb.c 1.7@(#) --- 1,5 ---- /* /lib/climb.c ! * from the Dead Souls Object Library * handles different methods of climbing * created by Descartes of Borg 960120 * Version: @(#) climb.c 1.7@(#) *************** *** 10,15 **** --- 10,16 ---- #include <function.h> static private mapping Climb = 0; + int ccc = 0; // abstract methods string GetDefiniteShort(); *************** *** 19,24 **** --- 20,34 ---- return Climb; } + int SetCanClimbCarried(int i) { + ccc = i; + return 1; + } + + int GetCanClimbCarried() { + return ccc; + } + varargs static mapping SetClimb(mixed val, int type) { if( !type ) { type = CLIMB_UP; *************** *** 34,40 **** mixed CanClimb(object who, int type) { int array tmp; ! if( Climb[type] ) { return 1; } --- 44,58 ---- mixed CanClimb(object who, int type) { int array tmp; ! object dude; ! string thingname; ! dude=this_player(); ! thingname=this_object()->GetKeyName(); ! ! if(present(thingname,dude) && ccc == 0) { ! return "You can't climb that while it's being carried."; ! } ! if( Climb[type] ) { return 1; } *************** *** 46,71 **** type = tmp[0]; } switch(type) { ! case CLIMB_UP: return "Perhaps you mean to climb up it?"; ! case CLIMB_DOWN: return "Perhaps you mean to climb down it?"; ! case CLIMB_OUT: return "Perhaps you mean to climb out of it?"; ! case CLIMB_INTO: return "Perhaps you mean to climb into it?"; ! case CLIMB_THROUGH: return "Perhaps you mean to climb through it?"; } return 0; } ! mixed eventClimb(object who, int type) { mixed dest = Climb[type]; if( functionp(dest) ) { if( functionp(dest) & FP_OWNER_DESTED ) { --- 64,90 ---- type = tmp[0]; } switch(type) { ! case CLIMB_UP: return "Perhaps you mean to climb up it?"; ! case CLIMB_DOWN: return "Perhaps you mean to climb down it?"; ! case CLIMB_OUT: return "Perhaps you mean to climb out of it?"; ! case CLIMB_INTO: return "Perhaps you mean to climb into it?"; ! case CLIMB_THROUGH: return "Perhaps you mean to climb through it?"; } return 0; } ! varargs mixed eventClimb(object who, int type, string where) { mixed dest = Climb[type]; + if(where && where !="") dest = where; if( functionp(dest) ) { if( functionp(dest) & FP_OWNER_DESTED ) { *************** *** 78,104 **** string omsg, imsg; switch(type) { ! case CLIMB_UP: omsg = "$N climbs up " + GetDefiniteShort() + "."; imsg = "$N comes climbing in."; break; ! case CLIMB_DOWN: omsg = "$N climbs down " + GetDefiniteShort() + "."; imsg = "$N comes climbing in."; break; ! case CLIMB_OUT: omsg = "$N climbs out " + GetDefiniteShort() + "."; imsg = "$N comes climbing in."; break; ! case CLIMB_INTO: omsg = "$N climbs into " + GetDefiniteShort() + "."; imsg = "$N comes climbing in."; break; ! case CLIMB_THROUGH: omsg = "$N climbs through " + GetDefiniteShort() + "."; imsg = "$N comes climbing in."; break; --- 97,123 ---- string omsg, imsg; switch(type) { ! case CLIMB_UP: omsg = "$N climbs up " + GetDefiniteShort() + "."; imsg = "$N comes climbing in."; break; ! case CLIMB_DOWN: omsg = "$N climbs down " + GetDefiniteShort() + "."; imsg = "$N comes climbing in."; break; ! case CLIMB_OUT: omsg = "$N climbs out " + GetDefiniteShort() + "."; imsg = "$N comes climbing in."; break; ! case CLIMB_INTO: omsg = "$N climbs into " + GetDefiniteShort() + "."; imsg = "$N comes climbing in."; break; ! case CLIMB_THROUGH: omsg = "$N climbs through " + GetDefiniteShort() + "."; imsg = "$N comes climbing in."; break; *************** *** 109,115 **** } mixed direct_climb_obj(object ob) { ! return CanClimb(this_player(), CLIMB_UP); } mixed direct_climb_out_of_obj(object ob) { --- 128,134 ---- } mixed direct_climb_obj(object ob) { ! return CanClimb(this_player(), CLIMB_UP); } mixed direct_climb_out_of_obj(object ob) { *************** *** 121,142 **** return 0; } switch(word) { ! case "up": return CanClimb(this_player(), CLIMB_UP); ! case "down": return CanClimb(this_player(), CLIMB_DOWN); ! case "out": return CanClimb(this_player(), CLIMB_OUT); ! case "in": case "into": return CanClimb(this_player(), CLIMB_INTO); ! case "through": return CanClimb(this_player(), CLIMB_THROUGH); ! default: return 0; } } --- 140,161 ---- return 0; } switch(word) { ! case "up": return CanClimb(this_player(), CLIMB_UP); ! case "down": return CanClimb(this_player(), CLIMB_DOWN); ! case "out": return CanClimb(this_player(), CLIMB_OUT); ! case "in": case "into": return CanClimb(this_player(), CLIMB_INTO); ! case "through": return CanClimb(this_player(), CLIMB_THROUGH); ! default: return 0; } } diff -c -r --new-file ds1.1/lib/lib/events/close.c ds2.0r27/lib/lib/events/close.c *** ds1.1/lib/lib/events/close.c Sun Feb 1 21:30:12 1998 --- ds2.0r27/lib/lib/events/close.c Wed Jul 5 00:01:05 2006 *************** *** 1,12 **** /* /lib/events/close.c ! * from the Dead Souls V Object Library * handles closing and opening events * created by Descartes of Borg 960115 * Version: @(#) close.c 1.5@(#) * Last modified: 96/12/23 */ ! private int Closed; // abstract methods string GetDefiniteShort(); --- 1,12 ---- /* /lib/events/close.c ! * from the Dead Souls Object Library * handles closing and opening events * created by Descartes of Borg 960115 * Version: @(#) close.c 1.5@(#) * Last modified: 96/12/23 */ ! int Closed; // abstract methods string GetDefiniteShort(); *************** *** 16,21 **** --- 16,26 ---- return Closed; } + int GetOpen(){ + if(GetClosed()) return 0; + else return 1; + } + int SetClosed(int x) { Closed = x; parse_refresh(); *************** *** 45,51 **** return 0; } send_messages("close", "$agent_name $agent_verb $target_name.", ! who, this_object(), environment(who)); return 1; } --- 50,56 ---- return 0; } send_messages("close", "$agent_name $agent_verb $target_name.", ! who, this_object(), environment(who)); return 1; } *************** *** 54,60 **** return 0; } send_messages("open", "$agent_name $agent_verb $target_name.", ! who, this_object(), environment(who)); return 1; } --- 59,65 ---- return 0; } send_messages("open", "$agent_name $agent_verb $target_name.", ! who, this_object(), environment(who)); return 1; } *************** *** 66,71 **** --- 71,84 ---- return !GetClosed(); } + int SetOpen(int x) { + if(x) Closed = 0; + else Closed = 1; + parse_refresh(); + return Closed; + } + + mixed direct_close_obj(object target) { return CanClose(this_player()); } diff -c -r --new-file ds1.1/lib/lib/events/crawl.c ds2.0r27/lib/lib/events/crawl.c *** ds1.1/lib/lib/events/crawl.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/events/crawl.c Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,8 ---- + mixed direct_crawl_str(string str) { + return 1; + } + + mixed direct_crawl_into_str(string str) { + return 1; + } + diff -c -r --new-file ds1.1/lib/lib/events/dig.c ds2.0r27/lib/lib/events/dig.c *** ds1.1/lib/lib/events/dig.c Sun Feb 1 21:30:13 1998 --- ds2.0r27/lib/lib/events/dig.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/events/dig.c ! * From the Dead Souls V Object Library * Handles things that can be dug * Created by Descartes of Borg 961231 * Version: @(#) dig.c 1.1@(#) --- 1,5 ---- /* /lib/events/dig.c ! * From the Dead Souls Object Library * Handles things that can be dug * Created by Descartes of Borg 961231 * Version: @(#) dig.c 1.1@(#) *************** *** 24,30 **** mixed SetDig(mixed val) { if( !stringp(val) && !arrayp(val) && !functionp(val) ) { error("Bad argument 1 to SetDig().\n\tExpected: string or function " ! "or mixed array, Got: " + typeof(val) + "\n"); } return (Dig = val); } --- 24,30 ---- mixed SetDig(mixed val) { if( !stringp(val) && !arrayp(val) && !functionp(val) ) { error("Bad argument 1 to SetDig().\n\tExpected: string or function " ! "or mixed array, Got: " + typeof(val) + "\n"); } return (Dig = val); } *************** *** 46,53 **** } if( stringp(val) ) { environment(who)->eventPrint(who->GetName() + " digs " + ! GetShort() + " with " + ! tool->GetShort() + ".", who); who->eventPrint(val); } else { --- 46,53 ---- } if( stringp(val) ) { environment(who)->eventPrint(who->GetName() + " digs " + ! GetShort() + " with " + ! tool->GetShort() + ".", who); who->eventPrint(val); } else { diff -c -r --new-file ds1.1/lib/lib/events/dig_with.c ds2.0r27/lib/lib/events/dig_with.c *** ds1.1/lib/lib/events/dig_with.c Sun Feb 1 21:30:13 1998 --- ds2.0r27/lib/lib/events/dig_with.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/events/dig_with.c ! * From the Dead Soulsr2 Object Library * handles functions to allow something to dig * Created by Descartes of Borg 951030 * Version: @(#) dig_with.c 1.3@(#) --- 1,5 ---- /* /lib/events/dig_with.c ! * From the Dead Souls Object Library * handles functions to allow something to dig * Created by Descartes of Borg 951030 * Version: @(#) dig_with.c 1.3@(#) diff -c -r --new-file ds1.1/lib/lib/events/drink.c ds2.0r27/lib/lib/events/drink.c *** ds1.1/lib/lib/events/drink.c Sun Feb 1 21:30:12 1998 --- ds2.0r27/lib/lib/events/drink.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/events/drink.c ! * From the Dead Souls V Object Library * Handles drinking in the form of OBJ and SUBSTANCE from OBJ * Created by descartes of Borg 961221 * Version: %A% --- 1,5 ---- /* /lib/events/drink.c ! * From the Dead Souls Object Library * Handles drinking in the form of OBJ and SUBSTANCE from OBJ * Created by descartes of Borg 961221 * Version: %A% *************** *** 25,28 **** mixed direct_drink_str_from_obj(string str) { return CanDrink(this_player(), remove_article(lower_case(str))); } ! --- 25,28 ---- mixed direct_drink_str_from_obj(string str) { return CanDrink(this_player(), remove_article(lower_case(str))); } ! diff -c -r --new-file ds1.1/lib/lib/events/drop.c ds2.0r27/lib/lib/events/drop.c *** ds1.1/lib/lib/events/drop.c Sun Feb 1 21:30:13 1998 --- ds2.0r27/lib/lib/events/drop.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/drop.c ! * From the Dead Souls V Object Library * Makes an object something which can be dropped * Created by Descartes of Borg 960113 * Version: @(#) drop.c 1.2@(#) --- 1,5 ---- /* /lib/drop.c ! * From the Dead Souls Object Library * Makes an object something which can be dropped * Created by Descartes of Borg 960113 * Version: @(#) drop.c 1.2@(#) *************** *** 39,45 **** if( objectp(PreventDrop) ) { if( PreventDrop == who ) { return capitalize(GetDefiniteShort()) + ! " simply will not leave your grasp."; } else { return 1; --- 39,45 ---- if( objectp(PreventDrop) ) { if( PreventDrop == who ) { return capitalize(GetDefiniteShort()) + ! " simply will not leave your grasp."; } else { return 1; *************** *** 55,75 **** mixed eventDrop(object who) { mixed tmp; ! if( who != environment() ) { return 0; } tmp = eventMove(environment(who)); if( !tmp ) { who->eventPrint("Something prevents you from dropping " ! + GetDefiniteShort() + "."); return 1; } if( tmp != 1 ) { return tmp; } send_messages("drop", "$agent_name $agent_verb $target_name.", ! who, this_object(), environment(who)); return 1; } --- 55,75 ---- mixed eventDrop(object who) { mixed tmp; ! if( who != environment() ) { return 0; } tmp = eventMove(environment(who)); if( !tmp ) { who->eventPrint("Something prevents you from dropping " ! + GetDefiniteShort() + "."); return 1; } if( tmp != 1 ) { return tmp; } send_messages("drop", "$agent_name $agent_verb $target_name.", ! who, this_object(), environment(who)); return 1; } diff -c -r --new-file ds1.1/lib/lib/events/fly.c ds2.0r27/lib/lib/events/fly.c *** ds1.1/lib/lib/events/fly.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/events/fly.c Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,8 ---- + mixed direct_fly_str(string str) { + return 1; + } + + mixed direct_fly_into_str(string str) { + return 1; + } + diff -c -r --new-file ds1.1/lib/lib/events/get.c ds2.0r27/lib/lib/events/get.c *** ds1.1/lib/lib/events/get.c Sun Feb 1 21:30:12 1998 --- ds2.0r27/lib/lib/events/get.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/get.c ! * from the Dead Souls V Object Library * handles the picking up of objects * created by Descartes of Borg 960114 * Version: @(#) get.c 1.3@(#) --- 1,5 ---- /* /lib/get.c ! * from the Dead Souls Object Library * handles the picking up of objects * created by Descartes of Borg 960114 * Version: @(#) get.c 1.3@(#) *************** *** 24,44 **** } mixed CanGet(object who) { - mixed val; if( !((int)who->CanCarry(GetMass())) ) return "It is too heavy for you!"; if( !PreventGet && !GetProperty("keep") ) return 1; if( stringp(GetProperty("keep")) ) { ! if( (string)who->GetKeyName() == GetProperty("keep") ) { if( !PreventGet ) return 1; } ! else return "Mystical forces prevent you from getting " + GetShort() + "."; } if( intp(PreventGet) ) return 0; if( stringp(PreventGet) ) return PreventGet; if( objectp(PreventGet) ) { if( PreventGet == who ) ! return capitalize(GetShort()) + " simply will not be taken."; else return 1; } else return evaluate(PreventGet, who); --- 24,43 ---- } mixed CanGet(object who) { if( !((int)who->CanCarry(GetMass())) ) return "It is too heavy for you!"; if( !PreventGet && !GetProperty("keep") ) return 1; if( stringp(GetProperty("keep")) ) { ! if( (string)who->GetKeyName() == GetProperty("keep") ) { if( !PreventGet ) return 1; } ! else return "Mystical forces prevent you from getting " + GetShort() + "."; } if( intp(PreventGet) ) return 0; if( stringp(PreventGet) ) return PreventGet; if( objectp(PreventGet) ) { if( PreventGet == who ) ! return capitalize(GetShort()) + " simply will not be taken."; else return 1; } else return evaluate(PreventGet, who); *************** *** 51,57 **** } who->eventPrint("You get " + GetShort() + "."); environment(who)->eventPrint((string)who->GetName() + " gets " + ! GetShort() + ".", who); return 1; } --- 50,56 ---- } who->eventPrint("You get " + GetShort() + "."); environment(who)->eventPrint((string)who->GetName() + " gets " + ! GetShort() + ".", who); return 1; } *************** *** 61,71 **** mixed direct_get_obj(object target) { if( environment() != environment(this_player()) ) { ! string str = GetShort(); ! if( !str ) str = "It"; ! else str = capitalize(str); ! return "#" + str + " is out of your reach."; } return CanGet(this_player()); } --- 60,70 ---- mixed direct_get_obj(object target) { if( environment() != environment(this_player()) ) { ! string str = GetShort(); ! if( !str ) str = "It"; ! else str = capitalize(str); ! return "# You are unable to do that right now."; } return CanGet(this_player()); } *************** *** 78,84 **** if( !(str = GetShort()) ) str = "It"; else str = capitalize(str); if( env==this_player() || env ==environment(this_player()) || living(env) ) ! return "#" + str + " is out of your reach."; return CanGet(this_player()); } --- 77,83 ---- if( !(str = GetShort()) ) str = "It"; else str = capitalize(str); if( env==this_player() || env ==environment(this_player()) || living(env) ) ! return "#You can't do that right now."; return CanGet(this_player()); } diff -c -r --new-file ds1.1/lib/lib/events/get_from.c ds2.0r27/lib/lib/events/get_from.c *** ds1.1/lib/lib/events/get_from.c Sun Feb 1 21:30:13 1998 --- ds2.0r27/lib/lib/events/get_from.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/events/get_from.c ! * From the Dead Souls V Object Library * Handles get from/put in * Created by Descartes of Borg 961221 * Version: @(#) get_from.c 1.1@(#) --- 1,5 ---- /* /lib/events/get_from.c ! * From the Dead Souls Object Library * Handles get from/put in * Created by Descartes of Borg 961221 * Version: @(#) get_from.c 1.1@(#) *************** *** 12,25 **** // end abstract methods mixed CanGetFrom(object who, object item) { if( !item ) { ! return 1; } if( environment(item) != this_object() ) { ! return "#It is not in there!"; } if( (environment() != environment(this_player())) && ! (environment() != this_player()) ) { return "#" + capitalize(GetShort()) + " is not in reach."; } return 1; --- 12,45 ---- // end abstract methods mixed CanGetFrom(object who, object item) { + //tc("hit CanGetFrom"); + //tc("who: "+identify(who)); + //tc("item: "+identify(item)); + //tc("this_object: "+this_object()->GetName()); + if( !item ) { ! //tc("no item. about to return 0"); ! return 0; ! } ! if( environment(item) != this_object() ) { ! //tc("this item isnt in my inventory. returning 0"); ! return 0; } + // if( environment(item) != this_object() ) { + ////tc("stack: "+get_stack()); + //tc("previous: "+identify(previous_object(-1))); + // + // return "#You can't do that."; + // } + //tc("survicved test"); if( environment(item) != this_object() ) { ! //tc("oddness"); ! item = present(item->GetKeyName(),this_object()); ! if(!item) return 0; } + if( (environment() != environment(this_player())) && ! (environment() != this_player()) ) { return "#" + capitalize(GetShort()) + " is not in reach."; } return 1; *************** *** 27,33 **** mixed CanPutInto(object who, object item) { object env; ! if( item == this_object() ) { return "#You cannot change the laws of physics."; } --- 47,73 ---- mixed CanPutInto(object who, object item) { object env; ! ! if( item == this_object() ) { ! return "#You cannot change the laws of physics."; ! } ! env = environment(); ! if( env != this_player() && env != environment(this_player()) ) { ! return "#It is not within reach."; ! } ! ! if( this_object()->GetClosed() ){ ! return "#It's closed!"; ! } ! return 1; ! } ! ! mixed CanPutOnto(object who, object item) { ! object env; ! ! if(!inherits( "/lib/comp/surface", item ) ){ ! return "#That isn't a load-bearing surface."; ! } if( item == this_object() ) { return "#You cannot change the laws of physics."; } *************** *** 38,43 **** --- 78,84 ---- return 1; } + mixed eventGetFrom(object who, object array what) { object array fin = ({}); string array shorts; *************** *** 45,54 **** string msg; int i, maxi; foreach(object ob in what ) { ! if( environment(ob) != this_object() ) { ! continue; ! } if( ob->CanGet(who) != 1 ) { continue; } --- 86,96 ---- string msg; int i, maxi; + //tc("hit eventGetFrom. item is: " +identify(what),"red"); foreach(object ob in what ) { ! if( environment(ob) != this_object() ) { ! continue; ! } if( ob->CanGet(who) != 1 ) { continue; } *************** *** 57,63 **** } if( !ob->eventMove(who) ) { who->eventPrint("You have a problem getting " + ! ob->GetShort() + "."); continue; } AddCarriedMass( -(ob->GetMass()) ); --- 99,105 ---- } if( !ob->eventMove(who) ) { who->eventPrint("You have a problem getting " + ! ob->GetShort() + "."); continue; } AddCarriedMass( -(ob->GetMass()) ); *************** *** 87,93 **** } } send_messages("get", "$agent_name $agent_verb " + msg + ! " from $target_name.", who, this_object(), environment(who)); return 1; } --- 129,135 ---- } } send_messages("get", "$agent_name $agent_verb " + msg + ! " from $target_name.", who, this_object(), environment(who)); return 1; } *************** *** 95,100 **** --- 137,147 ---- return what->eventPut(who, this_object()); } + mixed eventPutOnto(object who, object what) { + return what->eventPut(who, this_object()," onto "); + } + + int inventory_accessible() { return 1; } *************** *** 103,114 **** return 1; } ! mixed indirect_get_obj_from_obj(object item) { return CanGetFrom(this_player(), item); } ! mixed indirect_get_obj_out_of_obj(object item) { ! return indirect_get_obj_from_obj(item); } mixed indirect_get_obs_from_obj(object array items, object storage) { --- 150,179 ---- return 1; } ! mixed indirect_get_obj_from_obj(object item, object container) { ! //tc("stack: "+get_stack()); ! //tc("item is: " +identify(item)); ! //tc("container is: " +identify(container)); ! //tc("this object is: "+identify(this_object())); ! //if(item) tc("item's environment is: "+identify(environment(item))); ! if(!item){ ! //write("That's not there."); ! return 0; ! } ! ! if(environment(item) != this_object()) return 0; ! ! // if(!(environment(item) == this_object())){ ! // item = present(item->GetKeyName(),this_object()); ! //tc("item is now: " +identify(item)); ! //return 0; ! // } ! //tc("about to return CanGetFrom"); return CanGetFrom(this_player(), item); } ! mixed indirect_get_obj_out_of_obj(object item, object container) { ! return indirect_get_obj_from_obj(item, container); } mixed indirect_get_obs_from_obj(object array items, object storage) { diff -c -r --new-file ds1.1/lib/lib/events/give.c ds2.0r27/lib/lib/events/give.c *** ds1.1/lib/lib/events/give.c Sun Feb 1 21:30:13 1998 --- ds2.0r27/lib/lib/events/give.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/events/give.c ! * From the Dead Souls V Object Library * Give event handler * Created by Descartes of Borg 970101 * Version: @(#) give.c 1.1@(#) --- 1,5 ---- /* /lib/events/give.c ! * From the Dead Souls Object Library * Give event handler * Created by Descartes of Borg 970101 * Version: @(#) give.c 1.1@(#) *************** *** 28,37 **** } return 1; } ! mixed direct_give_obj_to_liv() { mixed tmp; ! if( environment() != this_player() ) { return "#You cannot give what is not yours."; } --- 28,37 ---- } return 1; } ! mixed direct_give_obj_to_liv() { mixed tmp; ! if( environment() != this_player() ) { return "#You cannot give what is not yours."; } diff -c -r --new-file ds1.1/lib/lib/events/jump.c ds2.0r27/lib/lib/events/jump.c *** ds1.1/lib/lib/events/jump.c Sun Feb 1 21:30:12 1998 --- ds2.0r27/lib/lib/events/jump.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/jump.c ! * from the Dead Souls V Object Library * handles different methods of jumping * created by Descartes of Borg 960117 * Version: @(#) jump.c 1.4@(#) --- 1,5 ---- /* /lib/jump.c ! * from the Dead Souls Object Library * handles different methods of jumping * created by Descartes of Borg 960117 * Version: @(#) jump.c 1.4@(#) *************** *** 12,50 **** private mapping Jumps = ([]); mapping GetJumps() { ! Jumps; } ! varargs mixed SetJump(mixed dest, int type) { ! if( !type ) { ! type = JUMP_INTO; ! } ! Jumps[type] = dest; ! return Jumps[type]; } mixed CanJump(object who, string id, int type) { ! if( Jumps[type] ) { return 1; } if( !sizeof(Jumps) ) { return 0; } ! type = keys(Jumps)[0]; switch(type) { ! case JUMP_INTO: return "Perhaps you mean to jump into it?"; ! case JUMP_FROM: return "Perhaps you mean to jump from it?"; ! case JUMP_THROUGH: return "Perhaps you mean to jump through it?"; ! case JUMP_OVER: return "Perhaps you mean to jump over it?"; ! case JUMP_ON: return "Perhaps you mean to jump on it?"; } return 0; --- 12,60 ---- private mapping Jumps = ([]); mapping GetJumps() { ! return Jumps; } ! //varargs mixed SetJump(mixed args) { ! // if(!mapp(args)) return "Bad argument to SetJump."; ! // foreach(mixed key, mixed val in args) { ! // if(!stringp(key)) return "Bad key value in SetJump"; ! // if(!arrayp(val)) return "Bad element to SetJump key \""+key+"\". An array is required."; ! // if(!stringp(val[0]) && !functionp(val[0])) return "Bad element 0 in array for key \""+key+"\". A string or function is required."; ! // if(!intp(val[1])) return "Bad element 1 in array for key \""+key+"\". A jump type is required."; ! // } ! // ! // return Jumps = args; ! // ! //} ! ! varargs mixed AddJump(string name, mixed saute, int type){ ! Jumps[name] = ({ saute , type }); } + mixed CanJump(object who, string id, int type) { ! if( Jumps[id] && Jumps[id][1] == type ) { return 1; } if( !sizeof(Jumps) ) { return 0; } ! type = Jumps[keys(Jumps)[0]][1]; switch(type) { ! case JUMP_INTO: return "Perhaps you mean to jump into it?"; ! case JUMP_FROM: return "Perhaps you mean to jump from it?"; ! case JUMP_THROUGH: return "Perhaps you mean to jump through it?"; ! case JUMP_OVER: return "Perhaps you mean to jump over it?"; ! case JUMP_ON: return "Perhaps you mean to jump on it?"; } return 0; *************** *** 52,60 **** mixed eventJump(object who, string id, int type) { mixed dest; ! ! if( Jumps[type] ) { ! dest = Jumps[type]; } else { return 0; --- 62,70 ---- mixed eventJump(object who, string id, int type) { mixed dest; ! ! if( Jumps[id] && Jumps[id][1] == type ) { ! dest = Jumps[id][0]; } else { return 0; *************** *** 63,84 **** string omsg, imsg; switch(type) { ! case JUMP_INTO: omsg = "$N jumps into the " + id + "."; imsg = "$N comes landing in."; break; ! case JUMP_FROM: omsg = "$N jumps out of here."; imsg = "$N comes landing in."; break; ! case JUMP_THROUGH: omsg = "$N jumps through the " + id + "."; imsg = "$N comes landing in."; break; ! case JUMP_OVER: omsg = "$N jumps over the " + id + "."; imsg = "$N comes landing in."; break; --- 73,94 ---- string omsg, imsg; switch(type) { ! case JUMP_INTO: omsg = "$N jumps into the " + id + "."; imsg = "$N comes landing in."; break; ! case JUMP_FROM: omsg = "$N jumps out of here."; imsg = "$N comes landing in."; break; ! case JUMP_THROUGH: omsg = "$N jumps through the " + id + "."; imsg = "$N comes landing in."; break; ! case JUMP_OVER: omsg = "$N jumps over the " + id + "."; imsg = "$N comes landing in."; break; *************** *** 124,130 **** string prep = args[0] + " " + args[1]; string id = remove_article(lower_case(args[5])); int type; ! switch(prep) { case "out of": case "off of": type = JUMP_FROM; --- 134,140 ---- string prep = args[0] + " " + args[1]; string id = remove_article(lower_case(args[5])); int type; ! switch(prep) { case "out of": case "off of": type = JUMP_FROM; diff -c -r --new-file ds1.1/lib/lib/events/lie.c ds2.0r27/lib/lib/events/lie.c *** ds1.1/lib/lib/events/lie.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/events/lie.c Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,41 ---- + #include <position.h> + + private int MaxLiers = 1; + private object array Liers = ({}); + + int GetMaxLiers() { + return MaxLiers; + } + + static int SetMaxLiers(int x) { + return (MaxLiers = x); + } + + object array GetLiers() { + return Liers; + } + + mixed eventReceiveLay(object who) { + Liers = ({ Liers..., who }); + return 1; + } + + mixed eventReleaseStand(object who) { + Liers -= ({ who }); + return 1; + } + + mixed direct_lie_word_obj() { + Liers = filter(Liers, (: $1 && $1->GetPosition()==POSITION_LYING :)); + if( sizeof(Liers) >= MaxLiers ) { + return "There is no room to lie there."; + } + if(environment() != environment(this_player())) { + return "That's not available for sitting right now."; + } + return 1; + } + + mixed direct_lie_down_word_obj() { + return direct_lie_word_obj(); + } diff -c -r --new-file ds1.1/lib/lib/events/listen.c ds2.0r27/lib/lib/events/listen.c *** ds1.1/lib/lib/events/listen.c Sun Feb 1 21:30:12 1998 --- ds2.0r27/lib/lib/events/listen.c Wed Jul 5 00:01:05 2006 *************** *** 17,23 **** varargs string GetListen(string str, object who) { mixed val; ! if( !str || str == "default" ) { val = Listen; } --- 17,23 ---- varargs string GetListen(string str, object who) { mixed val; ! if( !str || str == "default" ) { val = Listen; } *************** *** 90,96 **** } else { error("Wrong number of arguments to SetListen():\n\t" ! "Expected 1 or 2, got " + sizeof(args) + "\n"); } } --- 90,96 ---- } else { error("Wrong number of arguments to SetListen():\n\t" ! "Expected 1 or 2, got " + sizeof(args) + "\n"); } } *************** *** 101,111 **** return 1; } environment(who)->eventPrint(who->GetName() + " listens to " + GetShort() + ! ".", who); who->eventPrint(str); return 1; } ! mixed direct_listen_obj() { if( !Listen ) { return "You hear nothing unusual."; --- 101,111 ---- return 1; } environment(who)->eventPrint(who->GetName() + " listens to " + GetShort() + ! ".", who); who->eventPrint(str); return 1; } ! mixed direct_listen_obj() { if( !Listen ) { return "You hear nothing unusual."; *************** *** 128,130 **** --- 128,141 ---- return 1; } } + + mapping GetListenMap(){ + mapping Listens = ([]); + foreach(object ob in this_object()->GetDummyItems()) { + if( ob->GetListen() ) { + Listens[ob->GetId()] = ob->GetListen(); + } + } + if(this_object()->GetListen()) Listens["default"] = this_object()->GetListen(); + return copy(Listens); + } diff -c -r --new-file ds1.1/lib/lib/events/lock.c ds2.0r27/lib/lib/events/lock.c *** ds1.1/lib/lib/events/lock.c Sun Feb 1 21:30:12 1998 --- ds2.0r27/lib/lib/events/lock.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/events/lock.c ! * from the Dead Souls V Object Library * Handles lock/unlock/pick events * Created by Descartes of Borg 961221 * Version: @(#) lock.c 1.4@(#) --- 1,5 ---- /* /lib/events/lock.c ! * from the Dead Souls Object Library * Handles lock/unlock/pick events * Created by Descartes of Borg 961221 * Version: @(#) lock.c 1.4@(#) *************** *** 22,28 **** varargs string array GetKeys(string unused) { return Keys; } ! varargs string array SetKeys(mixed array args...) { if( !args ) { error("Bad argument 1 to SetKeys().\n"); --- 22,28 ---- varargs string array GetKeys(string unused) { return Keys; } ! varargs string array SetKeys(mixed array args...) { if( !args ) { error("Bad argument 1 to SetKeys().\n"); *************** *** 94,110 **** mixed eventLock(object who, object key) { string array ids = key->GetId(); if( !sizeof(ids & GetKeys()) ) { send_messages("try", "$agent_name $agent_verb to lock $target_name " ! "with " + key->GetShort() + ", but it does not work.", ! who, this_object(), environment(who)); } else { mixed tmp; send_messages("attempt", "$agent_name $agent_verb to lock " ! "$target_name with " + key->GetShort() + ".", ! who, this_object(), environment(who)); tmp = key->eventLockLock(who, this_object()); if( tmp != 1 ) { if( tmp ) { --- 94,114 ---- mixed eventLock(object who, object key) { string array ids = key->GetId(); + if(key->LockFun(1,key,lower_case(this_object()->GetName()))){ + return 1; + } + if( !sizeof(ids & GetKeys()) ) { send_messages("try", "$agent_name $agent_verb to lock $target_name " ! "with " + key->GetShort() + ", but it does not work.", ! who, this_object(), environment(who)); } else { mixed tmp; send_messages("attempt", "$agent_name $agent_verb to lock " ! "$target_name with " + key->GetShort() + ".", ! who, this_object(), environment(who)); tmp = key->eventLockLock(who, this_object()); if( tmp != 1 ) { if( tmp ) { *************** *** 116,122 **** return 0; } environment(who)->eventPrint(capitalize(GetDefiniteShort()) + ! " locks."); } return 1; } --- 120,126 ---- return 0; } environment(who)->eventPrint(capitalize(GetDefiniteShort()) + ! " locks."); } return 1; } *************** *** 161,176 **** return 0; } send_messages("pick", "$agent_name $agent_verb the lock on " ! "$target_name!", who, this_object(), environment(who)); return 1; } send_messages("fail", "$agent_name $agent_verb in $agent_possessive " ! "attempt to pick the lock on $target_name.", ! who, this_object(), environment(who)); if( random(100) > strength ) { send_messages("cut", "$agent_name $agent_verb $agent_reflexive " ! "on the lock.", who, this_object(), environment(who)); ! who->eventReceiveDamage(this_object(), 8, random(10) + 1); } return 1; } --- 165,180 ---- return 0; } send_messages("pick", "$agent_name $agent_verb the lock on " ! "$target_name!", who, this_object(), environment(who)); return 1; } send_messages("fail", "$agent_name $agent_verb in $agent_possessive " ! "attempt to pick the lock on $target_name.", ! who, this_object(), environment(who)); if( random(100) > strength ) { send_messages("cut", "$agent_name $agent_verb $agent_reflexive " ! "on the lock.", who, this_object(), environment(who)); ! who->eventReceiveDamage(this_object(), 8, random(10) + 1); } return 1; } *************** *** 178,194 **** mixed eventUnlock(object who, object key) { string array ids = key->GetId();; if( !sizeof(ids & GetKeys()) ) { send_messages("attempt", "$agent_name $agent_verb to unlock " ! "$target_name with " + key->GetShort() + ", but it " ! "does not work.", who, this_object(), environment(who)); } else { mixed tmp; send_messages("attempt", "$agent_name $agent_verb $target_name with "+ ! key->GetShort() + ".", who, this_object(), ! environment(who)); tmp = key->eventUnlockLock(who, this_object()); if( tmp != 1 ) { if( tmp ) { --- 182,202 ---- mixed eventUnlock(object who, object key) { string array ids = key->GetId();; + if(key->UnLockFun(1,key,lower_case(this_object()->GetName()))){ + return 1; + } + if( !sizeof(ids & GetKeys()) ) { send_messages("attempt", "$agent_name $agent_verb to unlock " ! "$target_name with " + key->GetShort() + ", but it " ! "does not work.", who, this_object(), environment(who)); } else { mixed tmp; send_messages("attempt", "$agent_name $agent_verb $target_name with "+ ! key->GetShort() + ".", who, this_object(), ! environment(who)); tmp = key->eventUnlockLock(who, this_object()); if( tmp != 1 ) { if( tmp ) { *************** *** 200,206 **** return 0; } environment(who)->eventPrint(capitalize(GetDefiniteShort()) + ! " comes unlocked."); } return 1; } --- 208,214 ---- return 0; } environment(who)->eventPrint(capitalize(GetDefiniteShort()) + ! " comes unlocked."); } return 1; } *************** *** 210,216 **** } mixed direct_pick_str_on_obj(string str, object target, string str2, ! string id) { if( remove_article(lower_case(str)) != "lock" ) { return "Pick the what?"; } --- 218,224 ---- } mixed direct_pick_str_on_obj(string str, object target, string str2, ! string id) { if( remove_article(lower_case(str)) != "lock" ) { return "Pick the what?"; } *************** *** 218,231 **** } mixed direct_pick_str_on_obj_with_obj(string str, object target, object tool, ! string str2, string targ_id) { if( remove_article(lower_case(str)) != "lock" ) { return "Pick the what?"; } targ_id = remove_article(lower_case(targ_id)); return CanPick(this_player(), targ_id); } ! mixed direct_unlock_obj_with_obj(object target, object key, string id) { return CanUnlock(this_player(), remove_article(lower_case(id))); } --- 226,239 ---- } mixed direct_pick_str_on_obj_with_obj(string str, object target, object tool, ! string str2, string targ_id) { if( remove_article(lower_case(str)) != "lock" ) { return "Pick the what?"; } targ_id = remove_article(lower_case(targ_id)); return CanPick(this_player(), targ_id); } ! mixed direct_unlock_obj_with_obj(object target, object key, string id) { return CanUnlock(this_player(), remove_article(lower_case(id))); } diff -c -r --new-file ds1.1/lib/lib/events/lock_with.c ds2.0r27/lib/lib/events/lock_with.c *** ds1.1/lib/lib/events/lock_with.c Sun Feb 1 21:30:13 1998 --- ds2.0r27/lib/lib/events/lock_with.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/events/lock_with.c ! * From the Dead Souls V Object Library * The indirect object of locks and unlocks (a key) * Created by Descartes of Borg 960121 */ --- 1,5 ---- /* /lib/events/lock_with.c ! * From the Dead Souls Object Library * The indirect object of locks and unlocks (a key) * Created by Descartes of Borg 960121 */ *************** *** 39,45 **** if( GetDisableChance() > random(100) ) { SetDisabled(1); who->eventPrint(capitalize(GetDefiniteShort()) + " gets twisted " ! "slightly out of shape as you try to use it.."); return 1; } return 1; --- 39,45 ---- if( GetDisableChance() > random(100) ) { SetDisabled(1); who->eventPrint(capitalize(GetDefiniteShort()) + " gets twisted " ! "slightly out of shape as you try to use it."); return 1; } return 1; diff -c -r --new-file ds1.1/lib/lib/events/look.c ds2.0r27/lib/lib/events/look.c *** ds1.1/lib/lib/events/look.c Sun Feb 1 21:30:12 1998 --- ds2.0r27/lib/lib/events/look.c Wed Jul 5 00:01:05 2006 *************** *** 7,22 **** */ #include <function.h> private mixed ExternalDesc = 0; private int Invisible = 0; ! private mapping Items = ([]); // abstract methods string GetShort(); // end abstract methods varargs string GetExternalDesc(object who) { if( !ExternalDesc ) { return ""; } --- 7,32 ---- */ #include <function.h> + #include <lib.h> private mixed ExternalDesc = 0; private int Invisible = 0; ! //private mapping Items = ([]); ! mapping Items = ([]); // abstract methods string GetShort(); // end abstract methods varargs string GetExternalDesc(object who) { + string openstate; + + if(this_object()->CanClose()){ + if(this_object()->GetClosed()) openstate = " It is closed."; + else openstate = " It is open."; + } + else openstate = ""; + if( !ExternalDesc ) { return ""; } *************** *** 27,36 **** return evaluate(ExternalDesc, who); } else if( arrayp(ExternalDesc) ) { ! return ExternalDesc[query_night()]; } else { ! return ExternalDesc; } } --- 37,46 ---- return evaluate(ExternalDesc, who); } else if( arrayp(ExternalDesc) ) { ! return ExternalDesc[query_night()] + openstate;; } else { ! return ExternalDesc + openstate; } } *************** *** 49,55 **** } mixed SetInvis(mixed val) { ! if( intp(val) ) { return (Invisible = val); } else if( functionp(val) && !Invisible ) { --- 59,74 ---- } mixed SetInvis(mixed val) { ! if( !val || intp(val) ) { ! if(!val || val == 0){ ! Invisible = 0; ! if(sizeof(get_livings(environment(this_object()),2))){ ! foreach(object ob in get_livings(environment(this_object()),2)){ ! ob->CheckEncounter(); ! } ! } ! return 1; ! } return (Invisible = val); } else if( functionp(val) && !Invisible ) { *************** *** 60,66 **** } } ! mixed AddItem(mixed item, mixed val) { if( functionp(val) || stringp(val) || arrayp(val) ) { if( stringp(item) ) { Items[item] = val; --- 79,89 ---- } } ! varargs mixed AddItem(mixed item, mixed val) { ! if( objectp(item) ) { ! item->eventMove(this_object()); ! return 1; ! } if( functionp(val) || stringp(val) || arrayp(val) ) { if( stringp(item) ) { Items[item] = val; *************** *** 78,90 **** } varargs mixed GetItem(string item, object who) { ! mixed val = Items[item]; if( !val ) { return 0; } ! if( stringp(val) ) { ! return val; } else if( functionp(val) ) { if( functionp(val) & FP_OWNER_DESTED ) { --- 101,113 ---- } varargs mixed GetItem(string item, object who) { ! mixed val = mapping_member(Items, item); if( !val ) { return 0; } ! if( stringp(val) || arrayp(val)) { ! return Items[val]; } else if( functionp(val) ) { if( functionp(val) & FP_OWNER_DESTED ) { *************** *** 92,103 **** } return evaluate(val, who, item); } - else if( arrayp(val) ) { - if( sizeof(val) != 2 ) { - return 0; - } - return val[query_night()]; - } else { return 0; } --- 115,120 ---- *************** *** 107,112 **** --- 124,133 ---- return keys(Items); } + mapping GetItemsMap(){ + return copy(Items); + } + mapping RemoveItem(mixed item) { if( !stringp(item) ) { if( !arrayp(item) ) { *************** *** 120,129 **** } mapping SetItems(mapping items) { ! return (Items = expand_keys(items)); } - // This method should no longer be used varargs string GetLong(string str) { if( str && Items[str] ) { return GetItem(str); --- 141,149 ---- } mapping SetItems(mapping items) { ! return (Items = copy(items)); } varargs string GetLong(string str) { if( str && Items[str] ) { return GetItem(str); *************** *** 133,139 **** } } - // This method should no longer be used string SetLong(string str) { return SetExternalDesc(str); } --- 153,158 ---- *************** *** 145,166 **** component = remove_article(lower_case(component)); desc = GetItem(component, who); environment(who)->eventPrint(who->GetName() + " looks at the " + ! component + " on " + GetShort() + ".", ! ({ who, this_object() })); } else { desc = GetExternalDesc(who); environment(who)->eventPrint(who->GetName() + " looks at " + ! GetShort() + ".", ! ({ who, this_object() })); } - who->eventPrint(desc); return 1; } mixed direct_look_obj() { object env = environment(); ! if( env != this_player() && env != environment(this_player()) ) { return "#You can't get to it to look at it."; } --- 164,194 ---- component = remove_article(lower_case(component)); desc = GetItem(component, who); environment(who)->eventPrint(who->GetName() + " looks at the " + ! component + " on " + GetShort() + ".", ! ({ who, this_object() })); } else { desc = GetExternalDesc(who); environment(who)->eventPrint(who->GetName() + " looks at " + ! GetShort() + ".", ! ({ who, this_object() })); ! } ! if(inherits(LIB_SURFACE,this_object()) || ! this_object()->GetOpacity() < 33){ ! //tempdesc = this_object()->eventShowInterior(who); ! who->eventPrint(desc); ! this_object()->eventShowInterior(who); ! } ! ! else { ! who->eventPrint(desc); } return 1; } mixed direct_look_obj() { object env = environment(); ! if( env != this_player() && env != environment(this_player()) ) { return "#You can't get to it to look at it."; } *************** *** 170,180 **** mixed direct_look_at_obj() { return direct_look_obj(); } ! mixed direct_look_at_obj_word_obj() { return direct_look_obj(); } ! mixed direct_look_at_str_on_obj(string str, object target) { str = remove_article(lower_case(str)); if( !Items[str] ) { --- 198,208 ---- mixed direct_look_at_obj() { return direct_look_obj(); } ! mixed direct_look_at_obj_word_obj() { return direct_look_obj(); } ! mixed direct_look_at_str_on_obj(string str, object target) { str = remove_article(lower_case(str)); if( !Items[str] ) { diff -c -r --new-file ds1.1/lib/lib/events/look_in.c ds2.0r27/lib/lib/events/look_in.c *** ds1.1/lib/lib/events/look_in.c Sun Feb 1 21:30:12 1998 --- ds2.0r27/lib/lib/events/look_in.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/events/look_in.c ! * From the Dead Souls V Object Library * Something that can be seen in * Created by Descartes of Borg 961222 * Version :@(#) look_in.c 1.2@(#) --- 1,5 ---- /* /lib/events/look_in.c ! * From the Dead Souls Object Library * Something that can be seen in * Created by Descartes of Borg 961222 * Version :@(#) look_in.c 1.2@(#) *************** *** 9,15 **** #include <function.h> private string InternalDesc = 0; ! private int Opacity = 100; // abstract methods string GetShort(); --- 9,15 ---- #include <function.h> private string InternalDesc = 0; ! int Opacity = 100; // abstract methods string GetShort(); *************** *** 40,46 **** return Opacity; } ! static int SetOpacity(int x) { Opacity = x; parse_refresh(); return Opacity; --- 40,46 ---- return Opacity; } ! int SetOpacity(int x) { Opacity = x; parse_refresh(); return Opacity; *************** *** 48,87 **** varargs mixed CanShowInterior(object who, object target) { int x; ! if( target ) { x = 66; } else { ! x = 34; } ! if( GetOpacity() > x ) { return 0; } return 1; } ! mixed eventShowInterior(object who, object target) { if( target ) { ! return target->eventShow(who); } - else { - string str = GetInternalDesc(); ! if( !str || str == "" ) { ! return 0; ! } ! environment(who)->eventPrint(who->GetName() + " looks inside " + ! GetShort() + ".", who); ! who->eventPrint(str); } } mixed direct_look_in_obj() { return CanShowInterior(this_player()); } mixed direct_look_inside_obj() { return CanShowInterior(this_player()); } --- 48,113 ---- varargs mixed CanShowInterior(object who, object target) { int x; ! ! if( environment() != this_player() && environment(this_player()) != ! environment()) { ! return "#You don't have that!"; ! } ! ! if(living()) { ! //write("You can't look inside of a living being."); ! //return 1; ! return "You can't look inside of a living being."; ! } ! if( target ) { x = 66; } else { ! x = 33; } ! if( this_object()->GetClosed() && this_object()->GetOpacity() > x ) { return 0; } return 1; } ! varargs mixed eventShowInterior(object who, object target) { ! object here,me,imhere,dabei; ! string this,str; ! here=environment(this_object()); ! me=this_object(); ! this=me->GetKeyName(); ! str=me->GetInternalDesc(); ! imhere=present(this,environment(who)); ! dabei=present(this,who); ! if( target ) { ! //return target->eventShow(who); ! return "well, well, well."; } ! if(!imhere && !dabei) { ! who->eventPrint("That is not here."); ! return 0; ! } ! ! if( !str || str == "" ) { ! return 0; } + if(!inherits("/lib/comp/surface",this_object())) environment(who)->eventPrint(who->GetName() + " looks inside " + + GetShort() + ".", who); + who->eventPrint(str); + } mixed direct_look_in_obj() { + if(inherits("/lib/comp/surface",this_object())) return 0; return CanShowInterior(this_player()); } mixed direct_look_inside_obj() { + if(inherits("/lib/comp/surface",this_object())) return 0; return CanShowInterior(this_player()); } diff -c -r --new-file ds1.1/lib/lib/events/manipulate.c ds2.0r27/lib/lib/events/manipulate.c *** ds1.1/lib/lib/events/manipulate.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/events/manipulate.c Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,103 ---- + #include <function.h> + + static private mapping Manipulate = ([]); + + // abstract methods + string GetDefiniteShort(); + // end abstract methods + + varargs mixed GetManipulate(string str) { + if( !str ) { + str = "default"; + } + return Manipulate[str]; + } + + string array GetManipulates() { + return keys(Manipulate); + } + + mapping RemoveManipulate(string item) { + map_delete(Manipulate, item); + return Manipulate; + } + + varargs mapping SetManipulate(mixed key, mixed desc) { + if( !key ) { + key = "default"; + } + if( !desc ) { + if( mapp(key) ) { + Manipulate = expand_keys(key); + } + else { + Manipulate["default"] = key; + } + } + else { + Manipulate[key] = desc; + } + return Manipulate; + } + + varargs mixed CanManipulate(object who, string component) { + mixed val; + + if( !component ) { + component = "default"; + } + val = Manipulate[component]; + if( !val ) { + if( component == "default" ) { + return 0; + } + else { + return "#There is no " + component + " on " + + GetDefiniteShort() + "."; + } + } + else return 1; + } + + varargs mixed eventManipulate(object who, string component) { + mixed val; + + if( !component ) { + val = Manipulate["default"]; + } + else { + val = Manipulate[component]; + } + if( arrayp(val) ) { + val = val[query_night()]; + } + if( stringp(val) ) { + object env; + + env = environment(who); + who->eventPrint(val); + if( component ) { + env->eventPrint(who->GetName() + " moves the " + component + + " on " + GetDefiniteShort() + ".", who); + } + else { + env->eventPrint(who->GetName() + " moves " + + GetDefiniteShort() + ".", who); + } + return 1; + } + else { + if( functionp(val) & FP_OWNER_DESTED ) { + return "Error in evaluating functional."; + } + return evaluate(val, who, component); + } + } + + mixed direct_move_obj(object target) { + return CanManipulate(this_player()); + } + + mixed direct_move_str_on_obj(string str, object target) { + return CanManipulate(this_player(), remove_article(lower_case(str))); + } diff -c -r --new-file ds1.1/lib/lib/events/poison.c ds2.0r27/lib/lib/events/poison.c *** ds1.1/lib/lib/events/poison.c Sun Feb 1 21:30:13 1998 --- ds2.0r27/lib/lib/events/poison.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/events/poison.c ! * From the Dead Souls V Object Library * Objects which can respond to poisoning * Created by Descartes of Borg 970101 * Version: @(#) poison.c 1.1@(#) --- 1,5 ---- /* /lib/events/poison.c ! * From the Dead Souls Object Library * Objects which can respond to poisoning * Created by Descartes of Borg 970101 * Version: @(#) poison.c 1.1@(#) *************** *** 34,40 **** mixed eventPoison(object who, object agent, int strength) { send_messages("spread", "$agent_name $agent_verb some poison onto " ! "$target_name.", who, this_object(), environment(who)); AddPoison(strength); return 1; } --- 34,40 ---- mixed eventPoison(object who, object agent, int strength) { send_messages("spread", "$agent_name $agent_verb some poison onto " ! "$target_name.", who, this_object(), environment(who)); AddPoison(strength); return 1; } diff -c -r --new-file ds1.1/lib/lib/events/press.c ds2.0r27/lib/lib/events/press.c *** ds1.1/lib/lib/events/press.c Sun Feb 1 21:30:13 1998 --- ds2.0r27/lib/lib/events/press.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/events/press.c ! * from the Dead Souls V Object Library * handles people pressing things * created by Descartes of Borg 960114 * Version: @(#) press.c 1.3@(#) --- 1,5 ---- /* /lib/events/press.c ! * from the Dead Souls Object Library * handles people pressing things * created by Descartes of Borg 960114 * Version: @(#) press.c 1.3@(#) *************** *** 50,56 **** varargs mixed CanPress(object who, string component) { mixed val; ! if( !component ) { component = "default"; } --- 50,56 ---- varargs mixed CanPress(object who, string component) { mixed val; ! if( !component ) { component = "default"; } *************** *** 61,67 **** } else { return "#There is no " + component + " on " + ! GetDefiniteShort() + "."; } } else return 1; --- 61,67 ---- } else { return "#There is no " + component + " on " + ! GetDefiniteShort() + "."; } } else return 1; *************** *** 69,75 **** varargs mixed eventPress(object who, string component) { mixed val; ! if( !component ) { val = Press["default"]; } --- 69,75 ---- varargs mixed eventPress(object who, string component) { mixed val; ! if( !component ) { val = Press["default"]; } *************** *** 86,96 **** who->eventPrint(val); if( component ) { env->eventPrint(who->GetName() + " presses the " + component + ! " on " + GetDefiniteShort() + ".", who); } else { env->eventPrint(who->GetName() + " presses " + ! GetDefiniteShort() + ".", who); } return 1; } --- 86,96 ---- who->eventPrint(val); if( component ) { env->eventPrint(who->GetName() + " presses the " + component + ! " on " + GetDefiniteShort() + ".", who); } else { env->eventPrint(who->GetName() + " presses " + ! GetDefiniteShort() + ".", who); } return 1; } *************** *** 101,111 **** return evaluate(val, who, component); } } ! mixed direct_press_obj(object target) { return CanPress(this_player()); } ! mixed direct_press_str_on_obj(string str, object target) { return CanPress(this_player(), remove_article(lower_case(str))); } --- 101,111 ---- return evaluate(val, who, component); } } ! mixed direct_press_obj(object target) { return CanPress(this_player()); } ! mixed direct_press_str_on_obj(string str, object target) { return CanPress(this_player(), remove_article(lower_case(str))); } diff -c -r --new-file ds1.1/lib/lib/events/pull.c ds2.0r27/lib/lib/events/pull.c *** ds1.1/lib/lib/events/pull.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/events/pull.c Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,103 ---- + #include <function.h> + + static private mapping Pull = ([]); + + // abstract methods + string GetDefiniteShort(); + // end abstract methods + + varargs mixed GetPull(string str) { + if( !str ) { + str = "default"; + } + return Pull[str]; + } + + string array GetPulls() { + return keys(Pull); + } + + mapping RemovePull(string item) { + map_delete(Pull, item); + return Pull; + } + + varargs mapping SetPull(mixed key, mixed desc) { + if( !key ) { + key = "default"; + } + if( !desc ) { + if( mapp(key) ) { + Pull = expand_keys(key); + } + else { + Pull["default"] = key; + } + } + else { + Pull[key] = desc; + } + return Pull; + } + + varargs mixed CanPull(object who, string component) { + mixed val; + + if( !component ) { + component = "default"; + } + val = Pull[component]; + if( !val ) { + if( component == "default" ) { + return 0; + } + else { + return "#There is no " + component + " on " + + GetDefiniteShort() + "."; + } + } + else return 1; + } + + varargs mixed eventPull(object who, string component) { + mixed val; + + if( !component ) { + val = Pull["default"]; + } + else { + val = Pull[component]; + } + if( arrayp(val) ) { + val = val[query_night()]; + } + if( stringp(val) ) { + object env; + + env = environment(who); + who->eventPrint(val); + if( component ) { + env->eventPrint(who->GetName() + " pulls the " + component + + " on " + GetDefiniteShort() + ".", who); + } + else { + env->eventPrint(who->GetName() + " pulls " + + GetDefiniteShort() + ".", who); + } + return 1; + } + else { + if( functionp(val) & FP_OWNER_DESTED ) { + return "Error in evaluating functional."; + } + return evaluate(val, who, component); + } + } + + mixed direct_pull_obj(object target) { + return CanPull(this_player()); + } + + mixed direct_pull_str_on_obj(string str, object target) { + return CanPull(this_player(), remove_article(lower_case(str))); + } diff -c -r --new-file ds1.1/lib/lib/events/put.c ds2.0r27/lib/lib/events/put.c *** ds1.1/lib/lib/events/put.c Sun Feb 1 21:30:11 1998 --- ds2.0r27/lib/lib/events/put.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/put.c ! * from the Dead Souls V Object Library * handles things which may be put into other objects * created by Descartes of Borg 960114 */ --- 1,5 ---- /* /lib/put.c ! * from the Dead Souls Object Library * handles things which may be put into other objects * created by Descartes of Borg 960114 */ *************** *** 24,59 **** mixed tmp; if( (tmp = CanDrop(who)) != 1 ) return tmp; ! if( environment() != this_player() ) return 0; if( !PreventPut ) return 1; if( intp(PreventPut) ) return 0; if( stringp(PreventPut) ) return PreventPut; if( objectp(PreventPut) ) { if( PreventPut == who ) ! return "You cannot put " + GetShort() + " anywhere."; else return 1; } ! else return evaluate(PreventPut, who); } ! mixed eventPut(object who, object storage) { if( !eventMove(storage) ) { who->eventPrint("There is not enough room in there!"); return 0; } ! who->eventPrint("You put " + GetShort() + " into " + ! (string)storage->GetShort() + "."); environment(who)->eventPrint((string)who->GetName() + " puts " + ! GetShort() + " into " + ! (string)storage->GetShort() + ".", who); return 1; } ! static void create() { PreventPut = 0; } ! mixed direct_put_obj_word_obj() { return CanPut(this_player()); } --- 24,94 ---- mixed tmp; if( (tmp = CanDrop(who)) != 1 ) return tmp; ! //debug("i dunno 1"); ! if( !environment() ) { destruct(this_object()); return 1; } ! //debug("i dunno 2"); ! if( environment() != this_player() && ! environment() != environment(this_player())) return 0; ! //debug("i dunno 3"); if( !PreventPut ) return 1; + //debug("i dunno 4"); + if( stringp(PreventPut) && PreventPut == "PERMIT" ) return 1; + //debug("i dunno 5"); if( intp(PreventPut) ) return 0; + //debug("i dunno 6"); if( stringp(PreventPut) ) return PreventPut; + //debug("i dunno 7"); if( objectp(PreventPut) ) { if( PreventPut == who ) ! return "You cannot put " + GetShort() + " anywhere."; else return 1; } ! else if(functionp(PreventPut)) return evaluate(PreventPut, who); ! else { ! return "It seems you're unable to do that right now."; ! } } ! varargs mixed eventPut(object who, object storage, string prep) { ! int depth; ! ! if(!prep || prep == "") prep = " into "; ! if(prep == " onto " && !inherits( "/lib/comp/surface", previous_object() ) ) { ! who->eventPrint("That isn't a load-bearing surface."); ! return 0; ! } ! ! if(prep == " into " && inherits( "/lib/comp/surface", previous_object() ) ) { ! who->eventPrint("That's a surface. Try \"put on\""); ! return 0; ! } ! if( !eventMove(storage) ) { who->eventPrint("There is not enough room in there!"); return 0; } ! who->eventPrint("You put " + GetShort() + prep + ! (string)storage->GetShort() + "."); environment(who)->eventPrint((string)who->GetName() + " puts " + ! GetShort() + prep + ! (string)storage->GetShort() + ".", who); ! if(inherits("/lib/std/storage",this_object())) { ! depth = this_object()->GetRecurseDepth(); ! if(depth && inherits("/lib/std/storage",storage)) storage->AddRecurseDepth(depth); ! } ! return 1; } ! static void create() { PreventPut = 0; } ! mixed direct_put_obj_word_obj(object ob, string wrd, object ob2) { ! return CanPut(this_player()); ! } ! ! mixed direct_put_wrd_wrd_word_obj(){ return CanPut(this_player()); } diff -c -r --new-file ds1.1/lib/lib/events/read.c ds2.0r27/lib/lib/events/read.c *** ds1.1/lib/lib/events/read.c Sun Feb 1 21:30:12 1998 --- ds2.0r27/lib/lib/events/read.c Wed Jul 5 00:01:05 2006 *************** *** 1,16 **** - /* /lib/read.c - * from the Dead Soulsr2 Object Library - * handles sounds and such - * created by Descartes of Borg 951107 - * Version: @(#) read.c 1.6@(#) - * Last modified: 97/01/01 - */ - #include <function.h> static private mixed Read = 0; static private mapping Reads = ([]); // abstract methods string GetShort(); // end abstract methods --- 1,13 ---- #include <function.h> + #include <message_class.h> + static private string Language; static private mixed Read = 0; static private mapping Reads = ([]); + string tmpfile, globalval; + object globalwho; + // abstract methods string GetShort(); // end abstract methods *************** *** 65,90 **** return Reads; } varargs mixed eventRead(object who, string str) { mixed val = GetRead(str); if( arrayp(val) ) { val = val[query_night()]; } if( functionp(val) ) { if( functionp(val) & FP_OWNER_DESTED ) { who->eventPrint("There was a problem with the read."); return 1; } ! return evaluate(val, who, str); } environment(who)->eventPrint(who->GetName() + " reads " + GetShort() + ".", ! who); if( !val ) { who->eventPrint("There is nothing to read."); return 1; } ! who->eventPrint(val); return 1; } --- 62,170 ---- return Reads; } + void SetReads(mapping ReadMap){ + foreach(mixed key, mixed val in ReadMap){ + SetRead(key, val); + } + } + + varargs mixed SetDefaultRead(mixed arg1, mixed desc) { + if( mapp(arg1) ) { + return 0; + } + if( !desc ) { + Read = arg1; + return Read; + } + if( !arg1 || arg1 == "default" ) { + Read = desc; + return Read; + } + } + + int SetLanguage(string str){ + if(str) Language = str; + return 1; + } + + mixed GetLanguage(){ + if(Language) return Language; + else return 0; + } + varargs mixed eventRead(object who, string str) { + mixed ret; mixed val = GetRead(str); + //tc("-1"); if( arrayp(val) ) { val = val[query_night()]; } + if(mapp(val)) val = val[str]; + if( functionp(val) ) { if( functionp(val) & FP_OWNER_DESTED ) { who->eventPrint("There was a problem with the read."); + //tc("alpha"); return 1; } ! //The funtion being evaluated, GetRead, only takes one arg. ! //return evaluate(val, who, str); ! ret = evaluate(val, str); ! if(!stringp(ret)) return 1; } + //tc("bravo"); environment(who)->eventPrint(who->GetName() + " reads " + GetShort() + ".", ! who); ! if(ret) val = ret; if( !val ) { who->eventPrint("There is nothing to read."); return 1; } ! //tc("charlie"); ! tmpfile = generate_tmp(); ! //tc("tmpfile: "+tmpfile); ! globalwho = who; ! globalval = val; ! ! //tc("delta"); ! if(Language){ ! //tc("echo"); ! write("The language appears to be "+capitalize(Language)+"."); ! } ! ! if(!globalval){ ! //tc("foxtrot"); ! write("You can't read that."); ! return 0; ! } ! //tc("0"); ! ! //unguarded( (: write_file(tmpfile, globalval) :) ); ! if(Language && (this_player()->GetLanguageLevel(Language) < 100 && ! !(this_player()->GetPolyglot()))){ ! //tc("1"); ! if(sizeof(globalval) > 4800){ ! //tc("2"); ! globalval = "It is too long and you are too unfamiliar with the language to make sense of it."; ! ! } ! else { ! //tc("3"); ! globalval = translate(val, this_player()->GetLanguageLevel(Language)); ! } ! //tc("4"); ! } ! else { ! //tc("6"); ! globalval = val; ! } ! //tc("val: "+val); ! //tc("globalval: "+globalval); ! unguarded( (: write_file(tmpfile, globalval,1) :) ); ! ! unguarded( (: globalwho->eventPage(tmpfile) :) ); ! unguarded( (: rm(tmpfile) :) ); return 1; } *************** *** 93,99 **** return 0; } else { ! return 1; } } --- 173,184 ---- return 0; } else { ! if( environment() != this_player() && environment(this_player()) != ! environment()) { ! return "#You don't have that!"; ! } ! else return 1; ! } } *************** *** 103,109 **** return 0; } else { ! return 1; } } --- 188,199 ---- return 0; } else { ! if( environment() != this_player() && environment(this_player()) != ! environment()) { ! return "#You don't have that!"; ! } ! else return 1; ! } } diff -c -r --new-file ds1.1/lib/lib/events/search.c ds2.0r27/lib/lib/events/search.c *** ds1.1/lib/lib/events/search.c Sun Feb 1 21:30:12 1998 --- ds2.0r27/lib/lib/events/search.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/search.c ! * from the Dead Soulsr2 Object Library * allows people to search things * created by Descartes of Borg 951008 * Version: @(#) search.c 1.7@(#) --- 1,5 ---- /* /lib/search.c ! * from the Dead Souls Object Library * allows people to search things * created by Descartes of Borg 951008 * Version: @(#) search.c 1.7@(#) *************** *** 17,23 **** varargs string GetSearch(string str, object who) { mixed val; ! if( !str || str == "default" ) { val = Search; } --- 17,23 ---- varargs string GetSearch(string str, object who) { mixed val; ! if( !str || str == "default" ) { val = Search; } *************** *** 90,96 **** } else { error("Wrong number of arguments to SetSearch():\n\t" ! "Expected 1 or 2, got " + sizeof(args) + "\n"); } } --- 90,96 ---- } else { error("Wrong number of arguments to SetSearch():\n\t" ! "Expected 1 or 2, got " + sizeof(args) + "\n"); } } *************** *** 100,111 **** who->eventPrint("There is nothing to search."); return 1; } ! environment(who)->eventPrint(who->GetName() + " searches " + GetShort() + ! ".", who); who->eventPrint(str); return 1; } ! mixed direct_search_obj() { if( !Search ) { return 0; --- 100,113 ---- who->eventPrint("There is nothing to search."); return 1; } ! //environment(who)->eventPrint(who->GetName() + " searches " + GetShort() + ! // ".", who); ! environment(who)->eventPrint(who->GetName() + " searches " ! "for something.", who); who->eventPrint(str); return 1; } ! mixed direct_search_obj() { if( !Search ) { return 0; diff -c -r --new-file ds1.1/lib/lib/events/sell.c ds2.0r27/lib/lib/events/sell.c *** ds1.1/lib/lib/events/sell.c Sun Feb 1 21:30:13 1998 --- ds2.0r27/lib/lib/events/sell.c Wed Jul 5 00:01:05 2006 *************** *** 1,11 **** /* /lib/events/sell.c ! * From the Dead Souls V Objecdt Library * Handles the buying and selling of items * Created by Descartes of Borg 970101 * Version: @(#) sell.c 1.1@(#) * Last modified: 97/01/01 */ mixed CanSell(object seller) { return 1; } --- 1,13 ---- /* /lib/events/sell.c ! * From the Dead Souls Objecdt Library * Handles the buying and selling of items * Created by Descartes of Borg 970101 * Version: @(#) sell.c 1.1@(#) * Last modified: 97/01/01 */ + //inherit LIB_COST; + mixed CanSell(object seller) { return 1; } diff -c -r --new-file ds1.1/lib/lib/events/shoot.c ds2.0r27/lib/lib/events/shoot.c *** ds1.1/lib/lib/events/shoot.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/events/shoot.c Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,59 ---- + int mustcarry,mustwield; + + int MustCarry(int i){ + if(i) mustcarry = i; + if(mustcarry) return mustcarry; + else return 0; + } + + int MustWield(int i){ + if(i) mustwield = i; + if(mustwield) return mustwield; + else return 0; + } + + + int eventShoot(mixed shooter, mixed target){ + string tmp; + if(target && objectp(target)){ + tmp=target->GetName(); + target = tmp; + } + if(target) write("You shoot at "+target+" with your weapon."); + + return 1; + } + + int CanShoot(object shooter, string target){ + object cible; + if(mustcarry > 0 && environment(this_object()) != this_player()) { + write("You are not holding the weapon."); + return 1; + } + if(mustwield > 0 && this_object()->GetWorn() == 0 && !creatorp(this_player())) { + write("You are not wielding the weapon."); + return 1; + } + + if(!present(target,environment(this_player())) && !present(target,environment(this_object()))){ + write("That target is not here."); + return 1; + } + if(stringp(target) && !cible=present(target,environment(this_object()))){ + cible=present(target,environment(this_player())); + } + + if(this_object()->eventFireWeapon(shooter,cible)) return 1; + + eventShoot(shooter,target); + return 1; + } + + int direct_shoot_obj_at_str(object shooter, string target){ + return 1; + } + + int indirect_shoot_wrd_with_wrd(mixed shooter,mixed target){ + return 1; + } + diff -c -r --new-file ds1.1/lib/lib/events/sit.c ds2.0r27/lib/lib/events/sit.c *** ds1.1/lib/lib/events/sit.c Sun Feb 1 21:30:11 1998 --- ds2.0r27/lib/lib/events/sit.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/sit.c ! * From the Dead Souls V Object Library * Handles people sitting down in it * Created by Descartes of Borg 961221 * Version: @(#) sit.c 1.1@(#) --- 1,5 ---- /* /lib/sit.c ! * From the Dead Souls Object Library * Handles people sitting down in it * Created by Descartes of Borg 961221 * Version: @(#) sit.c 1.1@(#) *************** *** 38,43 **** --- 38,46 ---- if( sizeof(Sitters) >= MaxSitters ) { return "There is no room to sit there."; } + if(environment() != environment(this_player())) { + return "That's not available for sitting right now."; + } return 1; } diff -c -r --new-file ds1.1/lib/lib/events/smell.c ds2.0r27/lib/lib/events/smell.c *** ds1.1/lib/lib/events/smell.c Sun Feb 1 21:30:12 1998 --- ds2.0r27/lib/lib/events/smell.c Wed Jul 5 00:01:05 2006 *************** *** 17,23 **** varargs string GetSmell(string str, object who) { mixed val; ! if( !str || str == "default" ) { val = Smell; } --- 17,23 ---- varargs string GetSmell(string str, object who) { mixed val; ! if( !str || str == "default" ) { val = Smell; } *************** *** 97,103 **** } else { error("Wrong number of arguments to SetSmell():\n\t" ! "Expected 1 or 2, got " + sizeof(args) + "\n"); } } --- 97,103 ---- } else { error("Wrong number of arguments to SetSmell():\n\t" ! "Expected 1 or 2, got " + sizeof(args) + "\n"); } } *************** *** 108,118 **** return 1; } environment(who)->eventPrint(who->GetName() + " smells " + GetShort() + ! ".", who); who->eventPrint(str); return 1; } ! mixed direct_smell_obj() { if( !Smell ) { return "You notice no unusual odor."; --- 108,118 ---- return 1; } environment(who)->eventPrint(who->GetName() + " smells " + GetShort() + ! ".", who); who->eventPrint(str); return 1; } ! mixed direct_smell_obj() { if( !Smell ) { return "You notice no unusual odor."; *************** *** 131,133 **** --- 131,146 ---- return 1; } } + + mapping GetSmellMap(){ + mapping Smells = ([]); + foreach(object ob in this_object()->GetDummyItems()) { + if( ob->GetSmell() ) { + Smells[ob->GetId()] = ob->GetSmell(); + } + } + if(this_object()->GetSmell()) Smells["default"] = this_object()->GetSmell(); + return copy(Smells); + + } + diff -c -r --new-file ds1.1/lib/lib/events/smoke.c ds2.0r27/lib/lib/events/smoke.c *** ds1.1/lib/lib/events/smoke.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/events/smoke.c Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,39 ---- + int eventTurnOn(object ob){ + return 1; + } + + int eventTurnOff(object ob){ + return 1; + } + + mixed CanTurn(object who) { + return 1; + } + + mixed CanTurnOn(object who) { + return 1; + } + mixed CanTurnOff(object who) { + return 1; + } + + + int eventTurn(object who) { + if(!who) who = this_player(); + // send_messages("turn", "$agent_name $agent_verb $target_name.", + // who, this_object(), environment(who)); + return 1; + } + + int direct_turn_obj(object target) { + return CanTurn(this_player()); + } + + int direct_turn_on_obj(object target){ + return CanTurnOn(this_player()); + } + + int direct_turn_off_obj(object target){ + return CanTurnOff(this_player()); + } + diff -c -r --new-file ds1.1/lib/lib/events/touch.c ds2.0r27/lib/lib/events/touch.c *** ds1.1/lib/lib/events/touch.c Sun Feb 1 21:30:12 1998 --- ds2.0r27/lib/lib/events/touch.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/touch.c ! * from the Dead Soulsr2 Object Library * for touching things * created by Descartes of Borg 951008 * Version: @(#) touch.c 1.8@(#) --- 1,5 ---- /* /lib/touch.c ! * from the Dead Souls Object Library * for touching things * created by Descartes of Borg 951008 * Version: @(#) touch.c 1.8@(#) *************** *** 17,23 **** varargs string GetTouch(string str, object who) { mixed val; ! if( !str || str == "default" ) { val = Touch; } --- 17,23 ---- varargs string GetTouch(string str, object who) { mixed val; ! if( !str || str == "default" ) { val = Touch; } *************** *** 90,96 **** } else { error("Wrong number of arguments to SetTouch():\n\t" ! "Expected 1 or 2, got " + sizeof(args) + "\n"); } } --- 90,96 ---- } else { error("Wrong number of arguments to SetTouch():\n\t" ! "Expected 1 or 2, got " + sizeof(args) + "\n"); } } *************** *** 101,107 **** return 1; } environment(who)->eventPrint(who->GetName() + " touches " + GetShort() + ! ".", who); who->eventPrint(str); return 1; } --- 101,107 ---- return 1; } environment(who)->eventPrint(who->GetName() + " touches " + GetShort() + ! ".", who); who->eventPrint(str); return 1; } diff -c -r --new-file ds1.1/lib/lib/events/turn.c ds2.0r27/lib/lib/events/turn.c *** ds1.1/lib/lib/events/turn.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/events/turn.c Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,39 ---- + int eventTurnOn(object ob){ + return 1; + } + + int eventTurnOff(object ob){ + return 1; + } + + mixed CanTurn(object who) { + return 1; + } + + mixed CanTurnOn(object who) { + return 1; + } + mixed CanTurnOff(object who) { + return 1; + } + + + int eventTurn(object who) { + if(!who) who = this_player(); + // send_messages("turn", "$agent_name $agent_verb $target_name.", + // who, this_object(), environment(who)); + return 1; + } + + int direct_turn_obj(object target) { + return CanTurn(this_player()); + } + + int direct_turn_on_obj(object target){ + return CanTurnOn(this_player()); + } + + int direct_turn_off_obj(object target){ + return CanTurnOff(this_player()); + } + diff -c -r --new-file ds1.1/lib/lib/events/wear.c ds2.0r27/lib/lib/events/wear.c *** ds1.1/lib/lib/events/wear.c Sun Feb 1 21:30:13 1998 --- ds2.0r27/lib/lib/events/wear.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/events/wear.c ! * From the Dead Souls V Object Library * An object that can be worn * Created by Descartes of Borg 970101 * Version: @(#) wear.c 1.1@(#) --- 1,5 ---- /* /lib/events/wear.c ! * From the Dead Souls Object Library * An object that can be worn * Created by Descartes of Borg 970101 * Version: @(#) wear.c 1.1@(#) *************** *** 13,37 **** // end abstract methods mixed direct_remove_obj() { ! mixed tmp; ! ! if( environment() != this_player() ) { return "#You don't have that!"; } return CanUnequip(this_player()); } ! mixed direct_wear_obj() { ! if( environment() != this_player() ) { return "#You don't have that!"; } return CanEquip(this_player(), GetRestrictLimbs()); } ! mixed direct_wear_obj_on_str(object target, string str) { ! if( environment() != this_player() ) { return "#You don't have that!"; } return CanEquip(this_player(), ({ remove_article(lower_case(str)) })); } ! --- 13,36 ---- // end abstract methods mixed direct_remove_obj() { ! ! if( environment(this_object()) != this_player() ) { return "#You don't have that!"; } return CanUnequip(this_player()); } ! mixed direct_wear_obj() { ! if( environment(this_object()) != this_player() ) { return "#You don't have that!"; } return CanEquip(this_player(), GetRestrictLimbs()); } ! mixed direct_wear_obj_on_str(object target, string str) { ! if( environment(this_object()) != this_player() ) { return "#You don't have that!"; } return CanEquip(this_player(), ({ remove_article(lower_case(str)) })); } ! diff -c -r --new-file ds1.1/lib/lib/events/wield.c ds2.0r27/lib/lib/events/wield.c *** ds1.1/lib/lib/events/wield.c Sun Feb 1 21:30:13 1998 --- ds2.0r27/lib/lib/events/wield.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/events/wield.c ! * From the Dead Souls V Object Library * Handles the wielding of things * Created by Descartes of Borg 970101 * Version: @(#) wield.c 1.1@(#) --- 1,5 ---- /* /lib/events/wield.c ! * From the Dead Souls Object Library * Handles the wielding of things * Created by Descartes of Borg 970101 * Version: @(#) wield.c 1.1@(#) *************** *** 18,28 **** } return CanUnequip(this_player()); } ! mixed direct_wield_obj() { int hands = GetHands(); string array limbs; ! if( environment() != this_player() ) { return "#You don't have that!"; } --- 18,28 ---- } return CanUnequip(this_player()); } ! mixed direct_wield_obj() { int hands = GetHands(); string array limbs; ! if( environment() != this_player() ) { return "#You don't have that!"; } *************** *** 36,42 **** } return CanEquip(this_player(), limbs); } ! mixed direct_wield_obj_word_str(object target, string wrd, string limb) { if( environment() != this_player() ) { return "#You don't have that!"; --- 36,42 ---- } return CanEquip(this_player(), limbs); } ! mixed direct_wield_obj_word_str(object target, string wrd, string limb) { if( environment() != this_player() ) { return "#You don't have that!"; diff -c -r --new-file ds1.1/lib/lib/exits.c ds2.0r27/lib/lib/exits.c *** ds1.1/lib/lib/exits.c Sun Feb 1 21:30:11 1998 --- ds2.0r27/lib/lib/exits.c Wed Jul 5 00:00:58 2006 *************** *** 31,56 **** } mixed eventGo(object who, string str) { ! if( who->GetPosition() != POSITION_STANDING ) { ! who->eventStand(); if( who->GetPosition() != POSITION_STANDING ) { return 0; } } ! if( Doors[str] && (int)Doors[str]->GetClosed() ) { message("my_action", "You bump into " + ! (string)Doors[str]->GetShort(str) + ".", who); return 1; } - if( Exits[str]["pre"] && !((int)evaluate(Exits[str]["pre"], str)) ) - return 1; who->eventMoveLiving(Exits[str]["room"], str); if( Exits[str]["post"] ) evaluate(Exits[str]["post"], str); return 1; } ! string GetDoor(string dir) { ! return Doors[dir]; } string array GetDoors() { --- 31,75 ---- } mixed eventGo(object who, string str) { ! if(query_verb() == "go" && interactive(this_player())){ if( who->GetPosition() != POSITION_STANDING ) { + if(stringp(hobbled(this_player()))) who->eventStand(); + if( who->GetPosition() != POSITION_STANDING ) { + return 0; + } + } + } + else if(query_verb() == "crawl") { + if( who->GetPosition() != POSITION_LYING && + who->GetPosition() != POSITION_SITTING ) { return 0; } } ! else if(query_verb() == "fly") { ! if( who->GetPosition() != POSITION_FLYING ) ! return 0; ! } ! ! if( sizeof(Doors) && Doors[str] && (int)Doors[str]->GetClosed() ) { message("my_action", "You bump into " + ! (string)Doors[str]->GetShort(str) + ".", who); ! return 1; ! } ! if( Exits[str] && Exits[str]["pre"] && ! !((int)evaluate(Exits[str]["pre"], str)) ) return 1; + if(!Exits[str]){ + write("You can't go that way."); + return 0; } who->eventMoveLiving(Exits[str]["room"], str); if( Exits[str]["post"] ) evaluate(Exits[str]["post"], str); return 1; } ! mixed GetDoor(string dir) { ! if(sizeof(Doors)) return Doors[dir]; ! else return 0; } string array GetDoors() { *************** *** 68,75 **** } string GetDirection(string dest) { - string *cles; - int i; foreach(string dir, mapping data in Exits) { if( data["room"] == dest ) { --- 87,92 ---- *************** *** 79,85 **** foreach(string dir in GetEnters()) { mapping data = GetEnterData(dir); ! if( data["room"] == dest ) { return "enter " + dir; } } --- 96,102 ---- foreach(string dir in GetEnters()) { mapping data = GetEnterData(dir); ! if(data["room"] && data["room"] == dest ) { return "enter " + dir; } } *************** *** 87,105 **** } object GetDummyItem(mixed id) { ! object array items = filter(all_inventory(), (: $1->isDummy() :)); ! if( stringp(id) ) { id = ({ id }); } ! foreach(object item in items) { ! if( sizeof(item->GetId() & id) ) { ! return item; } } return 0; } ! varargs void AddEnter(string dir, string dest, function pre, function post) { object ob = GetDummyItem(dir); --- 104,129 ---- } object GetDummyItem(mixed id) { ! int i; ! object array dummies,all_inv; ! ! all_inv=all_inventory(); ! dummies = ({}); ! ! for(i=0; i<sizeof(all_inv); i++) { ! if ( (mixed)all_inv[i]->isDummy() ) dummies += ({ all_inv[i] }); ! } if( stringp(id) ) { id = ({ id }); } ! foreach(object dummy in dummies) { ! if( sizeof(dummy->GetId() & id) ) { ! return dummy; } } return 0; } ! varargs void AddEnter(string dir, string dest, function pre, function post) { object ob = GetDummyItem(dir); *************** *** 128,145 **** } } ! string array GetEnters() { ! object array obs = filter(all_inventory(), (: $1->isDummy() :)); ! string array ids = ({}); foreach(object ob in obs) { if( ob->GetEnter() ) { ! ids += ob->GetId(); } } return ids; } void RemoveEnter(string dir) { object ob = GetDummyItem(dir); --- 152,198 ---- } } ! varargs string array GetEnters(int i) { ! object *obs; ! string *ids; ! ! obs = ({}); ! ids = ({}); ! ! foreach(object item in all_inventory(this_object())){ ! if(base_name(item) == LIB_DUMMY){ ! obs += ({ item }); ! } ! } foreach(object ob in obs) { if( ob->GetEnter() ) { ! if(i) ids += ({ ob->GetId()[0] }); ! else ids += ob->GetId(); } } return ids; } + mapping GetEnterMap(){ + mixed schlussel; + mapping EnterMap = ([]); + object *obs = ({}); + foreach(object item in all_inventory(this_object())){ + if(base_name(item) == LIB_DUMMY){ + obs += ({ item }); + } + } + if(!sizeof(obs)) return ([]); + foreach(object ob in obs) { + if( ob->GetEnter() ) { + schlussel = ob->GetId(); + EnterMap[schlussel] = ob->GetEnter(); + } + } + return copy(EnterMap); + } + void RemoveEnter(string dir) { object ob = GetDummyItem(dir); *************** *** 182,191 **** else return Exits[str]["room"]; } ! static mapping GetExitData(string str) { return Exits[str]; } string array GetExits() { return keys(Exits); } --- 235,257 ---- else return Exits[str]["room"]; } ! mapping GetExitData(string str) { return Exits[str]; } + mapping GetFullExitData() { + return Exits; + } + + mapping GetExitMap() { + mapping ret = ([]); + foreach(string key in keys(Exits)){ + ret[key] = Exits[key]["room"]; + } + + return ret; + } + string array GetExits() { return keys(Exits); } diff -c -r --new-file ds1.1/lib/lib/files.c ds2.0r27/lib/lib/files.c *** ds1.1/lib/lib/files.c Sun Feb 1 21:30:17 1998 --- ds2.0r27/lib/lib/files.c Wed Jul 5 00:00:58 2006 *************** *** 21,32 **** tmp -= ({ "." }); tmp -= ({ ".." }); if(!str || str[0] != '.') ! tmp = filter(tmp, "remove_dots", this_object()); for(i=0, maxi = sizeof(tmp); i < maxi; i++) { ! if(file_size(sprintf("%s/%s", pf[0], pf[1])) == -2) tmp[i] = pf[0]; ! else tmp[i] = sprintf("%s/%s", pf[0], tmp[i]); ! if(strlen(tmp[i]) > 1 && tmp[i][0..1] == "//") ! tmp[i] = tmp[i][1..strlen(tmp[i])-1]; } return tmp; } --- 21,32 ---- tmp -= ({ "." }); tmp -= ({ ".." }); if(!str || str[0] != '.') ! tmp = filter(tmp, "remove_dots", this_object()); for(i=0, maxi = sizeof(tmp); i < maxi; i++) { ! if(file_size(sprintf("%s/%s", pf[0], pf[1])) == -2) tmp[i] = pf[0]; ! else tmp[i] = sprintf("%s/%s", pf[0], tmp[i]); ! if(strlen(tmp[i]) > 1 && tmp[i][0..1] == "//") ! tmp[i] = tmp[i][1..strlen(tmp[i])-1]; } return tmp; } diff -c -r --new-file ds1.1/lib/lib/fish.c ds2.0r27/lib/lib/fish.c *** ds1.1/lib/lib/fish.c Sun Feb 1 21:30:17 1998 --- ds2.0r27/lib/lib/fish.c Wed Jul 5 00:00:58 2006 *************** *** 1,5 **** /* /lib/fish.c ! * from the Dead Soulsr2 Object Library * fish objects which get caught * created by Descartes of Borg 951009 */ --- 1,5 ---- /* /lib/fish.c ! * from the Dead Souls Object Library * fish objects which get caught * created by Descartes of Borg 951009 */ *************** *** 8,20 **** #include <lib.h> #include "include/fish.h" ! inherit LIB_OBJECT; static private int Mass, Fight; static private string Food; static void create() { ! object::create(); Mass = 0; Food = 0; Fight = 0; --- 8,20 ---- #include <lib.h> #include "include/fish.h" ! inherit LIB_MEAL; static private int Mass, Fight; static private string Food; static void create() { ! meal::create(); Mass = 0; Food = 0; Fight = 0; diff -c -r --new-file ds1.1/lib/lib/fishing.c ds2.0r27/lib/lib/fishing.c *** ds1.1/lib/lib/fishing.c Sun Feb 1 21:30:17 1998 --- ds2.0r27/lib/lib/fishing.c Wed Jul 5 00:00:58 2006 *************** *** 11,35 **** inherit LIB_ROOM; ! static private int MaxFishing, Speed, Chance; static private mapping Fishing, Fish; static void create() { room::create(); MaxFishing = 10; ! Speed = 5; Chance = 0; Fish = ([]); Fishing = ([]); } ! static void heart_beat() { mapping tmp; object pole; string fisher; if( !sizeof(Fishing) ) { - set_heart_beat(0); return; } tmp = Fishing; --- 11,41 ---- inherit LIB_ROOM; ! static private int MaxFishing, Speed, Chance, counter; static private mapping Fishing, Fish; static void create() { room::create(); MaxFishing = 10; ! Speed = 10; Chance = 0; + counter = 0; Fish = ([]); Fishing = ([]); } ! void heart_beat() { mapping tmp; object pole; string fisher; + room::CheckActions(); + + counter++; + if(counter < Speed) return; + counter = 0; + if( !sizeof(Fishing) ) { return; } tmp = Fishing; *************** *** 43,62 **** if( (int)pole->GetBroken() ) continue; if( (object)ob->GetInCombat() ) { message("my_action", "You are no longer fishing.", ob); continue; } Fishing[fisher] = pole; } if( !sizeof(Fishing) ) { - set_heart_beat(0); return; } foreach(fisher, pole in Fishing) { object who; string fish; int chance, x, y, i; ! int pro, con; ! who = present(fisher, this_object()); /* if this room is impossible to fish, or if using a non-fishing * device, no fishing can really occur --- 49,73 ---- if( (int)pole->GetBroken() ) continue; if( (object)ob->GetInCombat() ) { message("my_action", "You are no longer fishing.", ob); + RemoveFishing(ob); + continue; + } + if( (object)ob->GetSleeping() ) { + message("my_action", "You are no longer fishing.", ob); + RemoveFishing(ob); continue; } Fishing[fisher] = pole; } if( !sizeof(Fishing) ) { return; } foreach(fisher, pole in Fishing) { object who; string fish; int chance, x, y, i; ! int pro; ! who = present(fisher, this_object()); /* if this room is impossible to fish, or if using a non-fishing * device, no fishing can really occur *************** *** 65,93 **** else { pro = (Chance + x + who->GetStatLevel("luck"))/3; chance = (Chance + x + (int)who->GetStatLevel("luck")) / ! (1 + random(5)); } /* Give extra weight to fishing skill */ if( chance ) ! chance = random(chance/2 + (int)who->GetSkillLevel("fishing")/2); y = 0; ! foreach(fish, x in Fish) y += x; ! y = random(y); ! if( y < 1 || chance <= random(100) ) { who->eventTrainSkill("fishing", pro, 100-Chance/(y+1), 0); send_messages("cast", "$agent_name $agent_verb again, hoping " ! "for better luck.", who, 0, this_object()); continue; } ! i = 0; foreach(fish, x in Fish) { i += x; if( x >= y ) break; } who->eventTrainSkill("fishing", pro, (100-Chance)/(i+1), 1); send_messages("struggle", "$agent_name $agent_verb with " ! "something on $agent_possessive " + ! pole->GetKeyName() + ".", who, 0, this_object()); Fish[fish]--; call_out( (: eventCatch, who, fish, pole :), 1 ); } --- 76,104 ---- else { pro = (Chance + x + who->GetStatLevel("luck"))/3; chance = (Chance + x + (int)who->GetStatLevel("luck")) / ! (1 + random(5)); } /* Give extra weight to fishing skill */ if( chance ) ! chance = random(chance/2 + (int)who->GetSkillLevel("fishing")/2); y = 0; ! foreach(fish, x in Fish) y += x; ! y = random(y); ! if( y < 1 || chance <= random(100) ) { who->eventTrainSkill("fishing", pro, 100-Chance/(y+1), 0); send_messages("cast", "$agent_name $agent_verb again, hoping " ! "for better luck.", who, 0, this_object()); continue; } ! i = 0; foreach(fish, x in Fish) { i += x; if( x >= y ) break; } who->eventTrainSkill("fishing", pro, (100-Chance)/(i+1), 1); send_messages("struggle", "$agent_name $agent_verb with " ! "something on $agent_possessive " + ! pole->GetKeyName() + ".", who, 0, this_object()); Fish[fish]--; call_out( (: eventCatch, who, fish, pole :), 1 ); } *************** *** 95,105 **** mixed CanCast(object who, string where) { if( (int)this_player()->GetInCombat() ) ! return "You are too busy to fish!"; if( Fishing[(string)this_player()->GetKeyName()] ) ! return "You are already fishing!"; if( GetMaxFishing() <= sizeof(Fishing) ) ! return "It is too crowded here to fish."; return 1; } --- 106,116 ---- mixed CanCast(object who, string where) { if( (int)this_player()->GetInCombat() ) ! return "You are too busy to fish!"; if( Fishing[(string)this_player()->GetKeyName()] ) ! return "You are already fishing!"; if( GetMaxFishing() <= sizeof(Fishing) ) ! return "It is too crowded here to fish."; return 1; } *************** *** 110,158 **** return 1; } mixed eventCast(object who, object pole, string str) { - mixed err; send_messages(({ "cast", "start" }), ! "$agent_name $agent_verb $agent_possessive " + ! pole->GetKeyName() + " and $agent_verb fishing.", who, 0, ! this_object()); SetFishing(who, pole); return 1; } ! static void eventCatch(object who, string fish, object pole) { object food; if( !who || !present(who) ) return; if( !pole || !present(pole, who) ) { message("my_action", "Having given up " + (string)pole->GetShort() + ! ", you lose your catch!", who); return; } if( !((int)pole->eventCatch(who, fish)) ) return; ! food = new((string)fish->GetFood()); RemoveFishing(who); who->AddSkillPoints("fishing", (int)fish->GetFight()+(int)fish->GetMass()); message("my_action", "You find " + (string)fish->GetShort() + " on " + ! (string)pole->GetShort() + "!", who); message("other_action", (string)who->GetName() + " finds " + ! (string)fish->GetShort() + " on " + (string)pole->GetShort() + ! "!", this_object(), ({ who })); if( !((int)food->eventMove(who)) ) { message("my_action", "You drop " + (string)food->GetShort() + "!", ! who); message("other_action", (string)who->GetName() + " drops " + ! (string)food->GetShort() + "!", this_object(), ({ who }) ); food->eventMove(this_object()); } } mixed eventStop(object who, string str) { RemoveFishing(this_player()); message("my_action", "You stop fishing.", who); message("other_action", (string)who->GetName() + " stops " ! "fishing.", this_object(), ({ who }) ); return 1; } --- 121,178 ---- return 1; } + int CanRelease(object who){ + if(room::CanRelease()) RemoveFishing(who); + return 1; + } + mixed eventCast(object who, object pole, string str) { send_messages(({ "cast", "start" }), ! "$agent_name $agent_verb $agent_possessive " + ! pole->GetKeyName() + " and $agent_verb fishing.", who, 0, ! this_object()); SetFishing(who, pole); return 1; } ! static void eventCatch(object who, string fish, object pole) { object food; if( !who || !present(who) ) return; if( !pole || !present(pole, who) ) { message("my_action", "Having given up " + (string)pole->GetShort() + ! ", you lose your catch!", who); return; } if( !((int)pole->eventCatch(who, fish)) ) return; ! //food = new((string)fish->GetFood()); ! food=new(fish); ! //tc("new fish: "+identify(food),"yellow"); RemoveFishing(who); who->AddSkillPoints("fishing", (int)fish->GetFight()+(int)fish->GetMass()); message("my_action", "You find " + (string)fish->GetShort() + " on " + ! (string)pole->GetShort() + "!", who); message("other_action", (string)who->GetName() + " finds " + ! (string)fish->GetShort() + " on " + (string)pole->GetShort() + ! "!", this_object(), ({ who })); if( !((int)food->eventMove(who)) ) { + //tc("fish failed to move onto fisherman "+identify(who)); message("my_action", "You drop " + (string)food->GetShort() + "!", ! who); message("other_action", (string)who->GetName() + " drops " + ! (string)food->GetShort() + "!", this_object(), ({ who }) ); food->eventMove(this_object()); } + //tc("We weem to think all is well. The environment of "+identify(food)+" is "+ + //identify(environment(food))); } mixed eventStop(object who, string str) { RemoveFishing(this_player()); message("my_action", "You stop fishing.", who); message("other_action", (string)who->GetName() + " stops " ! "fishing.", this_object(), ({ who }) ); return 1; } *************** *** 177,183 **** mapping SetFishing(object who, object pole) { if( !living(who) ) return Fishing; ! if( !query_heart_beat() ) set_heart_beat(Speed); Fishing[(string)who->GetKeyName()] = pole; return Fishing; } --- 197,203 ---- mapping SetFishing(object who, object pole) { if( !living(who) ) return Fishing; ! if( !query_heart_beat() ) set_heart_beat(1); Fishing[(string)who->GetKeyName()] = pole; return Fishing; } *************** *** 187,194 **** if( !who ) return Fishing; if( Fishing[str = (string)who->GetKeyName()] ) ! map_delete(Fishing, str); ! if( !sizeof(Fishing) ) set_heart_beat(0); return Fishing; } --- 207,214 ---- if( !who ) return Fishing; if( Fishing[str = (string)who->GetKeyName()] ) ! map_delete(Fishing, str); ! if( !sizeof(Fishing) ) return; return Fishing; } diff -c -r --new-file ds1.1/lib/lib/flashlight.c ds2.0r27/lib/lib/flashlight.c *** ds1.1/lib/lib/flashlight.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/flashlight.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,211 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_STORAGE; + inherit "/lib/events/turn"; + + void SetLightLevel(int i); + int eventRadiate(int i); + + object player,env,fl; + string me,name, celltype, baseshort; + int noflicker,Lit,lightlevel,drainrate,powered,level; + int mincells, maxcells; + + void create(){ + ::create(); + SetKeyName("generic flashlight"); + SetId( ({"fl","flashlight","light","torch","flashlite"}) ); + SetAdjectives( ({"generic","simple","cheap"}) ); + SetShort( "a flashlight" ); + SetLong("This is a cheap, simple light source."); + SetMass(20); + SetBaseCost(10); + SetLightLevel(6); + Lit=0; + mincells = 2; + maxcells = 2; + celltype = "D"; + SetVendorType(VT_TREASURE); + baseshort=GetShort(); + } + + void init(){ + ::init(); + fl=this_object(); + me=this_object()->GetKeyName(); + } + + int SetHB(int i){ + set_heart_beat(i); + return query_heart_beat(); + } + int GetHB(){ + return query_heart_beat(); + } + + int SetMaxCells(int i){ maxcells = i; return i; } + int GetMaxCells() { return maxcells; } + int SetMinCells(int i){ mincells = i; return i; } + int GetMinCells() { return mincells; } + int SetCellType(string str) {celltype=str; return 1; } + string GetCellType() { return celltype; } + + int SetDrainRate(int i){ + drainrate = i; + return i; + } + + int eventUse(int i){ + Lit = i; + foreach(object ob in all_inventory(this_object())){ + ob->eventUse(i); + } + return i; + } + + int eventDie(){ + if(!Lit || Lit == 0) return 1; + Lit=0; + eventRadiate(0); + foreach(object ob in all_inventory(this_object())){ + ob->eventUse(0); + } + SetShort(baseshort); + tell_object(environment(this_object()),"The "+me+" flickers and dies."); + if(living(environment())){ + tell_room(environment(environment()),environment()->GetName()+"'s "+me+ + " flickers and dies.",({ environment() }) ); + } + set_heart_beat(0); + return 1; + } + + int flicker(){ + if(noflicker ==1) return; + if(!living(environment())){ + tell_object(environment(),capitalize(baseshort)+" flickers and shines less brightly than before."); + return 1; + } + tell_room(environment(environment()),environment()->GetName()+"'s "+me+ + " flickers and shines less brightly than before.",({ environment() }) ); + tell_object(environment(),"The "+me+" flickers and shines less brightly."); + return 1; + } + + int CheckPower(){ + object *batts; + powered = 1; + if( sizeof(all_inventory(this_object())) < mincells ) powered = 0; + batts = all_inventory(this_object()); + foreach(object batt in batts){ + batt->Spent(); + level = batt->GetCharge(); + if(level == 10 || level == 30 || level == 50 ) flicker(); + noflicker = 1; + //write("The "+me+" flickers."); + if( level < 1) powered = 0; + } + noflicker = 0; + return powered; + } + + int CanReceive(object ob) { + if(ob->GetCellType() != celltype) { + return 0; + } + if(sizeof(all_inventory(this_object())) >= maxcells ){ + + return 0; + } + return 1; + } + + int eventRadiate(int i){ + SetRadiantLight(i); + } + + void SetLightLevel(int i){ + if(i) lightlevel = i; + } + + int GetLightLevel(){ + if(lightlevel) return lightlevel; + return 0; + } + + void regetID(){ + player=this_player(); + name=this_player()->GetName(); + env=environment(this_object()); + } + + varargs mixed eventTurn(string str){ + regetID(); + if( player != env ) { write("You don't have that."); return 0; } + write("You turn the "+me+" over in your hands."); + say(name+" turns over a "+me+" in "+possessive(player)+" hands."); + return 1; + } + + int eventTurnOn(object ob){ + regetID(); + CheckPower(); + + if(powered != 1){ + write("It isn't powered."); + return 1; + } + + if(player != env && environment(player) !=env) { + write("It isn't within reach."); + return 1; + } + if(Lit < 1){ + write("You turn on the "+me+"."); + say(name+" turns on a "+me+"."); + if(drainrate && drainrate > 0) eventUse(drainrate); + else eventUse(1); + eventRadiate(lightlevel); + set_heart_beat(1); + SetShort(baseshort+" (%^BOLD%^YELLOW%^lit%^RESET%^)"); + return 1; + } + if(Lit >= 1){ + write("It is already lit."); + return 1; + } + } + + varargs mixed eventTurnOff(string str){ + regetID(); + if(player != env && environment(player) !=env) { write("It isn't within reach."); return 1; } + if(Lit > 0){ + write("You turn off the "+me+"."); + say(name+" turns off a "+me+"."); + eventRadiate(0); + eventUse(0); + set_heart_beat(0); + SetShort(baseshort); + return 1; + } + if(Lit < 1){ + write("It is already off."); + return 1; + } + } + + mixed eventExtinguish(){ + return eventTurnOff("foo"); + } + + mixed eventLight(){ + return eventTurnOn(this_object()); + } + + void heart_beat(){ + CheckPower(); + + if(powered != 1){ + eventDie(); + } + } diff -c -r --new-file ds1.1/lib/lib/follow.c ds2.0r27/lib/lib/follow.c *** ds1.1/lib/lib/follow.c Sun Feb 1 21:30:17 1998 --- ds2.0r27/lib/lib/follow.c Wed Jul 5 00:00:58 2006 *************** *** 1,4 **** ! /* From the Dead Soulsr2 Object Library * Provides follow/trail support for mobile objects. * Works closely with LIB_LEAD. * Created by Rush 951028 --- 1,4 ---- ! /* From the Dead Souls Object Library * Provides follow/trail support for mobile objects. * Works closely with LIB_LEAD. * Created by Rush 951028 *************** *** 13,19 **** mixed direct_follow_liv() { if( this_object() == this_player() ) ! return "It doesn't quite work that way."; return this_player()->CanFollow(this_object()); } --- 13,19 ---- mixed direct_follow_liv() { if( this_object() == this_player() ) ! return "It doesn't quite work that way."; return this_player()->CanFollow(this_object()); } *************** *** 28,41 **** varargs mixed CanFollow(object ob) { if( ob ) { ! if( !ob->CanLead() ) ! return "You are not empowered to follow " + ob->GetName(); ! if( IsFollowing(ob) ) ! return "You are already following " + ob->GetName(); ! if( ob->IsFollowing(this_object()) ) ! return ob->GetName() + " is already following you."; ! if( ob == this_object() ) ! return "You cannot possibly do that."; } return 1; } --- 28,41 ---- varargs mixed CanFollow(object ob) { if( ob ) { ! if( !ob->CanLead() ) ! return "You are not empowered to follow " + ob->GetName(); ! if( IsFollowing(ob) ) ! return "You are already following " + ob->GetName(); ! if( ob->IsFollowing(this_object()) ) ! return ob->GetName() + " is already following you."; ! if( ob == this_object() ) ! return "You cannot possibly do that."; } return 1; } diff -c -r --new-file ds1.1/lib/lib/fuel.c ds2.0r27/lib/lib/fuel.c *** ds1.1/lib/lib/fuel.c Sun Feb 1 21:30:17 1998 --- ds2.0r27/lib/lib/fuel.c Wed Jul 5 00:00:58 2006 *************** *** 1,5 **** /* /lib/fuel.c ! * from the Dead Souls V object Library * fuel for things which need fuel * this could be battery charge, gas, whatever * created by Descartes of Borg 960512 --- 1,5 ---- /* /lib/fuel.c ! * from the Dead Souls object Library * fuel for things which need fuel * this could be battery charge, gas, whatever * created by Descartes of Borg 960512 diff -c -r --new-file ds1.1/lib/lib/genetics.c ds2.0r27/lib/lib/genetics.c *** ds1.1/lib/lib/genetics.c Sun Feb 1 21:30:18 1998 --- ds2.0r27/lib/lib/genetics.c Wed Jul 5 00:00:58 2006 *************** *** 45,51 **** static void RemoveBlindness() { mixed val = Blind->end; ! Blind = 0; if( arrayp(val) ) { send_messages(val[0], val[1], this_object()); --- 45,51 ---- static void RemoveBlindness() { mixed val = Blind->end; ! Blind = 0; if( arrayp(val) ) { send_messages(val[0], val[1], this_object()); *************** *** 68,77 **** mixed eventCustomizeStat(string stat, int amount) { if( amount < 1 ) return "That is not a valid amount."; if( amount > CustomStats ) ! return "You do not have enough points to spend on customization."; if( !Stats[stat] ) return "You have no such stat."; if( Stats[stat]["level"] + amount > 100 ) ! return "You cannot make a stat exceed 100."; Stats[stat]["level"] += amount; Stats[stat]["points"] = 0; CustomStats -= amount; --- 68,77 ---- mixed eventCustomizeStat(string stat, int amount) { if( amount < 1 ) return "That is not a valid amount."; if( amount > CustomStats ) ! return "You do not have enough points to spend on customization."; if( !Stats[stat] ) return "You have no such stat."; if( Stats[stat]["level"] + amount > 100 ) ! return "You cannot make a stat exceed 100."; Stats[stat]["level"] += amount; Stats[stat]["points"] = 0; CustomStats -= amount; *************** *** 99,111 **** varargs void AddStat(string stat, int base, int cls) { int level; ! if( userp(this_object()) ) level = 1; else level = GetLevel(); if( !stat || cls < 1 || cls > 5 ) return; base += ((5 - cls) * random(10)) + (3 * (level + 1))/(cls * 4); if( userp(this_object()) && base > 90 ) base = 90; else if( base > 100 ) base = 100; SetStat(stat, base, cls); } --- 99,112 ---- varargs void AddStat(string stat, int base, int cls) { int level; ! //tc("stat: "+stat+", base: "+base+", cls: "+cls,"red"); if( userp(this_object()) ) level = 1; else level = GetLevel(); if( !stat || cls < 1 || cls > 5 ) return; base += ((5 - cls) * random(10)) + (3 * (level + 1))/(cls * 4); if( userp(this_object()) && base > 90 ) base = 90; else if( base > 100 ) base = 100; + //tc("stat: "+stat+", base: "+base+", cls: "+cls,"green"); SetStat(stat, base, cls); } *************** *** 129,135 **** x = (GetBaseStatLevel(stat) + GetStatBonus(stat)); switch(stat) { ! case "coordination": case "wisdom": x -= GetAlcohol(); } return x; --- 130,136 ---- x = (GetBaseStatLevel(stat) + GetStatBonus(stat)); switch(stat) { ! case "coordination": case "wisdom": x -= GetAlcohol(); } return x; *************** *** 150,156 **** } } while(Stats[stat]["points"] > (y = GetMaxStatPoints(stat, ! Stats[stat]["level"]))) { if(Stats[stat]["level"] >= GetLevel()*4) Stats[stat]["points"] = y; else { Stats[stat]["level"]++; --- 151,157 ---- } } while(Stats[stat]["points"] > (y = GetMaxStatPoints(stat, ! Stats[stat]["level"]))) { if(Stats[stat]["level"] >= GetLevel()*4) Stats[stat]["points"] = y; else { Stats[stat]["level"]++; *************** *** 161,166 **** --- 162,168 ---- } string *GetStats() { return keys(Stats); } + mapping GetStatsMap() { return copy(Stats); } int GetMaxStatPoints(string stat, int level) { if( !Stats[stat] ) return 0; *************** *** 193,200 **** if( !StatsBonus[stat] ) return 0; i = sizeof(obs = keys(StatsBonus[stat])); while(i--) { ! if( !obs[i] ) map_delete(StatsBonus[stat], obs[i]); ! else x += (int)evaluate(StatsBonus[stat][obs[i]], stat); } return x; } --- 195,202 ---- if( !StatsBonus[stat] ) return 0; i = sizeof(obs = keys(StatsBonus[stat])); while(i--) { ! if( !obs[i] ) map_delete(StatsBonus[stat], obs[i]); ! else x += (int)evaluate(StatsBonus[stat][obs[i]], stat); } return x; } *************** *** 231,266 **** int GetCustomStats() { return CustomStats; } ! int GetEffectiveVision() { int array l; object env; int bonus = GetVisionBonus(); ! int y, x = 0; ! if( Blind ) { ! return VISION_BLIND; ! } ! if( !(env = environment()) ) { ! x = GetRadiantLight(0); } - else { - int a = (int)env->GetAmbientLight(); ! foreach(object ob in all_inventory(env)) { ! if( ob == this_object() ) continue; ! x += (int)ob->GetRadiantLight(a); } - x = x/2 + GetRadiantLight(a) + a; } l = GetLightSensitivity(); l[0] -= bonus; l[1] += bonus; if( x >= l[0] && x <= l[1] ) return VISION_CLEAR; y = l[0]/3; if( x < y ) return VISION_TOO_DARK; if( x < (2*y) ) return VISION_DARK; if( x < l[0] ) return VISION_DIM; y = l[1]/3; if( x < (l[1] + y) ) return VISION_LIGHT; if( x < (l[1] + (2*y)) ) return VISION_BRIGHT; return VISION_TOO_BRIGHT; --- 233,300 ---- int GetCustomStats() { return CustomStats; } ! varargs mixed GetEffectiveVision(mixed raw_score, mixed location) { int array l; object env; int bonus = GetVisionBonus(); ! int a, y, x = 0; ! //if(raw_score) tc("raw_score: "+identify(raw_score),"yellow"); ! //if(location) tc("location: "+identify(location),"yellow"); ! ! if(raw_score && !intp(raw_score)){ ! //tc("raw_score: "+identify(raw_score)); ! location = raw_score; ! raw_score = 0; ! //tc("location: "+identify(location)); ! //tc("raw_score: "+raw_score); } ! ! //tc("stack2: "+get_stack(),"green"); ! //if(!location) tc("NOLOC","blue"); ! if(location){ ! if(objectp(location)) env = location; ! //if(env) tc("env: "+identify(env)); ! if(stringp(location)){ ! if(!file_exists(location)) location += ".c"; ! if(!file_exists(location)) return 0; ! env = load_object(location); ! //if(env) tc("env: "+identify(env)); ! if(!env) return 0; } } + //if(env) tc("env: "+identify(env)); + if( Blind && !raw_score) { + return VISION_BLIND; + } + if( !location ) env = environment(); + //if(env) tc("env: "+identify(env)); + x = GetRadiantLight(0); + a = env->GetAmbientLight(); + //tc("x: "+x,"red"); + //tc("a: "+a); + if(x) x = x/2; + x += GetRadiantLight(a) + a; + //tc("x: "+x,"green"); + //if(env) tc("env: "+identify(env)); l = GetLightSensitivity(); + //tc("l: "+identify(l)); l[0] -= bonus; l[1] += bonus; + + if(raw_score && !location){ + return "Low: "+l[0]+", High: "+l[1]; + } if( x >= l[0] && x <= l[1] ) return VISION_CLEAR; y = l[0]/3; + //tc("y: "+y,"cyan"); + //tc("x: "+x,"blue"); if( x < y ) return VISION_TOO_DARK; if( x < (2*y) ) return VISION_DARK; if( x < l[0] ) return VISION_DIM; y = l[1]/3; + //tc("y: "+y,"yellow"); if( x < (l[1] + y) ) return VISION_LIGHT; if( x < (l[1] + (2*y)) ) return VISION_BRIGHT; return VISION_TOO_BRIGHT; *************** *** 275,281 **** if( !val ) error("Null argument to SetLightSensitivity().\n"); if( sizeof(val) == 1 ) val = val[0]; if( sizeof(val) != 2 ) ! error(sprintf("Invalid arguments to SetLightSensitivity(): %O\n", val)); return (LightSensitivity = val); } --- 309,315 ---- if( !val ) error("Null argument to SetLightSensitivity().\n"); if( sizeof(val) == 1 ) val = val[0]; if( sizeof(val) != 2 ) ! error(sprintf("Invalid arguments to SetLightSensitivity(): %O\n", val)); return (LightSensitivity = val); } diff -c -r --new-file ds1.1/lib/lib/guild.c ds2.0r27/lib/lib/guild.c *** ds1.1/lib/lib/guild.c Sun Feb 1 21:30:18 1998 --- ds2.0r27/lib/lib/guild.c Wed Dec 31 19:00:00 1969 *************** *** 1,161 **** - - #include <lib.h> - #include "include/guild.h" - - private static class GuildClass Guild; - private int isWelcomed; - - static void create() { - Guild = new(class GuildClass); - Guild->leader = 0; - Guild->name = 0; - Guild->objectName = 0; - Guild->skill = 0; - isWelcomed = 0; - } - - static void init() { - if(!present(this_object(), this_player())) return; - if((string)this_player()->GetGuild() != (string)GetGuildName()) return; - if((string)this_player()->GetKeyName() == (string)GetLeader()) { - add_action((:eventBring:), "bring"); - add_action((:eventInitiate:), "initiate"); - add_action((:eventRetire:), "retire"); - } - this_player()->eventPrint("\n"); - if(!isWelcomed) { - this_player()->AddChannel(GetGuildName()); - eventWelcome(this_player()); - isWelcomed = 1; - } - } - - mixed CanJoin(object ob) { return 1; } - - string GetAffectLong(object ob) { - if(!ob || !living(ob)) return 0; - return ob->GetName() + " is a member of the " - + pluralize(GetGuildName()) + "."; - } - - string SetLeader(string str) { - if(!user_exists(str)) error("No such user: " + str - + ". You must have a real leader."); - if(!stringp(Guild->leader)) Guild->leader = str; - return Guild->leader; - } - - string GetLeader() { return Guild->leader; } - - string SetGuildName(string str) { - if(!stringp(Guild->name)) Guild->name = str; - return Guild->name; - } - - string GetGuildName() { return Guild->name; } - - string SetGuildObject(string str) { - if(!stringp(Guild->objectName)) Guild->objectName = str; - return Guild->objectName; - } - - string GetGuildObject() { return Guild->objectName; } - - string SetGuildSkill(string str) { - if(!stringp(Guild->skill)) Guild->skill = str; - return Guild->skill; - } - - string GetGuildSkill() { return Guild->skill; } - - int eventBring(string str) { - object who; - - if(!str) return notify_fail("Bring whom?\n"); - who = find_player(lower_case(str)); - if(!who) - return notify_fail(who->GetName() + " is nowhere to be found.\n"); - if((string)who->GetGuild() != (string)GetGuildName()) - return notify_fail(who->GetName() + " is not one of you!\n"); - if( environment(who)->GetProperty("no teleport") - || environment(this_player())->GetProperty("no teleport") - || environment(this_player())->GetProperty("no magic")) - return notify_fail("A magic force blocks your powers.\n"); - if(present(who, environment(this_player()))) - return notify_fail(capitalize(str) + " is here.\n"); - if((int)this_player()->GetMagicPoints() < 70) - return notify_fail("Too low on magic power.\n"); - this_player()->AddMagicPoints(-70); - who->eventPrint("%^CYAN%^Your guild leader summons you.%^RESET%^"); - who->eventMoveLiving(environment(this_player())); - if(!present(who, environment(this_player()))) - this_player()->eventPrint("%^CYAN%^" + capitalize(str) - + " is beyond your reach.%^RESET%^"); - return 1; - } - - int eventInitiate(string str) { - object initiate; - object guildObject; - mixed ret; - - if(!str) return notify_fail("Initiate whom?\n"); - initiate = present(lower_case(str), environment(this_player())); - if(!initiate || !living(initiate)) - return notify_fail("No one of that nature here.\n"); - if(stringp(ret = CanJoin(initiate))) return notify_fail(ret); - else if(!ret) return ret; - if((int)this_player()->GetMagicPoints() < 300) - return notify_fail("Too low on magic power.\n"); - if(initiate->GetGuild()) - return notify_fail("You may only initiate people without guild " - + "affiliation.\n"); - initiate->SetGuild((string)GetGuildName()); - initiate->SetSkill(GetGuildSkill(), 1, 1); - if(guildObject = new((string)GetGuildObject())) - guildObject->eventMove(initiate); - this_player()->AddMagicPoints(-300); - eventJoin(initiate); - return 1; - } - - void eventJoin(object ob) { - ob->eventPrint("%^YELLOW%^You are now a member of the " - + pluralize((string)GetGuildName()) + ".%^RESET%^"); - environment(ob)->eventPrint("%^YELLOW%^" +(string)ob->GetName() - + " is now a member of the " - + pluralize((string)GetGuildName()) + ".%^RESET%^", ob); - } - - int eventRetire(string str) { - object retiree; - object guildObject; - - if(!str) return notify_fail("Retire whom?\n"); - retiree = present(lower_case(str), environment(this_player())); - if(!retiree || !living(retiree)) - return notify_fail("No one of that nature here.\n"); - if((string)retiree->GetGuild() != (string)GetGuildName()) - return notify_fail(retiree->GetName() + " is not one of us!\n"); - guildObject = present(GetGuildName() + "_guild_object", retiree); - if(!guildObject) error("Problem with guild object."); - guildObject->eventDestruct(); - retiree->SetGuild(0); - // retiree->SetSkill(GetGuildSkill(), 1, 1); We need to remove skill here. - eventUnjoin(retiree); - return 1; - } - - void eventUnjoin(object ob) { - ob->eventPrint("%^RED%^You are no longer a member of the " - + pluralize((string)GetGuildName()) + ".%^RESET%^"); - environment(ob)->eventPrint("%^RED%^" + (string)ob->GetName() - + " is no longer a member of the " - + pluralize((string)GetGuildName()) + ".%^RESET%^", ob); - } - - void eventWelcome(object ob) { - ob->eventPrint("%^YELLOW%^Welcome, fellow " + (string)GetGuildName() - + ".%^RESET%^"); - } - --- 0 ---- diff -c -r --new-file ds1.1/lib/lib/help.c ds2.0r27/lib/lib/help.c *** ds1.1/lib/lib/help.c Sun Feb 1 21:30:18 1998 --- ds2.0r27/lib/lib/help.c Wed Jul 5 00:00:58 2006 *************** *** 1,5 **** /* /lib/help.c ! * From the Dead Souls V Object Library * Provides an interface to the help system for objects that want it * Created by Descartes of Borg 960116 * Version: @(#) help.c 1.2@(#) --- 1,5 ---- /* /lib/help.c ! * From the Dead Souls Object Library * Provides an interface to the help system for objects that want it * Created by Descartes of Borg 960116 * Version: @(#) help.c 1.2@(#) diff -c -r --new-file ds1.1/lib/lib/history.c ds2.0r27/lib/lib/history.c *** ds1.1/lib/lib/history.c Sun Feb 1 21:30:18 1998 --- ds2.0r27/lib/lib/history.c Wed Jul 5 00:00:58 2006 *************** *** 37,43 **** } else { int x; ! if( str[1] == '-' ) { sscanf(str, "!-%d%s", x, args); if( !x ) cmd = ""; --- 37,43 ---- } else { int x; ! if( str[1] == '-' ) { sscanf(str, "!-%d%s", x, args); if( !x ) cmd = ""; *************** *** 61,67 **** len = strlen(args); if( args[0] != '^' && args[0] != 's' ) { if( len > 1 && args[0] == '\\' && (args[1] == '^' || args[1] == 's') ) ! args = args[1..]; return Push(cmd + args); } if( len < 3 ) { --- 61,67 ---- len = strlen(args); if( args[0] != '^' && args[0] != 's' ) { if( len > 1 && args[0] == '\\' && (args[1] == '^' || args[1] == 's') ) ! args = args[1..]; return Push(cmd + args); } if( len < 3 ) { *************** *** 155,161 **** } else if( stringp(val) ) { int i, x; ! x = (CommandNumber-2) % sizeof(History); for(i = x; i>=0; i--) { if( !History[i] ) continue; --- 155,161 ---- } else if( stringp(val) ) { int i, x; ! x = (CommandNumber-2) % sizeof(History); for(i = x; i>=0; i--) { if( !History[i] ) continue; *************** *** 177,183 **** int SetHistorySize(int x) { if( !((int)master()->valid_apply(({ GetKeyName() }))) ) ! return HistorySize; if( x == HistorySize ) return HistorySize; if( x > MAX_HISTORY_SIZE ) return HistorySize; else if( x < MIN_HISTORY_SIZE ) return HistorySize; --- 177,183 ---- int SetHistorySize(int x) { if( !((int)master()->valid_apply(({ GetKeyName() }))) ) ! return HistorySize; if( x == HistorySize ) return HistorySize; if( x > MAX_HISTORY_SIZE ) return HistorySize; else if( x < MIN_HISTORY_SIZE ) return HistorySize; diff -c -r --new-file ds1.1/lib/lib/include/armor.h ds2.0r27/lib/lib/include/armor.h *** ds1.1/lib/lib/include/armor.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/include/armor.h Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,34 ---- + #ifndef l_armor_h + #define l_armor_h + + static void create(); + mixed direct_remove_obj(); + mixed direct_wear_obj(); + mixed direct_wear_obj_on_str(mixed fix...); + + mixed CanWear(object who, string *limbs); + mixed CanWield(object who, string *limbs); + + void eventDeteriorate(int type); + void eventEquipAgain(string *limbs); + int eventReceiveDamage(object agent, int type, int strength, int internal, mixed limbs); + mixed eventUnequip(object who); + mixed eventWear(object who, string *limbs); + + string GetWornDescription(); + string GetItemCondition(); + int SetArmorType(int x); + int SetProtection(int type, int amount); + int GetProtection(int type); + int GetMaxProtection(int type); + string *SetRestrictLimbs(string *limbs); + string *GetRestrictLimbs(); + int SetFingers(int x); + int GetFingers(); + mixed SetWear(mixed val); + mixed GetWear(); + string GetShort(); + + #endif /* l_armor_h */ + + diff -c -r --new-file ds1.1/lib/lib/include/armour.h ds2.0r27/lib/lib/include/armour.h *** ds1.1/lib/lib/include/armour.h Sun Feb 1 21:30:20 1998 --- ds2.0r27/lib/lib/include/armour.h Wed Dec 31 19:00:00 1969 *************** *** 1,34 **** - #ifndef l_armour_h - #define l_armour_h - - static void create(); - mixed direct_remove_obj(); - mixed direct_wear_obj(); - mixed direct_wear_obj_on_str(mixed fix...); - - mixed CanWear(object who, string *limbs); - mixed CanWield(object who, string *limbs); - - void eventDeteriorate(int type); - void eventEquipAgain(string *limbs); - int eventReceiveDamage(object agent, int type, int strength, int internal, mixed limbs); - mixed eventUnequip(object who); - mixed eventWear(object who, string *limbs); - - string GetWornDescription(); - string GetItemCondition(); - int SetArmourType(int x); - int SetProtection(int type, int amount); - int GetProtection(int type); - int GetMaxProtection(int type); - string *SetRestrictLimbs(string *limbs); - string *GetRestrictLimbs(); - int SetFingers(int x); - int GetFingers(); - mixed SetWear(mixed val); - mixed GetWear(); - string GetShort(); - - #endif /* l_armour_h */ - - --- 0 ---- diff -c -r --new-file ds1.1/lib/lib/include/bait.h ds2.0r27/lib/lib/include/bait.h *** ds1.1/lib/lib/include/bait.h Sun Feb 1 21:30:25 1998 --- ds2.0r27/lib/lib/include/bait.h Wed Jul 5 00:01:05 2006 *************** *** 1,19 **** #ifndef l_bait_h #define l_bait_h ! static void create(); ! mixed indirect_bait_obj_with_obj(); ! int SetBaitStrength(int x); int GetBaitStrength(); ! mixed eventBait(object who, object pole); ! /* virtual functions */ ! static mixed AddSave(mixed *vars); string GetShort(); int eventDestruct(); ! #endif --- 1,19 ---- #ifndef l_bait_h #define l_bait_h ! static void create(); ! mixed indirect_bait_obj_with_obj(); ! int SetBaitStrength(int x); int GetBaitStrength(); ! mixed eventBait(object who, object pole); ! /* virtual functions */ ! static mixed AddSave(mixed *vars); string GetShort(); int eventDestruct(); ! #endif diff -c -r --new-file ds1.1/lib/lib/include/bank.h ds2.0r27/lib/lib/include/bank.h *** ds1.1/lib/lib/include/bank.h Sun Feb 1 21:30:24 1998 --- ds2.0r27/lib/lib/include/bank.h Wed Jul 5 00:01:05 2006 *************** *** 1,10 **** #ifndef l_bank_h #define l_bank_h ! static void create(); ! mixed CanBank(object who, string currency); ! string SetBank(string str); string SetCurrency(string str); int SetSurcharge(int amount); --- 1,10 ---- #ifndef l_bank_h #define l_bank_h ! static void create(); ! mixed CanBank(object who, string currency); ! string SetBank(string str); string SetCurrency(string str); int SetSurcharge(int amount); *************** *** 19,31 **** int GetMinimumTransaction(); float GetExchangePercentage(); mixed GetCurrencies(); ! int AddSurcharge(object who, string currency, int amount); ! mixed eventDeposit(object who, string currency, int amount); mixed eventWithdraw(object who, string currency, int amount); mixed eventBalance(object who); mixed eventExchange(object who, int amount, string str1, string str2); mixed eventOpenAccount(object who); ! #endif /* l_bank_h */ --- 19,31 ---- int GetMinimumTransaction(); float GetExchangePercentage(); mixed GetCurrencies(); ! int AddSurcharge(object who, string currency, int amount); ! mixed eventDeposit(object who, string currency, int amount); mixed eventWithdraw(object who, string currency, int amount); mixed eventBalance(object who); mixed eventExchange(object who, int amount, string str1, string str2); mixed eventOpenAccount(object who); ! #endif /* l_bank_h */ diff -c -r --new-file ds1.1/lib/lib/include/body.h ds2.0r27/lib/lib/include/body.h *** ds1.1/lib/lib/include/body.h Sun Feb 1 21:30:20 1998 --- ds2.0r27/lib/lib/include/body.h Wed Jul 5 00:01:05 2006 *************** *** 1,6 **** #ifndef l_body_h #define l_body_h ! static void create(); static void heart_beat(); void restart_heart(); --- 1,6 ---- #ifndef l_body_h #define l_body_h ! static void create(); static void heart_beat(); void restart_heart(); *************** *** 13,27 **** varargs int eventHealDamage(int x, int internal, mixed limbs); varargs int eventReceiveDamage(object agent, int type, int x, int internal, mixed limbs); int eventCheckProtection(object agent, int type, int damage); ! mixed eventReceiveThrow(object who, object what); ! varargs int eventDie(object agent); int eventRemoveItem(object ob); int eventWear(object ob, mixed limbs); ! void NewBody(string race); ! mixed CanWear(object armour, string *limbs); ! varargs int AddLimb(string limb, string parent, int classes, int *armours); int RestoreLimb(string str); int RemoveLimb(string limb, object agent); mapping GetLimb(string limb); --- 13,27 ---- varargs int eventHealDamage(int x, int internal, mixed limbs); varargs int eventReceiveDamage(object agent, int type, int x, int internal, mixed limbs); int eventCheckProtection(object agent, int type, int damage); ! mixed eventReceiveThrow(object who, object what); ! varargs int eventDie(mixed agent); int eventRemoveItem(object ob); int eventWear(object ob, mixed limbs); ! void NewBody(string race); ! mixed CanWear(object armor, string *limbs); ! varargs int AddLimb(string limb, string parent, int classes, int *armors); int RestoreLimb(string str); int RemoveLimb(string limb, object agent); mapping GetLimb(string limb); *************** *** 32,38 **** string GetLimbParent(string limb); string *GetLimbChildren(string limb); mapping GetMissingLimb(string limb); ! string *GetMissingLimbs(); string GetLong(string nom); string *GetWieldingLimbs(); varargs int AddFingers(string limb, int x); --- 32,38 ---- string GetLimbParent(string limb); string *GetLimbChildren(string limb); mapping GetMissingLimb(string limb); ! varargs string *GetMissingLimbs(int not_default); string GetLong(string nom); string *GetWieldingLimbs(); varargs int AddFingers(string limb, int x); *************** *** 76,83 **** int GetHealRate(); /* pure virtual */ string GetShort(); /* pure virtual */ varargs mixed eventPrint(mixed msg, mixed cl, mixed three); ! /* pure virtual */ varargs void SetParalyzed(int x, function f); /* pure virtual */ varargs mixed eventMoveLiving(mixed dest, string omsg, ! string imsg); #endif /* l_body_h */ --- 76,83 ---- int GetHealRate(); /* pure virtual */ string GetShort(); /* pure virtual */ varargs mixed eventPrint(mixed msg, mixed cl, mixed three); ! /* pure virtual */ varargs int SetParalyzed(int x, function f); /* pure virtual */ varargs mixed eventMoveLiving(mixed dest, string omsg, ! string imsg); #endif /* l_body_h */ diff -c -r --new-file ds1.1/lib/lib/include/clan.h ds2.0r27/lib/lib/include/clan.h *** ds1.1/lib/lib/include/clan.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/include/clan.h Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,38 ---- + + + #ifndef l_clan_h + #define l_clan_h + + + class ClanClass { + string leader; + string name; + string objectName; + string skill; + } + + static void create(); + static void init(); + + mixed CanJoin(object ob); + string GetAffectLong(object ob); + string SetLeader(string str); + string GetLeader(); + string SetClanName(string str); + string GetClanName(); + string SetClanObject(string str); + string GetClanObject(); + string SetClanSkill(string str); + string GetClanSkill(); + + int eventBring(string str); + int eventInitiate(string str); + void eventJoin(object ob); + int eventRetire(string str); + void eventUnjoin(object ob); + void eventWelcome(object ob); + + + #endif /* l_clan_h */ + + diff -c -r --new-file ds1.1/lib/lib/include/classes.h ds2.0r27/lib/lib/include/classes.h *** ds1.1/lib/lib/include/classes.h Sun Feb 1 21:30:20 1998 --- ds2.0r27/lib/lib/include/classes.h Wed Jul 5 00:01:05 2006 *************** *** 10,17 **** string GetSkillModifier(string skill); string SetClass(string classes); string GetClass(); ! string SetGuild(string guild); ! string GetGuild(); int GetBaseStatLevel(string stat); int SetMorality(int x); int GetMorality(); --- 10,17 ---- string GetSkillModifier(string skill); string SetClass(string classes); string GetClass(); ! string SetClan(string clan); ! string GetClan(); int GetBaseStatLevel(string stat); int SetMorality(int x); int GetMorality(); diff -c -r --new-file ds1.1/lib/lib/include/clip.h ds2.0r27/lib/lib/include/clip.h *** ds1.1/lib/lib/include/clip.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/include/clip.h Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,18 ---- + #ifndef l_clip_h + #define l_clip_h + + static void create(); + + int PlusAmmo(int i); + int MinusAmmo(int i); + int SetMaxAmmo(int x); + int SetCaliber(int x); + int SetMillimeter(int x); + int SetPistolType(string str); + int SetAmmoType(string str); + string GetType(); + int GetCaliber(); + int GetMillimeter(); + string GetAmmoType(); + + #endif /* l_clip_h */ diff -c -r --new-file ds1.1/lib/lib/include/combatmsg.h ds2.0r27/lib/lib/include/combatmsg.h *** ds1.1/lib/lib/include/combatmsg.h Sun Feb 1 21:30:24 1998 --- ds2.0r27/lib/lib/include/combatmsg.h Wed Jul 5 00:01:05 2006 *************** *** 1,6 **** #ifndef l_combatmsg_h #define l_combatmsg_h ! mixed GetMissData(object target, int type, string limb); static void eventSendMissMessages(object target, int x, string limb); mixed GetCombatVerbs(string type, int damage); --- 1,6 ---- #ifndef l_combatmsg_h #define l_combatmsg_h ! mixed GetMissData(object target, int type, string limb); static void eventSendMissMessages(object target, int x, string limb); mixed GetCombatVerbs(string type, int damage); *************** *** 11,15 **** /* virtual only */ string GetName(); varargs int eventPrint(string msg, mixed arg2, mixed arg3); ! #endif /* l_combatmsg_h */ --- 11,15 ---- /* virtual only */ string GetName(); varargs int eventPrint(string msg, mixed arg2, mixed arg3); ! #endif /* l_combatmsg_h */ diff -c -r --new-file ds1.1/lib/lib/include/container.h ds2.0r27/lib/lib/include/container.h *** ds1.1/lib/lib/include/container.h Sun Feb 1 21:30:20 1998 --- ds2.0r27/lib/lib/include/container.h Wed Jul 5 00:01:05 2006 *************** *** 14,20 **** string GetInternalShort(); static string SetInternalShort(string str); int GetOpacity(); ! static int SetOpacity(int x); int GetRadiantLight(int ambient); #endif /* l_container_h */ --- 14,20 ---- string GetInternalShort(); static string SetInternalShort(string str); int GetOpacity(); ! int SetOpacity(int x); int GetRadiantLight(int ambient); #endif /* l_container_h */ diff -c -r --new-file ds1.1/lib/lib/include/detect.h ds2.0r27/lib/lib/include/detect.h *** ds1.1/lib/lib/include/detect.h Sun Feb 1 21:30:26 1998 --- ds2.0r27/lib/lib/include/detect.h Wed Jul 5 00:01:05 2006 *************** *** 1,12 **** #ifndef __detect_h__ #define __detect_h__ ! int direct_detect_wrd_in_obj(string word); mixed eventDetect(object who, string str, int ability); ! /* virtuals */ ! mixed GetProperty(string str); string GetShort(); ! #endif --- 1,12 ---- #ifndef __detect_h__ #define __detect_h__ ! int direct_detect_wrd_in_obj(string word); mixed eventDetect(object who, string str, int ability); ! /* virtuals */ ! mixed GetProperty(string str); string GetShort(); ! #endif diff -c -r --new-file ds1.1/lib/lib/include/exits.h ds2.0r27/lib/lib/include/exits.h *** ds1.1/lib/lib/include/exits.h Sun Feb 1 21:30:21 1998 --- ds2.0r27/lib/lib/include/exits.h Wed Jul 5 00:01:05 2006 *************** *** 9,15 **** mixed eventFly(object who, string dir); mixed eventGo(object who, string str); ! string GetDoor(string dir); string array GetDoors(); string SetDoor(string dir, string file); string GetDirection(string dest); --- 9,15 ---- mixed eventFly(object who, string dir); mixed eventGo(object who, string str); ! mixed GetDoor(string dir); string array GetDoors(); string SetDoor(string dir, string file); string GetDirection(string dest); diff -c -r --new-file ds1.1/lib/lib/include/genetics.h ds2.0r27/lib/lib/include/genetics.h *** ds1.1/lib/lib/include/genetics.h Sun Feb 1 21:30:21 1998 --- ds2.0r27/lib/lib/include/genetics.h Wed Jul 5 00:01:05 2006 *************** *** 20,26 **** varargs string SetResistance(int type, string level); string GetResistance(int type); int GetCustomStats(); ! int GetEffectiveVision(); int array GetLightSensitivity(); varargs int array SetLightSensitivity(mixed array val...); int AddVisionBonus(int x); --- 20,26 ---- varargs string SetResistance(int type, string level); string GetResistance(int type); int GetCustomStats(); ! varargs mixed GetEffectiveVision(int raw_score, mixed location); int array GetLightSensitivity(); varargs int array SetLightSensitivity(mixed array val...); int AddVisionBonus(int x); diff -c -r --new-file ds1.1/lib/lib/include/guild.h ds2.0r27/lib/lib/include/guild.h *** ds1.1/lib/lib/include/guild.h Sun Feb 1 21:30:21 1998 --- ds2.0r27/lib/lib/include/guild.h Wed Dec 31 19:00:00 1969 *************** *** 1,38 **** - - - #ifndef l_guild_h - #define l_guild_h - - - class GuildClass { - string leader; - string name; - string objectName; - string skill; - } - - static void create(); - static void init(); - - mixed CanJoin(object ob); - string GetAffectLong(object ob); - string SetLeader(string str); - string GetLeader(); - string SetGuildName(string str); - string GetGuildName(); - string SetGuildObject(string str); - string GetGuildObject(); - string SetGuildSkill(string str); - string GetGuildSkill(); - - int eventBring(string str); - int eventInitiate(string str); - void eventJoin(object ob); - int eventRetire(string str); - void eventUnjoin(object ob); - void eventWelcome(object ob); - - - #endif /* l_guild_h */ - - --- 0 ---- diff -c -r --new-file ds1.1/lib/lib/include/holder.h ds2.0r27/lib/lib/include/holder.h *** ds1.1/lib/lib/include/holder.h Sun Feb 1 21:30:24 1998 --- ds2.0r27/lib/lib/include/holder.h Wed Jul 5 00:01:05 2006 *************** *** 12,18 **** mixed direct_look_in_obj(object target, string id); mixed direct_look_inside_obj(object target, string id); mixed indirect_look_at_obj_word_obj(object target, string wrd, object ob, ! string id, string my_id); mixed indirect_put_obj_word_obj(object what, string word, object storage); mixed indirect_put_obs_word_obj(object *items, string word, object storage); --- 12,18 ---- mixed direct_look_in_obj(object target, string id); mixed direct_look_inside_obj(object target, string id); mixed indirect_look_at_obj_word_obj(object target, string wrd, object ob, ! string id, string my_id); mixed indirect_put_obj_word_obj(object what, string word, object storage); mixed indirect_put_obs_word_obj(object *items, string word, object storage); diff -c -r --new-file ds1.1/lib/lib/include/interactive.h ds2.0r27/lib/lib/include/interactive.h *** ds1.1/lib/lib/include/interactive.h Sun Feb 1 21:30:21 1998 --- ds2.0r27/lib/lib/include/interactive.h Wed Jul 5 00:01:05 2006 *************** *** 58,63 **** void eventLoad(mixed *value, int recurse); ! /* pure virtual */ int GetEffectiveVision(); #endif /* l_interactive_h */ --- 58,63 ---- void eventLoad(mixed *value, int recurse); ! /* pure virtual */ varargs mixed GetEffectiveVision(int raw_score, mixed location); #endif /* l_interactive_h */ diff -c -r --new-file ds1.1/lib/lib/include/items.h ds2.0r27/lib/lib/include/items.h *** ds1.1/lib/lib/include/items.h Sun Feb 1 21:30:21 1998 --- ds2.0r27/lib/lib/include/items.h Wed Jul 5 00:01:05 2006 *************** *** 7,13 **** varargs mixed eventShow(object who, string component); mapping SetItems(mapping items); ! mixed AddItem(mixed item, mixed val); mapping RemoveItem(mixed item); varargs mixed GetLong(string item); --- 7,13 ---- varargs mixed eventShow(object who, string component); mapping SetItems(mapping items); ! varargs mixed AddItem(mixed item, mixed val); mapping RemoveItem(mixed item); varargs mixed GetLong(string item); diff -c -r --new-file ds1.1/lib/lib/include/lead.h ds2.0r27/lib/lib/include/lead.h *** ds1.1/lib/lib/include/lead.h Sun Feb 1 21:30:22 1998 --- ds2.0r27/lib/lib/include/lead.h Wed Jul 5 00:01:05 2006 *************** *** 2,8 **** #define l_lead_h class FollowerClass { ! int allowed; int bonus; int lost; } --- 2,8 ---- #define l_lead_h class FollowerClass { ! int followed; int bonus; int lost; } *************** *** 12,19 **** object *RemoveFollower(object follower); object *GetFollowers(); ! int SetAllowed(object follower, int allowed); ! int GetAllowed(object follower); int AddFollowBonus(object follower, int bonus); int GetFollowBonus(object follower); --- 12,19 ---- object *RemoveFollower(object follower); object *GetFollowers(); ! int SetFollowed(object follower, int followed); ! int GetFollowed(object follower); int AddFollowBonus(object follower, int bonus); int GetFollowBonus(object follower); diff -c -r --new-file ds1.1/lib/lib/include/lock.h ds2.0r27/lib/lib/include/lock.h *** ds1.1/lib/lib/include/lock.h Sun Feb 1 21:30:25 1998 --- ds2.0r27/lib/lib/include/lock.h Wed Jul 5 00:01:05 2006 *************** *** 4,12 **** static void create(); mixed direct_lock_obj_with_obj(object target, object tool, string id); mixed direct_pick_str_on_obj(string str, object target, string str2, ! string id); mixed direct_pick_str_on_obj_with_obj(string str, object target, object tool, ! string str2, string targ_id); mixed direct_unlock_obj_with_obj(object target, object key, string id); mixed CanLock(object who, string id); --- 4,12 ---- static void create(); mixed direct_lock_obj_with_obj(object target, object tool, string id); mixed direct_pick_str_on_obj(string str, object target, string str2, ! string id); mixed direct_pick_str_on_obj_with_obj(string str, object target, object tool, ! string str2, string targ_id); mixed direct_unlock_obj_with_obj(object target, object key, string id); mixed CanLock(object who, string id); diff -c -r --new-file ds1.1/lib/lib/include/npc.h ds2.0r27/lib/lib/include/npc.h *** ds1.1/lib/lib/include/npc.h Sun Feb 1 21:30:22 1998 --- ds2.0r27/lib/lib/include/npc.h Wed Jul 5 00:01:05 2006 *************** *** 17,23 **** int cmdTouch(string str); static int cmdAll(string arg); ! varargs int eventDie(object agent); int eventMove(mixed dest); int eventCompleteMove(mixed dest); int eventFollow(object dest, int followChance); --- 17,23 ---- int cmdTouch(string str); static int cmdAll(string arg); ! varargs int eventDie(mixed agent); int eventMove(mixed dest); int eventCompleteMove(mixed dest); int eventFollow(object dest, int followChance); diff -c -r --new-file ds1.1/lib/lib/include/pistol.h ds2.0r27/lib/lib/include/pistol.h *** ds1.1/lib/lib/include/pistol.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/include/pistol.h Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,32 ---- + #ifndef l_pistol_h + #define l_pistol_h + + static void create(); + + int eventShoot(object who); + + int InitRevolver(mixed array); + int SetAmmoType(string str); + int SetPistolType(string str); + int SetMaxAmmo(int x); + int SetCaliber(float f); + int SetMillimeter(int x); + string GetAmmoType(); + string GetPistolType(); + int GetMaxAmmo(); + int GetCaliber(); + int GetMillimeter(); + int CalculateAmmoSize(); + int do_shoot(string str); + int missed_shot(); + int AddRound(int x); + int SubtractRound(int x); + int ShowRounds(); + int LoadRevolver(string str); + int LoadAuto(string str); + int doRevolverUnload(string foo, string bar); + int doAutoUnload(string str); + int UnloadAll(); + int SetAmmoFile(string str); + + #endif /* l_pistol_h */ diff -c -r --new-file ds1.1/lib/lib/include/player.h ds2.0r27/lib/lib/include/player.h *** ds1.1/lib/lib/include/player.h Sun Feb 1 21:30:23 1998 --- ds2.0r27/lib/lib/include/player.h Wed Jul 5 00:01:05 2006 *************** *** 21,27 **** int cmdTouch(string str); int eventDisplayStatus(); ! varargs int eventDie(object agent); mixed eventAsk(object who, string what); void eventRevive(); varargs int eventShow(object who, string str); --- 21,27 ---- int cmdTouch(string str); int eventDisplayStatus(); ! varargs int eventDie(mixed agent); mixed eventAsk(object who, string what); void eventRevive(); varargs int eventShow(object who, string str); *************** *** 57,63 **** string GetCapName(); int ResetLevel(); string SetClass(string str); ! string SetGuild(string guild); varargs static int AddHealthPoints(int x, string limb, object agent); int GetLanguageLevel(string lang); int is_living(); --- 57,63 ---- string GetCapName(); int ResetLevel(); string SetClass(string str); ! string SetClan(string clan); varargs static int AddHealthPoints(int x, string limb, object agent); int GetLanguageLevel(string lang); int is_living(); diff -c -r --new-file ds1.1/lib/lib/include/pole.h ds2.0r27/lib/lib/include/pole.h *** ds1.1/lib/lib/include/pole.h Sun Feb 1 21:30:23 1998 --- ds2.0r27/lib/lib/include/pole.h Wed Jul 5 00:01:05 2006 *************** *** 1,17 **** #ifndef l_pole_h #define l_pole_h ! static void create(); mixed direct_bait_obj_with_obj(); mixed direct_fish_with_obj(); mixed CanCast(object who); ! int eventBait(object who, object bait); int eventBreak(); mixed eventCatch(object who, string fish); int eventFish(object who); ! int SetBait(int x); int AddBait(int x); int GetBait(); --- 1,17 ---- #ifndef l_pole_h #define l_pole_h ! static void create(); mixed direct_bait_obj_with_obj(); mixed direct_fish_with_obj(); mixed CanCast(object who); ! int eventBait(object who, object bait); int eventBreak(); mixed eventCatch(object who, string fish); int eventFish(object who); ! int SetBait(int x); int AddBait(int x); int GetBait(); *************** *** 20,32 **** int GetChance(); int SetStrength(int x); int GetStrength(); ! /* virtual functions */ ! mixed AddSave(mixed *vars); string GetShort(); int SetBroken(int x); int GetBroken(); ! ! #endif /* l_pole_h */ --- 20,32 ---- int GetChance(); int SetStrength(int x); int GetStrength(); ! /* virtual functions */ ! mixed AddSave(mixed *vars); string GetShort(); int SetBroken(int x); int GetBroken(); ! ! #endif /* l_pole_h */ diff -c -r --new-file ds1.1/lib/lib/include/round.h ds2.0r27/lib/lib/include/round.h *** ds1.1/lib/lib/include/round.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/include/round.h Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,17 ---- + #ifndef l_round_h + #define l_round_h + + static void create(); + + int SetCaliber(int x); + int SetMillimeter(int x); + int SetPistolType(string str); + int SetAmmoType(string str); + int SetRifleType(string str); + string GetType(); + int GetCaliber(); + int GetMillimeter(); + string GetAmmoType(); + string GetRifleType(); + + #endif /* l_round_h */ diff -c -r --new-file ds1.1/lib/lib/include/shell.h ds2.0r27/lib/lib/include/shell.h *** ds1.1/lib/lib/include/shell.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/include/shell.h Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,15 ---- + #ifndef l_shell_h + #define l_shell_h + + static void create(); + + int SetCaliber(int x); + int SetMillimeter(int x); + int SetPistolType(string str); + int SetAmmoType(string str); + string GetType(); + int GetCaliber(); + int GetMillimeter(); + string GetAmmoType(); + + #endif /* l_shell_h */ diff -c -r --new-file ds1.1/lib/lib/include/stargate.h ds2.0r27/lib/lib/include/stargate.h *** ds1.1/lib/lib/include/stargate.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/include/stargate.h Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,18 ---- + /** + * + * $Id: stargate.h,v 1.1 2006/04/05 05:48:39 jam Exp $ + * + */ + + #include "/include/stargate.h" + + #ifndef lib_stargate_h + #define lib_stargate_h + + void setOrigin(string o, string d); + string getOrigin(); + void connect(string destination); + int disconnect(); + string status(); + + #endif diff -c -r --new-file ds1.1/lib/lib/include/storage.h ds2.0r27/lib/lib/include/storage.h *** ds1.1/lib/lib/include/storage.h Sun Feb 1 21:30:24 1998 --- ds2.0r27/lib/lib/include/storage.h Wed Jul 5 00:01:05 2006 *************** *** 8,14 **** mixed indirect_get_obj_out_of_obj(object item); mixed direct_look_inside_obj(object target, string id); mixed indirect_look_at_obj_word_obj(object target, string wrd, object ob, ! string id, string my_id); int direct_unlock(); int inventory_accessible(); int inventory_visible(); --- 8,14 ---- mixed indirect_get_obj_out_of_obj(object item); mixed direct_look_inside_obj(object target, string id); mixed indirect_look_at_obj_word_obj(object target, string wrd, object ob, ! string id, string my_id); int direct_unlock(); int inventory_accessible(); int inventory_visible(); diff -c -r --new-file ds1.1/lib/lib/include/teacher.h ds2.0r27/lib/lib/include/teacher.h *** ds1.1/lib/lib/include/teacher.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/include/teacher.h Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,22 ---- + #ifndef __trainer_h__ + #define __trainer_h__ + + static void create(); + static void init(); + + mixed AddTeachingLanguages(string *args...); + mixed RemoveTeachingLanguages(string *args...); + string *GetTeachingLanguages(); + mapping GetStudents(); + + int eventHelp(object who, string unused); + int eventTeach(object who, string verb, string language); + + static int ContinueTeaching(object who, string language, int x); + + int eventStart(object who, string language); + int eventContinue(object who, string language, int x); + int eventComplete(object who, string language); + + #define TEACHING_WAIT 10 + #endif __trainer_h__ diff -c -r --new-file ds1.1/lib/lib/include/teller.h ds2.0r27/lib/lib/include/teller.h *** ds1.1/lib/lib/include/teller.h Sun Feb 1 21:30:25 1998 --- ds2.0r27/lib/lib/include/teller.h Wed Jul 5 00:01:05 2006 *************** *** 1,6 **** #ifndef l_teller_h #define l_teller_h ! static void create(); string SetBankName(string str); string SetLocalCurrency(string str); --- 1,6 ---- #ifndef l_teller_h #define l_teller_h ! static void create(); string SetBankName(string str); string SetLocalCurrency(string str); *************** *** 23,28 **** int eventExchange(object who, int amount, string str1, string str2); int eventOpenAccount(object who); int cmdParse(object who, string cmd, string str); ! #endif --- 23,28 ---- int eventExchange(object who, int amount, string str1, string str2); int eventOpenAccount(object who); int cmdParse(object who, string cmd, string str); ! #endif diff -c -r --new-file ds1.1/lib/lib/include/trainer.h ds2.0r27/lib/lib/include/trainer.h *** ds1.1/lib/lib/include/trainer.h Sun Feb 1 21:30:26 1998 --- ds2.0r27/lib/lib/include/trainer.h Wed Jul 5 00:01:05 2006 *************** *** 1,22 **** #ifndef __trainer_h__ #define __trainer_h__ ! static void create(); static void init(); ! mixed AddTrainingSkills(string *args...); mixed RemoveTrainingSkills(string *args...); string *GetTrainingSkills(); mapping GetStudents(); ! int eventHelp(object who, string unused); int eventTrain(object who, string verb, string skill); ! static int ContinueTraining(object who, string skill, int x); ! int eventStart(object who, string skill); int eventContinue(object who, string skill, int x); int eventComplete(object who, string skill); ! #define TRAINING_WAIT 10 #endif __trainer_h__ --- 1,22 ---- #ifndef __trainer_h__ #define __trainer_h__ ! static void create(); static void init(); ! mixed AddTrainingSkills(string *args...); mixed RemoveTrainingSkills(string *args...); string *GetTrainingSkills(); mapping GetStudents(); ! int eventHelp(object who, string unused); int eventTrain(object who, string verb, string skill); ! static int ContinueTraining(object who, string skill, int x); ! int eventStart(object who, string skill); int eventContinue(object who, string skill, int x); int eventComplete(object who, string skill); ! #define TRAINING_WAIT 10 #endif __trainer_h__ diff -c -r --new-file ds1.1/lib/lib/include/weapon.h ds2.0r27/lib/lib/include/weapon.h *** ds1.1/lib/lib/include/weapon.h Sun Feb 1 21:30:26 1998 --- ds2.0r27/lib/lib/include/weapon.h Wed Jul 5 00:01:05 2006 *************** *** 17,24 **** mixed eventWield(object who, string *limbs); mixed eventUnequip(object who); ! int SetArmourType(int x); ! int GetArmourType(); int SetClass(int x); mixed GetProperty(string foo); int GetClass(); --- 17,24 ---- mixed eventWield(object who, string *limbs); mixed eventUnequip(object who); ! int SetArmorType(int x); ! int GetArmorType(); int SetClass(int x); mixed GetProperty(string foo); int GetClass(); diff -c -r --new-file ds1.1/lib/lib/interactive.c ds2.0r27/lib/lib/interactive.c *** ds1.1/lib/lib/interactive.c Sun Feb 1 21:30:10 1998 --- ds2.0r27/lib/lib/interactive.c Wed Jul 5 00:00:58 2006 *************** *** 1,5 **** /* /lib/interactive.c ! * from the Dead Soulsr1 Object Library * an interactive object * created by Descartes of Borg 941001 for the Idea Exchange * Version: @(#) interactive.c 1.17@(#) --- 1,5 ---- /* /lib/interactive.c ! * from the Dead Souls Object Library * an interactive object * created by Descartes of Borg 941001 for the Idea Exchange * Version: @(#) interactive.c 1.17@(#) *************** *** 29,35 **** inherit LIB_MESSAGES; inherit LIB_INTERFACE; ! private int Age, WhereBlock, Brief, LoginTime, BirthTime; private string Password, Email, RealName, Rank, LoginSite, HostSite, WebPage; private mapping News; private class marriage *Marriages; --- 29,35 ---- inherit LIB_MESSAGES; inherit LIB_INTERFACE; ! private int Age, WhereBlock, Brief, LoginTime, BirthTime, RescueBit; private string Password, Email, RealName, Rank, LoginSite, HostSite, WebPage; private mapping News; private class marriage *Marriages; *************** *** 54,75 **** BirthTime = time(); LastAge = time(); News = ([]); SetShort("$N the unaccomplished"); SetLong("$N is nondescript."); } /* *************** /lib/interactive.c modal functions *************** */ mixed CanDivorce(object who) { class marriage m; ! if( !Marriages || !sizeof(Marriages) ) ! return GetName() + " is not married!"; m = Marriages[0]; if( m->DivorceDate ) return GetName() + " is not married!"; return 1; } ! mixed CanGet(object ob) { return GetName() + " is a living being!"; } --- 54,81 ---- BirthTime = time(); LastAge = time(); News = ([]); + RescueBit = 0; SetShort("$N the unaccomplished"); SetLong("$N is nondescript."); } + int SetRescueBit(int i){ + RescueBit = i; + return i; + } + /* *************** /lib/interactive.c modal functions *************** */ mixed CanDivorce(object who) { class marriage m; ! if( !Marriages || !sizeof(Marriages) ) ! return GetName() + " is not married!"; m = Marriages[0]; if( m->DivorceDate ) return GetName() + " is not married!"; return 1; } ! mixed CanGet(object ob) { return GetName() + " is a living being!"; } *************** *** 98,137 **** log_file("enter", GetCapName()+" (enter): "+ctime(time())+ " : "+query_ip_name(this_object())+"\n"); if( VOTING_D->GetStatus() == VOTE_RUNNING ) { ! if( VOTING_D->GetMode() == VOTE_MODE_CANDIDATES ) ! eventPrint("%^YELLOW%^Class Elections are in progress! " ! "Go nominate candidates!%^RESET%^"); ! if( VOTING_D->GetMode() == VOTE_MODE_VOTING ) ! eventPrint("%^YELLOW%^Class Elections are in progress! " ! "Go vote for the candidates!%^RESET%^"); } if( VOTING_D->GetVoteStatus( this_object() ) != VOTE_ALREADY_VOTED ) { ! eventPrint("%^YELLOW%^You have not yet voted! " ! "Please vote now.%^RESET%^"); ! eventMove( VOTING_D->GetVoteRoom() ); } else { object room; ! catch(room = load_object(LoginSite)); if( room && room->GetMedium() == MEDIUM_AIR ) { } ! if( !eventMove(LoginSite) ) { ! eventMove(LoginSite = ROOM_START); } } environment()->eventPrint(tmp, MSG_ENV, this_object()); if( !(tmp = GetMessage("login")) ) ! tmp = GetName() + " enters " + mud_name() + "."; filter(users(), (: archp :))->eventPrint("[" + GetCapName() + " logs in]", ! MSG_SYSTEM); if(!catch(mp = (mapping)FOLDERS_D->mail_status(GetKeyName()))) { ! if(mp["unread"]) { ! eventPrint("\n>>> " + mp["unread"] + " of your " + ! (mp["total"] == 1 ? mp["total"] + " letter is" : ! mp["total"] + " letters remain") + " unread. <<<\n", ! MSG_SYSTEM); ! } } NEWS_D->GeneralNews(); return 1; --- 104,146 ---- log_file("enter", GetCapName()+" (enter): "+ctime(time())+ " : "+query_ip_name(this_object())+"\n"); if( VOTING_D->GetStatus() == VOTE_RUNNING ) { ! if( VOTING_D->GetMode() == VOTE_MODE_CANDIDATES ) ! eventPrint("%^YELLOW%^Class Elections are in progress! " ! "Go nominate candidates!%^RESET%^"); ! if( VOTING_D->GetMode() == VOTE_MODE_VOTING ) ! eventPrint("%^YELLOW%^Class Elections are in progress! " ! "Go vote for the candidates!%^RESET%^"); } if( VOTING_D->GetVoteStatus( this_object() ) != VOTE_ALREADY_VOTED ) { ! eventPrint("%^YELLOW%^You have not yet voted! " ! "Please vote now.%^RESET%^"); ! eventMove( VOTING_D->GetVoteRoom() ); } else { object room; ! catch(room = load_object(LoginSite)); if( room && room->GetMedium() == MEDIUM_AIR ) { } ! if(!sizeof(LoginSite) || (!file_exists(LoginSite) && !file_exists(LoginSite+".c")) || !load_object(LoginSite) || !eventMove(LoginSite) || RescueBit) { ! LoginSite = ROOM_START; ! eventMove(ROOM_START); ! SetRescueBit(0); ! //eventMove(LoginSite = ROOM_START); } } environment()->eventPrint(tmp, MSG_ENV, this_object()); if( !(tmp = GetMessage("login")) ) ! tmp = GetName() + " enters " + mud_name() + "."; filter(users(), (: archp :))->eventPrint("[" + GetCapName() + " logs in]", ! MSG_SYSTEM); if(!catch(mp = (mapping)FOLDERS_D->mail_status(GetKeyName()))) { ! if(mp["unread"]) { ! eventPrint("\n>>> " + mp["unread"] + " of your " + ! (mp["total"] == 1 ? mp["total"] + " letter is" : ! mp["total"] + " letters remain") + " unread. <<<\n", ! MSG_SYSTEM); ! } } NEWS_D->GeneralNews(); return 1; *************** *** 145,173 **** save_player(GetKeyName()); log_file("enter", GetCapName() + " (net-dead): " + ctime(time()) + "\n"); environment()->eventPrint(GetName() + " suddenly disappears into " ! "a sea of irreality.", MSG_ENV, this_object()); filter(users(), (: archp :))->eventPrint("[" + GetCapName() + ! " goes net-dead]", MSG_SYSTEM); eventMove(ROOM_FREEZER); if(query_snoop(this_object())) ! query_snoop(this_object())->eventPrint(GetCapName() + " has gone " ! "net-dead.", MSG_SYSTEM); } void eventReconnect() { - string dead_ed; interface::eventReconnect(); LastAge = time(); HostSite = query_ip_name(this_object()); eventPrint("Reconnected.", MSG_SYSTEM); filter(users(), (: archp :))->eventPrint("[" + GetCapName() + " has " ! "rejoined " + mud_name() + "]", ! MSG_SYSTEM); if( NetDiedHere ) eventMove(NetDiedHere); else eventMove(ROOM_START); environment()->eventPrint(GetCapName() + " has rejoined this reality.", ! MSG_ENV, this_object()); NetDiedHere = 0; } --- 154,186 ---- save_player(GetKeyName()); log_file("enter", GetCapName() + " (net-dead): " + ctime(time()) + "\n"); environment()->eventPrint(GetName() + " suddenly disappears into " ! "a sea of irreality.", MSG_ENV, this_object()); filter(users(), (: archp :))->eventPrint("[" + GetCapName() + ! " goes net-dead]", MSG_SYSTEM); ! if(file_exists("/secure/room/control")){ ! get_livings(load_object("/secure/room/control"))->eventPrint("[" + GetKeyName()+ ! " goes net-dead]", MSG_SYSTEM); ! } ! SNOOP_D->ReportLinkDeath(this_object()->GetKeyName()); eventMove(ROOM_FREEZER); if(query_snoop(this_object())) ! query_snoop(this_object())->eventPrint(GetCapName() + " has gone " ! "net-dead.", MSG_SYSTEM); } void eventReconnect() { interface::eventReconnect(); LastAge = time(); HostSite = query_ip_name(this_object()); eventPrint("Reconnected.", MSG_SYSTEM); filter(users(), (: archp :))->eventPrint("[" + GetCapName() + " has " ! "rejoined " + mud_name() + "]", ! MSG_SYSTEM); if( NetDiedHere ) eventMove(NetDiedHere); else eventMove(ROOM_START); environment()->eventPrint(GetCapName() + " has rejoined this reality.", ! MSG_ENV, this_object()); NetDiedHere = 0; } *************** *** 179,230 **** int i, maxi; if(!(env = environment(this_object()))) { ! eventPrint("You are nowhere.", MSG_ROOMDESC); ! return; } switch( i = GetEffectiveVision() ) { case VISION_BLIND: eventPrint("You are blind and can see nothing."); break; case VISION_TOO_DARK: ! eventPrint("It is much too dark to see."); break; case VISION_DARK: eventPrint("It is too dark to see."); ! break; case VISION_TOO_BRIGHT: ! eventPrint("It is much too %^YELLOW%^bright%^RESET%^ to see."); break; case VISION_BRIGHT: ! eventPrint("It is too %^YELLOW%^bright%^RESET%^ to see."); ! break; } if( !brief ) { ! if( i == VISION_CLEAR ) { desc = (string)env->GetObviousExits() || ""; ! desc = capitalize((string)env->GetShort() || "") + " [" + desc + "]\n"; } ! else desc = ""; if( i == VISION_CLEAR || i == VISION_LIGHT || i == VISION_DIM ) ! desc += (string)env->GetLong(); ! if(functionp(tmp = (mixed)env->GetSmell("default"))) tmp = (string)(*tmp)("default"); ! smell = tmp; ! if(functionp(tmp = (mixed)env->GetListen("default"))) ! tmp = (string)(*tmp)("default"); ! sound = tmp; ! if( functionp(tmp = (mixed)env->GetTouch("default")) ) ! tmp = evaluate(tmp, "default"); ! touch = tmp; } else { ! if( i == VISION_CLEAR || i == VISION_LIGHT || i == VISION_DIM ) { desc = (string)env->GetShort(); if( (tmp = (string)env->GetObviousExits()) && tmp != "" ) desc += " [" + tmp + "]"; } ! else desc = ""; } if( desc ) eventPrint(desc, MSG_ROOMDESC); if( smell ) eventPrint("%^GREEN%^" + smell, MSG_ROOMDESC); --- 192,246 ---- int i, maxi; if(!(env = environment(this_object()))) { ! eventPrint("You are nowhere.", MSG_ROOMDESC); ! return; } switch( i = GetEffectiveVision() ) { case VISION_BLIND: eventPrint("You are blind and can see nothing."); break; case VISION_TOO_DARK: ! eventPrint("It is much too dark to see."); break; case VISION_DARK: eventPrint("It is too dark to see."); ! break; case VISION_TOO_BRIGHT: ! eventPrint("It is much too %^YELLOW%^bright%^RESET%^ to see."); break; case VISION_BRIGHT: ! eventPrint("It is too %^YELLOW%^bright%^RESET%^ to see."); ! break; } if( !brief ) { ! if( i == VISION_CLEAR ){ desc = (string)env->GetObviousExits() || ""; ! if(desc && desc != "") ! desc = capitalize((string)env->GetShort() || "") + " [" + desc + "]\n"; + else desc = capitalize((string)env->GetShort()+"\n" || "\n"); } ! else desc = "\n"; if( i == VISION_CLEAR || i == VISION_LIGHT || i == VISION_DIM ) ! desc += (string)env->GetLong(); ! if(functionp(tmp = (mixed)env->GetSmell("default"))) tmp = (string)(*tmp)("default"); ! smell = tmp; ! if(functionp(tmp = (mixed)env->GetListen("default"))) ! tmp = (string)(*tmp)("default"); ! sound = tmp; ! if( functionp(tmp = (mixed)env->GetTouch("default")) ) ! tmp = evaluate(tmp, "default"); ! touch = tmp; } else { ! if(i == VISION_CLEAR || i == VISION_LIGHT || i == VISION_DIM){ desc = (string)env->GetShort(); if( (tmp = (string)env->GetObviousExits()) && tmp != "" ) desc += " [" + tmp + "]"; + else desc += "\n"; } ! else desc = "\n"; } if( desc ) eventPrint(desc, MSG_ROOMDESC); if( smell ) eventPrint("%^GREEN%^" + smell, MSG_ROOMDESC); *************** *** 234,596 **** if( i == VISION_CLEAR ) { mapping lying = ([]); shorts = map(filter(all_inventory(env), ! function(object ob) { ! if( living(ob) ) return 0; ! if( (int)ob->GetInvis(this_object()) ) ! return 0; ! if( (int)ob->isFreshCorpse() ) return 0; ! return 1; ! }), (: (string)$1->GetShort() :)); ! foreach(string s in shorts) { ! if( s ) { ! lying[s]++; ! } ! } ! for(i=0, desc = 0, maxi = sizeof(shorts = keys(lying)); i<maxi; i++) { ! string key = shorts[i]; ! int val = lying[shorts[i]]; ! ! if( val < 2 ) { ! if( !desc ) desc = "%^MAGENTA%^" + ! capitalize(key) + "%^RESET%^MAGENTA%^"; ! else desc += key + "%^RESET%^MAGENTA%^"; ! } ! else { ! if( !desc ) desc = "%^MAGENTA%^" + ! capitalize(consolidate(val, key)) + ! "%^RESET%^MAGENTA%^"; ! else desc += consolidate(val, key) + ! "%^RESET%^MAGENTA%^"; ! } ! if( i == maxi - 1 ) { ! if( maxi > 1 || val >1 ) ! desc += " are here.%^RESET%^\n"; ! else desc += " is here.%^RESET%^\n"; } ! else if( i == maxi - 2 ) { ! if( maxi == 2 ) { ! desc += " and "; ! } ! else { ! desc += ", and "; ! } } - else desc += ", "; - } - } - i = GetEffectiveVision(); - if( i == VISION_CLEAR || i == VISION_LIGHT || i == VISION_DIM ) { - mapping lying = ([]), sitting = ([]), standing = ([]); - object *obs; - string key; - int val; - - obs = filter(all_inventory(env), function(object ob) { - if( (int)ob->GetInvis(this_object()) ) return 0; - if( living(ob) ) return 1; - if( (int)ob->isFreshCorpse() ) - return 1; - }) - ({ this_object() }); - maxi = sizeof(shorts = map(obs, (: (string)$1->GetHealthShort() :))); - foreach(object liv in obs) { - string s = (string)liv->GetHealthShort(); - int pos = (int)liv->GetPosition(); - - if( !s ) continue; - if( creatorp(liv) || pos == POSITION_STANDING) standing[s]++; - else if( pos == POSITION_LYING || (int)liv->isFreshCorpse() ) - lying[s]++; - else if( pos == POSITION_SITTING ) sitting[s]++; - else lying[s]++; - } - if( !desc ) { - tmp = ""; - } - else { - tmp = desc; - } - desc = ""; - foreach(key, val in lying) { - if( val<2 ) desc += capitalize(key) + "%^RESET%^ is lying down."; - else desc += capitalize(consolidate(val, key)) + - "%^RESET%^ are lying down."; - desc += "\n"; - } - foreach(key, val in sitting) { - if( val<2 ) - desc += capitalize(key) + "%^RESET%^ is sitting down."; - else desc += capitalize(consolidate(val, key)) + - "%^RESET%^ are sitting down."; - desc += "\n"; - } - foreach(key, val in standing) { - if( val<2 ) - desc += capitalize(key) + "%^RESET%^ is standing here."; - else desc += capitalize(consolidate(val, key)) + - "%^RESET%^ are standing here."; - desc += "\n"; } - } - if( tmp ) { - desc = tmp + desc; - } - if( sizeof(desc) ) { - eventPrint(desc + "\n", MSG_ROOMDESC); - } - } ! int eventDestruct() { ! object ob; ! int i; ! ! interface::eventDestruct(); ! foreach(ob in deep_inventory(this_object())) { ! if( ob ) catch(ob->eventDestruct()); ! } ! return object::eventDestruct(); ! } ! mixed eventDivorce(object who) { ! class marriage m; ! m = Marriages[0]; ! m->DivorceDate = time(); ! return 1; ! } ! ! mixed eventMarry(object who, object to_whom) { ! class marriage m; ! object env; ! if( (env = previous_object()) != environment() ) return 0; ! m = new(class marriage); ! m->Spouse = (string)to_whom->GetCapName(); ! m->WeddingDate = time(); ! m->DivorceDate = 0; ! m->Location = file_name(env); ! Marriages = ({ m }) + Marriages; ! return 1; ! } ! int eventMove(mixed dest) { ! string str; ! int x; ! ! x = move::eventMove(dest); ! if( x ) { ! if( !(str = (string)environment()->GetProperty("login")) ) ! LoginSite = base_name(environment()); ! else LoginSite = str; ! } ! return x; ! } ! int cmdQuit(string str) { ! string tmp; ! if( previous_object() && ! ! ((int)master()->valid_apply( ({ GetKeyName() }) )) ) return 0; ! if( (int)environment(this_object())->GetProperty("no quit") && ! ! sizeof(previous_object(-1)) ) { ! message("system", "You are unable to escape this reality!", ! this_object()); ! return 1; ! } ! message("system", "Please come back another time!", this_object()); ! save_player(GetKeyName()); ! tmp = GetMessage("logout") || (GetName() + " is gone from this reality!"); ! message("environment", tmp, environment(this_object()), ({this_object()})); ! log_file("enter", GetCapName()+" (quit): "+ctime(time())+"\n"); ! message("announce", "["+GetCapName()+" quits]", filter(users(), (: archp :))); ! eventDestruct(); ! return 1; ! } ! int GetAge() { ! int x; ! if(!interactive(this_object())) return Age; ! x = time() - LastAge; ! Age += x; ! LastAge = time(); ! return Age; ! } ! int GetBirth() { return BirthTime - (YEAR * 18); } ! string query_cwd() { return interface::query_cwd(); } ! void SetEmail(string str) { ! if(!((int)master()->valid_apply(({ GetKeyName() })))) return; ! Email = str; ! } ! string GetEmail() { ! if(!((int)master()->valid_apply(({ GetKeyName() })))) return 0; ! else return Email; ! } ! void SetId(string *bogus) { ! int i; ! if(UserId) return; ! if(!GetCapName()) { ! UserId = ({ GetKeyName() }); ! return; ! } ! UserId = ({ GetKeyName(), lower_case(GetCapName()) }); ! if((i=sizeof(bogus = explode(lower_case(GetCapName()), " "))) == 1) ! return; ! while(i--) ! if(!user_exists(bogus[i])) UserId += ({ bogus[i] }); ! } ! string *GetId() { return UserId; } ! int id(string str) { ! if(!str || !UserId) return 0; ! else return member_array(lower_case(str), UserId) != -1; ! } ! int GetLoginTime() { return LoginTime; } ! string SetKeyName(string str) { ! if( previous_object() != master() ) return GetKeyName(); ! return object::SetKeyName(str); ! } ! string GetKeyName() { return object::GetKeyName(); } ! void SetNews(string type, int sz) { News[type] = sz; } ! int GetNews(string type) { return News[type]; } ! void SetPassword(string str) { ! if(!((int)master()->valid_apply(({ GetKeyName() })))) return; ! Password = str; ! save_player(GetKeyName()); ! } ! string GetPassword() { ! if(!((int)master()->valid_apply(({ GetKeyName() })))) return 0; ! else return Password; ! } ! void SetRank(string str) { Rank = str; } ! string GetRank() { return Rank; } ! void SetRealName(string str) { ! if(!((int)master()->valid_apply(({ GetKeyName() })))) return; ! RealName = str; ! } ! string GetRealName() { return RealName; } ! string GetShort() { ! string str; ! str = object::GetShort(str); ! if( !str ) str = "$N the unaccomplished"; ! if( strsrch(str, "$N") == -1 ) str = "$N"; ! str = replace_string(str, "$N", GetName()); ! if( interactive(this_object()) ) return str; ! else return str + " (net-dead)"; ! } ! varargs string GetLong() { ! string str; ! str = object::GetLong(str); ! if(!str || strsrch(str, "$N") == -1) str = "$N is nondescript."; ! str = replace_string(str, "$N", GetName()); ! return str; ! } ! int SetBriefMode(int x) { return (Brief = x); } ! int GetBriefMode() { return Brief; } ! int SetWhereBlock() { return (WhereBlock = !WhereBlock); } ! int GetWhereBlock() { return WhereBlock; } ! string get_path() { ! log_file("get_path", identify(previous_object())+"\n"); ! return query_cwd(); ! } ! void SetLastError(mapping m) { ! if (previous_object() != master()) return; ! LastError = m; ! } ! mapping GetLastError() { ! string caller = file_name(previous_object()); ! if( caller[0..24] == "/secure/cmds/creators/dbx" || ! caller[0..23] == "/secure/cmds/players/bug" ) return LastError; ! error("Privilege Violation: " + caller); ! } ! void SetCapName(string str) { ! if( base_name(previous_object(0)) != LIB_CONNECT ) return; ! object::SetCapName(str); ! } ! void move_or_destruct() { ! (eventMove(ROOM_START) || eventMove(ROOM_VOID)); ! } ! string SetShort(string str) { ! if( strsrch(str, "$N") == -1 ) return object::GetShort(); ! else return object::SetShort(str); ! } ! string SetLong(string str) { ! if(strsrch(str, "$N") == -1) return object::GetLong(); ! else return object::SetLong(str); ! } ! string GetName() { return object::GetName(); } ! varargs int GetInvis(object ob) { return object::GetInvis(ob); } ! mixed *GetCommands() { ! if( !((int)master()->valid_apply( ({ GetKeyName() }) )) ) return ({}); ! else return commands(); ! } ! string GetSpouse() { ! if( !Marriages || !sizeof(Marriages) ) return 0; ! if( ((class marriage)Marriages[0])->DivorceDate ) return 0; ! return ((class marriage)Marriages[0])->Spouse; ! } ! class marriage *GetMarriages() { return Marriages; } ! string GetHostSite() { ! if( WhereBlock ) { ! if( !((int)master()->valid_access(({ PRIV_ASSIST }))) ) ! return "Confidential"; ! else return HostSite; ! } ! return HostSite; ! } ! void eventLoadObject(mixed *value, int recurse) { } ! int GetRadiantLight(int ambient) { ! return (object::GetRadiantLight(ambient) + ! container::GetRadiantLight(ambient)); ! } ! string GetWebPage() { ! return WebPage; ! } ! string SetWebPage(string page) { ! if( !master()->valid_apply(({ GetKeyName() })) ) { ! return WebPage; ! } ! return (WebPage = page); ! } --- 250,625 ---- if( i == VISION_CLEAR ) { mapping lying = ([]); shorts = map(filter(all_inventory(env), ! function(object ob) { ! if( living(ob) ) return 0; ! if( (int)ob->GetInvis(this_object()) && !ob->GetDoor() ) ! return 0; ! if(ob->GetDoor() && load_object(ob->GetDoor())->GetHiddenDoor()) return 0; ! if( (int)ob->isFreshCorpse() ) return 0; ! return 1; ! }), (: (string)$1->GetShort() :)); ! foreach(string s in shorts) { ! if( s ) { ! lying[s]++; ! } ! } ! //tc(identify(shorts)); ! for(i=0, desc = 0, maxi = sizeof(shorts = keys(lying)); i<maxi; i++) { ! string key = shorts[i]; ! int val = lying[shorts[i]]; ! ! if( val < 2 ) { ! if( !desc ) desc = "%^MAGENTA%^" + ! capitalize(key) + "%^RESET%^MAGENTA%^"; ! else desc += key + "%^RESET%^MAGENTA%^"; ! } ! else { ! if( !desc ) desc = "%^MAGENTA%^" + ! capitalize(consolidate(val, key)) + ! "%^RESET%^MAGENTA%^"; ! else desc += consolidate(val, key) + ! "%^RESET%^MAGENTA%^"; ! } ! if( i == maxi - 1 ) { ! if( maxi > 1 || val >1 ) ! desc += " are here.%^RESET%^\n"; ! else desc += " is here.%^RESET%^\n"; ! } ! else if( i == maxi - 2 ) { ! if( maxi == 2 ) { ! desc += " and "; ! } ! else { ! desc += ", and "; ! } ! } ! else desc += ", "; ! } ! } ! i = GetEffectiveVision(); ! if( i == VISION_CLEAR || i == VISION_LIGHT || i == VISION_DIM ) { ! mapping lying = ([]), sitting = ([]), standing = ([]), flying = ([]); ! object *obs; ! string key; ! int val; ! ! obs = filter(all_inventory(env), function(object ob) { ! if( (int)ob->GetInvis(this_object()) ) return 0; ! if( living(ob) ) return 1; ! if( (int)ob->isFreshCorpse() ) ! return 1; ! }) - ({ this_object() }); ! maxi = sizeof(shorts = map(obs, (: (string)$1->GetHealthShort() :))); ! foreach(object liv in obs) { ! string s = (string)liv->GetHealthShort(); ! int pos = (int)liv->GetPosition(); ! ! if( !s ) continue; ! if( pos == POSITION_STANDING) standing[s]++; ! else if( pos == POSITION_LYING || (int)liv->isFreshCorpse() ) ! lying[s]++; ! else if( pos == POSITION_SITTING ) sitting[s]++; ! else if( pos == POSITION_FLYING ) flying[s]++; ! else lying[s]++; ! } ! if( !desc ) { ! tmp = ""; ! } ! else { ! tmp = desc; ! } ! desc = ""; ! foreach(key, val in lying) { ! if( val<2 ) desc += capitalize(key) + "%^RESET%^ is lying down."; ! else desc += capitalize(consolidate(val, key)) + ! "%^RESET%^ are lying down."; ! desc += "\n"; ! } ! foreach(key, val in sitting) { ! if( val<2 ) ! desc += capitalize(key) + "%^RESET%^ is sitting down."; ! else desc += capitalize(consolidate(val, key)) + ! "%^RESET%^ are sitting down."; ! desc += "\n"; ! } ! foreach(key, val in standing) { ! if( val<2 ) ! desc += capitalize(key) + "%^RESET%^ is standing here."; ! else desc += capitalize(consolidate(val, key)) + ! "%^RESET%^ are standing here."; ! desc += "\n"; ! } ! foreach(key, val in flying) { ! if( val<2 ) ! desc += capitalize(key) + "%^RESET%^ is hovering here."; ! else desc += capitalize(consolidate(val, key)) + ! "%^RESET%^ are hovering here."; ! desc += "\n"; ! } ! ! } ! if( tmp ) { ! desc = tmp + desc; } ! if( sizeof(desc) ) { ! eventPrint(desc + "\n", MSG_ROOMDESC); } } ! int eventDestruct() { ! object ob; ! interface::eventDestruct(); ! foreach(ob in deep_inventory(this_object())) { ! if( ob ) catch(ob->eventDestruct()); ! } ! return object::eventDestruct(); ! } ! mixed eventDivorce(object who) { ! class marriage m; ! m = Marriages[0]; ! m->DivorceDate = time(); ! return 1; ! } ! mixed eventMarry(object who, object to_whom) { ! class marriage m; ! object env; ! ! if( (env = previous_object()) != environment() ) return 0; ! m = new(class marriage); ! m->Spouse = (string)to_whom->GetCapName(); ! m->WeddingDate = time(); ! m->DivorceDate = 0; ! m->Location = file_name(env); ! Marriages = ({ m }) + Marriages; ! return 1; ! } ! int eventMove(mixed dest) { ! string str; ! int x; ! ! x = move::eventMove(dest); ! if( x ) { ! if( !(str = (string)environment()->GetProperty("login")) ) ! LoginSite = base_name(environment()); ! else LoginSite = str; ! } ! return x; ! } ! int cmdQuit(string str) { ! string tmp; ! if( previous_object() && ! ! ((int)master()->valid_apply( ({ GetKeyName() }) )) ) return 0; ! if( (int)environment(this_object())->GetProperty("no quit") && ! ! sizeof(previous_object(-1)) ) { ! message("system", "You are unable to escape this reality!", ! this_object()); ! return 1; ! } ! message("system", "Please come back another time!", this_object()); ! this_player()->AddCarriedMass(-5000); ! save_player(GetKeyName()); ! tmp = GetMessage("logout") || (GetName() + " is gone from this reality!"); ! message("environment", tmp, environment(this_object()), ({this_object()})); ! log_file("enter", GetCapName()+" (quit): "+timestamp()+"\n"); ! message("announce", "["+GetCapName()+" quits]", filter(users(), (: archp :))); ! eventDestruct(); ! return 1; ! } ! int GetAge() { ! int x; ! if(!interactive(this_object())) return Age; ! x = time() - LastAge; ! Age += x; ! LastAge = time(); ! return Age; ! } ! int GetBirth() { return BirthTime - (YEAR * 18); } ! string query_cwd() { return interface::query_cwd(); } ! void SetEmail(string str) { ! if(!((int)master()->valid_apply(({ GetKeyName() })))) return; ! Email = str; ! } ! string GetEmail() { ! if(!((int)master()->valid_apply(({ GetKeyName() })))) return 0; ! else return Email; ! } ! void SetId(string *bogus) { ! int i; ! if(UserId) return; ! if(!GetCapName()) { ! UserId = ({ GetKeyName() }); ! return; ! } ! UserId = ({ GetKeyName(), lower_case(GetCapName()) }); ! if((i=sizeof(bogus = explode(lower_case(GetCapName()), " "))) == 1) ! return; ! while(i--) ! if(!user_exists(bogus[i])) UserId += ({ bogus[i] }); ! } ! string *GetId() { return UserId; } ! int id(string str) { ! if(!str || !UserId) return 0; ! else return member_array(lower_case(str), UserId) != -1; ! } ! int GetLoginTime() { return LoginTime; } ! string SetKeyName(string str) { ! if( previous_object() != master() ) return GetKeyName(); ! return object::SetKeyName(str); ! } ! string GetKeyName() { return object::GetKeyName(); } ! void SetNews(string type, int sz) { News[type] = sz; } ! int GetNews(string type) { return News[type]; } ! void SetPassword(string str) { ! if(!((int)master()->valid_apply(({ GetKeyName() })))) return; ! Password = str; ! save_player(GetKeyName()); ! } ! string GetPassword() { ! if(!((int)master()->valid_apply(({ GetKeyName() })))) return 0; ! else return Password; ! } ! void SetRank(string str) { Rank = str; } ! string GetRank() { return Rank; } ! void SetRealName(string str) { ! if(!((int)master()->valid_apply(({ GetKeyName() })))) return; ! RealName = str; ! } ! string GetRealName() { return RealName; } ! string GetShort() { ! string str; ! str = object::GetShort(str); ! if( !str ) str = "$N the unaccomplished"; ! if( strsrch(str, "$N") == -1 ) str = "$N"; ! str = replace_string(str, "$N", GetName()); ! if( interactive(this_object()) ) return str; ! else return str + " (net-dead)"; ! } ! varargs string GetLong() { ! string str; ! str = object::GetLong(str); ! if(!str || strsrch(str, "$N") == -1) str = "$N is nondescript."; ! str = replace_string(str, "$N", GetName()); ! return str; ! } ! int SetBriefMode(int x) { return (Brief = x); } ! int GetBriefMode() { return Brief; } ! int SetWhereBlock() { return (WhereBlock = !WhereBlock); } ! int GetWhereBlock() { return WhereBlock; } ! string get_path() { ! log_file("get_path", identify(previous_object())+"\n"); ! return query_cwd(); ! } ! void SetLastError(mapping m) { ! if (previous_object() != master()) return; ! LastError = m; ! } ! mapping GetLastError() { ! string *allowed = ({ "/secure/cmds/creators/dbxwhere", "/secure/cmds/creators/dbxframe", "/secure/cmds/players/bug", file_name(master()) }); ! string caller = file_name(previous_object()); ! if(member_array(caller, allowed) != -1 ) { ! if(LastError) return LastError; ! } ! else error("Privilege Violation: " + caller); ! } ! void SetCapName(string str) { ! if( base_name(previous_object(0)) != LIB_CONNECT ) return; ! object::SetCapName(str); ! } ! void move_or_destruct() { ! (eventMove(ROOM_START) || eventMove(ROOM_VOID)); ! } ! string SetShort(string str) { ! if( strsrch(str, "$N") == -1 ) return object::GetShort(); ! else return object::SetShort(str); ! } ! string SetLong(string str) { ! if(strsrch(str, "$N") == -1) return object::GetLong(); ! else return object::SetLong(str); ! } ! string GetName() { return object::GetName(); } ! varargs int GetInvis(object ob) { return object::GetInvis(ob); } ! mixed *GetCommands() { ! if( !((int)master()->valid_apply( ({ GetKeyName() }) )) ) return ({}); ! else return commands(); ! } ! ! string GetSpouse() { ! if( !Marriages || !sizeof(Marriages) ) return 0; ! if( ((class marriage)Marriages[0])->DivorceDate ) return 0; ! return ((class marriage)Marriages[0])->Spouse; ! } ! class marriage *GetMarriages() { return Marriages; } ! string GetHostSite() { ! if( WhereBlock ) { ! if( !((int)master()->valid_access(({ PRIV_ASSIST }))) ) ! return "Confidential"; ! else return HostSite; ! } ! return HostSite; ! } ! void eventLoadObject(mixed *value, int recurse) { } ! int GetRadiantLight(int ambient) { ! return (object::GetRadiantLight(ambient) + ! container::GetRadiantLight(ambient)); ! } ! string GetWebPage() { ! return WebPage; ! } ! string SetWebPage(string page) { ! if( !master()->valid_apply(({ GetKeyName() })) ) { ! return WebPage; ! } ! return (WebPage = page); ! } diff -c -r --new-file ds1.1/lib/lib/interface.c ds2.0r27/lib/lib/interface.c *** ds1.1/lib/lib/interface.c Sun Feb 1 21:30:18 1998 --- ds2.0r27/lib/lib/interface.c Wed Jul 5 00:00:58 2006 *************** *** 1,5 **** /* /lib/interface.c ! * from the Dead Soulsr1 Object Library * handles user interface issues * created by Descartes of Borg 950428 * Version: @(#) interface.c 1.4@(#) --- 1,5 ---- /* /lib/interface.c ! * from the Dead Souls Object Library * handles user interface issues * created by Descartes of Borg 950428 * Version: @(#) interface.c 1.4@(#) *************** *** 27,41 **** command::create(); editor::create(); nmsh::create(); ! Terminal = "unknown"; ! Screen = ({ 80, 24 }); Blocked = ([]); } static string process_input(string str) { SetCommandFail(0); if( Client ) { ! int cl; sscanf(str, "%d %s", cl, str); } --- 27,41 ---- command::create(); editor::create(); nmsh::create(); ! Terminal = "ansi"; ! Screen = ({ 80, 20 }); Blocked = ([]); } static string process_input(string str) { SetCommandFail(0); if( Client ) { ! int cl; sscanf(str, "%d %s", cl, str); } *************** *** 60,116 **** void receive_message(string msg_class, string msg) { int cl = 0; ! if( msg_class[0] == 'N' ) { msg_class = msg_class[1..]; cl |= MSG_NOWRAP; } else if( msg_class == "prompt" && msg_class == "editor" ) cl |= MSG_NOWRAP; switch(msg_class) { ! case "smell": case "sound": case "touch": cl |= MSG_ENV; break; ! case "snoop": cl |= MSG_SYSTEM | MSG_NOCOLOUR; ! case "broadcast": cl |= MSG_SYSTEM; break; ! case "editor": cl |= MSG_EDIT; break; ! ! case "tell": case "shout": cl |= MSG_CONV; ! break; ! ! case "come": case "leave": case "telout": case "telin": cl |= MSG_ENV; break; ! case "living_item": case "inanimate_item": cl |= MSG_ROOMDESC; break; ! ! case "system": case "more": cl |= MSG_SYSTEM; break; ! case "prompt": cl = MSG_PROMPT; break; ! case "error": cl |= MSG_ERROR; break; ! case "help": cl |= MSG_HELP; ! default: cl |= MSG_ENV; ! } eventPrint(msg, cl); } --- 60,116 ---- void receive_message(string msg_class, string msg) { int cl = 0; ! if( msg_class[0] == 'N' ) { msg_class = msg_class[1..]; cl |= MSG_NOWRAP; } else if( msg_class == "prompt" && msg_class == "editor" ) cl |= MSG_NOWRAP; switch(msg_class) { ! case "smell": case "sound": case "touch": cl |= MSG_ENV; break; ! case "snoop": cl |= MSG_SYSTEM | MSG_NOCOLOUR; ! case "broadcast": cl |= MSG_SYSTEM; break; ! case "editor": cl |= MSG_EDIT; break; ! ! case "tell": case "shout": cl |= MSG_CONV; ! break; ! ! case "come": case "leave": case "telout": case "telin": cl |= MSG_ENV; break; ! case "living_item": case "inanimate_item": cl |= MSG_ROOMDESC; break; ! ! case "system": case "more": cl |= MSG_SYSTEM; break; ! case "prompt": cl = MSG_PROMPT; break; ! case "error": cl |= MSG_ERROR; break; ! case "help": cl |= MSG_HELP; ! default: cl |= MSG_ENV; ! } eventPrint(msg, cl); } *************** *** 127,134 **** int msg_class; if( !msg ) return 0; ! if( !arg2 && !arg3 ) msg_class = MSG_ENV; ! else if( !arg2 ) { if( !intp(arg3) ) msg_class = MSG_ENV; else msg_class = arg3; } --- 127,134 ---- int msg_class; if( !msg ) return 0; ! if( !arg2 && !arg3 ) msg_class = MSG_ENV; ! else if( !arg2 ) { if( !intp(arg3) ) msg_class = MSG_ENV; else msg_class = arg3; } *************** *** 136,144 **** else msg_class = arg2; if( !(msg_class & MSG_NOBLOCK) && GetBlocked("all") ) return 0; if( GetLogHarass() ) ! log_file("harass/" + GetKeyName(), strip_colours(msg) + "\n"); if( !TermInfo ) ! TermInfo = (mapping)TERMINAL_D->query_term_info(GetTerminal()); if( !(msg_class & MSG_NOCOLOUR) ) { int indent; --- 136,144 ---- else msg_class = arg2; if( !(msg_class & MSG_NOBLOCK) && GetBlocked("all") ) return 0; if( GetLogHarass() ) ! log_file("harass/" + GetKeyName(), strip_colours(msg) + "\n"); if( !TermInfo ) ! TermInfo = (mapping)TERMINAL_D->query_term_info(GetTerminal()); if( !(msg_class & MSG_NOCOLOUR) ) { int indent; *************** *** 148,171 **** msg = terminal_colour(msg + "%^RESET%^", TermInfo); else msg = terminal_colour(msg + "%^RESET%^\n", TermInfo, ! GetScreen()[0], indent); } else if( !(msg_class & MSG_NOWRAP) ) msg = wrap(msg, GetScreen()[0]-1); if( Client ) receive("<" + msg_class + " " + msg + " " + msg_class +">\n"); else receive(msg); return 1; } ! varargs int SetBlocked(string type, int flag) { if( !type ) return 0; if( !flag ) flag = !Blocked[type]; if( Blocked[type] == 2 && !archp(this_player()) ) { ! this_player()->eventPrint("Unable to unblock " + type + "."); ! return -1; } Blocked[type] = flag; message("system", "You are "+(Blocked[type] ? "now blocking" : ! "no longer blocking")+" "+type+".", this_object()); return Blocked[type]; } --- 148,171 ---- msg = terminal_colour(msg + "%^RESET%^", TermInfo); else msg = terminal_colour(msg + "%^RESET%^\n", TermInfo, ! GetScreen()[0], indent); } else if( !(msg_class & MSG_NOWRAP) ) msg = wrap(msg, GetScreen()[0]-1); if( Client ) receive("<" + msg_class + " " + msg + " " + msg_class +">\n"); else receive(msg); return 1; } ! varargs int SetBlocked(string type, int flag) { if( !type ) return 0; if( !flag ) flag = !Blocked[type]; if( Blocked[type] == 2 && !archp(this_player()) ) { ! this_player()->eventPrint("Unable to unblock " + type + "."); ! return -1; } Blocked[type] = flag; message("system", "You are "+(Blocked[type] ? "now blocking" : ! "no longer blocking")+" "+type+".", this_object()); return Blocked[type]; } *************** *** 185,197 **** if( GetForced() || (this_player(1) != this_object()) ) return LogHarass; if( LogHarass == x ) return LogHarass; if( x ) { ! txt = "**************** Start of Log *****************\n"+ ! "Time: " + ctime( time() ) + "\n"; ! if( environment( this_object() ) ) txt += "Place: " + ! file_name( environment( this_object() ) ) + "\n"; } else { ! txt = "**************** End of Log *****************\n"+ ! "Time: " + ctime( time() ) + "\n"; } log_file("harass/" + GetKeyName(), txt); return (LogHarass = x); --- 185,197 ---- if( GetForced() || (this_player(1) != this_object()) ) return LogHarass; if( LogHarass == x ) return LogHarass; if( x ) { ! txt = "**************** Start of Log *****************\n"+ ! "Time: " + ctime( time() ) + "\n"; ! if( environment( this_object() ) ) txt += "Place: " + ! file_name( environment( this_object() ) ) + "\n"; } else { ! txt = "**************** End of Log *****************\n"+ ! "Time: " + ctime( time() ) + "\n"; } log_file("harass/" + GetKeyName(), txt); return (LogHarass = x); *************** *** 214,236 **** string SetTerminal(string terminal) { switch( terminal ) { ! case "iris-ansi-net": case "vt100": case "vt220": case "vt102": ! case "vt300": case "dec-vt100": ! terminal = "ansi"; ! break; ! case "unknown": case "ansi": case "freedom": case "ansi-status": ! case "xterm": ! break; ! case "console": case "ibm-3278-2": ! terminal = "unknown"; ! break; ! default: ! log_file("terminals", "Unknown terminal type: " + terminal + "\n"); ! terminal = Terminal; ! break; } if( terminal != Terminal ) ! TermInfo = (mapping)TERMINAL_D->query_term_info(terminal); return Terminal = terminal; } --- 214,236 ---- string SetTerminal(string terminal) { switch( terminal ) { ! case "iris-ansi-net": case "vt100": case "vt220": case "vt102": ! case "vt300": case "dec-vt100": ! terminal = "ansi"; ! break; ! case "unknown": case "ansi": case "freedom": case "ansi-status": ! case "xterm": ! break; ! case "console": case "ibm-3278-2": ! terminal = "unknown"; ! break; ! default: ! log_file("terminals", "Unknown terminal type: " + terminal + "\n"); ! terminal = Terminal; ! break; } if( terminal != Terminal ) ! TermInfo = (mapping)TERMINAL_D->query_term_info(terminal); return Terminal = terminal; } diff -c -r --new-file ds1.1/lib/lib/lamp.c ds2.0r27/lib/lib/lamp.c *** ds1.1/lib/lib/lamp.c Sun Feb 1 21:30:18 1998 --- ds2.0r27/lib/lib/lamp.c Wed Jul 5 00:00:58 2006 *************** *** 1,5 **** /* /lib/lamp.c ! * from the Dead Souls V Object Library * a lamp-like inheritable that burns and such * created by Descartes of Borg 960513 */ --- 1,5 ---- /* /lib/lamp.c ! * from the Dead Souls Object Library * a lamp-like inheritable that burns and such * created by Descartes of Borg 960513 */ diff -c -r --new-file ds1.1/lib/lib/language.c ds2.0r27/lib/lib/language.c *** ds1.1/lib/lib/language.c Sun Feb 1 21:30:18 1998 --- ds2.0r27/lib/lib/language.c Wed Jul 5 00:00:58 2006 *************** *** 6,11 **** --- 6,13 ---- #include <function.h> + int Polyglot = 0; + class comprehension { function check; int time; *************** *** 18,28 **** // abstract methods int GetHeartRate(); int GetStatLevel(string stat); // end abstract methods int GetNextLevel(string lang, int curr_level); ! varargs static void SetLanguage(string lang, int level, int native) { string key; key = convert_name(lang); --- 20,31 ---- // abstract methods int GetHeartRate(); int GetStatLevel(string stat); + string GetNativeLanguage(); // end abstract methods int GetNextLevel(string lang, int curr_level); ! varargs void SetLanguage(string lang, int level, int native) { string key; key = convert_name(lang); *************** *** 32,42 **** } mapping RemoveLanguage(string lang) { ! lang = convert_name(lang); map_delete(Languages, lang); return Languages; } varargs void SetLanguageComprehension(function check, int time, function end) { if( !check ) { Comprehension = 0; --- 35,55 ---- } mapping RemoveLanguage(string lang) { ! if(lang && sizeof(lang)) lang = convert_name(lang); ! else return Languages; map_delete(Languages, lang); return Languages; } + mapping SetNativeLanguage(string lang){ + string key = convert_name(lang); + string old_lang = GetNativeLanguage(); + RemoveLanguage(old_lang); + SetLanguage(old_lang, 100); + SetLanguage(lang, 100, 1); + return Languages; + } + varargs void SetLanguageComprehension(function check, int time, function end) { if( !check ) { Comprehension = 0; *************** *** 71,90 **** int AddLanguagePoints(string lang, int points) { string key; int y; ! key = convert_name(lang); ! if( !Languages[key] ) SetLanguage(lang, 0, 0); Languages[key]["points"] += points; ! while( Languages[key]["points"] > ! (y = GetNextLevel(key, Languages[key]["level"])) ) { ! Languages[key]["points"] -= y; ! Languages[key]["level"]++; ! } ! while( Languages[key]["points"] < 0 ) { ! y = GetNextLevel(key, Languages[key]["level"] - 1); ! Languages[key]["points"] = y + Languages[key]["points"]; ! Languages[key]["level"]--; ! } return Languages[key]["points"]; } --- 84,97 ---- int AddLanguagePoints(string lang, int points) { string key; int y; ! key = convert_name(lang); ! if( !Languages[key] ) SetLanguage(key, 0, 0); ! //tc("thing1: "+identify(Languages[key]["points"])); Languages[key]["points"] += points; ! //tc("thing2: "+identify(Languages[key]["points"])); ! Languages[key]["level"] = Languages[key]["points"]; ! if(Languages[key]["level"] > 100) Languages[key]["level"] = 100; return Languages[key]["points"]; } *************** *** 115,121 **** string lang; foreach(lang, val in Languages) ! if( val["native"] ) return Languages[lang]["name"]; } static void heart_beat() { --- 122,138 ---- string lang; foreach(lang, val in Languages) ! if( val["native"] ) return Languages[lang]["name"]; ! } ! ! int SetPolyglot(int i){ ! if(!i) Polyglot = 0; ! else Polyglot = 1; ! return Polyglot; ! } ! ! int GetPolyglot(){ ! return Polyglot; } static void heart_beat() { diff -c -r --new-file ds1.1/lib/lib/lead.c ds2.0r27/lib/lib/lead.c *** ds1.1/lib/lib/lead.c Sun Feb 1 21:30:18 1998 --- ds2.0r27/lib/lib/lead.c Wed Jul 5 00:00:58 2006 *************** *** 1,4 **** ! /* From the Dead Soulsr2 Object Library * Provides lead support for mobile objects. * Works closely with LIB_FOLLOW. * Created by Rush 951028 --- 1,4 ---- ! /* From the Dead Souls Object Library * Provides lead support for mobile objects. * Works closely with LIB_FOLLOW. * Created by Rush 951028 *************** *** 11,18 **** private static int numberOfFollowers; static void create() { ! Followers = ([]); ! numberOfFollowers = 0; } mixed direct_lead_liv() { --- 11,18 ---- private static int numberOfFollowers; static void create() { ! Followers = ([]); ! numberOfFollowers = 0; } mixed direct_lead_liv() { *************** *** 31,46 **** if( !objectp(follower) ) error("Bad argument 1 to AddFollower().\n"); if( follower != this_object() && !Followers[follower] && !follower->GetProperty("no follow") ) { ! if( !follower->IsFollowing(this_object()) ) { ! if( follower->SetLeader(this_object()) ) { ! tmp = new(class FollowerClass); ! tmp->allowed = 0; ! tmp->bonus = 0; ! tmp->lost = 0; ! Followers[follower] = tmp; ! numberOfFollowers++; ! } ! } } return GetFollowers(); } --- 31,46 ---- if( !objectp(follower) ) error("Bad argument 1 to AddFollower().\n"); if( follower != this_object() && !Followers[follower] && !follower->GetProperty("no follow") ) { ! if( !follower->IsFollowing(this_object()) ) { ! if( follower->SetLeader(this_object()) ) { ! tmp = new(class FollowerClass); ! tmp->followed = 0; ! tmp->bonus = 0; ! tmp->lost = 0; ! Followers[follower] = tmp; ! numberOfFollowers++; ! } ! } } return GetFollowers(); } *************** *** 55,71 **** object *GetFollowers() { return filter(keys(Followers), (: $1 :)); } ! int SetAllowed(object follower, int allowed) { ! if( !objectp(follower) ) error("Bad argument 1 to SetAllowed().\n"); ! if( !intp(allowed) ) error("Bad argument 2 to SetAllowed().\n"); if( !Followers[follower] ) return 0; ! return(((class FollowerClass)Followers[follower])->allowed = allowed); } ! int GetAllowed(object follower) { if( !objectp(follower) ) error("Bad argument 1 to GetFollowBonus().\n"); if( !Followers[follower] ) return 0; ! return ((class FollowerClass)Followers[follower])->allowed; } int AddFollowBonus(object follower, int bonus) { --- 55,71 ---- object *GetFollowers() { return filter(keys(Followers), (: $1 :)); } ! int SetFollowed(object follower, int followed) { ! if( !objectp(follower) ) error("Bad argument 1 to SetFollowed().\n"); ! if( !intp(followed) ) error("Bad argument 2 to SetFollowed().\n"); if( !Followers[follower] ) return 0; ! return(((class FollowerClass)Followers[follower])->followed = followed); } ! int GetFollowed(object follower) { if( !objectp(follower) ) error("Bad argument 1 to GetFollowBonus().\n"); if( !Followers[follower] ) return 0; ! return ((class FollowerClass)Followers[follower])->followed; } int AddFollowBonus(object follower, int bonus) { *************** *** 83,103 **** varargs mixed CanLead(object ob) { if( ob ) { ! if( !ob->CanFollow() ) ! return "You are not empowered to lead " + ob->GetName(); ! if( ob->IsFollowing(this_object()) ) ! return "You are already leading " + ob->GetName(); ! if( this_object()->IsFollowing(ob) ) ! return ob->GetName() + " is already leading you."; ! if( ob == this_object() ) ! return "You cannot possibly do that."; } return 1; } varargs mixed CanEvade(object ob) { if( ob && !ob->IsFollowing(this_object()) ) ! return ob->GetName() + " is not following you."; return 1; } --- 83,103 ---- varargs mixed CanLead(object ob) { if( ob ) { ! if( !ob->CanFollow() ) ! return "You are not empowered to lead " + ob->GetName(); ! if( ob->IsFollowing(this_object()) ) ! return "You are already leading " + ob->GetName(); ! if( this_object()->IsFollowing(ob) ) ! return ob->GetName() + " is already leading you."; ! if( ob == this_object() ) ! return "You cannot possibly do that."; } return 1; } varargs mixed CanEvade(object ob) { if( ob && !ob->IsFollowing(this_object()) ) ! return ob->GetName() + " is not following you."; return 1; } *************** *** 107,120 **** int followChance; foreach(ob in GetFollowers()) { ! follower = Followers[ob]; ! followChance = 100; ! if( !follower->allowed ) followChance -= 20 + this_object()->GetSkillLevel("stealth"); ! followChance += ob->GetSkillLevel("tracking"); ! followChance += follower->bonus; ! if( ob->eventFollow(dest, followChance) ) follower->lost = 0; ! else if( follower->lost++ && eventEvade(ob) ) RemoveFollower(ob); } return 1; } --- 107,120 ---- int followChance; foreach(ob in GetFollowers()) { ! follower = Followers[ob]; ! followChance = 100; ! if( !follower->followed ) followChance -= 20 + this_object()->GetSkillLevel("stealth"); ! followChance += ob->GetSkillLevel("tracking"); ! followChance += follower->bonus; ! if( ob->eventFollow(dest, followChance) ) follower->lost = 0; ! else if( follower->lost++ && eventEvade(ob) ) RemoveFollower(ob); } return 1; } *************** *** 125,133 **** ret = CanEvade(ob); if( stringp(ret) ) error(ret); if( ret = 1 ) { ! ob->eventPrint(this_object()->GetName() + " has evaded you."); ! this_object()->eventPrint("You have evaded " + ob->GetName() + "."); ! return 1; } return 0; } --- 125,133 ---- ret = CanEvade(ob); if( stringp(ret) ) error(ret); if( ret = 1 ) { ! ob->eventPrint(this_object()->GetName() + " has evaded you."); ! this_object()->eventPrint("You have evaded " + ob->GetName() + "."); ! return 1; } return 0; } diff -c -r --new-file ds1.1/lib/lib/leader.c ds2.0r27/lib/lib/leader.c *** ds1.1/lib/lib/leader.c Sun Feb 1 21:30:18 1998 --- ds2.0r27/lib/lib/leader.c Wed Jul 5 00:00:58 2006 *************** *** 1,5 **** /* /domains/Ylsrim/npc/leader.c ! * from the Dead Soulsr2 Object Library * class leader inheritable * created by Descartes of Borg 951115 * Version: @(#) leader.c 1.5@(#) --- 1,5 ---- /* /domains/Ylsrim/npc/leader.c ! * from the Dead Souls Object Library * class leader inheritable * created by Descartes of Borg 951115 * Version: @(#) leader.c 1.5@(#) *************** *** 22,28 **** mixed eventAsk(object who, string str) { string cmd, args; mixed tmp; ! if( (tmp = sentient::eventAsk(who, str)) == 1 ) return 1; if( !str || str == "" ) { eventForce("speak ask me to what? To describe " + GetClass() + "s?"); --- 22,28 ---- mixed eventAsk(object who, string str) { string cmd, args; mixed tmp; ! if( (tmp = sentient::eventAsk(who, str)) == 1 ) return 1; if( !str || str == "" ) { eventForce("speak ask me to what? To describe " + GetClass() + "s?"); *************** *** 33,62 **** args = 0; } switch(cmd) { ! case "describe": case "preview": case "explain": eventPreview(who, args); break; ! case "convert": eventConvert(who, args); break; ! case "join": case "become": case "be": eventJoin(who, args); break; ! case "teach": eventTeachPlayer(who, args); break; ! ! default: eventForce("speak I am not sure what you want"); if( who->GetClass() ) { eventForce("speak do you mean to ask me to teach a spell?"); } else { eventForce("speak do you mean to ask me to describe " + ! pluralize(GetClass()) + "?"); } break; } --- 33,62 ---- args = 0; } switch(cmd) { ! case "describe": case "preview": case "explain": eventPreview(who, args); break; ! case "convert": eventConvert(who, args); break; ! case "join": case "become": case "be": eventJoin(who, args); break; ! case "teach": eventTeachPlayer(who, args); break; ! ! default: eventForce("speak I am not sure what you want"); if( who->GetClass() ) { eventForce("speak do you mean to ask me to teach a spell?"); } else { eventForce("speak do you mean to ask me to describe " + ! pluralize(GetClass()) + "?"); } break; } *************** *** 87,93 **** } if( ob != who ) { eventForce("speak " + (string)ob->GetName() + " must request " ! "conversion of " + possessive(ob) + " own free will."); return; } } --- 87,93 ---- } if( ob != who ) { eventForce("speak " + (string)ob->GetName() + " must request " ! "conversion of " + possessive(ob) + " own free will."); return; } } *************** *** 110,123 **** void eventJoin(object who, string args) { if( !args || args == "" ) { eventForce("speak Do you mean you wish to become " + ! add_article(GetClass()) + "?"); return; } args = remove_article(lower_case(args)); if( args != GetClass() && args[0..<2] != GetClass() && args != pluralize(GetClass()) ) { eventForce("speak you want me to make you a what?"); eventForce("speak people only ask me to join the " + ! pluralize(GetClass())); return; } if( (int)who->ClassMember(GetClass()) ) { --- 110,123 ---- void eventJoin(object who, string args) { if( !args || args == "" ) { eventForce("speak Do you mean you wish to become " + ! add_article(GetClass()) + "?"); return; } args = remove_article(lower_case(args)); if( args != GetClass() && args[0..<2] != GetClass() && args != pluralize(GetClass()) ) { eventForce("speak you want me to make you a what?"); eventForce("speak people only ask me to join the " + ! pluralize(GetClass())); return; } if( (int)who->ClassMember(GetClass()) ) { *************** *** 130,143 **** return; } if( !((string)who->GetReligion()) && GetReligion() ) ! who->SetReligion(GetReligion(0), GetReligion(1)); environment()->eventPrint(GetName() + " makes " + (string)who->GetName() + ! " " + add_article(GetClass()) + ".", ! ({ who, this_object() })); eventForce("speak welcome new " + GetClass() + "!"); eventForce("speak Inside this hall, you will find sanctuary."); eventForce(GetClass() + " " + (string)who->GetName() + ! " just joined our ranks!"); who->SetShort("foo"); /* reset title */ return; } --- 130,143 ---- return; } if( !((string)who->GetReligion()) && GetReligion() ) ! who->SetReligion(GetReligion(0), GetReligion(1)); environment()->eventPrint(GetName() + " makes " + (string)who->GetName() + ! " " + add_article(GetClass()) + ".", ! ({ who, this_object() })); eventForce("speak welcome new " + GetClass() + "!"); eventForce("speak Inside this hall, you will find sanctuary."); eventForce(GetClass() + " " + (string)who->GetName() + ! " just joined our ranks!"); who->SetShort("foo"); /* reset title */ return; } *************** *** 145,151 **** int eventPreAttack(object ob) { if( member_array(ob, GetEnemies()) > -1 ) return sentient::eventPreAttack(ob); eventForce(GetClass() + " " + pluralize(GetClass()) + "! Our home is " ! "being raided by " + (string)ob->GetName() + "!"); return sentient::eventPreAttack(ob); } --- 145,151 ---- int eventPreAttack(object ob) { if( member_array(ob, GetEnemies()) > -1 ) return sentient::eventPreAttack(ob); eventForce(GetClass() + " " + pluralize(GetClass()) + "! Our home is " ! "being raided by " + (string)ob->GetName() + "!"); return sentient::eventPreAttack(ob); } *************** *** 160,175 **** } } if( !who->eventLearnSpell(spell) ) { ! eventForce("speak You are no prepared for that spell!"); return 1; } who->eventPrint(GetName() + " touches your forehead and gives " ! "you knowledge of " + spell + "."); environment()->eventPrint(GetName() + " touches " + ! possessive_noun(who) + ! " forehead and gives " + ! objective(who) + " knowledge of " + ! spell + ".", who); return 1; } else { --- 160,175 ---- } } if( !who->eventLearnSpell(spell) ) { ! eventForce("speak You are not prepared for that spell!"); return 1; } who->eventPrint(GetName() + " touches your forehead and gives " ! "you knowledge of " + spell + "."); environment()->eventPrint(GetName() + " touches " + ! possessive_noun(who) + ! " forehead and gives " + ! objective(who) + " knowledge of " + ! spell + ".", who); return 1; } else { diff -c -r --new-file ds1.1/lib/lib/light.c ds2.0r27/lib/lib/light.c *** ds1.1/lib/lib/light.c Sun Feb 1 21:30:18 1998 --- ds2.0r27/lib/lib/light.c Wed Jul 5 00:00:58 2006 *************** *** 1,5 **** /* /lib/light.c ! * from the Dead Souls V LPC Library * a standard lighting object * created by Descartes of Borg 960512 * Version: @(#) light.c 1.2@(#) --- 1,5 ---- /* /lib/light.c ! * from the Dead Souls LPC Library * a standard lighting object * created by Descartes of Borg 960512 * Version: @(#) light.c 1.2@(#) *************** *** 33,39 **** if(!(str = item::GetShort()) || str == "") return str; return sprintf("%s%s", str, (GetLit() ? " (lit)" : "")); */ ! if( GetLit() ) return " (lit)"; else return ""; } --- 33,39 ---- if(!(str = item::GetShort()) || str == "") return str; return sprintf("%s%s", str, (GetLit() ? " (lit)" : "")); */ ! if( GetLit() && query_verb() != "light" && query_verb() != "strike") return " (%^BOLD%^YELLOW%^lit%^RESET%^)"; else return ""; } *************** *** 50,61 **** mixed eventDarken() { object env; ! if( env = environment() ) { env->eventPrint("The " + GetKeyName() + " goes dark."); if( living(env) ) { environment(env)->eventPrint(possessive_noun(env) + " " + ! GetKeyName() + " goes dark.", env); } } SetLit(0); --- 50,61 ---- mixed eventDarken() { object env; ! if( env = environment() ) { env->eventPrint("The " + GetKeyName() + " goes dark."); if( living(env) ) { environment(env)->eventPrint(possessive_noun(env) + " " + ! GetKeyName() + " goes dark.", env); } } SetLit(0); diff -c -r --new-file ds1.1/lib/lib/living.c ds2.0r27/lib/lib/living.c *** ds1.1/lib/lib/living.c Sun Dec 6 18:05:46 1998 --- ds2.0r27/lib/lib/living.c Wed Jul 5 00:00:58 2006 *************** *** 1,5 **** /* /lib/living.c ! * from the Dead Souls V Object Library * handles common living code * created by Descartes of Borg 951218 * Version: @(#) living.c 1.29@(#) --- 1,5 ---- /* /lib/living.c ! * from the Dead Souls Object Library * handles common living code * created by Descartes of Borg 951218 * Version: @(#) living.c 1.29@(#) *************** *** 8,13 **** --- 8,14 ---- #include <lib.h> #include <daemons.h> + #include <config.h> #include "include/living.h" inherit LIB_CARRY; *************** *** 41,54 **** } mixed direct_attack_liv() { if( userp(this_player()) && userp(this_object()) ) { ! if( !(int)environment(this_player())->CanAttack(this_object()) ) { ! return "No player killing!"; } } else return 1; } mixed direct_bite_liv() { return 1; } --- 42,85 ---- } mixed direct_attack_liv() { + //tc("got this far."); + //tc("this_player(): "+identify(this_player())); + //tc("this_object(): "+identify(this_object())); + if(PLAYER_KILL) return 1; if( userp(this_player()) && userp(this_object()) ) { ! //tc("further still","green"); ! if( !(int)environment(this_player())->CanAttack(this_object()) ) { ! //tc("Well well well.","blue"); ! return "No player killing!"; } + if(this_player()->GetPK() && this_object()->GetPK()){ + return 1; + } + else return "No PK!"; } else return 1; } + mixed direct_attack_only_liv(){ + return direct_attack_liv(); + } + + mixed direct_attack_liv_only(){ + return direct_attack_liv(); + } + + mixed direct_target_liv(){ + return direct_attack_liv(); + } + + mixed direct_target_only_liv(){ + return direct_attack_liv(); + } + + mixed direct_target_liv_only(){ + return direct_attack_liv(); + } + mixed direct_bite_liv() { return 1; } *************** *** 78,83 **** --- 109,117 ---- return 1; } + mixed direct_resurrect_obj() { return 1; } + mixed indirect_resurrect_obj() { return 1; } + mixed direct_get_obj() { return "You can't get a living thing!"; } *************** *** 113,193 **** mixed direct_give_wrd_wrd_to_liv(string num, string curr) { mixed tmp; int amt; ! if( this_object() == this_player() ) ! return "Are you feeling a bit confused?"; if( (amt = to_int(num)) < 1 ) return "What sort of amount is that?"; tmp = CanCarry(currency_mass(amt, curr)); if( tmp != 1 ) return GetName() + " cannot carry that much "+ curr+ "."; } mixed direct_look_obj() { return 1; } mixed direct_look_at_obj() { return 1; } ! mixed direct_smell_obj() { ! return smell::direct_smell_obj(); } mixed direct_steal_wrd_from_liv(string wrd) { if( wrd != "money" ) return 0; if( this_player() == this_object() ) return "Are you fool?"; ! if( !GetPK() ) return "You cannot act like a jerk today."; ! if( userp(this_object()) && !((int)this_player()->GetPK()) ) ! return "You do not have your player killer flag set."; if( this_player()->GetInCombat() ) ! return "You are too busy fighting at the moment."; return 1; } mixed indirect_steal_obj_from_liv(object item, mixed args...) { mixed tmp; ! if( environment()->GetProperty("no attack") ) ! return "Mystical forces prevent your malice."; if( !item ) return 1; if( environment(item) != this_object() ) return 0; if( this_player() == this_object() ) return "Are you a fool?"; ! if( !GetPK() ) return "You cannot act like a jerk today."; ! if( userp(this_object()) && !((int)this_player()->GetPK()) ) ! return "You do not have your player killer flag set."; if( this_player()->GetInCombat() ) ! return "You are too busy fighting at the moment."; tmp = (mixed)item->CanDrop(this_object()); if( tmp != 1 ) ! return GetName() + " will not let go of " + (string)item->GetShort()+"."; return 1; } mixed direct_backstab_liv() { if( this_object() == this_player() ) ! return "That would be messy."; if( member_array(this_object(), this_player()->GetEnemies()) != -1 ) ! return "%^RED%^You have lost the element of surprise."; if( environment()->GetProperty("no attack") || ! GetProperty("no backstab") ) ! return "A mysterious forces stays your hand."; return 1; } mixed direct_heal_str_of_liv(string limb) { string array limbs = GetLimbs(); mixed tmp; ! limb = lower_case(remove_article(limb)); if( !limbs ) { ! if( this_object() == this_player() ) { return "You have no limbs!"; } ! else { return GetName() + " has no limbs!"; } } else if( member_array(limb, limbs) == -1 ) { ! if( this_object() == this_player() ) { return "You have no " + limb + "."; } ! else { return GetName() + " has no " + limb + "."; } } --- 147,228 ---- mixed direct_give_wrd_wrd_to_liv(string num, string curr) { mixed tmp; int amt; ! if( this_object() == this_player() ) ! return "Are you feeling a bit confused?"; if( (amt = to_int(num)) < 1 ) return "What sort of amount is that?"; tmp = CanCarry(currency_mass(amt, curr)); if( tmp != 1 ) return GetName() + " cannot carry that much "+ curr+ "."; + return 1; } mixed direct_look_obj() { return 1; } mixed direct_look_at_obj() { return 1; } ! mixed direct_smell_obj(object ob, string id) { ! return smell::direct_smell_obj(ob,id); } mixed direct_steal_wrd_from_liv(string wrd) { if( wrd != "money" ) return 0; if( this_player() == this_object() ) return "Are you fool?"; ! //if( !GetPK() ) return "You cannot act like a jerk today."; ! //if( userp(this_object()) && !((int)this_player()->GetPK()) ) ! // return "You do not have your player killer flag set."; if( this_player()->GetInCombat() ) ! return "You are too busy fighting at the moment."; return 1; } mixed indirect_steal_obj_from_liv(object item, mixed args...) { mixed tmp; ! if( environment()->GetProperty("no attack") ) ! return "Mystical forces prevent your malice."; if( !item ) return 1; if( environment(item) != this_object() ) return 0; if( this_player() == this_object() ) return "Are you a fool?"; ! // if( !GetPK() ) return "You cannot act like a jerk today."; ! // if( userp(this_object()) && !((int)this_player()->GetPK()) ) ! // return "You do not have your player killer flag set."; if( this_player()->GetInCombat() ) ! return "You are too busy fighting at the moment."; tmp = (mixed)item->CanDrop(this_object()); if( tmp != 1 ) ! return GetName() + " will not let go of " + (string)item->GetShort()+"."; return 1; } mixed direct_backstab_liv() { if( this_object() == this_player() ) ! return "That would be messy."; if( member_array(this_object(), this_player()->GetEnemies()) != -1 ) ! return "%^RED%^You have lost the element of surprise."; if( environment()->GetProperty("no attack") || ! GetProperty("no backstab") ) ! return "A mysterious forces stays your hand."; return 1; } mixed direct_heal_str_of_liv(string limb) { string array limbs = GetLimbs(); mixed tmp; ! limb = lower_case(remove_article(limb)); if( !limbs ) { ! if( this_object() == this_player() ) { return "You have no limbs!"; } ! else { return GetName() + " has no limbs!"; } } else if( member_array(limb, limbs) == -1 ) { ! if( this_object() == this_player() ) { return "You have no " + limb + "."; } ! else { return GetName() + " has no " + limb + "."; } } *************** *** 198,222 **** return CanReceiveMagic(0, "heal"); } ! mixed direct_remedy_str_of_liv(string limb) { string *limbs; limbs = GetLimbs(); if( !limbs ) { ! if( this_object() == this_player() ) return "You have no limbs!"; ! else return GetName() + " has no limbs!"; } else if( member_array(limb, limbs) == -1 ) { ! if( this_object() == this_player() ) return "You have no " + limb + "."; ! else return GetName() + " has no " + limb + "."; } return CanReceiveMagic(0, "remedy"); } ! mixed direct_regen_str_on_liv(string limb) { if( !limb ) return 0; if( member_array(limb, GetMissingLimbs()) == -1 ) { ! return "That is not a missing limb!"; } return CanReceiveMagic(0, "regen"); } --- 233,257 ---- return CanReceiveMagic(0, "heal"); } ! mixed direct_remedy_str_of_liv(string limb) { string *limbs; limbs = GetLimbs(); if( !limbs ) { ! if( this_object() == this_player() ) return "You have no limbs!"; ! else return GetName() + " has no limbs!"; } else if( member_array(limb, limbs) == -1 ) { ! if( this_object() == this_player() ) return "You have no " + limb + "."; ! else return GetName() + " has no " + limb + "."; } return CanReceiveMagic(0, "remedy"); } ! mixed direct_regen_str_on_liv(string limb) { if( !limb ) return 0; if( member_array(limb, GetMissingLimbs()) == -1 ) { ! return "That is not a missing limb!"; } return CanReceiveMagic(0, "regen"); } *************** *** 224,231 **** mixed direct_teleport_to_liv() { if( environment()->GetProperty("no teleport") || ! environment()->GetProperty("no magic") ) { ! return "Mystical forces prevent your magic."; } else return CanReceiveMagic(0, "teleport"); } --- 259,266 ---- mixed direct_teleport_to_liv() { if( environment()->GetProperty("no teleport") || ! environment()->GetProperty("no magic") ) { ! return "Mystical forces prevent your magic."; } else return CanReceiveMagic(0, "teleport"); } *************** *** 236,244 **** mixed direct_resurrect_liv() { if( this_player() == this_object() ) ! return "You cannot resurrect yourself."; if( !GetUndead() ) ! return GetName() + " is not dead!"; return CanReceiveMagic(0, "resurrect"); } --- 271,279 ---- mixed direct_resurrect_liv() { if( this_player() == this_object() ) ! return "You cannot resurrect yourself."; if( !GetUndead() ) ! return GetName() + " is not dead!"; return CanReceiveMagic(0, "resurrect"); } *************** *** 246,260 **** object env = environment(); if( this_player() == this_object() ) ! return "Scry yourself??"; if( !env ) return GetName() + " is nowhere."; if( env->GetProperty("no magic") || env->GetProperty("no scry") ) ! return GetName() + " is beyond your reach."; return CanReceiveMagic(0, "scry"); } /* hostile spells */ ! int direct_rockwhip_liv() { return CanReceiveMagic(1, "rockwhip"); } int direct_acidspray_liv() { return CanReceiveMagic(1, "acidspray"); } int direct_annihilate_at_liv() { return CanReceiveMagic(1, "annihilate"); } --- 281,300 ---- object env = environment(); if( this_player() == this_object() ) ! return "Scry yourself??"; if( !env ) return GetName() + " is nowhere."; if( env->GetProperty("no magic") || env->GetProperty("no scry") ) ! return GetName() + " is beyond your reach."; return CanReceiveMagic(0, "scry"); } + mixed indirect_zap_liv() { return 1; } + mixed direct_zap_liv() { return 1; } + mixed indirect_pulsecheck_liv() { return 1; } + mixed direct_pulsecheck_liv() { return 1; } + /* hostile spells */ ! int direct_rockwhip_liv() { return CanReceiveMagic(1, "rockwhip"); } int direct_acidspray_liv() { return CanReceiveMagic(1, "acidspray"); } int direct_annihilate_at_liv() { return CanReceiveMagic(1, "annihilate"); } *************** *** 279,287 **** int direct_palm_liv() { return CanReceiveMagic(1, "palm"); } int direct_immolate_liv() { return CanReceiveMagic(1, "immolate"); } int direct_gale_liv() { return CanReceiveMagic(1, "gale"); } ! /* other spells */ ! int direct_aura_liv() { return CanReceiveMagic(0, "aura"); } int direct_soulseek_liv() { return CanReceiveMagic(0, "soulseek"); } int direct_cloak_wrd() { return CanReceiveMagic(0, "cloak"); } --- 319,327 ---- int direct_palm_liv() { return CanReceiveMagic(1, "palm"); } int direct_immolate_liv() { return CanReceiveMagic(1, "immolate"); } int direct_gale_liv() { return CanReceiveMagic(1, "gale"); } ! /* other spells */ ! int direct_aura_liv() { return CanReceiveMagic(0, "aura"); } int direct_soulseek_liv() { return CanReceiveMagic(0, "soulseek"); } int direct_cloak_wrd() { return CanReceiveMagic(0, "cloak"); } *************** *** 313,318 **** --- 353,359 ---- int direct_marry_liv_to_liv() { return 1; } int direct_party_wrd_liv() { return 1; } int direct_challenge_liv() { return 1; } + int direct_ignore_liv() { return 1; } int indirect_throw_obj_at_obj() { return 1; } int indirect_toss_obj_at_obj() { return 1; } *************** *** 320,325 **** --- 361,367 ---- int indirect_sell_obj_to_liv() { return 1; } int indirect_marry_liv_to_liv() { return 1; } + /* ********** /lib/living.c modal methods ********** */ int CanCarry(int amount) { return carry::CanCarry(amount); } *************** *** 341,353 **** mixed CanReceiveMagic(int hostile, string spell) { if( GetProperty(spell) == "immune" ) { ! this_player()->eventPrint(GetName() + " is immune to such magic."); ! return 0; } if( !hostile ) return 1; if( this_player() == this_object() ) { ! eventPrint("That would be construed as quite foolish."); ! return 0; } return 1; } --- 383,395 ---- mixed CanReceiveMagic(int hostile, string spell) { if( GetProperty(spell) == "immune" ) { ! this_player()->eventPrint(GetName() + " is immune to such magic."); ! return 0; } if( !hostile ) return 1; if( this_player() == this_object() ) { ! eventPrint("That would be construed as quite foolish."); ! return 0; } return 1; } *************** *** 357,373 **** if( !env ) "You are nowhere!"; if( spell && GetProperty("no " + spell) ) { ! eventPrint("A mysterious forces prevents you from doing that."); ! return 0; } if( env->GetProperty("no magic") ) { ! eventPrint("Mystical forces prevent your magic."); ! return 0; } if( !hostile ) return 1; if( env->GetProperty("no attack" ) ) { ! eventPrint("Mystical forces prevent your hostile intentions."); ! return 0; } return 1; } --- 399,415 ---- if( !env ) "You are nowhere!"; if( spell && GetProperty("no " + spell) ) { ! eventPrint("A mysterious forces prevents you from doing that."); ! return 0; } if( env->GetProperty("no magic") ) { ! eventPrint("Mystical forces prevent your magic."); ! return 0; } if( !hostile ) return 1; if( env->GetProperty("no attack" ) ) { ! eventPrint("Mystical forces prevent your hostile intentions."); ! return 0; } return 1; } *************** *** 375,381 **** /* ********** /lib/living.c event methods ********** */ mixed eventCure(object who, int amount, string type) { object array germs = filter(all_inventory(), ! (: $1->IsGerm() && $1->GetType()== $(type) :)); if( !sizeof(germs) ) { return GetName() + " suffers from no such affliction."; --- 417,423 ---- /* ********** /lib/living.c event methods ********** */ mixed eventCure(object who, int amount, string type) { object array germs = filter(all_inventory(), ! (: $1->IsGerm() && $1->GetType()== $(type) :)); if( !sizeof(germs) ) { return GetName() + " suffers from no such affliction."; *************** *** 406,413 **** varargs mixed eventShow(object who, string str, string on_id) { who->eventPrint(GetLong(str)); environment(who)->eventPrint((string)this_player()->GetName() + ! " looks at " + GetShort() + ".", ! ({ who, this_object() })); return 1; } --- 448,455 ---- varargs mixed eventShow(object who, string str, string on_id) { who->eventPrint(GetLong(str)); environment(who)->eventPrint((string)this_player()->GetName() + ! " looks at " + GetShort() + ".", ! ({ who, this_object() })); return 1; } *************** *** 416,557 **** */ varargs mixed eventSteal(object who, mixed what, object target, int skill) { ! int i, sr; if( who == this_object() ) { ! mixed tmp; ! int amt, skill2; ! skill2 = GetSkillLevel("stealing")*2.5; ! skill2 += GetMobility(); ! skill2 += GetStatLevel("coordination"); ! skill2 += GetStatLevel("charisma"); ! skill2 += GetStatLevel("luck")/2; ! if( ClassMember("rogue") ) skill2 += (int)GetLevel(); ! ! if( !stringp(what) ) { ! int x; ! ! x = sizeof(what); ! if( GetStaminaPoints() < 20.0*x ) { ! eventPrint("You are clumsy in your fatigue."); ! target->SetAttack(this_object()); ! target->eventExecuteAttack(this_object()); ! return 1; ! } ! AddStaminaPoints(-20); ! ! tmp = (mixed)target->eventSteal(who, what, target,skill2); ! ! /* You can't steal from this target */ ! if( !tmp ) ! return "You cannot steal from " + (string)target->GetName() +"."; ! ! /* Steal from target was succesful */ ! else if( tmp == 1 ) { ! string itstr = ""; ! ! what = filter(what, (: $1 :)); ! AddSkillPoints("stealing", implode(map(what, ! (: $1->GetMass() :)), ! (: $1 + $2 :)) + ! GetSkillLevel("stealing") * GetSkillLevel("stealing")*3); ! AddSkillPoints("stealth", random(sizeof(what)) * 20); ! AddStaminaPoints(-2); ! this_player()->eventPrint(sprintf("You steal %s from %s.", ! "something", (string)target->GetName()) ); ! what->eventMove(this_object()); ! return 1; ! } ! ! /* Steal was unsuccesful */ ! else if( tmp == 2 ) { ! AddSkillPoints("stealing", GetSkillLevel("stealing")*2); ! AddStaminaPoints(-5); ! return 1; ! } ! ! else return tmp; ! } ! /********************************************/ ! /* This part deals with stealing money */ ! ! amt = GetNetWorth(); ! eventPrint("You reach for " + possessive_noun(target) + " money."); ! tmp = (mixed)target->eventSteal(who, what, target, skill2); ! ! /* You can't steal from this target */ ! if( !tmp ) ! return "You cannot steal from " + (string)target->GetName() + "."; ! ! /* Steal from target was succesful */ ! else if( tmp == 1 ) { ! amt = GetNetWorth() - amt; ! if( amt < 1 ) return tmp; ! AddSkillPoints("stealing", random(7*amt) + ! GetSkillLevel("stealing") * GetSkillLevel("stealing") * 2); ! AddSkillPoints("stealth", random(amt)); ! AddStatPoints("coordination", random(amt)); ! AddStaminaPoints(-3); ! eventPrint("You come away with some money!"); ! return tmp; ! } ! ! /* Steal was unsuccesful */ ! else if( tmp == 2) { ! AddSkillPoints("stealing", GetSkillLevel("stealing")*2); ! AddStaminaPoints(-5); ! return 1; ! } ! return tmp; ! } ! /*******************************************************************/ if( GetInCombat() ) { ! who->eventPrint(GetName() + " is busy in combat."); ! return 0; } ! skill -= GetMobility()/2; skill -= GetStatLevel("agility"); ! skill -= GetStatLevel("wisdom"); ! skill -= GetStatLevel("luck")/3; if( objectp(what) ) sr = 100 * sizeof(what); else sr = 100; if( random(sr) > skill ) { ! eventPrint("You notice " + (string)who->GetName() + " trying " ! "to steal from you!"); ! if( !userp(this_object()) ) { ! who->eventPrint("%^RED%^" + (string)GetName() + "%^RED%^ " ! "notices your attempt at treachery!", ! environment(who) ); ! eventForce("attack " + (string)who->GetKeyName()); ! this_object()->SetProperty("steal victim", 1); ! } ! return 2; } if( random(2*sr) > skill ) { ! who->eventPrint("You are unsure if anyone noticed your foolish " ! "attempt at thievery.",environment(who) ); ! return 2; ! } if( stringp(what) ) { ! foreach(string curr in GetCurrencies()) { ! int x; ! if( !(x = random(GetCurrency(curr)/5)) ) continue; ! if( x > 100 ) x = 100; ! x = (x * skill)/100; ! AddCurrency(curr, -x); ! who->AddCurrency(curr, x); ! } ! return 1; } for(i=0; i<sizeof(what); i++) { ! if( (mixed)what[i]->eventSteal(who) != 1 ) what[i] = 0; } return 1; } --- 458,601 ---- */ varargs mixed eventSteal(object who, mixed what, object target, int skill) { ! int i, sr; if( who == this_object() ) { ! mixed tmp; ! int amt, skill2; ! skill2 = to_int(to_float(GetSkillLevel("stealing"))*2.5); ! skill2 += GetMobility(); ! skill2 += GetStatLevel("coordination"); ! skill2 += GetStatLevel("charisma"); ! skill2 += to_int(GetStatLevel("luck")/2); ! if( ClassMember("rogue") ) skill2 += (int)GetLevel(); ! if( ClassMember("thief") ) skill2 += (int)GetLevel(); ! ! if( !stringp(what) ) { ! int x; ! ! x = sizeof(what); ! if( GetStaminaPoints() < 20.0*x ) { ! eventPrint("You are clumsy in your fatigue."); ! if(target->GetRace() != "kender"){ ! target->SetAttack(this_object()); ! target->eventExecuteAttack(this_object()); ! } ! return 1; ! } ! AddStaminaPoints(-20); ! ! tmp = (mixed)target->eventSteal(who, what, target,skill2); ! ! /* You can't steal from this target */ ! if( !tmp ) ! return "You cannot steal from " + (string)target->GetName() +"."; ! ! /* Steal from target was succesful */ ! else if( tmp == 1 ) { ! ! what = filter(what, (: $1 :)); ! AddSkillPoints("stealing", implode(map(what, ! (: $1->GetMass() :)), ! (: $1 + $2 :)) + ! GetSkillLevel("stealing") * GetSkillLevel("stealing")*3); ! AddSkillPoints("stealth", random(sizeof(what)) * 20); ! AddStaminaPoints(-2); ! this_player()->eventPrint(sprintf("You steal %s from %s.", ! "something", (string)target->GetName()) ); ! what->eventMove(this_object()); ! return 1; ! } ! ! /* Steal was unsuccesful */ ! else if( tmp == 2 ) { ! AddSkillPoints("stealing", GetSkillLevel("stealing")*2); ! AddStaminaPoints(-5); ! return 1; ! } ! else return tmp; ! } ! /********************************************/ ! /* This part deals with stealing money */ ! ! amt = GetNetWorth(); ! eventPrint("You reach for " + possessive_noun(target) + " money."); ! tmp = (mixed)target->eventSteal(who, what, target, skill2); ! ! /* You can't steal from this target */ ! if( !tmp ) ! return "You cannot steal from " + (string)target->GetName() + "."; ! ! /* Steal from target was succesful */ ! else if( tmp == 1 ) { ! amt = GetNetWorth() - amt; ! if( amt < 1 ) return tmp; ! AddSkillPoints("stealing", random(7*amt) + ! GetSkillLevel("stealing") * GetSkillLevel("stealing") * 2); ! AddSkillPoints("stealth", random(amt)); ! AddStatPoints("coordination", random(amt)); ! AddStaminaPoints(-3); ! eventPrint("You come away with some money!"); ! return tmp; ! } ! ! /* Steal was unsuccesful */ ! else if( tmp == 2) { ! AddSkillPoints("stealing", GetSkillLevel("stealing")*2); ! AddStaminaPoints(-5); ! return 1; ! } ! ! return tmp; ! } ! /*******************************************************************/ if( GetInCombat() ) { ! who->eventPrint(GetName() + " is busy in combat."); ! return 0; } ! skill -= to_int(GetMobility()/2); skill -= GetStatLevel("agility"); ! skill -= GetStatLevel("wisdom"); ! skill -= to_int(GetStatLevel("luck")/3); if( objectp(what) ) sr = 100 * sizeof(what); else sr = 100; if( random(sr) > skill ) { ! target->eventPrint("You notice " + (string)who->GetName() + " trying " ! "to steal from you!"); ! if( !userp(this_object()) ) { ! who->eventPrint("%^RED%^" + (string)GetName() + "%^RED%^ " ! "notices your attempt at treachery!", ! environment(who) ); ! eventForce("attack " + (string)who->GetKeyName()); ! this_object()->SetProperty("steal victim", 1); ! } ! return 2; } if( random(2*sr) > skill ) { ! who->eventPrint("You are unsure if anyone noticed your foolish " ! "attempt at thievery.",environment(who) ); ! return 2; ! } if( stringp(what) ) { ! foreach(string curr in GetCurrencies()) { ! int x; ! if( !(x = random(GetCurrency(curr)/5)) ) continue; ! if( x > 100 ) x = 100; ! x = (x * skill)/100; ! AddCurrency(curr, -x); ! who->AddCurrency(curr, x); ! } ! return 1; } for(i=0; i<sizeof(what); i++) { ! if( (mixed)what[i]->eventSteal(who) != 1 ) what[i] = 0; } return 1; } *************** *** 561,566 **** --- 605,614 ---- return (currency::GetCurrencyMass() + carry::GetCarriedMass()); } + int GetNonCurrencyMass(){ + return (carry::GetCarriedMass()); + } + int GetMaxCarry() { return combat::GetMaxCarry(); } int SetPK(int x) { return (isPK = x); } diff -c -r --new-file ds1.1/lib/lib/lvs/abilities.c ds2.0r27/lib/lib/lvs/abilities.c *** ds1.1/lib/lib/lvs/abilities.c Sun Feb 1 21:30:11 1998 --- ds2.0r27/lib/lib/lvs/abilities.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/abilities.c ! * From the Dead Souls V LPC Library * Handles learned traits * Created by Descartes of Borg 950122 * Version: @(#) abilities.c 1.22@(#) --- 1,5 ---- /* /lib/abilities.c ! * From the Dead Souls LPC Library * Handles learned traits * Created by Descartes of Borg 950122 * Version: @(#) abilities.c 1.22@(#) *************** *** 60,66 **** int SetLevel(int x) { string array skills = GetPrimarySkills(); - int i; foreach(string skill in skills) { SetSkill(skill, 2*x); --- 60,65 ---- *************** *** 115,121 **** varargs int AddSkill(string skill, int cls) { if( !stringp(skill) ) { error("Bad argument 1 to AddSkill().\n\tExpected: string, Got: " + ! typeof(skill) + "\n"); } if( !nullp(Skills[skill]) ) { return 0; --- 114,120 ---- varargs int AddSkill(string skill, int cls) { if( !stringp(skill) ) { error("Bad argument 1 to AddSkill().\n\tExpected: string, Got: " + ! typeof(skill) + "\n"); } if( !nullp(Skills[skill]) ) { return 0; *************** *** 154,172 **** * sets the skill "skill" to the level "level" * if a classes is given, its class is set to it, otherwise the class is * set to 1 ! * usefule mostly for monster types, probably should have override * protections in the user object (should use AddSkill() for users) */ varargs void SetSkill(string skill, int level, int cls) { if( !stringp(skill) ) { error("Bad argument 1 to SetSkill().\n\tExpected: string, Got: " + ! typeof(skill) + "\n"); } if( !cls ) { ! if( Skills[skill] ) { cls = Skills[skill]["class"]; } ! else { cls = 1; } } --- 153,171 ---- * sets the skill "skill" to the level "level" * if a classes is given, its class is set to it, otherwise the class is * set to 1 ! * useful mostly for monster types, probably should have override * protections in the user object (should use AddSkill() for users) */ varargs void SetSkill(string skill, int level, int cls) { if( !stringp(skill) ) { error("Bad argument 1 to SetSkill().\n\tExpected: string, Got: " + ! typeof(skill) + "\n"); } if( !cls ) { ! if( Skills[skill] ) { cls = Skills[skill]["class"]; } ! else { cls = 1; } } *************** *** 180,185 **** --- 179,188 ---- return keys(Skills); } + mapping GetSkillsMap(){ + return copy(Skills); + } + void AddSkillBonus(string skill, function f) { if( !SkillsBonus[skill] ) { SkillsBonus[skill] = ([]); *************** *** 275,282 **** Skills[name]["points"] = y; } else { ! eventPrint("%^YELLOW%^You are a bit more adept with your " + ! name + "."); Skills[name]["level"]++; Skills[name]["points"] -= y; if( Skills[name]["class"] == 1 ) { --- 278,285 ---- Skills[name]["points"] = y; } else { ! eventPrint("%^YELLOW%^You are a bit more adept with your " + ! name + "."); Skills[name]["level"]++; Skills[name]["points"] -= y; if( Skills[name]["class"] == 1 ) { *************** *** 338,344 **** val = (con - pro + (200*success) + 100)/8; AddSkillPoints(skill, (bonus * val * level * level) + 1); } ! /* ****************** abilities.c driver applies **************** */ static void create() { } --- 341,347 ---- val = (con - pro + (200*success) + 100)/8; AddSkillPoints(skill, (bonus * val * level * level) + 1); } ! /* ****************** abilities.c driver applies **************** */ static void create() { } diff -c -r --new-file ds1.1/lib/lib/lvs/position.c ds2.0r27/lib/lib/lvs/position.c *** ds1.1/lib/lib/lvs/position.c Sun Feb 1 21:30:11 1998 --- ds2.0r27/lib/lib/lvs/position.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/position.c ! * From the Dead Souls V Object Library * Handles the positioning of living things * Created by Descartes of Borg 961221 * Version: @(#) position.c 1.1@(#) --- 1,5 ---- /* /lib/position.c ! * From the Dead Souls Object Library * Handles the positioning of living things * Created by Descartes of Borg 961221 * Version: @(#) position.c 1.1@(#) *************** *** 7,12 **** --- 7,13 ---- */ #include <position.h> + #include <daemons.h> private int Position = POSITION_STANDING; private static object Chair = 0; *************** *** 19,31 **** return Position; } ! static int SetPosition(int x) { Position = x; } mixed eventFall() { send_messages("fall", "$agent_name $agent_verb to the ground.", ! this_object(), 0, environment()); Position = POSITION_LYING; return 1; } --- 20,32 ---- return Position; } ! int SetPosition(int x) { Position = x; } mixed eventFall() { send_messages("fall", "$agent_name $agent_verb to the ground.", ! this_object(), 0, environment()); Position = POSITION_LYING; return 1; } *************** *** 33,76 **** varargs mixed eventLay(object target) { mixed tmp; ! if( Position != POSITION_STANDING ) { ! eventPrint("You must be standing in order to lie."); return 1; } if( !target ) { ! send_messages("lay", "$agent_name $agent_verb down.", this_object(), ! 0, environment()); Position = POSITION_LYING; return 1; } tmp = target->eventReceiveLay(this_object()); if( tmp != 1 ) { if( !tmp ) { ! eventPrint("You cannot lay there!"); } else { eventPrint(tmp); } return 1; } ! send_messages("lay", "$agent_name $agent_verb down on " + ! target->GetShort() + ".", this_object(), 0, environment()); Position = POSITION_LYING; Chair = target; return 1; ! } varargs mixed eventSit(object target) { mixed tmp; ! if( Position != POSITION_STANDING ) { ! eventPrint("You must be standing in order to sit!"); return 1; } if( !target ) { ! send_messages("sit", "$agent_name $agent_verb down.", this_object(), ! 0, environment()); Position = POSITION_SITTING; return 1; } --- 34,83 ---- varargs mixed eventLay(object target) { mixed tmp; ! if( Position != POSITION_STANDING && Position != POSITION_SITTING) { ! eventPrint("You must be standing or sitting in order to lie."); return 1; } if( !target ) { ! send_messages("lie", "$agent_name $agent_verb down.", this_object(), ! 0, environment()); Position = POSITION_LYING; return 1; } tmp = target->eventReceiveLay(this_object()); if( tmp != 1 ) { if( !tmp ) { ! eventPrint("You cannot lie there!"); } else { eventPrint(tmp); } return 1; } ! send_messages("lie", "$agent_name $agent_verb down on " + ! target->GetShort() + ".", this_object(), 0, environment()); Position = POSITION_LYING; Chair = target; return 1; ! } varargs mixed eventSit(object target) { mixed tmp; ! if( Position != POSITION_STANDING && Position != POSITION_LYING ) { ! //eventPrint("You must be standing in order to sit!"); ! eventPrint("You can't sit from that position."); return 1; } if( !target ) { ! if( Position == POSITION_STANDING) { ! send_messages("sit", "$agent_name $agent_verb down.", ! this_object(),0, environment()); ! } ! else send_messages("sit", "$agent_name $agent_verb up.", ! this_object(),0, environment()); ! Position = POSITION_SITTING; return 1; } *************** *** 85,101 **** return 1; } send_messages("sit", "$agent_name $agent_verb down on " + ! target->GetShort() + ".", this_object(), 0, environment()); Position = POSITION_SITTING; Chair = target; return 1; } mixed eventStand() { if( Position == POSITION_STANDING ) { eventPrint("You are already standing!"); return 1; } if( Chair ) { mixed tmp = Chair->eventReleaseStand(this_object()); --- 92,136 ---- return 1; } send_messages("sit", "$agent_name $agent_verb down on " + ! target->GetShort() + ".", this_object(), 0, environment()); Position = POSITION_SITTING; Chair = target; return 1; } + mixed eventFly(){ + write("You lift up off the ground."); + say(this_player()->GetName()+" begins flying and rises up off the ground."); + Position = POSITION_FLYING; + return 1; + } + + mixed eventLand(){ + if(! Position == POSITION_FLYING ) return 0; + write("You stop flying and land gracefully."); + say(this_player()->GetName()+" stops flying and lands gracefully."); + if(stringp(hobbled(this_player()))) Position = POSITION_STANDING; + else Position = POSITION_LYING; + return 1; + } + mixed eventStand() { + if(!stringp(hobbled(this_player()))){ + eventPrint("Your injuries prevent you from standing."); + return 1; + } + if(RACES_D->GetLimblessRace(this_player()->GetRace()) ){ + eventPrint("You aren't endowed with limbs with which to stand."); + return 1; + } if( Position == POSITION_STANDING ) { eventPrint("You are already standing!"); return 1; } + if( Position == POSITION_FLYING){ + return eventLand(); + } + if( Chair ) { mixed tmp = Chair->eventReleaseStand(this_object()); *************** *** 112,117 **** } Position = POSITION_STANDING; send_messages("stand", "$agent_name $agent_verb up.", this_object(), 0, ! environment()); return 1; } --- 147,160 ---- } Position = POSITION_STANDING; send_messages("stand", "$agent_name $agent_verb up.", this_object(), 0, ! environment()); return 1; } + + object GetFurniture(){ + if(Chair) return Chair; + } + string GetFurnitureName(){ + if(Chair) return Chair->GetShort(); + else return "none"; + } diff -c -r --new-file ds1.1/lib/lib/magic.c ds2.0r27/lib/lib/magic.c *** ds1.1/lib/lib/magic.c Sun Feb 1 21:30:27 1998 --- ds2.0r27/lib/lib/magic.c Wed Jul 5 00:00:58 2006 *************** *** 96,102 **** if( spell->GetAutoHeal() == 0 ) { if( !sizeof(args) ) { object array existing = filter(targets, (: $1 :)); ! if( sizeof(existing) != 1 ) { error("This spell was poorly constructed."); } --- 96,102 ---- if( spell->GetAutoHeal() == 0 ) { if( !sizeof(args) ) { object array existing = filter(targets, (: $1 :)); ! if( sizeof(existing) != 1 ) { error("This spell was poorly constructed."); } *************** *** 127,144 **** send_to = 0; } send_messages(({ "close", "begin" }), ! "$agent_name $agent_verb $agent_possessive eyes and " ! "$agent_verb uttering " + special + ".", this_object(), ! send_to, environment()); type = spell->GetSpellType(); if( GetInCombat() || (type == SPELL_COMBAT) ) { if( type == SPELL_COMBAT ) { SetAttack(targets, (: eventCast($(spell), $(arg), $(targets)) :), ! ROUND_MAGIC); } else { SetAttack(0, (: eventCast($(spell), $(arg), $(targets)) :), ! ROUND_MAGIC); } } else { --- 127,144 ---- send_to = 0; } send_messages(({ "close", "begin" }), ! "$agent_name $agent_verb $agent_possessive eyes and " ! "$agent_verb uttering " + special + ".", this_object(), ! send_to, environment()); type = spell->GetSpellType(); if( GetInCombat() || (type == SPELL_COMBAT) ) { if( type == SPELL_COMBAT ) { SetAttack(targets, (: eventCast($(spell), $(arg), $(targets)) :), ! ROUND_MAGIC); } else { SetAttack(0, (: eventCast($(spell), $(arg), $(targets)) :), ! ROUND_MAGIC); } } else { *************** *** 149,155 **** static varargs void eventCast(object spell, string limb, object array targs) { string name = spell->GetSpell(); ! if( SpellBook[name] < 100 ) { eventTrainSpell(spell); } --- 149,155 ---- static varargs void eventCast(object spell, string limb, object array targs) { string name = spell->GetSpell(); ! if( SpellBook[name] < 100 ) { eventTrainSpell(spell); } *************** *** 175,181 **** static void eventTrainSpell(object spell) { string name = spell->GetSpell(); int x = SpellBook[name] + 1; ! foreach(string skill in spell->GetSkills() ) { if( (5 * GetSkillLevel(skill)) < x ) { return; --- 175,181 ---- static void eventTrainSpell(object spell) { string name = spell->GetSpell(); int x = SpellBook[name] + 1; ! foreach(string skill in spell->GetSkills() ) { if( (5 * GetSkillLevel(skill)) < x ) { return; diff -c -r --new-file ds1.1/lib/lib/manycoins.c ds2.0r27/lib/lib/manycoins.c *** ds1.1/lib/lib/manycoins.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/manycoins.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,15 ---- + #include <lib.h> + #include <daemons.h> + + int x; + int y; + int copper,cents,silver,electrum,gold,dollars,platinum; + int PutCoins(object who); + + int Payment(object who, int value) { + return 1; + } + + int PutCoins(object who) { + return 1; + } diff -c -r --new-file ds1.1/lib/lib/match.c ds2.0r27/lib/lib/match.c *** ds1.1/lib/lib/match.c Sun Feb 1 21:30:19 1998 --- ds2.0r27/lib/lib/match.c Wed Jul 5 00:00:58 2006 *************** *** 1,5 **** /* /lib/match.c ! * from the Dead Souls V Object Library * an object which can be self-induced to burn * created by Descartes of Borg 960512 */ --- 1,5 ---- /* /lib/match.c ! * from the Dead Souls Object Library * an object which can be self-induced to burn * created by Descartes of Borg 960512 */ *************** *** 21,33 **** if( !GetFuelAmount() || StrikeChance < random(100) || !eventBurn(who) ) { who->eventPrint("You strike " + GetShort() + ", but nothing happens."); environment(who)->eventPrint((string)who->GetName() + " stikes " + ! GetShort() + ", but nothing happens.", ! who); return 1; } who->eventPrint("You strike " + GetShort() + " and it ignites!"); environment(who)->eventPrint((string)who->GetName() + " strikes " + ! GetShort() + " and it ignites!", who); return 1; } --- 21,33 ---- if( !GetFuelAmount() || StrikeChance < random(100) || !eventBurn(who) ) { who->eventPrint("You strike " + GetShort() + ", but nothing happens."); environment(who)->eventPrint((string)who->GetName() + " stikes " + ! GetShort() + ", but nothing happens.", ! who); return 1; } who->eventPrint("You strike " + GetShort() + " and it ignites!"); environment(who)->eventPrint((string)who->GetName() + " strikes " + ! GetShort() + " and it ignites!", who); return 1; } diff -c -r --new-file ds1.1/lib/lib/mayor.c ds2.0r27/lib/lib/mayor.c *** ds1.1/lib/lib/mayor.c Sun Feb 1 21:30:27 1998 --- ds2.0r27/lib/lib/mayor.c Wed Jul 5 00:00:58 2006 *************** *** 1,5 **** /* /lib/mayor.c ! * From the Dead Souls V Object Library * Allows players to change their residence on the mud * Created by Descartes of Borg 961019 * Version: @(#) mayor.c 1.3@(#) --- 1,5 ---- /* /lib/mayor.c ! * From the Dead Souls Object Library * Allows players to change their residence on the mud * Created by Descartes of Borg 961019 * Version: @(#) mayor.c 1.3@(#) *************** *** 18,34 **** static void create() { sentient::create(); SetRequestResponses(([ "citizenship" : (: EvaluateCitizenshipRequest :), ! "help" : (: eventForce("speak You can request " ! "citizenship from me.") :) ])); } mixed CanRequestCitizenship(object who) { if( Tax > 0 ) { ! int cost = (currency_rate(LocalCurrency) * Tax); ! if( who->GetCurrency(LocalCurrency) < cost ) { ! eventForce("speak we have a new citizen tax of " + Tax + " " + ! LocalCurrency + "."); return 0; } } --- 18,34 ---- static void create() { sentient::create(); SetRequestResponses(([ "citizenship" : (: EvaluateCitizenshipRequest :), ! "help" : (: this_object()->eventForce("say You can request " ! "citizenship from me.") :) ])); } mixed CanRequestCitizenship(object who) { if( Tax > 0 ) { ! int cost = (Tax); ! if( who->GetCurrency(LocalCurrency) < cost ) { ! this_object()->eventForce("say I'm sorry, but we have a new citizen tax of " + Tax + " " + ! LocalCurrency + "."); return 0; } } *************** *** 42,55 **** object array homies = filter(users(), (: $1->GetTown() == GetTown() :)); homies->eventPrint(who->GetName() + " is now a citizen of " + GetTown() + ! "."); who->SetTown(GetTown()); who->eventPrint("You are now a citizen of " + GetTown() + "."); if( Tax > 0 ) { ! int cost = (currency_rate(LocalCurrency) * Tax); ! who->AddCurrency(LocalCurrency, -cost); ! AddCurrency(LocalCurrency, cost); } return 1; } --- 42,56 ---- object array homies = filter(users(), (: $1->GetTown() == GetTown() :)); homies->eventPrint(who->GetName() + " is now a citizen of " + GetTown() + ! "."); who->SetTown(GetTown()); who->eventPrint("You are now a citizen of " + GetTown() + "."); if( Tax > 0 ) { ! int cost = Tax; ! who->AddCurrency(LocalCurrency, -cost); ! this_object()->AddCurrency(LocalCurrency, cost); ! this_object()->eventForce("say Congratulations, citizen!"); } return 1; } *************** *** 58,65 **** mixed tmp = CanRequestCitizenship(this_player()); if( tmp != 1 ) { ! if( !tmp ) { ! eventForce("speak Your request is denied."); } else { this_player()->eventPrint(tmp); --- 59,66 ---- mixed tmp = CanRequestCitizenship(this_player()); if( tmp != 1 ) { ! if( !tmp || tmp == 0 ) { ! this_object()->eventForce("say Your request is denied."); } else { this_player()->eventPrint(tmp); diff -c -r --new-file ds1.1/lib/lib/meal.c ds2.0r27/lib/lib/meal.c *** ds1.1/lib/lib/meal.c Sun Feb 1 21:30:10 1998 --- ds2.0r27/lib/lib/meal.c Wed Jul 5 00:00:58 2006 *************** *** 5,25 **** * Version: @(#) meal.c 1.3@(#) * Last modified: 97/01/03 */ ! #include <lib.h> #include <function.h> #include <meal_types.h> #include <rounds.h> #include <vendor_types.h> #include "include/meal.h" ! inherit LIB_BAIT_WITH; inherit LIB_ITEM; ! private int MealStrength, MealType; private string EmptyItem, EmptyName, OtherMessage; private mixed EmptyShort, EmptyLong, MyMessage; ! static void create() { item::create(); MealType = MEAL_ALCOHOL; --- 5,25 ---- * Version: @(#) meal.c 1.3@(#) * Last modified: 97/01/03 */ ! #include <lib.h> #include <function.h> #include <meal_types.h> #include <rounds.h> #include <vendor_types.h> #include "include/meal.h" ! inherit LIB_BAIT_WITH; inherit LIB_ITEM; ! private int MealStrength, MealType; private string EmptyItem, EmptyName, OtherMessage; private mixed EmptyShort, EmptyLong, MyMessage; ! static void create() { item::create(); MealType = MEAL_ALCOHOL; *************** *** 60,181 **** mixed eventDrink(object who) { mixed tmp; int x; ! if( (tmp = (mixed)who->eventDrink(this_object())) != 1 ) return tmp; if( (x = functionp(MyMessage)) && !(x & FP_OWNER_DESTED) ) { evaluate(MyMessage, who); } else { ! string mymsg, othermsg; ! ! mymsg = replace_string(MyMessage, "$P", "your"); ! othermsg = replace_string(OtherMessage, "$P", possessive(who)); ! mymsg = replace_string(mymsg, "$N", "you"); ! othermsg = replace_string(othermsg, "$N", (string)who->GetName()); ! who->eventPrint( capitalize(mymsg) ); ! environment(who)->eventPrint( capitalize(othermsg), who ); } if( GetEmptyItem() ) { ! object ob; ! ! ob = new(GetEmptyItem() || LIB_ITEM); ! if( base_name(ob) == LIB_ITEM ) { ! ob->SetKeyName(GetEmptyName()); ! ob->SetId( ({ GetEmptyName(), "container", "empty container" }) ); ! ob->SetShort(GetEmptyShort()); ! ob->SetLong(GetEmptyLong()); ! ob->SetValue(10); ! ob->SetMass(100); ! ob->SetDestroyOnSell(); ! } ! if( !((int)ob->eventMove(who)) ) { ! who->eventPrint("You drop " + (string)ob->GetShort() + "."); ! environment(who)->eventPrint((string)who->GetName() + ! " drops " + (string)ob->GetShort() + ".", who); ! ob->eventMove(environment(who)); ! } } if( x = GetPoison() ) { ! if( random((int)who->GetStatLevel("luck")) > 35 ) ! who->eventPrint("That didn't seem to taste quite right."); ! who->AddPoison(x); } Destruct(); return 1; } ! mixed eventEat(object who) { mixed tmp; int x; ! if( (tmp = (mixed)who->eventEat(this_object())) != 1 ) return tmp; if( (x = functionp(MyMessage)) && !(x & FP_OWNER_DESTED) ) { evaluate(MyMessage, who); } else { ! string mymsg, othermsg; ! ! mymsg = replace_string(MyMessage, "$P", "your"); ! othermsg = replace_string(OtherMessage, "$P", ! possessive(who)); ! mymsg = replace_string(mymsg, "$N", "you"); ! othermsg = replace_string(othermsg, "$N", (string)who->GetName()); ! who->eventPrint( capitalize(mymsg) ); ! environment(who)->eventPrint( capitalize(othermsg), who ); } if( x = GetPoison() ) { ! if( random((int)who->GetStatLevel("luck")) > 35 ) ! who->eventPrint("You notice a strange aftertaste."); ! who->AddPoison(x); } Destruct(); return 1; } ! int eventPoison(object who, object agent, int x) { who->eventPrint("You put some poison " ! "in " + add_article(GetShort()) + "."); environment(who)->eventPrint( (string)who->GetName()+" puts something " ! "in " + add_article(GetShort()) + ".", who); AddPoison(x); return 1; } ! string SetEmptyItem(string file) { return (EmptyItem = file); } ! string GetEmptyItem() { return EmptyItem; } ! string SetEmptyName(string str) { return (EmptyName = str); } ! string GetEmptyName() { return EmptyName; } ! mixed SetEmptyShort(mixed val) { return (EmptyShort = val); } ! mixed GetEmptyShort() { return EmptyShort; } ! mixed SetEmptyLong(mixed val) { return (EmptyLong = val); } ! mixed GetEmptyLong() { return EmptyLong; } ! int SetMealType(int x) { int vt = 0; ! if( x & MEAL_FOOD ) { ! vt |= VT_FOOD; ! MyMessage = "You eat your food."; ! OtherMessage = "$N eats $P food."; } if( x & MEAL_DRINK ) vt |= VT_DRINK; SetVendorType(vt); return (MealType = x); } ! int GetMealType() { return MealType; } ! int SetStrength(int x) { return (MealStrength = x); } ! int GetStrength() { return MealStrength; } ! varargs void SetMealMessages(mixed array val...) { if( !arrayp(val) ) { error(sprintf("Bad argument 1 to SetMealMessages(): %O\n", val)); --- 60,181 ---- mixed eventDrink(object who) { mixed tmp; int x; ! if( (tmp = (mixed)who->eventDrink(this_object())) != 1 ) return tmp; if( (x = functionp(MyMessage)) && !(x & FP_OWNER_DESTED) ) { evaluate(MyMessage, who); } else { ! string mymsg, othermsg; ! ! mymsg = replace_string(MyMessage, "$P", "your"); ! othermsg = replace_string(OtherMessage, "$P", possessive(who)); ! mymsg = replace_string(mymsg, "$N", "you"); ! othermsg = replace_string(othermsg, "$N", (string)who->GetName()); ! who->eventPrint( capitalize(mymsg) ); ! environment(who)->eventPrint( capitalize(othermsg), who ); } if( GetEmptyItem() ) { ! object ob; ! ! ob = new(GetEmptyItem() || LIB_ITEM); ! if( base_name(ob) == LIB_ITEM ) { ! ob->SetKeyName(GetEmptyName()); ! ob->SetId( ({ GetEmptyName(), "container", "empty container" }) ); ! ob->SetShort(GetEmptyShort()); ! ob->SetLong(GetEmptyLong()); ! ob->SetValue(10); ! ob->SetMass(100); ! ob->SetDestroyOnSell(); ! } ! if( !((int)ob->eventMove(who)) ) { ! who->eventPrint("You drop " + (string)ob->GetShort() + "."); ! environment(who)->eventPrint((string)who->GetName() + ! " drops " + (string)ob->GetShort() + ".", who); ! ob->eventMove(environment(who)); ! } } if( x = GetPoison() ) { ! if( random((int)who->GetStatLevel("luck")) > 35 ) ! who->eventPrint("That didn't seem to taste quite right."); ! who->AddPoison(x); } Destruct(); return 1; } ! mixed eventEat(object who) { mixed tmp; int x; ! if( (tmp = (mixed)who->eventEat(this_object())) != 1 ) return tmp; if( (x = functionp(MyMessage)) && !(x & FP_OWNER_DESTED) ) { evaluate(MyMessage, who); } else { ! string mymsg, othermsg; ! ! mymsg = replace_string(MyMessage, "$P", "your"); ! othermsg = replace_string(OtherMessage, "$P", ! possessive(who)); ! mymsg = replace_string(mymsg, "$N", "you"); ! othermsg = replace_string(othermsg, "$N", (string)who->GetName()); ! who->eventPrint( capitalize(mymsg) ); ! environment(who)->eventPrint( capitalize(othermsg), who ); } if( x = GetPoison() ) { ! if( random((int)who->GetStatLevel("luck")) > 35 ) ! who->eventPrint("You notice a strange aftertaste."); ! who->AddPoison(x); } Destruct(); return 1; } ! int eventPoison(object who, object agent, int x) { who->eventPrint("You put some poison " ! "in " + add_article(GetShort()) + "."); environment(who)->eventPrint( (string)who->GetName()+" puts something " ! "in " + add_article(GetShort()) + ".", who); AddPoison(x); return 1; } ! string SetEmptyItem(string file) { return (EmptyItem = file); } ! string GetEmptyItem() { return EmptyItem; } ! string SetEmptyName(string str) { return (EmptyName = str); } ! string GetEmptyName() { return EmptyName; } ! mixed SetEmptyShort(mixed val) { return (EmptyShort = val); } ! mixed GetEmptyShort() { return EmptyShort; } ! mixed SetEmptyLong(mixed val) { return (EmptyLong = val); } ! mixed GetEmptyLong() { return EmptyLong; } ! int SetMealType(int x) { int vt = 0; ! if( x & MEAL_FOOD ) { ! vt |= VT_FOOD; ! MyMessage = "You eat your food."; ! OtherMessage = "$N eats $P food."; } if( x & MEAL_DRINK ) vt |= VT_DRINK; SetVendorType(vt); return (MealType = x); } ! int GetMealType() { return MealType; } ! int SetStrength(int x) { return (MealStrength = x); } ! int GetStrength() { return MealStrength; } ! varargs void SetMealMessages(mixed array val...) { if( !arrayp(val) ) { error(sprintf("Bad argument 1 to SetMealMessages(): %O\n", val)); *************** *** 184,205 **** if( arrayp(val[0]) ) SetMealMessages(val[0]...); else if( stringp(val[0]) || functionp(val[0]) ) MyMessage = val[0]; else error(sprintf("Bad argument 1 to SetMealMessages(): %O\n", ! val[0])); return; } if( !stringp(val[0]) ) ! error(sprintf("Bad argument 1 to SetMealMessages(): %O\n", val[0])); else if( !stringp(val[1]) ) ! error(sprintf("Bad argument 2 to SetMealMessages(): %O\n", val[1])); MyMessage = val[0]; OtherMessage = val[1]; } ! mixed *GetMealMessages() { return ({ MyMessage, OtherMessage }); } ! int GetValue() { int x; ! x = GetStrength(); return (x * (6 + x)) / 10 + 10; } --- 184,205 ---- if( arrayp(val[0]) ) SetMealMessages(val[0]...); else if( stringp(val[0]) || functionp(val[0]) ) MyMessage = val[0]; else error(sprintf("Bad argument 1 to SetMealMessages(): %O\n", ! val[0])); return; } if( !stringp(val[0]) ) ! error(sprintf("Bad argument 1 to SetMealMessages(): %O\n", val[0])); else if( !stringp(val[1]) ) ! error(sprintf("Bad argument 2 to SetMealMessages(): %O\n", val[1])); MyMessage = val[0]; OtherMessage = val[1]; } ! mixed *GetMealMessages() { return ({ MyMessage, OtherMessage }); } ! int GetValue() { int x; ! x = GetStrength(); return (x * (6 + x)) / 10 + 10; } diff -c -r --new-file ds1.1/lib/lib/messages.c ds2.0r27/lib/lib/messages.c *** ds1.1/lib/lib/messages.c Sun Feb 1 21:30:19 1998 --- ds2.0r27/lib/lib/messages.c Wed Jul 5 00:00:58 2006 *************** *** 1,5 **** /* /lib/messages.c ! * from the Dead Soulsr1 Object Library * handles special messages such as leaving, coming, saying, etc. * created by Descartes of Borg 950428 */ --- 1,5 ---- /* /lib/messages.c ! * from the Dead Souls Object Library * handles special messages such as leaving, coming, saying, etc. * created by Descartes of Borg 950428 */ *************** *** 20,30 **** string SetMessage(string msg, string str) { if(!stringp(msg) || !stringp(str)) error("Bad argument to SetMessage()."); switch(msg) { ! case "come": case "leave": case "telin": case "telout": case "home": ! case "say": case "ask": case "exclaim": case "login": case "logout": ! case "dest": case "clone": ! return (Messages[msg] = str); ! default: return 0; } } --- 20,30 ---- string SetMessage(string msg, string str) { if(!stringp(msg) || !stringp(str)) error("Bad argument to SetMessage()."); switch(msg) { ! case "come": case "leave": case "telin": case "telout": case "home": ! case "say": case "ask": case "exclaim": case "login": case "logout": ! case "dest": case "clone": ! return (Messages[msg] = str); ! default: return 0; } } *************** *** 34,50 **** if( !stringp(msg) ) return 0; if( !(tmp = Messages[msg]) ) return 0; switch(msg) { ! case "dest": case "clone": ! tmp = replace_string(tmp, "$O", (string)arg->GetShort()); ! break; ! case "leave": ! if(strsrch(arg, "$N") == -1) tmp = replace_string(tmp, "$D", arg); ! else tmp = arg; ! break; ! case "say": case "ask": case "exclaim": return tmp; ! case "login": case "logout": ! tmp = replace_string(tmp, "$M", mud_name()); ! break; } if(strsrch(tmp, "$N") == -1) tmp = "$N "+tmp; return capitalize(replace_string(tmp, "$N", GetName())); --- 34,50 ---- if( !stringp(msg) ) return 0; if( !(tmp = Messages[msg]) ) return 0; switch(msg) { ! case "dest": case "clone": ! tmp = replace_string(tmp, "$O", (string)arg->GetShort()); ! break; ! case "leave": ! if(strsrch(arg, "$N") == -1) tmp = replace_string(tmp, "$D", arg); ! else tmp = arg; ! break; ! case "say": case "ask": case "exclaim": return tmp; ! case "login": case "logout": ! tmp = replace_string(tmp, "$M", mud_name()); ! break; } if(strsrch(tmp, "$N") == -1) tmp = "$N "+tmp; return capitalize(replace_string(tmp, "$N", GetName())); diff -c -r --new-file ds1.1/lib/lib/money.c ds2.0r27/lib/lib/money.c *** ds1.1/lib/lib/money.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/money.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,27 ---- + #include <lib.h> + mapping Money = ([]); + + int AddMoney(string type, int amount) { + object pile; + pile = new(LIB_BLANK_PILE); + pile->SetPile(type,amount); + pile->eventMove(this_object()); + Money[type] = amount; + return 1; + } + + varargs void SetMoney(mixed val, int amount) { + if( stringp(val) ) AddMoney(val, amount); + else if( mapp(val) ) { + string *currs; + int i; + i = sizeof(currs = keys(val)); + while(i--) { + AddMoney(currs[i], val[currs[i]]); + Money[currs[i]] = val[currs[i]]; + } + } + else error("Bad argument 1 to SetMoney()."); + } + + mapping GetMoneyMap() { return copy(Money); } diff -c -r --new-file ds1.1/lib/lib/nmsh.c ds2.0r27/lib/lib/nmsh.c *** ds1.1/lib/lib/nmsh.c Sun Feb 1 21:30:11 1998 --- ds2.0r27/lib/lib/nmsh.c Wed Jul 5 00:00:58 2006 *************** *** 14,27 **** inherit LIB_HISTORY; #define DIRECTORY_STACK_SIZE 5 ! #define MAX_CMD_ALIASES 60 private string CurrentWorkingDirectory; private mapping Nicknames, Aliases, Xverbs; private static int CWDCount, CWDBottom, CWDTop, CmdNumber; private static string Prompt, CommandFail; private static string *Stack; ! static void create() { history::create(); Nicknames = ([]); --- 14,28 ---- inherit LIB_HISTORY; #define DIRECTORY_STACK_SIZE 5 ! #define MAX_CMD_ALIASES 128 private string CurrentWorkingDirectory; + private string PreviousWorkingDirectory; private mapping Nicknames, Aliases, Xverbs; private static int CWDCount, CWDBottom, CWDTop, CmdNumber; private static string Prompt, CommandFail; private static string *Stack; ! static void create() { history::create(); Nicknames = ([]); *************** *** 29,39 **** "n" : "go north", "s" : "go south", "e" : "go east", "w" : "go west", "ne" : "go northeast", "nw" : "go northwest", "se" : "go southeast", "sw" : "go southwest", "d" : "go down", "u" : "go up", "out": "go out", ! "exa" : "look at $*", ]); ! Xverbs = ([ "'" : "say $*", ":" : "emote $*" ]); } ! int Setup() { if(this_player() != this_object()) return 0; reset_prompt(); --- 30,47 ---- "n" : "go north", "s" : "go south", "e" : "go east", "w" : "go west", "ne" : "go northeast", "nw" : "go northwest", "se" : "go southeast", "sw" : "go southwest", "d" : "go down", "u" : "go up", "out": "go out", ! "exa" : "look at $*", "p" : "people", "sc" : "status", "inf" : "score", ! "eq" : "inventory", "where" : "people", "prac" : "skills", ! "practice" : "skills", "trophy" : "kills", ! "northwest" : "go northwest", "northeast" : "go northeast", ! "southwest" : "go southwest", "southeast" : "go southeast", ! "north" : "go north", "south": "go south", "east" : "go east", ! "west" : "go west", "up" : "go up", "down": "go down", ! "ig" : "intergossip $*", "c" : "cre $*", "lp" : "lpuni $*" ]); ! Xverbs = (["'":"say $*",":":"emote $*","\"":"say $*",]); } ! int Setup() { if(this_player() != this_object()) return 0; reset_prompt(); *************** *** 43,194 **** add_action("cmd_alias", "alias"); add_action("cmd_nickname", "nickname"); if(creatorp(this_object())) { ! Stack = allocate(DIRECTORY_STACK_SIZE); ! CWDBottom = CWDTop = CWDCount = 0; ! add_action("cmd_cd", "cd"); ! add_action("cmd_nmsh", "nmsh"); ! add_action("cmd_pushd", "pushd"); ! add_action("cmd_popd", "popd"); ! add_action("cmd_pwd", "cwd"); ! add_action("cmd_pwd", "pwd"); ! add_action("cmd_work", "work"); } return 1; } ! nomask static int cmd_alias(string str) { string *a, *b; string key, thing; int i; ! if(this_player() != this_object()) return 0; if(!str) { ! i = sizeof(a = keys(Aliases)); ! while(i--) ! a[i] = sprintf("%s%s", arrange_string(a[i],15),Aliases[a[i]]); ! i = sizeof(b = keys(Xverbs)); ! while(i--) ! b[i] = sprintf("$%s%s", arrange_string(b[i],14), Xverbs[b[i]]); ! this_player()->eventPage(a+b); ! return 1; } if(sscanf(str, "%s %s", key, thing) != 2) { ! if(str[0] == '$') { ! str = str[1..strlen(str)-1]; ! if(Xverbs[str]) { ! map_delete(Xverbs, str); ! message("system", sprintf("Alias $%s removed.", str), this_player()); ! } ! else message("system", sprintf("No such alias $%s.", str), this_player()); ! return 1; ! } ! if(Aliases[str]) { ! map_delete(Aliases, str); ! message("system", sprintf("Alias %s removed.", str), this_player()); ! } ! else message("system", sprintf("No such alias %s.", str), this_player()); ! return 1; } if(sizeof(Xverbs) + sizeof(Aliases) >= MAX_CMD_ALIASES) { ! message("system", "You must remove an alias before adding another.", ! this_player()); ! return 1; } if(key == "alias") return notify_fail("You are a bonehead.\n"); if(key[0] == '$') { ! key = key[1..strlen(key)]; ! if(Xverbs[key]) ! message("system", sprintf("Alias for $%s altered to (%s).", ! key, thing), this_player()); ! else message("system", sprintf("Alias $%s (%s) added.", key, thing), ! this_player()); ! Xverbs[key] = thing; } else { ! if(Aliases[key]) ! message("system", sprintf("Alias for %s altered to (%s).", key, thing), ! this_player()); ! else message("system", sprintf("Alias %s (%s) added.", key, thing),this_player()); ! Aliases[key] = thing; } return 1; } ! nomask static int cmd_cd(string str) { if(this_player() != this_object()) return 0; set_cwd(str); return 1; } ! nomask static int cmd_nickname(string str) { string *cles; string key, thing; int i; ! if(this_player() != this_object()) return 0; if(!str) { ! i = sizeof(cles = keys(Nicknames)); ! while(i--) ! cles[i] = sprintf("%s%s", arrange_string(cles[i], 15), ! Nicknames[cles[i]]); ! this_player()->eventPage(cles); ! return 1; } if(sscanf(str, "%s %s", key, thing) != 2) { ! if(Nicknames[str]) { ! message("system", sprintf("Nickname %s removed.", str), ! this_player()); ! map_delete(Nicknames, str); ! } ! else message("system", sprintf("No such nickname %s.", str), ! this_player()); } else { ! if(Nicknames[key]) ! message("system", sprintf("Nickname %s altered to (%s).", key, thing), ! this_player()); ! else message("system", sprintf("Nickname %s (%s) added.", key, thing), ! this_player()); ! Nicknames[key] = thing; } return 1; } ! nomask static int cmd_nmsh(string str) { string *lines; string tmp; int i, maxi; ! if(!str) return 0; if(this_player() != this_object()) return 0; if((int)this_player()->GetForced()) return 0; if(!(tmp = read_file(absolute_path(query_cwd(), str)))) ! return notify_fail(sprintf("nmsh: script %s not found.\n")); maxi = sizeof(lines = explode(tmp, "\n")); for(i=0; i < maxi; i++) { ! if(lines[i][0] == '#') continue; ! if(!command(lines[i])) { ! message("system", sprintf("nmsh: error in executing %s.", str), ! this_player()); ! return 1; ! } } return 1; } ! nomask static int cmd_pushd(string str) { if(this_player() != this_object()) return 0; if(!set_cwd(str)) return 0; pushd(str); return 1; } ! nomask static int cmd_popd(string str) { if(this_player() != this_object()) return 0; set_cwd(popd()); return 1; } ! nomask static int cmd_pwd(string str) { if(!query_cwd()) message("system", "No current directory.", this_object()); else message("system", query_cwd()+":", this_object()); --- 51,202 ---- add_action("cmd_alias", "alias"); add_action("cmd_nickname", "nickname"); if(creatorp(this_object())) { ! Stack = allocate(DIRECTORY_STACK_SIZE); ! CWDBottom = CWDTop = CWDCount = 0; ! add_action("cmd_cd", "cd"); ! add_action("cmd_nmsh", "nmsh"); ! add_action("cmd_pushd", "pushd"); ! add_action("cmd_popd", "popd"); ! add_action("cmd_pwd", "cwd"); ! add_action("cmd_pwd", "pwd"); ! add_action("cmd_work", "work"); } return 1; } ! nomask static int cmd_alias(string str) { string *a, *b; string key, thing; int i; ! if(this_player() != this_object()) return 0; if(!str) { ! i = sizeof(a = keys(Aliases)); ! while(i--) ! a[i] = sprintf("%s%s", arrange_string(a[i],15),Aliases[a[i]]); ! i = sizeof(b = keys(Xverbs)); ! while(i--) ! b[i] = sprintf("$%s%s", arrange_string(b[i],14), Xverbs[b[i]]); ! this_player()->eventPage(a+b); ! return 1; } if(sscanf(str, "%s %s", key, thing) != 2) { ! if(str[0] == '$') { ! str = str[1..strlen(str)-1]; ! if(Xverbs[str]) { ! map_delete(Xverbs, str); ! message("system", sprintf("Alias $%s removed.", str), this_player()); ! } ! else message("system", sprintf("No such alias $%s.", str), this_player()); ! return 1; ! } ! if(Aliases[str]) { ! map_delete(Aliases, str); ! message("system", sprintf("Alias %s removed.", str), this_player()); ! } ! else message("system", sprintf("No such alias %s.", str), this_player()); ! return 1; } if(sizeof(Xverbs) + sizeof(Aliases) >= MAX_CMD_ALIASES) { ! message("system", "You must remove an alias before adding another.", ! this_player()); ! return 1; } if(key == "alias") return notify_fail("You are a bonehead.\n"); if(key[0] == '$') { ! key = key[1..strlen(key)]; ! if(Xverbs[key]) ! message("system", sprintf("Alias for $%s altered to (%s).", ! key, thing), this_player()); ! else message("system", sprintf("Alias $%s (%s) added.", key, thing), ! this_player()); ! Xverbs[key] = thing; } else { ! if(Aliases[key]) ! message("system", sprintf("Alias for %s altered to (%s).", key, thing), ! this_player()); ! else message("system", sprintf("Alias %s (%s) added.", key, thing),this_player()); ! Aliases[key] = thing; } return 1; } ! nomask static int cmd_cd(string str) { if(this_player() != this_object()) return 0; set_cwd(str); return 1; } ! nomask static int cmd_nickname(string str) { string *cles; string key, thing; int i; ! if(this_player() != this_object()) return 0; if(!str) { ! i = sizeof(cles = keys(Nicknames)); ! while(i--) ! cles[i] = sprintf("%s%s", arrange_string(cles[i], 15), ! Nicknames[cles[i]]); ! this_player()->eventPage(cles); ! return 1; } if(sscanf(str, "%s %s", key, thing) != 2) { ! if(Nicknames[str]) { ! message("system", sprintf("Nickname %s removed.", str), ! this_player()); ! map_delete(Nicknames, str); ! } ! else message("system", sprintf("No such nickname %s.", str), ! this_player()); } else { ! if(Nicknames[key]) ! message("system", sprintf("Nickname %s altered to (%s).", key, thing), ! this_player()); ! else message("system", sprintf("Nickname %s (%s) added.", key, thing), ! this_player()); ! Nicknames[key] = thing; } return 1; } ! nomask static int cmd_nmsh(string str) { string *lines; string tmp; int i, maxi; ! if(!str) return 0; if(this_player() != this_object()) return 0; if((int)this_player()->GetForced()) return 0; if(!(tmp = read_file(absolute_path(query_cwd(), str)))) ! return notify_fail(sprintf("nmsh: script %s not found.\n")); maxi = sizeof(lines = explode(tmp, "\n")); for(i=0; i < maxi; i++) { ! if(lines[i][0] == '#') continue; ! if(!command(lines[i])) { ! message("system", sprintf("nmsh: error in executing %s.", str), ! this_player()); ! return 1; ! } } return 1; } ! nomask static int cmd_pushd(string str) { if(this_player() != this_object()) return 0; if(!set_cwd(str)) return 0; pushd(str); return 1; } ! nomask static int cmd_popd(string str) { if(this_player() != this_object()) return 0; set_cwd(popd()); return 1; } ! nomask static int cmd_pwd(string str) { if(!query_cwd()) message("system", "No current directory.", this_object()); else message("system", query_cwd()+":", this_object()); *************** *** 203,224 **** if(!str || str == "") ob = environment(this_object()); else if(str == "!") { ! flag = 1; ! ob = environment(this_object()); } else if(str[0] == '!') { ! flag = 1; ! str = str[1..strlen(str)]; } if(!ob && !(ob = present(str, this_object()))) ! ob = present(str, environment(this_object())); if(!ob) return notify_fail("No target object found.\n"); tmp = explode(file = base_name(ob), "/"); set_cwd("/"+implode(tmp[0..sizeof(tmp)-2], "/")); if(flag) { ! message("system", file+".c, "+file_size(file+".c")+" bytes:", ! this_object()); ! this_object()->eventEdit(file+".c"); } return 1; } --- 211,232 ---- if(!str || str == "") ob = environment(this_object()); else if(str == "!") { ! flag = 1; ! ob = environment(this_object()); } else if(str[0] == '!') { ! flag = 1; ! str = str[1..strlen(str)]; } if(!ob && !(ob = present(str, this_object()))) ! ob = present(str, environment(this_object())); if(!ob) return notify_fail("No target object found.\n"); tmp = explode(file = base_name(ob), "/"); set_cwd("/"+implode(tmp[0..sizeof(tmp)-2], "/")); if(flag) { ! message("system", file+".c, "+file_size(file+".c")+" bytes:", ! this_object()); ! this_object()->eventEdit(file+".c"); } return 1; } *************** *** 226,237 **** nomask string write_prompt() { string tmp, ret; int x, y; ! if( (y = query_ed_mode()) != -1 ) { if( !y ) { if( creatorp() ) ret = ":"; else ! ret = "\tQ)uit without saving, save and ex)it, h)elp\nCommand: "; } else if( y == -2 ) ret = "Help: "; else ret = "*\b"; --- 234,245 ---- nomask string write_prompt() { string tmp, ret; int x, y; ! if( (y = query_ed_mode()) != -1 ) { if( !y ) { if( creatorp() ) ret = ":"; else ! ret = "\tQ)uit without saving, save and ex)it, h)elp\nCommand: "; } else if( y == -2 ) ret = "Help: "; else ret = "*\b"; *************** *** 239,424 **** return ret; } if((ret = Prompt) == DEFAULT_PROMPT) { ! message("prompt", ret, this_object()); ! return ret; } while((x = strsrch(ret, "$")) != -1) { ! if(x == strlen(ret) -1) break; ! switch(ret[x+1]) { ! case 'D': ! if(!creatorp(this_object())) break; ! if(sscanf(query_cwd(), user_path(GetKeyName())+"%s", ! tmp)) tmp = "~"+tmp; ! else tmp = query_cwd(); ! ret = replace_string(ret, "$D", tmp); ! break; ! case 'V': case 'v': ! if(GetInvis()) { ! ret = replace_string(ret, "$V", "INVIS"); ! ret = replace_string(ret, "$v", "invis"); ! } ! else if(hiddenp(this_object())) { ! ret = replace_string(ret, "$V", "HID"); ! ret = replace_string(ret, "$v", "hid"); ! } ! else { ! ret = replace_string(ret, "$V", ""); ! ret = replace_string(ret, "$v", ""); ! } ! break; ! case 'C': ! ret = replace_string(ret, "$C", sprintf("%d", CmdNumber+1)); ! break; ! case 'H': ! ret = replace_string(ret, "$H", sprintf("%d", query_max_hp())); ! break; ! case 'h': ! ret = replace_string(ret, "$h", sprintf("%d", query_hp())); ! break; ! case 'G': ! ret = replace_string(ret, "$G", sprintf("%d", query_max_mp())); ! break; ! case 'g': ! ret = replace_string(ret, "$g", sprintf("%d", query_mp())); ! break; ! case 'I': ! ret = replace_string(ret, "$I", sprintf("%d", query_max_sp())); ! break; ! case 'i': ! ret = replace_string(ret, "$i", sprintf("%d", query_sp())); ! break; ! default: ! ret = replace_string(ret, ret[x..x+1], ""); ! break; ! } } message("prompt", ret, this_object()); return ret; } ! string process_input(string str) { - mixed err; string tmp, xtra, request; ! if(!str || str == "") return ""; else if(GetClient() && member_array(GetClient(), SUPPORTED_CLIENTS) != -1) { ! if(sscanf(str, "<%s>%s", request, xtra)) { ! process_request(request, xtra ? xtra : ""); ! return ""; ! } ! else return str; } else if((tmp = eventHistory(str)) == "") return ""; if(tmp != str) message("system", tmp, this_object()); return do_alias(do_nickname(tmp)); } ! nomask static void process_request(string request, string xtra) { switch(request) { ! case "ALIAS": ! receive("<ALIAS>[n,go north] [s,go south] [e,go east] [w,go west] " ! "[nw,go northwest] [ne,go northeast] [sw,go southwest] " ! "[se,go southeast] [u,go up] [d,go down] [i,inventory] " ! "[bio,biography] [exa,look at $*] [$',say $*] " ! "[$:,emote $*] [l,look]\n"); ! break; ! case "NICKNAME": receive("<NICKNAME>\n"); break; ! case "USERS": ! receive("<USERS>"+implode(map_array(filter(users(), ! "request_vis", this_object()), "user_names", this_object()), ! ", ")+"\n"); ! break; ! case "ROOM": ! receive("<ROOM>"+ ! (string)environment(this_object())->GetShort()+"\n"); ! break; ! case "PRESENT": ! receive("<PRESENT>"+ ! implode(map_array(filter(all_inventory(environment(this_object())), ! "request_vis", this_object()), "user_names", this_object()), ! ", ")+"\n"); ! break; ! default: ! receive("<error>Request not supported.\n"); ! break; ! } } static int request_vis(object ob) { return (userp(ob) && !((int)ob->GetInvis(this_object()))); ! } static string user_names(object ob) { return (string)ob->GetName(); ! } private static int set_cwd(string str) { int x; ! if(!str || str == "") str = user_path(GetKeyName()); if (str[<1] == '/' && str != "/") str = str[0..<2]; replace_string(str, "//", "/"); str = absolute_path(query_cwd(), str); if((x=file_size(str)) != -2) { ! if(x > -1) { ! message("system", sprintf("%s: Path is a file.", str), this_player()); ! return 0; ! } ! else { ! message("system", sprintf("%s: No such reference.", str), this_player()); ! return 0; ! } } CurrentWorkingDirectory = str; message("system", sprintf("%s:", CurrentWorkingDirectory), this_player()); return 1; } ! private static void pushd(string str) { if(CWDCount++ == DIRECTORY_STACK_SIZE) { ! CWDCount--; ! CWDBottom = (++CWDBottom) % DIRECTORY_STACK_SIZE; } Stack[CWDTop] = str; CWDTop = (++CWDTop) % DIRECTORY_STACK_SIZE; } ! private static string popd() { if(!CWDCount) return 0; CWDCount--; return Stack[--CWDTop]; } ! nomask private static string do_nickname(string str) { if(!Nicknames) return str; if(str[0..7] == "nickname") return str; return implode(map_array(explode(str, " "), "replace_nickname", this_object()), " "); } ! nomask private static string do_alias(string str) { string *words; string tmp; ! int x, i; ! if(!sizeof(words = explode(str, " "))) return ""; if((x = strlen(words[0])) && (tmp = Xverbs[words[0][0..0]])) { ! words[0] = words[0][1..x-1]; ! return replace_string(tmp, "$*", implode(words, " ")); } if(!(tmp = Aliases[words[0]])) return implode(words, " "); else str = implode(words[1..sizeof(words)-1], " "); return replace_string(tmp, "$*", str); ! } ! nomask static string replace_nickname(string str) { if(str == "") return str; if(str[0] == '\\') return str[1..(strlen(str)-1)]; else if(Nicknames[str]) return Nicknames[str]; else return str; } ! void reset_prompt() { Prompt =GetPrompt(); if(!stringp(Prompt)) Prompt = "Prompt screwey> "; --- 247,437 ---- return ret; } if((ret = Prompt) == DEFAULT_PROMPT) { ! message("prompt", ret, this_object()); ! return ret; } while((x = strsrch(ret, "$")) != -1) { ! if(x == strlen(ret) -1) break; ! switch(ret[x+1]) { ! case 'D': ! if(!creatorp(this_object())) break; ! if(sscanf(query_cwd(), user_path(GetKeyName())+"%s", ! tmp)) tmp = "~"+tmp; ! else tmp = query_cwd(); ! ret = replace_string(ret, "$D", tmp); ! break; ! case 'V': case 'v': ! if(GetInvis()) { ! ret = replace_string(ret, "$V", "INVIS"); ! ret = replace_string(ret, "$v", "invis"); ! } ! else if(hiddenp(this_object())) { ! ret = replace_string(ret, "$V", "HID"); ! ret = replace_string(ret, "$v", "hid"); ! } ! else { ! ret = replace_string(ret, "$V", ""); ! ret = replace_string(ret, "$v", ""); ! } ! break; ! case 'C': ! ret = replace_string(ret, "$C", sprintf("%d", CmdNumber+1)); ! break; ! case 'H': ! ret = replace_string(ret, "$H", sprintf("%d", query_max_hp())); ! break; ! case 'h': ! ret = replace_string(ret, "$h", sprintf("%d", query_hp())); ! break; ! case 'G': ! ret = replace_string(ret, "$G", sprintf("%d", query_max_mp())); ! break; ! case 'g': ! ret = replace_string(ret, "$g", sprintf("%d", query_mp())); ! break; ! case 'I': ! ret = replace_string(ret, "$I", sprintf("%d", query_max_sp())); ! break; ! case 'i': ! ret = replace_string(ret, "$i", sprintf("%d", query_sp())); ! break; ! default: ! ret = replace_string(ret, ret[x..x+1], ""); ! break; ! } } message("prompt", ret, this_object()); return ret; } ! string process_input(string str) { string tmp, xtra, request; ! if(!str || str == "") return ""; else if(GetClient() && member_array(GetClient(), SUPPORTED_CLIENTS) != -1) { ! if(sscanf(str, "<%s>%s", request, xtra)) { ! process_request(request, xtra ? xtra : ""); ! return ""; ! } ! else return str; } else if((tmp = eventHistory(str)) == "") return ""; if(tmp != str) message("system", tmp, this_object()); return do_alias(do_nickname(tmp)); } ! nomask static void process_request(string request, string xtra) { switch(request) { ! case "ALIAS": ! receive("<ALIAS>[n,go north] [s,go south] [e,go east] [w,go west] " ! "[nw,go northwest] [ne,go northeast] [sw,go southwest] " ! "[se,go southeast] [u,go up] [d,go down] [i,inventory] " ! "[bio,biography] [exa,look at $*] [$',say $*] " ! "[$:,emote $*] [l,look]\n"); ! break; ! case "NICKNAME": receive("<NICKNAME>\n"); break; ! case "USERS": ! receive("<USERS>"+implode(map_array(filter(users(), ! "request_vis", this_object()), "user_names", this_object()), ! ", ")+"\n"); ! break; ! case "ROOM": ! receive("<ROOM>"+ ! (string)environment(this_object())->GetShort()+"\n"); ! break; ! case "PRESENT": ! receive("<PRESENT>"+ ! implode(map_array(filter(all_inventory(environment(this_object())), ! "request_vis", this_object()), "user_names", this_object()), ! ", ")+"\n"); ! break; ! default: ! receive("<error>Request not supported.\n"); ! break; ! } } static int request_vis(object ob) { return (userp(ob) && !((int)ob->GetInvis(this_object()))); ! } static string user_names(object ob) { return (string)ob->GetName(); ! } private static int set_cwd(string str) { int x; ! string tmpstr = str; ! if(str == "~-") str = PreviousWorkingDirectory; if(!str || str == "") str = user_path(GetKeyName()); if (str[<1] == '/' && str != "/") str = str[0..<2]; replace_string(str, "//", "/"); str = absolute_path(query_cwd(), str); + if(!directory_exists(str) && tmpstr == "here" && environment(this_player())){ + str = path_prefix(base_name(environment(this_player()))); + } if((x=file_size(str)) != -2) { ! if(x > -1) { ! message("system", sprintf("%s: Path is a file.", str), this_player()); ! return 0; ! } ! else { ! message("system", sprintf("%s: No such reference.", str), this_player()); ! return 0; ! } } + + if(str != query_cwd()) PreviousWorkingDirectory = query_cwd(); CurrentWorkingDirectory = str; message("system", sprintf("%s:", CurrentWorkingDirectory), this_player()); return 1; } ! private static void pushd(string str) { if(CWDCount++ == DIRECTORY_STACK_SIZE) { ! CWDCount--; ! CWDBottom = (++CWDBottom) % DIRECTORY_STACK_SIZE; } Stack[CWDTop] = str; CWDTop = (++CWDTop) % DIRECTORY_STACK_SIZE; } ! private static string popd() { if(!CWDCount) return 0; CWDCount--; return Stack[--CWDTop]; } ! nomask private static string do_nickname(string str) { if(!Nicknames) return str; if(str[0..7] == "nickname") return str; return implode(map_array(explode(str, " "), "replace_nickname", this_object()), " "); } ! nomask private static string do_alias(string str) { string *words; string tmp; ! int x; ! if(!sizeof(words = explode(str, " "))) return ""; if((x = strlen(words[0])) && (tmp = Xverbs[words[0][0..0]])) { ! words[0] = words[0][1..x-1]; ! return replace_string(tmp, "$*", implode(words, " ")); } if(!(tmp = Aliases[words[0]])) return implode(words, " "); else str = implode(words[1..sizeof(words)-1], " "); return replace_string(tmp, "$*", str); ! } ! nomask static string replace_nickname(string str) { if(str == "") return str; if(str[0] == '\\') return str[1..(strlen(str)-1)]; else if(Nicknames[str]) return Nicknames[str]; else return str; } ! void reset_prompt() { Prompt =GetPrompt(); if(!stringp(Prompt)) Prompt = "Prompt screwey> "; *************** *** 427,447 **** Prompt =replace_string(Prompt, "$N", (string)this_object()->GetCapName()); Prompt =replace_string(Prompt, "$n", GetKeyName()); } ! string query_cwd() { return CurrentWorkingDirectory; } ! string GetPrompt() { return DEFAULT_PROMPT; } int query_mp() { return 1; } ! int query_max_mp() { return 10; } ! int query_hp() { return 1; } ! int query_max_hp() { return 10; } ! int query_sp() { return 1; } ! int query_max_sp() { return 10; } string get_path() { return query_cwd(); } --- 440,462 ---- Prompt =replace_string(Prompt, "$N", (string)this_object()->GetCapName()); Prompt =replace_string(Prompt, "$n", GetKeyName()); } ! string query_cwd() { return CurrentWorkingDirectory; } ! ! string query_prev_wd() { return PreviousWorkingDirectory; } ! string GetPrompt() { return DEFAULT_PROMPT; } int query_mp() { return 1; } ! int query_max_mp() { return 10; } ! int query_hp() { return 1; } ! int query_max_hp() { return 10; } ! int query_sp() { return 1; } ! int query_max_sp() { return 10; } string get_path() { return query_cwd(); } diff -c -r --new-file ds1.1/lib/lib/npc.c ds2.0r27/lib/lib/npc.c *** ds1.1/lib/lib/npc.c Sun Feb 1 21:30:19 1998 --- ds2.0r27/lib/lib/npc.c Wed Jul 5 00:00:58 2006 *************** *** 9,16 **** #include <lib.h> #include <daemons.h> #include <position.h> ! #include <armour_types.h> #include <message_class.h> #include "include/npc.h" inherit LIB_CHAT; --- 9,17 ---- #include <lib.h> #include <daemons.h> #include <position.h> ! #include <armor_types.h> #include <message_class.h> + #include <vision.h> #include "include/npc.h" inherit LIB_CHAT; *************** *** 20,33 **** inherit LIB_MESSAGES; inherit LIB_MOVE; inherit LIB_OBJECT; ! private int ActionChance, CombatActionChance; private mixed Encounter; private string *EnemyNames; private static int Level, Unique; private static mixed Die, Action, CombatAction; private static mapping Inventory; static void create() { AddSave( ({ "CarriedMass" }) ); SetSaveRecurse(1); --- 21,38 ---- inherit LIB_MESSAGES; inherit LIB_MOVE; inherit LIB_OBJECT; + inherit LIB_CRAWL; + inherit LIB_SAVE; ! private int CustomXP, ActionChance, CombatActionChance, AutoStand, Mount; private mixed Encounter; private string *EnemyNames; private static int Level, Unique; private static mixed Die, Action, CombatAction; private static mapping Inventory; + int eventExtraAction(){ return 1; } + static void create() { AddSave( ({ "CarriedMass" }) ); SetSaveRecurse(1); *************** *** 43,57 **** Encounter = 0; ActionChance = 0; Unique = 0; Inventory = ([]); } ! static void init() { string *enemies; ! if( !query_heart_beat() ) { ! eventCheckHealing(); ! set_heart_beat( GetHeartRate() ); } if( sizeof(enemies = GetEnemyNames()) ) { if( member_array((string)this_player()->GetKeyName(),enemies) != -1 ) { --- 48,64 ---- Encounter = 0; ActionChance = 0; Unique = 0; + CustomXP = 0; Inventory = ([]); + AutoStand = 1; } ! void CheckEncounter(){ string *enemies; ! if( !query_heart_beat() ) { ! eventCheckHealing(); ! set_heart_beat( GetHeartRate() ); } if( sizeof(enemies = GetEnemyNames()) ) { if( member_array((string)this_player()->GetKeyName(),enemies) != -1 ) { *************** *** 59,71 **** return; } } - if( Encounter ) { - int x = 0; ! if( functionp(Encounter) ) { x = (int)evaluate(Encounter, this_player()); } ! else if( arrayp(Encounter) ) { if( member_array(this_player()->GetKeyName(), Encounter) > -1 ) { x = 1; } --- 66,79 ---- return; } } ! if( Encounter && !query_invis(this_player(),this_object())) { ! int x = 0; ! ! if( functionp(Encounter) ) { x = (int)evaluate(Encounter, this_player()); } ! else if( arrayp(Encounter) ) { if( member_array(this_player()->GetKeyName(), Encounter) > -1 ) { x = 1; } *************** *** 73,517 **** x = 1; } } ! else if( (int)this_player()->GetStatLevel("charisma") < Encounter ) { x = 1; } ! if( x ) { SetAttack(this_player()); } } } static void heart_beat() { int position; ! living::heart_beat(); if( !ContinueHeart() ) { ! set_heart_beat(0); ! return; } position = GetPosition(); if( position == POSITION_LYING || position == POSITION_SITTING ) { ! eventForce("stand up"); } if( !GetInCombat() && ActionChance > random(100) ) { ! int x; ! if( functionp(Action) ) evaluate(Action); ! else if( pointerp(Action) && (x = sizeof(Action)) ) { ! string act; ! ! act = Action[random(x)]; ! if( act && act != "" && act[0] == '!' && act != "!" ) { ! act = act[1..]; ! eventForce(act); ! } ! else message("other_action", act, environment()); ! } } else if( GetInCombat() && CombatActionChance > random(100) ) { ! int x; ! if( functionp(CombatAction) ) evaluate(CombatAction); ! else if( pointerp(CombatAction) && (x = sizeof(CombatAction)) ) { ! string act; ! ! act = CombatAction[random(x)]; ! if( act && act != "" && act[0] == '!' && act != "!" ) { ! act = act[1..]; ! eventForce(act); ! } ! else message("other_action", act, environment()); ! } } } ! void receive_message(string cl, string msg) { catch_tell(msg); } ! void catch_tell(string msg) { } ! static int Destruct() { ! if( GetParty() ) PARTY_D->eventLeaveParty(this_object()); ! living::Destruct(); ! return object::Destruct(); ! } ! void eventReconnect() { } ! /* *************** /lib/npc.c command functions ************** */ ! static int cmdAll(string arg) { ! object env; ! string verb; ! verb = query_verb(); ! env = environment(); ! if( chat::chat_command(verb + " " + arg) == "" ) return 1; ! return command::cmdAll(arg); ! } ! /* *************** /lib/npc.c events *************** */ ! int eventCompleteMove(mixed dest) { ! mixed val; ! string file; ! int x; ! ! if( environment() ) return move::eventMove(dest); ! else x = move::eventMove(dest); ! if( !x ) return x; ! foreach(file, val in Inventory) { ! object ob; ! ! if( intp(val) ) { ! if( val < 0 ) { ! ob = unique(file, -val); ! if( ob ) ob->eventMove(this_object()); ! } ! else while(val--) ! if( ob = new(file) ) ob->eventMove(this_object()); ! } ! else if( stringp(val) ) { ! if( !(ob = new(file)) ) continue; ! if( ob->eventMove(this_object()) ) eventForce(val); ! } ! else if( functionp(val) ) { ! if( !(ob = new(file)) ) continue; ! if( ob->eventMove(this_object()) ) evaluate(val); ! } ! } ! return x; ! } ! int eventDestruct() { ! chat::eventDestruct(); ! object::eventDestruct(); ! } ! varargs int eventDie(object agent) { ! int x; ! if( (x = living::eventDie(agent)) != 1 ) return x; ! if( stringp(Die) ) { ! message("other_action", Die, environment(), ({ this_object() })); ! if( agent) message("my_action", "You kill " + GetName() + ".", agent); ! } ! else if( functionp(Die) && !evaluate(Die, agent) ) return 0; ! else { ! message("other_action", "%^BOLD%^%^RED%^"+ GetName() + " drops dead.", ! environment(), ({ this_object() }) ); ! if( agent ) message("my_action", "You kill " + GetName() + ".", agent); ! } ! set_heart_beat(0); ! call_out( (: Destruct :), 0); ! return 1; ! } ! mixed eventTurn(object who) { ! if( !living::eventTurn(who) ) { ! return 0; ! } ! all_inventory()->eventDestruct(); ! call_out((: Destruct :), 0); ! return 1; ! } ! void eventEnemyDied(object ob) { ! living::eventEnemyDied(ob); ! EnemyNames -= ({ (string)ob->GetKeyName() }); ! } ! int eventMove(mixed dest) { ! int ret; ! ret = eventCompleteMove(dest); ! eventMoveFollowers(environment(this_object())); ! return ret; ! } ! varargs int eventMoveLiving(mixed dest, string omsg, string imsg) { ! object *inv; ! object prev, env; ! string msgclass; ! ! if( prev = environment() ) { ! if( stringp(dest) ) { ! if(dest[0] != '/') { ! string *arr; ! ! arr = explode(file_name(prev), "/"); ! dest = "/"+implode(arr[0..sizeof(arr)-2], "/")+"/"+dest; ! } ! } ! if( !eventCompleteMove(dest) ) { ! eventPrint("You remain where you are."); ! return 0; ! } ! inv = filter(all_inventory(prev), (: (!GetInvis($1) && living($1) && ! ($1 != this_object())) :)); ! if( !omsg || omsg == "" ) omsg = GetMessage("telout"); ! else omsg = GetMessage("leave", omsg); ! inv->eventPrint(omsg, MSG_ENV); ! } ! else if( !eventCompleteMove(dest) ) { ! eventPrint("You remain where you are."); ! return 0; ! } ! inv = filter(all_inventory(environment()), ! (: (!GetInvis($1) && living($1) && ($1 != this_object())) :)); ! if( (!imsg || imsg == "") && (!omsg || omsg == "") ) ! imsg = GetMessage(msgclass = "telin"); ! else if( !imsg || imsg == "" ) imsg = GetMessage(msgclass = "come", imsg); ! else imsg = replace_string(imsg, "$N", GetName()); ! inv->eventPrint(imsg, MSG_ENV); ! eventMoveFollowers(environment(this_player())); ! return 1; ! } ! varargs int eventPrint(string msg, mixed arg2, mixed arg3) { ! return 1; ! } ! int eventReceiveObject() { ! object ob; ! ob = previous_object(); ! if( !ob || !container::eventReceiveObject() ) return 0; ! AddCarriedMass((int)ob->GetMass()); ! return 1; ! } ! int eventReleaseObject() { ! object ob; ! ob = previous_object(); ! if( !ob || !container::eventReleaseObject() ) return 0; ! AddCarriedMass( -((int)ob->GetMass()) ); ! return 1; ! } ! varargs int eventShow(object who, string str) { ! if( !living::eventShow(who, str) ) return 0; ! eventPrint((string)this_player()->GetName() + " looks you over."); ! return 1; ! } ! /* *************** /lib/npc.c modal functions *************** */ ! int CanCarry(int amount) { return living::CanCarry(amount); } ! mixed CanGet(object who) { return GetName() + " is a living being!"; } ! int CanReceive(object ob) { return CanCarry((int)ob->GetMass()); } ! /* *************** /lib/npc.c lfuns *************** */ ! static int ContinueHeart() { ! object env; ! if( !(env = environment()) ) return 0; ! if( !sizeof(filter(all_inventory(env), (: userp :))) ) return 0; ! return 1; ! } ! /* *************** /lib/npc.c data functions *************** */ ! mapping SetInventory(mapping mp ) { return (Inventory = mp); } ! varargs string SetRace(string race, mixed extra) { ! race = living::SetRace(race, extra); ! eventCompleteHeal(GetMaxHealthPoints()); ! return race; ! } ! string SetClass(string cls) { ! string *skills; ! int x, i; ! ! cls = living::SetClass(cls); ! x = Level; ! i = sizeof(skills = GetSkills()); ! while(i--) { ! int y; ! y = (GetSkillClass(skills[i]) || 5); ! SetSkill(skills[i], (3*x)/y, y); ! } ! return cls; ! } ! int SetLevel(int x) { ! string *tmp; ! int i; ! ! Level = x; ! i = sizeof(tmp = GetSkills()); ! while(i--) { ! int y; ! ! y = (GetSkillClass(tmp[i]) || 5); ! SetSkill(tmp[i], (3*x)/y, y); ! } ! i = sizeof(tmp = GetStats()); ! while(i--) { ! int y; ! y = (GetStatClass(tmp[i]) || 5); ! SetStat(tmp[i], ((5-y)*10) + (3*x)/y, y); ! } ! eventCompleteHeal(GetMaxHealthPoints()); ! return Level; ! } ! int GetLevel() { return Level; } ! int SetHealthPoints(int x) { ! if( x > GetMaxHealthPoints() ) ! SetStat("durability", (x-50)/10, GetStatClass("durability")); ! AddHealthPoints( x - GetHealthPoints() ); ! return GetHealthPoints(); ! } ! int SetMaxHealthPoints(int x) { ! SetStat("durability", to_int((x-50)/10), GetStatClass("durability")); ! return GetMaxHealthPoints(); ! } ! int SetMagicPoints(int x) { ! if( x > GetMaxMagicPoints() ) ! SetStat("intelligence", (x-50)/10, GetStatClass("intelligence")); ! AddMagicPoints( x - GetMagicPoints() ); ! return GetMagicPoints(); ! } ! int SetMaxMagicPoints(int x) { ! SetStat("intelligence", (x-50)/10, GetStatClass("intelligence")); ! return GetMaxMagicPoints(); ! } ! float SetStaminaPoints(float x) { ! if( x > GetMaxStaminaPoints() ) ! SetStat("agility", to_int((x-50.0)/10.0), GetStatClass("agility")); ! AddStaminaPoints( x - GetStaminaPoints() ); ! return to_float(GetStaminaPoints()); ! } ! float SetMaxStaminaPoints(float x) { ! SetStat("agility", (x-50.0)/10.0, GetStatClass("agility")); ! return GetMaxStaminaPoints(); ! } ! varargs void SetCurrency(mixed val, int amount) { ! if( stringp(val) ) AddCurrency(val, amount - GetCurrency(val)); ! else if( mapp(val) ) { ! string *currs; ! int i; ! i = sizeof(currs = keys(val)); ! while(i--) AddCurrency(currs[i], val[currs[i]]-GetCurrency(currs[i])); ! } ! else error("Bad argument 1 to SetCurrency()."); ! } ! mixed SetEncounter(mixed val) { return (Encounter = val); } ! string *AddEncounter(string nom) { ! if( !stringp(nom) ) error("Bad argument 1 to AddEncounter()\n"); ! if( Encounter && !pointerp(Encounter) ) return 0; ! else Encounter += ({ convert_name(nom) }); ! return Encounter; ! } ! string *RemoveEncounter(string nom) { ! if( !stringp(nom) ) error("Bad argument 1 to RemoveEncounter()\n"); ! if( Encounter && !pointerp(Encounter) ) return 0; ! else Encounter -= ({ convert_name(nom) }); ! return Encounter; ! } ! mixed GetEncounter() { return Encounter; } ! mixed SetDie(mixed val) { return (Die = val); } - mixed GetDie() { return Die; } ! string SetKeyName(string nom) { ! set_living_name(nom = object::SetKeyName(nom)); ! return nom; ! } ! string GetName() { return object::GetName(); } ! string GetCapName() { return object::GetCapName(); } ! string GetShort() { return object::GetShort(); } ! varargs string GetLong(string str) { ! mapping counts; ! string item, what; ! float h; ! ! str = object::GetLong() + "\n"; ! what = "The "+GetGender()+" "+GetRace(); ! str += living::GetLong(what); ! foreach(item in map(all_inventory(), ! (: (string)$1->GetAffectLong(this_object()) :))) ! if( item ) str += item + "\n"; ! counts = ([]); ! foreach(item in map(all_inventory(),(: (string)$1->GetEquippedShort() :))) ! if( item ) counts[item]++; ! if( sizeof(counts) ) str += GetCapName() + " is carrying:\n"; ! foreach(item in keys(counts)) ! str += capitalize(consolidate(counts[item], item)) + "\n"; ! return str; ! } ! void SetAction(int chance, mixed val) { ! ActionChance = chance; ! if( stringp(val) ) val = ({ val }); ! else if( !functionp(val) && !pointerp(val) ) ! error("Bad argument 2 to SetAction()\n"); ! Action = val; ! } ! mixed GetAction() { return Action; } ! void SetCombatAction(int chance, mixed val) { ! CombatActionChance = chance; ! if( stringp(val) ) val = ({ val }); ! else if( !functionp(val) && !pointerp(val) ) ! error("Bad argument 2 to SetCombatAction()\n"); ! CombatAction = val; ! } ! mixed GetCombatAction() { return CombatAction; } ! int AddCarriedMass(int x) { return living::AddCarriedMass(x); } ! mixed *GetCommands() { return commands(); } ! int SetUnique(int x) { ! Unique = x; ! if( Unique ) UNIQUE_D->eventTouchObject(); ! return Unique; ! } ! int GetUnique() { return Unique; } ! string GetCommandFail() { return "What?"; } ! int AddEnemy(object ob) { ! string tmp; ! ! if( !living::AddEnemy(ob) ) return 0; ! if( member_array(tmp = (string)ob->GetKeyName(), EnemyNames) == -1 ) ! EnemyNames += ({ tmp }); ! return 1; ! } ! string *GetEnemyNames() { return EnemyNames; } ! int GetRadiantLight(int ambient) { ! return (object::GetRadiantLight(ambient) + ! container::GetRadiantLight(ambient)); ! } ! int *GetScreen() { return ({ 80, 24 }); } --- 81,773 ---- x = 1; } } ! else if( (int)this_player()->GetStatLevel("charisma") < Encounter ) { x = 1; } ! if( x ) { SetAttack(this_player()); } } } + static void init() { + CheckEncounter(); + } + static void heart_beat() { int position; ! living::heart_beat(); if( !ContinueHeart() ) { ! set_heart_beat(0); ! return; } + eventExtraAction(); position = GetPosition(); if( position == POSITION_LYING || position == POSITION_SITTING ) { ! if(AutoStand && !RACES_D->GetLimblessRace(this_object()->GetRace())) eventForce("stand up"); ! if(GetInCombat() && !RACES_D->GetLimblessRace(this_object()->GetRace()) ) eventForce("stand up"); } if( !GetInCombat() && ActionChance > random(100) ) { ! int x; ! if( functionp(Action) ) evaluate(Action); ! else if( pointerp(Action) && (x = sizeof(Action)) ) { ! mixed act; ! ! act = Action[random(x)]; ! if(functionp(act)) { ! evaluate(act); ! return; ! } ! if( act && act != "" && act[0] == '!' && act != "!" ) { ! act = act[1..]; ! eventForce(act); ! } ! else message("other_action", act, environment()); ! } } else if( GetInCombat() && CombatActionChance > random(100) ) { ! int x; ! ! if( functionp(CombatAction) ) { ! evaluate(CombatAction); ! } ! else if( pointerp(CombatAction) && (x = sizeof(CombatAction)) ) { ! mixed mact; ! string act; ! ! x--; ! mact = CombatAction[random(x)]; ! if( functionp(mact) ) { ! evaluate(mact); ! return; ! } ! if( !stringp(mact) ) mact = "emote looks confused."; ! else act = mact; ! if( act && act != "" ) { ! eventForce(act); ! } ! else message("other_action", act, environment()); ! } } } ! void eventDescribeEnvironment(int brief) { ! object env; ! mixed tmp; ! string *shorts; ! string desc, smell, sound, touch; ! int i, maxi; ! ! if(!(env = environment(this_object()))) { ! eventPrint("You are nowhere.", MSG_ROOMDESC); ! return; ! } ! switch( i = GetEffectiveVision() ) { ! case VISION_BLIND: ! eventPrint("You are blind and can see nothing."); ! break; ! case VISION_TOO_DARK: ! eventPrint("It is much too dark to see."); ! break; ! case VISION_DARK: ! eventPrint("It is too dark to see."); ! break; ! case VISION_TOO_BRIGHT: ! eventPrint("It is much too %^YELLOW%^bright%^RESET%^ to see."); ! break; ! case VISION_BRIGHT: ! eventPrint("It is too %^YELLOW%^bright%^RESET%^ to see."); ! break; ! } ! if( !brief ) { ! if( i == VISION_CLEAR ) { ! desc = (string)env->GetObviousExits() || ""; ! desc = capitalize((string)env->GetShort() || "") ! + " [" + desc + "]\n"; ! } ! else desc = ""; ! if( i == VISION_CLEAR || i == VISION_LIGHT || i == VISION_DIM ) ! desc += (string)env->GetLong(); ! if(functionp(tmp = (mixed)env->GetSmell("default"))) ! tmp = (string)(*tmp)("default"); ! smell = tmp; ! if(functionp(tmp = (mixed)env->GetListen("default"))) ! tmp = (string)(*tmp)("default"); ! sound = tmp; ! if( functionp(tmp = (mixed)env->GetTouch("default")) ) ! tmp = evaluate(tmp, "default"); ! touch = tmp; ! } ! else { ! if( i == VISION_CLEAR || i == VISION_LIGHT || i == VISION_DIM ) { ! desc = (string)env->GetShort(); ! if( (tmp = (string)env->GetObviousExits()) && tmp != "" ) ! desc += " [" + tmp + "]"; ! } ! else desc = ""; ! } ! if( desc ) eventPrint(desc, MSG_ROOMDESC); ! if( smell ) eventPrint("%^GREEN%^" + smell, MSG_ROOMDESC); ! if( sound ) eventPrint("%^CYAN%^" + sound, MSG_ROOMDESC); ! if( touch ) eventPrint("%^YELLOW%^" + touch, MSG_ROOMDESC); ! desc = ""; ! if( i == VISION_CLEAR ) { ! mapping lying = ([]); ! shorts = map(filter(all_inventory(env), ! function(object ob) { ! if( living(ob) ) return 0; ! if( (int)ob->GetInvis(this_object()) ) ! return 0; ! if( (int)ob->isFreshCorpse() ) return 0; ! return 1; ! }), (: (string)$1->GetShort() :)); ! foreach(string s in shorts) { ! if( s ) { ! lying[s]++; ! } ! } ! for(i=0, desc = 0, maxi = sizeof(shorts = keys(lying)); i<maxi; i++) { ! string key = shorts[i]; ! int val = lying[shorts[i]]; ! ! if( val < 2 ) { ! if( !desc ) desc = "%^MAGENTA%^" + ! capitalize(key) + "%^RESET%^MAGENTA%^"; ! else desc += key + "%^RESET%^MAGENTA%^"; ! } ! else { ! if( !desc ) desc = "%^MAGENTA%^" + ! capitalize(consolidate(val, key)) + ! "%^RESET%^MAGENTA%^"; ! else desc += consolidate(val, key) + ! "%^RESET%^MAGENTA%^"; ! } ! if( i == maxi - 1 ) { ! if( maxi > 1 || val >1 ) ! desc += " are here.%^RESET%^\n"; ! else desc += " is here.%^RESET%^\n"; ! } ! else if( i == maxi - 2 ) { ! if( maxi == 2 ) { ! desc += " and "; ! } ! else { ! desc += ", and "; ! } ! } ! else desc += ", "; ! } ! } ! i = GetEffectiveVision(); ! if( i == VISION_CLEAR || i == VISION_LIGHT || i == VISION_DIM ) { ! mapping lying = ([]), sitting = ([]), standing = ([]), flying = ([]); ! object *obs; ! string key; ! int val; ! ! obs = filter(all_inventory(env), function(object ob) { ! if( (int)ob->GetInvis(this_object()) ) return 0; ! if( living(ob) ) return 1; ! if( (int)ob->isFreshCorpse() ) ! return 1; ! }) - ({ this_object() }); ! maxi = sizeof(shorts = map(obs, (: (string)$1->GetHealthShort() :))); ! foreach(object liv in obs) { ! string s = (string)liv->GetHealthShort(); ! int pos = (int)liv->GetPosition(); ! ! if( !s ) continue; ! if( pos == POSITION_STANDING) standing[s]++; ! else if( pos == POSITION_LYING || (int)liv->isFreshCorpse() ) ! lying[s]++; ! else if( pos == POSITION_SITTING ) sitting[s]++; ! else if( pos == POSITION_FLYING ) flying[s]++; ! else lying[s]++; ! } ! if( !desc ) { ! tmp = ""; ! } ! else { ! tmp = desc; ! } ! desc = ""; ! foreach(key, val in lying) { ! if( val<2 ) desc += capitalize(key) + "%^RESET%^ is lying down."; ! else desc += capitalize(consolidate(val, key)) + ! "%^RESET%^ are lying down."; ! desc += "\n"; ! } ! foreach(key, val in sitting) { ! if( val<2 ) ! desc += capitalize(key) + "%^RESET%^ is sitting down."; ! else desc += capitalize(consolidate(val, key)) + ! "%^RESET%^ are sitting down."; ! desc += "\n"; ! } ! foreach(key, val in standing) { ! if( val<2 ) ! desc += capitalize(key) + "%^RESET%^ is standing here."; ! else desc += capitalize(consolidate(val, key)) + ! "%^RESET%^ are standing here."; ! desc += "\n"; ! } ! foreach(key, val in flying) { ! if( val<2 ) ! desc += capitalize(key) + "%^RESET%^ is hovering here."; ! else desc += capitalize(consolidate(val, key)) + ! "%^RESET%^ are hovering here."; ! desc += "\n"; ! } ! } ! if( tmp ) { ! desc = tmp + desc; ! } ! if( sizeof(desc) ) { ! eventPrint(desc + "\n", MSG_ROOMDESC); ! } ! } ! void receive_message(string cl, string msg) { catch_tell(msg); } ! void catch_tell(string msg) { } ! static int Destruct() { ! if( GetParty() ) PARTY_D->eventLeaveParty(this_object()); ! living::Destruct(); ! return object::Destruct(); ! } ! void eventReconnect() { } ! /* *************** /lib/npc.c command functions ************** */ ! static int cmdAll(string arg) { ! object env; ! string verb; ! ! verb = query_verb(); ! env = environment(); ! if( chat::chat_command(verb + " " + arg) == "" ) return 1; ! return command::cmdAll(arg); ! } ! /* *************** /lib/npc.c events *************** */ ! int eventCompleteMove(mixed dest) { ! mixed val; ! string file; ! int x; ! ! if( environment() ) return move::eventMove(dest); ! else x = move::eventMove(dest); ! if( !x ) return x; ! foreach(file, val in Inventory) { ! object ob; ! ! if( intp(val) ) { ! if( val < 0 ) { ! ob = unique(file, -val); ! if( ob ) ob->eventMove(this_object()); ! } ! else while(val--) ! if( ob = new(file) ) ob->eventMove(this_object()); ! } ! else if( stringp(val) ) { ! if( !(ob = new(file)) ) continue; ! if( ob->eventMove(this_object()) ) eventForce(val); ! } ! else if( functionp(val) ) { ! if( !(ob = new(file)) ) continue; ! if( ob->eventMove(this_object()) ) evaluate(val); ! } ! } ! return x; ! } ! int eventDestruct() { ! chat::eventDestruct(); ! object::eventDestruct(); ! } ! varargs int eventDie(mixed agent) { ! int x; ! if( (x = living::eventDie(agent)) != 1 ) return x; ! if( stringp(Die) ) { ! message("other_action", Die, environment(), ({ this_object() })); ! if( agent) message("my_action", "You kill " + GetName() + ".", agent); ! } ! else if( functionp(Die) && !evaluate(Die, agent) ) return 0; ! else { ! if(GetPosition() == POSITION_STANDING) message("other_action", "%^BOLD%^%^RED%^"+ GetName() + " drops dead.", environment(), ({ this_object() }) ); ! else if(GetPosition() == POSITION_FLYING) message("other_action", "%^BOLD%^%^RED%^"+ GetName() + " falls dead.", environment(), ({ this_object() }) ); ! else message("other_action", "%^BOLD%^%^RED%^"+ GetName() + " finally dies.", environment(), ({ this_object() }) ); ! if( agent ) message("my_action", "You kill " + GetName() + ".", agent); ! } ! set_heart_beat(0); ! call_out( (: Destruct :), 0); ! flush_messages(); ! return 1; ! } ! mixed eventTurn(object who) { ! if( !living::eventTurn(who) ) { ! return 0; ! } ! all_inventory()->eventDestruct(); ! call_out((: Destruct :), 0); ! return 1; ! } ! void eventEnemyDied(object ob) { ! living::eventEnemyDied(ob); ! EnemyNames -= ({ (string)ob->GetKeyName() }); ! } ! int eventMove(mixed dest) { ! int ret; ! ret = eventCompleteMove(dest); ! //if(environment(this_object())) eventMoveFollowers(environment(this_object())); ! return ret; ! } ! varargs int eventMoveLiving(mixed dest, string omsg, string imsg) { ! object *inv; ! object prev; ! string msgclass; ! ! if( prev = environment() ) { ! if( stringp(dest) ) { ! if(dest[0] != '/') { ! string *arr; ! ! arr = explode(file_name(prev), "/"); ! dest = "/"+implode(arr[0..sizeof(arr)-2], "/")+"/"+dest; ! } ! } ! if( !eventCompleteMove(dest) ) { ! eventPrint("You remain where you are."); ! return 0; ! } ! inv = filter(all_inventory(prev), (: (!GetInvis($1) && living($1) && ! ($1 != this_object())) :)); ! if( !omsg || omsg == "" ) omsg = GetMessage("telout"); ! else if(GetPosition() == POSITION_SITTING || ! GetPosition() == POSITION_LYING ){ ! omsg = this_object()->GetName()+" crawls "+omsg+"."; ! } ! else if(GetPosition() == POSITION_FLYING ){ ! omsg = this_object()->GetName()+" flies "+omsg+"."; ! } ! else omsg = GetMessage("leave", omsg); ! inv->eventPrint(omsg, MSG_ENV); ! } ! else if( !eventCompleteMove(dest) ) { ! eventPrint("You remain where you are."); ! return 0; ! } ! inv = filter(all_inventory(environment()), ! (: (!GetInvis($1) && living($1) && ($1 != this_object())) :)); ! if( (!imsg || imsg == "") && (!omsg || omsg == "") ) ! imsg = GetMessage(msgclass = "telin"); ! else if(GetPosition() == POSITION_SITTING || ! GetPosition() == POSITION_LYING ){ ! imsg = this_object()->GetName()+" crawls in"; ! } ! else if(GetPosition() == POSITION_FLYING ){ ! imsg = this_object()->GetName()+" flies in."; ! } ! else if( !imsg || imsg == "" ) imsg = GetMessage(msgclass = "come", imsg); ! else imsg = replace_string(imsg, "$N", GetName()); ! inv->eventPrint(imsg, MSG_ENV); ! this_object()->eventDescribeEnvironment(0); ! eventMoveFollowers(environment(this_player())); ! return 1; ! } ! ! varargs int eventPrint(string msg, mixed arg2, mixed arg3) { ! return 1; ! } ! int eventReceiveObject() { ! object ob; ! ob = previous_object(); ! if( !ob || !container::eventReceiveObject() ) return 0; ! AddCarriedMass((int)ob->GetMass()); ! return 1; ! } ! int eventReleaseObject() { ! object ob; ! ob = previous_object(); ! if( !ob || !container::eventReleaseObject() ) return 0; ! AddCarriedMass( -((int)ob->GetMass()) ); ! return 1; ! } ! varargs int eventShow(object who, string str) { ! if( !living::eventShow(who, str) ) return 0; ! eventPrint((string)this_player()->GetName() + " looks you over."); ! return 1; ! } ! /* *************** /lib/npc.c modal functions *************** */ ! int CanCarry(int amount) { return living::CanCarry(amount); } ! mixed CanGet(object who) { return GetName() + " is a living being!"; } ! int CanReceive(object ob) { return CanCarry((int)ob->GetMass()); } ! /* *************** /lib/npc.c lfuns *************** */ ! static int ContinueHeart() { ! object env; ! if( !(env = environment()) ) return 0; ! if( !sizeof(filter(all_inventory(env), (: living :))) ) return 0; ! return 1; ! } ! /* *************** /lib/npc.c data functions *************** */ ! mapping SetInventory(mapping mp ) { return (Inventory = mp); } ! mapping GetInventory() { return copy(Inventory); } ! varargs string SetRace(string race, mixed extra) { ! //if(arrayp(extra) && !sizeof(extra)) extra = ({ ({}), ({}), ({}), ({}), ({}) }); ! race = living::SetRace(race, extra); ! eventCompleteHeal(GetMaxHealthPoints()); ! return race; ! } ! string SetClass(string cls) { ! string *skills; ! int x, i; ! ! cls = living::SetClass(cls); ! x = Level; ! i = sizeof(skills = GetSkills()); ! while(i--) { ! int y; ! y = (GetSkillClass(skills[i]) || 5); ! SetSkill(skills[i], (3*x)/y, y); ! } ! return cls; ! } ! int SetLevel(int x) { ! string *tmp; ! int i; ! ! Level = x; ! i = sizeof(tmp = GetSkills()); ! while(i--) { ! int y; ! y = (GetSkillClass(tmp[i]) || 5); ! SetSkill(tmp[i], (3*x)/y, y); ! } ! i = sizeof(tmp = GetStats()); ! while(i--) { ! int y; ! y = (GetStatClass(tmp[i]) || 5); ! SetStat(tmp[i], ((5-y)*10) + (3*x)/y, y); ! } ! eventCompleteHeal(GetMaxHealthPoints()); ! return Level; ! } ! int GetLevel() { return Level; } ! int SetCustomXP(int i){ ! if(!i) i = 0; ! CustomXP = i; ! return CustomXP; ! } ! int GetCustomXP(){ ! return CustomXP; ! } ! int SetHealthPoints(int x) { ! if( x > GetMaxHealthPoints() ) ! SetStat("durability", (x-50)/10, GetStatClass("durability")); ! AddHealthPoints( x - GetHealthPoints() ); ! return GetHealthPoints(); ! } ! int SetMaxHealthPoints(int x) { ! SetStat("durability", to_int((x-50)/10), GetStatClass("durability")); ! return GetMaxHealthPoints(); ! } ! int SetMagicPoints(int x) { ! if( x > GetMaxMagicPoints() ) ! SetStat("intelligence", (x-50)/10, GetStatClass("intelligence")); ! AddMagicPoints( x - GetMagicPoints() ); ! return GetMagicPoints(); ! } ! int SetMaxMagicPoints(int x) { ! SetStat("intelligence", (x-50)/10, GetStatClass("intelligence")); ! return GetMaxMagicPoints(); ! } ! float SetStaminaPoints(float x) { ! if( x > GetMaxStaminaPoints() ) ! SetStat("agility", to_int((x-50.0)/10.0), GetStatClass("agility")); ! AddStaminaPoints( x - GetStaminaPoints() ); ! return to_float(GetStaminaPoints()); ! } ! float SetMaxStaminaPoints(float x) { ! SetStat("agility", (x-50.0)/10.0, GetStatClass("agility")); ! return GetMaxStaminaPoints(); ! } ! varargs void SetCurrency(mixed val, int amount) { ! //tc("val: "+identify(val),"red"); ! //if(amount) tc("amount: "+identify(amount),"red"); ! if( stringp(val) ) AddCurrency(val, amount); ! else if( mapp(val) ) { ! string *currs; ! int i; ! i = sizeof(currs = keys(val)); ! while(i--) AddCurrency(currs[i], val[currs[i]]); ! } ! else error("Bad argument 1 to SetCurrency()."); ! } ! mixed SetEncounter(mixed val) { return (Encounter = val); } ! mixed SetAggressive(mixed val){ ! if(sizeof(Encounter)) return Encounter; ! else Encounter = 100; ! } ! string *AddEncounter(string nom) { ! if( !stringp(nom) ) error("Bad argument 1 to AddEncounter()\n"); ! if( Encounter && !pointerp(Encounter) ) return 0; ! else Encounter += ({ convert_name(nom) }); ! return Encounter; ! } ! string *RemoveEncounter(string nom) { ! if( !stringp(nom) ) error("Bad argument 1 to RemoveEncounter()\n"); ! if( Encounter && !pointerp(Encounter) ) return 0; ! else Encounter -= ({ convert_name(nom) }); ! return Encounter; ! } ! mixed GetEncounter() { return Encounter; } ! mixed SetDie(mixed val) { return (Die = val); } ! mixed GetDie() { return Die; } ! string SetKeyName(string nom) { ! set_living_name(nom = object::SetKeyName(nom)); ! return nom; ! } ! string GetName() { return object::GetName(); } ! string GetCapName() { return object::GetCapName(); } ! string GetShort() { return object::GetShort(); } ! varargs string GetLong(string str) { ! mapping counts; ! string item, what; ! ! str = object::GetLong() + "\n"; ! what = "The "+GetGender()+" "+GetRace(); ! str += living::GetLong(what); ! foreach(item in map(all_inventory(), ! (: (string)$1->GetAffectLong(this_object()) :))) ! if( item ) str += item + "\n"; ! if(this_object()->GetAffectLong()) str += this_object()->GetAffectLong(); ! counts = ([]); ! foreach(item in map(all_inventory(),(: (string)$1->GetEquippedShort() :))) ! if( item ) counts[item]++; ! if( sizeof(counts) ) str += GetCapName() + " is carrying:\n"; ! foreach(item in keys(counts)) ! str += capitalize(consolidate(counts[item], item)) + "\n"; ! return str; ! } ! void SetAction(int chance, mixed val) { ! ActionChance = chance; ! if( stringp(val) ) val = ({ val }); ! else if( !functionp(val) && !pointerp(val) ) ! error("Bad argument 2 to SetAction()\n"); ! Action = val; ! } ! mixed GetAction() { return Action; } ! void SetCombatAction(int chance, mixed val) { ! CombatActionChance = chance; ! if( stringp(val) ) val = ({ val }); ! else if( !functionp(val) && !pointerp(val) ) ! error("Bad argument 2 to SetCombatAction()\n"); ! CombatAction = val; ! } ! mixed GetCombatAction() { return CombatAction; } ! int AddCarriedMass(int x) { return living::AddCarriedMass(x); } ! mixed *GetCommands() { return commands(); } ! int SetUnique(int x) { ! Unique = x; ! if( Unique ) UNIQUE_D->eventTouchObject(); ! return Unique; ! } ! ! int GetUnique() { return Unique; } ! ! string GetCommandFail() { return "What?"; } ! ! int AddEnemy(object ob) { ! string tmp; ! ! if( !living::AddEnemy(ob) ) return 0; ! if( member_array(tmp = (string)ob->GetKeyName(), EnemyNames) == -1 ) ! EnemyNames += ({ tmp }); ! return 1; ! } ! ! string *GetEnemyNames() { return EnemyNames; } ! int GetRadiantLight(int ambient) { ! return (object::GetRadiantLight(ambient) + ! container::GetRadiantLight(ambient)); ! } ! ! int *GetScreen() { return ({ 80, 24 }); } ! ! int SetMount(int x) { ! Mount = x; ! return Mount; ! } ! ! int GetMount(){ return Mount; } ! ! int GetAutoStand(){ return AutoStand; } ! ! int SetAutoStand(int i){ ! AutoStand = i; ! return AutoStand; ! } diff -c -r --new-file ds1.1/lib/lib/pager.c ds2.0r27/lib/lib/pager.c *** ds1.1/lib/lib/pager.c Sun Feb 1 21:30:19 1998 --- ds2.0r27/lib/lib/pager.c Wed Jul 5 00:00:58 2006 *************** *** 1,5 **** /* /lib/pager.c ! * from the Dead Soulsr2 Object Library * a system pager for interactive objects * created by Descartes of Borg 951104 * Version: @(#) pager.c 1.3@(#) --- 1,5 ---- /* /lib/pager.c ! * from the Dead Souls Object Library * a system pager for interactive objects * created by Descartes of Borg 951104 * Version: @(#) pager.c 1.3@(#) *************** *** 20,33 **** varargs mixed eventPage(mixed val, mixed msg_class, function f,mixed args...) { class page_file *files; int maxi; ! if( InPager ) return "You are already in the pager."; if( !stringp(val) && !arrayp(val) ) ! error("Bad argument 1 to eventPage().\n"); if( stringp(msg_class) || !msg_class ) msg_class = MSG_SYSTEM; if( arrayp(val) ) { class page_file file; ! file = new(class page_file); if( !(file->Size = sizeof(val)) ) return 1; file->MessageClass = msg_class; --- 20,33 ---- varargs mixed eventPage(mixed val, mixed msg_class, function f,mixed args...) { class page_file *files; int maxi; ! if( InPager ) return "You are already in the pager."; if( !stringp(val) && !arrayp(val) ) ! error("Bad argument 1 to eventPage().\n"); if( stringp(msg_class) || !msg_class ) msg_class = MSG_SYSTEM; if( arrayp(val) ) { class page_file file; ! file = new(class page_file); if( !(file->Size = sizeof(val)) ) return 1; file->MessageClass = msg_class; *************** *** 42,48 **** } else { string tmp; ! val = wild_card(val); if( !val || !sizeof(val) ) return "File not found."; files = ({}); --- 42,48 ---- } else { string tmp; ! val = wild_card(val); if( !val || !sizeof(val) ) return "File not found."; files = ({}); *************** *** 80,90 **** } } if( ((class page_file)files[<1])->Args ) ! ((class page_file)files[<1])->Args = ({ ((class page_file)files[<1])->Callback }) + ! ((class page_file)files[<1])->Args; else ((class page_file)files[<1])->Args = ! ({ ((class page_file)files[<1])->Callback }); ((class page_file)files[<1])->Callback = (: RazzleDazzle :); Page(files[0]); return 1; --- 80,90 ---- } } if( ((class page_file)files[<1])->Args ) ! ((class page_file)files[<1])->Args = ({ ((class page_file)files[<1])->Callback }) + ! ((class page_file)files[<1])->Args; else ((class page_file)files[<1])->Args = ! ({ ((class page_file)files[<1])->Callback }); ((class page_file)files[<1])->Callback = (: RazzleDazzle :); Page(files[0]); return 1; *************** *** 103,117 **** else prompt = ""; if( endline < file->Size - 1 ) { prompt += "(" + (file->CurrentLine+1) + "-" + (endline+1) + " "; ! prompt += ((endline * 100)/(file->Size - 1)) + "%): "; ! prompt = "%^BOLD%^" + prompt + "%^RESET%^"; file->CurrentLine = endline + 1; eventPrint(prompt, MSG_PROMPT); input_to((: cmdPage :), file); } else { int fp; ! file->CurrentLine = endline; fp = functionp(file->Callback); if( !fp || (fp == FP_OWNER_DESTED) ) return; --- 103,118 ---- else prompt = ""; if( endline < file->Size - 1 ) { prompt += "(" + (file->CurrentLine+1) + "-" + (endline+1) + " "; ! prompt += ((endline * 100)/(file->Size - 1)) + "%) press enter: "; ! // Following fix courtesy of Brodbane ! prompt = "%^BOLD%^" + prompt + "%^RESET%^\n"; file->CurrentLine = endline + 1; eventPrint(prompt, MSG_PROMPT); input_to((: cmdPage :), file); } else { int fp; ! file->CurrentLine = endline; fp = functionp(file->Callback); if( !fp || (fp == FP_OWNER_DESTED) ) return; *************** *** 124,132 **** string *tmp; string cmd, args; int fp, x, scrlen; ! if( !str || trim(str) == "" ) { ! if( file->CurrentLine >= (file->Size - 1) ) { fp = functionp(file->Callback); if( !fp || (fp == FP_OWNER_DESTED) ) return; if( file->Args ) evaluate(file->Callback, file->Args...); --- 125,133 ---- string *tmp; string cmd, args; int fp, x, scrlen; ! if( !str || trim(str) == "" ) { ! if( file->CurrentLine >= (file->Size) ) { fp = functionp(file->Callback); if( !fp || (fp == FP_OWNER_DESTED) ) return; if( file->Args ) evaluate(file->Callback, file->Args...); *************** *** 139,145 **** if( strlen(str) > 1 ) args = str[1..]; else args = 0; switch(cmd) { ! case ",": if( !args || !(file->Marks[args]) ) { receive("\a"); input_to((: cmdPage :), file); --- 140,146 ---- if( strlen(str) > 1 ) args = str[1..]; else args = 0; switch(cmd) { ! case ",": if( !args || !(file->Marks[args]) ) { receive("\a"); input_to((: cmdPage :), file); *************** *** 148,154 **** else cmdPage("g" + file->Marks[args], file); return; ! case "/": if( file->CurrentLine >= (file->Size - 1) ) { eventPrint("\a" + GetPagerPrompt(file), MSG_PROMPT); input_to((: cmdPage :), file); --- 149,155 ---- else cmdPage("g" + file->Marks[args], file); return; ! case "/": if( file->CurrentLine >= (file->Size - 1) ) { eventPrint("\a" + GetPagerPrompt(file), MSG_PROMPT); input_to((: cmdPage :), file); *************** *** 179,185 **** Page(file); return; ! case "?": x = file->CurrentLine - GetScreen()[1] - 3; if( x < 1 ) { eventPrint("\a" + GetPagerPrompt(file), MSG_PROMPT); --- 180,186 ---- Page(file); return; ! case "?": x = file->CurrentLine - GetScreen()[1] - 3; if( x < 1 ) { eventPrint("\a" + GetPagerPrompt(file), MSG_PROMPT); *************** *** 212,218 **** Page(file); return; ! case "b": scrlen = GetScreen()[1]; if( (file->CurrentLine - (2*(scrlen-3))) < 1 ) { eventPrint("\a" + GetPagerPrompt(file), MSG_PROMPT); --- 213,219 ---- Page(file); return; ! case "b": scrlen = GetScreen()[1]; if( (file->CurrentLine - (2*(scrlen-3))) < 1 ) { eventPrint("\a" + GetPagerPrompt(file), MSG_PROMPT); *************** *** 225,231 **** } return; ! case "g": case "<": case "G": case ">": if( cmd == "g" || cmd == "<" ) x = 1; else { x = (file->Size - (GetScreen()[1] - 3)); --- 226,232 ---- } return; ! case "g": case "<": case "G": case ">": if( cmd == "g" || cmd == "<" ) x = 1; else { x = (file->Size - (GetScreen()[1] - 3)); *************** *** 245,257 **** Page(file); return; ! case "h": case "H": eventPrint(GetHelp("pager"), MSG_HELP); eventPrint(GetPagerPrompt(file), MSG_PROMPT); input_to((: cmdPage :), file); return; ! ! case "m": if( !args ) { eventPrint("\a" + GetPagerPrompt(file), MSG_PROMPT); input_to((: cmdPage :), file); --- 246,258 ---- Page(file); return; ! case "h": case "H": eventPrint(GetHelp("pager"), MSG_HELP); eventPrint(GetPagerPrompt(file), MSG_PROMPT); input_to((: cmdPage :), file); return; ! ! case "m": if( !args ) { eventPrint("\a" + GetPagerPrompt(file), MSG_PROMPT); input_to((: cmdPage :), file); *************** *** 259,270 **** } file->Marks[args] = file->CurrentLine; eventPrint("Mark " + args + " set to line " + ! (file->CurrentLine + 1) + ".", file->MessageClass); eventPrint(GetPagerPrompt(file), MSG_PROMPT); input_to((: cmdPage :), file); return; ! case "n": fp = functionp(file->Callback); if( !fp || (fp == FP_OWNER_DESTED) ) { eventPrint("\a" + GetPagerPrompt(file), MSG_PROMPT); --- 260,271 ---- } file->Marks[args] = file->CurrentLine; eventPrint("Mark " + args + " set to line " + ! (file->CurrentLine + 1) + ".", file->MessageClass); eventPrint(GetPagerPrompt(file), MSG_PROMPT); input_to((: cmdPage :), file); return; ! case "n": fp = functionp(file->Callback); if( !fp || (fp == FP_OWNER_DESTED) ) { eventPrint("\a" + GetPagerPrompt(file), MSG_PROMPT); *************** *** 274,281 **** if( file->Args ) evaluate(file->Callback, file->Args...); else evaluate(file->Callback); return; ! ! case "p": case "%": if( args ) x = to_int(args); if( !args || x < 1 || x > 100 ) { eventPrint("\a" + GetPagerPrompt(file), MSG_PROMPT); --- 275,282 ---- if( file->Args ) evaluate(file->Callback, file->Args...); else evaluate(file->Callback); return; ! ! case "p": case "%": if( args ) x = to_int(args); if( !args || x < 1 || x > 100 ) { eventPrint("\a" + GetPagerPrompt(file), MSG_PROMPT); *************** *** 285,310 **** x = ((file->Size - 1) * x)/100 - 1; if( x < 0 ) x = 0; else if( x > ((file->Size - 1) - (GetScreen()[1] - 3)) ) ! x = ((file->Size - 1) - (GetScreen()[1] - 3)); file->CurrentLine = x; Page(file); return; ! ! case "q": fp = functionp(file->Callback); if( !fp || (fp == FP_OWNER_DESTED) ) return; if( file->Args ) evaluate(file->Callback, file->Args...); else evaluate(file->Callback); return; ! case "v": eventPrint("Dead Souls Pager v3.0 by Descartes of Borg 951104", ! MSG_HELP); eventPrint(GetPagerPrompt(file), MSG_PROMPT); input_to((: cmdPage :), file); return; ! default: eventPrint("\a'h' for help", MSG_ERROR); eventPrint(GetPagerPrompt(file), MSG_PROMPT); input_to((: cmdPage :), file); --- 286,311 ---- x = ((file->Size - 1) * x)/100 - 1; if( x < 0 ) x = 0; else if( x > ((file->Size - 1) - (GetScreen()[1] - 3)) ) ! x = ((file->Size - 1) - (GetScreen()[1] - 3)); file->CurrentLine = x; Page(file); return; ! ! case "q": fp = functionp(file->Callback); if( !fp || (fp == FP_OWNER_DESTED) ) return; if( file->Args ) evaluate(file->Callback, file->Args...); else evaluate(file->Callback); return; ! case "v": eventPrint("Dead Souls Pager v3.0 by Descartes of Borg 951104", ! MSG_HELP); eventPrint(GetPagerPrompt(file), MSG_PROMPT); input_to((: cmdPage :), file); return; ! default: eventPrint("\a'h' for help", MSG_ERROR); eventPrint(GetPagerPrompt(file), MSG_PROMPT); input_to((: cmdPage :), file); *************** *** 314,320 **** varargs static private void RazzleDazzle(mixed args...) { function f; ! InPager = 0; f = args[0]; if( !functionp(f) || functionp(f) == FP_OWNER_DESTED ) return; --- 315,321 ---- varargs static private void RazzleDazzle(mixed args...) { function f; ! InPager = 0; f = args[0]; if( !functionp(f) || functionp(f) == FP_OWNER_DESTED ) return; *************** *** 326,334 **** static private string GetPagerPrompt(class page_file file) { int x; ! if( creatorp() && file->Name != "" ) ! return "%^BOLD%^" + file->Name + ":%^RESET%^ "; if( file->CurrentLine >= (file->Size - 1) ) return "END: "; x = ((100 * file->CurrentLine)/(file->Size - 1)); if( x < 0 ) x = 0; --- 327,335 ---- static private string GetPagerPrompt(class page_file file) { int x; ! if( creatorp() && file->Name != "" ) ! return "%^BOLD%^" + file->Name + ":%^RESET%^ "; if( file->CurrentLine >= (file->Size - 1) ) return "END: "; x = ((100 * file->CurrentLine)/(file->Size - 1)); if( x < 0 ) x = 0; *************** *** 339,364 **** string GetHelp(string str) { if( str != "pager" ) return 0; return ("/<pattern>, ?<pattern>\n" ! "The pattern is optional. / searches forward for a pattern. " ! "If no pattern is specified, the last search pattern is " ! "repeated. ? does the same, except searching backwards.\n" ! "b\n" ! "Move back one page.\n" ! "<return>\n" ! "Move ahead one page.\n" ! "n\n" ! "Move to the next file in the group of files being paged.\n" ! "m<tag>\n" ! "Mark the current line and asociate it with tag. You can mark " ! "any number of lines.\n" ! ",<tag>\n" ! "Move to the named tag.\n" ! "g<line>, G<line>\n" ! "Go to the named line. If no line is named, 'g' goes to the " ! "beginning of the file. In contras, 'G' will go to the end.\n" ! "p<percent>\n" ! "Move to the line <percent> lines into the file.\n" ! "q\n" ! "Quit out of the pager."); } --- 340,365 ---- string GetHelp(string str) { if( str != "pager" ) return 0; return ("/<pattern>, ?<pattern>\n" ! "The pattern is optional. / searches forward for a pattern. " ! "If no pattern is specified, the last search pattern is " ! "repeated. ? does the same, except searching backwards.\n" ! "b\n" ! "Move back one page.\n" ! "<return>\n" ! "Move ahead one page.\n" ! "n\n" ! "Move to the next file in the group of files being paged.\n" ! "m<tag>\n" ! "Mark the current line and asociate it with tag. You can mark " ! "any number of lines.\n" ! ",<tag>\n" ! "Move to the named tag.\n" ! "g<line>, G<line>\n" ! "Go to the named line. If no line is named, 'g' goes to the " ! "beginning of the file. In contras, 'G' will go to the end.\n" ! "p<percent>\n" ! "Move to the line <percent> lines into the file.\n" ! "q\n" ! "Quit out of the pager."); } diff -c -r --new-file ds1.1/lib/lib/persist.c ds2.0r27/lib/lib/persist.c *** ds1.1/lib/lib/persist.c Sun Feb 1 21:30:19 1998 --- ds2.0r27/lib/lib/persist.c Wed Jul 5 00:00:58 2006 *************** *** 7,13 **** #include "include/persist.h" private int SaveRecurse; ! private mixed *Saved = ({}); string GetShort(); --- 7,13 ---- #include "include/persist.h" private int SaveRecurse; ! mixed *Saved = ({}); string GetShort(); *************** *** 15,20 **** --- 15,21 ---- string *flat = ({}); mixed *tmp; + //tc("Hit eventConvertObject","red"); if( val[0] != base_name(this_object()) ) error("Invalid save string.\n"); tmp = map(Saved, (: functionp($1) ? evaluate($1, "loading") : $1 :)); foreach(mixed elem in tmp) { *************** *** 27,33 **** if( sizeof(val) == 3 ) { foreach(string obdata in val[2]) { object ob; ! val = restore_variable(obdata); ob = new(val[0]); ob->eventLoadObject(val, 1); --- 28,34 ---- if( sizeof(val) == 3 ) { foreach(string obdata in val[2]) { object ob; ! val = restore_variable(obdata); ob = new(val[0]); ob->eventLoadObject(val, 1); *************** *** 46,52 **** /* This converst NM IV - IVr2.2 data into NM data */ if( arrayp(data) ) return eventConvertObject(data, recurse); if( data["#base_name#"] != base_name(this_object()) ) ! error("Invalid save string.\n"); tmp = map(Saved, (: functionp($1) ? evaluate($1, "loading") : $1 :)); foreach(mixed elem in tmp) { if( arrayp(elem) ) flat += elem; --- 47,53 ---- /* This converst NM IV - IVr2.2 data into NM data */ if( arrayp(data) ) return eventConvertObject(data, recurse); if( data["#base_name#"] != base_name(this_object()) ) ! error("Invalid save string.\n"); tmp = map(Saved, (: functionp($1) ? evaluate($1, "loading") : $1 :)); foreach(mixed elem in tmp) { if( arrayp(elem) ) flat += elem; *************** *** 60,66 **** if( data["#inventory#"] ) { foreach(mixed obdata in data["#inventory#"]) { object ob; ! val = restore_variable(obdata); if( arrayp(val) ) { catch(ob = new(val[0])); --- 61,67 ---- if( data["#inventory#"] ) { foreach(mixed obdata in data["#inventory#"]) { object ob; ! val = restore_variable(obdata); if( arrayp(val) ) { catch(ob = new(val[0])); *************** *** 75,93 **** } if( recurse ) { object prev = previous_object(); ! if( !eventMove(prev) ) { call_out(function(object p) { ! object env = environment(p); ! ! if( !env ) { ! p->eventPrint("You lose " + GetShort() + "."); ! } ! else { ! p->eventPrint("You drop " + GetShort() + "."); ! eventMove(env); ! } ! }, 1, prev); } } } --- 76,94 ---- } if( recurse ) { object prev = previous_object(); ! if( !eventMove(prev) ) { call_out(function(object p) { ! object env = environment(p); ! ! if( !env ) { ! p->eventPrint("You lose " + GetShort() + "."); ! } ! else { ! p->eventPrint("You drop " + GetShort() + "."); ! eventMove(env); ! } ! }, 1, prev); } } } *************** *** 108,117 **** if( arrayp(elem) ) flat += elem; else flat += ({ elem }); } ! flat -= ({ 0 }); ! foreach(string var in flat) mp[var] = fetch_variable(var); mp["#base_name#"] = base_name(this_object()); if( SaveRecurse ) ! mp["#inventory#"] = (string *)all_inventory()->GetSaveString() - ({ 0 }); return save_variable(mp); } --- 109,122 ---- if( arrayp(elem) ) flat += elem; else flat += ({ elem }); } ! if(flat && sizeof(flat)){ ! flat -= ({ 0 }); ! foreach(mixed var in flat) { ! if(stringp(var)) mp[var] = fetch_variable(var); ! } ! } mp["#base_name#"] = base_name(this_object()); if( SaveRecurse ) ! mp["#inventory#"] = (string *)all_inventory()->GetSaveString() - ({ 0 }); return save_variable(mp); } diff -c -r --new-file ds1.1/lib/lib/pile.c ds2.0r27/lib/lib/pile.c *** ds1.1/lib/lib/pile.c Sun Feb 1 21:30:19 1998 --- ds2.0r27/lib/lib/pile.c Wed Jul 5 00:00:58 2006 *************** *** 1,5 **** /* /lib/pile.c ! * from the Dead Soulsr2 Object Library * basically a pile of precious coinses * created by Descartes of Borg 951029 * Version: @(#) pile.c 1.2@(#) --- 1,5 ---- /* /lib/pile.c ! * from the Dead Souls Object Library * basically a pile of precious coinses * created by Descartes of Borg 951029 * Version: @(#) pile.c 1.2@(#) *************** *** 14,20 **** --- 14,24 ---- private int PileAmount = 0; static void create() { + string *saveds; item::create(); + saveds = item::GetSave(); + saveds += ({ "PileType", "PileAmount" }); + AddSave( saveds ); SetKeyName("pile"); } *************** *** 66,72 **** return 1; } send_messages("get", "$agent_name $agent_verb " + amount + " " + ! curr + " " + GetShort() + ".", who, 0, environment(who)); PileAmount -= amount; if( PileAmount < 1 ) { call_out((: Destruct :), 0); --- 70,76 ---- return 1; } send_messages("get", "$agent_name $agent_verb " + amount + " " + ! curr + " " + GetShort() + ".", who, 0, environment(who)); PileAmount -= amount; if( PileAmount < 1 ) { call_out((: Destruct :), 0); *************** *** 84,89 **** --- 88,94 ---- return x; } environment()->AddCurrency(PileType, PileAmount); + environment()->AddCarriedMass(-this_object()->GetMass()); SetShort("a pile of " + PileAmount + " " + PileType); PileAmount = 0; call_out((: Destruct :), 0); *************** *** 92,98 **** mixed direct_get_wrd_wrd_out_of_obj(string num, string curr) { int amt; ! if( environment() != environment(this_player()) ) { return "#You cannot reach the pile!"; } --- 97,103 ---- mixed direct_get_wrd_wrd_out_of_obj(string num, string curr) { int amt; ! if( environment() != environment(this_player()) ) { return "#You cannot reach the pile!"; } diff -c -r --new-file ds1.1/lib/lib/pistol.c ds2.0r27/lib/lib/pistol.c *** ds1.1/lib/lib/pistol.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/pistol.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,508 ---- + #include "include/pistol.h" + #include <lib.h> + #include <damage_types.h> + #include <dirs.h> + inherit LIB_STORAGE; + inherit LIB_WEAPON; + inherit LIB_SHOOT; + + private int MaxAmmo, Millimeter, AmmoSize; + private string PistolType, AmmoType; + private string AmmoFile; + private float Caliber; + private string *namen; + private string *ammonamen; + private int loaded, rounds; + private int shells; + private int mag,cloned; + private int autohit; + private int dam; + + static void create(){ + string *s_save, *w_save, *a_save; + + ::create(); + + s_save = storage::GetSave(); + w_save = weapon::GetSave(); + a_save = s_save + w_save; + + AddSave( a_save ); + AddSave( ({ "loaded", "rounds", "shells" , "mag" , "cloned" }) ); + MaxAmmo=6; + AmmoFile="/domains/town/obj/round"; + PistolType="revolver"; + AmmoType="round"; + loaded=1; + rounds=0; + } + void init(){ + object ob; + object *inv; + add_action("startLoad","load"); + add_action("startUnload","unload"); + this_object()->CalculateAmmoSize(); + namen=this_object()->GetId(); + if(PistolType=="revolver" + && !present("cylinder",this_object())){ + new("/lib/cylinder")->eventMove(this_object()); + } + if(PistolType=="revolver" && !cloned){ + cloned=1; + ob=present("cylinder", this_object()); + inv=all_inventory(ob); + filter(inv, (: this_object()->InitRevolver($1->GetId()) :) ); + } + if(PistolType=="auto" && !present("clip",this_object()) ) { + mag=0; + loaded=0; + rounds=0; + } + } + int InitRevolver(string *arr){ + if(member_array("round",arr) != -1){ + rounds++; + return 1; + } + if(member_array("shell",arr) != -1){ + shells++; + return 1; + } + } + mixed CanGetFrom(object who, object item) { + return "It doesn't work that way. Try unloading it."; + } + + mixed CanPutInto(object who, object what) { + return "It doesn't work that way. Try loading the pistol with something."; + } + + int CanReceive(object ob){ + string *idarray; + if(PistolType=="revolver"){ + idarray=ob->GetId(); + if(member_array("round",idarray) != -1){ + write("Try: load pistol with round."); + return 0; + } + } + if(PistolType != "auto" && ob->GetKeyName() != "revolver cylinder"){ + write("This pistol only receives bullets."); + return 0; + } + idarray=ob->GetId(); + if(PistolType=="auto" && member_array("magazine",idarray) == -1){ + write("This pistol only receives ammunition clips."); + return 0; + } + if(PistolType=="auto" && ob->GetMillimeter() != this_object()->GetMillimeter() ){ + write("That is not the correct ammunition clip size."); + return 0; + } + if(PistolType=="auto" && ob->GetCaliber() != this_object()->GetCaliber() ){ + write("That is not the correct ammunition clip caliber."); + return 0; + } + if(PistolType=="auto" && ob->GetAmmoType() != this_object()->GetAmmoType() ){ + write("That is not the correct ammunition clip type."); + return 0; + } + if(PistolType=="auto" && mag){ + write("The pistol is already loaded."); + return 0; + } + if(PistolType=="auto"){ + mag=1; + rounds=sizeof(all_inventory(ob)); + } + return 1; + } + int CanRelease(object ob){ + if(ob->GetKeyName()=="revolver cylinder"){ + write("The cylinder is not a removable part of the pistol."); + return 0; + } + return 1; + } + + int eventShoot(object ob, string str){ + if(!rounds || rounds == 0){ + write("Your weapon is not loaded.\n"); + say(environment(this_object())->GetName()+" tries to shoot "+capitalize(str)+" with an unloaded weapon.\n"); + return 1; + } + write("You shoot at "+capitalize(str)+"!\n"); + say(environment(this_object())->GetName()+" shoots at "+capitalize(str)+"!\n"); + tell_object(present(str,environment(environment(this_object()))), environment(this_object())->GetName()+ + " shoots at you!\n"); + this_object()->eventFire(str); + if(PistolType=="auto") new("/lib/shell")->eventMove(environment(environment(this_object()))); + return 1; + } + + int eventFire(string str){ + object ob; + int tempclass, i, dex; + int TorsoNum, NumLimbs; + mixed dexmap; + string tempshort,templong; + string *limbarr; + int limbhit; + string limbname; + string s1,s2; + rounds--; + if(this_object()->GetPistolType() == "auto"){ + if(first_inventory(present("magazine",this_object())) ){ + first_inventory(present("magazine",this_object()))->eventDestruct(); + present("magazine",this_object())->MinusAmmo(1); + } + else rounds=0; + } + if(this_object()->GetPistolType() == "revolver"){ + shells++; + ob=present("cylinder",this_object()); + present("round",ob)->eventDestruct(); + new("/lib/shell")->eventMove(ob); + } + if(rounds <= 0) loaded=0; + ob=present(str,environment(environment(this_object()))); + if(creatorp(ob)){ + write(ob->GetName()+" catches your bullet in "+possessive(ob)+" teeth.\n"); + say(ob->GetName()+" catches the bullet in "+possessive(ob)+" teeth.\n"); + autohit=0; + return 1; + } + if(!living(ob)){ + if(!sscanf(ob->GetLong(),"%sIt has been damaged by gun%s",s1,s2)){ + tempclass=ob->GetClass(); + if(tempclass) ob->SetClass(tempclass/2); + tempshort=ob->GetShort(); + tempshort = "A damaged "+remove_article(tempshort); + ob->SetShort(tempshort); + templong=ob->GetLong(); + if(sscanf(templong,"%s\n\n%s",s1,s2) >=1){ + templong=s1+" It has been damaged by gunfire.\n\n"; + } + else + templong += " It has been damaged by gunfire."; + ob->SetLong(templong); + tell_room(environment(environment(this_object())),"The bullet smashes into "+lower_case(ob->GetShort())+"!\n"); + return 1; + } + tell_room(environment(environment(this_object())),"The bullet smashes into "+lower_case(ob->GetShort())+"!\n"); + tempclass=ob->GetClass(); + if(tempclass) ob->SetClass(tempclass/2); + return 1; + } + i = random(100); + if(!creatorp(environment())){ + dexmap=environment(this_object())->GetStat("coordination"); + dex=dexmap["level"]; + } + else dex = 200; + if(i < dex || autohit==1){ + NumLimbs=sizeof(ob->GetLimbs()); + TorsoNum=member_array("torso",ob->GetLimbs()); + i=random(100); + if(i < 50) limbhit=TorsoNum; + else limbhit=random(NumLimbs); + limbarr=ob->GetLimbs(); + limbname=limbarr[limbhit]; + tell_room(environment(environment(this_object())),"The bullet smashes into "+ + capitalize(str)+"'s "+limbname+"!\n",ob); + tell_object(ob,"The bullet smashes into your "+limbname+"!\n"); + ob->AddLead("gunshot_wounds", 1); + ob->SetAttack(this_agent()); + if(!present("firearms_wound",ob)){ + new("/domains/town/obj/wound")->eventMove(ob); + } + if(Caliber) dam = to_int(Caliber/6); + if(Millimeter) dam = Millimeter; + if(!dam) dam = 7; + dam *= random(10); + dam += random(environment(this_object())->GetStatLevel("coordination")); + dam += environment(this_object())->GetSkillLevel("projectile attack"); + if(creatorp(this_player())) write("you do "+dam+" points of damage"); + + ob->eventReceiveDamage(environment(this_object()),BLUNT, dam, 1, limbname); + if(!ob->GetInCombat()){ + ob->eventForce("attack "+environment(this_object())->GetKeyName()); + } + autohit=0; + return 1; + } + write("Your shot misses its mark.\n"); + say(environment(this_object())->GetName()+"'s shot misses its mark.\n"); + this_object()->missed_shot(); + return 1; + } + int missed_shot(){ + object ob,maghere,magstuff; + string str; + int i; + object *inv; + string *arr; + if(environment(environment(this_object()))->GetClimate() != "indoors"){ + return 1; + } + inv=all_inventory(environment(environment(this_object()))); + i=random(sizeof(inv)); + if(living(inv[i])){ + tell_room(environment(environment(this_object())), inv[i]->GetName()+" is struck "+ + "by the stray bullet!",inv[i]); + tell_object(inv[i],"You are struck by a stray bullet from "+environment(this_object())->GetName()+ + "'s gun.\n"); + } + if(!living(inv[i])){ + arr=explode(inv[i]->GetKeyName(),""); + if(arr[sizeof(arr)-1] =="s"){ + tell_room(environment(environment(this_object())),capitalize(inv[i]->GetShort())+" are struck by the stray bullet."); + } + else + tell_room(environment(environment(this_object())),capitalize(inv[i]->GetShort())+" is struck by the stray bullet."); + } + autohit=1; + rounds++; + this_object()->eventFire(inv[i]->GetKeyName()); + if(this_object()->GetPistolType() == "revolver"){ + shells--; + present("shell",present("cylinder",this_object()))->eventDestruct(); + ob=new("/lib/round"); + ob->SetCaliber(this_object()->GetCaliber()); + ob->SetMillimeter(this_object()->GetMillimeter()); + ob->SetPistolType(this_object()->GetPistolType()); + ob->SetAmmoType(this_object()->GetAmmoType()); + ob->eventMove(present("cylinder",this_object())); + } + else + { + str = ""; + maghere=present("magazine",this_object()); + if(maghere) magstuff = first_inventory(maghere); + if(maghere && magstuff) str=base_name(magstuff); + if(str && str !="" ) new(str)->eventMove(maghere); + } + return 1; + } + int CalculateAmmoSize(){ + float i; + i=this_object()->GetCaliber(); + if(i > 0){ + if(stringp(i)) sscanf(i,"%d",i); + if(intp(i)) to_float(i); + while(i > 1.0){ + i = i*(0.1); + } + i = i*(25.4); + AmmoSize=to_int(i); + dam=AmmoSize*(AmmoSize); + dam *= 3; + return 1; + } + AmmoSize=this_object()->GetMillimeter(); + return 1; + } + int ShowRounds() { environment(this_object())->eventPrint("Pistol has: "+rounds+" rounds.\n"); + environment(this_object())->eventPrint("Pistol has: "+shells+" shells.\n"); + return 1; + } + int SetAmmo(int i) { rounds=i; return 1; } + int GetAmmo(int i) { return rounds; } + int GetMag(int i) { return mag; } + int SetMag(int i) { mag=i; return 1; } + int SetLoaded(int i) { loaded=i; return 1; } + int GetLoaded(int i) { return loaded; } + int SetAmmoFile(string str) { AmmoFile=str; return 1; } + int SetAmmoType(string str) { AmmoType=str; return 1; } + int SetPistolType(string str) { PistolType=str; return 1; } + int SetMaxAmmo(int x) { MaxAmmo=x; return 1; } + int SetCaliber(int x) { Caliber=x; return 1; } + int SetMillimeter(int x) { Millimeter=x; return 1; } + string GetAmmoType() { return AmmoType; } + string GetPistolType() { return PistolType; } + int GetMaxAmmo() { return MaxAmmo; } + int GetCaliber() { return Caliber; } + int GetMillimeter() { return Millimeter; } + + int startLoad(string str){ + string s1,s2; + if(!str || str== "") return 0; + if(member_array(str, namen) != -1){ + write("Load pistol with what?"); + return 1; + } + if(sscanf(str,"%s with %s",s1,s2) >= 1){ + if(!present(s1,environment(this_object()))){ + write("You have no such thing to load.\n"); + return 1; + } + if(member_array(s1,namen) == -1){ + present(s1, environment(this_object()))->startLoad(str); + return 1; + } + if(PistolType=="revolver"){ + this_object()->LoadRevolver(s2); + return 1; + } + if(PistolType=="auto"){ + this_object()->LoadAuto(s2); + return 1; + } + write("Your pistol seems not to be loadable.\n"); + return 1; + } + if(member_array(s1,namen) != -1){ + write("Load it with what?\n"); + return 1; + } + } + int LoadAuto(string str){ + object ob; + string junk; + ob=present(str,environment(this_object())); + if(!ob){ + write("You have no such thing to load your pistol with."); + return 1; + } + write("You load your pistol."); + say(environment(this_object())->GetName()+" loads an ammunition clip into "+ + possessive(environment(this_object()))+" semiautomatic pistol."); + ob->eventMove(this_object()); + if(!sizeof(deep_inventory(present("magazine",this_object())))) return 1; + if(!AmmoFile=file_name(first_inventory(present("magazine",this_object()))) ) { + AmmoFile="/lib/round"; + } + else sscanf(AmmoFile,"%s#%s",AmmoFile,junk); + return 1; + } + int LoadRevolver(string str){ + object ob; + ob=present(str,environment(this_object())); + if(!ob){ + write("You do not have that to load with.\n"); + return 1; + } + ammonamen=ob->GetId(); + if(member_array("bullet",ammonamen) == -1){ + write("That is not something you can load your pistol with.\n"); + return 1; + } + if(ob->GetPistolType() != "revolver"){ + write("That's not revolver ammunition.\n"); + return 1; + } + if(ob->GetAmmoType() != this_object()->GetAmmoType()){ + write("That's the incorrect ammunition for this pistol.\n"); + return 1; + } + if(rounds + shells == MaxAmmo){ + write("Your pistol cannot hold any more rounds.\n"); + return 1; + } + write("You load a round into your pistol.\n"); + say(environment(this_object())->GetName()+" loads a bullet into "+ + possessive(environment(this_object()))+" revolver."); + rounds++; + ob->eventMove(present("revolver cylinder",this_object())); + return 1; + } + int startUnload(string str){ + string n1,s1,s2; + int n2; + if(!str || str== "") return 0; + if(mag==1 && member_array(str,namen) != -1){ + this_object()->doMagUnload(); + return 1; + } + if(PistolType=="revolver" && member_array(str,namen) != -1){ + if(rounds == 0 && shells == 0){ + write("Your pistol is already empty."); + return 1; + } + write("You unload your pistol."); + this_object()->doRevolverUnload("all","all"); + return 1; + } + if(sscanf(str,"%s %s from %s",n1,s1,s2) >=1){ + if(!sscanf(n1,"%d",n2)){ + write("You must specify a number of items to unload.\n"); + return 1; + } + if(member_array(s2,namen) == -1){ + if(!present(s2, environment(this_object()))){ + write("You have no such thing to unload.\n"); + return 1; + } + present(s2,environment(this_object()))->UnloadRevolver(str); + return 1; + } + if(s1=="shell" || s1=="shells"){ + if(!shells){ + write("There are no shells in the pistol.\n"); + return 1; + } + if(shells < n2){ + write("There aren't that many shells in the pistol.\n"); + return 1; + } + this_object()->doRevolverUnload("shells",n1); + return 1; + } + if(s1=="bullet" || s1=="bullets" || s1=="round"|| s1=="rounds"){ + if(!rounds){ + write("There are no rounds in the pistol.\n"); + return 1; + } + if(rounds < n2){ + write("There aren't that many rounds in the pistol.\n"); + return 1; + } + this_object()->doRevolverUnload("rounds",n1); + return 1; + } + } + } + + int doMagUnload(){ + if(!present("clip",this_object())){ + write("The pistol is already empty."); + return 0; + } + write("You unload an ammo clip from your pistol."); + say(this_player()->GetName()+" unloads an ammo clip from "+possessive(this_player())+" pistol."); + present("clip",this_object())->eventMove(environment(this_object())); + mag=0; + loaded=0; + rounds=0; + return 1; + } + + int doRevolverUnload(string what, string num){ + int i,n1,n2; + if(sscanf(num,"%d",n1)){ + } + if(what=="all"){ + n1=shells; + n2=rounds; + } + if(what=="shells" || what=="all"){ + i=shells-n1; + while(shells > i){ + present("shell",present("revolver cylinder",this_object()))->eventMove(environment(this_object())); + shells--; + } + } + if(what=="rounds" || what=="all"){ + if(what != "all") n2=n1; + i=rounds-n2; + while(rounds > i){ + present("round",present("revolver cylinder",this_object()))->eventMove(environment(this_object())); + rounds--; + } + } + if(n2 > 0) write("You unload "+n2+" rounds from your pistol."); + if(n1 > 0) write("You unload "+n1+" shells from your pistol."); + say(environment(this_object())->GetName()+" unloads some cartridges from "+ + possessive(environment(this_object()))+" revolver."); + return 1; + } diff -c -r --new-file ds1.1/lib/lib/player.c ds2.0r27/lib/lib/player.c *** ds1.1/lib/lib/player.c Sun Feb 1 21:30:10 1998 --- ds2.0r27/lib/lib/player.c Wed Jul 5 00:00:58 2006 *************** *** 13,24 **** --- 13,26 ---- #include <daemons.h> #include <config.h> #include <vision.h> + #include <position.h> #include "include/player.h" inherit LIB_INTERACTIVE; inherit LIB_LIVING; private string *Titles; + string *Muffed = ({}); private class quest *Quests; private class death *Deaths; private int TrainingPoints, TitleLength; *************** *** 26,50 **** /* ***************** /lib/player.c driver applies ***************** */ static void create() { ! AddSave( ({ "CarriedMass" }) ); interactive::create(); living::create(); Titles = ({}); TitleLength = 1; Quests = ({}); } static void heart_beat() { - object *inv; - string *cns; - int i; if(!interactive(this_object())) { ! set_heart_beat(0); ! return; } interactive::heart_beat(); ! if( query_idle(this_object()) >= 3600 ) { cmdQuit(0); return; } --- 28,50 ---- /* ***************** /lib/player.c driver applies ***************** */ static void create() { ! AddSave( ({ "Properties", "CarriedMass", "Muffed" }) ); interactive::create(); living::create(); + Titles = ({}); TitleLength = 1; Quests = ({}); } static void heart_beat() { if(!interactive(this_object())) { ! set_heart_beat(0); ! return; } interactive::heart_beat(); ! if( query_idle(this_object()) >= IDLE_TIMEOUT && !creatorp(this_object()) && !present("testchar badge",this_object()) ) { cmdQuit(0); return; } *************** *** 84,90 **** varargs int eventShow(object who, string str) { if( !living::eventShow(who, str) ) return 0; if( this_player() != this_object() ) ! eventPrint((string)this_player()->GetName() + " looks you over."); return 1; } --- 84,90 ---- varargs int eventShow(object who, string str) { if( !living::eventShow(who, str) ) return 0; if( this_player() != this_object() ) ! eventPrint((string)this_player()->GetName() + " looks you over."); return 1; } *************** *** 92,98 **** int eventDisplayStatus() { string str; ! int hp, mp, sp, max_hp, max_mp, max_sp; hp = GetHealthPoints(); max_hp = GetMaxHealthPoints(); --- 92,98 ---- int eventDisplayStatus() { string str; ! int qp, xp, hp, mp, sp, max_hp, max_mp, max_sp; hp = GetHealthPoints(); max_hp = GetMaxHealthPoints(); *************** *** 100,114 **** max_mp = GetMaxMagicPoints(); sp = GetStaminaPoints(); max_sp = GetMaxStaminaPoints(); if( percent(hp, max_hp) < 20.0 ) ! str = "%^YELLOW%^hp: %^RED%^" + hp + "%^RESET%^/" + max_hp; else str = "%^YELLOW%^hp: %^RESET%^" + hp + "/" + max_hp; if( percent(mp, max_mp) < 20.0 ) ! str += " %^BLUE%^mp: %^RED%^" + mp + "%^RESET%^/" + max_mp; else str += " %^BLUE%^mp: %^RESET%^" + mp + "/" + max_mp; if( percent(sp, max_sp) < 20.0 ) ! str += " %^GREEN%^sp: %^RED%^" + sp + "%^RESET%^/" + max_sp; else str += " %^GREEN%^sp: %^RESET%^" + sp + "/" + max_sp; message("status", str, this_object()); return 1; } --- 100,119 ---- max_mp = GetMaxMagicPoints(); sp = GetStaminaPoints(); max_sp = GetMaxStaminaPoints(); + xp = GetExperiencePoints(); + qp = GetQuestPoints(); + if( percent(hp, max_hp) < 20.0 ) ! str = "%^YELLOW%^hp: %^RED%^" + hp + "%^RESET%^/" + max_hp; else str = "%^YELLOW%^hp: %^RESET%^" + hp + "/" + max_hp; if( percent(mp, max_mp) < 20.0 ) ! str += " %^BLUE%^mp: %^RED%^" + mp + "%^RESET%^/" + max_mp; else str += " %^BLUE%^mp: %^RESET%^" + mp + "/" + max_mp; if( percent(sp, max_sp) < 20.0 ) ! str += " %^GREEN%^sp: %^RED%^" + sp + "%^RESET%^/" + max_sp; else str += " %^GREEN%^sp: %^RESET%^" + sp + "/" + max_sp; + str += " %^MAGENTA%^xp: %^RESET%^" + xp; + str += " %^CYAN%^qp: %^RESET%^" + qp; message("status", str, this_object()); return 1; } *************** *** 116,148 **** static void eventDestroyUndead(object agent) { } ! varargs int eventDie(object agent) { ! int x; if( (x = living::eventDie(agent)) != 1 ) return x; if( !GetUndead() ) { eventDestroyUndead(agent); } else { ! message("my_action", "Consciousness passes from you after one last " ! "gasp for air.", this_object()); ! message("my_action", "You awake, but you find your body feels " ! "different, and the world about you is unfamiliar.", ! this_object()); ! if( agent ) { ! message("other_action", GetName() + " drops dead by the hand " ! "of " + (string)agent->GetName() + ".", ! environment(this_object()), ({ agent, this_object() })); ! message("other_action", "You send " + GetName() + " into the " ! "Underworld.", agent); ! } ! else message("other_action", GetName() + " drops dead.", ! environment(), ({ this_object() }) ); ! NewBody(GetRace()); ! eventCompleteHeal(GetMaxHealthPoints()/2); ! AddMagicPoints(-(random(GetMagicPoints()))); ! interactive::eventMove(ROOM_DEATH); } return 1; } --- 121,162 ---- static void eventDestroyUndead(object agent) { } ! varargs int eventDie(mixed agent) { ! int x, expee, subexpee; if( (x = living::eventDie(agent)) != 1 ) return x; if( !GetUndead() ) { eventDestroyUndead(agent); } else { ! message("my_action", "Consciousness passes from you after one last " ! "gasp for air.", this_object()); ! message("my_action", "You awake, but you find your body feels " ! "different, and the world about you is unfamiliar.", ! this_object()); ! if( agent ) { ! message("other_action", GetName() + " drops dead by the hand " ! "of " + (string)agent->GetName() + ".", ! environment(this_object()), ({ agent, this_object() })); ! message("other_action", "You send " + GetName() + " into the " ! "Underworld.", agent); ! } ! else message("other_action", GetName() + " drops dead.", ! environment(), ({ this_object() }) ); ! ! NewBody(GetRace()); ! ! expee = this_object()->GetExperiencePoints(); ! subexpee = to_int(expee * 0.25); ! ! eventCompleteHeal(GetMaxHealthPoints()/2); ! AddMagicPoints(-(random(GetMagicPoints()))); ! interactive::eventMove(ROOM_DEATH); ! this_object()->AddExperiencePoints(-subexpee); ! this_object()->save_player((string)this_object()->GetKeyName()); ! this_object()->eventForce("look"); } + flush_messages(); return 1; } *************** *** 159,167 **** if( !GetUndead() ) return; SetUndead(0); foreach(skill in GetSkills()) { int x; ! if( !random(4) ) { continue; } --- 173,184 ---- if( !GetUndead() ) return; SetUndead(0); + if(this_player()->GetPoison() > 0){ + this_player()->AddPoison(0 - this_player()->GetPoison()); + } foreach(skill in GetSkills()) { int x; ! if( !random(4) ) { continue; } *************** *** 175,193 **** if( x > 0 ) { while( x-- ) { AddSkillPoints(skill, ! -GetMaxSkillPoints(skill, ! GetBaseSkillLevel(skill))); } } } NewBody(GetRace()); eventCompleteHeal(GetMaxHealthPoints()); AddMagicPoints(-(GetMaxMagicPoints()/2)); } int eventMove(mixed dest) { int ret; ret = interactive::eventMove(dest); eventMoveFollowers(environment(this_object())); return ret; --- 192,219 ---- if( x > 0 ) { while( x-- ) { AddSkillPoints(skill, ! -GetMaxSkillPoints(skill, ! GetBaseSkillLevel(skill))); } } } NewBody(GetRace()); eventCompleteHeal(GetMaxHealthPoints()); + SetSpecialTarget( ({}) ); AddMagicPoints(-(GetMaxMagicPoints()/2)); + AddStaminaPoints(-(GetMaxStaminaPoints()/2)); + AddHealthPoints(-(GetMaxHealthPoints()/2)); + if(creatorp()) interactive::SetShort("$N the reborn"); } int eventMove(mixed dest) { int ret; + if(environment(this_player()) && base_name(environment(this_player()))) { + this_player()->SetProperty("LastLocation", + base_name(environment(this_player()))); + } + ret = interactive::eventMove(dest); eventMoveFollowers(environment(this_object())); return ret; *************** *** 195,326 **** varargs int eventMoveLiving(mixed dest, string omsg, string imsg) { object *inv; ! object prev, env; string prevclim, newclim; if( prev = environment() ) { ! prevclim = (string)prev->GetClimate(); ! if( stringp(dest) ) { ! if(dest[0] != '/') { ! string *arr; ! ! arr = explode(file_name(prev), "/"); ! dest = "/"+implode(arr[0..sizeof(arr)-2], "/")+"/"+dest; ! } ! } ! if( !interactive::eventMove(dest) ) { eventPrint("You remain where you are.", MSG_SYSTEM); ! return 0; ! } ! inv = filter(all_inventory(prev), (: (!GetInvis($1) && living($1) && ! !GetProperty("stealthy") && ! ($1 != this_object())) :)); ! if( !omsg || omsg == "" ) omsg = GetMessage("telout"); ! else omsg = GetMessage("leave", omsg); inv->eventPrint(omsg, MSG_ENV); } else if( !interactive::eventMove(dest) ) { eventPrint("You remain where you are.", MSG_SYSTEM); ! return 0; } inv = filter(all_inventory(environment()), ! (: (!GetInvis($1) && !GetProperty("stealthy") && ! living($1) && ($1 != this_object())) :)); if( (!imsg || imsg == "") && (!omsg || omsg == "") ) ! imsg = GetMessage("telin"); else if( !imsg || imsg == "" ) imsg = GetMessage("come", imsg); else imsg = replace_string(imsg, "$N", GetName()); inv->eventPrint(imsg, MSG_ENV); ! if(GetInvis()) { ! AddStaminaPoints(-(15-(GetSkillLevel("stealth")/10))); ! AddSkillPoints("stealth", 30 + GetSkillLevel("stealth")*2); ! eventPrint("%^RED%^You move along quietly....%^RESET%^\n"); ! } ! if(GetProperty("stealthy")) { ! AddStaminaPoints(-3 - random(3)); ! AddSkillPoints("stealth", 10 + GetSkillLevel("stealth")*2); ! } eventDescribeEnvironment(GetBriefMode()); newclim = (string)environment()->GetClimate(); if( !GetUndead() ) switch( newclim ) { ! case "arid": ! AddStaminaPoints(-0.3); ! break; ! case "tropical": ! AddStaminaPoints(-0.3); ! break; ! case "sub-tropical": ! AddStaminaPoints(-0.2); ! break; ! case "sub-arctic": ! AddStaminaPoints(-0.2); ! break; ! case "arctic": ! AddStaminaPoints(-0.3); ! break; ! default: ! AddStaminaPoints(-0.1); ! break; } if( prevclim != newclim && prevclim != "indoors" && newclim != "indoors" ){ ! switch(prevclim) { ! case "arid": ! if( newclim == "tropical" || newclim == "sub-tropical" ) ! message("environment", "The air is much more humid.", ! this_object()); ! else message("environment", "The air is getting a bit cooler.", ! this_object()); ! break; ! case "tropical": ! if( newclim != "arid" ) ! message("environment", "The air is not quite as humid.", ! this_object()); ! else message("environment", "The air has become suddenly dry.", ! this_object()); ! break; ! case "sub-tropical": ! if( newclim == "arid" ) ! message("environment", "The air has become suddenly dry.", ! this_object()); ! else if( newclim == "tropical" ) ! message("environment","The air has gotten a bit more humid.", ! this_object()); ! else message("environment", "The air is not quite as humid.", ! this_object()); ! break; ! case "temperate": ! if( newclim == "arid" ) ! message("environment", "The air is a bit drier and warmer.", ! this_object()); ! else if( newclim == "tropical" ) ! message("environment", "The air is much more humid.", ! this_object()); ! else if( newclim == "sub-tropical" ) ! message("environment", "The air is a bit more humid.", ! this_object()); ! else message("environment", "The air is a bit colder now.", ! this_object()); ! break; ! case "sub-arctic": ! if( newclim == "arid" || newclim == "tropical" || ! newclim == "sub-tropical" ) ! message("environment", "It has suddenly grown very hot.", ! this_object()); ! else if( newclim == "arctic" ) ! message("environment", "It is a bit cooler than before.", ! this_object()); ! else message("environment", "It is not quite as cold as " ! "before.", this_object()); ! break; ! case "arctic": ! if( newclim == "sub-arctic" ) ! message("environment", "It is not quite as cold now.", ! this_object()); ! else message("environment", "It is suddenly much warmer than " ! "before.", this_object()); ! } } eventMoveFollowers(environment(this_object())); return 1; } --- 221,373 ---- varargs int eventMoveLiving(mixed dest, string omsg, string imsg) { object *inv; ! object prev; string prevclim, newclim; if( prev = environment() ) { ! prevclim = (string)prev->GetClimate(); ! if( stringp(dest) ) { ! if(dest[0] != '/') { ! string *arr; ! ! arr = explode(file_name(prev), "/"); ! dest = "/"+implode(arr[0..sizeof(arr)-2], "/")+"/"+dest; ! } ! } ! if( !interactive::eventMove(dest) ) { eventPrint("You remain where you are.", MSG_SYSTEM); ! return 0; ! } ! inv = filter(all_inventory(prev), (: (!GetInvis($1) && living($1) && ! !GetProperty("stealthy") && ! ($1 != this_object())) :)); ! if( !omsg || omsg == "" ) omsg = GetMessage("telout"); ! else if(GetPosition() == POSITION_SITTING || ! GetPosition() == POSITION_LYING ){ ! omsg = GetName()+" crawls "+omsg+"."; ! } ! else if(GetPosition() == POSITION_FLYING ){ ! omsg = GetName()+" flies "+omsg+"."; ! } ! ! else omsg = GetMessage("leave", omsg); inv->eventPrint(omsg, MSG_ENV); } else if( !interactive::eventMove(dest) ) { eventPrint("You remain where you are.", MSG_SYSTEM); ! return 0; } inv = filter(all_inventory(environment()), ! (: (!GetInvis($1) && !GetProperty("stealthy") && ! living($1) && ($1 != this_object())) :)); if( (!imsg || imsg == "") && (!omsg || omsg == "") ) ! imsg = GetMessage("telin"); ! else if(GetPosition() == POSITION_SITTING || ! GetPosition() == POSITION_LYING ){ ! imsg = GetName()+" crawls in."; ! } ! else if(GetPosition() == POSITION_FLYING){ ! imsg = GetName()+" flies in."; ! } ! else if( !imsg || imsg == "" ) imsg = GetMessage("come", imsg); else imsg = replace_string(imsg, "$N", GetName()); inv->eventPrint(imsg, MSG_ENV); ! if(GetInvis()) { ! AddStaminaPoints(-(15-(GetSkillLevel("stealth")/10))); ! AddSkillPoints("stealth", 30 + GetSkillLevel("stealth")*2); ! eventPrint("%^RED%^You move along quietly....%^RESET%^\n"); ! } ! if(GetProperty("stealthy")) { ! AddStaminaPoints(-3 - random(3)); ! AddSkillPoints("stealth", 10 + GetSkillLevel("stealth")*2); ! } eventDescribeEnvironment(GetBriefMode()); newclim = (string)environment()->GetClimate(); if( !GetUndead() ) switch( newclim ) { ! case "arid": ! AddStaminaPoints(-0.3); ! break; ! case "tropical": ! AddStaminaPoints(-0.3); ! break; ! case "sub-tropical": ! AddStaminaPoints(-0.2); ! break; ! case "sub-arctic": ! AddStaminaPoints(-0.2); ! break; ! case "arctic": ! AddStaminaPoints(-0.3); ! break; ! default: ! AddStaminaPoints(-0.1); ! break; } if( prevclim != newclim && prevclim != "indoors" && newclim != "indoors" ){ ! switch(prevclim) { ! case "arid": ! if( newclim == "tropical" || newclim == "sub-tropical" ) ! message("environment", "The air is much more humid.", ! this_object()); ! else message("environment", "The air is getting a bit cooler.", ! this_object()); ! break; ! case "tropical": ! if( newclim != "arid" ) ! message("environment", "The air is not quite as humid.", ! this_object()); ! else message("environment", "The air has become suddenly dry.", ! this_object()); ! break; ! case "sub-tropical": ! if( newclim == "arid" ) ! message("environment", "The air has become suddenly dry.", ! this_object()); ! else if( newclim == "tropical" ) ! message("environment","The air has gotten a bit more humid.", ! this_object()); ! else message("environment", "The air is not quite as humid.", ! this_object()); ! break; ! case "temperate": ! if( newclim == "arid" ) ! message("environment", "The air is a bit drier and warmer.", ! this_object()); ! else if( newclim == "tropical" ) ! message("environment", "The air is much more humid.", ! this_object()); ! else if( newclim == "sub-tropical" ) ! message("environment", "The air is a bit more humid.", ! this_object()); ! else message("environment", "The air is a bit colder now.", ! this_object()); ! break; ! case "sub-arctic": ! if( newclim == "arid" || newclim == "tropical" || ! newclim == "sub-tropical" ) ! message("environment", "It has suddenly grown very hot.", ! this_object()); ! else if( newclim == "arctic" ) ! message("environment", "It is a bit cooler than before.", ! this_object()); ! else message("environment", "It is not quite as cold as " ! "before.", this_object()); ! break; ! case "arctic": ! if( newclim == "sub-arctic" ) ! message("environment", "It is not quite as cold now.", ! this_object()); ! else message("environment", "It is suddenly much warmer than " ! "before.", this_object()); ! } } eventMoveFollowers(environment(this_object())); + if(environment(this_player()) && base_name(environment(this_player()))) { + this_player()->SetProperty("LastLocation", + base_name(environment(this_player()))); + } + return 1; } *************** *** 340,346 **** ob = previous_object(); if( !ob || !interactive::eventReleaseObject() ) return 0; if( ob->GetMass() ) ! AddCarriedMass( -((int)ob->GetMass()) ); return 1; } --- 387,393 ---- ob = previous_object(); if( !ob || !interactive::eventReleaseObject() ) return 0; if( ob->GetMass() ) ! AddCarriedMass( -((int)ob->GetMass()) ); return 1; } *************** *** 353,358 **** --- 400,406 ---- old_agent = this_agent(used); tmp = parse_sentence(cmd); this_agent(old_agent); + message("info", tmp, this_object()); if( stringp(tmp) ) message("error", tmp, this_object()); else return tmp; } *************** *** 369,386 **** if( !interactive::Setup() ) return 0; if( avatarp() ) AddChannel(({ "avatar" })); if( high_mortalp() ) AddChannel( ({ "newbie", "hm" }) ); ! if( newbiep() ) AddChannel( ({ "newbie" }) ); if( councilp() ) AddChannel( ({ "council" }) ); if( GetClass() ) { ! string classes; ! AddChannel(GetClass()); ! foreach(classes in (string array)CLASSES_D->GetClasses()) ! if( ClassMember(classes) && classes != GetClass() ) ! AddChannel(classes); } set_heart_beat(GetHeartRate()); return 1; } --- 417,489 ---- if( !interactive::Setup() ) return 0; if( avatarp() ) AddChannel(({ "avatar" })); if( high_mortalp() ) AddChannel( ({ "newbie", "hm" }) ); ! if( newbiep() ) AddChannel( ({ "newbie" }) ); ! else { ! RemoveChannel( ({ "newbie" }) ); ! AddChannel( ({ "gossip" }) ); ! } if( councilp() ) AddChannel( ({ "council" }) ); + if( !GetClass() ) SetClass("explorer"); if( GetClass() ) { ! string classes; ! AddChannel(GetClass()); ! foreach(classes in (string array)CLASSES_D->GetClasses()) ! if( ClassMember(classes) && classes != GetClass() ) ! AddChannel(classes); } + if(sizeof(GetExtraChannels())) AddChannel(GetExtraChannels()); set_heart_beat(GetHeartRate()); + if(GetProperty("brand_spanking_new")){ + object jeans, shirt, book; + + if(ENGLISH_ONLY) this_object()->SetNativeLanguage("English"); + PLAYERS_D->AddPlayerInfo(this_object()); + + jeans = new("/domains/default/armor/jeans"); + shirt = new("/domains/default/armor/shirt"); + book = new("/domains/default/obj/handbook"); + + if(jeans) jeans->eventMove(this_object()); + if(shirt) shirt->eventMove(this_object()); + if(book && !present("handbook",this_object())) book->eventMove(this_object()); + else if(book) book->eventMove(ROOM_FURNACE); + + if(jeans) this_object()->eventForce("wear jeans"); + if(shirt) this_object()->eventForce("wear shirt"); + SetProperty("brand_spanking_new",0); + } + + if(this_object()->GetTown() == "FirstAdmin"){ + object robe, hat, staff, book, book2; + string home; + + this_object()->SetTown("World"); + + robe = new("/domains/default/armor/robe"); + hat = new("/domains/default/armor/wizard_hat"); + staff = new("/secure/obj/staff"); + book = new("/domains/default/obj/guide"); + book2 = new("/domains/default/obj/handbook"); + + if(robe) robe->eventMove(this_object()); + if(hat) hat->eventMove(this_object()); + if(staff) staff->eventMove(this_object()); + if(book) book->eventMove(this_object()); + if(book2) book2->eventMove(this_object()); + + if(robe) this_object()->eventForce("wear robe"); + if(hat) this_object()->eventForce("wear hat"); + + home = "/realms/"+this_player()->GetKeyName()+"/workroom"; + + if(file_exists(home+".c")) + this_object()->eventMoveLiving(home); + + SetShort("First Admin $N"); + } + return 1; } *************** *** 388,406 **** int AddCurrency(string type, int amount) { if( currency_value(amount, type) > 999 ) ! log_file("currency", GetCapName() + " received "+amount+" "+type+ ! " "+ctime(time())+"\n"+identify(previous_object(-1))+"\n"); return living::AddCurrency(type, amount); } int AddBank(string bank, string type, int amount) { if( currency_value(amount, type) > 999 ) ! log_file("bank", GetCapName() + " deposited "+amount+" "+type+ ! " "+ctime(time())+" into bank: "+bank+"\n" + ! identify(previous_object(-1))+"\n"); return living::AddBank(bank, type, amount); } string *SetTitles(string *titles) { if( sizeof(distinct_array(titles)) != sizeof(titles) ) return Titles; Titles = titles; --- 491,534 ---- int AddCurrency(string type, int amount) { if( currency_value(amount, type) > 999 ) ! log_file("currency", GetCapName() + " received "+amount+" "+type+ ! " "+ctime(time())+"\n"+identify(previous_object(-1))+"\n"); return living::AddCurrency(type, amount); } int AddBank(string bank, string type, int amount) { if( currency_value(amount, type) > 999 ) ! log_file("bank", GetCapName() + " deposited "+amount+" "+type+ ! " "+ctime(time())+" into bank: "+bank+"\n" + ! identify(previous_object(-1))+"\n"); return living::AddBank(bank, type, amount); } + string *GetMuffed(){ + return Muffed; + } + + string *SetMuffed(string *muffed){ + if(sizeof(muffed)) Muffed = muffed; + else Muffed = ({}); + return Muffed; + } + + string *AddMuffed(string muffed){ + if(muffed) muffed = lower_case(muffed); + else return Muffed; + if(member_array(muffed,Muffed) == -1) Muffed += ({ muffed }); + return Muffed; + } + + string *RemoveMuffed(string unmuffed){ + if(unmuffed) unmuffed = lower_case(unmuffed); + else return Muffed; + if(member_array(unmuffed,Muffed) != -1) Muffed -= ({ unmuffed }); + return Muffed; + } + + string *SetTitles(string *titles) { if( sizeof(distinct_array(titles)) != sizeof(titles) ) return Titles; Titles = titles; *************** *** 411,419 **** if( !stringp(title) ) return Titles; else if( member_array(title, Titles) != -1 ) return Titles; else { ! Titles = ({ title }) + Titles; ! SetShort("whatever"); ! return Titles; } } --- 539,547 ---- if( !stringp(title) ) return Titles; else if( member_array(title, Titles) != -1 ) return Titles; else { ! Titles = ({ title }) + Titles; ! SetShort("whatever"); ! return Titles; } } *************** *** 421,429 **** if( !stringp(title) ) return Titles; if( member_array(title, Titles) == -1 ) return Titles; else { ! Titles -= ({ title }); ! SetShort("whatever"); ! return Titles; } } --- 549,557 ---- if( !stringp(title) ) return Titles; if( member_array(title, Titles) == -1 ) return Titles; else { ! Titles -= ({ title }); ! SetShort("whatever"); ! return Titles; } } *************** *** 442,455 **** string pname; if( !title || !desc ) return; ! ! if( (string)GetParty() ) { ! pname = (string)GetParty(); ! PartyMember = "/daemon/party"->GetPartyMembers(pname) - ({ this_player() });; ! foreach(ob in PartyMember) { ! ob->AddPartyQuest(title,desc); ! } ! } tmp = new(class quest); tmp->Date = time(); tmp->Description = desc; --- 570,583 ---- string pname; if( !title || !desc ) return; ! ! if( (string)GetParty() ) { ! pname = (string)GetParty(); ! PartyMember = "/daemon/party"->GetPartyMembers(pname) - ({ this_player() });; ! foreach(ob in PartyMember) { ! ob->AddPartyQuest(title,desc); ! } ! } tmp = new(class quest); tmp->Date = time(); tmp->Description = desc; *************** *** 458,553 **** } void AddQuestSkillPoints(string skill, int amount) { ! object * PartyMember; object ob; string pname; ! if(!skill || !amount) return; ! if( (string)GetParty() ) { ! pname = (string)GetParty(); ! PartyMember = "/daemon/party"->GetPartyMembers(pname); ! foreach(ob in PartyMember) { ! ob->AddSkillPoints(skill, amount); ! } ! } ! else AddSkillPoints(skill, amount); } ! ! void AddQuestStatPoints(string stat, int amount) { ! object * PartyMember; object ob; string pname; ! if(!stat || !amount) return; ! if( (string)GetParty() ) { ! pname = (string)GetParty(); ! PartyMember = "/daemon/party"->GetPartyMembers(pname); ! foreach(ob in PartyMember) { ! ob->AddStatPoints(stat, amount); ! } ! } ! else AddStatPoints(stat, amount); } ! ! void AddQuestCurrency(string type, int amount) { ! object * PartyMember; object ob; string pname; ! if(!type || !amount) return; ! if( (string)GetParty() ) { ! pname = (string)GetParty(); ! PartyMember = "/daemon/party"->GetPartyMembers(pname); ! foreach(ob in PartyMember) { ! ob->AddCurrency(type, amount); ! } ! } ! else AddCurrency(type, amount); } ! void AddPartyQuest(string title, string desc) { class quest tmp; ! if( !title || !desc ) return; ! if( member_array(title, Titles) != -1 ) return; ! tmp = new(class quest); ! tmp->Date = time(); ! tmp->Description = desc; ! Quests += ({ tmp }); ! AddTitle(title); } ! mixed *GetQuests() { return map(Quests, (: ({ ((class quest)$1)->Date, ! ((class quest)$1)->Description }) :)); } string SetShort(string irrelevant) { string title, tmp; int i; ! if( avatarp() ) { ! title = "Avatar "; ! if( !(tmp = GetClass()) ) title += "Wanderer $N "; ! else title += capitalize(tmp) + " $N "; ! title += irrelevant; ! return interactive::SetShort(title); ! } ! else if( high_mortalp() ) title = "High mortal "; ! else if( GetLevel() <= MAX_NEWBIE_LEVEL ) title = "Newbie "; else title = ""; ! if( !(tmp = GetClass()) ) title += "Wanderer $N "; ! else title += capitalize(tmp) + " $N "; if( GetUndead() && (tmp = GetUndeadType()) ) ! return interactive::SetShort(title + "the " + tmp); if( !(i = sizeof(Titles)) ) ! return interactive::SetShort(title + "the unaccomplished"); else title += Titles[0]; if( i > 1 && TitleLength > 1 ) title += " and " + Titles[1]; return interactive::SetShort(title); --- 586,683 ---- } void AddQuestSkillPoints(string skill, int amount) { ! object * PartyMember; object ob; string pname; ! if(!skill || !amount) return; ! if( (string)GetParty() ) { ! pname = (string)GetParty(); ! PartyMember = "/daemon/party"->GetPartyMembers(pname); ! foreach(ob in PartyMember) { ! ob->AddSkillPoints(skill, amount); ! } ! } ! else AddSkillPoints(skill, amount); } ! ! void AddQuestStatPoints(string stat, int amount) { ! object * PartyMember; object ob; string pname; ! if(!stat || !amount) return; ! if( (string)GetParty() ) { ! pname = (string)GetParty(); ! PartyMember = "/daemon/party"->GetPartyMembers(pname); ! foreach(ob in PartyMember) { ! ob->AddStatPoints(stat, amount); ! } ! } ! else AddStatPoints(stat, amount); } ! ! void AddQuestCurrency(string type, int amount) { ! object * PartyMember; object ob; string pname; ! if(!type || !amount) return; ! if( (string)GetParty() ) { ! pname = (string)GetParty(); ! PartyMember = "/daemon/party"->GetPartyMembers(pname); ! foreach(ob in PartyMember) { ! ob->AddCurrency(type, amount); ! } ! } ! else AddCurrency(type, amount); } ! void AddPartyQuest(string title, string desc) { class quest tmp; ! if( !title || !desc ) return; ! if( member_array(title, Titles) != -1 ) return; ! tmp = new(class quest); ! tmp->Date = time(); ! tmp->Description = desc; ! Quests += ({ tmp }); ! AddTitle(title); } ! mixed *GetQuests() { return map(Quests, (: ({ ((class quest)$1)->Date, ! ((class quest)$1)->Description }) :)); ! } ! ! int GetQuest(string str){ ! foreach(mixed component in GetQuests()){ ! if(str == component[1]) return 1; ! } ! return 0; } string SetShort(string irrelevant) { string title, tmp; int i; ! if( high_mortalp() ) title = "High mortal "; else title = ""; ! if(title && title != "") title += " $N "; ! else title = "$N "; if( GetUndead() && (tmp = GetUndeadType()) ) ! return interactive::SetShort(title + "the " + tmp); ! if( avatarp() || creatorp() ) { ! return interactive::SetShort(irrelevant); ! } if( !(i = sizeof(Titles)) ) ! return interactive::SetShort(title + "the unaccomplished"); else title += Titles[0]; if( i > 1 && TitleLength > 1 ) title += " and " + Titles[1]; return interactive::SetShort(title); *************** *** 560,588 **** } string GetName() { ! if(GetInvis()) return "A shadow"; ! else return interactive::GetName(); } varargs string GetLong(string str) { mapping counts; string item; - float h; str = GetShort() + "\n"; str += interactive::GetLong() + "\n"; str += living::GetLong(nominative(this_object())); foreach(item in map(all_inventory(), ! (: (string)$1->GetAffectLong(this_object()) :))) ! if( item ) str += item + "\n"; counts = ([]); foreach(item in map( ! filter(all_inventory(), (: !((int)$1->GetInvis(this_object())) :)), ! (: (string)$1->GetEquippedShort() :))) ! if( item ) counts[item]++; if( sizeof(counts) ) str += GetCapName() + " is carrying:\n"; foreach(item in keys(counts)) ! str += capitalize(consolidate(counts[item], item)) + "\n"; return str; } --- 690,718 ---- } string GetName() { ! if(GetInvis()) return "A shadow"; ! else return interactive::GetName(); } varargs string GetLong(string str) { mapping counts; string item; str = GetShort() + "\n"; str += interactive::GetLong() + "\n"; str += living::GetLong(nominative(this_object())); foreach(item in map(all_inventory(), ! (: (string)$1->GetAffectLong(this_object()) :))) ! if( item ) str += item + "\n"; ! if(this_object()->GetAffectLong()) str += this_object()->GetAffectLong(); counts = ([]); foreach(item in map( ! filter(all_inventory(), (: !((int)$1->GetInvis(this_object())) :)), ! (: (string)$1->GetEquippedShort() :))) ! if( item ) counts[item]++; if( sizeof(counts) ) str += GetCapName() + " is carrying:\n"; foreach(item in keys(counts)) ! str += capitalize(consolidate(counts[item], item)) + "\n"; return str; } *************** *** 593,640 **** x = GetLevel(); if( x != (y = living::ResetLevel()) ) { ! string file; ! if( x > y ) file = "decline"; ! else file = "advance"; ! log_file(file, GetCapName() + " went from level " + x + " to " ! "level " + y + " (" + ctime(time()) + ")\n"); ! if( x < y ) { ! eventPrint("%^YELLOW%^You are now a more experienced " + ! GetClass() + "."); ! TrainingPoints += ( (y-x) * 4 ); ! } ! else TrainingPoints -= ( (x-y) * 4 ); ! SetShort("whatever"); ! if( x > 49 && y < 50 ) RemoveChannel("avatar"); ! if( x > 24 && y < 25 ) RemoveChannel("hm"); } return y; } string SetClass(string str) { if( GetClass() != living::SetClass(str) ) { ! int points = TrainingPoints; ! string classes; ! ResetLevel(); ! TrainingPoints = points; /* leave points alone */ ! AddChannel(GetClass()); ! foreach(classes in (string array)CLASSES_D->GetClasses()) ! if( ClassMember(classes) && classes != GetClass() ) ! AddChannel(classes); } return GetClass(); } ! int GetEffectiveVision() { if( newbiep(this_object()) ) return VISION_CLEAR; else return living::GetEffectiveVision(); } varargs static int AddHealthPoints(int x, string limb, object agent) { ! string str; ! int hp, mp, sp, max_hp, max_mp, max_sp, ret, undead; hp = GetHealthPoints(); undead = GetUndead(); --- 723,772 ---- x = GetLevel(); if( x != (y = living::ResetLevel()) ) { ! string file; ! if( x > y ) file = "decline"; ! else file = "advance"; ! log_file(file, GetCapName() + " went from level " + x + " to " ! "level " + y + " (" + ctime(time()) + ")\n"); ! if( x < y ) { ! eventPrint("%^YELLOW%^You are now a more experienced " + ! GetClass() + "."); ! TrainingPoints += ( (y-x) * 4 ); ! } ! else TrainingPoints -= ( (x-y) * 4 ); ! SetShort("whatever"); ! if( x > 49 && y < 50 ) RemoveChannel("avatar"); ! if( x > 24 && y < 25 ) RemoveChannel("hm"); } return y; } string SetClass(string str) { if( GetClass() != living::SetClass(str) ) { ! int points = TrainingPoints; ! string classes; ! ResetLevel(); ! TrainingPoints = points; /* leave points alone */ ! AddChannel(GetClass()); ! foreach(classes in (string array)CLASSES_D->GetClasses()) ! if( ClassMember(classes) && classes != GetClass() ) ! AddChannel(classes); } return GetClass(); } ! varargs mixed GetEffectiveVision(int raw_score, mixed location) { ! //tc("stack1: "+get_stack(),"cyan"); if( newbiep(this_object()) ) return VISION_CLEAR; + else if(raw_score && location) return living::GetEffectiveVision(raw_score,location); + else if(raw_score) return living::GetEffectiveVision(raw_score); else return living::GetEffectiveVision(); } varargs static int AddHealthPoints(int x, string limb, object agent) { ! int hp, ret, undead; hp = GetHealthPoints(); undead = GetUndead(); *************** *** 652,698 **** mapping *GetDeaths() { if( !Deaths ) return ({}); return map(Deaths, function(class death morte) { ! return ([ "date" : morte->Date, ! "enemy" : morte->Enemy ]); ! }); ! } ! ! int AddTrainingPoints(int x) { ! log_file("TrainingPoints", GetName() + " received " + x + " training " ! "points at " + ctime(time()) + "\ncall chain: " + ! sprintf("%O\n", previous_object(-1)) ); ! return (TrainingPoints += x); ! } ! ! int RemoveTrainingPoints(int x) { ! return (TrainingPoints -= x); ! } ! ! int GetTrainingPoints() { return TrainingPoints; } ! ! varargs int eventTrain(string skill, int points) { ! float x = 0; ! mapping mp; ! ! if( points < 1 ) points = 1; ! if( !(mp = GetSkill(skill)) ) return 0; ! if( TrainingPoints < points ) return 0; ! while( points-- ) { ! int max = GetMaxSkillPoints(skill, mp["level"]); ! switch( mp["class"] ) { ! case 1: x = 50.0; break; ! case 2: x = 40.0; break; ! case 3: x = 30.0; break; ! case 4: x = 20.0; break; ! default: return 0; ! } ! TrainingPoints--; ! AddSkillPoints(skill, to_int( (max * x) / 100 )); } ! return 1; ! } ! ! string ChangeClass(string cl) { ! error("Players cannot change class.\n"); ! return GetClass(); ! } --- 784,830 ---- mapping *GetDeaths() { if( !Deaths ) return ({}); return map(Deaths, function(class death morte) { ! return ([ "date" : morte->Date, ! "enemy" : morte->Enemy ]); ! }); ! } ! ! int AddTrainingPoints(int x) { ! log_file("TrainingPoints", GetName() + " received " + x + " training " ! "points at " + ctime(time()) + "\ncall chain: " + ! sprintf("%O\n", previous_object(-1)) ); ! return (TrainingPoints += x); ! } ! ! int RemoveTrainingPoints(int x) { ! return (TrainingPoints -= x); ! } ! ! int GetTrainingPoints() { return TrainingPoints; } ! ! varargs int eventTrain(string skill, int points) { ! float x = 0; ! mapping mp; ! ! if( points < 1 ) points = 1; ! if( !(mp = GetSkill(skill)) ) return 0; ! if( TrainingPoints < points ) return 0; ! while( points-- ) { ! int max = GetMaxSkillPoints(skill, mp["level"]); ! switch( mp["class"] ) { ! case 1: x = 50.0; break; ! case 2: x = 40.0; break; ! case 3: x = 30.0; break; ! case 4: x = 20.0; break; ! default: return 0; ! } ! TrainingPoints--; ! AddSkillPoints(skill, to_int( (max * x) / 100 )); ! } ! return 1; } ! ! //string ChangeClass(string cl) { ! // error("Players cannot change class.\n"); ! // return GetClass(); ! // } diff -c -r --new-file ds1.1/lib/lib/poison.c ds2.0r27/lib/lib/poison.c *** ds1.1/lib/lib/poison.c Sun Feb 1 21:30:19 1998 --- ds2.0r27/lib/lib/poison.c Wed Jul 5 00:00:58 2006 *************** *** 8,20 **** #include "include/poison.h" private int PoisonUses, PoisonStrength; ! static void create() { PoisonStrength = 0; PoisonUses = 0; this_object()->AddSave( ({ "PoisonUses" }) ); } ! mixed indirect_poison_obj_with_obj() { if( environment() != this_player() ) return 0; if( PoisonStrength < 1 ) return "The poison is all used up."; --- 8,20 ---- #include "include/poison.h" private int PoisonUses, PoisonStrength; ! static void create() { PoisonStrength = 0; PoisonUses = 0; this_object()->AddSave( ({ "PoisonUses" }) ); } ! mixed indirect_poison_obj_with_obj() { if( environment() != this_player() ) return 0; if( PoisonStrength < 1 ) return "The poison is all used up."; *************** *** 25,49 **** if( !who || !target || !PoisonUses ) return 0; PoisonUses--; if( random(50) > (int)who->GetStatLevel("coordination") ) { ! this_player()->eventPrint("You fumble around with the poison, " ! "spilling it on yourself."); ! environment(this_player())->eventPrint((string)who->GetName() + ! " fumbles around with some " ! "poison, spilling it on " + ! reflexive(who) + ".", ! this_player()); ! who->AddPoison(random(10)); ! return 1; } target->eventPoison(who, this_object(), PoisonStrength); return 1; } int SetPoisonStrength(int x) { return (PoisonStrength = x); } ! mixed GetPoisonStrength() { return PoisonStrength; } int SetPoisonUses(int x) { return (PoisonUses = x); } ! int GetPoisonUses() { return PoisonUses; } ! --- 25,49 ---- if( !who || !target || !PoisonUses ) return 0; PoisonUses--; if( random(50) > (int)who->GetStatLevel("coordination") ) { ! this_player()->eventPrint("You fumble around with the poison, " ! "spilling it on yourself."); ! environment(this_player())->eventPrint((string)who->GetName() + ! " fumbles around with some " ! "poison, spilling it on " + ! reflexive(who) + ".", ! this_player()); ! who->AddPoison(random(10)); ! return 1; } target->eventPoison(who, this_object(), PoisonStrength); return 1; } int SetPoisonStrength(int x) { return (PoisonStrength = x); } ! mixed GetPoisonStrength() { return PoisonStrength; } int SetPoisonUses(int x) { return (PoisonUses = x); } ! int GetPoisonUses() { return PoisonUses; } ! diff -c -r --new-file ds1.1/lib/lib/pole.c ds2.0r27/lib/lib/pole.c *** ds1.1/lib/lib/pole.c Sun Feb 1 21:30:14 1998 --- ds2.0r27/lib/lib/pole.c Wed Jul 5 00:00:58 2006 *************** *** 1,5 **** /* /lib/pole.c ! * from the Dead Soulsr2 Object Library * inheritable fishing functions, must also inherit item along the way * created by Descartes of Borg 951009 */ --- 1,5 ---- /* /lib/pole.c ! * from the Dead Souls Object Library * inheritable fishing functions, must also inherit item along the way * created by Descartes of Borg 951009 */ *************** *** 10,25 **** inherit LIB_BAIT; static private int PoleStrength, CatchChance; ! static void create() { PoleStrength = 0; CatchChance = 0; ! AddSave( ({ "PoleStrength", "CatchChance" }) + bait::GetSave() ); } mixed direct_cast_obj() { if( environment() != this_player() ) ! return "#You must have it to cast it."; return 1; } --- 10,26 ---- inherit LIB_BAIT; static private int PoleStrength, CatchChance; ! static void create() { + string *bait_save = bait::GetSave(); PoleStrength = 0; CatchChance = 0; ! AddSave( ({ "PoleStrength", "CatchChance" }) + bait_save ); } mixed direct_cast_obj() { if( environment() != this_player() ) ! return "#You must have it to cast it."; return 1; } *************** *** 27,33 **** mixed err; if( environment() != this_player() ) ! return "#You must have it to fish with it!"; if( (err = CanCast(this_player())) != 1 ) return err; return 1; } --- 28,34 ---- mixed err; if( environment() != this_player() ) ! return "#You must have it to fish with it!"; if( (err = CanCast(this_player())) != 1 ) return err; return 1; } *************** *** 36,95 **** SetBroken(1); return 1; } ! mixed CanCast(object who) { ! if( GetBroken() ) ! return "You cannot cast a broken " + strip_article(GetShort()) + "!"; ! else return 1; } ! mixed eventCatch(object who, string fish) { int mass; ! SetBait(0); mass = (int)fish->GetMass(); if( mass > PoleStrength && eventBreak() ) { ! message("my_action", "Just as you notice " + (string)fish->GetShort() + ! " on " + GetShort() + ", it breaks " ! "and you lose your catch!", who); ! message("my_action", possessive_noun(who) + " " + ! strip_article(GetShort()) + " breaks as " + ! nominative(who) + " tries to land " + (string)fish->GetShort()+ ! "!", environment(who), ({ who })); ! return 0; } PoleStrength -= (mass/10) + 1; if( PoleStrength < 1 ) PoleStrength = 0; if( !((int)fish->eventCatch(who, this_object()))) return 0; if( !((int)who->CanCarry(mass)) ) { ! message("my_action", "For a fleeting moment, you notice " + ! (string)fish->GetShort() + " on your " + ! strip_article(GetShort()) + ", but then it is lost.", ! who); ! message("other_action", (string)who->GetName() + " loses a catch.", ! environment(who), ({ who })); ! return 0; } return 1; } ! int eventFish(object who) { if( (int)who->GetSkillLevel("fishing") >= random(5) ) ! return GetChance() + GetBait(); else return 0; } ! int SetChance(int x) { return (CatchChance =x); } ! mixed GetProperty(string foo); int GetChance() { return CatchChance + GetProperty("blessed"); } ! int SetStrength(int x) { return (PoleStrength = x); } ! int GetStrength() { return PoleStrength; } ! /* virtual functions */ ! mixed AddSave(mixed *vars) { return ({}); } --- 37,96 ---- SetBroken(1); return 1; } ! mixed CanCast(object who) { ! if( GetBroken() ) ! return "You cannot cast a broken " + strip_article(GetShort()) + "!"; ! else return 1; } ! mixed eventCatch(object who, string fish) { int mass; ! SetBait(0); mass = (int)fish->GetMass(); if( mass > PoleStrength && eventBreak() ) { ! message("my_action", "Just as you notice " + (string)fish->GetShort() + ! " on " + GetShort() + ", it breaks " ! "and you lose your catch!", who); ! message("my_action", possessive_noun(who) + " " + ! strip_article(GetShort()) + " breaks as " + ! nominative(who) + " tries to land " + (string)fish->GetShort()+ ! "!", environment(who), ({ who })); ! return 0; } PoleStrength -= (mass/10) + 1; if( PoleStrength < 1 ) PoleStrength = 0; if( !((int)fish->eventCatch(who, this_object()))) return 0; if( !((int)who->CanCarry(mass)) ) { ! message("my_action", "For a fleeting moment, you notice " + ! (string)fish->GetShort() + " on your " + ! strip_article(GetShort()) + ", but then it is lost.", ! who); ! message("other_action", (string)who->GetName() + " loses a catch.", ! environment(who), ({ who })); ! return 0; } return 1; } ! int eventFish(object who) { if( (int)who->GetSkillLevel("fishing") >= random(5) ) ! return GetChance() + GetBait(); else return 0; } ! int SetChance(int x) { return (CatchChance =x); } ! mixed GetProperty(string foo); int GetChance() { return CatchChance + GetProperty("blessed"); } ! int SetStrength(int x) { return (PoleStrength = x); } ! int GetStrength() { return PoleStrength; } ! /* virtual functions */ ! mixed AddSave(mixed *vars) { return ({}); } diff -c -r --new-file ds1.1/lib/lib/post_office.c ds2.0r27/lib/lib/post_office.c *** ds1.1/lib/lib/post_office.c Sun Feb 1 21:30:19 1998 --- ds2.0r27/lib/lib/post_office.c Wed Jul 5 00:00:58 2006 *************** *** 1,5 **** /* /lib/post_office.c ! * from the Dead Soulsr2 Object Library * an inheritable post office * created by Descartes of Borg 951007 */ --- 1,5 ---- /* /lib/post_office.c ! * from the Dead Souls Object Library * an inheritable post office * created by Descartes of Borg 951007 */ *************** *** 19,31 **** mixed CanMail(object who, string args) { if( !interactive(who) ) return 0; if( GetTown() != (string)who->GetTown() ) ! return "Any mail you might have will be at your home post office."; return 1; } mixed eventMail(object who, string args) { object ob; ! if( !(ob = new(OBJ_POST)) ) { who->eventPrint("Failed to load postal object!"); return 1; --- 19,31 ---- mixed CanMail(object who, string args) { if( !interactive(who) ) return 0; if( GetTown() != (string)who->GetTown() ) ! return "Any mail you might have will be at your home post office."; return 1; } mixed eventMail(object who, string args) { object ob; ! if( !(ob = new(OBJ_POST)) ) { who->eventPrint("Failed to load postal object!"); return 1; diff -c -r --new-file ds1.1/lib/lib/props/addstuff.c ds2.0r27/lib/lib/props/addstuff.c *** ds1.1/lib/lib/props/addstuff.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/props/addstuff.c Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,22 ---- + varargs int AddStuff(string *str, int q){ + int i,problem,z; + problem = 1; + for(i=0;i<sizeof(str);i++){ + object to,thing; + if(!to=this_object()) return 0; + if(q) { + for(z=0;z<q;z++){ + thing=new(str[i]); + if(!thing->eventMove(to)) problem = -1; + } + } + else if(!q || q ==0){ + thing=new(str[i]); + if(!thing->eventMove(to)) problem = -1; + } + + + } + return problem; + } + diff -c -r --new-file ds1.1/lib/lib/props/ambiance.c ds2.0r27/lib/lib/props/ambiance.c *** ds1.1/lib/lib/props/ambiance.c Sun Feb 1 21:30:16 1998 --- ds2.0r27/lib/lib/props/ambiance.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/props/ambiance.c ! * From the Dead Souls V LPC Library * Ambiance is natural light in an area * Created by Descartes of Borg 961221 * Version: @(#) ambiance.c 1.1@(#) --- 1,5 ---- /* /lib/props/ambiance.c ! * From the Dead Souls LPC Library * Ambiance is natural light in an area * Created by Descartes of Borg 961221 * Version: @(#) ambiance.c 1.1@(#) diff -c -r --new-file ds1.1/lib/lib/props/carry.c ds2.0r27/lib/lib/props/carry.c *** ds1.1/lib/lib/props/carry.c Sun Feb 1 21:30:16 1998 --- ds2.0r27/lib/lib/props/carry.c Wed Jul 5 00:01:05 2006 *************** *** 8,15 **** #include <config.h> ! private static int CarriedMass = 0; ! private static int MaxCarry = 0; int CanCarry(int amount); --- 8,15 ---- #include <config.h> ! int CarriedMass = 0; ! int MaxCarry = 0; int CanCarry(int amount); *************** *** 42,47 **** --- 42,51 ---- return MaxCarry; } + int GetLivingMaxCarry() { + return MaxCarry; + } + int SetMaxCarry(int x) { return (MaxCarry = x); } diff -c -r --new-file ds1.1/lib/lib/props/clean.c ds2.0r27/lib/lib/props/clean.c *** ds1.1/lib/lib/props/clean.c Sun Feb 1 21:30:17 1998 --- ds2.0r27/lib/lib/props/clean.c Wed Jul 5 00:01:05 2006 *************** *** 7,13 **** */ #include <clean_up.h> ! private static int NoClean = 0; /* ******************* clean.c attributes ************************* */ --- 7,13 ---- */ #include <clean_up.h> ! private static int NoClean = 0; /* ******************* clean.c attributes ************************* */ *************** *** 30,37 **** */ static int Destruct() { object env; - object *inv; - int i; if( !this_object() ) { return 1; --- 30,35 ---- *************** *** 48,54 **** destruct(this_object()); return !(this_object()); } ! int eventDestruct() { return Destruct(); } --- 46,52 ---- destruct(this_object()); return !(this_object()); } ! int eventDestruct() { return Destruct(); } *************** *** 57,63 **** int clean_up(int ref_exists) { object array inv; object env; ! if( NoClean || ref_exists ) { return NEVER_AGAIN; } --- 55,61 ---- int clean_up(int ref_exists) { object array inv; object env; ! if( NoClean || ref_exists ) { return NEVER_AGAIN; } *************** *** 66,75 **** } env = environment(); if( env ) { ! if( env->isBag() ) { return TRY_AGAIN_LATER; } ! if( env->GetProperty("storage room") ) { return TRY_AGAIN_LATER; } } --- 64,73 ---- } env = environment(); if( env ) { ! if( env->isBag() ) { return TRY_AGAIN_LATER; } ! if( env->GetProperty("storage room") ) { return TRY_AGAIN_LATER; } } *************** *** 78,91 **** return TRY_AGAIN_LATER; } if( !env ) { ! catch(inv->eventDestruct()); ! if( this_object() ) { Destruct(); } ! if( this_object() ) { destruct(this_object()); } ! return NEVER_AGAIN; } if( userp(env) ) { return TRY_AGAIN_LATER; --- 76,89 ---- return TRY_AGAIN_LATER; } if( !env ) { ! catch(inv->eventDestruct()); ! if( this_object() ) { Destruct(); } ! if( this_object() ) { destruct(this_object()); } ! return NEVER_AGAIN; } if( userp(env) ) { return TRY_AGAIN_LATER; diff -c -r --new-file ds1.1/lib/lib/props/cost.txt ds2.0r27/lib/lib/props/cost.txt *** ds1.1/lib/lib/props/cost.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/props/cost.txt Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,14 ---- + private int cost; + + int GetDollarCost(){ + if(cost) return cost; + return 0; + } + + int SetDollarCost(int i){ + if(i && i > -1) cost = i; + else cost = 0; + return i; + } + + diff -c -r --new-file ds1.1/lib/lib/props/damage.c ds2.0r27/lib/lib/props/damage.c *** ds1.1/lib/lib/props/damage.c Sun Feb 1 21:30:17 1998 --- ds2.0r27/lib/lib/props/damage.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/props/damage.c ! * From the Dead Souls V Object Library * Things that do damage to other things * Created by Descartes of Borg 970101 * Version: @(#) damage.c 1.1@(#) --- 1,5 ---- /* /lib/props/damage.c ! * From the Dead Souls Object Library * Things that do damage to other things * Created by Descartes of Borg 970101 * Version: @(#) damage.c 1.1@(#) *************** *** 51,54 **** int eventStrike(object ob) { return GetClass(); } ! --- 51,54 ---- int eventStrike(object ob) { return GetClass(); } ! diff -c -r --new-file ds1.1/lib/lib/props/description.c ds2.0r27/lib/lib/props/description.c *** ds1.1/lib/lib/props/description.c Sun Feb 1 21:30:16 1998 --- ds2.0r27/lib/lib/props/description.c Wed Jul 5 00:01:05 2006 *************** *** 1,16 **** /* /lib/props/description.c ! * From the Dead Souls V Object Library * Handles the describing of objects * Created by Descartes of Borg 961222 * Version: @(#) description.c 1.1@(#) * Last modified: 96/12/22 */ #include <function.h> private int ProperNoun = 0; private mixed Short = 0; string GetShort(); string GetDefiniteShort() { --- 1,92 ---- /* /lib/props/description.c ! * From the Dead Souls Object Library * Handles the describing of objects * Created by Descartes of Borg 961222 * Version: @(#) description.c 1.1@(#) * Last modified: 96/12/22 */ + #include <lib.h> #include <function.h> private int ProperNoun = 0; + private int Modify = 1; private mixed Short = 0; + mixed direct_modify_obj_str() { + return 1; + } + + mixed direct_modify_word_str() { + return 1; + } + + mixed direct_initfix_obj() { + return 1; + } + + mixed direct_initfix() { + return 1; + } + + mixed direct_reload_obj() { return 1; } + mixed indirect_reload_obj() { return 1; } + mixed direct_reload_word_obj() { return 1; } + mixed indirect_reload_word_obj() { return 1; } + mixed direct_reload_str_obj() { return 1; } + mixed indirect_reload_str_obj() { return 1; } + mixed direct_reload_str_word() { return 1; } + mixed indirect_reload_str_word() { return 1; } + + mixed direct_reload() { return 1; } + mixed indirect_reload() { return 1; } + + mixed direct_reload_every_str() { return 1; } + mixed indirect_reload_every_str() { return 1; } + + mixed direct_copy_obj_to_obj() { return 1; } + mixed direct_copy_obj_str() { return 1; } + + mixed direct_add_obj_to_obj() { return 1; } + mixed indirect_add_obj_to_obj() { return 1; } + + mixed direct_delete_obj_from_obj(){ + return 1; + } + + mixed indirect_delete_obj_from_obj(){ + return 1; + } + + mixed indirect_delete_obj_from_here() { return 1; } + mixed direct_delete_obj_from_here() { return 1; } + mixed direct_delete_obj_from_room() { return 1; } + mixed indirect_delete_obj_from_room() { return 1; } + + mixed indirect_add_obj_to_here() { return 1; } + mixed direct_add_obj_to_here() { return 1; } + mixed indirect_add_obj_to_room() { return 1; } + mixed direct_add_obj_to_room() { return 1; } + + mixed indirect_add_obj() { return 1; } + mixed direct_add_obj() { return 1; } + + mixed indirect_delete_obj() { return 1; } + mixed direct_delete_obj() { return 1; } + + int SetNoModify(int i){ + if(i) Modify = 0; + else Modify = 1; + } + + int GetModify(){ + return Modify; + } + + int GetNoModify(){ + if(Modify) return 0; + else return 1; + } string GetShort(); string GetDefiniteShort() { *************** *** 26,32 **** return add_article(tmp, 1); } } ! string GetShort() { if( !Short ) { return 0; --- 102,108 ---- return add_article(tmp, 1); } } ! string GetShort() { if( !Short ) { return 0; *************** *** 67,69 **** --- 143,155 ---- return (Short = val); } + object array GetDummyItems() { + object *DummyItems = ({}); + foreach(object item in all_inventory(this_object())){ + if(base_name(item) == LIB_DUMMY){ + DummyItems += ({ item }); + } + } + return DummyItems; + } + diff -c -r --new-file ds1.1/lib/lib/props/deterioration.c ds2.0r27/lib/lib/props/deterioration.c *** ds1.1/lib/lib/props/deterioration.c Sun Feb 1 21:30:17 1998 --- ds2.0r27/lib/lib/props/deterioration.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/props/deterioriation.c ! * From the Dead Souls V Object Library * Handles the deterioration of objects * Created by Descartes of Borg 970101 * Version: @(#) deterioration.c 1.1@(#) --- 1,5 ---- /* /lib/props/deterioriation.c ! * From the Dead Souls Object Library * Handles the deterioration of objects * Created by Descartes of Borg 970101 * Version: @(#) deterioration.c 1.1@(#) *************** *** 18,36 **** int GetBroken() { return Broken; } ! int SetBroken(int x) { return (Broken = x); } ! int SetDamagePoints(int x) { return (MaxDamagePoints = DamagePoints = x); } ! int GetDamagePoints() { return DamagePoints; } ! int GetDeterioration() { return Deterioration; } --- 18,36 ---- int GetBroken() { return Broken; } ! int SetBroken(int x) { return (Broken = x); } ! int SetDamagePoints(int x) { return (MaxDamagePoints = DamagePoints = x); } ! int GetDamagePoints() { return DamagePoints; } ! int GetDeterioration() { return Deterioration; } *************** *** 52,60 **** int eventReceiveDamage(object agent, int type, int amt, int d, mixed array l) { DamagePoints -= (amt * 5); if( DamagePoints < 1 ) { ! Deterioration++; ! DamagePoints = MaxDamagePoints; ! eventDeteriorate(type); } return amt; } --- 52,60 ---- int eventReceiveDamage(object agent, int type, int amt, int d, mixed array l) { DamagePoints -= (amt * 5); if( DamagePoints < 1 ) { ! Deterioration++; ! DamagePoints = MaxDamagePoints; ! eventDeteriorate(type); } return amt; } diff -c -r --new-file ds1.1/lib/lib/props/equip.c ds2.0r27/lib/lib/props/equip.c *** ds1.1/lib/lib/props/equip.c Sun Feb 1 21:30:17 1998 --- ds2.0r27/lib/lib/props/equip.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/props/equip.c ! * From the Dead Souls V Object Library * Handles the property of being something that is equipped to a limb * The word worn is used instead of equipped for historical reasons * Created by Descartes of Borg 970101 --- 1,5 ---- /* /lib/props/equip.c ! * From the Dead Souls Object Library * Handles the property of being something that is equipped to a limb * The word worn is used instead of equipped for historical reasons * Created by Descartes of Borg 970101 *************** *** 7,31 **** * Last modified: 97/01/01 */ ! #include <armour_types.h> ! private int ArmourType = A_WEAPON; private string array Worn = 0; // abstract methods string GetDefiniteShort(); // end abstract methods ! int GetArmourType() { ! return ArmourType; } ! int SetArmourType(int x) { if( !intp(x) ) { ! error("Bad argument to SetArmourType().\n\tExpected value from " ! "/include/armour_types.h, Got: " + typeof(x) + "\n"); } ! return (ArmourType = x); } string array GetSave() { --- 7,31 ---- * Last modified: 97/01/01 */ ! #include <armor_types.h> ! private int ArmorType = A_WEAPON; private string array Worn = 0; // abstract methods string GetDefiniteShort(); // end abstract methods ! int GetArmorType() { ! return ArmorType; } ! int SetArmorType(int x) { if( !intp(x) ) { ! error("Bad argument to SetArmorType().\n\tExpected value from " ! "/include/armor_types.h, Got: " + typeof(x) + "\n"); } ! return (ArmorType = x); } string array GetSave() { *************** *** 37,42 **** --- 37,43 ---- } static string array SetWorn(string array limbs) { + //tc("limbs: "+identify(limbs),"cyan"); return (Worn = limbs); } *************** *** 57,62 **** --- 58,65 ---- mixed eventEquip(object who, string array limbs) { mixed tmp = who->eventWear(this_object(), limbs); + //tc("limbs: "+identify(limbs)); + if( tmp != 1 ) { return tmp; } *************** *** 66,72 **** static void eventRestoreEquip(string array limbs) { mixed tmp; ! if( !limbs || !environment() ) { return; } --- 69,75 ---- static void eventRestoreEquip(string array limbs) { mixed tmp; ! if( !limbs || !environment() ) { return; } *************** *** 78,84 **** environment()->eventPrint(tmp); } } ! mixed eventUnequip(object who) { mixed tmp = who->eventRemoveItem(this_object()); --- 81,87 ---- environment()->eventPrint(tmp); } } ! mixed eventUnequip(object who) { mixed tmp = who->eventRemoveItem(this_object()); diff -c -r --new-file ds1.1/lib/lib/props/getlivings.c ds2.0r27/lib/lib/props/getlivings.c *** ds1.1/lib/lib/props/getlivings.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/props/getlivings.c Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,9 ---- + /* /lib/props/getlivings.c + * From the Frontiers LPC Library + * this was an ugly hack to return an array of living things. now sefun + * Give it an integer argument to return interactives only + * Created by Cratylus 15JAN2005 + * Version: @(#) getlivings.c 1.1@(#) + * Last modified: 2005/01/15 + */ + diff -c -r --new-file ds1.1/lib/lib/props/id.c ds2.0r27/lib/lib/props/id.c *** ds1.1/lib/lib/props/id.c Sun Feb 1 21:30:16 1998 --- ds2.0r27/lib/lib/props/id.c Wed Jul 5 00:01:05 2006 *************** *** 1,11 **** /* /lib/props/id.c ! * From the Dead Souls V Object Library * Attributes which identify objects * Created by Descartes of Borg 961222 * Version: @(#) id.c 1.2@(#) * Last modified: 96/12/22 */ private static string array Adjectives = ({}); private string CapName = 0; private static string array Id = ({}); --- 1,13 ---- /* /lib/props/id.c ! * From the Dead Souls Object Library * Attributes which identify objects * Created by Descartes of Borg 961222 * Version: @(#) id.c 1.2@(#) * Last modified: 96/12/22 */ + #include <lib.h> + private static string array Adjectives = ({}); private string CapName = 0; private static string array Id = ({}); *************** *** 49,55 **** } string array GetId() { ! string tmp = GetKeyName(); if( tmp ) { return distinct_array(({ Id..., tmp })); --- 51,59 ---- } string array GetId() { ! string tmp; ! //if(!inherits(LIB_GERM,this_object())) tmp = GetKeyName(); ! tmp = GetKeyName(); if( tmp ) { return distinct_array(({ Id..., tmp })); diff -c -r --new-file ds1.1/lib/lib/props/inventory.c ds2.0r27/lib/lib/props/inventory.c *** ds1.1/lib/lib/props/inventory.c Sun Feb 1 21:30:16 1998 --- ds2.0r27/lib/lib/props/inventory.c Wed Jul 5 00:01:05 2006 *************** *** 1,60 **** - /* /lib/props/inventory.c - * From the Dead Souls V Object Library - * Inheritable for objects that manage inventories - * Created by Descartes of Borg 961222 - * Version: @(#) inventory.c 1.2@(#) - * Last modified: 96/12/31 - */ - private static mapping Inventory = ([]); static void eventLoadInventory(); static void eventLoadItem(string file, mixed args, int count); mapping GetInventory() { return Inventory; } - mapping SetInventory(mapping mp) { - foreach(string key, mixed val in mp) { - if( key[<2..] == ".c" ) { - key = key[0..<3]; - } - if( key[0] != '/' ) { - key = "/" + key; - } - Inventory[key] = val; - } - eventLoadInventory(); - return Inventory; - } - - static void eventLoadInventory() { - object array items = map(all_inventory(this_object()), (: base_name :)); - - foreach(string file, mixed args in Inventory) { - eventLoadItem(file, args, sizeof(filter(items, (: $1 == $(file) :)))); - } - } - static void eventLoadItem(string file, mixed args, int count) { ! if( intp(args) ) { // Number of items to clone or unique ! if( args < 0 ) { // Unique item ! object ob; ! ob = unique(file, -args); if( ob ) { ob->eventMove(this_object()); } } ! else { // Clone up to # args = args - count; while( args > 0 ) { int u = file->GetUnique(); - object ob; - if( u ) { ! ob = unique(file, u); } else { ob = new(file); --- 1,37 ---- private static mapping Inventory = ([]); static void eventLoadInventory(); + static void eventLoadItem(string file, mixed args, int count); mapping GetInventory() { return Inventory; } static void eventLoadItem(string file, mixed args, int count) { ! object ob; ! if( intp(args) ) { ! if( args < 0 ) { ! foreach(object guy in findobs(file)){ ! if(environment(guy)) return; ! } ! //ob = unique(file, -args); ! ob = new(file); if( ob ) { ob->eventMove(this_object()); } } ! else { args = args - count; while( args > 0 ) { int u = file->GetUnique(); if( u ) { ! foreach(object guy in findobs(file)){ ! if(environment(guy)) return; ! } ! //ob = unique(file, u); ! ob = new(file); } else { ob = new(file); *************** *** 68,73 **** --- 45,85 ---- } } + static void eventLoadInventory() { + int filtersize, i; + object array stuff,items,tmp; + + stuff=all_inventory(this_object()); + items = ({}); + + for(i=0; i<sizeof(stuff);i++){ + if(tmp = ({ base_name(stuff[i]) }) ) items += tmp; + } + filtersize=0; + foreach(string file, mixed args in Inventory) { + for(i=0; i<sizeof(items); i++) { + if (base_name(items[i]) == file ) filtersize++; + } + eventLoadItem(file, args, filtersize); + filtersize=0; + } + } + + + mapping SetInventory(mapping mp) { + foreach(string key, mixed val in mp) { + if( key[<2..] == ".c" ) { + key = key[0..<3]; + } + if( key[0] != '/' ) { + key = "/" + key; + } + Inventory[key] = val; + } + eventLoadInventory(); + return Inventory; + } + varargs void reset(int count) { eventLoadInventory(); } diff -c -r --new-file ds1.1/lib/lib/props/mass.c ds2.0r27/lib/lib/props/mass.c *** ds1.1/lib/lib/props/mass.c Sun Feb 1 21:30:17 1998 --- ds2.0r27/lib/lib/props/mass.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/props/mass.c ! * From the Dead Souls V Object Library * Handles object massiveness and weight * Created by Descartes of Borg 970101 * Version: @(#) mass.c 1.1@(#) --- 1,5 ---- /* /lib/props/mass.c ! * From the Dead Souls Object Library * Handles object massiveness and weight * Created by Descartes of Borg 970101 * Version: @(#) mass.c 1.1@(#) *************** *** 19,25 **** } return (Mass -= x); } ! int GetMass() { return Mass; } --- 19,25 ---- } return (Mass -= x); } ! int GetMass() { return Mass; } *************** *** 30,43 **** } return (Mass = x); } ! string array GetSave() { return ({ "Mass" }); } int GetWeight() { float h; ! if( environment() ) { h = environment()->GetGravity(); } --- 30,43 ---- } return (Mass = x); } ! string array GetSave() { return ({ "Mass" }); } int GetWeight() { float h; ! if( environment() ) { h = environment()->GetGravity(); } *************** *** 46,49 **** } return to_int(GetMass() * h); } ! --- 46,49 ---- } return to_int(GetMass() * h); } ! diff -c -r --new-file ds1.1/lib/lib/props/move.c ds2.0r27/lib/lib/props/move.c *** ds1.1/lib/lib/props/move.c Sun Feb 1 21:30:16 1998 --- ds2.0r27/lib/lib/props/move.c Wed Jul 5 00:01:05 2006 *************** *** 1,27 **** - /* /lib/move.c - * From the Dead Souls Object Library - * Functions for basic movement - * Created by Descartes of Borg 950209 - * Version: @(#) move.c 1.4@(#) - * Last modified: 96/12/31 - */ - #include <message_class.h> private static object LastEnvironment = 0; ! // abstract methods ! varargs void eventPrint(string str, mixed args...); ! // end abstract methods - /* ****************** /lib/move.c attributes ******************** */ object GetLastEnvironment() { return LastEnvironment; } - /* ******************** /lib/move.c events ********************** */ int eventMove(mixed dest) { ! object ob; if( !this_object() ) { return 0; --- 1,17 ---- #include <message_class.h> private static object LastEnvironment = 0; ! varargs int eventPrint(string str, mixed args...); object GetLastEnvironment() { return LastEnvironment; } int eventMove(mixed dest) { ! object ob,to; ! int depth; ! to=this_object(); if( !this_object() ) { return 0; *************** *** 30,51 **** int x; x = (int)environment()->CanRelease(this_object()); ! if( !x && !archp() ) { return 0; } } if( stringp(dest) ) { ! if( !(ob = find_object(dest)) ) { string str; ! if( str = catch(call_other(dest, "???")) ) { ! if( creatorp() ) { eventPrint(str, MSG_ERROR); } ! return 0; ! } ! ob = find_object(dest); ! } } else { ob = dest; --- 20,49 ---- int x; x = (int)environment()->CanRelease(this_object()); ! ////tc("verb: "+query_verb(),"blue"); ! //tc("prev obs: "+identify(previous_object(-1))); ! //tc("stack: "+get_stack(),"blue"); ! //tc("this_object: "+identify(this_object())); ! //tc("env this_object: "+identify(environment(this_object())),"blue"); ! //tc("env "+identify(environment()),"blue"); ! //if(dest) tc("dest: "+identify(dest)); ! //tc("x: "+x,"blue"); ! if( !x && !archp() ) { return 0; } } if( stringp(dest) ) { ! if( !(ob = find_object(dest)) ) { string str; ! if( str = catch(call_other(dest, "???")) ) { ! if( creatorp() ) { eventPrint(str, MSG_ERROR); } ! return 0; ! } ! ob = find_object(dest); ! } } else { ob = dest; *************** *** 54,67 **** return 0; } if( living(this_object()) && living(ob) ) { ! return 0; } if( !ob->CanReceive(this_object()) ) { return 0; } ! if( LastEnvironment = environment() ) { environment()->eventReleaseObject(this_object()); } move_object(ob); environment()->eventReceiveObject(this_object()); if( environment() ) { --- 52,73 ---- return 0; } if( living(this_object()) && living(ob) ) { ! if(!ob->GetMount()) return 0; } if( !ob->CanReceive(this_object()) ) { return 0; } ! if( objectp(to) && LastEnvironment = environment() ) { environment()->eventReleaseObject(this_object()); + if(inherits("/lib/std/storage",to) && inherits("/lib/std/storage",environment() ) ) { + depth = to->GetRecurseDepth(); + depth += 1; + if(depth) environment()->AddRecurseDepth(-depth); + if(environment()->GetRecurseDepth() < 1) environment()->SetRecurseDepth(1); + } + } + if(!objectp(to) ) return 0; move_object(ob); environment()->eventReceiveObject(this_object()); if( environment() ) { diff -c -r --new-file ds1.1/lib/lib/props/poisoning.c ds2.0r27/lib/lib/props/poisoning.c *** ds1.1/lib/lib/props/poisoning.c Sun Feb 1 21:30:17 1998 --- ds2.0r27/lib/lib/props/poisoning.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/props/poisoning.c ! * From the Dead Souls V Object Library * Things that can have poison * Created by Descartes of Borg 970101 * Version: %A% --- 1,5 ---- /* /lib/props/poisoning.c ! * From the Dead Souls Object Library * Things that can have poison * Created by Descartes of Borg 970101 * Version: %A% diff -c -r --new-file ds1.1/lib/lib/props/properties.c ds2.0r27/lib/lib/props/properties.c *** ds1.1/lib/lib/props/properties.c Sun Feb 1 21:30:16 1998 --- ds2.0r27/lib/lib/props/properties.c Wed Jul 5 00:01:05 2006 *************** *** 1,12 **** /* /lib/props/properties.c ! * From the Dead Souls V Object Library * The properties property * Created by Descartes of Borg 961222 * Version: @(#) properties.c 1.1@(#) * Last modified: 96/12/22 */ ! private static mapping Properties = ([]); mixed AddProperty(string prop, mixed val) { if( Properties[prop] ) { --- 1,13 ---- /* /lib/props/properties.c ! * From the Dead Souls Object Library * The properties property * Created by Descartes of Borg 961222 * Version: @(#) properties.c 1.1@(#) * Last modified: 96/12/22 */ ! //private static mapping Properties = ([]); ! mapping Properties = ([]); mixed AddProperty(string prop, mixed val) { if( Properties[prop] ) { *************** *** 20,25 **** --- 21,27 ---- mixed GetProperty(string prop) { return Properties[prop]; + //else return 0; } mapping GetProperties() { *************** *** 41,45 **** } mapping SetProperties(mapping props) { ! return (Properties += props); } --- 43,48 ---- } mapping SetProperties(mapping props) { ! if(sizeof(Properties)) return (Properties += props); ! else return (Properties = props); } diff -c -r --new-file ds1.1/lib/lib/props/radiance.c ds2.0r27/lib/lib/props/radiance.c *** ds1.1/lib/lib/props/radiance.c Sun Feb 1 21:30:16 1998 --- ds2.0r27/lib/lib/props/radiance.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/props/radiance.c ! * From the Dead Souls V LPC Library * Radiance is the capacity of one object to radiate light * Created by Descartes of Borg 961221 * Version: @(#) radiance.c 1.1@(#) --- 1,5 ---- /* /lib/props/radiance.c ! * From the Dead Souls LPC Library * Radiance is the capacity of one object to radiate light * Created by Descartes of Borg 961221 * Version: @(#) radiance.c 1.1@(#) *************** *** 13,19 **** return RadiantLight; } else { ! return (RadiantLight * 20)/(ambient); } } --- 13,20 ---- return RadiantLight; } else { ! //return (RadiantLight * 20)/(ambient); ! return RadiantLight; } } diff -c -r --new-file ds1.1/lib/lib/props/save.c ds2.0r27/lib/lib/props/save.c *** ds1.1/lib/lib/props/save.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/props/save.c Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,3 ---- + int DumpVars(string file){ + return save_object(file, 1); + } diff -c -r --new-file ds1.1/lib/lib/props/uniqueness.c ds2.0r27/lib/lib/props/uniqueness.c *** ds1.1/lib/lib/props/uniqueness.c Sun Feb 1 21:30:16 1998 --- ds2.0r27/lib/lib/props/uniqueness.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/props/uniqueness.c ! * From the Dead Souls V Object Library * Allows certain objects to be made rareor unique * Created by Descartes of Borg 961222 * Version: @(#) uniqueness.c 1.1@(#) --- 1,5 ---- /* /lib/props/uniqueness.c ! * From the Dead Souls Object Library * Allows certain objects to be made rareor unique * Created by Descartes of Borg 961222 * Version: @(#) uniqueness.c 1.1@(#) diff -c -r --new-file ds1.1/lib/lib/props/value.c ds2.0r27/lib/lib/props/value.c *** ds1.1/lib/lib/props/value.c Sun Feb 1 21:30:17 1998 --- ds2.0r27/lib/lib/props/value.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/props/value.c ! * From the Dead Souls V Object Library * Basic value attributes * Created by Descartes of Borg 970101 * Version: @(#) value.c 1.1@(#) --- 1,5 ---- /* /lib/props/value.c ! * From the Dead Souls Object Library * Basic value attributes * Created by Descartes of Borg 970101 * Version: @(#) value.c 1.1@(#) *************** *** 7,15 **** --- 7,17 ---- */ #include <vendor_types.h> + #include <daemons.h> private int DestroyOnSell = 0; private int Value = 0; + private int Cost = 0; private int VendorType = VT_TREASURE; int GetDestroyOnSell() { *************** *** 27,43 **** } string array GetSave() { ! return ({ "Value" }); } ! int GetValue() { return Value; } ! int SetValue(int x) { if( !intp(x) ) { error("Bad argument 1 to SetValue().\n\tExpected: int, Got: " + ! typeof(x) + "\n"); } else { return (Value = x); --- 29,47 ---- } string array GetSave() { ! return ({ "Value","Cost" }); } ! varargs int GetValue(string str) { ! if(Cost && str && valid_currency(str)) return query_value(Cost,query_base_currency(),str); ! return Value; } ! int SetValue(int x) { if( !intp(x) ) { error("Bad argument 1 to SetValue().\n\tExpected: int, Got: " + ! typeof(x) + "\n"); } else { return (Value = x); *************** *** 51,57 **** int SetVendorType(int x) { if( !intp(x) ) { error("Bad argument 1 to SetVendorType().\n\tExpected: int, Got: " + ! typeof(x) + "\n"); } if( !(x & VT_ALL) ) { error("Invalid vendor type.\n"); --- 55,61 ---- int SetVendorType(int x) { if( !intp(x) ) { error("Bad argument 1 to SetVendorType().\n\tExpected: int, Got: " + ! typeof(x) + "\n"); } if( !(x & VT_ALL) ) { error("Invalid vendor type.\n"); *************** *** 62,64 **** --- 66,102 ---- int CanSell() { return 1; } + + varargs mixed SetBaseCost(mixed arg, int i){ + float base, rate; + + if(intp(arg)) Cost = arg; + else if(stringp(arg)){ + if(member_array(arg,ECONOMY_D->__QueryCurrencies()) == -1){ + return "Bad currency value to SetBaseCost."; + } + if(!i) return "Bad amount value to SetBaseCost."; + + base = query_base_rate(); + rate = ECONOMY_D->__Query(arg,"rate"); + + Cost = i * rate; + + } + return Cost; + } + + int GetBaseCost(string str){ + if(!str)return Cost; + + if(member_array(str,ECONOMY_D->__QueryCurrencies()) == -1){ + return 0; + } + + return query_value(Cost,query_base_currency(),str); + } + + int SetDollarCost(int x){ + SetBaseCost("dollars", x); + return Cost; + } diff -c -r --new-file ds1.1/lib/lib/race.c ds2.0r27/lib/lib/race.c *** ds1.1/lib/lib/race.c Sun Feb 1 21:30:19 1998 --- ds2.0r27/lib/lib/race.c Wed Jul 5 00:00:58 2006 *************** *** 7,14 **** */ #include <lib.h> #include <daemons.h> ! #include <armour_types.h> #include <damage_types.h> #include <meal_types.h> #include "include/race.h" --- 7,15 ---- */ #include <lib.h> + #include <config.h> #include <daemons.h> ! #include <armor_types.h> #include <damage_types.h> #include <meal_types.h> #include "include/race.h" *************** *** 29,35 **** genetics::create(); Race = "blob"; Gender = "neuter"; ! Town = "Praxis"; } mixed CanDrink(object ob) { --- 30,36 ---- genetics::create(); Race = "blob"; Gender = "neuter"; ! Town = "Town"; } mixed CanDrink(object ob) { *************** *** 39,57 **** strength = (int)ob->GetStrength(); type = (int)ob->GetMealType(); if( (type & MEAL_ALCOHOL) && ((strength + GetAlcohol()) > ! GetStatLevel("durability")) ) ! return "You are way too drunk to coordinate another drink."; if( (type & MEAL_CAFFEINE) && ((strength + GetCaffeine()) > ! GetStatLevel("durability")) ) ! return "Any more caffeine and your heart will burst."; if( (type & MEAL_DRINK) && ((strength + GetDrink()) > 100) ) ! return "You are too bloated to drink any more!"; return 1; } mixed CanEat(object ob) { if( ((int)ob->GetStrength() + GetFood()) > 100 ) ! return "One more bite, and you would explode!"; else return 1; } --- 40,58 ---- strength = (int)ob->GetStrength(); type = (int)ob->GetMealType(); if( (type & MEAL_ALCOHOL) && ((strength + GetAlcohol()) > ! GetStatLevel("durability")) ) ! return "That drink is too strong for you right now."; if( (type & MEAL_CAFFEINE) && ((strength + GetCaffeine()) > ! GetStatLevel("durability")) ) ! return "That is too much caffeine for you right now."; if( (type & MEAL_DRINK) && ((strength + GetDrink()) > 100) ) ! return "You can't drink any more fluids right now."; return 1; } mixed CanEat(object ob) { if( ((int)ob->GetStrength() + GetFood()) > 100 ) ! return "This is more food than you can handle right now."; else return 1; } *************** *** 77,100 **** mixed eventEat(object ob) { AddFood((int)ob->GetStrength()); if( (int)ob->GetMealType() & MEAL_POISON ) ! AddPoison((int)ob->GetStrength()); return 1; } varargs string SetRace(string race, mixed extra) { ! mixed array args = ({ ({}), ({}), ({}), ({}) }); mixed array tmp; ! RACES_D->SetCharacterRace(race, args); ! foreach(tmp in args[0]) SetResistance(tmp...); ! foreach(tmp in args[1]) AddStat(tmp...); ! if( stringp(args[2]) ) SetLanguage(args[2], 100, 1); ! if( sizeof(args[3]) == 2 ) SetLightSensitivity(args[3]...); if( extra != 1 ) NewBody(race); if( stringp(extra) ) return (Race = extra), race; else return (Race = race); } string GetRace() { return Race; } string SetGender(string gender) { return (Gender = gender); } --- 78,133 ---- mixed eventEat(object ob) { AddFood((int)ob->GetStrength()); if( (int)ob->GetMealType() & MEAL_POISON ) ! AddPoison((int)ob->GetStrength()); return 1; } varargs string SetRace(string race, mixed extra) { ! mixed array args = allocate(5); mixed array tmp; ! mixed mixt; ! RACES_D->SetCharacterRace(race, args); ! ! //tc("meep: "+identify(args[4])); ! ! if(sizeof(args[4])){ ! foreach(mixed key, mixed val in args[4]){ ! this_object()->AddSkill(key,atoi(val[1])); ! } ! } ! ! foreach(tmp in args[0]) { ! mixt = copy(args[0]); ! SetResistance(tmp...); ! } ! foreach(tmp in args[1]) { ! mixt = copy(args[1]); ! //tc("mixt: "+identify(mixt),"blue"); ! AddStat(tmp...); ! } ! if( stringp(args[2]) ) { ! mixt = copy(args[2]); ! ! if(!ENGLISH_ONLY){ ! SetLanguage(args[2], 100, 1); ! } ! else { ! SetLanguage("English", 100, 1); ! } ! } ! if( sizeof(args[3]) == 2 ) { ! mixt = copy(args[3]); ! ! SetLightSensitivity(args[3]...); ! } if( extra != 1 ) NewBody(race); if( stringp(extra) ) return (Race = extra), race; else return (Race = race); } + + string GetRace() { return Race; } string SetGender(string gender) { return (Gender = gender); } *************** *** 106,132 **** genetics::SetStat(stat, level, classes); switch(stat) { ! case "durability": ! eventCompleteHeal(healthPoints = GetMaxHealthPoints()); ! eventHealDamage(healthPoints); ! break; ! case "intelligence": ! AddMagicPoints(GetMaxMagicPoints()); ! break; ! case "agility": ! AddStaminaPoints(GetMaxStaminaPoints()); ! break; } } varargs int GetMaxHealthPoints(string limb) { if(!limb) return ( 50 + (GetStatLevel("durability") * 10) ); else { ! int x; ! x = GetLimbClass(limb); ! if(!x) x = 5; ! return ( (1 + GetStatLevel("durability")/x) * 10 ); } } --- 139,165 ---- genetics::SetStat(stat, level, classes); switch(stat) { ! case "durability": ! eventCompleteHeal(healthPoints = GetMaxHealthPoints()); ! eventHealDamage(healthPoints); ! break; ! case "intelligence": ! AddMagicPoints(GetMaxMagicPoints()); ! break; ! case "agility": ! AddStaminaPoints(GetMaxStaminaPoints()); ! break; } } varargs int GetMaxHealthPoints(string limb) { if(!limb) return ( 50 + (GetStatLevel("durability") * 10) ); else { ! int x; ! x = GetLimbClass(limb); ! if(!x) x = 5; ! return ( (1 + GetStatLevel("durability")/x) * 10 ); } } *************** *** 141,147 **** void NewBody(string race) { mixed array args = allocate(2); mixed array tmp; ! body::NewBody(race); if(!race) return; RACES_D->SetCharacterLimbs(race, args); --- 174,180 ---- void NewBody(string race) { mixed array args = allocate(2); mixed array tmp; ! body::NewBody(race); if(!race) return; RACES_D->SetCharacterLimbs(race, args); *************** *** 161,194 **** x = random(GetStatLevel("luck")) / 20; x = ((x > 4) ? 4 : x); if( newbiep() ) x += random(7); ! return (x + random(4)); } int GetMobility() { ! int max = GetMaxCarry(); ! int encum, mob; ! if( GetParalyzed() ) { ! return 0; ! } ! if( max < 1 ) { ! max = 1; ! } ! encum = (GetCarriedMass() * 100)/max; ! encum -= (encum * GetStatLevel("agility"))/200; ! mob = 100 - encum; ! if( mob > 100 ) { ! mob = 100; ! } ! else if( mob < 1 ) { ! mob = 0; ! } ! return mob; } int GetCarriedMass() { return 0; } ! int GetMaxCarry() { return ((2 + GetStatLevel("strength")) * 100); } int GetHeartRate() { int x, y; --- 194,232 ---- x = random(GetStatLevel("luck")) / 20; x = ((x > 4) ? 4 : x); if( newbiep() ) x += random(7); ! return (x + random(4)); } int GetMobility() { ! int max = GetMaxCarry(); ! int encum, mob; ! if( GetParalyzed() ) { ! return 0; ! } ! if( max < 1 ) { ! max = 1; ! } ! encum = (GetCarriedMass() * 100)/max; ! encum -= (encum * GetStatLevel("agility"))/200; ! mob = 100 - encum; ! if( mob > 100 ) { ! mob = 100; ! } ! else if( mob < 1 ) { ! mob = 0; ! } ! return mob; } int GetCarriedMass() { return 0; } ! int GetMaxCarry() { ! int carry_max; ! carry_max = this_object()->GetLivingMaxCarry(); ! if(carry_max) return carry_max; ! else return ((2 + GetStatLevel("strength")) * 100); ! } int GetHeartRate() { int x, y; diff -c -r --new-file ds1.1/lib/lib/round.c ds2.0r27/lib/lib/round.c *** ds1.1/lib/lib/round.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/round.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,27 ---- + #include <lib.h> + #include "include/round.h" + #include <vendor_types.h> + inherit LIB_ITEM; + private int caliber,millimeter; + private string pistoltype,ammotype; + private string rifletype; + void create(){ + ::create(); + SetKeyName("round"); + SetId(({"round","bullet"})); + SetShort("a generic pistol round"); + SetLong("This is a generic pistol round."); + SetMass(1); + SetValue(1); + SetVendorType(VT_TREASURE); + } + int SetRifleType(string str) {rifletype=str; return 1; } + int SetPistolType(string str) {pistoltype=str; return 1; } + int SetAmmoType(string str) {ammotype=str; return 1; } + int SetCaliber(int x) { caliber=x; return 1; } + int SetMillimeter(int x){ millimeter=x; return 1; } + int GetMillimeter() { return millimeter; } + int GetCaliber() { return caliber; } + string GetRifleType() { return rifletype; } + string GetPistolType() { return pistoltype; } + string GetAmmoType() { return ammotype; } diff -c -r --new-file ds1.1/lib/lib/sentient.c ds2.0r27/lib/lib/sentient.c *** ds1.1/lib/lib/sentient.c Sun Feb 1 21:30:26 1998 --- ds2.0r27/lib/lib/sentient.c Wed Jul 5 00:00:58 2006 *************** *** 8,13 **** --- 8,16 ---- #include <lib.h> #include <function.h> + #include <talk_type.h> + #include <message_class.h> + inherit LIB_NPC; *************** *** 20,25 **** --- 23,29 ---- private mixed array WanderPath = ({}); private int WanderRecurse = 0; private int WanderSpeed = 0; + private int permit_load = 0; /* ****************** /lib/sentient.c data manipulation **************** */ /** *************** *** 167,176 **** return (WanderSpeed = x); } /* ****************** /lib/sentient.c events **************** */ mixed eventAsk(object who, string str) { string cmd, args; ! if( !str || str == "" ) return 0; if( sscanf(str, "%s %s", cmd, args) != 2 ) { cmd = str; --- 171,189 ---- return (WanderSpeed = x); } + int SetPermitLoad(mixed i){ + permit_load = i; + return permit_load; + } + + int GetPermitLoad(){ + return permit_load; + } + /* ****************** /lib/sentient.c events **************** */ mixed eventAsk(object who, string str) { string cmd, args; ! if( !str || str == "" ) return 0; if( sscanf(str, "%s %s", cmd, args) != 2 ) { cmd = str; *************** *** 193,204 **** varargs mixed eventReceiveEmote(object who, string verb, string info) { mixed val = EmoteResponses[verb]; ! if( !val ) { return 0; } if( stringp(val) ) { ! eventSpeak(val); return 1; } return evaluate(val, this_player(), verb, info); --- 206,222 ---- varargs mixed eventReceiveEmote(object who, string verb, string info) { mixed val = EmoteResponses[verb]; ! ! //debug("who",who,"red"); ! //debug("verb",verb,"red"); ! //debug("info",info,"red"); ! //debug("responses",EmoteResponses,"red"); if( !val ) { return 0; } if( stringp(val) ) { ! //debug("val",val,"red"); ! eventSpeak(who,TALK_LOCAL,val); return 1; } return evaluate(val, this_player(), verb, info); *************** *** 223,229 **** mixed eventTalkRespond(object who, object targ, int cls, string msg, string lang) { string resp; ! foreach(resp in keys(TalkResponses)) { if( resp == "default" ) continue; if( strsrch(lower_case(msg), resp) > -1 ) { --- 241,247 ---- mixed eventTalkRespond(object who, object targ, int cls, string msg, string lang) { string resp; ! foreach(resp in keys(TalkResponses)) { if( resp == "default" ) continue; if( strsrch(lower_case(msg), resp) > -1 ) { *************** *** 232,243 **** return 1; } else if( evaluate(TalkResponses[resp], who, targ, msg, lang, cls) ) ! return 1; } } if( TalkResponses["default"] ) { if( stringp(TalkResponses["default"]) ) ! eventForce("speak " + TalkResponses["default"]); else evaluate(TalkResponses["default"], who, targ, msg, lang, cls); return 1; } --- 250,261 ---- return 1; } else if( evaluate(TalkResponses[resp], who, targ, msg, lang, cls) ) ! return 1; } } if( TalkResponses["default"] ) { if( stringp(TalkResponses["default"]) ) ! eventForce("speak " + TalkResponses["default"]); else evaluate(TalkResponses["default"], who, targ, msg, lang, cls); return 1; } *************** *** 246,273 **** mixed eventWander() { int fp; ! if( !sizeof(WanderPath) ) { string *sorties; string tmp; sorties = ({}); foreach(tmp in (string *)environment()->GetExits()) { string dest, door; ! ! if( !find_object(dest = (string)environment()->GetExit(tmp)) ) ! continue; ! if( (door = (string)environment()->GetDoor(tmp)) && ! (int)door->GetClosed() ) continue; sorties += ({ "go " + tmp }); } foreach(tmp in (string *)environment()->GetEnters()) { string dest, door; ! if( !find_object(dest = (string)environment()->GetEnter(tmp)) ) ! continue; ! if( (door = (string)environment()->GetDoor(tmp)) && ! (int)door->GetClosed() ) continue; sorties += ({ "enter " + tmp }); } if( sizeof(sorties) ) { --- 264,296 ---- mixed eventWander() { int fp; ! ! //tc("1","red"); ! if( !sizeof(WanderPath) ) { string *sorties; string tmp; + //tc("2","green"); sorties = ({}); foreach(tmp in (string *)environment()->GetExits()) { string dest, door; ! ! if( !permit_load && !find_object(dest = (string)environment()->GetExit(tmp)) ) ! continue; ! door = (string)environment()->GetDoor(tmp); ! if( door && ! (int)door->GetClosed() ) continue; sorties += ({ "go " + tmp }); } foreach(tmp in (string *)environment()->GetEnters()) { string dest, door; ! if( !find_object(dest = (string)environment()->GetEnter(tmp)) ) ! continue; ! door = (string)environment()->GetDoor(tmp); ! if( door && ! (int)door->GetClosed() ) continue; sorties += ({ "enter " + tmp }); } if( sizeof(sorties) ) { *************** *** 277,288 **** else return 0; } if( arrayp(WanderPath[WanderMarker]) ) ! foreach(mixed cmd in WanderPath[WanderMarker]) { ! if( fp = functionp(cmd) ) { ! if( fp != FP_OWNER_DESTED ) evaluate(cmd); ! } ! else eventForce(cmd); ! } else if( fp = functionp(WanderPath[WanderMarker]) ) { if( fp != FP_OWNER_DESTED ) evaluate(WanderPath[WanderMarker]); } --- 300,311 ---- else return 0; } if( arrayp(WanderPath[WanderMarker]) ) ! foreach(mixed cmd in WanderPath[WanderMarker]) { ! if( fp = functionp(cmd) ) { ! if( fp != FP_OWNER_DESTED ) evaluate(cmd); ! } ! else eventForce(cmd); ! } else if( fp = functionp(WanderPath[WanderMarker]) ) { if( fp != FP_OWNER_DESTED ) evaluate(WanderPath[WanderMarker]); } *************** *** 309,320 **** --- 332,347 ---- return; } if( !GetInCombat() ) { // Things to do when not in combat + //tc("not in combat"); if( WanderSpeed ) { // Check if wandering + //tc("wandering"); if( WanderCount >= WanderSpeed ) { // Time to wander + //tc("time to wander"); WanderCount = 0; eventWander(); } else { + //tc("not time to wander yet"); WanderCount++; } } diff -c -r --new-file ds1.1/lib/lib/shadow.c ds2.0r27/lib/lib/shadow.c *** ds1.1/lib/lib/shadow.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/shadow.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,30 ---- + #include <lib.h> + #include <dirs.h> + + object shadowed; + + int eventShadow(object ob){ + shadow(ob); + shadowed = ob; + return 1; + } + + int wtf(){ + return 42; + } + + mixed GetShadowed(){ + return shadow(shadowed,0); + } + + string GetShadowedName(){ + return shadowed->GetName(); + } + + object GetShadowedObject(){ + return shadowed; + } + + + + //void create(){}; diff -c -r --new-file ds1.1/lib/lib/shell.c ds2.0r27/lib/lib/shell.c *** ds1.1/lib/lib/shell.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/shell.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,24 ---- + #include <lib.h> + #include "include/shell.h" + #include <vendor_types.h> + inherit LIB_ITEM; + private int caliber,millimeter; + private string pistoltype,ammotype; + void create(){ + ::create(); + SetKeyName("shell"); + SetId(({"shell","casing","shell casing"})); + SetShort("a spent pistol shell"); + SetLong("This is the empty shell casing of a bullet that has been fired."); + SetMass(1); + SetValue(0); + SetVendorType(VT_TREASURE); + } + int SetPistolType(string str) {pistoltype=str; return 1; } + int SetAmmoType(string str) {ammotype=str; return 1; } + int SetCaliber(int x) { caliber=x; return 1; } + int SetMillimeter(int x){ millimeter=x; return 1; } + int GetMillimeter() { return millimeter; } + int GetCaliber() { return caliber; } + string GetPistolType() { return pistoltype; } + string GetAmmoType() { return ammotype; } diff -c -r --new-file ds1.1/lib/lib/shop.c ds2.0r27/lib/lib/shop.c *** ds1.1/lib/lib/shop.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/shop.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,45 ---- + /* /realms/haderach/land/cities/hartland/pawnshop.c + * created by Haderach@Frontiers + * Date: Sat Aug 31 02:37:27 1996 + */ + + #include <lib.h> + + inherit LIB_ROOM; + + static void create() { + ::create(); + } + + void init() { + ::init(); + add_action("list","list"); + add_action("show","show"); + add_action("price","price"); + add_action("appraise","appraise"); + } + + object *ob; + object ob2; + int list(string str) { + if(!str || str == "") str = "all"; + present("vendor")->cmdBrowse(this_player(),str); + return 1; + } + + + + int show(string str) { + present("vendor")->cmdShow(this_player(),str); + return 1; + } + + int price(string str) { + present("vendor")->cmdPrice(this_player(),str); + return 1; + } + + int appraise(string str) { + present("vendor")->cmdAppraise(this_player(),str); + return 1; + } diff -c -r --new-file ds1.1/lib/lib/spell.c ds2.0r27/lib/lib/spell.c *** ds1.1/lib/lib/spell.c Sun Feb 1 21:30:27 1998 --- ds2.0r27/lib/lib/spell.c Wed Jul 5 00:00:58 2006 *************** *** 61,71 **** --- 61,78 ---- } int GetDamage() { + int tmp = 0; int damage = Damage[0]; if( Damage[1] ) { damage += random(Damage[1]); } + if(this_player()->GetSkill("magic attack")){ + tmp = (this_player()->GetSkill("magic attack")["level"]) * 2; + tmp = tmp/this_player()->GetSkill("magic attack")["class"]; + } + damage += tmp; + //tc("spell damage: "+identify(damage)); return damage; } *************** *** 142,148 **** else { return "Cast against what?"; } ! case "against STR for LIV": return "Pray against what for whom?"; } --- 149,155 ---- else { return "Cast against what?"; } ! case "against STR for LIV": return "Pray against what for whom?"; } *************** *** 336,342 **** } if( stringp(args[0]) ) { // on STR int which = member_array("against STR", Rules); ! if( which == -1 && member_array("STR", Rules) == -1 ) { return 0; } --- 343,349 ---- } if( stringp(args[0]) ) { // on STR int which = member_array("against STR", Rules); ! if( which == -1 && member_array("STR", Rules) == -1 ) { return 0; } *************** *** 438,451 **** int miss_count = 0; int hit_con = 0; int miss_con = 0; ! int con, bonus; ! if( !maxi ) { return -1; } for(i=0; i<maxi; i++) { mixed area; ! if( !enemies[i] ) { continue; } --- 445,458 ---- int miss_count = 0; int hit_con = 0; int miss_con = 0; ! int bonus; ! if( !maxi ) { return -1; } for(i=0; i<maxi; i++) { mixed area; ! if( !enemies[i] ) { continue; } *************** *** 471,478 **** miss_count++; miss_con += enemies[i]->GetMagicResistance(); send_messages("repel", "$target_name $target_verb " ! "$agent_possessive_noun magic attack.", who, ! enemies[i], area); enemies[i] = 0; } else { --- 478,485 ---- miss_count++; miss_con += enemies[i]->GetMagicResistance(); send_messages("repel", "$target_name $target_verb " ! "$agent_possessive_noun magic attack.", who, ! enemies[i], area); enemies[i] = 0; } else { *************** *** 483,492 **** } if( miss_count > 0 ) { bonus = who->GetCombatBonus(misses/miss_count); ! bonus *= GetTrainingModifier(); foreach(string skill in GetSkills()) { who->eventTrainSkill(skill, power/(hit_count+miss_count), ! miss_con/miss_count, 0, bonus); } } if( hit_count < 1 ) { --- 490,499 ---- } if( miss_count > 0 ) { bonus = who->GetCombatBonus(misses/miss_count); ! bonus *= GetTrainingModifier(); foreach(string skill in GetSkills()) { who->eventTrainSkill(skill, power/(hit_count+miss_count), ! miss_con/miss_count, 0, bonus); } } if( hit_count < 1 ) { *************** *** 496,502 **** bonus *= GetTrainingModifier(); foreach(string skill in GetSkills()) { who->eventTrainSkill(skill, power/(hit_count+miss_count), ! hit_con/hit_count, 1, bonus); } return 1; } --- 503,509 ---- bonus *= GetTrainingModifier(); foreach(string skill in GetSkills()) { who->eventTrainSkill(skill, power/(hit_count+miss_count), ! hit_con/hit_count, 1, bonus); } return 1; } *************** *** 525,538 **** for(i=0; i<maxi; i++) { int hp, max_hp; ! if( !targets[i] ) { continue; } if( limb ) { if( member_array(limb, targets[i]->GetLimbs()) == -1 ) { send_messages("have", "$target_name $target_verb no " + ! limb + ".", who, targets[i]); targets[i] = 0; continue; } --- 532,545 ---- for(i=0; i<maxi; i++) { int hp, max_hp; ! if( !targets[i] ) { continue; } if( limb ) { if( member_array(limb, targets[i]->GetLimbs()) == -1 ) { send_messages("have", "$target_name $target_verb no " + ! limb + ".", who, targets[i]); targets[i] = 0; continue; } *************** *** 542,552 **** if( max_hp - hp < (Healing[0]+Healing[1])/10 + 1 ) { if( limb ) { send_messages("", "$target_possessive_noun " + limb + ! " needs no healing.", who, targets[i]); } else { send_messages("need", "$target_name $target_verb no " ! "healing.", who, targets[i]); } targets[i] = 0; continue; --- 549,559 ---- if( max_hp - hp < (Healing[0]+Healing[1])/10 + 1 ) { if( limb ) { send_messages("", "$target_possessive_noun " + limb + ! " needs no healing.", who, targets[i]); } else { send_messages("need", "$target_name $target_verb no " ! "healing.", who, targets[i]); } targets[i] = 0; continue; *************** *** 564,570 **** if( x < GetDifficulty() ) { // Can't even cast it... foreach(string skill in skills) { who->eventTrainSkill(skill, level, GetDifficulty(), ! 0, GetTrainingModifier()); } who->eventPrint("You must have gotten the words wrong."); return 0; --- 571,577 ---- if( x < GetDifficulty() ) { // Can't even cast it... foreach(string skill in skills) { who->eventTrainSkill(skill, level, GetDifficulty(), ! 0, GetTrainingModifier()); } who->eventPrint("You must have gotten the words wrong."); return 0; *************** *** 581,587 **** } foreach(string skill in skills) { who->eventTrainSkill(skill, level, GetDifficulty(), ! 1, GetTrainingModifier()); } } return 1; --- 588,594 ---- } foreach(string skill in skills) { who->eventTrainSkill(skill, level, GetDifficulty(), ! 1, GetTrainingModifier()); } } return 1; *************** *** 603,610 **** send_messages(Messages[0][0], Messages[0][1], who, 0,environment(who)); if( !ob->eventMove(who) ) { send_messages("drop", "$agent_name could not carry " + ! ob->GetShort() + " and $agent_verb it!", who, 0, ! environment(who)); ob->eventMove(environment(who)); } return 1; --- 610,617 ---- send_messages(Messages[0][0], Messages[0][1], who, 0,environment(who)); if( !ob->eventMove(who) ) { send_messages("drop", "$agent_name could not carry " + ! ob->GetShort() + " and $agent_verb it!", who, 0, ! environment(who)); ob->eventMove(environment(who)); } return 1; *************** *** 639,645 **** foreach(string message, mapping tmp in messages) { foreach(string verb, object array obs in tmp) { send_messages(verb, message, who, obs, ! environment(who), ([ "$limb" : limb ])); } } if( sizeof(targets) ) { --- 646,652 ---- foreach(string message, mapping tmp in messages) { foreach(string verb, object array obs in tmp) { send_messages(verb, message, who, obs, ! environment(who), ([ "$limb" : limb ])); } } if( sizeof(targets) ) { *************** *** 661,668 **** continue; } damage = (GetDamage() * level)/100; damage = target->eventReceiveDamage(who, GetDamageType(), damage, ! AutoDamage, limb); total_damage += damage; tmp = GetMessage(damage); if( !messages[tmp[1]] ) { --- 668,679 ---- continue; } damage = (GetDamage() * level)/100; + //damage = GetDamage(); + if(!limb) limb = "torso"; + //tc("limb: "+identify(limb)); + if(grepp(identify(limb),"leg") || grepp(identify(limb),"foot")) limb = "torso"; damage = target->eventReceiveDamage(who, GetDamageType(), damage, ! AutoDamage, limb); total_damage += damage; tmp = GetMessage(damage); if( !messages[tmp[1]] ) { *************** *** 680,686 **** foreach(string message, mapping tmp in messages) { foreach(string verb, object array obs in tmp) { send_messages(verb, message, who, obs, ! environment(who), ([ "$limb" : limb ])); } } if( sizeof(targets) ) { --- 691,697 ---- foreach(string message, mapping tmp in messages) { foreach(string verb, object array obs in tmp) { send_messages(verb, message, who, obs, ! environment(who), ([ "$limb" : limb ])); } } if( sizeof(targets) ) { *************** *** 718,724 **** } if( stringp(args[0]) ) { int which = member_array("against STR", Rules); ! if( which == -1 && member_array("STR", Rules) == -1 ) { return GetErrorMessage(); } --- 729,735 ---- } if( stringp(args[0]) ) { int which = member_array("against STR", Rules); ! if( which == -1 && member_array("STR", Rules) == -1 ) { return GetErrorMessage(); } diff -c -r --new-file ds1.1/lib/lib/stargate.c ds2.0r27/lib/lib/stargate.c *** ds1.1/lib/lib/stargate.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/stargate.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,258 ---- + #include <lib.h> + #include <daemons.h> + #include "/lib/include/stargate.h" + + /** + * 2006-03-28, jonez + * - based on a suggestion from rhk, changed so that one cannot enter the + * gate unless status is "outbound". this makes the object closer to the + * (theoretical) math and also to what happens on the show. + */ + + /** + * based on portal.c by Brodbane - March 2006 + * + * $Id: stargate.c,v 1.1 2006/04/05 05:48:39 jam Exp $ + * + * The desired functionality is much like a "star gate": users dialed + * letters or full words that lined up with destinations. A portal opens to + * that destination briefly. To define destinations you must setup a + * constant below then add it to the switch statement in the cmdDial + * function. This object is crude and basic, but gets the job done. + * + * 2006-03-22, jonez + * - original version of this file is from Daelas@Moraelinost + * 2006-03-23, jonez + * - altered so code uses existing verbs (touch, enter) where possible. last add_action is for dial command. + * - added single mapping called "database" and made the "dial" command use it. + * - dial command no longer uses switch/case, making adding a new destination simpler + * - made use of SetPreventGet() / SetPreventPut() + * - made use of new stargate daemon + * - made use of LIB_STARGATE + * - made use of STARGATE_D + * + * IDEAS: + * - create a daemon that holds the stargate network [DONE] + * - allow for stargate failure + * - add dhd object + * - change the code so that it uses a single mapping of names and + * destinations, perhaps in a database file. currently an update to the + * object requires an update for all the objects. [DONE] + * - dhd skill (thanks plato) + * - delay when dialing gate. destination dhd lights up? + * - player should not be able to dial earth if earth is already connected elsewhere (need daemon) [DONE] + * - make use of existing verbs (enter, touch) instead of doing our own thing. [DONE] + * - daemon should contain a class that maps the various gates to each other. see lib/include/door.h [DONE] + * - shout "off world activation" into the gateroom when the gate engages. + * - track status as "incoming" or "outgoing".. you can only "enter" an outgoing gate (rhk) [DONE] + * - if room is empty, shut down the gate (rhk) + * - change callout time when someone goes through the gate (rhk) + */ + + inherit LIB_ITEM; + + static private string origin; + + string displayLong(); + string displayShort(); + + void create(){ + item::create(); + + SetKeyName("stargate"); + SetId(({"stargate", "gate", "portal", "ring"})); + SetAdjectives(({"stargate"})); + SetShort( (: displayShort :) ); + + SetLong( (: displayLong :) ); + + AddItem( "inner ring", "The second ring - the inner ring - is placed " + "inside the larger ring and seems to be able to move."); + SetMass(1000); + SetBaseCost("silver",50); + SetPreventGet("The gate is pure naquadah and cannot be moved"); + SetPreventPut("The gate is pure naquadah and cannot be moved"); + SetTouch("You feel the stargate beneath your hand humming with energy."); + } + + void init(){ + ::init(); + add_action( "cmdDial", "dial" ); + add_action( "cmdEnter", "enter"); + } + + + void SetOrigin(string o, string d){ + if (o == "" || d == "") return; + origin = lower_case(o); + if(!sizeof(STARGATE_D->GetStargate(origin))){ + STARGATE_D->SetStargate(origin, d); + } + } + + string GetOrigin(){ + return origin; + } + + void eventConnect(string destination){ + int ret; + + destination = lower_case(destination); + //tc("origin: "+origin,"white"); + //tc("destination: "+destination,"white"); + + if (origin == destination){ + write("You attempt to dial the gate, but the last chevron does not engage"); + say(this_player()->GetName() + " tries to dial the gate but the last chevron does not engage"); + return; + } + + ret = STARGATE_D->eventConnect(origin, destination); + if (ret){ + string d = STARGATE_D->GetDestination(destination); + write("The ancient rings lock into place and a portal forms in an explosion of energy."); + say("The ancient rings lock into place and a portal forms in an explosion of energy."); + tell_room(d, "The ancient rings lock into place and a portal forms in an explosion of energy"); + call_out("eventDisconnect", 10+random(5)); + return; + } + + write("You attempt to dial the stargate, but nothing happens."); + say(this_player()->GetName() + " tries to dial the gate but fails."); + + return; + } + + int eventDisconnect(){ + string endpoint = STARGATE_D->GetEndpoint(origin); + string e = STARGATE_D->GetDestination(origin); + string d = STARGATE_D->GetDestination(endpoint); + //object e = load_object(STARGATE_D->GetEndpoint(origin)); + //object d; + //if(e) d = load_object(STARGATE_D->GetDestination(STARGATE_D->GetEndpoint(origin))); + + //debug(sprintf("stargate_lib->eventDisconnect(%s), e=%s, d=%s", origin, e, d)); + + // FIX: does the player Get a message if they come through the gate and then leave the room? + //write("The chevrons on the stargate disengage and the portal disappears."); + //say("The chevrons on the stargate disengage and the portal disappears."); + //tell_room(d, "The chevrons on the stargate disengage and the portal disappears", ({ this_player() })); + if(d) tell_room(d, "The chevrons on the stargate disengage and the portal disappears."); + if(e) tell_room(e, "The chevrons on the stargate disengage and the portal disappears."); + + //tc("origin: "+identify(origin)); + + return STARGATE_D->eventDisconnect(origin); + } + + string status(){ + //tc("origin: "+origin); + //tc("staus: "+STARGATE_D->GetStatus(origin)); + return STARGATE_D->GetStatus(origin); + } + + mixed cmdDial(string s){ + object ob; + string flipside; + if (s) + { + //tc("s: "+s); + if(STARGATE_D->GetDestination(s)) + flipside = STARGATE_D->GetDestination(s); + //tc("flipside: "+flipside); + eventConnect(s); + //if(sizeof(flipside)) ob = find_object(flipside); + if(sizeof(flipside) && !ob) ob = load_object(flipside); + if(!ob){ + write("The Stargate abruptly begins to shuts down."); + eventDisconnect(); + } + //else if(!present("stargate",find_object(flipside))) tc("wtf"); + return 1; + } + + return 0; + + } + + int cmdEnter(string what){ + string endpoint, destination; + object who; + + if (what != "gate" && what != "stargate") + { + return 0; + } + + if (status() != "outbound") + { + return 0; + } + + who = this_player(); + endpoint = STARGATE_D->GetEndpoint(origin); + destination = STARGATE_D->GetDestination(endpoint); + //debug("endpoint=" + endpoint); + //debug("destination=" + destination); + who->eventPrint("You step through the event horizon of the stargate."); + who->eventMoveLiving(destination, + "$N steps into the event horizon and disappears", + "$N steps out of the event horizon"); + return 1; + + } + + int eventEnter(object who){ + string endpoint; + + if (!who) return 0; + + endpoint = STARGATE_D->GetEndpoint(origin); + if (status() == "connected") + { + who->eventPrint("You step through the event horizon of the stargate."); + who->eventMoveLiving(endpoint, + "$N steps into the event horizon and disappears", + "$N steps out of the event horizon"); + } + return 1; + } + + string displayLong(){ + string buf, stat; + + buf = "This is the Stargate of legend. The Stargate was created " + "from naquadah ore, similar to black quartz. It is a perfectly " + "circular device approximately ten meters in diameter and " + "comprised of two sets of rings and nine chevrons placed " + "equidistant along its outer circumference."; + + stat = status(); + + if (stat == "outbound" || stat == "inbound") + { + buf += " There is an event horizon in the center of the ring that looks like shimmering water."; + } + else if (stat == "idle") + { + buf += " This gate is currently idle."; + } + return buf; + } + + string displayShort(){ + string stat; + stat = status(); + //tc("status: "+stat); + switch (stat) + { + case "inbound": + return "an inbound stargate"; + case "outbound": + return "an outbound stargate"; + case "idle": + return "an idle stargate"; + default: + return "a broken stargate"; + } + } diff -c -r --new-file ds1.1/lib/lib/std/armor.c ds2.0r27/lib/lib/std/armor.c *** ds1.1/lib/lib/std/armor.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/std/armor.c Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,464 ---- + /* /lib/std/armor.c + * From the Dead Souls Object Library + * The standard armor object + * Created by Descartes of Borg 950408 + * Version: @(#) armor.c 1.9@(#) + * Last modified: 97/01/01 + */ + + #include <lib.h> + #include <function.h> + #include <armor_types.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_BURY; + inherit LIB_DETECT; + inherit LIB_DETERIORATION; + inherit LIB_DROP; + inherit LIB_EQUIP; + inherit LIB_GET; + inherit LIB_GIVE; + inherit LIB_LOCK_WITH; + inherit LIB_MASS; + inherit LIB_MOVE; + inherit LIB_OBJECT; + inherit LIB_PERSIST; + inherit LIB_POISON; + inherit LIB_PUT; + inherit LIB_READ; + inherit LIB_SELL; + inherit LIB_STEAL; + inherit LIB_UNIQUENESS; + inherit LIB_VALUE; + inherit LIB_WEAR; + + private int Fingers = 5; + private mapping Protection = ([]); + private string array RestrictLimbs = 0; + private static mixed Wear = 0; + private static mapping MaxProtection = ([]); + + int GetMaxProtection(int type); + + private int RetainOnDeath = 0; + + int SetRetainOnDeath(int x ) { return (RetainOnDeath = x); } + + int GetRetainOnDeath() { return RetainOnDeath; } + + /* *************** /lib/armor.c data functions *************** */ + varargs string GetEquippedDescription(object who) { + if( GetWorn() ) { + string tmp = "It is worn on "; + + if( !who ) { + who = this_player(); + } + if( who == environment()) { + tmp += "your"; + } + else { + tmp += possessive_noun(environment()); + } + tmp += " " + item_list(GetWorn()) + "."; + return tmp; + } + return 0; + } + + varargs string GetExternalDesc(){ + string desc; + desc = ::GetExternalDesc(); + if(GetWorn()) desc += " "+GetEquippedDescription(); + return desc; + } + + + + string GetEquippedShort() { + string tmp = GetShort(); + + if( GetWorn() ) { + tmp += " (%^GREEN%^worn%^RESET%^)"; + } + return tmp; + } + + int GetFingers() { + return Fingers; + } + + int SetFingers(int x) { + return (Fingers = x); + } + + /* Just check the surface for blade/knife/blunt damage + * Other damage types will be checked via more costly methods + * -blitz + */ + string GetItemCondition() { + int cuts, dents; + string ret; + cuts = dents = -1; + + foreach(int type, int val in Protection) { + int x; + if( BLADE & type || KNIFE & type ) { + x = to_float(val) / GetMaxProtection(type) * 100; + if( cuts == -1 || x < cuts ) cuts = x; + } + else if( BLUNT & type ) { + x = to_float(val) / GetMaxProtection(type) * 100; + if( dents == -1 || x > dents ) dents = x; + } + } + if( cuts == -1 && dents == -1 ) return 0; + if( cuts > -1 ) switch( cuts ) { + case 0..10: ret = "shredded to pieces"; break; + case 11..20: ret = "shredded"; break; + case 21..40: ret = "mildly shredded"; break; + case 41..60: ret = "slashed up"; break; + case 61..80: ret = "scratched"; break; + case 81..90: ret = "somewhat nicked"; break; + default: ret = "unbroken"; + } + if( dents > -1 ) { + if( ret ) ret += " and "; + else ret = ""; + switch( dents ) { + case 0..10: ret += "utterly battered"; break; + case 11..20: ret += "terribly pounded"; break; + case 21..40: ret += "serverly dented"; break; + case 41..60: ret += "pretty dented"; break; + case 61..80: ret += "dented"; break; + case 81..90: ret += "slightly dented"; break; + default: ret += "unmarred"; + } + } + return "Its surface is " + ret + "."; + } + + int GetMaxProtection(int type) { + return MaxProtection[type]; + } + + int GetProtection(int type) { + int array types; + int i; + + foreach(int t, int val in Protection) { + if( t & type ) { + int blessing = GetProperty("blessed"); + + if( !intp(blessing) ) { + blessing = 0; + } + return (val + blessing); + } + } + return 0; + } + + int SetProtection(int type, int amount) { + MaxProtection[type] = amount; + return (Protection[type] = amount); + } + + string array GetRestrictLimbs() { + return RestrictLimbs; + } + + string array SetRestrictLimbs(string array limbs) { + return (RestrictLimbs = limbs); + } + + static mixed array AddSave(mixed array vars) { + if(!vars) vars = ({}); + vars += ({ "Properties" }); + return persist::AddSave(vars); + } + + string array GetSave() { + return persist::GetSave(); + } + + mixed GetWear() { + return Wear; + } + + mixed SetWear(mixed val) { + return (Wear = val); + } + + /* ****************** armor.c modals ********************* */ + mixed CanEquip(object who, string array limbs) { + mixed tmp; + + if( !limbs ) { /* let's try and guess */ + string array guess = who->GetLimbs(); + int armor = GetArmorType(); + string limb; + + if( !guess ) { + return "You have no limbs!"; + } + limbs = ({}); + foreach(limb in guess) { + mapping data; + + data = who->GetLimb(limb); + if( data["armors"] & armor ) { + limbs += ({ limb }); + } + } + if( equip::CanEquip(who, limbs) != 1 ) { + return "Wear " + GetDefiniteShort() + " on which limb?"; + } + else { + return 1; + } + } + else if( sizeof(limbs) == 1 ) { + string which; + + switch(GetArmorType()) { + case A_SHIELD: + if( which = who->GetLimbParent(limbs[0]) ) { + limbs = ({ limbs[0], "torso", which }); + } + break; + + case A_LONG_GLOVE: case A_LONG_BOOT: + if( which = who->GetLimbParent(limbs[0]) ) { + limbs = ({ limbs[0], which }); + } + else { + limbs = ({ limbs[0] }); + } + break; + + default: + limbs = ({ limbs[0] }); + break; + } + } + return equip::CanEquip(who, limbs); + } + + mixed CanRepair(object who) { + return 1; + } + + mixed CanSteal(object who) { + if( GetWorn() ) { + return "You can't steal something equipped!"; + } + return steal::CanSteal(who); + } + + /* ********************* armor.c events *********************** */ + static int Destruct() { + if( GetWorn() && environment() ) { + eventUnequip(environment()); + } + return object::Destruct(); + } + + void eventDeteriorate(int type) { + foreach(int t, int val in Protection) { + if( (t & type) && val ) { + if( GetProperty("blessed") ) { + Protection[t] -= 2; + } + else { + Protection[t]--; + } + if( Protection[t] < 1 ) { + Protection[t] = 0; + } + } + } + SetDestroyOnSell(1); + SetValue(GetValue()/2); + } + + mixed eventEquip(object who, string array limbs) { + mixed tmp; + + if( !limbs ) { /* let's try and guess */ + int armor = GetArmorType(); + string limb; + + limbs = ({}); + foreach(limb in who->GetLimbs()) { + mapping data = who->GetLimb(limb); + + if( data["armors"] & armor ) { + limbs += ({ limb }); + } + } + if( equip::CanEquip(who, limbs) != 1 ) { + return "Wear " + GetDefiniteShort() + " on which limb?"; + } + } + else if( sizeof(limbs) == 1 ) { + string which; + + switch(GetArmorType()) { + case A_SHIELD: + if( which = who->GetLimbParent(limbs[0]) ) { + limbs = ({ limbs[0], "torso", which }); + } + break; + + case A_LONG_GLOVE: case A_LONG_BOOT: + if( which = who->GetLimbParent(limbs[0]) ) { + limbs = ({ limbs[0], which }); + } + else { + limbs = ({ limbs[0] }); + } + break; + + default: + limbs = ({ limbs[0] }); + break; + } + } + if( functionp(Wear) ) { + if( functionp(Wear) & FP_OWNER_DESTED ) { + //return "Error in evaluating function pointer."; + return "You can't wear that there at the moment."; + } + if( !evaluate(Wear, who, limbs) ) { + return 1; + } + } + tmp = equip::eventEquip(who, limbs); + if( tmp != 1 ) { + if( tmp ) { + who->eventPrint(tmp); + } + else { + //who->eventPrint("Error in wearing armor."); + who->eventPrint("You can't wear that there right now."); + } + return 1; + } + tmp = GetShort(); + SetWorn(limbs); + if( functionp(Wear) ) { + return 1; + } + else if( stringp(Wear) ) { + who->eventPrint(Wear); + } + else { + who->eventPrint("You wear " + tmp + "."); + } + environment(who)->eventPrint(who->GetName() + " wears " + tmp + ".", who); + return 1; + } + + int eventMove(mixed dest) { + if( !environment() && GetWorn() ) { + mixed array limbs = GetWorn(); + + SetWorn(0); + call_out((: eventRestoreEquip :), 0, limbs); + } + if( GetWorn() && environment() ) { + eventUnequip(environment()); + } + return move::eventMove(dest); + } + + int eventReceiveDamage(object agent, int type, int amt, int i, mixed array l) { + int x = -1; + + foreach(int t, int val in Protection) { + if( t & type ) { + if( x == -1 || val < x ) { + x = val; + } + } + } + x = x/2 + random(x/2); + x = deterioration::eventReceiveDamage(agent, type, x, i, l); + return x; + } + + varargs mixed eventRepair(object who, int strength, int type) { + if( !who || !strength ) { + return 0; + } + if( !type ) { + type = ALL_DAMAGE; + } + foreach(int i in keys(Protection)) { + if( !(i & type) || !MaxProtection[i]) { + continue; + } + Protection[i] += strength; + if( Protection[i] > MaxProtection[i] ) { + Protection[i] = MaxProtection[i]; + } + } + return 1; + } + + mixed eventShow(object who, string component) { + mixed tmp = object::eventShow(who, component); + + if( component || tmp != 1 ) { + return tmp; + } + if( GetPoison() ) { + if( random(100) < who->GetSkillLevel("stealth") ) { + who->eventPrint("You notice a strange substance on it."); + } + } + return 1; + } + + varargs mixed eventUnequip(object who) { + mixed tmp = equip::eventUnequip(who); + + if( tmp != 1 ) { + return tmp; + } + send_messages("remove", "$agent_name $agent_verb $target_name.", + who, this_object(), environment(who)); + return 1; + } + + int restrict(mixed arg){ + if(!arg) return 1; + if(arg) SetRestrictLimbs(arg); + return 2; + } + + /* ******************** armor.c driver applies ******************** */ + static void create() { + AddSave(equip::GetSave() + value::GetSave() + mass::GetSave() + + poison::GetSave() + deterioration::GetSave()); + steal::create(); + object::create(); + SetVendorType(VT_ARMOR); + } + + void init() { + int atype; + atype = GetArmorType(); + if(atype & A_HELMET ) restrict(({"head"})); + if(atype & A_VISOR ) restrict(({"head"})); + if(atype & A_PANTS ) restrict(({"right leg","left leg"})); + if(atype & A_BELT ) restrict(({"torso"})); + if(atype & A_SHIRT ) restrict(({"torso"})); + if(atype & A_CLOAK ) restrict(({"torso"})); + if(atype & A_VEST ) restrict(({"torso"})); + if(atype & A_ARMOR ) restrict(({"torso","right arm","left arm"})); + if(atype & A_COLLAR ) restrict(({"neck"})); + if(atype & A_BODY_ARMOR ) restrict(({"torso","right arm","left arm","left leg","right leg"}) ); + } diff -c -r --new-file ds1.1/lib/lib/std/armour.c ds2.0r27/lib/lib/std/armour.c *** ds1.1/lib/lib/std/armour.c Sun Feb 1 21:30:15 1998 --- ds2.0r27/lib/lib/std/armour.c Wed Dec 31 19:00:00 1969 *************** *** 1,432 **** - /* /lib/std/armour.c - * From the Dead Souls Object Library - * The standard armour object - * Created by Descartes of Borg 950408 - * Version: @(#) armour.c 1.9@(#) - * Last modified: 97/01/01 - */ - - #include <lib.h> - #include <function.h> - #include <armour_types.h> - #include <damage_types.h> - #include <vendor_types.h> - - inherit LIB_BURY; - inherit LIB_DETECT; - inherit LIB_DETERIORATION; - inherit LIB_DROP; - inherit LIB_EQUIP; - inherit LIB_GET; - inherit LIB_GIVE; - inherit LIB_LOCK_WITH; - inherit LIB_MASS; - inherit LIB_MOVE; - inherit LIB_OBJECT; - inherit LIB_PERSIST; - inherit LIB_POISON; - inherit LIB_PUT; - inherit LIB_READ; - inherit LIB_SELL; - inherit LIB_STEAL; - inherit LIB_UNIQUENESS; - inherit LIB_VALUE; - inherit LIB_WEAR; - - private int Fingers = 5; - private mapping Protection = ([]); - private string array RestrictLimbs = 0; - private static mixed Wear = 0; - private static mapping MaxProtection = ([]); - - int GetMaxProtection(int type); - - private int RetainOnDeath = 0; - - int SetRetainOnDeath(int x ) { return (RetainOnDeath = x); } - - int GetRetainOnDeath() { return RetainOnDeath; } - - /* *************** /lib/armour.c data functions *************** */ - varargs string GetEquippedDescription(object who) { - if( GetWorn() ) { - string tmp = "It is worn on "; - - if( !who ) { - who = this_player(); - } - if( who == environment()) { - tmp += "your"; - } - else { - tmp += possessive_noun(environment()); - } - tmp += " " + item_list(GetWorn()) + "."; - return tmp; - } - return 0; - } - - string GetEquippedShort() { - string tmp = GetShort(); - - if( GetWorn() ) { - tmp += " (worn)"; - } - return tmp; - } - - int GetFingers() { - return Fingers; - } - - int SetFingers(int x) { - return (Fingers = x); - } - - /* Just check the surface for blade/knife/blunt damage - * Other damage types will be checked via more costly methods - * -blitz - */ - string GetItemCondition() { - int cuts, dents; - string ret; - cuts = dents = -1; - - foreach(int type, int val in Protection) { - int x; - if( BLADE & type || KNIFE & type ) { - x = to_float(val) / GetMaxProtection(type) * 100; - if( cuts == -1 || x < cuts ) cuts = x; - } - else if( BLUNT & type ) { - x = to_float(val) / GetMaxProtection(type) * 100; - if( dents == -1 || x > dents ) dents = x; - } - } - if( cuts == -1 && dents == -1 ) return 0; - if( cuts > -1 ) switch( cuts ) { - case 0..10: ret = "shredded to pieces"; break; - case 11..20: ret = "shredded"; break; - case 21..40: ret = "mildly shredded"; break; - case 41..60: ret = "slashed up"; break; - case 61..80: ret = "scratched"; break; - case 81..90: ret = "somewhat nicked"; break; - default: ret = "unbroken"; - } - if( dents > -1 ) { - if( ret ) ret += " and "; - else ret = ""; - switch( dents ) { - case 0..10: ret += "utterly battered"; break; - case 11..20: ret += "terribly pounded"; break; - case 21..40: ret += "serverly dented"; break; - case 41..60: ret += "pretty dented"; break; - case 61..80: ret += "dented"; break; - case 81..90: ret += "slightly dented"; break; - default: ret += "unmarred"; - } - } - return "Its surface is " + ret + "."; - } - - int GetMaxProtection(int type) { - return MaxProtection[type]; - } - - int GetProtection(int type) { - int array types; - int i; - - foreach(int t, int val in Protection) { - if( t & type ) { - int blessing = GetProperty("blessed"); - - if( !intp(blessing) ) { - blessing = 0; - } - return (val + blessing); - } - } - return 0; - } - - int SetProtection(int type, int amount) { - MaxProtection[type] = amount; - return (Protection[type] = amount); - } - - string array GetRestrictLimbs() { - return RestrictLimbs; - } - - string array SetRestrictLimbs(string array limbs) { - return (RestrictLimbs = limbs); - } - - static mixed array AddSave(mixed array vars) { - return persist::AddSave(vars); - } - - string array GetSave() { - return persist::GetSave(); - } - - mixed GetWear() { - return Wear; - } - - mixed SetWear(mixed val) { - return (Wear = val); - } - - /* ****************** armour.c modals ********************* */ - mixed CanEquip(object who, string array limbs) { - mixed tmp; - - if( !limbs ) { /* let's try and guess */ - string array guess = who->GetLimbs(); - int armour = GetArmourType(); - string limb; - - if( !guess ) { - return "You have no limbs!"; - } - limbs = ({}); - foreach(limb in guess) { - mapping data; - - data = who->GetLimb(limb); - if( data["armours"] & armour ) { - limbs += ({ limb }); - } - } - if( equip::CanEquip(who, limbs) != 1 ) { - return "Wear " + GetDefiniteShort() + " on which limb?"; - } - else { - return 1; - } - } - else if( sizeof(limbs) == 1 ) { - string which; - - switch(GetArmourType()) { - case A_SHIELD: - if( which = who->GetParentLimb(limbs[0]) ) { - limbs = ({ limbs[0], "torso", which }); - } - break; - - case A_LONG_GLOVE: case A_LONG_BOOT: - if( which = who->GetParentLimb(limbs[0]) ) { - limbs = ({ limbs[0], which }); - } - else { - limbs = ({ limbs[0] }); - } - break; - - default: - limbs = ({ limbs[0] }); - break; - } - } - return equip::CanEquip(who, limbs); - } - - mixed CanRepair(object who) { - return 1; - } - - mixed CanSteal(object who) { - if( GetWorn() ) { - return "You can't steal something equipped!"; - } - return steal::CanSteal(who); - } - - /* ********************* armour.c events *********************** */ - static int Destruct() { - if( GetWorn() && environment() ) { - eventUnequip(environment()); - } - return object::Destruct(); - } - - void eventDeteriorate(int type) { - foreach(int t, int val in Protection) { - if( (t & type) && val ) { - if( GetProperty("blessed") ) { - Protection[t] -= 2; - } - else { - Protection[t]--; - } - if( Protection[t] < 1 ) { - Protection[t] = 0; - } - } - } - SetDestroyOnSell(1); - SetValue(GetValue()/2); - } - - mixed eventEquip(object who, string array limbs) { - mixed tmp; - - if( !limbs ) { /* let's try and guess */ - int armour = GetArmourType(); - string limb; - - limbs = ({}); - foreach(limb in who->GetLimbs()) { - mapping data = who->GetLimb(limb); - - if( data["armours"] & armour ) { - limbs += ({ limb }); - } - } - if( equip::CanEquip(who, limbs) != 1 ) { - return "Wear " + GetDefiniteShort() + " on which limb?"; - } - } - else if( sizeof(limbs) == 1 ) { - string which; - - switch(GetArmourType()) { - case A_SHIELD: - if( which = who->GetParentLimb(limbs[0]) ) { - limbs = ({ limbs[0], "torso", which }); - } - break; - - case A_LONG_GLOVE: case A_LONG_BOOT: - if( which = who->GetParentLimb(limbs[0]) ) { - limbs = ({ limbs[0], which }); - } - else { - limbs = ({ limbs[0] }); - } - break; - - default: - limbs = ({ limbs[0] }); - break; - } - } - if( functionp(Wear) ) { - if( functionp(Wear) & FP_OWNER_DESTED ) { - return "Error in evaluating function pointer."; - } - if( !evaluate(Wear, who, limbs) ) { - return 1; - } - } - tmp = equip::eventEquip(who, limbs); - if( tmp != 1 ) { - if( tmp ) { - who->eventPrint(tmp); - } - else { - who->eventPrint("Error in wearing armour."); - } - return 1; - } - tmp = GetShort(); - SetWorn(limbs); - if( functionp(Wear) ) { - return 1; - } - else if( stringp(Wear) ) { - who->eventPrint(Wear); - } - else { - who->eventPrint("You wear " + tmp + "."); - } - environment(who)->eventPrint(who->GetName() + " wears " + tmp + ".", who); - return 1; - } - - int eventMove(mixed dest) { - if( !environment() && GetWorn() ) { - mixed array limbs = GetWorn(); - - SetWorn(0); - call_out((: eventRestoreEquip :), 0, limbs); - } - if( GetWorn() && environment() ) { - eventUnequip(environment()); - } - return move::eventMove(dest); - } - - int eventReceiveDamage(object agent, int type, int amt, int i, mixed array l) { - int x = -1; - - foreach(int t, int val in Protection) { - if( t & type ) { - if( x == -1 || val < x ) { - x = val; - } - } - } - x = x/2 + random(x/2); - x = deterioration::eventReceiveDamage(agent, type, x, i, l); - return x; - } - - varargs mixed eventRepair(object who, int strength, int type) { - if( !who || !strength ) { - return 0; - } - if( !type ) { - type = ALL_DAMAGE; - } - foreach(int i in keys(Protection)) { - if( !(i & type) || !MaxProtection[i]) { - continue; - } - Protection[i] += strength; - if( Protection[i] > MaxProtection[i] ) { - Protection[i] = MaxProtection[i]; - } - } - return 1; - } - - mixed eventShow(object who, string component) { - mixed tmp = object::eventShow(who, component); - - if( component || tmp != 1 ) { - return tmp; - } - if( GetPoison() ) { - if( random(100) < who->GetSkillLevel("stealth") ) { - who->eventPrint("You notice a strange substance on it."); - } - } - return 1; - } - - varargs mixed eventUnequip(object who) { - mixed tmp = equip::eventUnequip(who); - - if( tmp != 1 ) { - return tmp; - } - send_messages("remove", "$agent_name $agent_verb $target_name.", - who, this_object(), environment(who)); - return 1; - } - - /* ******************** armour.c driver applies ******************** */ - static void create() { - AddSave(equip::GetSave() + value::GetSave() + mass::GetSave() + - poison::GetSave() + deterioration::GetSave()); - steal::create(); - object::create(); - SetVendorType(VT_ARMOUR); - } - - void init() { } --- 0 ---- diff -c -r --new-file ds1.1/lib/lib/std/bane.c ds2.0r27/lib/lib/std/bane.c *** ds1.1/lib/lib/std/bane.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/std/bane.c Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,18 ---- + string array bane; + + string array GetBane(){ + if(bane) return bane; + } + + string array QueryBane(){ + if(bane) return bane; + } + + int SetBane(array arr){ + if(arr) bane = arr; + return 1; + } + + void create(){ + } + diff -c -r --new-file ds1.1/lib/lib/std/barkeep.c ds2.0r27/lib/lib/std/barkeep.c *** ds1.1/lib/lib/std/barkeep.c Sun Feb 1 21:30:15 1998 --- ds2.0r27/lib/lib/std/barkeep.c Wed Jul 5 00:01:05 2006 *************** *** 7,13 **** */ #include <lib.h> ! inherit LIB_SENTIENT; inherit LIB_BUY; --- 7,13 ---- */ #include <lib.h> ! inherit LIB_SENTIENT; inherit LIB_BUY; *************** *** 17,59 **** string GetLocalCurrency(); mixed eventSell(object who, string args); /* ******************* barkeep.c attributes *********************** */ ! int GetCost(string item) { float f = currency_rate(GetLocalCurrency()); ! if( !MenuItems[item] ) { return 0; } if( f < 0.1 ) { f = 1.0; } ! return to_int(to_float(MenuItems[item]->GetValue()) * f); } string GetLocalCurrency() { return LocalCurrency; } ! string SetLocalCurrency(string str) { return (LocalCurrency = str); } ! ! mapping AddMenuItem(string item, string file) { ! MenuItems[item] = file; return MenuItems; } ! mapping GetMenuItems() { return MenuItems; } ! mapping RemoveMenuItem(string item) { ! map_delete(MenuItems, item); return MenuItems; } ! mapping SetMenuItems(mapping mp) { ! return (MenuItems = mp); } /* *********************** barkeep.c modals ************************ */ --- 17,84 ---- string GetLocalCurrency(); mixed eventSell(object who, string args); + int indirect_sell_obj_to_liv() { + write("Your offer is refused."); + say(this_player()->GetName()+"'s sell offer is refused."); + return 0; + } + + /* ******************* barkeep.c attributes *********************** */ ! int GetCost(string *item) { float f = currency_rate(GetLocalCurrency()); ! if( !MenuItems[item] ) { return 0; } if( f < 0.1 ) { f = 1.0; } ! return query_value(load_object(MenuItems[item])->GetBaseCost(),query_base_currency(),this_object()->GetLocalCurrency()); } string GetLocalCurrency() { return LocalCurrency; } ! string SetLocalCurrency(string str) { return (LocalCurrency = str); } ! ! mapping AddMenuItem(mixed item, string file) { ! string *item_arr; ! if(stringp(item)) item_arr = ({ item }); ! else item_arr = item; ! MenuItems[item_arr] = file; return MenuItems; } ! mapping GetMenuItems() { return MenuItems; } ! mapping RemoveMenuItem(string item) { ! string *item_arr; ! if(!sizeof(MenuItems)) return MenuItems; ! foreach(string *key, string arr in MenuItems){ ! if(member_array(item,key) != -1) item_arr = key; ! } ! if(sizeof(item_arr)) map_delete(MenuItems, item_arr); return MenuItems; } ! mapping SetMenuItems(mapping mp) { ! mapping mp2 = ([]); ! //tc("mp: "+identify(mp)); ! foreach(mixed key, mixed val in mp){ ! string *key2; ! if(stringp(key)) key2 = ({ key }); ! else key2 = key; ! mp2[key2] = val; ! } ! //tc("mp2: "+identify(mp2)); ! //tc("copy(mp2): "+identify(copy(mp2))); ! return (MenuItems = copy(mp2)); } /* *********************** barkeep.c modals ************************ */ *************** *** 61,83 **** return 1; } ! mixed CanSell(object who, string what) { if( !MenuItems[what] ) { return "There is no such thing for sale."; } ! return buy::CanSell(who, what); } /* *********************** barkeep.c events *********************** */ ! mixed eventBuyItem(object who, string cmd, string args) { mixed tmp; ! ! if( !args || args == "" ) { ! eventForce("speak err, what do you want me to sell?"); ! return 1; } ! args = remove_article(lower_case(args)); ! tmp = CanSell(who, args); if( tmp != 1 ) { if( tmp ) { who->eventPrint(tmp); --- 86,116 ---- return 1; } ! mixed CanSell(object who, string item) { ! string *what = ({}); ! foreach(string *key, string val in MenuItems){ ! if(member_array(item,key) != -1) what = key; ! } if( !MenuItems[what] ) { return "There is no such thing for sale."; } ! //return buy::CanSell(who, what); ! return 1; } /* *********************** barkeep.c events *********************** */ ! mixed eventBuyItem(object who, string cmd, string item) { mixed tmp; ! string *what = ({}); ! if( !item || item == "" ) { ! eventForce("speak err, what do you want me to sell?"); ! return 1; ! } ! item = remove_article(lower_case(item)); ! foreach(string *key, string val in MenuItems){ ! if(member_array(item,key) != -1) what = key; } ! tmp = CanSell(who, item); if( tmp != 1 ) { if( tmp ) { who->eventPrint(tmp); *************** *** 87,148 **** } return 1; } ! return eventSell(who, args); } mixed eventSell(object who, string args) { object ob; int x; ! ! if( !(ob = load_object(MenuItems[args])) ) { ! eventForce("speak I am having a problem with that item right now."); ! return 1; } ! x = GetCost(args); if( x > (int)who->GetCurrency(GetLocalCurrency()) ) { ! eventForce("speak You do not have that much in " + GetLocalCurrency()); ! return 1; } ! ob = new(MenuItems[args]); if( !ob ) { ! eventForce("speak I seem to be having some troubles."); ! return 1; } if( !((int)ob->eventMove(this_object())) ) { ! eventForce("speak Sorry, today is just not my day"); ! return 1; } eventForce("give " + (string)ob->GetKeyName() + " to " + ! (string)who->GetKeyName()); if( environment(ob) == this_object() ) { ! eventForce("speak heh, you cannot carry that. I will drop it."); ! eventForce("drop " + (string)ob->GetKeyName()); ! if( environment(ob) == this_object()) { ob->eventMove(environment()); } } who->AddCurrency(GetLocalCurrency(), -x); eventForce("speak Thank you for your business, " + ! (string)who->GetName()); return 1; } int eventList(object who, string cmd, string args) { string array drinks = ({}); ! string drink; if( !sizeof(keys(MenuItems)) ) { ! eventForce("speak I have nothing to serve right now."); ! return 1; } foreach(drink in keys(MenuItems)) { string array adjectives = MenuItems[drink]->GetAdjectives(); string adj = ""; - if( sizeof(adjectives) ) { adj = adjectives[random(sizeof(adjectives))] + " "; } ! drinks += ({ adj + drink + " for " + GetCost(drink) }); } eventForce("speak I currently supply " + item_list(drinks) + "."); eventForce("speak Prices are in " + GetLocalCurrency() + " of course."); --- 120,184 ---- } return 1; } ! return eventSell(who, item); } mixed eventSell(object who, string args) { object ob; int x; ! string *what; ! foreach(string *key, string val in MenuItems){ ! if(member_array(args,key) != -1) what = key; ! } ! //tc("what: "+identify(what)); ! if( !(ob = load_object(MenuItems[what])) ) { ! eventForce("speak I am having a problem with that item right now."); ! return 1; } ! x = query_value(ob->GetBaseCost(),query_base_currency(),GetLocalCurrency()); if( x > (int)who->GetCurrency(GetLocalCurrency()) ) { ! eventForce("speak You do not have that much in " + GetLocalCurrency()); ! return 1; } ! ob = new(MenuItems[what]); if( !ob ) { ! eventForce("speak I seem to be having some troubles."); ! return 1; } if( !((int)ob->eventMove(this_object())) ) { ! eventForce("speak Sorry, today is just not my day"); ! return 1; } eventForce("give " + (string)ob->GetKeyName() + " to " + ! (string)who->GetKeyName()); if( environment(ob) == this_object() ) { ! eventForce("speak heh, you cannot carry that. I will drop it."); ! eventForce("drop " + (string)ob->GetKeyName()); ! if( environment(ob) == this_object()) { ob->eventMove(environment()); } } who->AddCurrency(GetLocalCurrency(), -x); eventForce("speak Thank you for your business, " + ! (string)who->GetName()); return 1; } int eventList(object who, string cmd, string args) { string array drinks = ({}); ! string *drink; if( !sizeof(keys(MenuItems)) ) { ! eventForce("speak I have nothing to serve right now."); ! return 1; } foreach(drink in keys(MenuItems)) { string array adjectives = MenuItems[drink]->GetAdjectives(); string adj = ""; if( sizeof(adjectives) ) { adj = adjectives[random(sizeof(adjectives))] + " "; } ! drinks += ({ adj + drink[0] + " for " + GetCost(drink) }); } eventForce("speak I currently supply " + item_list(drinks) + "."); eventForce("speak Prices are in " + GetLocalCurrency() + " of course."); *************** *** 153,159 **** static void create() { sentient::create(); SetCommandResponses( ([ ! ({ "list", "show", "browse" }) : (: eventList :), ! ({ "sell", "serve" }) : (: eventBuyItem :), ! ]) ); } --- 189,195 ---- static void create() { sentient::create(); SetCommandResponses( ([ ! ({ "list", "show", "browse" }) : (: eventList :), ! ({ "sell", "serve" }) : (: eventBuyItem :), ! ]) ); } diff -c -r --new-file ds1.1/lib/lib/std/bed.c ds2.0r27/lib/lib/std/bed.c *** ds1.1/lib/lib/std/bed.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/std/bed.c Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,17 ---- + #include <lib.h> + + inherit LIB_ITEM; + inherit LIB_SIT; + inherit LIB_LIE; + + inherit LIB_SURFACE; + + void create(){ + ::create(); + SetMaxSitters(4); + SetMaxLiers(2); + SetMaxCarry(300); + SetMass(1700); + } + + diff -c -r --new-file ds1.1/lib/lib/std/book.c ds2.0r27/lib/lib/std/book.c *** ds1.1/lib/lib/std/book.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/std/book.c Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,97 ---- + #include <lib.h> + + inherit LIB_ITEM; + + string array chapters, globalheader; + string Title = "Generic Book"; + string Source = "/obj/book_source"; + static mapping BookItems = ([]); + static mapping BookReads = ([]); + + string globalstr, globalstr2; + + + void SetTitle(string title){ + if(title) Title = title; + } + + mixed GetTitle(){ + if(Title) return Title; + else return 0; + } + + void SetSource(string source){ + if(source && directory_exists(source)) Source = source; + } + + string GetSource(){ + if(Source) return Source; + else return ""; + } + + string array eventExtractChapterName(string path){ + string *header; + string chap, foo, line; + int num; + + if(!path) return ({""}); + if(first(last_string_element(path,"/"),1) == ".") return ({""}); + + if(path && file_size(path) > 0){ + globalstr = ""; + globalstr2 = path; + if(!file_exists(globalstr2)) globalstr2 == ""; + if(sizeof(globalstr2)) unguarded( (: globalstr = read_file(globalstr2, 1, 1) :) ); + line = globalstr; + } + if(!line) chap = "unknown"; + else if(sscanf(line,"chapter %s %s", chap, foo) != 2) chap = "unknown"; + if(sscanf(chap,"%d",num) != 1) num = 0; + header = ({ "chapter "+chap, "chapter "+cardinal(num), chap }); + return ({ header, foo }); + } + + mapping *eventLoadChapters(){ + string this_path; + + foreach(string chap in get_dir(Source+"/")){ + this_path = Source+"/"+chap; + globalheader = eventExtractChapterName(this_path); + + if(sizeof(globalheader) > 1){ + BookItems[globalheader[0]] = globalheader[1]; + globalstr = this_path; + unguarded( (: BookReads[globalheader[0]] = read_file(globalstr) :) ); + } + } + return ({ copy(BookItems), copy(BookReads) }); + } + + string eventLoadIndex(){ + int i; + string chapter_index = "\t\t"+this_object()->GetTitle()+"\n\n"; + for(i=1; i<300; i++){ + if(this_object()->GetItem("chapter "+i)) { + chapter_index += "Chapter "+i+":\t"; + chapter_index += this_object()->GetItem("chapter "+i)+""; + } + } + return chapter_index; + } + + + void create(){ + ::create(); + SetDefaultRead("Try \"read chapter 1 in book\" or " + "\"read index in book\""); + } + + void init(){ + mapping *map_array = this_object()->eventLoadChapters(); + ::init(); + SetItems(map_array[0]); + SetReads(map_array[1]); + AddItem( "index", "This is a list of the chapters in this book."); + SetRead("index", this_object()->eventLoadIndex()); + } + diff -c -r --new-file ds1.1/lib/lib/std/bot_corpse.c ds2.0r27/lib/lib/std/bot_corpse.c *** ds1.1/lib/lib/std/bot_corpse.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/std/bot_corpse.c Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,42 ---- + #include <lib.h> + #include <message_class.h> + + inherit LIB_CORPSE; + + void create() { + corpse::create(); + SetId(({"chassis","body","synthetics"})); + SetAdjectives(({"melting","corroding"})); + } + + int eventDecay() { + if( !environment() ) { + Destruct(); + return 0; + } + Fresh = 0; + switch(Count) { + case 10: + environment()->eventPrint(possessive_noun(Owner) + " chassis " + + "begins to corrode.", MSG_ROOMDESC); + SetId(GetId()..., "chassis", "body"); + SetAdjectives(GetAdjectives()..., "melting", "corroding"); + SetShort("the corroding chassis of an artificial body"); + SetSmell("The chassis emits an acrid chemical odor."); + break; + case 20: + environment()->eventPrint("An acrid chemical odor fills the entire " + "area.", MSG_ROOMDESC); + SetId(GetId()..., "synthetics", "pile", "pile of synthetics"); + SetShort("a pile of corroding synthetics"); + SetSmell("Its smell is nearly unbearable."); + break; + case 30: + Destruct(); + return 0; + } + Count++; + //CallOut = call_out((: eventDecay :), DecayLife/3); + return Count; + } + diff -c -r --new-file ds1.1/lib/lib/std/bot_limb.c ds2.0r27/lib/lib/std/bot_limb.c *** ds1.1/lib/lib/std/bot_limb.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/std/bot_limb.c Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,44 ---- + #include <lib.h> + + inherit LIB_LIMB; + + static void create() { + limb::create(); + } + + int eventDecay() { + if( !environment() ) { + CallOut = -1; + Destruct(); + return 0; + } + switch(Count) { + case 10: + message("smell", "The "+Limb+" rapidly corrodes.", environment()); + SetShort("the corroding remnant of a " + Limb); + break; + case 20: + message("smell", "An acrid chemical odor fills the area.", + environment()); + SetShort("some corroded chemicals"); + break; + case 30: + CallOut = -1; + Destruct(); + return 0; + } + Count++; + //CallOut = call_out((: eventDecay :), DecayLife/3); + return Count; + } + + void SetLimb(string limb, string owner, string race) { + SetKeyName(limb); + SetId( ({ "limb", Limb = limb }) ); + Owner = owner; + Race = race; + Count = 1; + SetShort("a melting " + possessive_noun(Race) + " " +Limb); + SetLong("This limb is rapidly corroding into its component chemicals."); + //CallOut = call_out((: eventDecay :), DecayLife/3); + } diff -c -r --new-file ds1.1/lib/lib/std/chair.c ds2.0r27/lib/lib/std/chair.c *** ds1.1/lib/lib/std/chair.c Sun Feb 1 21:30:15 1998 --- ds2.0r27/lib/lib/std/chair.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/chair.c ! * From the Dead Souls V Object Library * A thing you can sit in * Created by Descartes of Borg 961221 * Version: @(#) chair.c 1.1@(#) --- 1,5 ---- /* /lib/chair.c ! * From the Dead Souls Object Library * A thing you can sit in * Created by Descartes of Borg 961221 * Version: @(#) chair.c 1.1@(#) *************** *** 10,14 **** --- 10,22 ---- inherit LIB_ITEM; inherit LIB_SIT; + inherit LIB_SURFACE; + + void create(){ + ::create(); + SetMaxSitters(1); + SetMaxCarry(100); + SetMass(500); + } /* Nothing else needs to happen here */ diff -c -r --new-file ds1.1/lib/lib/std/corpse.c ds2.0r27/lib/lib/std/corpse.c *** ds1.1/lib/lib/std/corpse.c Sun Feb 1 21:30:15 1998 --- ds2.0r27/lib/lib/std/corpse.c Wed Jul 5 00:01:05 2006 *************** *** 10,77 **** #include <message_class.h> inherit LIB_STORAGE; inherit LIB_SMELL; ! private int DecayLife, Count, CallOut, Fresh; ! private string Owner, Race; int eventDecay() { if( !environment() ) { ! Destruct(); ! return 0; } ! Fresh = 0; switch(Count) { ! case 1: ! environment()->eventPrint(possessive_noun(Owner) + " corpse " + ! "is starting to stink.", MSG_ROOMDESC); ! SetId(GetId()..., "corpse", "remains"); ! SetAdjectives(GetAdjectives()..., "stinky", "rotting"); ! SetShort("the stinky remains of a rotting corpse"); ! SetSmell("This corpse is beginning to stink up the entire area."); ! break; ! case 2: ! environment()->eventPrint("A rotting stench fills the entire " ! "area.", MSG_ROOMDESC); ! SetId(GetId()..., "flesh", "pile", "pile of flesh"); ! SetShort("a pile of rotting flesh"); ! SetSmell("Its smell is nearly unbearable."); ! break; ! case 3: ! Destruct(); ! return 0; } Count++; ! CallOut = call_out((: eventDecay :), DecayLife/3); return Count; } static int Destruct() { ! if( CallOut ) { ! remove_call_out(CallOut); ! } ! return storage::Destruct(); } int SetDecayLife(int x) { return (DecayLife = x); } int GetDecayLife() { return DecayLife; } void SetCorpse(object who) { if( DecayLife < 100 ) { ! DecayLife = 100; } SetKeyName(who->GetKeyName()); ! SetId(who->GetId()...); Owner = who->GetCapName(); Race = who->GetRace(); Count = 1; Fresh = 1; SetShort((string)who->GetShort()); SetLong("As you look closely at " + who->GetCapName() + ! ", you notice that " + nominative(who) + ! " does not appear to be moving."); ! CallOut = call_out((: eventDecay :), DecayLife/3); } int isFreshCorpse() { --- 10,84 ---- #include <message_class.h> inherit LIB_STORAGE; + inherit LIB_SURFACE; inherit LIB_SMELL; ! int DecayLife, Count, CallOut, Fresh; ! string Owner, Race; int eventDecay() { if( !environment() ) { ! Destruct(); ! return 0; } ! Fresh = 0; switch(Count) { ! case 10: ! environment()->eventPrint(possessive_noun(Owner) + " corpse " + ! "is starting to stink.", MSG_ROOMDESC); ! SetId(GetId()..., "corpse", "remains","flesh","pile","pile of flesh"); ! SetAdjectives(GetAdjectives()..., "stinky", "rotting"); ! SetShort("the stinky remains of a rotting corpse"); ! SetSmell("This corpse is beginning to stink up the entire area."); ! break; ! case 20: ! environment()->eventPrint("A rotting stench fills the entire " ! "area.", MSG_ROOMDESC); ! SetId(GetId()..., "flesh", "pile", "pile of flesh"); ! SetShort("a pile of rotting flesh"); ! SetSmell("Its smell is nearly unbearable."); ! break; ! case 30: ! Destruct(); ! return 0; } Count++; ! //CallOut = call_out((: eventDecay :), DecayLife/3); return Count; } static int Destruct() { ! //if( CallOut ) { ! // remove_call_out(CallOut); ! // } ! return ::Destruct(); } int SetDecayLife(int x) { return (DecayLife = x); } int GetDecayLife() { return DecayLife; } + //void init(){ + // ::init(); + // SetId(({ "body","corpse",who->GetId()... }) ); + //} + void SetCorpse(object who) { if( DecayLife < 100 ) { ! DecayLife = 500; } SetKeyName(who->GetKeyName()); ! //SetId(who->GetId()...); ! SetId(({ "body","corpse",who->GetId()... }) ); Owner = who->GetCapName(); Race = who->GetRace(); Count = 1; Fresh = 1; SetShort((string)who->GetShort()); SetLong("As you look closely at " + who->GetCapName() + ! ", you notice that " + nominative(who) + ! " does not appear to be moving."); ! //CallOut = call_out((: eventDecay :), DecayLife/3); } int isFreshCorpse() { *************** *** 92,98 **** static void create() { ! storage::create(); SetId( ({ "corpse", "flesh", "remains" }) ); SetAdjectives( ({"pile of", "rotting", "stinky"}) ); Count = 0; --- 99,105 ---- static void create() { ! ::create(); SetId( ({ "corpse", "flesh", "remains" }) ); SetAdjectives( ({"pile of", "rotting", "stinky"}) ); Count = 0; *************** *** 100,105 **** --- 107,113 ---- DecayLife = 100; Owner = 0; Race = 0; + SetNoCondition(1); } int direct_animate_obj() { *************** *** 110,112 **** --- 118,121 ---- return 1; } + string GetItemCondition() { return "";} diff -c -r --new-file ds1.1/lib/lib/std/daemon.c ds2.0r27/lib/lib/std/daemon.c *** ds1.1/lib/lib/std/daemon.c Sun Feb 1 21:30:15 1998 --- ds2.0r27/lib/lib/std/daemon.c Wed Jul 5 00:01:05 2006 *************** *** 24,31 **** /* ********************* daemon.c events ************************* */ int eventDestruct() { ! string str; ! if( !master()->valid_apply(({ PRIV_ASSIST })) ) { return 0; } --- 24,30 ---- /* ********************* daemon.c events ************************* */ int eventDestruct() { ! if( !master()->valid_apply(({ PRIV_ASSIST })) ) { return 0; } diff -c -r --new-file ds1.1/lib/lib/std/dummy.c ds2.0r27/lib/lib/std/dummy.c *** ds1.1/lib/lib/std/dummy.c Sun Feb 1 21:30:15 1998 --- ds2.0r27/lib/lib/std/dummy.c Wed Jul 5 00:01:05 2006 *************** *** 1,5 **** /* /lib/obj/dummy.c ! * From the Dead Souls V Object Library * A dummy item object that handles item descriptions and such * Created by Descartes of Borg 961014 * Version: @(#) dummy.c 1.18@(#) --- 1,5 ---- /* /lib/obj/dummy.c ! * From the Dead Souls Object Library * A dummy item object that handles item descriptions and such * Created by Descartes of Borg 961014 * Version: @(#) dummy.c 1.18@(#) *************** *** 22,31 **** inherit LIB_TOUCH; /* ***************** dummy.c attributes ***************** */ int isDummy() { return 1; } - varargs string array SetId(mixed ids...) { ids = id::SetId(ids); if( sizeof(ids) && !GetKeyName() ) { --- 22,31 ---- inherit LIB_TOUCH; /* ***************** dummy.c attributes ***************** */ + int isDummy() { return 1; } varargs string array SetId(mixed ids...) { ids = id::SetId(ids); if( sizeof(ids) && !GetKeyName() ) { *************** *** 36,42 **** } return ids; } - varargs int GetInvis(object ob) { return 1; } --- 36,41 ---- *************** *** 47,82 **** int x; if( env = environment() ) { ! env->eventReleaseObject(this_object()); x = clean::Destruct(); if( !x ) { env->eventReceiveObject(this_object()); } ! return x; } else return clean::Destruct(); } - mixed eventMove(mixed dest) { object ob; if( stringp(dest) ) { ob = load_object(dest); } else { ob = dest; } move_object(ob); if( environment() != ob ) { return 0; } else { return 1; } } ! /* ******************* dummy.c driver applies ******************** */ varargs static void create(string array id, mixed long, string array adj) { enter::create(); parse_init(); if( adj ) { --- 46,105 ---- int x; if( env = environment() ) { ! env->eventReleaseObject(this_object()); x = clean::Destruct(); if( !x ) { env->eventReceiveObject(this_object()); } ! return x; } else return clean::Destruct(); } mixed eventMove(mixed dest) { object ob; + string str; + + str = "I am "+file_name(this_object())+", named "+identify(GetId())+", "; + str += "and I have been asked to move "; + str += "by "+identify(previous_object()); + + if(previous_object(-1)) str += " at the request of "+identify(previous_object(-1)); + str += ". "; + if(environment()) str += "\nMy current environment is "+file_name(environment())+"."; + else str += "\nI currently have no environment."; if( stringp(dest) ) { ob = load_object(dest); + } else { ob = dest; } + str += "\nMy intended destination is "+file_name(ob)+". "; move_object(ob); if( environment() != ob ) { + str += "\nThe move was not successful"; + //tc(str,"red"); return 0; } else { + str += "\nThe move was successful."; + //tc(str,"red"); return 1; } } ! /* ******************* dummy.c driver applies ******************** */ varargs static void create(string array id, mixed long, string array adj) { + string str; + str = "I am "+file_name(this_object())+" and I have been created "; + str += "by "+identify(previous_object(-1)); + + if(environment()) str += "\nMy current environment is "+file_name(environment())+"."; + else str += "\nI currently have no environment."; + str += "\nCall stack: "+get_stack(); + //tc(str,"blue"); + enter::create(); parse_init(); if( adj ) { diff -c -r --new-file ds1.1/lib/lib/std/germ.c ds2.0r27/lib/lib/std/germ.c *** ds1.1/lib/lib/std/germ.c Sun Feb 1 21:30:15 1998 --- ds2.0r27/lib/lib/std/germ.c Wed Jul 5 00:01:05 2006 *************** *** 7,24 **** */ #include <lib.h> inherit LIB_ITEM; private int Communicable = 1; ! private static mixed Cure = 0; private static function Infect = 0; private static int LastHeartBeat = time(); private int LifeSpan = 60; private string Type = "cold"; mixed eventMultiply(); /* *************** /lib/germ.c data functions *************** */ int isGerm() { return 1; --- 7,36 ---- */ #include <lib.h> + #include <rooms.h> inherit LIB_ITEM; private int Communicable = 1; ! mixed Cure = 0; private static function Infect = 0; private static int LastHeartBeat = time(); private int LifeSpan = 60; + private int CannotInfect = 0; private string Type = "cold"; + private string GermName = "generic germ"; + private string array ImmuneRaces = ({ "android", "tree", + "plant", "elemental", "fish", "gargoyle", "god", "golem", "insect", + "slug", "snake", "wraith", "zombie" }); mixed eventMultiply(); + void init(){ + ::init(); + set_heart_beat(1); + + } + /* *************** /lib/germ.c data functions *************** */ int isGerm() { return 1; *************** *** 28,33 **** --- 40,64 ---- return Communicable; } + int GetCannotInfect(){ + return CannotInfect; + } + + int SetCannotInfect(int i){ + if(!i) i = 0; + CannotInfect = i; + return CannotInfect; + } + + int SetGermName(string str){ + if(str) GermName = str; + return 1; + } + + string GetGermName(){ + return GermName; + } + /* * int SetCommunicable(int x); * int x - how infectious the germ is *************** *** 41,47 **** * returns the degree to which it is communicable */ int SetCommunicable(int x) { ! if( x > 50 ) x = 50; return (Communicable = x); } --- 72,78 ---- * returns the degree to which it is communicable */ int SetCommunicable(int x) { ! if( x > 100 ) x = 100; return (Communicable = x); } *************** *** 65,77 **** * returns the successfully set value */ mixed SetCure(mixed val) { return (Cure = val); } - string array GetId() { - return ({ item::GetId()..., "germ" }); - } - function GetInfect() { return Infect; } --- 96,108 ---- * returns the successfully set value */ mixed SetCure(mixed val) { + if(intp(val)){ + Cure=val; + return; + } return (Cure = val); } function GetInfect() { return Infect; } *************** *** 85,91 **** * returns the function to be called */ function SetInfect(function f) { ! return (Infect = f); } int GetLifeSpan() { --- 116,123 ---- * returns the function to be called */ function SetInfect(function f) { ! Infect = f; ! return f; } int GetLifeSpan() { *************** *** 119,129 **** * valid values are: * viral * bacterial ! * * returns the new germ type */ string SetType(string type) { ! return (Type = type); } /* *************** /lib/germ.c events *************** */ --- 151,163 ---- * valid values are: * viral * bacterial ! * parasite * returns the new germ type */ string SetType(string type) { ! Type=type; ! if(!Type || Type == "") Type = "foo"; ! return Type; } /* *************** /lib/germ.c events *************** */ *************** *** 140,146 **** } if( functionp(Cure) ) { mixed tmp = evaluate(Cure, who, x, type); ! if( tmp != 1 ) { return tmp; } --- 174,180 ---- } if( functionp(Cure) ) { mixed tmp = evaluate(Cure, who, x, type); ! if( tmp != 1 ) { return tmp; } *************** *** 156,162 **** return 0; } set_heart_beat(0); ! Destruct(); return 1; } --- 190,196 ---- return 0; } set_heart_beat(0); ! eventDestruct(); return 1; } *************** *** 165,318 **** return 1; } if( !query_heart_beat() ) { - eventMultiply(); set_heart_beat(5); } return 1; } mixed eventInfect(object ob) { mixed tmp; ! if( functionp(Infect) ) { tmp = evaluate(Infect, ob); ! if( tmp != 1 ) { ! Destruct(); return tmp; } } ! if( !query_heart_beat() ) { ! set_heart_beat(5); ! } ! eventMove(ob); return 1; } mixed eventMultiply() { ! object ob; ! if( Communicable > random(3000) ) { ! object array germs = filter(deep_inventory(environment()), ! (: $1->isGerm() :)); ! object germ; ! if( sizeof(germs) > 5 ) { ! return 0; ! } ! germ = new(base_name(this_object())); ! if( !germ ) { ! return 0; ! } ! if( (ob = environment()) && random(100) > 50 ) { ! ob = (environment(ob) || ob); ! } ! if( living(ob) ) { ! if( ob->eventInfect(germ) != 1 ) { ! germ->eventDestruct(); ! } } ! else { ! germ->eventMove(ob); } ! return 1; } ! return 0; } void eventSuffer(object ob) { } ! /* *************** /lib/germ.c driver applies *************** */ static void create() { - AddSave(({ "Communicable", "LifeSpan", "Type" })); item::create(); SetInvis(1); SetMass(0); SetValue(0); SetPreventDrop(""); SetPreventGet(""); SetPreventPut(""); - call_out(function() { // Start up the HB if cloned into living thing - object env = environment(); - - if( !env || !living(env) ) { - return; - } - set_heart_beat(5); - }, 2); } static void heart_beat() { ! object array victims; ! object env = environment(); int interval; interval = time() - LastHeartBeat; LastHeartBeat = time(); ! if( !env ) { ! set_heart_beat(0); ! if( clonep() ) { ! Destruct(); ! } ! return; ! } ! if( living(env) && environment(env) ) { ! eventSuffer(env); ! if( !this_object() ) { ! return; ! } ! if( !env ) { ! if( this_object() ) { ! Destruct(); ! } ! return; ! } ! if( Communicable ) { ! eventMultiply(); ! } ! victims = filter(all_inventory(environment(env)), ! (: living :)) - ({ env }); } ! else { ! LifeSpan -= interval; ! if( LifeSpan < 1 ) { ! Destruct(); ! return; ! } ! victims = filter(all_inventory(env), (: living :)); ! if( !sizeof(victims) ) { ! set_heart_beat(0); ! return; ! } ! if( Communicable ) { ! eventMultiply(); ! } } ! if( Communicable > random(1000) ) { ! object target, germ; ! ! victims = sort_array(victims, ! function(object one, object two) { ! if( one->GetHealthPoints() > ! two->GetHealthPoints() ) { ! return -1; ! } ! else { ! return 1; ! } ! }); ! if( sizeof(victims) ) { ! target = victims[0]; ! } ! else { ! return; ! } ! germ = new(base_name(this_object())); ! if( germ ) { ! if( target->eventInfect(germ) != 1 ) { ! germ->eventDestruct(); ! } ! } } } --- 199,319 ---- return 1; } if( !query_heart_beat() ) { set_heart_beat(5); } + eventMultiply(); return 1; } mixed eventInfect(object ob) { mixed tmp; ! object presbane; ! string race; ! string *bane; ! if(!ob) return; ! ! race = ob->GetRace(); ! ! presbane = present("bane",ob); ! if(presbane) bane = presbane->QueryBane(); ! if(bane){ ! if(member_array(GetKeyName(),bane) != -1) return 0; ! if(member_array("all",bane) != -1) return 0; ! foreach(string foo in GetId()){ ! if(member_array(foo,bane) != -1) return 0; ! } ! } ! ! if(present(this_object()->GetKeyName(),ob) ) return 0; ! if(race && member_array(race, ImmuneRaces) != -1) return 0; ! if(ob->GetUndead() == 1) return 0; ! if(ob->GetAquatic() == 1) return 0; ! if(ob->GetNonCarbonBased() == 1) return 0; ! if( functionp(Infect) ) { tmp = evaluate(Infect, ob); ! if( tmp == 1 ) { ! eventMove(ob); ! if(environment() != ob) { ! eventMove(ROOM_FURNACE); ! set_heart_beat(0); ! } ! else set_heart_beat(5); return tmp; } } ! ! if(!eventMove(ob)) eventMove(ROOM_FURNACE); ! set_heart_beat(5); return 1; } + mixed eventMultiply() { ! object ob, germ, winner; ! object *targs; ! if( Communicable > random(1000) && !CannotInfect) { ! if( (ob = environment()) && living(ob) ) { ! if(environment(environment())) ob = environment(environment()); } ! ! if(!ob) return 0; ! ! //move to the host's environment ! if(!present(this_object()->GetName(),ob) ) { ! germ = new(base_name(this_object())); ! if( living(ob) ) germ->eventInfect(ob); ! else if(!germ->eventMove(ob)) germ->eventMove(ROOM_FURNACE); } ! ! //find someone to infect ! if(!sizeof(get_livings(ob))) return 0; ! targs = filter(get_livings(ob), (: !query_carrying($1,base_name(this_object())) :) ); ! if(sizeof(targs)) winner = targs[random(sizeof(targs))]; ! if(winner) new(base_name(this_object()))->eventInfect(winner); } ! return 1; } void eventSuffer(object ob) { } ! /* *************** /lib/germ.c driver applies *************** */ static void create() { item::create(); + AddSave(({ "Communicable", "LifeSpan", "Type" })); SetInvis(1); SetMass(0); SetValue(0); SetPreventDrop(""); SetPreventGet(""); SetPreventPut(""); } static void heart_beat() { ! object env; int interval; + if(!env = environment()) eventMove(ROOM_FURNACE); + interval = time() - LastHeartBeat; LastHeartBeat = time(); ! ! if( Communicable ) { ! eventMultiply(); } ! ! if( env && living(env) && environment(env) && member_array(env->GetRace(),ImmuneRaces) == -1) { ! eventSuffer(env); } ! ! if(LifeSpan == -1) return; ! LifeSpan -= interval; ! if( LifeSpan < 5 ) { ! eventDestruct(); ! return; } } diff -c -r --new-file ds1.1/lib/lib/std/item.c ds2.0r27/lib/lib/std/item.c *** ds1.1/lib/lib/std/item.c Sun Feb 1 21:30:15 1998 --- ds2.0r27/lib/lib/std/item.c Wed Jul 5 00:01:05 2006 *************** *** 5,11 **** * Version: @(#) item.c 1.30@(#) * Last Modified: 97/01/01 */ ! #include <lib.h> #include <dirs.h> #include <daemons.h> --- 5,11 ---- * Version: @(#) item.c 1.30@(#) * Last Modified: 97/01/01 */ ! #include <lib.h> #include <dirs.h> #include <daemons.h> *************** *** 28,41 **** inherit LIB_UNIQUENESS; inherit LIB_VALUE; inherit LIB_WEAPON; ! private int RetainOnDeath; /* ******************** item.c attributes ******************** */ string GetExternalDesc() { string desc = object::GetExternalDesc(); string tmp; ! if( desc == "" ) { return ""; } --- 28,42 ---- inherit LIB_UNIQUENESS; inherit LIB_VALUE; inherit LIB_WEAPON; + inherit LIB_MONEY; ! private int RetainOnDeath, nocondition; /* ******************** item.c attributes ******************** */ string GetExternalDesc() { string desc = object::GetExternalDesc(); string tmp; ! if( desc == "" ) { return ""; } *************** *** 51,80 **** return desc; } string GetItemCondition() { if( GetMaxClass() ) { ! float i = to_float(GetClass()) / GetMaxClass() * 100.0; ! ! if( i > 95.0 ) { ! return "It is as good as new."; } ! else if( i > 80.0 ) { ! return "It is in good condition."; } ! else if( i > 70.0 ) { ! return "It is in decent condition."; } ! else if( i > 50.0 ) { ! return "It is somewhat worn and battered."; } ! else if( i > 30.0 ) { ! return "It is worn down and dented."; } ! else if( i > 10.0 ) { ! return "It is very worn down and in bad shape."; } ! else { ! return "It has worn down completely."; } } else { --- 52,88 ---- return desc; } + int SetNoCondition(int i){ + nocondition = i; + } + string GetItemCondition() { + + if(nocondition) return ""; + if( GetMaxClass() ) { ! float i = to_float(GetClass()) / GetMaxClass() * 100.0; ! ! if( i > 95.0 ) { ! return " It is as good as new."; } ! else if( i > 80.0 ) { ! return " It is in good condition."; } ! else if( i > 70.0 ) { ! return " It is in decent condition."; } ! else if( i > 50.0 ) { ! return " It is somewhat worn and battered."; } ! else if( i > 30.0 ) { ! return " It is worn down and dented."; } ! else if( i > 10.0 ) { ! return " It is very worn down and in bad shape."; } ! else { ! return " It has worn down completely."; } } else { *************** *** 85,96 **** int GetRetainOnDeath() { return RetainOnDeath; } ! int SetRetainOnDeath(int x) { return (RetainOnDeath = x); } ! static mixed array AddSave(mixed array vars) { return persist::AddSave(vars); } --- 93,106 ---- int GetRetainOnDeath() { return RetainOnDeath; } ! int SetRetainOnDeath(int x) { return (RetainOnDeath = x); } ! static mixed array AddSave(mixed array vars) { + if(!vars) vars = ({}); + vars += ({ "Properties" }); return persist::AddSave(vars); } *************** *** 111,117 **** } return steal::CanSteal(who); } ! varargs mixed CanThrow(object who, object target) { return 1; } --- 121,127 ---- } return steal::CanSteal(who); } ! varargs mixed CanThrow(object who, object target) { return 1; } *************** *** 123,129 **** } return object::Destruct(); } ! int eventMove(mixed dest) { if( !environment() && GetWorn() ) { mixed array limbs = GetWorn(); --- 133,139 ---- } return object::Destruct(); } ! int eventMove(mixed dest) { if( !environment() && GetWorn() ) { mixed array limbs = GetWorn(); *************** *** 136,234 **** } return move::eventMove(dest); } ! void eventDeteriorate(int type) { weapon::eventDeteriorate(); SetDestroyOnSell(1); SetValue(GetValue()/2); } ! void eventRemoveBlessing() { SetProperty("blessed", 0); if( living(environment()) ) { environment()->eventPrint("%^YELLOW%^" ! + capitalize((string)GetDefiniteShort()) + ! " returns to its normal state."); } } ! int eventBless(int amount, int time) { if(!amount || !time) return 0; if(GetProperty("blessed")) return 0; SetProperty("blessed", amount); call_out( (: eventRemoveBlessing :), time); if(GetProperty("blessed") > 0) { ! SetProperty("magic item", "blessed"); ! } if(GetProperty("blessed") < 0) { ! SetProperty("magic item", "cursed"); ! } return 1; } mixed eventThrow(object who, object target) { if( target && living(target) ) { int skill; ! who->eventPrint("You throw " + GetShort() + " at " + ! target->GetName() + "."); ! target->eventPrint(who->GetName() + " throws " + GetShort() +" at you."); environment(who)->eventPrint(who->GetName() + " throws " + ! GetShort() + " at " + target->GetName() + ! ".", ({ who, target }) ); skill = (who->GetSkillLevel("projectile attack") + ! who->GetStatLevel("coordination"))/2; skill -= (target->GetSkillLevel("projectile defense") + ! target->GetStatLevel("agility"))/4; if( GetWeaponType() != "projectile" ) { ! skill = skill/4; } if( skill > random(100) + 1 ) { who->AddSkillPoints("projectile attack", ! target->GetSkillLevel("projectile defense") * ! target->GetLevel() + 10); target->AddSkillPoints("projectile defense", 10); target->eventReceiveThrow(who, this_object()); ! } else { target->AddSkillPoints("proectile defense", ! who->GetSkillLevel("projectile attack") * ! who->GetLevel() + 10); who->AddSkillPoints("projectile attack", 10); environment(who)->eventPrint(capitalize(GetShort()) + " does not " ! "come close to hitting " + ! target->GetName() + "."); eventMove(environment(who)); } ! return 1; } else if( target ) { who->eventPrint("You throw " + GetShort() + " at " + ! target->GetShort() + "."); environment(who)->eventPrint(who->GetName() + " throws " + ! GetShort() + " at " + target->GetShort() + ! ".", who); return target->eventReceiveThrow(who, this_object()); } if( !eventMove(environment(who)) ) { ! who->eventPrint("You are not too good at throwing things."); ! return 1; } who->eventPrint("You throw " + GetShort() + "."); environment(who)->eventPrint(who->GetName() + " throws " + ! GetShort() + ".", who); return 1; } ! varargs mixed eventRepair(object who, int strength, int type) { if( !who || !strength ) return 0; if( !GetMaxClass() ) return 0; while(strength--) { ! if( GetClass() < GetMaxClass() ) { ! SetClass(GetClass() + 1); ! SetValue(GetValue() + (GetValue() / 3)); ! } ! else break; } return 1; } --- 146,250 ---- } return move::eventMove(dest); } ! void eventDeteriorate(int type) { weapon::eventDeteriorate(); SetDestroyOnSell(1); SetValue(GetValue()/2); } ! void eventRemoveBlessing() { SetProperty("blessed", 0); if( living(environment()) ) { environment()->eventPrint("%^YELLOW%^" ! + capitalize((string)GetDefiniteShort()) + ! " returns to its normal state."); } } ! int eventBless(int amount, int time) { if(!amount || !time) return 0; if(GetProperty("blessed")) return 0; SetProperty("blessed", amount); call_out( (: eventRemoveBlessing :), time); if(GetProperty("blessed") > 0) { ! SetProperty("magic item", "blessed"); ! } if(GetProperty("blessed") < 0) { ! SetProperty("magic item", "cursed"); ! } return 1; } mixed eventThrow(object who, object target) { if( target && living(target) ) { int skill; ! who->eventPrint("You throw " + GetShort() + " at " + ! target->GetName() + "."); ! target->eventPrint(who->GetName() + " throws " + GetShort() +" at you."); environment(who)->eventPrint(who->GetName() + " throws " + ! GetShort() + " at " + target->GetName() + ! ".", ({ who, target }) ); skill = (who->GetSkillLevel("projectile attack") + ! who->GetStatLevel("coordination")); ! //tc("skill: "+skill); skill -= (target->GetSkillLevel("projectile defense") + ! target->GetStatLevel("agility"))/2; ! //tc("skill: "+skill); if( GetWeaponType() != "projectile" ) { ! skill = skill/2; } + //tc("skill: "+skill); if( skill > random(100) + 1 ) { who->AddSkillPoints("projectile attack", ! target->GetSkillLevel("projectile defense") * ! target->GetLevel() + 10); target->AddSkillPoints("projectile defense", 10); target->eventReceiveThrow(who, this_object()); ! } else { target->AddSkillPoints("proectile defense", ! who->GetSkillLevel("projectile attack") * ! who->GetLevel() + 10); who->AddSkillPoints("projectile attack", 10); environment(who)->eventPrint(capitalize(GetShort()) + " does not " ! "hit "+target->GetName() + ".",({ target, who })); ! write("Your throw misses its mark."); ! tell_object(target, capitalize(GetShort()) + " does not hit you."); eventMove(environment(who)); } ! return 1; } else if( target ) { who->eventPrint("You throw " + GetShort() + " at " + ! target->GetShort() + "."); environment(who)->eventPrint(who->GetName() + " throws " + ! GetShort() + " at " + target->GetShort() + ! ".", ({ who, target })); ! tell_object(target, capitalize(GetShort()) + " throws " + ! GetShort() + " at you."); return target->eventReceiveThrow(who, this_object()); } if( !eventMove(environment(who)) ) { ! who->eventPrint("You are not too good at throwing things."); ! return 1; } who->eventPrint("You throw " + GetShort() + "."); environment(who)->eventPrint(who->GetName() + " throws " + ! GetShort() + ".", who); return 1; } ! varargs mixed eventRepair(object who, int strength, int type) { if( !who || !strength ) return 0; if( !GetMaxClass() ) return 0; while(strength--) { ! if( GetClass() < GetMaxClass() ) { ! SetClass(GetClass() + 1); ! SetValue(GetValue() + (GetValue() / 3)); ! } ! else break; } return 1; } *************** *** 240,247 **** return tmp; } if( GetPoison() ) { ! if( random(100) < who->GetSkillLevel("stealth") ) { ! who->eventPrint("You notice a strange substance on it."); } } return 1; --- 256,263 ---- return tmp; } if( GetPoison() ) { ! if( random(100) < who->GetSkillLevel("stealth") ) { ! who->eventPrint("You notice a strange substance on it."); } } return 1; *************** *** 250,260 **** /* ***************** item.c driver applies ****************** */ static void create() { AddSave(weapon::GetSave() + value::GetSave() + mass::GetSave() + ! deterioration::GetSave()); steal::create(); object::create(); } ! mixed direct_cast_str_on_obj() { return 1; } --- 266,289 ---- /* ***************** item.c driver applies ****************** */ static void create() { AddSave(weapon::GetSave() + value::GetSave() + mass::GetSave() + ! deterioration::GetSave()); steal::create(); object::create(); } ! ! varargs mixed direct_get_obj_from_obj(object item, mixed gamma,mixed alfa, mixed beta, mixed epsilon){ ! //tc("stack: "+get_stack(),"yellow"); ! //tc("i am: "+this_object()->GetName(),"yellow"); ! //tc("item: "+identify(item),"yellow"); ! //tc("alfa: "+identify(alfa),"yellow"); ! //tc("beta: "+identify(beta),"yellow"); ! //tc("gamma: "+identify(gamma),"yellow"); ! //tc("type of gamma: "+typeof(gamma),"yellow"); ! //tc("epsilon: "+identify(epsilon),"yellow"); ! if(answers_to(beta,environment(this_object()))) return 1; ! return 0; ! } ! mixed direct_cast_str_on_obj() { return 1; } *************** *** 289,301 **** mixed direct_use_obj_to_str() { if( environment() != this_player() ) ! return "#You need better access to it."; else return 1; } mixed direct_throw_obj_word_obj() { if( environment() != this_player() ) { ! return "#Throw something you are not holding?"; } else return 1; } --- 318,330 ---- mixed direct_use_obj_to_str() { if( environment() != this_player() ) ! return "#You need better access to it."; else return 1; } mixed direct_throw_obj_word_obj() { if( environment() != this_player() ) { ! return "#Throw something you are not holding?"; } else return 1; } *************** *** 307,320 **** int direct_sacrifice_obj_to_str(string deus) { mixed tmp; object env; ! if( !sizeof(deus) ) return 0; deus = lower_case(remove_article(deus)); if( !env = environment(this_player()) ) return 0; tmp = (mixed)env->CanSacrifice(this_player(), this_object(), deus); if( !tmp ) { ! this_player()->eventPrint("This is not the place for sacrifices."); ! return 0; } else return 1; } --- 336,349 ---- int direct_sacrifice_obj_to_str(string deus) { mixed tmp; object env; ! if( !sizeof(deus) ) return 0; deus = lower_case(remove_article(deus)); if( !env = environment(this_player()) ) return 0; tmp = (mixed)env->CanSacrifice(this_player(), this_object(), deus); if( !tmp ) { ! this_player()->eventPrint("This is not the place for sacrifices."); ! return 0; } else return 1; } *************** *** 326,332 **** } return 1; } ! mixed direct_curse_obj() { if( environment() != this_player() ) { return "#You don't have that!"; --- 355,361 ---- } return 1; } ! mixed direct_curse_obj() { if( environment() != this_player() ) { return "#You don't have that!"; diff -c -r --new-file ds1.1/lib/lib/std/limb.c ds2.0r27/lib/lib/std/limb.c *** ds1.1/lib/lib/std/limb.c Sun Feb 1 21:30:15 1998 --- ds2.0r27/lib/lib/std/limb.c Wed Jul 5 00:01:05 2006 *************** *** 8,21 **** #include <lib.h> ! inherit LIB_STORAGE; ! private int Count = 0; ! private int DecayLife = 100; ! private string Limb = 0; ! private string Owner = 0; ! private string Race = 0; ! private static int CallOut = -1; int eventDecay(); --- 8,21 ---- #include <lib.h> ! inherit LIB_SURFACE; ! int Count = 0; ! int DecayLife = 500; ! string Limb = 0; ! string Owner = 0; ! string Race = 0; ! int CallOut = -1; int eventDecay(); *************** *** 30,45 **** string GetLimb() { return Limb; } void SetLimb(string limb, string owner, string race) { ! SetKeyName("limb"); ! SetId( ({ "limb", Limb = limb }) ); Owner = owner; Race = race; Count = 1; SetShort("a rotting " + possessive_noun(Race) + " " + Limb); SetLong("This limb has a horrible stench as it rots to nothing."); ! CallOut = call_out((: eventDecay :), DecayLife/3); } string GetOwner() { --- 30,56 ---- string GetLimb() { return Limb; } + string GetItemCondition(){ + return ""; + } + + void create(){ + surface::create(); + } + + void init(){ + surface::init(); + } void SetLimb(string limb, string owner, string race) { ! SetKeyName(limb); ! SetId( ({ "flesh","pile", "limb", Limb = limb }) ); Owner = owner; Race = race; Count = 1; SetShort("a rotting " + possessive_noun(Race) + " " + Limb); SetLong("This limb has a horrible stench as it rots to nothing."); ! //CallOut = call_out((: eventDecay :), DecayLife/3); } string GetOwner() { *************** *** 55,61 **** } string GetShort() { ! string str = storage::GetShort(); if( !str ) { str = "a limb"; --- 66,72 ---- } string GetShort() { ! string str = surface::GetShort(); if( !str ) { str = "a limb"; *************** *** 68,101 **** } int Destruct() { ! if( CallOut > -1 ) { ! remove_call_out(CallOut); ! } ! return storage::Destruct(); } int eventDecay() { if( !environment() ) { ! CallOut = -1; Destruct(); return 0; } switch(Count) { ! case 1: ! message("smell", "The "+Limb+" really stinks.", environment()); ! SetShort("the stinky remains of a rotting " + Limb); ! break; ! case 2: ! message("smell", "A rotting stench fills the entire area.", ! environment()); ! SetShort("a pile of rotting flesh"); ! break; ! case 3: ! CallOut = -1; ! Destruct(); ! return 0; } Count++; ! CallOut = call_out((: eventDecay :), DecayLife/3); return Count; } --- 79,112 ---- } int Destruct() { ! //if( CallOut > -1 ) { ! //remove_call_out(CallOut); ! //} ! return surface::Destruct(); } int eventDecay() { if( !environment() ) { ! //CallOut = -1; Destruct(); return 0; } switch(Count) { ! case 10: ! message("smell", "The "+Limb+" really stinks.", environment()); ! SetShort("the stinky remains of a rotting " + Limb); ! break; ! case 20: ! message("smell", "A rotting stench fills the entire area.", ! environment()); ! SetShort("a pile of rotting flesh"); ! break; ! case 30: ! //CallOut = -1; ! Destruct(); ! return 0; } Count++; ! //CallOut = call_out((: eventDecay :), DecayLife/3); return Count; } diff -c -r --new-file ds1.1/lib/lib/std/room.c ds2.0r27/lib/lib/std/room.c *** ds1.1/lib/lib/std/room.c Sun Feb 1 21:30:14 1998 --- ds2.0r27/lib/lib/std/room.c Wed Jul 5 00:01:05 2006 *************** *** 3,11 **** * The room object used to represent any room in the game * Created by Descartes of Borg 940711 * Version: @(#) room.c 1.20@(#) ! * Last Modified: 97/01/01 */ #include <lib.h> #include <rooms.h> #include <config.h> --- 3,12 ---- * The room object used to represent any room in the game * Created by Descartes of Borg 940711 * Version: @(#) room.c 1.20@(#) ! * Last Modified: 050912 */ + #include <lib.h> #include <rooms.h> #include <config.h> *************** *** 14,21 **** #include <medium.h> #include <message_class.h> #include <talk_type.h> - inherit LIB_AMBIANCE; inherit LIB_CLEAN; inherit LIB_CONTAINER; inherit LIB_EXITS; --- 15,22 ---- #include <medium.h> #include <message_class.h> #include <talk_type.h> + #include <privs.h> inherit LIB_CLEAN; inherit LIB_CONTAINER; inherit LIB_EXITS; *************** *** 23,38 **** inherit LIB_INVENTORY; inherit LIB_LOOK; inherit LIB_PROPERTIES; private function Bury = 0; private string Climate = "temperate"; ! private int DayLight = 0; private static string DayLong = 0; private object array DummyItems = ({}); private static int GasCheck = time(); private float Gravity = 1.0; private static mixed Listen = 0; ! private int NightLight = 0; private static string NightLong = 0; private static int NoReplace = 0; private static int PlayerKill = 0; --- 24,43 ---- inherit LIB_INVENTORY; inherit LIB_LOOK; inherit LIB_PROPERTIES; + inherit LIB_AMBIANCE; + inherit LIB_READ; + inherit LIB_SAVE; + inherit LIB_MONEY; private function Bury = 0; private string Climate = "temperate"; ! private int DayLight = -1970; private static string DayLong = 0; private object array DummyItems = ({}); private static int GasCheck = time(); private float Gravity = 1.0; private static mixed Listen = 0; ! private int NightLight = -1970; private static string NightLong = 0; private static int NoReplace = 0; private static int PlayerKill = 0; *************** *** 43,70 **** private static mixed Smell = 0; private static mixed Touch = 0; private string Town = "wilderness"; string GetClimate(); int GetNightLight(); int GetDayLight(); int GetShade(); varargs int eventPrint(string msg, mixed arg2, mixed arg3); /*********** /lib/room.c data manipulation functions **********/ int GetAmbientLight() { ! int a; ! if( GetClimate() == "indoors" ) { ! return ambiance::GetAmbientLight(); } ! if( query_night() ) { ! a = GetNightLight(); } else { ! a = GetDayLight(); } ! a += SEASONS_D->GetRadiantLight() - GetShade(); return a; } --- 48,152 ---- private static mixed Smell = 0; private static mixed Touch = 0; private string Town = "wilderness"; + private int DefaultExits = 1; + private int Flying = 1; + private int Obvious = 1; + private int ActionChance = 10; + mapping ItemsMap = ([]); + //private static object *dummies = ({}); + private static mixed global_item; + private static mixed Action; + private int tick_resolution = 5; + string GetClimate(); int GetNightLight(); int GetDayLight(); int GetShade(); + int elderp(object foo); + + mixed direct_delete_exit_str(){ + return 1; + } + + mixed indirect_delete_exit_str(){ + return 1; + } + varargs int eventPrint(string msg, mixed arg2, mixed arg3); /*********** /lib/room.c data manipulation functions **********/ + void CheckActions(){ + if( ActionChance > random(100) ) { + int x; + + if( functionp(Action) ) evaluate(Action); + else if( pointerp(Action) && (x = sizeof(Action)) ) { + mixed act; + + act = Action[random(x)]; + if(functionp(act)) { + evaluate(act); + return; + } + else message("other_action", act, this_object()); + } + } + } + + void heart_beat(){ + CheckActions(); + } + + void SetAction(int chance, mixed val) { + ActionChance = chance; + if( stringp(val) ) val = ({ val }); + else if( !functionp(val) && !pointerp(val) ) + error("Bad argument 2 to SetAction()\n"); + Action = val; + } + + mixed GetAction() { return Action; } + + int SetFrequency(int tick){ + if(tick) tick_resolution = tick; + else tick_resolution = 5; + set_heart_beat(0); + return tick_resolution; + } + + int GetFrequency(){ + return tick_resolution; + } + int GetAmbientLight() { ! int a, dayset, nightset; ! dayset = this_object()->GetDayLight(); ! nightset = this_object()->GetNightLight(); ! ! if(dayset == -1970 && nightset == -1970 ) { ! a = ambiance::GetAmbientLight(); ! } ! ! else if( query_night() && nightset != -1970 ) { ! a = nightset; } ! else if(!query_night() && dayset != -1970) { ! a = dayset; } else { ! a = ambiance::GetAmbientLight(); } ! if( GetClimate() != "indoors" ) { ! //a += SEASONS_D->GetRadiantLight() - GetShade(); ! } ! ! foreach(object ob in all_inventory()){ ! a += ob->GetRadiantLight(); ! } ! return a; } *************** *** 77,96 **** } static string GetExtraLong() { ! string *l; string ret; ! ret = " "; ! l = filter(map(all_inventory(), ! (: (string)$1->GetAffectLong(this_object()) :)), (: $1 :)); if( !sizeof(l) ) return 0; ! ret += implode(l, " "); return ret; } string GetInternalDesc() { string ret, tmp; - object ob; if( DayLong && !query_night() ) { ret = DayLong; --- 159,183 ---- } static string GetExtraLong() { ! int i; ! string *l,*tmp; string ret; ! object array stuff; ret = " "; ! tmp = ({}); ! stuff=all_inventory(this_object()); ! for(i=0; i<sizeof(stuff);i++){ ! if(tmp = ({ stuff[i]->GetAffectLong() }) && !sizeof(l)) l = tmp; ! if( !sizeof(l) ) return 0; ! if(tmp = ({ stuff[i]->GetAffectLong() }) ) l += tmp; ! } if( !sizeof(l) ) return 0; ! ret += implode(l, " "); return ret; } string GetInternalDesc() { string ret, tmp; if( DayLong && !query_night() ) { ret = DayLong; *************** *** 113,119 **** int GetResetNumber() { return ResetNumber; } ! string array GetId() { return ({}); } string SetDayLong(string str) { return (DayLong = str); } --- 200,206 ---- int GetResetNumber() { return ResetNumber; } ! string array GetId() { return ({}); } string SetDayLong(string str) { return (DayLong = str); } *************** *** 140,154 **** return (DayLight = x); } ! static object array GetDummyItems() { ! DummyItems = filter(DummyItems, (: $1 :)); return DummyItems; } varargs void AddItem(mixed item, mixed val, mixed adjectives) { ! object ob; ! if( objectp(item) ) { ob = item; } else { --- 227,250 ---- return (DayLight = x); } ! object array GetDummyItems() { ! DummyItems = ({}); ! foreach(object item in all_inventory(this_object())){ ! if(base_name(item) == LIB_DUMMY){ ! DummyItems += ({ item }); ! } ! } return DummyItems; } varargs void AddItem(mixed item, mixed val, mixed adjectives) { ! object ob, same_dummy; ! object *dummies = filter(all_inventory(this_object()), (: base_name(LIB_DUMMY) :) ); ! global_item = item; ! if( objectp(item) ) { + same_dummy = filter(dummies,(: ($1->GetId())[0] == (global_item->GetId())[0] :)); + if(sizeof(same_dummy)) return; ob = item; } else { *************** *** 158,163 **** --- 254,261 ---- if( stringp(adjectives) ) { adjectives = ({ adjectives }); } + same_dummy = filter(dummies,(: member_array(global_item[0],$1->GetId()) != -1 :)); + if(sizeof(same_dummy)) return; ob = new(LIB_DUMMY, item, val, adjectives); } ob->eventMove(this_object()); *************** *** 183,199 **** } void SetItems(mixed items) { ! DummyItems->eventDestruct(); DummyItems = ({}); if( arrayp(items) ) { items->eventMove(this_object()); DummyItems = items; } else if( mapp(items) ) { foreach(mixed key, mixed val in items) { string array adjs = ({}); object ob; ! if( stringp(key) ) { key = ({ key }); } --- 281,298 ---- } void SetItems(mixed items) { ! if(sizeof(DummyItems)) DummyItems->eventDestruct(); DummyItems = ({}); if( arrayp(items) ) { items->eventMove(this_object()); DummyItems = items; } else if( mapp(items) ) { + ItemsMap = items; foreach(mixed key, mixed val in items) { string array adjs = ({}); object ob; ! if( stringp(key) ) { key = ({ key }); } *************** *** 210,217 **** } else { error("Bad argument 1 to SetItems(), expected object array or " ! "mapping.\n"); } } varargs void AddListen(mixed item, mixed val) { --- 309,354 ---- } else { error("Bad argument 1 to SetItems(), expected object array or " ! "mapping.\n"); ! } ! } ! ! mapping GetItemsMap(){ ! return copy(ItemsMap); ! } ! ! mapping GetSmellMap(){ ! mapping Smells = ([]); ! foreach(object ob in GetDummyItems()) { ! if( ob->GetSmell() ) { ! Smells[ob->GetId()] = ob->GetSmell(); ! } ! } ! if(this_object()->GetSmell()) Smells["default"] = this_object()->GetSmell(); ! return copy(Smells); ! ! } ! ! mapping GetListenMap(){ ! mapping Listens = ([]); ! foreach(object ob in GetDummyItems()) { ! if( ob->GetListen() ) { ! Listens[ob->GetId()] = ob->GetListen(); ! } } + if(this_object()->GetListen()) Listens["default"] = this_object()->GetListen(); + return copy(Listens); + } + + mapping QueryMap(string str){ + switch(str){ + case "SetItems" : return GetItemsMap();break; + case "SetSmell" : return GetSmellMap();break; + case "SetListen" : return GetListenMap();break; + case "SetInventory" : return this_object()->GetInventory();break; + default : return ([]); + } + } varargs void AddListen(mixed item, mixed val) { *************** *** 562,568 **** if( !val ) return val; if( GetClimate() == "indoors" ) { if( val < 0 ) return val; ! else return SetAmbientLight(val*13); } else { if( val < 0 ) return SetShade(-val); --- 699,705 ---- if( !val ) return val; if( GetClimate() == "indoors" ) { if( val < 0 ) return val; ! else return ambiance::SetAmbientLight(val*13); } else { if( val < 0 ) return SetShade(-val); *************** *** 609,620 **** if( !(str = (string)SEASONS_D->GetLong(args)) ) { who->eventPrint("You do not see that there."); ! return 1; } who->eventPrint(str); eventPrint(who->GetName() + " looks at the " + args + ".", who); } ! /*********** /lib/room.c events ***********/ mixed eventBuryItem(object who, object tool, object what) { if( !functionp(Bury) ) { --- 746,757 ---- if( !(str = (string)SEASONS_D->GetLong(args)) ) { who->eventPrint("You do not see that there."); ! return 1; } who->eventPrint(str); eventPrint(who->GetName() + " looks at the " + args + ".", who); } ! /*********** /lib/room.c events ***********/ mixed eventBuryItem(object who, object tool, object what) { if( !functionp(Bury) ) { *************** *** 627,654 **** } varargs mixed eventHearTalk(object who, object target, int cls, string verb, ! string msg, string lang) { object *obs; string exit, door; ! switch(cls) { ! case TALK_PRIVATE: return 1; ! case TALK_SEMI_PRIVATE: target->eventHearTalk(who, target, cls, verb, msg, lang); eventPrint("%^BOLD%^CYAN%^" + (string)who->GetName() + ! " whispers something to " + (string)target->GetName() + ".", ! MSG_CONV, ({ who, target })); return 1; ! case TALK_LOCAL: obs = filter(all_inventory(), ! (: (int)$1->is_living() && $1 != $(who) :)); obs->eventHearTalk(who, target, cls, verb, msg, lang); return 1; ! case TALK_AREA: foreach(exit in GetExits()) { string tmp; --- 764,791 ---- } varargs mixed eventHearTalk(object who, object target, int cls, string verb, ! string msg, string lang) { object *obs; string exit, door; ! switch(cls) { ! case TALK_PRIVATE: return 1; ! case TALK_SEMI_PRIVATE: target->eventHearTalk(who, target, cls, verb, msg, lang); eventPrint("%^BOLD%^CYAN%^" + (string)who->GetName() + ! " whispers something to " + (string)target->GetName() + ".", ! MSG_CONV, ({ who, target })); return 1; ! case TALK_LOCAL: obs = filter(all_inventory(), ! (: (int)$1->is_living() && $1 != $(who) :)); obs->eventHearTalk(who, target, cls, verb, msg, lang); return 1; ! case TALK_AREA: foreach(exit in GetExits()) { string tmp; *************** *** 666,675 **** tmp->eventHearTalk(who, target, TALK_LOCAL, verb, msg, lang); } obs = filter(all_inventory(), ! (: (int)$1->is_living() && $1 != $(who) :)); obs->eventHearTalk(who, target, cls, verb, msg, lang); return 1; ! } } --- 803,812 ---- tmp->eventHearTalk(who, target, TALK_LOCAL, verb, msg, lang); } obs = filter(all_inventory(), ! (: (int)$1->is_living() && $1 != $(who) :)); obs->eventHearTalk(who, target, cls, verb, msg, lang); return 1; ! } } *************** *** 677,683 **** varargs int eventPrint(string msg, mixed arg2, mixed arg3) { object *targs; ! int msg_class; if( !arg2 && !arg3 ) { targs = filter(all_inventory(), (: (int)$1->is_living() :)); --- 814,820 ---- varargs int eventPrint(string msg, mixed arg2, mixed arg3) { object *targs; ! int msg_class,i; if( !arg2 && !arg3 ) { targs = filter(all_inventory(), (: (int)$1->is_living() :)); *************** *** 704,709 **** --- 841,847 ---- static void create() { exits::create(); reset(query_reset_number()); + set_heart_beat(0); if( replaceable(this_object()) && !GetNoReplace() ) { string array tmp= inherit_list(this_object()); *************** *** 713,718 **** --- 851,869 ---- } } + int CanReceive(object ob){ + if(!GetProperty("no teleport")) return container::CanReceive(ob); + else { + string verb = query_verb(); + string *allowed = ({ "go", "climb", "jump", "enter", "fly", "crawl" }); + if(member_array(verb, allowed) == -1 && !archp(this_player())) { + write("Your teleportation is prevented."); + return 0; + } + } + return container::CanReceive(ob); + } + varargs void reset(int count) { inventory::reset(count); all_inventory()->reset(count); *************** *** 731,735 **** --- 882,961 ---- return 1; } + int SetNoDefaultExits(int i){ + if(!i) i = 0; + DefaultExits = bool_reverse(i); + Obvious = DefaultExits; + return DefaultExits; + } + + int SetDefaultExits(int i){ + if(!i) i = 0; + DefaultExits = i; + Obvious = DefaultExits; + return DefaultExits; + } + + int SetCanFly(int i){ + if(i && i > 0) Flying = 1; + else Flying = 0; + } + + varargs int CanFly(mixed ob, mixed dir){ + return Flying; + } + + int SetNoObviousExits(int i){ + if(!i) i = 0; + Obvious = bool_reverse(i); + DefaultExits = Obvious; + return Obvious; + } + + int GenerateObviousExits(){ + string *normals; + string *exits; + string dir_string, enters; + exits = GetExits(); + enters = ""; + normals = ({ "north", "south", "east", "west", "up", "down" }); + normals += ({ "northeast", "southeast", "northwest", "southwest" }); + normals += ({ "out" }); + dir_string = ""; + + if(sizeof(GetEnters(1)-({0}))){ + foreach(string enter in this_object()->GetEnters(1)){ + enters += "enter "+enter; + if(member_array(enter,this_object()->GetEnters(1)) != + sizeof(this_object()->GetEnters(1)) -1) { + enters +=", "; + } + } + } + + if(member_array("north",exits) != -1) dir_string += "n, "; + if(member_array("south",exits) != -1) dir_string += "s, "; + if(member_array("east",exits) != -1) dir_string += "e, "; + if(member_array("west",exits) != -1) dir_string += "w, "; + if(member_array("northeast",exits) != -1) dir_string += "ne, "; + if(member_array("northwest",exits) != -1) dir_string += "nw, "; + if(member_array("southeast",exits) != -1) dir_string += "se, "; + if(member_array("southwest",exits) != -1) dir_string += "sw, "; + if(member_array("up",exits) != -1) dir_string += "u, "; + if(member_array("down",exits) != -1) dir_string += "d, "; + if(member_array("out",exits) != -1) dir_string += "out, "; + if(sizeof(this_object()->GetEnters(1) - ({0}) )) { + if(sizeof(this_object()->GetExits())) dir_string += ", "; + dir_string += enters; + } + if(last(dir_string,2) == ", ") dir_string = truncate(dir_string,2); + dir_string = replace_string(dir_string,", , ",", "); + if(Obvious) SetObviousExits(dir_string); + return 1; + } + static void init() { + if(!sizeof(GetObviousExits()) && DefaultExits > 0 && Obvious) GenerateObviousExits(); + if(Action && sizeof(Action)) set_heart_beat(tick_resolution); } + diff -c -r --new-file ds1.1/lib/lib/std/storage.c ds2.0r27/lib/lib/std/storage.c *** ds1.1/lib/lib/std/storage.c Sun Feb 1 21:30:15 1998 --- ds2.0r27/lib/lib/std/storage.c Wed Jul 5 00:01:05 2006 *************** *** 12,19 **** inherit LIB_ITEM; inherit LIB_SEAL; ! private int CanClose = 1; private int CanLock = 0; int GetCanClose() { return CanClose; --- 12,44 ---- inherit LIB_ITEM; inherit LIB_SEAL; ! private int CanClose = 0; private int CanLock = 0; + private int MaxRecurseDepth = 3; + private int RecurseDepth = 1; + + int GetMaxRecurseDepth(){ + return MaxRecurseDepth; + } + + int GetRecurseDepth(){ + return RecurseDepth; + } + + int SetMaxRecurseDepth(int i){ + MaxRecurseDepth =i; + return 1; + } + + int SetRecurseDepth(int i){ + RecurseDepth=i; + return 1; + } + + int AddRecurseDepth(int i){ + RecurseDepth += i; + return 1; + } int GetCanClose() { return CanClose; *************** *** 31,45 **** return SetCanClose(CanLock = x); } ! void SetKey(string key) { /* for backwards compat */ SetKeys(key); } int GetOpacity() { ! if( GetClosed() ) { ! return holder::GetOpacity(); ! } ! else return 0; } int GetRadiantLight(int ambient) { --- 56,74 ---- return SetCanClose(CanLock = x); } ! void SetKey(string key) { SetKeys(key); } int GetOpacity() { ! //if( GetClosed() ) { ! return holder::GetOpacity(); ! //} ! //else return 0; ! } ! ! int SetOpacity(mixed arg){ ! return holder::SetOpacity(arg); } int GetRadiantLight(int ambient) { *************** *** 103,121 **** } mixed CanPutInto(object who, object what) { ! mixed tmp = holder::CanPutInto(who, what); if( tmp != 1 ) { ! return tmp; } if( GetClosed() ) { return capitalize(GetDefiniteShort()) + " is closed."; } return 1; } varargs mixed CanShowInterior(object who, object target) { ! if( GetClosed() ) { return capitalize(GetDefiniteShort()) + " is closed."; } else return holder::CanShowInterior(); --- 132,177 ---- } mixed CanPutInto(object who, object what) { ! mixed tmp; ! int mydepth,yourdepth,total,indirectp,indirectpp; ! string wherefrom,stackstring; ! string *callstack; ! ! if(!tmp = holder::CanPutInto(who, what)){ ! if(GetClosed()) return capitalize(GetDefiniteShort()) + " is closed right now."; ! else return "You can't do that right now."; ! } ! ! wherefrom=origin(); ! callstack=call_stack(2); ! stackstring=implode(callstack," "); ! indirectp=member_array("indirect_put_obj_word_obj",callstack); ! indirectpp=member_array("indirect_put_objs_word_obj",callstack); ! if( tmp != 1 ) { ! if( GetClosed() ) return capitalize(GetDefiniteShort()) + " is closed."; ! else return "You can't do that at this time."; ! //if( GetClosed() ) write("It is closed."); ! //else write("You can't do that at this time."); ! //return tmp; } if( GetClosed() ) { return capitalize(GetDefiniteShort()) + " is closed."; } + + if(inherits("/lib/std/storage",what) ) { + yourdepth = what->GetRecurseDepth(); + mydepth = this_object()->GetRecurseDepth(); + if(yourdepth && mydepth) total = yourdepth + mydepth; + if(total && total > this_object()->GetMaxRecurseDepth()) return "Doesn't fit."; + } + return 1; } varargs mixed CanShowInterior(object who, object target) { ! if( GetClosed() && this_object()->GetOpacity() > 33) { return capitalize(GetDefiniteShort()) + " is closed."; } else return holder::CanShowInterior(); *************** *** 134,148 **** if( GetClosed() ) { return 0; } return holder::eventReceiveObject(ob); } void create() { ! AddSave( ({ "CanClose", "CanLock" }) ); holder::create(); item::create(); seal::create(); ! SetPreventPut("You can't put this in there."); } int inventory_accessible() { --- 190,220 ---- if( GetClosed() ) { return 0; } + return holder::eventReceiveObject(ob); } + void PutCheck(){ + + if(RecurseDepth >= MaxRecurseDepth) { + SetPreventPut("You have enough containers inside containers there. This one will have to stay out."); + } + + + } + void create() { ! string *i_save, *s_save, *a_save; ! i_save = item::GetSave(); ! s_save = seal::GetSave(); ! a_save = i_save + s_save; ! ! AddSave( ({ "CanClose", "CanLock", "RecurseDepth" , "MaxRecurseDepth" }) ); ! AddSave( a_save ); holder::create(); item::create(); seal::create(); ! PutCheck(); } int inventory_accessible() { diff -c -r --new-file ds1.1/lib/lib/std/story.c ds2.0r27/lib/lib/std/story.c *** ds1.1/lib/lib/std/story.c Wed Mar 10 21:39:32 1999 --- ds2.0r27/lib/lib/std/story.c Wed Jul 5 00:01:05 2006 *************** *** 1,11 **** /* /lib/std/story.c ! * from the Dead Souls V Object Library * handles objects and NPCs telling stories * created by Corvar * Version: * Last Modified: */ ! private int AlreadyTellingTale; private mapping Tales; private string TalesDir; --- 1,11 ---- /* /lib/std/story.c ! * from the Dead Souls Object Library * handles objects and NPCs telling stories * created by Corvar * Version: * Last Modified: */ ! private int AlreadyTellingTale; private mapping Tales; private string TalesDir; *************** *** 23,63 **** int GetTellingTale(); static void create() { ! AlreadyTellingTale = 0; ! TalesDir = ""; ! Tales = ([ ]); } /* One of the following two must be used. SetTalesDir(string dir) will set a directory which will contain tale files. Each tale file should consist of the following: action#delay where action is what you want the NPC to say, and delay ! is how long before the next action. ! Example: say this is the first part of the tale#5 emote this is the second part of the tale which is really long so that it will span a line. Note that there is no line feed in the middle of this line#4 speak last line#1 ! End Example. ! If using SetTale(mapping tale) instead the mapping should be like the ! following ! SetTale( ([ 1 : ({"say this is the first part of the tale",5}), ! 2 : ({"emote this is.....",4}), 3 : ({"speak last line",1}) ]) ); */ string SetTalesDir(string dir) { ! TalesDir = dir; ! return TalesDir; } mapping SetTale(mapping tale) { ! Tales = tale; ! return Tales; } string SetNoTaleMessage(string notalemessage) { ! NoTaleMessage = notalemessage; ! return NoTaleMessage; } string GetTalesDir() { return TalesDir; } --- 23,63 ---- int GetTellingTale(); static void create() { ! AlreadyTellingTale = 0; ! TalesDir = ""; ! Tales = ([ ]); } /* One of the following two must be used. SetTalesDir(string dir) will set a directory which will contain tale files. Each tale file should consist of the following: action#delay where action is what you want the NPC to say, and delay ! is how long before the next action. ! Example: say this is the first part of the tale#5 emote this is the second part of the tale which is really long so that it will span a line. Note that there is no line feed in the middle of this line#4 speak last line#1 ! End Example. ! If using SetTale(mapping tale) instead the mapping should be like the ! following ! SetTale( ([ 1 : ({"say this is the first part of the tale",5}), ! 2 : ({"emote this is.....",4}), 3 : ({"speak last line",1}) ]) ); */ string SetTalesDir(string dir) { ! TalesDir = dir; ! return TalesDir; } mapping SetTale(mapping tale) { ! Tales = tale; ! return Tales; } string SetNoTaleMessage(string notalemessage) { ! NoTaleMessage = notalemessage; ! return NoTaleMessage; } string GetTalesDir() { return TalesDir; } *************** *** 72,109 **** int y; if( ! AlreadyTellingTale ) { ! int x = 0; ! if( TalesDir ) { ! files = get_dir( GetTalesDir() ); ! if(taletotell){ ! y = member_array(taletotell,files); ! if( y != -1 ) ! file = taletotell; ! else { ! environment(this_object())->eventPrint(NoTaleMessage); ! return; ! } ! } ! else ! file = files[random(sizeof(files))]; ! AlreadyTellingTale = 1; ! Tales = ([]); ! msg = explode( read_file( TalesDir + file ), "\n" ); ! foreach( string str in msg ) { ! Tales[x++] = explode( str, "#" ); } ! } ! if( !Tales ) return; ! call_out( (: TellTale :), 1, 0 ); } ! } void TellTale( int part ) { if( part == sizeof( keys( Tales ) ) ) { ! AlreadyTellingTale = 0; ! return; } if( living(this_object()) ) this_object()->eventForce( Tales[part][0] ); else environment(this_object())->eventPrint( Tales[part][0] ); --- 72,109 ---- int y; if( ! AlreadyTellingTale ) { ! int x = 0; ! if( TalesDir ) { ! files = get_dir( GetTalesDir() ); ! if(taletotell){ ! y = member_array(taletotell,files); ! if( y != -1 ) ! file = taletotell; ! else { ! environment(this_object())->eventPrint(NoTaleMessage); ! return; ! } ! } ! else ! file = files[random(sizeof(files))]; ! AlreadyTellingTale = 1; ! Tales = ([]); ! msg = explode( read_file( TalesDir + file ), "\n" ); ! foreach( string str in msg ) { ! Tales[x++] = explode( str, "#" ); ! } } ! if( !Tales ) return; ! call_out( (: TellTale :), 1, 0 ); } ! } void TellTale( int part ) { if( part == sizeof( keys( Tales ) ) ) { ! AlreadyTellingTale = 0; ! return; } if( living(this_object()) ) this_object()->eventForce( Tales[part][0] ); else environment(this_object())->eventPrint( Tales[part][0] ); diff -c -r --new-file ds1.1/lib/lib/std/table.c ds2.0r27/lib/lib/std/table.c *** ds1.1/lib/lib/std/table.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/std/table.c Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + + inherit LIB_ITEM; + inherit LIB_SIT; + inherit LIB_LIE; + + inherit LIB_STORAGE; + inherit LIB_SURFACE; + + void create(){ + storage::create(); + SetMaxSitters(2); + SetMaxLiers(1); + SetMaxCarry(500); + SetMass(1000); + inventory_visible(); + inventory_accessible(); + } + + diff -c -r --new-file ds1.1/lib/lib/std/vendor.c ds2.0r27/lib/lib/std/vendor.c *** ds1.1/lib/lib/std/vendor.c Sun Feb 1 21:30:15 1998 --- ds2.0r27/lib/lib/std/vendor.c Wed Jul 5 00:01:05 2006 *************** *** 1,555 **** - /* /lib/vendor.c - * From the Dead Souls LPC Library - * The standard vendor npc - * created by Descartes of Borg 950522 - * Version: @(#) vendor.c 1.10@(#) - * Last Modified: 97/01/01 - */ - #include <lib.h> ! #include <armour_types.h> #include <vendor_types.h> inherit LIB_SENTIENT; ! private static mapping Costs = ([]); ! private static string LocalCurrency = "gold"; ! private static int MaxItems = 40; ! private static int MaxSingleItem = 4; ! private static string StorageRoom = 0; ! private static mapping Values = ([]); ! private static int VendorType = VT_TREASURE; ! ! string GetLocalCurrency(); ! int eventBrowse(object who, string args); ! mixed eventBuy(object who, object array obs); ! int eventPrice(object who, string args); ! mixed eventSell(object who, string what); ! int eventShowItem(object who, string args); ! ! /* ******************** vendor.c attributes ********************** */ ! int GetCost(object ob, object who) { ! int cost, mod, train; ! ! // this person has already checked on this object ! if( Costs[who] && Costs[who][ob] ) { ! return Costs[who][ob]; ! } ! cost = ob->GetValue(); ! mod = who->GetSkillLevel("bargaining") - GetSkillLevel("bargaining"); ! if( mod < -90 ) { ! mod = -90; ! } ! if( mod > 90 ) { ! mod = 90; ! } ! cost += to_int((cost * (100 - mod))/100); ! train = cost/100; ! if( train > 100 ) { ! train = 100; ! } ! who->eventTrainSkill("bargaining", train, GetSkillLevel("bargaining"), 1); ! cost = to_int(cost * currency_rate(GetLocalCurrency())); ! if( !Costs[who] ) { ! Costs[who] = ([ ob : cost ]); ! } ! else { ! Costs[who][ob] = cost; ! } ! return cost; ! } ! ! string GetLocalCurrency() { ! return LocalCurrency; ! } ! ! string SetLocalCurrency(string str) { ! return (LocalCurrency = str); ! } ! ! int GetMaxItems() { ! return MaxItems; ! } ! ! int SetMaxItems(int x) { ! return (MaxItems = x); } ! int GetMaxSingleItem() { ! return MaxSingleItem; ! } ! ! int SetMaxSingleItem(int x) { ! return (MaxSingleItem = x); ! } ! ! string GetStorageRoom() { ! return StorageRoom; ! } ! ! string SetStorageRoom(string room) { ! return (StorageRoom = room); ! } ! ! int GetValue(object ob, object who) { ! int value, mod, train; ! ! if( Values[who] && Values[who][ob] ) { ! return Values[who][ob]; ! } ! value = ob->GetValue(); ! mod = who->GetSkillLevel("bargaining") - GetSkillLevel("bargaining"); ! if( mod < -90 ) { ! mod = -90; ! } ! if( mod > 90 ) { ! mod = 90; ! } ! value = to_int((value * (100 - -mod))/100); ! train = value/100; ! if( train > 100 ) { ! train = 100; ! } ! who->eventTrainSkill("bargaining", train, GetSkillLevel("bargaining"), 1); ! value = to_int(value * currency_rate(GetLocalCurrency())); ! if( !Values[who] ) { ! Values[who] = ([ ob : value ]); ! } ! else { ! Values[who][ob] = value; ! } ! return value; } ! int GetVendorType() { ! return VendorType; ! } ! int SetVendorType(int x) { ! return (VendorType = x); ! } ! /* ********************* vendor.c modals ******************** */ ! int CanCarry(int amount) { ! return 1; ! } mixed CanBuy(object who, object *obs) { ! if( !load_object(StorageRoom) ) { return "There is a bug with the vendor's storage, please report it."; - } return 1; } mixed CanSell(object who, string what) { ! if( !load_object(StorageRoom) ) { return "There is a bug with the vendor's storage, please report it."; - } return 1; } ! /* ************************ vendor.c events ********************** */ ! int eventAppraise(object who, string args) { ! object ob; ! int x; ! ! if( !args || args == "" ) { ! eventForce("speak appraise what?"); ! return 1; ! } ! if( !(ob = present(args = lower_case(args), who)) ) { ! eventForce("speak You have no such thing!"); ! return 1; ! } ! if( !((int)ob->GetVendorType() & GetVendorType()) ) { ! eventForce("speak I have no use for " + ob->GetShort()); ! return 1; ! } ! x = GetValue(ob, this_player()); ! eventForce("speak " + who->GetName() + ", I will offer " ! "you " + x + " " + GetLocalCurrency() + " for " + ! ob->GetDefiniteShort()); ! return 1; ! } ! mixed eventAsk(object who, string str) { ! string cmd, args; ! object array obs; ! object ob; ! mixed tmp; ! ! if( !str || str == "" ) { ! eventForce("speak what do you want from me?"); return 1; } ! if( sscanf(str, "%s %s", cmd, args) != 2 ) { ! cmd = str; ! args = 0; } ! switch(cmd) { ! case "appraise": ! if( !args ) { ! eventForce("speak Appraise what?"); return 1; } ! return eventAppraise(who, args); ! case "browse": ! return eventBrowse(who, args); ! case "buy": ! if( !args ) { ! eventForce("speak What do you want me to buy?"); return 1; } ! else if( args == "all" ) { ! obs = filter(all_inventory(who), (: (int)$1->CanSell() :)); } ! else { ! if( !(ob = present(args, who)) ) { ! eventForce("speak Get out of here you cheat!"); ! eventForce("bump " + (string)this_player()->GetKeyName()); return 1; } - obs = ({ ob }); } - return eventBuy(who, obs); ! case "price": ! if( !args ) { ! eventForce("speak the price for what?"); return 1; } ! return eventPrice(who, args); ! case "sell": ! if( !args ) { ! eventForce("speak What would you like me to sell?"); return 1; } ! tmp = CanSell(who, args); ! if( tmp == 1 ) { ! return eventSell(who, args); } ! else if( stringp(tmp) ) { ! eventForce("speak " + tmp); return 1; } ! else { return 0; } ! case "show": ! if( !args ) { ! eventForce("speak what would you like me to show you?"); return 1; } ! return eventShowItem(who, args); ! ! default: ! eventForce("speak I am not quite sure what you want from me"); return 1; } ! } ! ! int eventBrowse(object who, string args) { ! object array obs; ! string array list; ! object sroom; ! int i, maxi; ! ! if( !args ) { ! args = "all"; ! } ! if( !(sroom = load_object(StorageRoom)) ) { ! eventForce("speak I am having terrific difficulties today"); ! return 1; ! } ! if( !(maxi = sizeof(obs = all_inventory(sroom))) ) { ! eventForce("speak I have nothing to sell right now."); ! return 1; ! } ! list = ({ " # Description", "" }); ! i = this_player()->GetScreen()[0]; ! while( i-- ) { ! list[1] += "_"; ! } ! for(i=0; i<maxi; i++) { ! int ok; ! int gat; ! ! ok = 0; ! gat = (int)obs[i]->GetArmourType(); ! switch(args) { ! case "all": ok = 1; break; ! case "weapon": case "weapons": ! ok = (gat & A_WEAPON) && ((int)obs[i]->GetClass() > 1); ! break; ! case "armour": case "armours": ! ok = (int)obs[i]->GetProperty("armour"); ! break; ! case "bag": case "bags": ! ok = (int)obs[i]->GetProperty("bag"); ! break; ! case "ring": case "rings": ! ok = gat & A_RING; ! break; ! case "glove": case "gloves": ! ok = gat & (A_GLOVE | A_LONG_GLOVE); ! break; ! case "boot": case "boots": ! ok = gat & (A_BOOT | A_LONG_BOOT); ! break; ! case "sock": case "socks": ! ok = gat & (A_SOCK | A_LONG_SOCK); ! break; ! case "helm": case "helmet": ! ok = gat & A_HELMET; ! break; ! case "visor": case "visors": ! ok = gat & A_VISOR; ! break; ! case "pants": ! ok = gat & A_PANTS; ! break; ! case "shirt": case "shirts": ! ok = gat & A_SHIRT; ! break; ! case "cloak": case "cloaks": ! ok = gat & A_CLOAK; ! break; ! case "belt": case "belts": ! ok = gat & A_BELT; ! break; ! case "vest": case "vests": ! ok = gat & A_VEST; ! break; ! case "shield": case "shields": ! ok = gat & A_SHIELD; ! break; ! case "body armour": case "body armours": ! ok = gat & A_BODY_ARMOUR; ! break; ! case "blunt": case "knife": case "blade": case "projectile": ! case "blunts": case "knives": case "blades": case "projectiles": ! ok = ((string)obs[i]->GetWeaponType() == args) || ! (pluralize((string)obs[i]->GetWeaponType()) == args); ! break; ! default: ! ok = (int)obs[i]->id(args); ! break; ! } ! if( !ok ) { ! continue; } ! list += ({ sprintf("%:-3d %s", (i+1), (string)obs[i]->GetShort()) }); ! } ! if( !sizeof(list) ) { ! eventForce("frown"); ! eventForce("speak I have nothing like that to sell."); ! return 1; ! } ! this_player()->eventPage(list); ! return 1; ! } ! mixed eventBuy(object who, object array obs) { ! object array tmp; ! object sroom; ! int train; ! sroom = load_object(StorageRoom); ! if( sizeof(all_inventory(sroom)) > GetMaxItems() ) { ! eventForce("speak I am having trouble getting rid of the things I " ! "have to sell right now."); ! return 1; ! } ! if( !sizeof(obs) ) { ! eventForce("speak you have nothing to sell!"); ! return 1; } - tmp = ({}); - foreach(object ob in obs) { - int value; ! if( !ob->GetShort() ) { ! continue; } ! if( !(ob->GetVendorType() & GetVendorType()) ) { ! eventForce("speak I do not buy things like " + ! ob->GetShort() + "."); ! continue; ! } ! value = GetValue(ob, who); ! if( value < 1 ) { ! eventForce("speak " + ob->GetDefiniteShort() + " is worthless!"); ! continue; ! } ! if( !ob->CanSell(who) ) { ! eventForce("speak You cannot sell " + ob->GetDefiniteShort() +"."); ! continue; } ! if( sizeof(filter(all_inventory(sroom), ! (: $1->GetShort() == $(ob)->GetShort() :))) ! >= MaxSingleItem ) { ! eventForce("speak " + ob->GetDefiniteShort() + " is too " + ! "common."); ! continue; ! } ! eventForce("speak " + ob->GetShort() + "! Excellent!"); ! if( !ob->eventMove(sroom) ) { ! eventForce("speak I cannot seem to carry that"); ! return 1; ! } ! if( who->AddCurrency(GetLocalCurrency(), value) == -1 ){ ! eventForce("speak you cannot carry that much money!"); ! ob->eventMove(environment()); ! continue; ! } ! train = value/100; ! if( train > 100 ) { ! train = 100; } ! who->eventTrainSkill("bargaining", train, GetSkillLevel("bargaining"), ! 1); ! tmp += ({ ob }); ! send_messages("sell", "$agent_name $agent_verb " + ob->GetShort() + ! " to $target_name.", who, this_object(), ! environment(who)); ! } ! if( !sizeof(tmp) ) { ! eventForce("speak I am sorry, " + who->GetName() + ", " ! "that we could not come to a better agreement."); ! } ! else { ! map(tmp, function(object ob) { ! if( ob->GetDestroyOnSell() ) { ! ob->eventDestruct(); ! } ! }); } - return 1; - } ! int eventPrice(object who, string args) { ! object array obs; ! object ob, sroom; ! int x; ! ! if( !args || args == "" ) { ! eventForce("speak price what?"); ! return 1; ! } ! if( !(sroom = load_object(StorageRoom)) ) { ! eventForce("speak today is not really a good day for me"); ! return 0; ! } ! obs = all_inventory(sroom); ! if( x = to_int(args) ) { ! if( x < 1 || x > sizeof(obs) ) { ! ob = 0; ! } ! else { ! ob = obs[x-1]; ! } ! } ! else { ! ob = present(args = lower_case(args), sroom); ! } ! if( !ob ) { ! eventForce("speak I have no such thing!"); ! return 1; ! } ! if( !(x = GetCost(ob, this_player())) ) { ! eventForce("speak that thing has no value!"); ! return 1; ! } ! eventForce("speak " + who->GetName() + ", I will take " + ! x + " " + GetLocalCurrency() + " for " + ! ob->GetDefiniteShort()); ! return 1; ! } ! mixed eventSell(object who, string what) { ! object ob, sroom; ! int cost, train; ! ! sroom = load_object(StorageRoom); ! if( !(ob = present(what, sroom)) ) { ! eventForce("speak I have nothing like that to sell"); ! return 1; ! } ! cost = GetCost(ob, who); ! if( (int)who->GetCurrency(GetLocalCurrency()) < cost ) { ! eventForce("speak go out on the streets and beg you pathetic wretch!"); ! return 1; ! } ! if( !((int)ob->eventMove(this_object())) ) { ! message("error", "An error occurred moving the object, use bug -r.", ! who); ! return 1; ! } ! eventForce("speak here is " + (string)ob->GetShort() + " for " + cost + ! " " + GetLocalCurrency() + "!"); ! eventForce("give " + what + " to " + (string)who->GetKeyName()); ! if( environment(ob) == this_object() ) { ! eventForce("speak you cannot carry that!"); ! eventForce("drop " + what); ! } ! train = cost/100; ! if( train > 100 ) { ! train = 100; } - who->eventTrainSkill("bargaining", train, GetSkillLevel("bargaining"), 1); - who->AddCurrency(GetLocalCurrency(), -cost); - return 1; - } ! int eventShowItem(object who, string args) { ! object ob, sroom; ! int x; ! if( !args || args == "" ) { ! eventForce("speak show you what?"); ! return 1; ! } ! if( !(sroom = load_object(StorageRoom)) ) { ! eventForce("speak I am having troubles right now"); ! return 1; } - if( x = to_int(args) ) { - object array obs; ! x--; ! obs = all_inventory(sroom); ! if( x > sizeof(obs) || x < 0 ) { ! ob = 0; ! } ! else { ! ob = obs[x]; ! } ! } ! else { ! ob = present(args = lower_case(args), sroom); ! } ! if( !ob ) { ! eventForce("speak I have no such thing to show you"); ! return 1; ! } ! who->eventPrint(GetName() + " shows you " + ob->GetDefiniteShort() + "."); ! who->eventPrint(ob->GetLong()); ! return 1; ! } - /* ********************* vendor.c driver applies ****************** */ - mixed direct_buy_str_from_liv(string str) { - return CanSell(this_player(), remove_article(lower_case(str))); - } - mixed direct_sell_liv_obj() { - return 1; - } - mixed indirect_sell_obj_to_liv() { - return 1; - } --- 1,545 ---- #include <lib.h> ! #include <armor_types.h> #include <vendor_types.h> + #include <daemons.h> + #include "/lib/include/vendor.h" inherit LIB_SENTIENT; + inherit "/lib/manycoins"; ! private static int MaxItems, VendorType, bargain; ! private static string StorageRoom, LocalCurrency; ! private static mapping Costs, Values; ! ! static void create() { ! sentient::create(); ! Costs = ([]); ! Values = ([]); ! LocalCurrency = "gold"; ! VendorType = VT_TREASURE; ! MaxItems = 40; } ! mixed direct_buy_str_from_liv(string str) { ! return CanSell(this_player(), str); } ! int indirect_sell_obj_to_liv() { return 1; } ! int indirect_sell_obs_to_liv() { return 1; } ! int CanCarry(int amount) { return 1; } mixed CanBuy(object who, object *obs) { ! if( !load_object(StorageRoom) ) return "There is a bug with the vendor's storage, please report it."; return 1; } mixed CanSell(object who, string what) { ! if( !load_object(StorageRoom) ) return "There is a bug with the vendor's storage, please report it."; return 1; } ! mixed eventBuy(object who, object *obs) { ! object *tmp; ! object sroom, ob; ! int cost; ! sroom = load_object(StorageRoom); ! if( sizeof(all_inventory(sroom)) > GetMaxItems() ) { ! eventForce("say I am having trouble getting rid of the things I " ! "have to sell right now."); return 1; } ! if( !sizeof(obs) ) { ! eventForce("say you have nothing to sell!"); ! return 1; } ! tmp = ({}); ! foreach(ob in obs) { ! int value; ! ! if( !((string)ob->GetShort()) ) continue; ! if( !((int)ob->GetVendorType() & GetVendorType()) ) { ! eventForce("say I do not buy things like " + ! (string)ob->GetShort()); ! continue; ! } ! cost = to_int(ob->GetBaseCost(GetLocalCurrency())); ! value = to_int(ceil(GetValue(ob, who))); ! if(ob->GetValue()) bargain = 1; ! else bargain = 0; ! if(!bargain) value = cost; ! ! if( !value ) { ! eventForce("say " + (string)ob->GetShort() + " is worthless!"); ! continue; ! } ! if( !((int)ob->CanSell(who)) ) { ! eventForce("say You cannot sell " + (string)ob->GetShort() +"."); ! continue; ! } ! if( sizeof(filter(all_inventory(sroom), ! (: $1->GetShort() == (string)$(ob)->GetShort() :))) ! > 3 ) { ! if( (int)this_player()->AddCurrency(GetLocalCurrency(),value) == -1 ){ ! //eventForce("say you cannot carry that much money!"); ! eventForce("say you cannot carry "+value+" "+ ! GetLocalCurrency()+"!"); ! ob->eventMove(environment()); ! continue; ! } ! eventForce("say " + (string)ob->GetShort() + "! Excellent!"); ! if(bargain) who->AddSkillPoints("bargaining", value*5); ! message("my_action", "You sell " + (string)ob->GetShort() + ".", who); ! message("other_action", capitalize((string)who->GetKeyName()) + " sells " + ! (string)ob->GetShort() + ".", environment(), ! ({ who, this_object() })); ! ob->eventDestruct(); return 1; } ! eventForce("say " + (string)ob->GetShort() + "! Excellent!"); ! if( !((int)ob->eventMove(sroom)) ) { ! eventForce("say I cannot seem to carry that"); ! return 1; ! } ! if( (int)this_player()->AddCurrency(GetLocalCurrency(), value) == -1 ){ ! //eventForce("say you cannot carry that much money!"); ! eventForce("say you cannot carry "+value+" "+ ! GetLocalCurrency()+"!"); ! ob->eventMove(environment()); ! continue; ! } ! if(bargain) who->AddSkillPoints("bargaining", value*5); ! tmp += ({ ob }); ! message("my_action", "You sell " + (string)ob->GetShort() + ".", who); ! message("other_action", capitalize((string)who->GetKeyName()) + " sells " + ! (string)ob->GetShort() + ".", environment(), ! ({ who, this_object() })); ! } ! if( !sizeof(tmp) ) ! eventForce("say I am sorry, " + capitalize((string)who->GetKeyName()) + ", " ! "that we could not come to a better agreement."); ! else map(tmp, function(object ob) { ! if( (int)ob->GetDestroyOnSell() ) ! ob->eventDestruct(); ! }); ! return 1; ! } ! ! int cmdShow(object who, string args) { ! object ob, sroom; ! int x; ! if( !args || args == "" ) { ! eventForce("say show you what?"); ! return 1; ! } ! if( !(sroom = load_object(StorageRoom)) ) { ! eventForce("say I am having troubles right now"); ! return 1; ! } ! if( x = to_int(args) ) { ! object *obs; ! object *obs2; ! string *list2; ! int maxi; ! ! x--; ! obs = all_inventory(sroom); ! maxi = sizeof(obs); ! list2 = ({(obs[0]->GetKeyName())}); ! for(int counter = 1;counter < maxi;++counter) { ! if(member_array((obs[counter]->GetKeyName()),list2) < 0) { ! list2 += ({ ( obs[counter]->GetKeyName()) }); ! } ! } ! obs2 = ({ present(list2[0],sroom) }); ! maxi = sizeof(list2); ! for(int counter = 1;counter < maxi;++counter) { ! obs2 += ({ present(list2[counter],sroom) }); ! } ! if((x >= 0) && (x < sizeof(obs2))) { ! ob = obs2[x]; ! } ! } ! else ob = present(args = lower_case(args), sroom); ! if( !ob ) { ! eventForce("say I have no such thing to show you"); ! return 1; ! } ! message("other_action", capitalize(GetKeyName())+" shows you "+ ! (string)ob->GetShort()+".", who); ! message("system", (string)ob->GetLong(), who); ! return 1; ! } ! int cmdBrowse(object who, string args) { ! object *obs; ! object *obs2; ! string *list2; ! string *list; ! object sroom; ! int i, ii, maxi, number; ! ! if( !args || args == "" ) args = "all"; ! if( !(sroom = load_object(StorageRoom)) ) { ! eventForce("say I am having terrific difficulties today"); ! return 1; ! } ! if( !(maxi = sizeof(obs = all_inventory(sroom))) ) { ! eventForce("say I have nothing to sell right now."); return 1; } ! list = ({ "item # Description Price", "" }); ! list2 = ({(obs[0]->GetKeyName())}); ! for(int counter = 1;counter < maxi;++counter) { ! if(member_array((obs[counter]->GetKeyName()),list2) < 0) { ! list2 += ({ ( obs[counter]->GetKeyName()) }); ! } } ! obs2 = ({ present(list2[0],sroom) }); ! maxi = sizeof(list2); ! for(int counter = 1;counter < maxi;++counter) { ! obs2 += ({ present(list2[counter],sroom) }); ! } ! maxi = sizeof(obs2); ! i = (int)this_player()->GetScreen()[0]; ! if(number = to_int(args)) { ! if((number > 0) && (number <= maxi)) { ! while( i-- ) list[1] += "_"; ! list += ({ sprintf("%d %:-35s %d", number, (string)obs2[(number - 1)]->GetShort(), GetCost(obs2[(number - 1)],who)) }); ! this_player()->eventPage(list); return 1; } } ! while( i-- ) list[1] += "_"; ! for(ii=0; ii < maxi; ii++) { ! int ok; ! int gat; ! ! ok = 0; ! gat = (int)(obs2[ii]->GetArmorType()); ! switch(args) { ! case "all": ok = 1; break; ! case "weapon": case "weapons": ! break; ! case "armor": case "armors": ! if(obs2[ii]->GetVendorType() == 8) { ! ok = 1; ! } ! break; ! case "bag": case "bags": ! ok = (int)obs2[ii]->GetProperty("bag"); ! break; ! case "ring": case "rings": ! ok = gat & A_RING; ! break; ! case "glove": case "gloves": ! ok = gat & (A_GLOVE | A_LONG_GLOVE); ! break; ! case "boot": case "boots": ! ok = gat & (A_BOOT | A_LONG_BOOT); ! break; ! case "sock": case "socks": ! ok = gat & (A_SOCK | A_LONG_SOCK); ! break; ! case "helm": case "helmet": ! ok = gat & A_HELMET; ! break; ! case "visor": case "visors": ! ok = gat & A_VISOR; ! break; ! case "pants": ! ok = gat & A_PANTS; ! break; ! case "shirt": case "shirts": ! ok = gat & A_SHIRT; ! break; ! case "cloak": case "cloaks": ! ok = gat & A_CLOAK; ! break; ! case "belt": case "belts": ! ok = gat & A_BELT; ! break; ! case "vest": case "vests": ! ok = gat & A_VEST; ! break; ! case "shield": case "shields": ! ok = gat & A_SHIELD; ! break; ! case "body armor": case "body armors": ! ok = gat & A_BODY_ARMOR; ! break; ! case "blunt": case "knife": case "blade": case "projectile": ! case "blunts": case "knives": case "blades": case "projectiles": ! ok = ((string)obs2[ii]->GetWeaponType() == args) || ! (pluralize((string)obs2[ii]->GetWeaponType()) == args); ! break; ! default: ! ok = (int)obs2[ii]->id(args); ! break; ! } ! if( !ok ) continue; ! ok = GetCost(obs2[ii], who); ! if(!ii) ii = 0; ! list += ({ sprintf("%d %:-35s %d", (ii+1), (string)obs2[ii]->GetShort(), to_int(ok)) }); ! //list += ({ sprintf("%:-7d %:-35s %d", (ii+1), (string)obs2[ii]->GetShort(), (ok)) }); ! } ! if( !sizeof(list) ) { ! eventForce("frown"); ! eventForce("say I have nothing like that to sell."); return 1; } ! this_player()->eventPage(list); ! return 1; ! } ! int cmdAppraise(object who, string args) { ! object ob; ! int x,cost; ! ! if( !args || args == "" ) { ! eventForce("say appraise what?"); return 1; } ! if( !(ob = present(args = lower_case(args), who)) ) { ! eventForce("say You have no such thing!"); ! return 1; } ! if( !((int)ob->GetVendorType() & GetVendorType()) ) { ! eventForce("say I have no use for " + (string)ob->GetShort()); return 1; } ! if( LocalCurrency != query_base_currency() ){ ! cost=to_int(ob->GetBaseCost() / ECONOMY_D->__Query(LocalCurrency,"rate")); ! } ! else cost=to_int(floor(ob->GetBaseCost())); ! if(cost && cost > 0) x=cost; ! if(!cost || cost < 0) x = to_int(floor(GetValue(ob, this_player()))); ! eventForce("say " + capitalize((string)who->GetKeyName()) + ", I will offer " ! "you " + x + " " + GetLocalCurrency() + " for " + ! (string)ob->GetShort()); ! return 1; ! } ! ! int cmdPrice(object who, string args) { ! object *obs; ! string *list2; ! object *obs2; ! object ob, sroom; ! int x; ! int maxi; ! ! if( !args || args == "" ) { ! eventForce("say price what?"); ! return 1; ! } ! if( !(sroom = load_object(StorageRoom)) ) { ! eventForce("say today is not really a good day for me"); return 0; } + obs = all_inventory(sroom); + maxi = sizeof(obs); + if( x = to_int(args) ) { + list2 = ({(obs[0]->GetKeyName())}); + for(int counter = 1;counter < maxi;++counter) { + if(member_array((obs[counter]->GetKeyName()),list2) < 0) { + list2 += ({ ( obs[counter]->GetKeyName()) }); + } + } + obs2 = ({ present(list2[0],sroom) }); + maxi = sizeof(list2); + for(int counter = 1;counter < maxi;++counter) { + obs2 += ({ present(list2[counter],sroom) }); + } + if((x <= 0) || (x > sizeof(obs2))) ob = 0; + else + ob = obs2[x-1]; ! } ! else ob = present(args = lower_case(args), sroom); ! if( !ob ) { ! eventForce("say I have no such thing!"); return 1; } ! if( !(x = to_int(ceil(GetCost(ob, this_player())))) ) { ! eventForce("say that thing has no value!"); ! return 1; ! } ! eventForce("say " + capitalize((string)who->GetKeyName()) + ", I will take " + ! x + " " + GetLocalCurrency() + " for " + ! (string)ob->GetShort()); return 1; } ! ! mixed eventAsk(object who, string str) { ! object *obs; ! object ob; ! string cmd, args, tmp; ! ! if( !str || str == "" ) { ! eventForce("say what do you want from me?"); ! return 1; } ! if( sscanf(str, "%s %s", cmd, args) != 2 ) { ! cmd = str; ! args = 0; ! } ! switch(cmd) { ! case "appraise": ! return cmdAppraise(who, args); ! case "browse": ! return cmdBrowse(who, args); ! case "buy": ! if( str == "all" ) ! obs = filter(all_inventory(who), (: (int)$1->CanSell() :)); ! else { ! if( !(ob = present(args, who)) ) { ! eventForce("say Get out of here you cheat!"); ! eventForce("bump " + (string)this_player()->GetKeyName()); ! return 1; ! } ! obs = ({ ob }); ! } ! return eventBuy(who, obs); ! ! case "price": ! return cmdPrice(who, args); ! ! case "sell": ! if( (tmp = CanSell(who, args)) == 1 ) return eventSell(who, args); ! else if( stringp(tmp) ) eventForce("say " + tmp); ! else { ! return 0; ! } ! ! case "show": ! return cmdShow(who, args); ! ! default: ! eventForce("say I am not quite sure what you want from me"); ! } } ! mixed eventSell(object who, mixed what) { ! object ob, sroom; ! object *obs; ! string *list2; ! object *obs2; ! int cost,number,maxi; ! ! sroom = load_object(StorageRoom); ! obs = all_inventory(sroom); ! maxi = sizeof(obs); ! if(number = to_int(what)) { ! number = number - 1; ! list2 = ({(obs[0]->GetKeyName())}); ! for(int counter = 1;counter < maxi;++counter) { ! if(member_array((obs[counter]->GetKeyName()),list2) < 0) { ! list2 += ({ ( obs[counter]->GetKeyName()) }); ! } ! } ! obs2 = ({ present(list2[0],sroom) }); ! maxi = sizeof(list2); ! for(int counter = 1;counter < maxi;++counter) { ! obs2 += ({ present(list2[counter],sroom) }); ! } ! if((number >= 0) && (number < sizeof(obs2))) { ! ob = obs2[number]; ! } else { ! eventForce("say I have nothing like that to sell to you."); ! return 1; ! } ! } else { ! if( !(ob = present(what, sroom)) ) { ! eventForce("say I have nothing like that to sell"); ! return 1; ! } } ! cost=to_int(ob->GetBaseCost(GetLocalCurrency())); ! if(!cost || cost < 0) { ! cost = 0; ! cost = to_int(ob->GetValue()); ! } ! if(who->GetCurrency(GetLocalCurrency()) < cost){ ! eventForce("say You don't have enough "+GetLocalCurrency()+ ! " to buy that."); ! return 1; } ! if( !((int)ob->eventMove(this_object())) ) { ! message("error", "An error occurred moving the object, use bug -r.", ! who); ! return 1; } ! eventForce("say here is " + (string)ob->GetShort() + " for " + to_int(cost) + ! " " + GetLocalCurrency() + "!"); ! eventForce("give " + (string)ob->GetKeyName() + " to " + (string)who->GetKeyName()); ! if( environment(ob) == this_object() ) { ! eventForce("say you cannot carry that!"); ! eventForce("drop " + (string)ob->GetKeyName()); ! } ! if(bargain) who->AddSkillPoints("bargaining", random(to_int(floor(cost)))); ! //Payment(who, cost); ! who->AddCurrency(GetLocalCurrency(), -cost); ! return 1; } ! int GetCost(object ob, object who) { ! int x, mod,cost; ! cost=ob->GetBaseCost(LocalCurrency); ! if(cost && cost > 0) return cost; ! ! if( Costs[who] && Costs[who][ob] ) return Costs[who][ob]; ! x = ob->GetValue(GetLocalCurrency()); ! mod = (int)who->GetSkillLevel("bargaining") - GetSkillLevel("bargaining"); ! if( mod < -90 ) mod = -90; ! if( mod > 90 ) mod = 90; ! x = (x * (100 - mod))/100; ! who->AddSkillPoints("bargaining", x); ! if( !Costs[who] ) Costs[who] = ([ ob : x ]); ! else Costs[who][ob] = x; ! return x; } ! int GetValue(object ob, object who) { ! int x, mod; ! if( Values[who] && Values[who][ob] ) return Values[who][ob]; ! x = ob->GetValue(GetLocalCurrency()); ! mod = (int)who->GetSkillLevel("bargaining") - GetSkillLevel("bargaining"); ! if( mod < -90 ) mod = -90; ! if( mod > 90 ) mod = 90; ! x = (x * (100 - -mod)) / 100; ! who->AddSkillPoints("bargaining", x); ! if( !Values[who] ) Values[who] = ([ ob : x ]); ! else Values[who][ob] = x; ! return x; } ! string SetLocalCurrency(string str) { return (LocalCurrency = str); } ! ! string GetLocalCurrency() { return LocalCurrency; } ! ! string SetStorageRoom(string room) { return (StorageRoom = room); } ! ! string GetStorageRoom() { return StorageRoom; } ! ! int SetMaxItems(int x) { return (MaxItems = x); } ! ! int GetMaxItems() { return MaxItems; } ! ! int SetVendorType(int x) { return (VendorType = x); } ! ! int GetVendorType() { return VendorType; } ! ! diff -c -r --new-file ds1.1/lib/lib/std/worn_storage.c ds2.0r27/lib/lib/std/worn_storage.c *** ds1.1/lib/lib/std/worn_storage.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/std/worn_storage.c Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,659 ---- + /* /lib/std/armor.c + * From the Dead Souls Object Library + * The standard armor object + * Created by Descartes of Borg 950408 + * Version: @(#) armor.c 1.9@(#) + * Last modified: 97/01/01 + */ + + #include <lib.h> + #include <function.h> + #include <armor_types.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_BURY; + inherit LIB_DETECT; + inherit LIB_DETERIORATION; + inherit LIB_DROP; + inherit LIB_EQUIP; + inherit LIB_GET; + inherit LIB_GIVE; + inherit LIB_LOCK_WITH; + inherit LIB_MASS; + inherit LIB_MOVE; + inherit LIB_OBJECT; + inherit LIB_PERSIST; + inherit LIB_POISON; + inherit LIB_PUT; + inherit LIB_READ; + inherit LIB_SELL; + inherit LIB_STEAL; + inherit LIB_UNIQUENESS; + inherit LIB_VALUE; + inherit LIB_WEAR; + inherit LIB_HOLDER; + inherit LIB_SEAL; + inherit LIB_MONEY; + + private int Fingers = 5; + private mapping Protection = ([]); + private string array RestrictLimbs = 0; + private static mixed Wear = 0; + private static mapping MaxProtection = ([]); + private int CanClose = 0; + private int CanLock = 0; + private int MaxRecurseDepth = 3; + private int RecurseDepth = 1; + private int RetainOnDeath = 0; + + void PutCheck(); + + int GetMaxProtection(int type); + + int SetRetainOnDeath(int x ) { return (RetainOnDeath = x); } + + int GetRetainOnDeath() { return RetainOnDeath; } + + /* *************** /lib/armor.c data functions *************** */ + varargs string GetEquippedDescription(object who) { + if( GetWorn() ) { + string tmp = "It is worn on "; + + if( !who ) { + who = this_player(); + } + if( who == environment()) { + tmp += "your"; + } + else { + tmp += possessive_noun(environment()); + } + tmp += " " + item_list(GetWorn()) + "."; + return tmp; + } + return 0; + } + + varargs string GetExternalDesc(){ + string desc; + desc = ::GetExternalDesc(); + if(GetWorn()) desc += " "+GetEquippedDescription(); + return desc; + } + + + + string GetEquippedShort() { + string tmp = GetShort(); + + if( GetWorn() ) { + tmp += " (%^GREEN%^worn%^RESET%^)"; + } + return tmp; + } + + int GetFingers() { + return Fingers; + } + + int SetFingers(int x) { + return (Fingers = x); + } + + /* Just check the surface for blade/knife/blunt damage + * Other damage types will be checked via more costly methods + * -blitz + */ + string GetItemCondition() { + int cuts, dents; + string ret; + cuts = dents = -1; + + foreach(int type, int val in Protection) { + int x; + if( BLADE & type || KNIFE & type ) { + x = to_float(val) / GetMaxProtection(type) * 100; + if( cuts == -1 || x < cuts ) cuts = x; + } + else if( BLUNT & type ) { + x = to_float(val) / GetMaxProtection(type) * 100; + if( dents == -1 || x > dents ) dents = x; + } + } + if( cuts == -1 && dents == -1 ) return 0; + if( cuts > -1 ) switch( cuts ) { + case 0..10: ret = "shredded to pieces"; break; + case 11..20: ret = "shredded"; break; + case 21..40: ret = "mildly shredded"; break; + case 41..60: ret = "slashed up"; break; + case 61..80: ret = "scratched"; break; + case 81..90: ret = "somewhat nicked"; break; + default: ret = "unbroken"; + } + if( dents > -1 ) { + if( ret ) ret += " and "; + else ret = ""; + switch( dents ) { + case 0..10: ret += "utterly battered"; break; + case 11..20: ret += "terribly pounded"; break; + case 21..40: ret += "serverly dented"; break; + case 41..60: ret += "pretty dented"; break; + case 61..80: ret += "dented"; break; + case 81..90: ret += "slightly dented"; break; + default: ret += "unmarred"; + } + } + return "Its surface is " + ret + "."; + } + + int GetMaxProtection(int type) { + return MaxProtection[type]; + } + + int GetProtection(int type) { + int array types; + int i; + + foreach(int t, int val in Protection) { + if( t & type ) { + int blessing = GetProperty("blessed"); + + if( !intp(blessing) ) { + blessing = 0; + } + return (val + blessing); + } + } + return 0; + } + + int SetProtection(int type, int amount) { + MaxProtection[type] = amount; + return (Protection[type] = amount); + } + + string array GetRestrictLimbs() { + return RestrictLimbs; + } + + string array SetRestrictLimbs(string array limbs) { + return (RestrictLimbs = limbs); + } + + static mixed array AddSave(mixed array vars) { + if(!vars) vars = ({}); + vars += ({ "Properties" }); + return persist::AddSave(vars); + } + + string array GetSave() { + return persist::GetSave(); + } + + mixed GetWear() { + return Wear; + } + + mixed SetWear(mixed val) { + return (Wear = val); + } + + /* ****************** armor.c modals ********************* */ + mixed CanEquip(object who, string array limbs) { + mixed tmp; + + if( !limbs ) { /* let's try and guess */ + string array guess = who->GetLimbs(); + int armor = GetArmorType(); + string limb; + + if( !guess ) { + return "You have no limbs!"; + } + limbs = ({}); + foreach(limb in guess) { + mapping data; + + data = who->GetLimb(limb); + if( data["armors"] & armor ) { + limbs += ({ limb }); + } + } + if( equip::CanEquip(who, limbs) != 1 ) { + return "Wear " + GetDefiniteShort() + " on which limb?"; + } + else { + return 1; + } + } + else if( sizeof(limbs) == 1 ) { + string which; + + switch(GetArmorType()) { + case A_SHIELD: + if( which = who->GetLimbParent(limbs[0]) ) { + limbs = ({ limbs[0], "torso", which }); + } + break; + + case A_LONG_GLOVE: case A_LONG_BOOT: + if( which = who->GetLimbParent(limbs[0]) ) { + limbs = ({ limbs[0], which }); + } + else { + limbs = ({ limbs[0] }); + } + break; + + default: + limbs = ({ limbs[0] }); + break; + } + } + return equip::CanEquip(who, limbs); + } + + mixed CanRepair(object who) { + return 1; + } + + mixed CanSteal(object who) { + if( GetWorn() ) { + return "You can't steal something equipped!"; + } + return steal::CanSteal(who); + } + + /* ********************* armor.c events *********************** */ + static int Destruct() { + if( GetWorn() && environment() ) { + eventUnequip(environment()); + } + return object::Destruct(); + } + + void eventDeteriorate(int type) { + foreach(int t, int val in Protection) { + if( (t & type) && val ) { + if( GetProperty("blessed") ) { + Protection[t] -= 2; + } + else { + Protection[t]--; + } + if( Protection[t] < 1 ) { + Protection[t] = 0; + } + } + } + SetDestroyOnSell(1); + SetValue(GetValue()/2); + } + + mixed eventEquip(object who, string array limbs) { + mixed tmp; + + if( !limbs ) { /* let's try and guess */ + int armor = GetArmorType(); + string limb; + + limbs = ({}); + foreach(limb in who->GetLimbs()) { + mapping data = who->GetLimb(limb); + + if( data["armors"] & armor ) { + limbs += ({ limb }); + } + } + if( equip::CanEquip(who, limbs) != 1 ) { + return "Wear " + GetDefiniteShort() + " on which limb?"; + } + } + else if( sizeof(limbs) == 1 ) { + string which; + + switch(GetArmorType()) { + case A_SHIELD: + if( which = who->GetLimbParent(limbs[0]) ) { + limbs = ({ limbs[0], "torso", which }); + } + break; + + case A_LONG_GLOVE: case A_LONG_BOOT: + if( which = who->GetLimbParent(limbs[0]) ) { + limbs = ({ limbs[0], which }); + } + else { + limbs = ({ limbs[0] }); + } + break; + + default: + limbs = ({ limbs[0] }); + break; + } + } + if( functionp(Wear) ) { + if( functionp(Wear) & FP_OWNER_DESTED ) { + //return "Error in evaluating function pointer."; + return "You can't wear that there at the moment."; + } + if( !evaluate(Wear, who, limbs) ) { + return 1; + } + } + tmp = equip::eventEquip(who, limbs); + if( tmp != 1 ) { + if( tmp ) { + who->eventPrint(tmp); + } + else { + //who->eventPrint("Error in wearing armor."); + who->eventPrint("You can't wear that there right now."); + } + return 1; + } + tmp = GetShort(); + SetWorn(limbs); + if( functionp(Wear) ) { + return 1; + } + else if( stringp(Wear) ) { + who->eventPrint(Wear); + } + else { + who->eventPrint("You wear " + tmp + "."); + } + environment(who)->eventPrint(who->GetName() + " wears " + tmp + ".", who); + return 1; + } + + int eventMove(mixed dest) { + if( !environment() && GetWorn() ) { + mixed array limbs = GetWorn(); + + SetWorn(0); + call_out((: eventRestoreEquip :), 0, limbs); + } + if( GetWorn() && environment() ) { + eventUnequip(environment()); + } + return move::eventMove(dest); + } + + int eventReceiveDamage(object agent, int type, int amt, int i, mixed array l) { + int x = -1; + + foreach(int t, int val in Protection) { + if( t & type ) { + if( x == -1 || val < x ) { + x = val; + } + } + } + x = x/2 + random(x/2); + x = deterioration::eventReceiveDamage(agent, type, x, i, l); + return x; + } + + varargs mixed eventRepair(object who, int strength, int type) { + if( !who || !strength ) { + return 0; + } + if( !type ) { + type = ALL_DAMAGE; + } + foreach(int i in keys(Protection)) { + if( !(i & type) || !MaxProtection[i]) { + continue; + } + Protection[i] += strength; + if( Protection[i] > MaxProtection[i] ) { + Protection[i] = MaxProtection[i]; + } + } + return 1; + } + + mixed eventShow(object who, string component) { + mixed tmp = object::eventShow(who, component); + + if( component || tmp != 1 ) { + return tmp; + } + if( GetPoison() ) { + if( random(100) < who->GetSkillLevel("stealth") ) { + who->eventPrint("You notice a strange substance on it."); + } + } + return 1; + } + + varargs mixed eventUnequip(object who) { + mixed tmp = equip::eventUnequip(who); + + if( tmp != 1 ) { + return tmp; + } + send_messages("remove", "$agent_name $agent_verb $target_name.", + who, this_object(), environment(who)); + return 1; + } + + int restrict(mixed arg){ + if(!arg) return 1; + if(arg) SetRestrictLimbs(arg); + return 2; + } + + /* ******************** armor.c driver applies ******************** */ + static void create() { + AddSave( ({ "CanClose", "CanLock", "RecurseDepth" , "MaxRecurseDepth" }) + + (equip::GetSave()) + (value::GetSave()) + (mass::GetSave()) + + (poison::GetSave()) + (deterioration::GetSave())); + steal::create(); + object::create(); + holder::create(); + seal::create(); + PutCheck(); + SetVendorType(VT_ARMOR); + } + + void init() { + int atype; + atype = GetArmorType(); + if(atype & A_HELMET ) restrict(({"head"})); + if(atype & A_VISOR ) restrict(({"head"})); + if(atype & A_PANTS ) restrict(({"right leg","left leg"})); + if(atype & A_BELT ) restrict(({"torso"})); + if(atype & A_SHIRT ) restrict(({"torso"})); + if(atype & A_CLOAK ) restrict(({"torso"})); + if(atype & A_VEST ) restrict(({"torso"})); + if(atype & A_ARMOR ) restrict(({"torso","right arm","left arm"})); + if(atype & A_COLLAR ) restrict(({"neck"})); + if(atype & A_BODY_ARMOR ) restrict(({"torso","right arm","left arm","left leg","right leg"}) ); + } + + int GetMaxRecurseDepth(){ + return MaxRecurseDepth; + } + + int GetRecurseDepth(){ + return RecurseDepth; + } + + int SetMaxRecurseDepth(int i){ + MaxRecurseDepth =i; + return 1; + } + + int SetRecurseDepth(int i){ + RecurseDepth=i; + return 1; + } + + int AddRecurseDepth(int i){ + RecurseDepth += i; + return 1; + } + + int GetCanClose() { + return CanClose; + } + + int SetCanClose(int x) { + CanClose = x; + } + + int GetCanLock() { + return CanLock; + } + + int SetCanLock(int x) { + return SetCanClose(CanLock = x); + } + + void SetKey(string key) { + SetKeys(key); + } + + int GetOpacity() { + return holder::GetOpacity(); + } + + int GetRadiantLight(int ambient) { + return (object::GetRadiantLight(ambient)) + (holder::GetRadiantLight(ambient)); + } + + int SetSaveRecurse(int x) { + return persist::SetSaveRecurse(x); + } + + mixed CanClose(object who, string id) { + if( !GetCanClose() ) { + return 0; + } + else { + return seal::CanClose(who, id); + } + } + + mixed CanGetFrom(object who, object item) { + mixed tmp = holder::CanGetFrom(who, item); + + if( tmp != 1 ) { + return tmp; + } + if( GetClosed() ) { + return capitalize(GetDefiniteShort()) + " is closed."; + } + return 1; + } + + mixed CanLock(object who, string id) { + if( !GetCanLock() ) { + return 0; + } + else { + return seal::CanLock(who, id); + } + } + + mixed CanOpen(object who, string id) { + if( !GetCanClose() ) { + return 0; + } + else { + return seal::CanOpen(who, id); + } + } + + mixed CanPick(object who, string id) { + if( !GetCanLock() ) { + return "It isn't lockable in the first place."; + } + else { + return seal::CanPick(who, id); + } + } + + mixed CanPutInto(object who, object what) { + mixed tmp; + int mydepth,yourdepth,total,indirectp,indirectpp; + string wherefrom,stackstring; + string *callstack; + + if(!tmp = holder::CanPutInto(who, what)){ + if(GetClosed()) return capitalize(GetDefiniteShort()) + " is closed right now."; + else return "You can't do that right now."; + } + + wherefrom=origin(); + callstack=call_stack(2); + stackstring=implode(callstack," "); + indirectp=member_array("indirect_put_obj_word_obj",callstack); + indirectpp=member_array("indirect_put_objs_word_obj",callstack); + + + if( tmp != 1 ) { + if( GetClosed() ) return capitalize(GetDefiniteShort()) + " is closed."; + else return "You can't do that at this time."; + //if( GetClosed() ) write("It is closed."); + //else write("You can't do that at this time."); + //return tmp; + } + if( GetClosed() ) { + return capitalize(GetDefiniteShort()) + " is closed."; + } + + if(inherits("/lib/std/storage",what) ) { + yourdepth = what->GetRecurseDepth(); + mydepth = this_object()->GetRecurseDepth(); + if(yourdepth && mydepth) total = yourdepth + mydepth; + if(total && total > this_object()->GetMaxRecurseDepth()) return "Doesn't fit."; + } + + return 1; + } + + varargs mixed CanShowInterior(object who, object target) { + if( GetClosed() && this_object()->GetOpacity() > 33) { + return capitalize(GetDefiniteShort()) + " is closed."; + } + else return holder::CanShowInterior(); + } + + mixed CanUnlock(object who, string id, object key) { + if( !GetCanLock() ) { + return 0; + } + else { + return seal::CanUnlock(who, id, key); + } + } + + int eventReceiveObject(object ob) { + if( GetClosed() ) { + return 0; + } + + return holder::eventReceiveObject(ob); + } + + void PutCheck(){ + + if(RecurseDepth >= MaxRecurseDepth) { + SetPreventPut("You have enough containers inside containers there. This one will have to stay out."); + } + + + } + + int inventory_accessible() { + return seal::inventory_accessible(); + } + + int inventory_visible() { + return (seal::inventory_visible() || holder::inventory_visible()); + } diff -c -r --new-file ds1.1/lib/lib/steal.c ds2.0r27/lib/lib/steal.c *** ds1.1/lib/lib/steal.c Sun Feb 1 21:30:27 1998 --- ds2.0r27/lib/lib/steal.c Wed Jul 5 00:00:58 2006 *************** *** 1,5 **** /* /lib/steal.c ! * from the Dead Souls V Object Library * handles the stealing of objects * created by Descartes of Borg 960210 */ --- 1,5 ---- /* /lib/steal.c ! * from the Dead Souls Object Library * handles the stealing of objects * created by Descartes of Borg 960210 */ *************** *** 17,27 **** mixed CanSteal(object who) { if( GetInvis(who) ) return 0; if( PreventSteal ) { ! if( PreventSteal == 1 ) return "You can't steal that!"; if( stringp(PreventSteal) ) return PreventSteal; if( objectp(PreventSteal) ) { if( PreventSteal == who ) ! return "Mystical forces prevent your thievery."; return 1; } return evaluate(PreventSteal, who); --- 17,27 ---- mixed CanSteal(object who) { if( GetInvis(who) ) return 0; if( PreventSteal ) { ! if( PreventSteal == 1 ) return "You can't steal that!"; if( stringp(PreventSteal) ) return PreventSteal; if( objectp(PreventSteal) ) { if( PreventSteal == who ) ! return "Mystical forces prevent your thievery."; return 1; } return evaluate(PreventSteal, who); diff -c -r --new-file ds1.1/lib/lib/talk.c ds2.0r27/lib/lib/talk.c *** ds1.1/lib/lib/talk.c Sun Feb 1 21:30:27 1998 --- ds2.0r27/lib/lib/talk.c Wed Jul 5 00:00:58 2006 *************** *** 10,15 **** --- 10,17 ---- #include <message_class.h> #include "include/talk.h" + int GetPolyglot(); + int direct_ask_liv_str() { return 1; } int direct_ask_liv_to_str() { return 1; } *************** *** 32,56 **** varargs mixed CanSpeak(object target, string verb, string msg, string lang) { if( lang && (!GetLanguageLevel(lang) || !GetLanguageName(lang)) ) ! return "You don't speak that language!"; if( target ) { if( target == this_object() ) ! return "Are you really intent on talking to yourself?"; if( userp(target) && !interactive(target) ) ! return (string)target->GetName() + " is net-dead."; if( (int)target->GetBlocked("tell") ) ! return (string)target->GetName() + " is blocking all tells."; } return 1; } varargs mixed eventHearTalk(object who, object target, int cls, string verb, ! string msg, string lang) { string tmp; ! ! if( lang && !newbiep() ) msg = translate(msg, GetLanguageLevel(lang)); switch(cls) { ! case TALK_PRIVATE: if( target != this_object() ) return 0; if( verb == "reply" ) tmp = "%^BOLD%^RED%^" + (string)who->GetName() + --- 34,58 ---- varargs mixed CanSpeak(object target, string verb, string msg, string lang) { if( lang && (!GetLanguageLevel(lang) || !GetLanguageName(lang)) ) ! return "You don't speak that language!"; if( target ) { if( target == this_object() ) ! return "Are you really intent on talking to yourself?"; if( userp(target) && !interactive(target) ) ! return (string)target->GetName() + " is net-dead."; if( (int)target->GetBlocked("tell") ) ! return (string)target->GetName() + " is blocking all tells."; } return 1; } varargs mixed eventHearTalk(object who, object target, int cls, string verb, ! string msg, string lang) { string tmp; ! ! if( lang && !newbiep() && !GetPolyglot() ) msg = translate(msg, GetLanguageLevel(lang)); switch(cls) { ! case TALK_PRIVATE: if( target != this_object() ) return 0; if( verb == "reply" ) tmp = "%^BOLD%^RED%^" + (string)who->GetName() + *************** *** 60,97 **** eventPrint(tmp, MSG_CONV); break; ! case TALK_SEMI_PRIVATE: if( target != this_object() ) return 0; tmp = "%^BOLD%^CYAN%^" + (string)who->GetName() + " whispers in " + ! lang + " to you,%^RESET%^ \"" + msg + "%^RESET%^\""; eventPrint(tmp, MSG_CONV); break; ! case TALK_LOCAL: if( target ) { if( target != this_object() ) { if( msg[<1] == '?' ) tmp = (string)target->GetName(); else tmp = "to " + (string)target->GetName(); ! if( lang ) tmp += " in " + lang; } else { if( msg[<1] == '?' ) tmp = "you"; else tmp = "to you"; ! if( lang ) tmp += " in " + lang; } tmp = (string)who->GetName() + " " + pluralize(verb) + " " + tmp + ! ", \""; tmp = tmp + "%^BOLD%^CYAN%^\"" + msg + "%^RESET%^\""; eventPrint(tmp, MSG_CONV); } else if( verb == "yell" ) { tmp = "%^BOLD%^GREEN%^You hear a " + (string)who->GetGender() ! + " " + (string)who->GetRace() + " yell in " + lang + ! " from a distance,%^RESET%^ \"" + msg + "%^RESET%^\""; eventPrint(tmp, MSG_CONV); } else { ! if( lang ) tmp = pluralize(verb) + " in " + lang; else tmp = pluralize(verb); tmp = (string)who->GetName() + " " + tmp + ", \""; tmp = tmp + "%^BOLD%^CYAN%^" + msg + "%^RESET%^\""; --- 62,99 ---- eventPrint(tmp, MSG_CONV); break; ! case TALK_SEMI_PRIVATE: if( target != this_object() ) return 0; tmp = "%^BOLD%^CYAN%^" + (string)who->GetName() + " whispers in " + ! capitalize(lang) + " to you,%^RESET%^ \"" + msg + "%^RESET%^\""; eventPrint(tmp, MSG_CONV); break; ! case TALK_LOCAL: if( target ) { if( target != this_object() ) { if( msg[<1] == '?' ) tmp = (string)target->GetName(); else tmp = "to " + (string)target->GetName(); ! if( lang ) tmp += " in " + capitalize(lang); } else { if( msg[<1] == '?' ) tmp = "you"; else tmp = "to you"; ! if( lang ) tmp += " in " + capitalize(lang); } tmp = (string)who->GetName() + " " + pluralize(verb) + " " + tmp + ! ", \""; tmp = tmp + "%^BOLD%^CYAN%^\"" + msg + "%^RESET%^\""; eventPrint(tmp, MSG_CONV); } else if( verb == "yell" ) { tmp = "%^BOLD%^GREEN%^You hear a " + (string)who->GetGender() ! + " " + (string)who->GetRace() + " yell in " + capitalize(lang) + ! " from a distance,%^RESET%^ \"" + msg + "%^RESET%^\""; eventPrint(tmp, MSG_CONV); } else { ! if( lang ) tmp = pluralize(verb) + " in " + capitalize(lang); else tmp = pluralize(verb); tmp = (string)who->GetName() + " " + tmp + ", \""; tmp = tmp + "%^BOLD%^CYAN%^" + msg + "%^RESET%^\""; *************** *** 99,117 **** } break; ! case TALK_AREA: ! tmp = "%^BOLD%^GREEN%^" + (string)who->GetName() + " yells in " + ! lang + ",%^RESET%^ \"" + msg + "%^RESET%^\""; ! eventPrint(tmp, MSG_CONV); ! break; ! case TALK_WORLD: ! tmp = "%^BOLD%^BLUE%^" + (string)who->GetName() + " shouts in " + ! lang + ",%^RESET%^ \"" + msg + "%^RESET%^\""; ! eventPrint(tmp, MSG_CONV); break; ! default: return 0; } eventTalkRespond(who, target, cls, msg, lang); --- 101,119 ---- } break; ! case TALK_AREA: ! tmp = "%^BOLD%^GREEN%^" + (string)who->GetName() + " yells in " + ! capitalize(lang) + ",%^RESET%^ \"" + msg + "%^RESET%^\""; ! eventPrint(tmp, MSG_CONV); ! break; ! case TALK_WORLD: ! tmp = "%^BOLD%^BLUE%^" + (string)who->GetName() + " shouts in " + ! capitalize(lang) + ",%^RESET%^ \"" + msg + "%^RESET%^\""; ! eventPrint(tmp, MSG_CONV); break; ! default: return 0; } eventTalkRespond(who, target, cls, msg, lang); *************** *** 123,201 **** } varargs mixed eventSpeak(object target, int cls, string msg, string lang) { - object *bystanders; string verb, tmp; ! int x, cols; ! ! if( lang ) { msg = translate(msg, GetLanguageLevel(lang)); lang = GetLanguageName(lang); } cols = GetScreen()[0]; if( msg[<1] != '?' && msg[<1] != '!' && msg[<1] != '.' ) ! msg = capitalize(msg) + "."; else msg = capitalize(msg); switch( cls ) { ! case TALK_PRIVATE: tmp = "%^BOLD%^RED%^You tell " + (string)target->GetName() + ! ",%^RESET%^ \"" + msg + "%^RESET%^\""; eventPrint(tmp, MSG_CONV); target->eventHearTalk(this_object(), target, cls, "tell", msg); return 1; ! ! case TALK_SEMI_PRIVATE: ! if( !target ) tmp = "%^BOLD%^CYAN%^You whisper in " + lang + ! ",%^RESET%^ \"" + msg + "%^RESET%^\""; ! else tmp = "%^BOLD%^CYAN%^You whisper in " + lang + " to " + ! (string)target->GetName() + ",%^RESET%^ \"" + msg + "%^RESET%^\""; eventPrint(tmp, MSG_CONV); environment()->eventHearTalk(this_object(), target, cls, "whisper", ! msg, lang); return 1; ! ! case TALK_LOCAL: if( msg[<1] == '?' ) verb = GetMessage("ask") || "ask"; else if( msg[<1] == '!' ) verb = GetMessage("exclaim") || "exclaim"; else { verb = GetMessage("say") || "say"; if ((msg[<1] >= 'a' && msg[<1] <= 'z') || ! (msg[<1] >= 'A' && msg[<1] <= 'Z')) msg = msg + "."; } if( target && msg[<1] == '?' ) { tmp = "You " + verb + " " + (string)target->GetName(); ! if( lang ) tmp = tmp + " in " + lang; } else if( target ) { tmp = "You " + verb + " to " + (string)target->GetName(); ! if( lang ) tmp = tmp + " in " + lang; } else { tmp = "You " + verb; ! if( lang ) tmp = tmp + " in " + lang; } tmp = tmp + ", \"%^BOLD%^CYAN%^" + msg + "%^RESET%^\""; eventPrint(tmp, MSG_CONV); environment()->eventHearTalk(this_object(), target, cls, verb, msg, ! lang); return 1; ! ! case TALK_AREA: ! tmp = "%^BOLD%^GREEN%^You yell in " + lang + ",%^RESET%^ \"" + ! msg + "%^RESET%^\""; eventPrint(tmp, MSG_CONV); environment()->eventHearTalk(this_object(), target, cls, "yell", msg, ! lang); break; ! case TALK_WORLD: ! tmp = "%^BOLD%^BLUE%^You shout in " + lang + ",%^RESET%^ \"" + ! msg + "%^RESET%^\""; eventPrint(tmp, MSG_CONV); (users() - ({ this_object() }))->eventHearTalk(this_object(), target, ! cls,"shout", msg, lang); return 1; ! ! default: return 0; } } --- 125,206 ---- } varargs mixed eventSpeak(object target, int cls, string msg, string lang) { string verb, tmp; ! int cols; ! ! if( lang && !GetPolyglot() ) { msg = translate(msg, GetLanguageLevel(lang)); lang = GetLanguageName(lang); } cols = GetScreen()[0]; + //debug("target",target); + //debug("cls",cls); + //debug("msg",msg); + //debug("lang",lang); if( msg[<1] != '?' && msg[<1] != '!' && msg[<1] != '.' ) ! msg = capitalize(msg) + "."; else msg = capitalize(msg); switch( cls ) { ! case TALK_PRIVATE: tmp = "%^BOLD%^RED%^You tell " + (string)target->GetName() + ! ",%^RESET%^ \"" + msg + "%^RESET%^\""; eventPrint(tmp, MSG_CONV); target->eventHearTalk(this_object(), target, cls, "tell", msg); return 1; ! ! case TALK_SEMI_PRIVATE: ! if( !target ) tmp = "%^BOLD%^CYAN%^You whisper in " + capitalize(lang) + ! ",%^RESET%^ \"" + msg + "%^RESET%^\""; ! else tmp = "%^BOLD%^CYAN%^You whisper in " + capitalize(lang) + " to " + ! (string)target->GetName() + ",%^RESET%^ \"" + msg + "%^RESET%^\""; eventPrint(tmp, MSG_CONV); environment()->eventHearTalk(this_object(), target, cls, "whisper", ! msg, lang); return 1; ! ! case TALK_LOCAL: if( msg[<1] == '?' ) verb = GetMessage("ask") || "ask"; else if( msg[<1] == '!' ) verb = GetMessage("exclaim") || "exclaim"; else { verb = GetMessage("say") || "say"; if ((msg[<1] >= 'a' && msg[<1] <= 'z') || ! (msg[<1] >= 'A' && msg[<1] <= 'Z')) msg = msg + "."; } if( target && msg[<1] == '?' ) { tmp = "You " + verb + " " + (string)target->GetName(); ! if( lang ) tmp = tmp + " in " + capitalize(lang); } else if( target ) { tmp = "You " + verb + " to " + (string)target->GetName(); ! if( lang ) tmp = tmp + " in " + capitalize(lang); } else { tmp = "You " + verb; ! if( lang ) tmp = tmp + " in " + capitalize(lang); } tmp = tmp + ", \"%^BOLD%^CYAN%^" + msg + "%^RESET%^\""; eventPrint(tmp, MSG_CONV); environment()->eventHearTalk(this_object(), target, cls, verb, msg, ! lang); return 1; ! ! case TALK_AREA: ! tmp = "%^BOLD%^GREEN%^You yell in " + capitalize(lang) + ",%^RESET%^ \"" + ! msg + "%^RESET%^\""; eventPrint(tmp, MSG_CONV); environment()->eventHearTalk(this_object(), target, cls, "yell", msg, ! lang); break; ! case TALK_WORLD: ! tmp = "%^BOLD%^BLUE%^You shout in " + capitalize(lang) + ",%^RESET%^ \"" + ! msg + "%^RESET%^\""; eventPrint(tmp, MSG_CONV); (users() - ({ this_object() }))->eventHearTalk(this_object(), target, ! cls,"shout", msg, lang); return 1; ! ! default: return 0; } } diff -c -r --new-file ds1.1/lib/lib/teacher.c ds2.0r27/lib/lib/teacher.c *** ds1.1/lib/lib/teacher.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/lib/teacher.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,222 ---- + /* /lib/teacher.c + * from the Dead Souls Library + * created 960320 by Blitz@Dead Souls + * Version: @(#) teacher.c 1.3@(#) + * Last modified: 96/10/28 + */ + + #include <lib.h> + #include <daemons.h> + #include "include/teacher.h" + + inherit LIB_SENTIENT; + + private string array TeachingLanguages; + private mapping Students; + private int commercial = 0; + private int teaching_fee = 50; + private string local_currency = "silver"; + + int GetCommercial(){ + return commercial; + } + + int SetCommercial(int i){ + if(i) { + commercial = i; + if(!teaching_fee) teaching_fee = 50; + } + else commercial = 0; + return commercial; + } + + string GetLocalCurrency(){ + return local_currency; + } + + string SetLocalCurrency(string str){ + local_currency = str; + return local_currency; + } + + int GetTeachingFee(){ + return teaching_fee; + } + + int SetTeachingFee(int i){ + if(i) { + teaching_fee = i; + commercial = 1; + } + else { + teaching_fee = 0; + commercial = 0; + } + return teaching_fee; + } + + /**** driver applies ****/ + + static void create() { + sentient::create(); + TeachingLanguages = ({}); + Students = ([]); + SetNoClean(1); + SetCommandResponses( ([ + "teach" : (: eventTeach :), + "teach" : (: eventTeach :), + "default" : (: eventHelp :), + "help" : (: eventHelp :), + ]) ); + SetRequestResponses( ([ + "default" : (: eventHelp :), + "help" : (: eventHelp :), + ]) ); + } + + static void init() { + string str; + sentient::init(); + if( !living(this_player()) ) return; + str = (string)this_player()->GetKeyName(); + if( Students[str] ) { + eventForce("speak You will have to start your " + "studies anew, "+(string)this_player()->GetName()); + map_delete(Students, str); + } + } + + /**** data manipulation ****/ + + mixed AddTeachingLanguages(string *args){ + string *tmp_array = ({}); + if( !args ) + error("Bad argument 1 to AddTeachingLanguages."); + foreach(string lang in args){ + tmp_array += ({ capitalize(lower_case(lang)) }); + } + return (TeachingLanguages = distinct_array(TeachingLanguages + tmp_array)); + } + + mixed RemoveTeachingLanguages(string *args...) { + if( !args || !arrayp(args) ) + error("Bad argument 1 to RemoveTeachingLanguages."); + TeachingLanguages -= args; + return TeachingLanguages; + } + + string array GetTeachingLanguages() { return copy(TeachingLanguages); } + + string Expertise(){ + string tmp, expertises; + if(!sizeof(GetTeachingLanguages())) return "none"; + else if(sizeof(GetTeachingLanguages()) == 1) { + return GetTeachingLanguages()[0]; + } + expertises = implode(GetTeachingLanguages(), ", "); + if(sizeof(GetTeachingLanguages()) == 2){ + expertises = replace_string(expertises,", "," and "); + } + else if(sizeof(GetTeachingLanguages()) > 2){ + tmp = last_string_element(expertises,","); + expertises = replace_string(expertises, tmp, " and"+tmp); + } + return expertises; + } + + mapping GetStudents() { return copy(Students); } + + /**** high-level events ****/ + + int eventHelp(object who, string unused) { + eventForce("speak I am not sure of what you are " + "asking, " + (string)who->GetName() + "."); + if(sizeof( GetTeachingLanguages() )){ + eventForce("speak My area of expertise covers " + + Expertise() + "."); + eventForce("speak You can \"ask "+GetKeyName()+" to teach " + "<LANGUAGE>\" if you have training points."); + } + return 1; + } + + int eventTeach(object who, string verb, string language) { + if( !who || environment(who) != environment() ) { + return 0; + } + if( !sizeof(language) || !sizeof(verb) ) return eventHelp(who, 0); + if( verb == "teach" ) { + + language = capitalize(language); + + if( Students[ (string)who->GetKeyName() ] ) { + eventForce("speak I am already teaching you!"); + return 0; + } + if( member_array(language, this_object()->GetTeachingLanguages()) == -1 ) { + eventForce("speak I know nothing about the " +capitalize(language)+" language."); + return 0; + } + if( !commercial && (int)this_player()->GetTrainingPoints() < 1 ) { + eventForce("speak You need more training points."); + return 0; + } + if(commercial && this_player()->GetCurrency(GetLocalCurrency()) < teaching_fee){ + eventForce("speak I charge "+teaching_fee+" "+GetLocalCurrency()+" per lesson. "+ + "You don't seem to have the right amount of the right currency."); + return 0; + } + Students[ (string)who->GetKeyName() ] = language; + eventStart(who, language); + call_out((: ContinueTeaching, who, language, 0 :), TEACHING_WAIT); + return 1; + } + return 1; + } + + static int ContinueTeaching(object who, string language, int x) { + language = capitalize(language); + if( !present(who, environment()) ) return 0; + if( !Students[(string)who->GetKeyName()] ) return 0; + if( x > 4 ) { + map_delete(Students, (string)who->GetKeyName()); + eventComplete(who, language); + who->AddLanguagePoints(language,5+((who->GetStatLevel("intelligence")/10)*2)+random(10)); + if(!commercial) who->AddTrainingPoints(-1); + else who->AddCurrency(GetLocalCurrency(),-teaching_fee); + return 1; + } else { + eventContinue(who, language, ++x); + call_out((: ContinueTeaching, who, language, x :), TEACHING_WAIT); + return 1; + } + } + + /**** message handling events ****/ + + /* The three following events are purely *aesthetic*, + * Hopefully prolific coders will override them for + * more interesting teaching techniques. :) + */ + + int eventStart(object who, string language) { + who->eventPrint(GetName() + " begins teaching you " + "about the " + language + " language."); + environment()->eventPrint(GetName() + " begins teaching " + + (string)who->GetName() + "...", who); + return 1; + } + + int eventContinue(object who, string language, int x) { + who->eventPrint("You listen intently as " + GetName() + + " continues " + possessive(this_object()) + + " dissertation on " + language + "."); + return 1; + } + + int eventComplete(object who, string language) { + who->eventPrint("You feel somewhat more competent in " + language + "."); + eventForce("speak I can teach you no more for now, " + + (string)who->GetName() + "."); + return 1; + } diff -c -r --new-file ds1.1/lib/lib/teller.c ds2.0r27/lib/lib/teller.c *** ds1.1/lib/lib/teller.c Sun Feb 1 21:30:10 1998 --- ds2.0r27/lib/lib/teller.c Wed Jul 5 00:00:58 2006 *************** *** 1,331 **** /* /lib/teller.c ! * from the Dead Souls V Object Library * npc interface which handles banking transactions * created by Blitz@Dead Souls 960105 * Version: @(#) teller.c 1.3@(#) * Last Modified: 96/10/22 */ ! #include <lib.h> #include <daemons.h> #include "include/teller.h" ! inherit LIB_SENTIENT; ! string BankName, LocalCurrency; string *Currencies; int LocalFee, NonLocalFee, OpenFee; float ExchangeFee; ! static void create() { sentient::create(); ! BankName = "Praxis Trust"; ! LocalCurrency = "gold"; OpenFee = 5; Currencies = ({ "copper", "silver", "electrum", "gold", "platinum" }); SetCommandResponses( ([ ! "default" : (: cmdParse :), ! ]) ); SetRequestResponses( ([ ! "default" : (: cmdParse :), ! ]) ); } ! string SetBankName(string str) { return (BankName = str); } ! string SetLocalCurrency(string str) { return (LocalCurrency = str); } ! int SetLocalFee(int x) { return (LocalFee = x); } ! int SetNonLocalFee(int x) { return (NonLocalFee = x); } ! int SetOpenFee(int x) { return (OpenFee = x); } ! float SetExchangeFee(float x) { return (ExchangeFee = x); } ! mixed SetCurrencies(mixed var) { if( arrayp(var) ) { ! if( member_array(LocalCurrency, var) == -1 ) ! var += ({ LocalCurrency }); ! return (Currencies = var); } else error("Bad argument 1 to SetCurrencies()"); } ! int GetLocalFee() { return LocalFee; } ! int GetNonLocalFee() { return NonLocalFee; } ! int GetExchangeFee() { return ExchangeFee; } ! int GetOpenFee() { return OpenFee; } ! mixed GetCurrencies() { return copy(Currencies); } ! string GetBankName() { return BankName; } ! string GetLocalCurrency() { return LocalCurrency; } ! mixed CanBank(object who) { ! if( creatorp(who) ) ! return "Creators have no need for that."; ! if( !(int)who->GetAccountInfo( GetBankName() ) ) ! return "You must create an account with "+GetBankName()+" first."; ! return 1; } ! int AddSurcharge(object who, string currency, int amount) { int charge; string type; ! if( (string)who->GetTown() == GetTown() ) { ! type = "standard"; ! charge = GetLocalFee(); } else { ! type = "non-residential"; ! charge = GetNonLocalFee(); } if( !charge ) return amount; if( amount > charge ) { ! amount -= charge; ! who->eventPrint(sprintf("The bank retains a %s " ! "surcharge of %d %s.", type, charge, currency)); ! return amount; } else if( (amount + charge) <= (int)who->GetCurrency(currency) ) { ! who->eventPrint(sprintf("The bank charges you a %s %d %s " ! "surcharge.", type, charge, currency)); ! who->AddCurrency(currency, -charge); ! return amount; } else { ! who->eventPrint(sprintf("You are unable to afford the " ! "%s surcharge of %d %s.", type, charge, currency)); ! return 0; } return amount; } ! int eventBalance(object who) { string str, ret, *tmp; mapping mp; float val; int total; ! mp = (mapping)who->GetAccountInfo( GetBankName() ); if( !mp ) return 0; environment()->eventPrint( (string)who->GetName() + " requests " ! "current balance.", ({ who }) ); ret = "Your account with "+GetBankName()+" was " ! "opened "+ctime(mp["open"])+".\n"; ret += "This location's default currency is "+GetLocalCurrency()+".\n\n"; tmp = filter(keys(mp), (: member_array($1, Currencies) > -1 :)); total = 0; if( !sizeof(tmp) ) ! ret += "You have made no deposits.\n"; else foreach(str in tmp) { ! if( mp[str] < 1 ) continue; ! ret += sprintf("%-20s : %d\n", str+" coins", mp[str]); ! if( str == GetLocalCurrency() ) total += mp[str]; ! else if( mp[str] ) { ! if( currency_rate(str) ) ! val = mp[str] / currency_rate(str); ! else val = 0; ! if( currency_rate(GetLocalCurrency()) ) ! total += to_int( val * currency_rate(GetLocalCurrency()) ); ! } } ret += sprintf("%-20s ----------\n%-22s %d", ! "", "Total in "+GetLocalCurrency(), total); if( mp["last time"] ) ! ret += sprintf("\n\nYour last transaction: %s at %s.", ! mp["last trans"], ctime(mp["last time"]) ); who->eventPage(explode(ret, "\n"), "info"); return 1; } ! int eventDeposit(object who, string currency, int amount) { int i; if( amount < 1 ) { ! eventForce("speak " + (string)who->GetName() + ", " ! "you are a moron."); ! return 1; } if( !currency ) currency = GetLocalCurrency(); if( !(i = (int)who->GetCurrency(currency)) ) { ! eventForce("speak You are not carrying any "+currency+"."); ! return 1; } if( amount > i ) { ! eventForce("speak You are not carrying that much "+ currency +"."); ! return 1; } who->eventPrint(sprintf("You deposit %d %s into your " ! "account.", amount, currency)); environment()->eventPrint((string)who->GetName() + " makes " ! "a deposit.", ({ who }) ); who->AddCurrency(currency, -amount); who->AddBank(GetBankName(), currency, amount); return 1; } ! int eventWithdraw(object who, string currency, int amount) { int i, x; ! x = amount; if( amount < 1 ) { ! eventForce("speak Withdrawing a negative amount is not a prudent " ! "idea, "+ (string)who->GetName() +"."); ! return 1; } if( !currency ) currency = GetLocalCurrency(); if( !(i = (int)who->GetBank(GetBankName(), currency)) ) { ! eventForce("speak You have no "+currency+" in your account."); ! return 1; } if( amount > i ) { ! eventForce("speak You do not have that much "+currency+" in your " ! "account."); ! return 1; } if( !(amount = AddSurcharge(who, currency, amount)) ) return 1; if( (int)who->AddCurrency(currency, amount) < 0 ) { ! eventForce("speak You are unable to carry that " ! "much "+currency+"!"); ! if( x > amount ) { ! who->eventPrint("The bank returns the fee."); ! who->AddCurrency(currency, (amount - x)); ! } ! return 1; } who->AddBank(GetBankName(), currency, -amount); who->eventPrint(sprintf("You withdraw %d %s from your account.", ! amount, currency)); environment()->eventPrint(sprintf("%s withdraws some %s.", ! (string)who->GetName(), currency), ({ who })); return 1; } ! int eventExchange(object who, int amount, string str1, string str2) { int i, x, charge; float val; ! if( amount < 1 ) { ! eventForce("speak " + (string)who->GetName() + ", you are " ! "definitely a moron!"); ! return 1; } if( amount > (int)who->GetCurrency(str1) ) { ! eventForce("speak You do not have that much "+str1+" to exchange."); ! return 1; } if( str1 == str2 ) { ! eventForce("speak That would be pointless."); ! return 1; } if( member_array(str1, GetCurrencies()) == -1 ) { ! eventForce("speak You cannot exchange "+str1+" here."); ! return 1; } if( member_array(str2, GetCurrencies()) == -1 ) { ! eventForce("speak You cannot exchange "+str2+" here."); ! return 1; } ! val = amount / currency_rate(str1); x = to_int( (amount * 0.01) + amount ); ! i = to_int( val * currency_rate(str2) ); if( GetExchangeFee() ) ! charge = to_int(i / (100 / GetExchangeFee())); ! else charge = 0; if( charge ) i -= charge; if( i < 1 ) { ! eventForce("speak That isn't even worth one " + str2 + "!"); ! return 1; } if( (int)who->AddCurrency(str2, i) < 0 ) { ! eventForce("speak You cannot carry that much "+str2+", " + ! (string)who->GetName()+"."); ! return 1; } who->AddCurrency(str1, -amount); who->eventPrint(sprintf("You exchange %d %s for %d %s.", ! amount, str1, i, str2)); if( charge ) ! who->eventPrint(sprintf("You were charged a %.1f%s fee of %d %s.", ! GetExchangeFee(), "%", charge, str2) ); environment()->eventPrint((string)who->GetName()+" exchanges some "+ ! str1+" for "+str2+".", who); return 1; } ! int eventOpenAccount(object who) { if( who->GetAccountInfo( GetBankName() ) ) { ! eventForce("speak You already have an account with "+GetBankName()+", " + ! (string)who->GetName()+"!"); ! return 1; } if( (int)who->GetCurrency( GetLocalCurrency() ) < OpenFee ) { ! eventForce(" speak "+ sprintf("You must have at least %d %s to open " ! "an account at this branch of %s, %s.", GetOpenFee(), ! GetLocalCurrency(), GetBankName(), (string)who->GetName())); ! return 1; } if( OpenFee < 1 ) return 0; who->AddCurrency(GetLocalCurrency(), -OpenFee); who->AddBank(GetBankName(), GetLocalCurrency(), OpenFee); who->eventPrint(sprintf("You deposit %d %s and open an account " ! "with %s.", OpenFee, GetLocalCurrency(), GetBankName()) ); eventBalance(who); environment()->eventPrint((string)who->GetName() + " opens an " ! "account.", who); eventForce("smile "+(string)who->GetKeyName()); return 1; } ! int cmdParse(object who, string cmd, string str) { int x; ! string s1, s2; mixed err; ! if( cmd != "account" && stringp(err = CanBank(who)) ) { ! who->eventPrint(err); ! return 1; } switch(cmd) { ! case "balance" : ! return eventBalance(who); ! break; ! case "deposit" : case "withdraw" : ! if( !str ) { ! eventForce("speak How much of what?"); ! return 1; ! } ! sscanf(str, "%d %s", x, s1); ! if( member_array(s1, Currencies) < 0 ) { ! who->eventPrint(s1 + " is not supported here!"); ! return 1; ! } ! if( cmd == "deposit" ) ! return eventDeposit(who, s1, x); ! else ! return eventWithdraw(who, s1, x); ! break; ! case "exchange" : ! if( !str ) { ! eventForce("speak Exchange what for what?"); ! return 1; ! } ! sscanf(str, "%d %s for %s", x, s1, s2); ! return eventExchange(who, x, s1, s2); ! break; ! case "account" : ! return eventOpenAccount(who); ! break; ! default: ! eventForce("speak " + (string)who->GetName() + ", I do not " ! "understand what you want."); ! eventForce("whisper to " + (string)who->GetKeyName() + " Try " ! "\"help banking\" if you are confused."); ! } return 1; } --- 1,358 ---- /* /lib/teller.c ! * from the Dead Souls Object Library * npc interface which handles banking transactions * created by Blitz@Dead Souls 960105 * Version: @(#) teller.c 1.3@(#) * Last Modified: 96/10/22 */ ! #include <lib.h> #include <daemons.h> #include "include/teller.h" ! inherit LIB_SENTIENT; ! inherit LIB_MANYCOINS; ! string BankName, LocalCurrency; string *Currencies; int LocalFee, NonLocalFee, OpenFee; float ExchangeFee; ! static void create() { sentient::create(); ! BankName = "Town Trust"; ! LocalCurrency = "silver"; OpenFee = 5; Currencies = ({ "copper", "silver", "electrum", "gold", "platinum" }); SetCommandResponses( ([ ! "default" : (: cmdParse :), ! ]) ); SetRequestResponses( ([ ! "default" : (: cmdParse :), ! ]) ); } ! string SetBankName(string str) { return (BankName = str); } ! string SetLocalCurrency(string str) { return (LocalCurrency = str); } ! int SetLocalFee(int x) { return (LocalFee = x); } ! int SetNonLocalFee(int x) { return (NonLocalFee = x); } ! int SetOpenFee(int x) { return (OpenFee = x); } ! float SetExchangeFee(float x) { return (ExchangeFee = x); } ! mixed SetCurrencies(mixed var) { if( arrayp(var) ) { ! if( member_array(LocalCurrency, var) == -1 ) ! var += ({ LocalCurrency }); ! return (Currencies = var); } else error("Bad argument 1 to SetCurrencies()"); } ! int GetLocalFee() { return LocalFee; } ! int GetNonLocalFee() { return NonLocalFee; } ! int GetExchangeFee() { return ExchangeFee; } ! int GetOpenFee() { return OpenFee; } ! mixed GetCurrencies() { return copy(Currencies); } ! string GetBankName() { return BankName; } ! string GetLocalCurrency() { return LocalCurrency; } ! mixed CanBank(object who) { ! if( !(int)who->GetAccountInfo( GetBankName() ) ) ! return "You must create an account with "+GetBankName()+" first."; ! return 1; } ! int AddSurcharge(object who, string currency, int amount) { int charge; string type; ! if( (string)who->GetTown() == GetTown() ) { ! type = "standard"; ! charge = GetLocalFee(); } else { ! type = "non-residential"; ! charge = GetNonLocalFee(); } if( !charge ) return amount; if( amount > charge ) { ! amount -= charge; ! who->eventPrint(sprintf("The bank retains a %s " ! "surcharge of %d %s.", type, charge, currency)); ! return amount; } else if( (amount + charge) <= (int)who->GetCurrency(currency) ) { ! who->eventPrint(sprintf("The bank charges you a %s %d %s " ! "surcharge.", type, charge, currency)); ! who->AddCurrency(currency, -charge); ! return amount; } else { ! who->eventPrint(sprintf("You are unable to afford the " ! "%s surcharge of %d %s.", type, charge, currency)); ! return 0; } return amount; } ! int eventBalance(object who) { string str, ret, *tmp; mapping mp; float val; int total; ! mp = (mapping)who->GetAccountInfo( GetBankName() ); if( !mp ) return 0; environment()->eventPrint( (string)who->GetName() + " requests " ! "current balance.", ({ who }) ); ret = "Your account with "+GetBankName()+" was " ! "opened "+ctime(mp["open"])+".\n"; ret += "This location's default currency is "+GetLocalCurrency()+".\n\n"; tmp = filter(keys(mp), (: member_array($1, Currencies) > -1 :)); total = 0; if( !sizeof(tmp) ) ! ret += "You have made no deposits.\n"; else foreach(str in tmp) { ! if( mp[str] < 1 ) continue; ! ret += sprintf("%-20s : %d\n", str+"", mp[str]); ! if( str == GetLocalCurrency() ) total += mp[str]; ! else if( mp[str] ) { ! if( currency_rate(str) ) ! val = query_value(mp[str],str,GetLocalCurrency()); ! else val = 0; ! if(val) total += val; ! } } ret += sprintf("%-20s ----------\n%-22s %d", ! "", "Total in "+GetLocalCurrency(), total); if( mp["last time"] ) ! ret += sprintf("\n\nYour last transaction: %s at %s.", ! mp["last trans"], ctime(mp["last time"]) ); who->eventPage(explode(ret, "\n"), "info"); return 1; } ! int eventDeposit(object who, string currency, int amount) { int i; if( amount < 1 ) { ! eventForce("speak " + (string)who->GetName() + ", " ! "That transaction is unacceptable."); ! return 1; } if( !currency ) currency = GetLocalCurrency(); if( !(i = (int)who->GetCurrency(currency)) ) { ! eventForce("speak You are not carrying any "+currency+"."); ! return 1; } if( amount > i ) { ! eventForce("speak You are not carrying that much "+ currency +"."); ! return 1; } who->eventPrint(sprintf("You deposit %d %s into your " ! "account.", amount, currency)); environment()->eventPrint((string)who->GetName() + " makes " ! "a deposit.", ({ who }) ); who->AddCurrency(currency, -amount); who->AddBank(GetBankName(), currency, amount); return 1; } ! int eventWithdraw(object who, string currency, int amount) { int i, x; ! x = amount; if( amount < 1 ) { ! eventForce("speak Withdrawing a negative amount is not a prudent " ! "idea, "+ (string)who->GetName() +"."); ! return 1; } if( !currency ) currency = GetLocalCurrency(); if( !(i = (int)who->GetBank(GetBankName(), currency)) ) { ! eventForce("speak You have no "+currency+" in your account."); ! return 1; } if( amount > i ) { ! eventForce("speak You do not have that much "+currency+" in your " ! "account."); ! return 1; } if( !(amount = AddSurcharge(who, currency, amount)) ) return 1; if( (int)who->AddCurrency(currency, amount) < 0 ) { ! eventForce("speak You are unable to carry that " ! "much "+currency+"!"); ! if( x > amount ) { ! who->eventPrint("The bank returns the fee."); ! who->AddCurrency(currency, (amount - x)); ! } ! return 1; } who->AddBank(GetBankName(), currency, -amount); who->eventPrint(sprintf("You withdraw %d %s from your account.", ! amount, currency)); environment()->eventPrint(sprintf("%s withdraws some %s.", ! (string)who->GetName(), currency), ({ who })); return 1; } ! int eventExchange(object who, int amount, string str1, string str2) { int i, x, charge; float val; ! if( amount < 1 ) { ! eventForce("speak " + (string)who->GetName() + ", that " ! "transaction cannot be completed."); ! return 1; } if( amount > (int)who->GetCurrency(str1) ) { ! eventForce("speak You do not have that much "+str1+" to exchange."); ! return 1; } if( str1 == str2 ) { ! eventForce("speak That would be pointless."); ! return 1; } if( member_array(str1, GetCurrencies()) == -1 ) { ! eventForce("speak You cannot exchange "+str1+" here."); ! return 1; } if( member_array(str2, GetCurrencies()) == -1 ) { ! eventForce("speak You cannot exchange "+str2+" here."); ! return 1; } ! //val = amount / currency_rate(str1); ! val = query_base_value(str1,amount); x = to_int( (amount * 0.01) + amount ); ! //i = to_int( val * currency_rate(str2) ); ! i = val / currency_rate(str2); if( GetExchangeFee() ) ! charge = to_int(i / (100 / GetExchangeFee())); ! else charge = 0; if( charge ) i -= charge; if( i < 1 ) { ! eventForce("speak That isn't even worth one " + str2 + "!"); ! return 1; } if( (int)who->AddCurrency(str2, i) < 0 ) { ! eventForce("speak You cannot carry that much "+str2+", " + ! (string)who->GetName()+"."); ! return 1; } who->AddCurrency(str1, -amount); who->eventPrint(sprintf("You exchange %d %s for %d %s.", ! amount, str1, i, str2)); if( charge ) ! who->eventPrint(sprintf("You were charged a fee of %d %s.", ! //GetExchangeFee(), "%", ! charge, str2) ); environment()->eventPrint((string)who->GetName()+" exchanges some "+ ! str1+" for "+str2+".", who); return 1; } ! int eventOpenAccount(object who) { if( who->GetAccountInfo( GetBankName() ) ) { ! eventForce("speak You already have an account with "+GetBankName()+", " + ! (string)who->GetName()+"!"); ! return 1; } if( (int)who->GetCurrency( GetLocalCurrency() ) < OpenFee ) { ! eventForce(" speak "+ sprintf("You must have at least %d %s to open " ! "an account at this branch of %s, %s.", GetOpenFee(), ! GetLocalCurrency(), GetBankName(), (string)who->GetName())); ! return 1; } if( OpenFee < 1 ) return 0; who->AddCurrency(GetLocalCurrency(), -OpenFee); who->AddBank(GetBankName(), GetLocalCurrency(), OpenFee); who->eventPrint(sprintf("You deposit %d %s and open an account " ! "with %s.", OpenFee, GetLocalCurrency(), GetBankName()) ); eventBalance(who); environment()->eventPrint((string)who->GetName() + " opens an " ! "account.", who); eventForce("smile "+(string)who->GetKeyName()); return 1; } ! int cmdParse(object who, string cmd, string str) { int x; ! string s1, s2, honorific; mixed err; ! if( cmd != "account" && stringp(err = CanBank(who)) ) { ! who->eventPrint(err); ! return 1; } switch(cmd) { ! case "balance" : ! return eventBalance(who); ! break; ! case "deposit" : ! if( !str ) { ! eventForce("speak How much of what?"); ! return 1; ! } ! if(str == "all") { ! if(!sizeof(this_player()->GetCurrencies())){ ! who->eventPrint("You have no money to deposit."); ! return 1; ! } ! foreach(string dinero in this_player()->GetCurrencies()){ ! if(this_player()->GetCurrency(dinero) > 0) ! eventDeposit(who, dinero, this_player()->GetCurrency(dinero)); ! } ! return 1; ! } ! sscanf(str, "%d %s", x, s1); ! if( member_array(s1, Currencies) < 0 ) { ! who->eventPrint(s1 + " is not supported here!"); ! return 1; ! } ! return eventDeposit(who, s1, x); ! break; ! case "withdraw" : ! if( !str ) { ! eventForce("speak How much of what?"); ! return 1; ! } ! if(str == "all") { ! if(this_player()->GetGender() == "female") honorific = "ma'am"; ! else honorific = "sir"; ! eventForce("speak I'm sorry, "+honorific+", but withdrawals must be specified explicitly in terms of currency type and amount."); ! return 1; ! } ! sscanf(str, "%d %s", x, s1); ! if( member_array(s1, Currencies) < 0 ) { ! who->eventPrint(s1 + " is not supported here!"); ! return 1; ! } ! return eventWithdraw(who, s1, x); ! break; ! case "exchange" : ! if( !str ) { ! eventForce("speak Exchange what for what?"); ! return 1; ! } ! sscanf(str, "%d %s for %s", x, s1, s2); ! return eventExchange(who, x, s1, s2); ! break; ! case "account" : ! return eventOpenAccount(who); ! break; ! default: ! eventForce("speak " + (string)who->GetName() + ", I do not " ! "understand what you want."); ! eventForce("whisper to " + (string)who->GetKeyName() + " Try " ! "\"help banking\" if you are confused."); ! } return 1; } diff -c -r --new-file ds1.1/lib/lib/torch.c ds2.0r27/lib/lib/torch.c *** ds1.1/lib/lib/torch.c Sun Feb 1 21:30:27 1998 --- ds2.0r27/lib/lib/torch.c Wed Jul 5 00:00:58 2006 *************** *** 1,5 **** /* /lib/torch.c ! * from the Dead Souls V Object Library * a torch-like inheritable that burns and such * created by Descartes of Borg 960512 */ --- 1,5 ---- /* /lib/torch.c ! * from the Dead Souls Object Library * a torch-like inheritable that burns and such * created by Descartes of Borg 960512 */ diff -c -r --new-file ds1.1/lib/lib/trainer.c ds2.0r27/lib/lib/trainer.c *** ds1.1/lib/lib/trainer.c Sun Feb 1 21:30:27 1998 --- ds2.0r27/lib/lib/trainer.c Wed Jul 5 00:00:58 2006 *************** *** 4,174 **** * Version: @(#) trainer.c 1.3@(#) * Last modified: 96/10/28 */ ! #include <lib.h> #include <daemons.h> #include "include/trainer.h" ! inherit LIB_SENTIENT; ! private string array TrainingSkills; private mapping Students; ! /**** driver applies ****/ ! static void create() { sentient::create(); TrainingSkills = ({}); Students = ([]); SetNoClean(1); SetCommandResponses( ([ ! ({ "train", "teach" }) : (: eventTrain :), ! "default" : (: eventHelp :), ! ]) ); } ! static void init() { string str; ! ::init(); if( !living(this_player()) ) return; str = (string)this_player()->GetKeyName(); if( Students[str] ) { ! eventForce("speak You will have to start your " ! "studies anew, "+(string)this_player()->GetName()); ! map_delete(Students, str); } } ! /**** data manipulation ****/ ! ! mixed AddTrainingSkills(string *args...) { ! if( !args || !arrayp(args) ) ! error("Bad argument 1 to AddTrainingSkills."); return (TrainingSkills = distinct_array(TrainingSkills + args)); } ! ! mixed RemoveTrainingSkills(string *args...) { if( !args || !arrayp(args) ) ! error("Bad argument 1 to RemoveTrainingSkills."); TrainingSkills -= args; return TrainingSkills; } ! string array GetTrainingSkills() { return copy(TrainingSkills); } ! mapping GetStudents() { return copy(Students); } ! /**** high-level events ****/ ! int eventHelp(object who, string unused) { ! eventForce("speak I am not sure of what you are " ! "asking " + (string)who->GetName() + "."); ! eventForce("speak My area of expertise covers " + ! conjunction(TrainingSkills) + "."); ! eventForce("speak You can \"ask "+GetKeyName()+" to teach " ! "<SKILL>\" if you have training points."); return 1; } ! int eventTrain(object who, string verb, string skill) { if( !who || environment(who) != environment() ) { return 0; } if( !sizeof(skill) || !sizeof(verb) ) return eventHelp(who, 0); ! if( verb == "train" ) { object ob = SPELLS_D->GetSpell(skill); ! if( ob ) { ! foreach(string sk in ob->GetSkills()) { ! if( GetSkillLevel(sk) < ob->GetRequiredSkill(sk) ) { ! eventForce("speak I don't know " + skill + "."); ! return 0; ! } ! } ! if( !who->eventLearnSpell(skill) ) { ! eventForce("speak You are no prepared for that spell!"); ! return 0; ! } ! who->eventPrint(GetName() + " touches your forehead and gives " ! "you knowledge of " + skill + "."); ! environment()->eventPrint(GetName() + " touches " + ! possessive_noun(who) + ! " forehead and gives " + ! objective(who) + " knowledge of " + ! skill + ".", who); ! return 1; ! } ! } ! skill = lower_case(skill); ! if( creatorp(who) ) { ! who->eventPrint("Creators do not have skills, get a life."); ! return 1; } if( Students[ (string)who->GetKeyName() ] ) { ! eventForce("speak I am already training you!"); ! return 0; } ! if( member_array(skill, TrainingSkills) == -1 ) { ! eventForce("speak I know nothing about the art of " + ! skill + "."); ! return 0; } if( member_array(skill, ! (string *)this_player()->GetSkills() ) == -1 ) { ! eventForce("speak You do not appear to be the type " ! "who would be skilled in " + skill + "!"); ! return 0; } if( (int)this_player()->GetTrainingPoints() < 1 ) { ! eventForce("speak Fool! You need training points for that!"); ! return 0; } Students[ (string)who->GetKeyName() ] = skill; eventStart(who, skill); call_out((: ContinueTraining, who, skill, 0 :), TRAINING_WAIT); return 1; } ! static int ContinueTraining(object who, string skill, int x) { if( !present(who, environment()) ) return 0; if( !Students[(string)who->GetKeyName()] ) return 0; if( x > 4 ) { ! map_delete(Students, (string)who->GetKeyName()); ! eventComplete(who, skill); ! who->eventTrain(skill, 1); ! return 1; } else { ! eventContinue(who, skill, ++x); ! call_out((: ContinueTraining, who, skill, x :), TRAINING_WAIT); ! return 1; } } ! /**** message handling events ****/ ! /* The three following events are purely *aesthetic*, * Hopefully prolific coders will override them for * more interesting training techniques. :) */ ! int eventStart(object who, string skill) { who->eventPrint(GetName() + " begins teaching you " ! "about the skill of " + skill + "."); environment()->eventPrint(GetName() + " begins teaching " + ! (string)who->GetName() + "...", who); return 1; } ! int eventContinue(object who, string skill, int x) { who->eventPrint("You listen intently as " + GetName() ! + " continues " + possessive(this_object()) ! + " dissertation on " + skill + "."); return 1; } ! int eventComplete(object who, string skill) { who->eventPrint("You feel more adept with your " + skill + "."); eventForce("speak I can teach you no more for now, " + ! (string)who->GetName() + "."); return 1; } --- 4,246 ---- * Version: @(#) trainer.c 1.3@(#) * Last modified: 96/10/28 */ ! #include <lib.h> #include <daemons.h> #include "include/trainer.h" ! inherit LIB_SENTIENT; ! private string array TrainingSkills; private mapping Students; ! int NoSpells = 0; ! ! /**** driver applies ****/ ! static void create() { sentient::create(); TrainingSkills = ({}); Students = ([]); SetNoClean(1); SetCommandResponses( ([ ! "train" : (: eventTrain :), ! "teach" : (: eventTrain :), ! "default" : (: eventHelp :), ! "help" : (: eventHelp :), ! ]) ); ! SetRequestResponses( ([ ! "help" : (: eventHelp :), ! ]) ); } ! static void init() { string str; ! sentient::init(); if( !living(this_player()) ) return; str = (string)this_player()->GetKeyName(); if( Students[str] ) { ! eventForce("speak You will have to start your " ! "studies anew, "+(string)this_player()->GetName()); ! map_delete(Students, str); } } ! ! int SetNoSpells(int i){ ! if(i) NoSpells = 1; ! else NoSpells = 0; ! return NoSpells; ! } ! ! int GetNoSpells(){ ! return NoSpells; ! } ! /**** data manipulation ****/ ! ! mixed AddTrainingSkills(string *args){ ! if( !args ) ! error("Bad argument 1 to AddTrainingSkills."); return (TrainingSkills = distinct_array(TrainingSkills + args)); } ! ! mixed RemoveTrainingSkills(string *args) { if( !args || !arrayp(args) ) ! error("Bad argument 1 to RemoveTrainingSkills."); TrainingSkills -= args; return TrainingSkills; } ! string array GetTrainingSkills() { return copy(TrainingSkills); } ! ! string Expertise(){ ! string tmp, expertises; ! string expertises2 = ""; ! mapping spellbook = this_object()->GetSpellBook(); ! ! if(!sizeof(GetTrainingSkills())) return "none"; ! else if(sizeof(GetTrainingSkills()) == 1) { ! return GetTrainingSkills()[0]; ! } ! expertises = implode(GetTrainingSkills(), ", "); ! if(sizeof(GetTrainingSkills()) == 2){ ! expertises = replace_string(expertises,", "," and "); ! } ! else if(sizeof(GetTrainingSkills()) > 2){ ! tmp = last_string_element(expertises,","); ! expertises = replace_string(expertises, tmp, " and"+tmp); ! } ! ! if(sizeof(spellbook) && !GetNoSpells()){ ! expertises2 = implode(keys(spellbook), ", "); ! if(sizeof(spellbook) == 1) expertises2 = replace_string(expertises2,", ","."); ! else if(sizeof(spellbook) == 2){ ! expertises2 = replace_string(expertises2,", "," and ",1); ! expertises2 = replace_string(expertises2,", ","."); ! } ! else { ! tmp = last_string_element(expertises2,","); ! expertises2 = replace_string(expertises2,tmp," and"+tmp); ! } ! expertises2 = ". In terms of spells, I can teach you "+expertises2; ! } ! ! return expertises + expertises2; ! } ! mapping GetStudents() { return copy(Students); } ! /**** high-level events ****/ ! int eventHelp(object who, string unused) { ! if(who) eventForce("speak I am not sure of what you are " ! "asking, " + (string)who->GetName() + "."); ! if(sizeof( GetTrainingSkills() )){ ! eventForce("speak My area of training expertise covers " + ! Expertise() + "."); ! eventForce("speak You can \"ask "+GetKeyName()+" to train " ! "<SKILL>\" if you have training points."); ! if(sizeof(this_object()->GetSpellBook()) && !GetNoSpells()){ ! eventForce("speak You can also \"ask "+GetKeyName()+ ! " to teach <SPELL>.\""); ! } ! } return 1; } ! int eventTrain(object who, string verb, string skill) { + //tc("who: "+identify(who)); + //tc("verb: "+identify(verb)); + //tc("skill: "+identify(skill)); if( !who || environment(who) != environment() ) { return 0; } + + if(who->GetLanguageLevel(this_object()->GetNativeLanguage()) < 100){ + eventForce("speak You are not fluent in my language. We can't communicate well enough for me to teach or train you anything."); + return 1; + } + if( !sizeof(skill) || !sizeof(verb) ) return eventHelp(who, 0); ! if(first(skill, 3) == "in ") skill = replace_string(skill,"in ","",1); ! if(first(skill, 6) == "me in ") skill = replace_string(skill,"me in ","",1); ! ! if( verb == "teach") { object ob = SPELLS_D->GetSpell(skill); ! if(!sizeof(GetSpellBook()) || GetNoSpells()){ ! eventForce("speak I am not able to teach spells. I only train skills."); ! this_object()->eventHelp(); ! return 0; ! } ! if(!ob){ ! eventForce("speak I've never heard of such a spell."); ! return 0; ! } ! ! if( !who->eventLearnSpell(skill) ) { ! eventForce("speak You are not prepared for that spell!"); ! return 0; ! } ! ! who->eventPrint(GetName() + " touches your forehead and gives " ! "you knowledge of " + skill + "."); ! environment()->eventPrint(GetName() + " touches " + ! possessive_noun(who) + ! " forehead and gives " + ! objective(who) + " knowledge of " + ! skill + ".", who); ! return 1; } + + if(skill) skill = lower_case(skill); + if( Students[ (string)who->GetKeyName() ] ) { ! eventForce("speak I am already training you!"); ! return 0; } ! if( member_array(skill, this_object()->GetTrainingSkills()) == -1 ) { ! eventForce("speak I know nothing about the art of " + ! skill + "."); ! return 0; } if( member_array(skill, ! (string *)this_player()->GetSkills() ) == -1 ) { ! eventForce("speak You do not appear to be the type " ! "who would be skilled in " + skill + "!"); ! eventForce("speak I cannot train you in a skill you don't know at all. You may need to join a guild or a class that enables you to train in this skill."); ! return 0; } if( (int)this_player()->GetTrainingPoints() < 1 ) { ! eventForce("speak You need more training points!"); ! return 0; } Students[ (string)who->GetKeyName() ] = skill; eventStart(who, skill); call_out((: ContinueTraining, who, skill, 0 :), TRAINING_WAIT); return 1; } ! static int ContinueTraining(object who, string skill, int x) { if( !present(who, environment()) ) return 0; if( !Students[(string)who->GetKeyName()] ) return 0; if( x > 4 ) { ! map_delete(Students, (string)who->GetKeyName()); ! eventComplete(who, skill); ! who->eventTrain(skill, 1); ! return 1; } else { ! eventContinue(who, skill, ++x); ! call_out((: ContinueTraining, who, skill, x :), TRAINING_WAIT); ! return 1; } } ! /**** message handling events ****/ ! /* The three following events are purely *aesthetic*, * Hopefully prolific coders will override them for * more interesting training techniques. :) */ ! int eventStart(object who, string skill) { who->eventPrint(GetName() + " begins teaching you " ! "about the skill of " + skill + "."); environment()->eventPrint(GetName() + " begins teaching " + ! (string)who->GetName() + "...", who); return 1; } ! int eventContinue(object who, string skill, int x) { who->eventPrint("You listen intently as " + GetName() ! + " continues " + possessive(this_object()) ! + " dissertation on " + skill + "."); return 1; } ! int eventComplete(object who, string skill) { who->eventPrint("You feel more adept with your " + skill + "."); eventForce("speak I can teach you no more for now, " + ! (string)who->GetName() + "."); return 1; } diff -c -r --new-file ds1.1/lib/lib/trap.c ds2.0r27/lib/lib/trap.c *** ds1.1/lib/lib/trap.c Sun Feb 1 21:30:27 1998 --- ds2.0r27/lib/lib/trap.c Wed Jul 5 00:00:58 2006 *************** *** 1,5 **** /* /lib/trap.c ! * From the Dead Souls V Object Library * Allows living things to be trapped and stored across reboots * Created by Descartes of Borg 961010 * Version: @(#) trap.c 1.5@(#) --- 1,5 ---- /* /lib/trap.c ! * From the Dead Souls Object Library * Allows living things to be trapped and stored across reboots * Created by Descartes of Borg 961010 * Version: @(#) trap.c 1.5@(#) *************** *** 72,94 **** } if( GetClosed() ) { return "You must open " + GetShort() + " before you can free " ! "things from it."; } return 1; } mixed eventCapture(object who, object target) { - object env = environment(target); - mixed tmp; if( !target->eventMove(this_object()) ) { return target->GetShort() + " will not fit!"; } who->eventPrint("You capture " + target->GetName() + " in " + ! GetShort() + "!"); environment(who)->eventPrint(who->GetName() + " captures " + ! target->GetName() + " in " + GetShort() + ! ".", ({ who, target })); target->eventPrint(who->GetName() + " captures you in " + GetShort() +"."); set_heart_beat(2); return 1; --- 72,92 ---- } if( GetClosed() ) { return "You must open " + GetShort() + " before you can free " ! "things from it."; } return 1; } mixed eventCapture(object who, object target) { if( !target->eventMove(this_object()) ) { return target->GetShort() + " will not fit!"; } who->eventPrint("You capture " + target->GetName() + " in " + ! GetShort() + "!"); environment(who)->eventPrint(who->GetName() + " captures " + ! target->GetName() + " in " + GetShort() + ! ".", ({ who, target })); target->eventPrint(who->GetName() + " captures you in " + GetShort() +"."); set_heart_beat(2); return 1; *************** *** 97,103 **** mixed eventEscape() { object array captives; object captive, env; ! if( GetClosed() ) { return 0; } --- 95,101 ---- mixed eventEscape() { object array captives; object captive, env; ! if( GetClosed() ) { return 0; } *************** *** 126,135 **** mixed eventFree(object who, string target) { target->eventMove(environment(who)); who->eventPrint("You release " + target->GetName() + " from " + ! GetShort() + "."); environment(who)->eventPrint(who->GetName() + " releases " + ! target->GetName() + " from " + GetShort()+".", ! ({ who, target })); target->eventPrint(who->GetName() + " releases you from " + GetShort() +"."); return 1; } --- 124,133 ---- mixed eventFree(object who, string target) { target->eventMove(environment(who)); who->eventPrint("You release " + target->GetName() + " from " + ! GetShort() + "."); environment(who)->eventPrint(who->GetName() + " releases " + ! target->GetName() + " from " + GetShort()+".", ! ({ who, target })); target->eventPrint(who->GetName() + " releases you from " + GetShort() +"."); return 1; } diff -c -r --new-file ds1.1/lib/lib/undead.c ds2.0r27/lib/lib/undead.c *** ds1.1/lib/lib/undead.c Sun Feb 1 21:30:27 1998 --- ds2.0r27/lib/lib/undead.c Wed Jul 5 00:00:58 2006 *************** *** 1,5 **** /* /lib/undead.c ! * From Dead Souls V Object Library * This differs from the NM LPmud version * copyright (c) 1995 Dead Souls LPMud * Created by Descartes of Borg 961025 --- 1,5 ---- /* /lib/undead.c ! * From Dead Souls Object Library * This differs from the NM LPmud version * copyright (c) 1995 Dead Souls LPMud * Created by Descartes of Borg 961025 *************** *** 17,23 **** string GetName(); varargs string eventPrint(string message, mixed args...); varargs int eventReceiveDamage(object agent, int type, int amt, int ins, ! mixed limbs); int eventCompleteHeal(int x); int GetHealthPoints(); int eventMoralAct(int x); --- 17,23 ---- string GetName(); varargs string eventPrint(string message, mixed args...); varargs int eventReceiveDamage(object agent, int type, int amt, int ins, ! mixed limbs); int eventCompleteHeal(int x); int GetHealthPoints(); int eventMoralAct(int x); *************** *** 68,80 **** mixed eventTurn(object who) { if( who ) { environment()->eventPrint(GetName() + " is turned from the world of " ! "the living.", this_object()); eventPrint(who->GetName() +" turns you from the world of the living."); who->eventDestroyEnemy(this_object()); } else { environment()->eventPrint(GetName() + " is turned from the world " ! "of the living.", this_object()); eventPrint("You have been turned from the world of the living."); } return 1; --- 68,80 ---- mixed eventTurn(object who) { if( who ) { environment()->eventPrint(GetName() + " is turned from the world of " ! "the living.", this_object()); eventPrint(who->GetName() +" turns you from the world of the living."); who->eventDestroyEnemy(this_object()); } else { environment()->eventPrint(GetName() + " is turned from the world " ! "of the living.", this_object()); eventPrint("You have been turned from the world of the living."); } return 1; *************** *** 82,88 **** static void heart_beat() { string type; ! if( !GetUndead() ) { return; } --- 82,88 ---- static void heart_beat() { string type; ! if( !GetUndead() ) { return; } *************** *** 91,103 **** if( type == "ghost" || type == "phantom" ) { eventPrint("You wail mournfully."); environment()->eventPrint(GetName() + " wails mournfully.", ! this_object()); } else if( type == "zombie" || type == "ghoul" ) { eventPrint("You groan painfully."); environment()->eventPrint(GetName() + " groans painfully.", ! this_object()); } } } --- 91,108 ---- if( type == "ghost" || type == "phantom" ) { eventPrint("You wail mournfully."); environment()->eventPrint(GetName() + " wails mournfully.", ! this_object()); } else if( type == "zombie" || type == "ghoul" ) { eventPrint("You groan painfully."); environment()->eventPrint(GetName() + " groans painfully.", ! this_object()); } } } + int GetGhost(){ + if(GetUndeadType() == "ghost") return 1; + else return 0; + } + diff -c -r --new-file ds1.1/lib/lib/user/autosave.c ds2.0r27/lib/lib/user/autosave.c *** ds1.1/lib/lib/user/autosave.c Sun Feb 1 21:30:10 1998 --- ds2.0r27/lib/lib/user/autosave.c Wed Jul 5 00:01:05 2006 *************** *** 23,30 **** nomask void save_player(string nom); int Setup() { - object ob; - int i; master()->create_save(); call_out( (: save_player, GetKeyName() :), 2 ); --- 23,28 ---- *************** *** 34,44 **** nomask void restore_inventory() { if( Inventory ) { ! foreach(string obdata in Inventory) { object ob; mixed tmp; ! ! tmp = restore_variable(obdata); if( arrayp(tmp) ) { ob = new(tmp[0]); if( ob ) ob->eventConvertObject(tmp, 1); --- 32,42 ---- nomask void restore_inventory() { if( Inventory ) { ! foreach(string obdata in Inventory) { object ob; mixed tmp; ! ! tmp = restore_variable(obdata); if( arrayp(tmp) ) { ob = new(tmp[0]); if( ob ) ob->eventConvertObject(tmp, 1); *************** *** 50,56 **** } } } ! } } Inventory = 0; } --- 48,54 ---- } } } ! } } Inventory = 0; } *************** *** 72,78 **** return; } Inventory = filter(map(all_inventory(), (: $1->GetSaveString() :)), ! (: $1 :)); file = save_file(GetKeyName()); unguarded((: save_object, file, 1 :)); Inventory = 0; --- 70,76 ---- return; } Inventory = filter(map(all_inventory(), (: $1->GetSaveString() :)), ! (: $1 :)); file = save_file(GetKeyName()); unguarded((: save_object, file, 1 :)); Inventory = 0; *************** *** 86,92 **** } LastSave = x; save_player(GetKeyName()); ! if( !creatorp(this_object()) ) { eventPrint("Autosaving...", MSG_SYSTEM); } } --- 84,90 ---- } LastSave = x; save_player(GetKeyName()); ! if( !creatorp(this_object()) && !present("visitor pass",this_object()) ) { eventPrint("Autosaving...", MSG_SYSTEM); } } diff -c -r --new-file ds1.1/lib/lib/verb.c ds2.0r27/lib/lib/verb.c *** ds1.1/lib/lib/verb.c Sun Feb 1 21:30:27 1998 --- ds2.0r27/lib/lib/verb.c Wed Jul 5 00:00:58 2006 *************** *** 1,5 **** /* /lib/verb.c ! * From the Dead Souls V Object Library * An inheritable for creating verbs * Created by Descartes of Borg 960116 * Version: @(#) verb.c 1.2@(#) --- 1,5 ---- /* /lib/verb.c ! * From the Dead Souls Object Library * An inheritable for creating verbs * Created by Descartes of Borg 960116 * Version: @(#) verb.c 1.2@(#) *************** *** 38,44 **** if( Verb ) { foreach(string rule in Rules) parse_add_rule(Verb, rule); if( sizeof(Synonyms) ) ! foreach(string cmd in Synonyms) parse_add_synonym(cmd, Verb); } return Rules; } --- 38,44 ---- if( Verb ) { foreach(string rule in Rules) parse_add_rule(Verb, rule); if( sizeof(Synonyms) ) ! foreach(string cmd in Synonyms) parse_add_synonym(cmd, Verb); } return Rules; } *************** *** 52,58 **** else Synonyms += arg; } if( Verb && sizeof(Rules) ) ! foreach(string cmd in Synonyms) parse_add_synonym(cmd, Verb); return Synonyms; } --- 52,58 ---- else Synonyms += arg; } if( Verb && sizeof(Rules) ) ! foreach(string cmd in Synonyms) parse_add_synonym(cmd, Verb); return Synonyms; } *************** *** 62,70 **** if( !stringp(str) ) error("Bad argument 1 to SetVerb().\n"); Verb = str; if( sizeof(Rules) ) ! foreach(string rule in Rules) parse_add_rule(Verb, rule); if( sizeof(Synonyms) ) ! foreach(string cmd in Synonyms) parse_add_synonym(cmd, Verb); return Verb; } --- 62,70 ---- if( !stringp(str) ) error("Bad argument 1 to SetVerb().\n"); Verb = str; if( sizeof(Rules) ) ! foreach(string rule in Rules) parse_add_rule(Verb, rule); if( sizeof(Synonyms) ) ! foreach(string cmd in Synonyms) parse_add_synonym(cmd, Verb); return Verb; } diff -c -r --new-file ds1.1/lib/lib/virtual/virt_land.c ds2.0r27/lib/lib/virtual/virt_land.c *** ds1.1/lib/lib/virtual/virt_land.c Wed Mar 10 21:52:21 1999 --- ds2.0r27/lib/lib/virtual/virt_land.c Wed Jul 5 00:01:05 2006 *************** *** 25,31 **** /******************* virt_land.c required overrides ***********/ ! void SetLongAndItems(int x, int y, int z) { SetVirtualExits(x, y, z); } --- 25,31 ---- /******************* virt_land.c required overrides ***********/ ! varargs void SetLongAndItems(int x, int y, int z) { SetVirtualExits(x, y, z); } *************** *** 33,54 **** int SetMasterMap(mixed map_name){ if(!stringp(map_name) && !objectp(map_name)){ ! error("Bad argument 1 to SetMasterMap()\n\t" ! "Expected: string or object, Got: " + typeof(map_name) ! + "."); ! return 0; } if(stringp(map_name)){ ! if( !(Map_Master = find_object(map_name)) ) { ! string str; ! if( str = catch(call_other(map_name, "???")) ) { ! if( creatorp() ) message("error", str, ! previous_object()); ! return 0; ! } ! Map_Master = find_object(map_name); ! } } else Map_Master=map_name; --- 33,54 ---- int SetMasterMap(mixed map_name){ if(!stringp(map_name) && !objectp(map_name)){ ! error("Bad argument 1 to SetMasterMap()\n\t" ! "Expected: string or object, Got: " + typeof(map_name) ! + "."); ! return 0; } if(stringp(map_name)){ ! if( !(Map_Master = load_object(map_name)) ) { ! string str; ! if( str = catch(call_other(map_name, "???")) ) { ! if( creatorp() ) message("error", str, ! previous_object()); ! return 0; ! } ! Map_Master = load_object(map_name); ! } } else Map_Master=map_name; *************** *** 59,66 **** int SetVirtFile( string file ){ string str; if( str = catch(call_other(file, "???")) ) { ! if( creatorp() ) message("error", str, previous_object()); ! return 0; } Virt_Room=file; SetMasterMap( file ); --- 59,66 ---- int SetVirtFile( string file ){ string str; if( str = catch(call_other(file, "???")) ) { ! if( creatorp() ) message("error", str, previous_object()); ! return 0; } Virt_Room=file; SetMasterMap( file ); *************** *** 83,160 **** mapping GetDirectionMap(){ return (["north":({-1,0,0}),"south":({1,0,0}), ! "east":({0,1,0}),"west":({0,-1,0}), ! "northeast":({-1,1,0}),"northwest":({-1,-1,0}), ! "southeast":({1,1,0}),"southwest":({1,-1,0}), ! "up":({0,0,-1}),"down":({0,0,1}) ]); } string GetReverseDirection(string dir){ return (["north":"south","south":"north", ! "east":"west","west":"east", ! "northeast":"southwest","northwest":"southeast", ! "southeast":"northwest","southwest":"northeast", ! "up":"down","down":"up" ])[dir]; } varargs mixed GetMapType(int x, int y, int z){ if(!objectp(Map_Master) || nullp(x) ||nullp(y) || nullp(z) ) ! return 0; return Map_Master->GetAreaMap(x,y,z); } mapping SetSurroundAreas(int x, int y, int z){ mapping surrounds = ([]); foreach(string dir, int * offset in GetDirectionMap()) ! surrounds[dir] = GetMapType((x + offset[1]), ! (y + offset[0]),(z + offset[2])); return Surrounding_Areas=surrounds; } void ResetSurroundExits(){ foreach(string dir, string atype in Surrounding_Areas){ ! if(atype != "0" && atype != "@"){ ! (Virt_Room + "/" ! + ( CoordX + GetDirectionMap()[dir][1]) + "," ! + ( CoordY + GetDirectionMap()[dir][0]) + "," ! + ( CoordZ + GetDirectionMap()[dir][2]))->ResetLocation(); ! } } } ! void SetVirtualExits(int x, int y, int z){ if(sizeof(Virt_Room)){ ! string * obexits=({}); ! SetSurroundAreas(x,y,z); ! foreach(string dir, string atype in Surrounding_Areas){ ! if(atype != "0" && atype != "@"){ ! AddExit(dir,Virt_Room+"/" ! + ( x + GetDirectionMap()[dir][1])+"," ! + ( y + GetDirectionMap()[dir][0])+ "," ! + ( z + GetDirectionMap()[dir][2])); ! obexits += ({dir[0..0]+dir[5..5]}); ! } ! else if( atype == "@"){ ! mixed exit = ! Map_Master->GetExternalRoom( ! sprintf("%d,%d,%d", ! ( x + GetDirectionMap()[dir][1]), ! ( y + GetDirectionMap()[dir][0]), ! ( z + GetDirectionMap()[dir][2])), ! sprintf("%d,%d,%d",x,y,z) ! ); ! if(exit){ ! AddExit(dir, exit); ! obexits += ({dir[0..0]+dir[5..5]}); ! } ! } ! } ! SetObviousExits(implode(obexits,", ")); ! AreaType = GetMapType(x,y,z); } } --- 83,160 ---- mapping GetDirectionMap(){ return (["north":({-1,0,0}),"south":({1,0,0}), ! "east":({0,1,0}),"west":({0,-1,0}), ! "northeast":({-1,1,0}),"northwest":({-1,-1,0}), ! "southeast":({1,1,0}),"southwest":({1,-1,0}), ! "up":({0,0,-1}),"down":({0,0,1}) ]); } string GetReverseDirection(string dir){ return (["north":"south","south":"north", ! "east":"west","west":"east", ! "northeast":"southwest","northwest":"southeast", ! "southeast":"northwest","southwest":"northeast", ! "up":"down","down":"up" ])[dir]; } varargs mixed GetMapType(int x, int y, int z){ if(!objectp(Map_Master) || nullp(x) ||nullp(y) || nullp(z) ) ! return 0; return Map_Master->GetAreaMap(x,y,z); } mapping SetSurroundAreas(int x, int y, int z){ mapping surrounds = ([]); foreach(string dir, int * offset in GetDirectionMap()) ! surrounds[dir] = GetMapType((x + offset[1]), ! (y + offset[0]),(z + offset[2])); return Surrounding_Areas=surrounds; } void ResetSurroundExits(){ foreach(string dir, string atype in Surrounding_Areas){ ! if(atype != "0" && atype != "@"){ ! (Virt_Room + "/" ! + ( CoordX + GetDirectionMap()[dir][1]) + "," ! + ( CoordY + GetDirectionMap()[dir][0]) + "," ! + ( CoordZ + GetDirectionMap()[dir][2]))->ResetLocation(); ! } } } ! void SetVirtualExits(int x, int y, int z){ if(sizeof(Virt_Room)){ ! string * obexits=({}); ! SetSurroundAreas(x,y,z); ! foreach(string dir, string atype in Surrounding_Areas){ ! if(atype != "0" && atype != "@"){ ! AddExit(dir,Virt_Room+"/" ! + ( x + GetDirectionMap()[dir][1])+"," ! + ( y + GetDirectionMap()[dir][0])+ "," ! + ( z + GetDirectionMap()[dir][2])); ! obexits += ({dir[0..0]+dir[5..5]}); ! } ! else if( atype == "@"){ ! mixed exit = ! Map_Master->GetExternalRoom( ! sprintf("%d,%d,%d", ! ( x + GetDirectionMap()[dir][1]), ! ( y + GetDirectionMap()[dir][0]), ! ( z + GetDirectionMap()[dir][2])), ! sprintf("%d,%d,%d",x,y,z) ! ); ! if(exit){ ! AddExit(dir, exit); ! obexits += ({dir[0..0]+dir[5..5]}); ! } ! } ! } ! SetObviousExits(implode(obexits,", ")); ! AreaType = GetMapType(x,y,z); } } *************** *** 163,171 **** varargs mixed GetCoordinates(int level) { if(nullp(level)) return ({ CoordX, CoordY, CoordZ }); else switch(level){ ! case 0: return CoordX; ! case 1: return CoordY; ! case 2: return CoordZ; } return 0; } --- 163,171 ---- varargs mixed GetCoordinates(int level) { if(nullp(level)) return ({ CoordX, CoordY, CoordZ }); else switch(level){ ! case 0: return CoordX; ! case 1: return CoordY; ! case 2: return CoordZ; } return 0; } *************** *** 197,206 **** SetVirtualExits(CoordX,CoordY,CoordZ); SetLongAndItems(CoordX,CoordY,CoordZ); if(Reset_Message){ ! string ret; ! eventPrint(Reset_Message); ! if(sizeof(objects=filter(objects,(:playerp:)))) ! objects->eventDescribeEnvironment(0); } } --- 197,206 ---- SetVirtualExits(CoordX,CoordY,CoordZ); SetLongAndItems(CoordX,CoordY,CoordZ); if(Reset_Message){ ! string ret; ! eventPrint(Reset_Message); ! if(sizeof(objects=filter(objects,(:playerp:)))) ! objects->eventDescribeEnvironment(0); } } diff -c -r --new-file ds1.1/lib/lib/virtual/virt_map.c ds2.0r27/lib/lib/virtual/virt_map.c *** ds1.1/lib/lib/virtual/virt_map.c Wed Mar 10 21:52:51 1999 --- ds2.0r27/lib/lib/virtual/virt_map.c Wed Jul 5 00:01:05 2006 *************** *** 17,30 **** /******************* virt_map.c required overrides ************/ varargs string array BaseMap(){ //override with actual map ! return ! ({ ! // 0 ! // 012 ! ({"000",//0 ! "010",//1 ! "000",//2 ! })}); } /******************* virt_map.c attributes ********************/ --- 17,30 ---- /******************* virt_map.c required overrides ************/ varargs string array BaseMap(){ //override with actual map ! return ! ({ ! // 0 ! // 012 ! ({"000",//0 ! "010",//1 ! "000",//2 ! })}); } /******************* virt_map.c attributes ********************/ *************** *** 32,138 **** int *GetLocations(string str){return Location[str]; } varargs mixed GetAreaMap(int x, int y, int z){ ! if(nullp(x) || nullp(y) || nullp(z)) return copy(AreaMap); ! if( x<0 ! || y<0 ! || z<0 ! || z>sizeof(AreaMap) ! || y>sizeof(AreaMap[0]) ! || x>sizeof(AreaMap[0][0])) ! return "0"; ! return copy(AreaMap[z][y][x..x]); } varargs mixed SetAreaMap(int y,int x ,int z, string str){ ! if(nullp(x)||nullp(y)||nullp(z)){ ! string x_line=""; ! string * y_line=({}); ! AreaMap=BaseMap(); ! z=sizeof(AreaMap); ! y=sizeof(AreaMap[0]); ! x=sizeof(AreaMap[0][0]); ! while (x --) x_line += "0"; ! while (y --) y_line += ({x_line}); ! return AreaMap = ({y_line}) +AreaMap + ({y_line}); ! } ! else return AreaMap[z][y][x..x]=str; } int SetVirtFile( string file){ string str; if( str = catch(call_other(file, "???")) ) { ! if( creatorp() ) message("error", str, previous_object()); ! return 0; ! } ! Virt_Room=file+"/"; ! SetAreaMap(); ! return 1; } /******************* virt_map.c events ************************/ int * RecurseLocations(){ ! mixed map=GetAreaMap(); ! int *locat; ! int z=random(sizeof(map)-2)+1; ! int y=random(sizeof(map[z])); ! int x=random(sizeof(map[z][y])); ! ! if(map[z][y][x..x]!="1") ! return RecurseLocations(); // Is it within the general land? ! foreach(string tmp in keys(Location)){ //Is something else here? ! locat=Location[tmp]; ! if(locat[0]==x && locat[1]==y && locat[2]==z) ! return RecurseLocations(); ! } ! return ({x,y,z}); } varargs void InitializeLocations(string tmp){ ! if(!nullp(tmp)){ ! if(!Location[tmp][0] && !Location[tmp][1] ! && !Location[tmp][2]) ! Location[tmp]=RecurseLocations(); ! SetAreaMap(Location[tmp][1], Location[tmp][0], ! Location[tmp][2], tmp); ! (Virt_Room+(Location[tmp][0] ) + "," ! + (Location[tmp][1]) + "," ! + (Location[tmp][2]))->ResetLocation(); } else foreach(tmp in keys(Location)){ ! Location[tmp]=RecurseLocations(); ! SetAreaMap(Location[tmp][1], Location[tmp][0], ! Location[tmp][2], tmp); ! (Virt_Room+(Location[tmp][0] ) + "," + (Location[tmp][1]) ! + "," +(Location[tmp][2]))->ResetLocation(); ! } } // call this if all the locations randomly move around void SwitchLocations(){ ! int * old_location; ! mixed areas=BaseMap(); ! foreach(string tmp in keys(Location)){ ! if(Location[tmp][3]) continue; ! old_location=copy(Location[tmp]); ! Location[tmp]=({0,0,0}); ! SetAreaMap(old_location[1], old_location[0], ! old_location[2], areas[(old_location[2]-1)] ! [old_location[1]][old_location[0]..old_location[0]]); ! Location[tmp]=RecurseLocations(); ! (Virt_Room + (old_location[0]) + "," ! + (old_location[1]) + "," ! + (old_location[2]))->ResetLocation(); ! SetAreaMap(Location[tmp][1], Location[tmp][0], ! old_location[2], tmp); ! (Virt_Room + (Location[tmp][0] ) + "," ! + (Location[tmp][1]) + "," ! + (old_location[2]))->ResetLocation(); ! } } /******************* virt_map.c driver applies ****************/ --- 32,138 ---- int *GetLocations(string str){return Location[str]; } varargs mixed GetAreaMap(int x, int y, int z){ ! if(nullp(x) || nullp(y) || nullp(z)) return copy(AreaMap); ! if( x<0 ! || y<0 ! || z<0 ! || z>sizeof(AreaMap) ! || y>sizeof(AreaMap[0]) ! || x>sizeof(AreaMap[0][0])) ! return "0"; ! return copy(AreaMap[z][y][x..x]); } varargs mixed SetAreaMap(int y,int x ,int z, string str){ ! if(nullp(x)||nullp(y)||nullp(z)){ ! string x_line=""; ! string * y_line=({}); ! AreaMap=BaseMap(); ! z=sizeof(AreaMap); ! y=sizeof(AreaMap[0]); ! x=sizeof(AreaMap[0][0]); ! while (x --) x_line += "0"; ! while (y --) y_line += ({x_line}); ! return AreaMap = ({y_line}) +AreaMap + ({y_line}); ! } ! else return AreaMap[z][y][x..x]=str; } int SetVirtFile( string file){ string str; if( str = catch(call_other(file, "???")) ) { ! if( creatorp() ) message("error", str, previous_object()); ! return 0; ! } ! Virt_Room=file+"/"; ! SetAreaMap(); ! return 1; } /******************* virt_map.c events ************************/ int * RecurseLocations(){ ! mixed map=GetAreaMap(); ! int *locat; ! int z=random(sizeof(map)-2)+1; ! int y=random(sizeof(map[z])); ! int x=random(sizeof(map[z][y])); ! ! if(map[z][y][x..x]!="1") ! return RecurseLocations(); // Is it within the general land? ! foreach(string tmp in keys(Location)){ //Is something else here? ! locat=Location[tmp]; ! if(locat[0]==x && locat[1]==y && locat[2]==z) ! return RecurseLocations(); ! } ! return ({x,y,z}); } varargs void InitializeLocations(string tmp){ ! if(!nullp(tmp)){ ! if(!Location[tmp][0] && !Location[tmp][1] ! && !Location[tmp][2]) ! Location[tmp]=RecurseLocations(); ! SetAreaMap(Location[tmp][1], Location[tmp][0], ! Location[tmp][2], tmp); ! (Virt_Room+(Location[tmp][0] ) + "," ! + (Location[tmp][1]) + "," ! + (Location[tmp][2]))->ResetLocation(); } else foreach(tmp in keys(Location)){ ! Location[tmp]=RecurseLocations(); ! SetAreaMap(Location[tmp][1], Location[tmp][0], ! Location[tmp][2], tmp); ! (Virt_Room+(Location[tmp][0] ) + "," + (Location[tmp][1]) ! + "," +(Location[tmp][2]))->ResetLocation(); ! } } // call this if all the locations randomly move around void SwitchLocations(){ ! int * old_location; ! mixed areas=BaseMap(); ! foreach(string tmp in keys(Location)){ ! if(Location[tmp][3]) continue; ! old_location=copy(Location[tmp]); ! Location[tmp]=({0,0,0}); ! SetAreaMap(old_location[1], old_location[0], ! old_location[2], areas[(old_location[2]-1)] ! [old_location[1]][old_location[0]..old_location[0]]); ! Location[tmp]=RecurseLocations(); ! (Virt_Room + (old_location[0]) + "," ! + (old_location[1]) + "," ! + (old_location[2]))->ResetLocation(); ! SetAreaMap(Location[tmp][1], Location[tmp][0], ! old_location[2], tmp); ! (Virt_Room + (Location[tmp][0] ) + "," ! + (Location[tmp][1]) + "," ! + (old_location[2]))->ResetLocation(); ! } } /******************* virt_map.c driver applies ****************/ *************** *** 151,174 **** // where==({0,0,0}) will randomly place the location int AddLocation(string str, int array where){ ! if(!nullp(Location[str])) return 0; ! Location[str]=where; ! InitializeLocations(str); ! return 1; } int RemoveLocation(string str){ ! int * location=Location[str]; ! mixed areas=BaseMap(); ! if(nullp(location)) return 0; ! SetAreaMap(location[1],location[0],location[2], ! areas[(location[2]-1)][location[1]] ! [location[0]..location[0]]); ! (Virt_Room + (location[0] ) + "," ! + (location[1]) + "," ! + (location[2]))->ResetLocation(); ! map_delete(Location,str); ! return 1; } --- 151,174 ---- // where==({0,0,0}) will randomly place the location int AddLocation(string str, int array where){ ! if(!nullp(Location[str])) return 0; ! Location[str]=where; ! InitializeLocations(str); ! return 1; } int RemoveLocation(string str){ ! int * location=Location[str]; ! mixed areas=BaseMap(); ! if(nullp(location)) return 0; ! SetAreaMap(location[1],location[0],location[2], ! areas[(location[2]-1)][location[1]] ! [location[0]..location[0]]); ! (Virt_Room + (location[0] ) + "," ! + (location[1]) + "," ! + (location[2]))->ResetLocation(); ! map_delete(Location,str); ! return 1; } diff -c -r --new-file ds1.1/lib/lib/virtual/virt_sky.c ds2.0r27/lib/lib/virtual/virt_sky.c *** ds1.1/lib/lib/virtual/virt_sky.c Wed Mar 10 21:53:22 1999 --- ds2.0r27/lib/lib/virtual/virt_sky.c Wed Jul 5 00:01:05 2006 *************** *** 76,86 **** mixed eventFly(object who, string dir) { mapping exit = GetExitData(dir); ! if( GetDoor(dir) && GetDoor(dir)->GetClosed() ) { who->eventPrint("You fly into " + GetDoor(dir)->GetShort(dir) + "."); eventPrint(who->GetName() + " flies into " + ! GetDoor(dir)->GetShort(dir) + ".", who); return 1; } if( exit["pre"] && !evaluate(exit["pre"], dir) ) { --- 76,86 ---- mixed eventFly(object who, string dir) { mapping exit = GetExitData(dir); ! if( GetDoor(dir) && GetDoor(dir)->GetClosed() ) { who->eventPrint("You fly into " + GetDoor(dir)->GetShort(dir) + "."); eventPrint(who->GetName() + " flies into " + ! GetDoor(dir)->GetShort(dir) + ".", who); return 1; } if( exit["pre"] && !evaluate(exit["pre"], dir) ) { *************** *** 104,110 **** mixed eventReceiveObject(object ob) { int x = ob->GetLift(); mixed rtn; ! rtn = virt_land::eventReceiveObject(ob); if(GetMedium() != MEDIUM_AIR) return rtn; if( !ob->CanFly() ) { // Things that cannot fly fall down --- 104,110 ---- mixed eventReceiveObject(object ob) { int x = ob->GetLift(); mixed rtn; ! rtn = virt_land::eventReceiveObject(ob); if(GetMedium() != MEDIUM_AIR) return rtn; if( !ob->CanFly() ) { // Things that cannot fly fall down *************** *** 117,126 **** } else { string short; ! if( !ob->GetInvis() && (short = ob->GetShort()) ) { GetGround()->eventPrint(capitalize(short) + " comes raining " ! "down from the sky."); } ob->eventMove(GetGround()); } --- 117,126 ---- } else { string short; ! if( !ob->GetInvis() && (short = ob->GetShort()) ) { GetGround()->eventPrint(capitalize(short) + " comes raining " ! "down from the sky."); } ob->eventMove(GetGround()); } diff -c -r --new-file ds1.1/lib/lib/virtual/virt_std.c ds2.0r27/lib/lib/virtual/virt_std.c *** ds1.1/lib/lib/virtual/virt_std.c Wed Mar 10 21:53:52 1999 --- ds2.0r27/lib/lib/virtual/virt_std.c Wed Jul 5 00:01:05 2006 *************** *** 16,24 **** int i, j; if(fname == recursed){ ! recursed = ""; ! error("Recursion error in CreateVirtualObject()"); ! return 0; } i = strsrch(fname, "/", -1); --- 16,24 ---- int i, j; if(fname == recursed){ ! recursed = ""; ! error("Recursion error in CreateVirtualObject()"); ! return 0; } i = strsrch(fname, "/", -1); *************** *** 27,42 **** } tmp = fname[(i+1)..]; if( sscanf(tmp, "%d,%d,%d,%d", x, y, z, s) != 4 ) { ! if( sscanf(tmp, "%d,%d,%d", x, y, z) != 3 ) { ! if( sscanf(tmp, "%d,%d", x, y) != 2 ) { ! vname = tmp; } else { ! vname = 0; ! z = 0; } ! } ! s = 0; } else { vname = 0; --- 27,42 ---- } tmp = fname[(i+1)..]; if( sscanf(tmp, "%d,%d,%d,%d", x, y, z, s) != 4 ) { ! if( sscanf(tmp, "%d,%d,%d", x, y, z) != 3 ) { ! if( sscanf(tmp, "%d,%d", x, y) != 2 ) { ! vname = tmp; } else { ! vname = 0; ! z = 0; } ! } ! s = 0; } else { vname = 0; *************** *** 50,57 **** return daemon->CreateNamedObject(vname); } else { ! if(!s) return daemon->CreateGridObject(x, y, z); ! else return daemon->CreateGridObject(x, y, z, s); } } --- 50,57 ---- return daemon->CreateNamedObject(vname); } else { ! if(!s) return daemon->CreateGridObject(x, y, z); ! else return daemon->CreateGridObject(x, y, z, s); } } diff -c -r --new-file ds1.1/lib/log/domain_stats ds2.0r27/lib/log/domain_stats *** ds1.1/lib/log/domain_stats Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/log/domain_stats Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,5 ---- + town 0 0 + default 0 0 + Ylsrim 0 0 + BACKBONE 0 0 + NONAME 0 0 diff -c -r --new-file ds1.1/lib/news/admin ds2.0r27/lib/news/admin *** ds1.1/lib/news/admin Fri Jan 3 23:11:56 1997 --- ds2.0r27/lib/news/admin Wed Jul 5 00:00:58 2006 *************** *** 1,2 **** --- 1,40 ---- Admin news /news/admin + + ADMIN: + + * To change your mud's name, use the command: admintool + and select the "driver" menu. Do the same for port number. + + * To make someone else an assistant admin also use admintool. + Select groups, and modify the assist group. + + * DO NOT try to modify mudos.cfg or groups.cfg unless you know + what you're doing. IF you do try, be sure to back up the originals. + + * To know what players can do, type: + + read handbook + + * To know what creators can do, type: + + read manual + + * And you really, really have to read chapters 31 through 38 of the + manual. They are not long chapters, and you will be very happy + you did. + + * You now have an intermud channel available by default. If you + see something like: + + Cratylus@Dead Souls %^BLUE%^<ds>%^RESET%^ Hi there! + + Don't be surprised. "ds" is an intermud communication channel + between Dead Souls muds. To chat, type: + + ds blah blah + + It's new, so don't expect an answer right away. + + * To read this information again, type: news admin + diff -c -r --new-file ds1.1/lib/news/creator ds2.0r27/lib/news/creator *** ds1.1/lib/news/creator Fri Jan 3 23:11:56 1997 --- ds2.0r27/lib/news/creator Wed Jul 5 00:00:58 2006 *************** *** 1,2 **** --- 1,20 ---- Creator news /news/creator + + + Dead Souls Admin FAQ: http://dead-souls.net/ds-admin-faq.html + + Dead Souls Creator FAQ: http://dead-souls.net/ds-creator-faq.html + + Editor tutorial: http://dead-souls.net/editor.html + + + The Creators Manual has been updated and revised! + There is a sweet new section on the Quick Creation System. + Starting with chapter 31, there are chapters now on how to + create things superfast, supereasy. + To get started with the first QCS chapter, the command is: + + read chapter 31 in manual + + diff -c -r --new-file ds1.1/lib/news/deadsouls ds2.0r27/lib/news/deadsouls *** ds1.1/lib/news/deadsouls Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/news/deadsouls Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,14 ---- + + __ \ | ___| | + | | _ \ _` | _` | \___ \ _ \ | | | __| + | | __/ ( | ( | | ( | | | | \__ \ + ____/ \___| \__,_| \__,_| _____/ \___/ \__,_| _| ____/ + The Dead Souls Development and Demo MUD + + This software is copyrighted and not GPL. + * Intermud channels are restricted here * + ---------------------------------------------------------- + *-> This demo MUD grants creator powers to guests. The <-* + *-> regular, downloadable version does not do this. <-* + ---------------------------------------------------------- + For more info: http://dead-souls.net/ diff -c -r --new-file ds1.1/lib/news/general ds2.0r27/lib/news/general *** ds1.1/lib/news/general Fri Jan 3 23:11:56 1997 --- ds2.0r27/lib/news/general Wed Jul 5 00:00:58 2006 *************** *** 1,3 **** --- 1,12 ---- General news /news/general + * To enable colored text, type: + + terminal ansi + + * New characters have the new Players Handbook. It's not that + long, and it's super helpful. To get started, type: + + read handbook + diff -c -r --new-file ds1.1/lib/news/hints.txt ds2.0r27/lib/news/hints.txt *** ds1.1/lib/news/hints.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/news/hints.txt Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,98 ---- + CREATOR TIPS + + * For details on the Quick Creation System: + http://dead-souls.net/example.html + + * If you get stuck in the editor type a single dot on + a blank line, then enter, then Q, then enter, like this: + + . + Q + + + * Admins: there is a new command: admintool + It is a menu-driven system that will make your + life easier and simplify tasks like locking + the mud, changing the mud's name, creating new + currency, the works. + + + * Edit .plan in your homedir to let others + know what you're working on. You can see other + people's plans when you finger them. + + + * You can test how functions work without having to + code a command or object. The "eval" command will let + you evaluate functions. For example: + ------------------------ + eval return this_player()->GetName() + eval return find_player("cratylus") + eval return present("sword",find_player("testylus"))->GetClass() + ------------------------ + + + * The "boards" command will tell you which chat boards + have posts you have not read. + + + * Navigate and manipulate your files and directories + with the standard unix commands: ls, cd, cp, mv, more, + ed, grep. Be careful: just like in unix, if you delete + a mud file, it is gone for good. + + + * To toggle chat channels on and off, just type the + channel name. If you're listening to intergossip, for + example, you can turn it off by just typing: intergossip + + + * Use test characters. If you test stuff on yourself and + screw up your character file, you will be sad. + + + * To create good code, you should look at what people + have already done. Look in /domains/town and + /domains/default and you'll find some examples. Copy some + to your home directory and use them as templates for + your own creations. + + + * Remember that once you finish editing a file, you + have to use the "update" command to load it into memory. + If you change a file you've already updated, you have + to update it again for the changes to take effect. + + + * If you get errors when you try to update a file, use + the "elog" command to get clues as to what is wrong. + Most of the time it is something simple, like using "=" + where you meant to use "==" or forgetting a semicolon. + The LPC programming language does not forgive typoes any + more than any other programming language. + + + * Before changing a file, make a backup copy, for + example: cp file.c file.bak This way, if your changes + really cause a problem, you can easily restore things + to the way they used to be. + + + * The admins and elders are here to help and answer + questions. But remember: if your request is basically + "fix my workroom!" or "fix my code!", your request will + probably wind up at the bottom of the priority list. We + want you to learn to solve coding problems, and fixing + your code for you isn't the best way to make that happen. + However, we're happy to look over your code and make suggestions. + + + * Permissions and privileges: For security reasons, all creators + do not have read/write access to everything. You can read and + write any file in your home directory. You only have write + permissions within your home directory and the /tmp + directory. You can read everything outside the /realms and + /secure directories. You can't read anything + in other creators' home dirs. Your read access to some items + in the /secure directory is limited. + If you're full admin, of course, you have full access to everything. diff -c -r --new-file ds1.1/lib/news/reminders.txt ds2.0r27/lib/news/reminders.txt *** ds1.1/lib/news/reminders.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/news/reminders.txt Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,70 ---- + CREATOR CHEAT SHEET + + make a new room named test1.c south of here: + create room south test1 + + make a new weapon named hammer_5.c: + create weapon hammer_5.c + + make the new weapon respond to the name "hammer": + modify weapon keyname hammer + + change the hammer's short description to "The Silver Hammer of Thor": + modify hammer short The Silver Hammer of Thor + + Edit a file: + ed <file> + + Load a file: + update <file> + + Copy a file: + cp <filename1> <filename2> + + Rename a file: + mv <filename1> <filename2> + + Delete a file: + rm <file> + + Make an object appear in your inventory: + clone <file> + example: clone /domains/campus/obj/key.c + + Look at the contents of a file: + more <file> + example: more /domains/campus/obj/key.c + + Destroy an object: + dest <object> + example: dest key + NOTE: Desting players or other creators is extremely rude. + + Look in your current directory (your current folder): + ls + + Find out what directory you're in: + pwd + + Change to a different directory: + cd <directory> + example: cd /domains/town/room + + Go to your workroom: + home + + Go to the Creators' Hall + wiz + + Go to another person or place + goto <person> + goto <filename> + examples: + goto cratylus + goto /domains/town/room/basement + + Get details about other people's location and activity: + people + + Bring another person to your location: + trans <person> diff -c -r --new-file ds1.1/lib/news/welcome ds2.0r27/lib/news/welcome *** ds1.1/lib/news/welcome Fri Jan 3 23:12:53 1997 --- ds2.0r27/lib/news/welcome Wed Jul 5 00:00:58 2006 *************** *** 1,10 **** - The Nightmare Object Library - Version 4.6 for MudOS v22b25 - Copyright (c) 1992-1997 George Reese ! Please read the license agreement in /doc/mudlib/Agreement ! Use of the Nightmare Object Library signifies acceptance of these terms ! Nightmare documentation is located at http://www.imaginary.com/LPC/Nightmare ! NOTE: This is a beta product --- 1,6 ---- ! The Dead Souls Object Library version 2 ! This software is copyrighted and not GPL. ! For more info: http://dead-souls.net diff -c -r --new-file ds1.1/lib/obj/README ds2.0r27/lib/obj/README *** ds1.1/lib/obj/README Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/obj/README Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,12 ---- + The /obj directory contains files required by lib + systems. Removing this directory or its contents, + or modifying its contents may generate unexpected + behavior from your mud. + + Do not try to use these objects directly, and do not + copy them into your area directories as templates. + QCS uses these rooms in very special ways, and having them + in your area directories may confuse it and give you + errors you don't understand. + + diff -c -r --new-file ds1.1/lib/obj/area_room.c ds2.0r27/lib/obj/area_room.c *** ds1.1/lib/obj/area_room.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/obj/area_room.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + #include <rooms.h> + + #include "../../customdefs.h"; + + inherit LIB_ROOM; + + void create() { + room::create(); + SetAmbientLight(30); + SetShort("a blank room"); + SetLong("A featureless area."); + } + + void init(){ + ::init(); + } + diff -c -r --new-file ds1.1/lib/obj/armor.c ds2.0r27/lib/obj/armor.c *** ds1.1/lib/obj/armor.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/obj/armor.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("armor"); + SetId(({"armor"})); + SetAdjectives(({"generic"})); + SetShort("generic armor"); + SetLong("A generic piece of armor of indeterminate proportions."); + SetMass(50); + SetArmorType(A_SHIRT); + SetProtection(KNIFE, 5); + SetProtection(COLD, 5); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/obj/barkeep.c ds2.0r27/lib/obj/barkeep.c *** ds1.1/lib/obj/barkeep.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/obj/barkeep.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,22 ---- + #include <lib.h> + + inherit LIB_BARKEEP; + + static void create() { + barkeep::create(); + SetKeyName("barkeep"); + SetId( ({ "barman" }) ); + SetShort("a generic barkeep"); + SetLevel(1); + SetLong("A nondescript being whose job is to sell food and drink."); + SetMenuItems(([ + ])); + SetGender("male"); + SetRace("human"); + SetSkill("bargaining", 1); + SetProperty("no bump", 1); + SetLocalCurrency("silver"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/obj/bed.c ds2.0r27/lib/obj/bed.c *** ds1.1/lib/obj/bed.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/obj/bed.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,21 ---- + #include <lib.h> + #include <props.h> + + inherit LIB_BED; + + + static void create() { + ::create(); + SetKeyName("bed"); + SetId( ({ "bed" }) ); + SetAdjectives( ({ "generic","nondescript"}) ); + SetShort("a generic bed"); + SetLong("A nondescript bed."); + SetMass(400); + SetBaseCost("silver",150); + SetMaxSitters(2); + SetMaxLiers(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/obj/book.c ds2.0r27/lib/obj/book.c *** ds1.1/lib/obj/book.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/obj/book.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_BOOK; + + void create(){ + ::create(); + SetKeyName("generic book"); + SetId( ({"book"}) ); + SetAdjectives( ({"generic","sample","template"}) ); + SetShort("a generic book"); + SetLong("This is a mostly empty book."); + SetMass(20); + SetBaseCost("silver",10); + SetVendorType(VT_TREASURE); + SetTitle("The Sample Book"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/obj/book_source/chapter1 ds2.0r27/lib/obj/book_source/chapter1 *** ds1.1/lib/obj/book_source/chapter1 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/obj/book_source/chapter1 Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,3 ---- + chapter 1 "First Chapter Title" + + This is the text of the first chapter. diff -c -r --new-file ds1.1/lib/obj/book_source/chapter2 ds2.0r27/lib/obj/book_source/chapter2 *** ds1.1/lib/obj/book_source/chapter2 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/obj/book_source/chapter2 Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,3 ---- + chapter 2 "Second Chapter Title" + + This is the text of the second chapter. diff -c -r --new-file ds1.1/lib/obj/burning_orb.c ds2.0r27/lib/obj/burning_orb.c *** ds1.1/lib/obj/burning_orb.c Sun Feb 1 21:30:28 1998 --- ds2.0r27/lib/obj/burning_orb.c Wed Jul 5 00:00:58 2006 *************** *** 9,15 **** #include <vendor_types.h> inherit LIB_TORCH; ! static void create() { torch::create(); SetKeyName("burning orb"); --- 9,15 ---- #include <vendor_types.h> inherit LIB_TORCH; ! static void create() { torch::create(); SetKeyName("burning orb"); *************** *** 18,24 **** SetAdjectives("burning", "flaming"); SetShort("a burning orb"); SetLong("A flaming orb that does not burn you when you touch it. You " ! "might be able to burn other things with it or light torches."); SetRadiantLight(5); SetMinHeat(10); SetFuelRequired(1); --- 18,24 ---- SetAdjectives("burning", "flaming"); SetShort("a burning orb"); SetLong("A flaming orb that does not burn you when you touch it. You " ! "might be able to burn other things with it or light torches."); SetRadiantLight(5); SetMinHeat(10); SetFuelRequired(1); diff -c -r --new-file ds1.1/lib/obj/chair.c ds2.0r27/lib/obj/chair.c *** ds1.1/lib/obj/chair.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/obj/chair.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_CHAIR; + + + static void create() { + chair::create(); + SetKeyName("chair"); + SetId("chair"); + SetAdjectives( ({ "generic","nondescript" }) ); + SetShort("a generic chair"); + SetLong("A nondescript chair."); + SetMass(150); + SetDollarCost(15); + SetMaxSitters(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/obj/container.c ds2.0r27/lib/obj/container.c *** ds1.1/lib/obj/container.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/obj/container.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + + inherit LIB_STORAGE; + + + void create() { + ::create(); + SetKeyName("container"); + SetId( ({ "container" }) ); + SetAdjectives( ({ "generic","nondescript" }) ); + SetShort("a generic container"); + SetLong("It is a thing that holds other things."); + SetCanClose(1); + SetMass(274); + SetBaseCost("silver",1); + SetMaxCarry(500); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/obj/door.c ds2.0r27/lib/obj/door.c *** ds1.1/lib/obj/door.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/obj/door.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,26 ---- + #include <lib.h> + + inherit LIB_DOOR; + + static void create() { + door::create(); + + SetSide("DIR_X", ([ "id" : ({"door leading DIR_X", "door", "DIR_X door"}), + "short" : "a door leading DIR_X", + "long" : "This is the Y_SIDE side of a door leading DIR_X.", + "lockable" : 1 ]) ); + + SetSide("DIR_Y", ([ "id" : ({"door leading DIR_Y", "door", "DIR_Y door"}), + "short" : "a door leading DIR_Y", + "long" : "This is the X_SIDE side of a door leading DIR_Y.", + "lockable" : 1 ]) ); + + SetClosed(1); + SetLocked(0); + SetKeys("DIR_X", ({ "DIR_X key" })); + SetKeys("DIR_Y", ({ "DIR_Y key" })); + } + + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/obj/drink.c ds2.0r27/lib/obj/drink.c *** ds1.1/lib/obj/drink.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/obj/drink.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + #include <meal_types.h> + + inherit LIB_MEAL; + + + static void create() { + meal::create(); + SetKeyName("drink"); + SetId(({"drink","generic drink"})); + SetShort("a generic drink"); + SetLong("This is a generic drink."); + SetMass(10); + SetStrength(20); + SetBaseCost("silver",10); + SetMealType(MEAL_DRINK); + SetMealMessages("You quaff your drink. Mmm!", + "$N quaffs $P drink."); + SetNoCondition(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/obj/friend.c ds2.0r27/lib/obj/friend.c *** ds1.1/lib/obj/friend.c Sun Feb 1 21:30:28 1998 --- ds2.0r27/lib/obj/friend.c Wed Jul 5 00:00:58 2006 *************** *** 8,75 **** int count; static void create(int level) { ! string type; ! npc::create(); ! SetId(({"blob"})); ! if(level < 40) type = "rodent"; ! if(level > 39 && level < 50) type = "bear"; ! if(level > 49 && level < 70) type = "golem"; ! if(level > 69 && level < 90) type = "unicorn"; ! else type = "dragon"; ! count = level; ! SetType(type); } void SetType(string what) { ! SetRace(what); ! if(!SetClass("monk")) SetClass("fighter"); ! SetLevel(to_int(count/12)); ! SetGender(({"female","male"})[random(2)]); ! switch(what) { case "rodent": ! SetLong("A cute little chipmunk."); ! SetShort("a chipmunk"); ! SetKeyName("chipmunk"); ! SetId(({"chipmunk"})); ! break; case "bear": ! SetLong("A big black bear."); ! SetShort("a bear"); ! SetId(({"bear"})); ! SetKeyName("bear"); ! break; ! case "golem": ! SetLong("A threatening looking golem."); ! SetShort("a golem"); ! SetId(({"golem"})); ! SetKeyName("golem"); ! break; case "unicorn": ! SetLong("A noble unicorn."); ! SetShort("a unicorn"); ! SetId(({"unicorn"})); ! SetKeyName("unicorn"); ! break; case "dragon": ! SetLong("A huge dragon with a threatening visage."); ! SetShort("a dragon"); ! SetId(({"dragon"})); ! SetKeyName("dragon"); ! break; ! } } void heart_beat() { ! ::heart_beat(); ! count--; ! if(count <= 10) send_messages("flicker","$agent_name $agent_verb.", ! this_object(),0,environment()); ! if(count <= 0) { ! send_messages("flicker","$agent_name slowly $agent_verb out" ! " of existence...",this_object(),0,environment()); ! eventDestruct(); ! } } - ! --- 8,75 ---- int count; static void create(int level) { ! string type; ! npc::create(); ! SetId(({"blob"})); ! if(level < 40) type = "rodent"; ! if(level > 39 && level < 50) type = "bear"; ! if(level > 49 && level < 70) type = "golem"; ! if(level > 69 && level < 90) type = "unicorn"; ! else type = "dragon"; ! count = level; ! SetType(type); } void SetType(string what) { ! SetRace(what); ! if(!SetClass("monk")) SetClass("fighter"); ! SetLevel(to_int(count/12)); ! SetGender(({"female","male"})[random(2)]); ! switch(what) { case "rodent": ! SetLong("A cute little chipmunk."); ! SetShort("a chipmunk"); ! SetKeyName("chipmunk"); ! SetId(({"chipmunk"})); ! break; case "bear": ! SetLong("A big black bear."); ! SetShort("a bear"); ! SetId(({"bear"})); ! SetKeyName("bear"); ! break; ! case "golem": ! SetLong("A threatening looking golem."); ! SetShort("a golem"); ! SetId(({"golem"})); ! SetKeyName("golem"); ! break; case "unicorn": ! SetLong("A noble unicorn."); ! SetShort("a unicorn"); ! SetId(({"unicorn"})); ! SetKeyName("unicorn"); ! break; case "dragon": ! SetLong("A huge dragon with a threatening visage."); ! SetShort("a dragon"); ! SetId(({"dragon"})); ! SetKeyName("dragon"); ! break; ! } } void heart_beat() { ! ::heart_beat(); ! count--; ! if(count <= 10) send_messages("flicker","$agent_name $agent_verb.", ! this_object(),0,environment()); ! if(count <= 0) { ! send_messages("flicker","$agent_name slowly $agent_verb out" ! " of existence...",this_object(),0,environment()); ! eventDestruct(); ! } } ! ! diff -c -r --new-file ds1.1/lib/obj/meal.c ds2.0r27/lib/obj/meal.c *** ds1.1/lib/obj/meal.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/obj/meal.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + #include <meal_types.h> + + inherit LIB_MEAL; + + + static void create() { + meal::create(); + SetKeyName("meal"); + SetId(({"meal","generic meal"})); + SetShort("a generic meal"); + SetLong("This is a generic meal."); + SetMass(10); + SetStrength(20); + SetBaseCost("silver",10); + SetMealType(MEAL_FOOD); + SetMealMessages("You eat your food. Mmm!", + "$N eats $P food."); + SetNoCondition(1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/obj/npc.c ds2.0r27/lib/obj/npc.c *** ds1.1/lib/obj/npc.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/obj/npc.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_SENTIENT; + + static void create() { + sentient::create(); + SetKeyName("generic npc"); + SetId(({"npc","mob","character","mobile"})); + SetAdjectives(({"non-player", "non player"})); + SetShort("a generic npc"); + SetLong("Other than being human, this npc is entirely unremarkable."); + SetLevel(1); + SetMelee(1); + SetRace("human"); + SetGender("male"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/obj/portal.c ds2.0r27/lib/obj/portal.c *** ds1.1/lib/obj/portal.c Sun Feb 1 21:30:28 1998 --- ds2.0r27/lib/obj/portal.c Wed Jul 5 00:00:58 2006 *************** *** 2,17 **** * created by Blitz@Dead Souls 960417 * used with the portal spell */ ! #include <lib.h> #include "include/portal.h" ! inherit LIB_ITEM; ! static int LifeSpan = 0; static string Caster = "Blitz", ! LinkRoom; ! static void create() { item::create(); SetKeyName("portal"); --- 2,17 ---- * created by Blitz@Dead Souls 960417 * used with the portal spell */ ! #include <lib.h> #include "include/portal.h" ! inherit LIB_ITEM; ! static int LifeSpan = 0; static string Caster = "Blitz", ! LinkRoom; ! static void create() { item::create(); SetKeyName("portal"); *************** *** 24,88 **** SetMass(0); SetValue(0); } ! string eventShowPortal() { string str; str = "A shimmering, magical portal that pulsates different " ! "shades of white and blue. It was created by Talima " ! "for her faithful servent " + Caster + ". "; if( sizeof(LinkRoom) ) { ! object ob = load_object(LinkRoom); ! if( !ob ) return "There are problems with this portal."; ! str += "Gazing into its fitful depths, you can barely see " ! "an occasional glimpse of " + ob->GetShort() + "."; } else str += "You see nothing in its depths."; return str; } ! int SetLink(mixed dest) { if( stringp(dest) ) { ! dest = load_object(dest); ! if( !dest ) return 0; } else if( !objectp(dest) ) error("Invalid argument 1 to SetLink!"); LinkRoom = base_name(dest); return 1; } ! string GetLink() { return LinkRoom; } ! int SetLifeSpan(int x) { if( LifeSpan ) return 0; call_out((: eventDestruct :), x); return (LifeSpan = x); } ! int GetLifeSpan() { return LifeSpan; } ! string SetCaster(string str) { return (Caster = str); } ! string GetCaster() { return Caster; } ! mixed CanEnter(object who, string what) { if( !sizeof(LinkRoom) ) return "The portal is non-functional."; else return 1; } ! int eventEnter(object who) { if( !who ) return 0; who->eventPrint("%^RED%^%^BOLD%^You step into the portal " ! "and feel reality shift around you."); who->eventMoveLiving(LinkRoom, ! "%^GREEN%^$N steps into the portal and disappears.", ! "%^GREEN%^$N steps out of a shimmering portal."); return 1; } ! int eventDestruct() { object env = environment(); if( env ) { ! env->eventPrint("A shimmering portal winks out of existance."); } ::eventDestruct(); } --- 24,88 ---- SetMass(0); SetValue(0); } ! string eventShowPortal() { string str; str = "A shimmering, magical portal that pulsates different " ! "shades of white and blue. It was created by Talima " ! "for her faithful servent " + Caster + ". "; if( sizeof(LinkRoom) ) { ! object ob = load_object(LinkRoom); ! if( !ob ) return "There are problems with this portal."; ! str += "Gazing into its fitful depths, you can barely see " ! "an occasional glimpse of " + ob->GetShort() + "."; } else str += "You see nothing in its depths."; return str; } ! int SetLink(mixed dest) { if( stringp(dest) ) { ! dest = load_object(dest); ! if( !dest ) return 0; } else if( !objectp(dest) ) error("Invalid argument 1 to SetLink!"); LinkRoom = base_name(dest); return 1; } ! string GetLink() { return LinkRoom; } ! int SetLifeSpan(int x) { if( LifeSpan ) return 0; call_out((: eventDestruct :), x); return (LifeSpan = x); } ! int GetLifeSpan() { return LifeSpan; } ! string SetCaster(string str) { return (Caster = str); } ! string GetCaster() { return Caster; } ! mixed CanEnter(object who, string what) { if( !sizeof(LinkRoom) ) return "The portal is non-functional."; else return 1; } ! int eventEnter(object who) { if( !who ) return 0; who->eventPrint("%^RED%^%^BOLD%^You step into the portal " ! "and feel reality shift around you."); who->eventMoveLiving(LinkRoom, ! "%^GREEN%^$N steps into the portal and disappears.", ! "%^GREEN%^$N steps out of a shimmering portal."); return 1; } ! int eventDestruct() { object env = environment(); if( env ) { ! env->eventPrint("A shimmering portal winks out of existance."); } ::eventDestruct(); } diff -c -r --new-file ds1.1/lib/obj/room.c ds2.0r27/lib/obj/room.c *** ds1.1/lib/obj/room.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/obj/room.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,15 ---- + #include <lib.h> + #include <rooms.h> + + inherit LIB_ROOM; + + + void create() { + room::create(); + SetAmbientLight(30); + SetShort("a blank room"); + SetLong("A featureless area."); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/obj/stargate.c ds2.0r27/lib/obj/stargate.c *** ds1.1/lib/obj/stargate.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/obj/stargate.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,83 ---- + #include <lib.h> + #include <daemons.h> + #include "/lib/include/stargate.h" + + /** + * based on portal.c by Brodbane - March 2006 + * + * $Id: stargate.c,v 1.1 2006/04/05 05:48:39 jam Exp $ + * + * The desired functionality is much like a "star gate": users dialed + * letters or full words that lined up with destinations. A portal opens to + * that destination briefly. To define destinations you must setup a + * constant below then add it to the switch statement in the cmdDial + * function. This object is crude and basic, but gets the job done. + * + * 2006-03-22, jonez + * - original version of this file is from Daelas@Moraelinost + * 2006-03-23, jonez + * - altered so code uses existing verbs (touch, enter) where possible. last add_action is for dial command. + * - added single mapping called "database" and made the "dial" command use it. + * - dial command no longer uses switch/case, making adding a new destination simpler + * - made use of SetPreventGet() / SetPreventPut() + * - made use of new stargate daemon + * - made use of LIB_STARGATE + * - made use of STARGATE_D + * + * IDEAS: + * - create a daemon that holds the stargate network [DONE] + * - allow for stargate failure + * - add dhd object + * - change the code so that it uses a single mapping of names and + * destinations, perhaps in a database file. currently an update to the + * object requires an update for all the objects. [DONE] + * - dhd skill (thanks plato) + * - delay when dialing gate. destination dhd lights up? + * - player should not be able to dial earth if earth is already connected elsewhere (need daemon) [DONE] + * - make use of existing verbs (enter, touch) instead of doing our own thing. [DONE] + * - daemon should contain a class that maps the various gates to each other. see lib/include/door.h [DONE] + * - shout "off world activation" into the gateroom when the gate engages. + * - track status as "incoming" or "outgoing".. you can only "enter" an outgoing gate (rhk) [DONE] + * - if room is empty, shut down the gate (rhk) + * - change callout time when someone goes through the gate (rhk) + */ + + /* + Cratylus@Dead Souls <ds> but let me give you a quick outline + Cratylus@Dead Souls <ds> i type dial thing + Cratylus@Dead Souls <ds> the thing inherits LIB_DIAL + Cratylus@Dead Souls <ds> which is in /lib/events/dial.c + Cratylus@Dead Souls <ds> and all that contains is like direct_dial_ob() return 1; this kind of thing + Cratylus@Dead Souls <ds> take a look at LIB_TURN + Cratylus@Dead Souls <ds> what LIB_DIAL does is provide the object with hooks, so it *can* be dialed + Cratylus@Dead Souls <ds> so, when i type dial thing, the thing goes, yeah i + can be dialed, and then the parser enters the can_dial and do_dial funcs + in the verb + Cratylus@Dead Souls <ds> tellya what. i'd like to work with you on this one. i think it's less straightforward than it + seems, and i need to test some ideas before i can say "do it this way" + + */ + inherit LIB_STARGATE; + + int readScreen(); + + void create() + { + ::create(); + setOrigin("default", "/obj/room"); + // SetRead(([ ({ "screen" }) : (: readScreen :) ]) ); + // SetItems(([ ({ "screen" }) : "a computer screen which shows the status of the gate network" ]) ); + } + + void init() + { + ::init(); + } + + int readScreen() + { + write("stargate network status\n"); + write("-----------------------\n"); + write("\n"); + + } diff -c -r --new-file ds1.1/lib/obj/table.c ds2.0r27/lib/obj/table.c *** ds1.1/lib/obj/table.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/obj/table.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_TABLE; + + + void create() { + ::create(); + SetKeyName("generic table"); + SetId( ({ "table","surface" }) ); + SetAdjectives( ({ "generic"}) ); + SetShort("a generic table"); + SetLong("It is a surface that can hold things."); + SetBaseCost("silver",1); + SetMaxCarry(500); + + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/obj/thing.c ds2.0r27/lib/obj/thing.c *** ds1.1/lib/obj/thing.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/obj/thing.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,18 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + + void create(){ + ::create(); + SetKeyName("generic thing"); + SetId( ({"thing","item","thang","dingus"}) ); + SetAdjectives( ({"generic","sample","template"}) ); + SetShort("a generic thing"); + SetLong("This is an object of indeterminate nature and proportions."); + SetMass(20); + SetBaseCost("silver",10); + SetVendorType(VT_TREASURE); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/obj/trainer.c ds2.0r27/lib/obj/trainer.c *** ds1.1/lib/obj/trainer.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/obj/trainer.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + + inherit LIB_TRAINER; + void create(){ + trainer::create(); + SetKeyName("trainer"); + SetId("generic trainer"); + SetGender("male"); + SetRace("human"); + SetShort("a generic trainer"); + SetLong("This is a person whose job it is to teach you things. "+ + "For example, 'ask trainer "+ + "to teach wibbling' would prompt him to begin a wibble learning "+ + "lesson with you, if wibbling is in his skill set and you have "+ + "earned sufficient training points. If you lack training points, then "+ + "do some adventuring and earn a level promotion. You will "+ + "then be awarded training points."); + SetLevel(1); + AddTrainingSkills( ({"wibbling"})); + } + void init() { + ::init(); + } diff -c -r --new-file ds1.1/lib/obj/vendor.c ds2.0r27/lib/obj/vendor.c *** ds1.1/lib/obj/vendor.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/obj/vendor.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,22 ---- + #include <lib.h> + #include <vendor_types.h> + + inherit LIB_VENDOR; + + static void create() { + vendor::create(); + SetKeyName("vendor"); + SetId( ({ "shopkeep" }) ); + SetAdjectives( ({ "generic" }) ); + SetShort("a generic vendor"); + SetLevel(1); + SetLong("A nondescript person whose job it is to sell things."); + SetGender("male"); + SetRace("human"); + SetSkill("bargaining", 1); + SetProperty("no bump", 1); + SetLocalCurrency("silver"); + SetStorageRoom("/obj/room"); + SetMaxItems(100); + SetVendorType(VT_ALL); + } diff -c -r --new-file ds1.1/lib/obj/weapon.c ds2.0r27/lib/obj/weapon.c *** ds1.1/lib/obj/weapon.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/obj/weapon.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + + + static void create() { + item::create(); + SetKeyName("generic weapon"); + SetId( ({ "weapon"})); + SetAdjectives( ({ "generic" })); + SetShort("a generic weapon"); + SetLong("A weapon of indeterminate proportions."); + SetMass(50); + SetVendorType(VT_WEAPON); + SetClass(30); + SetDamageType(BLADE); + SetWeaponType("blade"); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/obj/wed_ring.c ds2.0r27/lib/obj/wed_ring.c *** ds1.1/lib/obj/wed_ring.c Sun Feb 1 21:30:28 1998 --- ds2.0r27/lib/obj/wed_ring.c Wed Jul 5 00:00:58 2006 *************** *** 2,31 **** * from Dead Souls LPMud * created by Descartes of Borg 951211 */ ! #include <lib.h> ! #include <armour_types.h> #include <damage_types.h> #include <vendor_types.h> ! ! inherit LIB_ARMOUR; ! private string Spouse; ! mixed eventMove(mixed dest); string SetSpouse(string str); string GetSpouse(); string RealLong(); ! static void create() { ! armour::create(); AddSave( ({ "Spouse" }) ); SetKeyName("wedding ring"); ! SetId( ({ "ring", "wedding ring" }) ); SetAdjectives( ({ "golden", "gold" }) ); SetShort("a wedding ring of gold"); SetLong( (:RealLong:) ); ! SetVendorType(VT_ARMOUR | VT_MAGIC); SetMass(10); SetValue(0); SetPreventDrop("You may not drop your wedding ring!"); --- 2,31 ---- * from Dead Souls LPMud * created by Descartes of Borg 951211 */ ! #include <lib.h> ! #include <armor_types.h> #include <damage_types.h> #include <vendor_types.h> ! ! inherit LIB_ARMOR; ! private string Spouse; ! mixed eventMove(mixed dest); string SetSpouse(string str); string GetSpouse(); string RealLong(); ! static void create() { ! armor::create(); AddSave( ({ "Spouse" }) ); SetKeyName("wedding ring"); ! SetId( ({ "ring", "official wedding ring" }) ); SetAdjectives( ({ "golden", "gold" }) ); SetShort("a wedding ring of gold"); SetLong( (:RealLong:) ); ! SetVendorType(VT_ARMOR | VT_MAGIC); SetMass(10); SetValue(0); SetPreventDrop("You may not drop your wedding ring!"); *************** *** 34,62 **** SetProtection(BLUNT, 3); SetProtection(BLADE, 3); SetProtection(KNIFE, 3); ! SetArmourType(A_AMULET); } ! mixed eventMove(mixed dest) { mixed tmp; ! if( !environment() ) { ! tmp = armour::eventMove(dest); ! //if( tmp == 1 ) environment()->eventForce("wear wedding ring"); ! return tmp; } else return 0; } ! string SetSpouse(string str) { if( Spouse ) return Spouse; else return Spouse = str; } ! string GetSpouse() { return Spouse; } ! string RealLong() { return ("This beautiful golden band was given to you by " + ! GetSpouse() + " to capture your eternal love."); } ! --- 34,64 ---- SetProtection(BLUNT, 3); SetProtection(BLADE, 3); SetProtection(KNIFE, 3); ! SetArmorType(A_RING); ! SetRestrictLimbs( ({"left hand"}) ); } ! mixed eventMove(mixed dest) { mixed tmp; ! ! if(archp(this_player())) return armor::eventMove(dest); if( !environment() ) { ! tmp = armor::eventMove(dest); ! //if( tmp == 1 ) environment()->eventForce("wear wedding ring"); ! return tmp; } else return 0; } ! string SetSpouse(string str) { if( Spouse ) return Spouse; else return Spouse = str; } ! string GetSpouse() { return Spouse; } ! string RealLong() { return ("This beautiful golden band was given to you by " + ! GetSpouse() + " to capture your eternal love."); } ! diff -c -r --new-file ds1.1/lib/obj/workroom.c ds2.0r27/lib/obj/workroom.c *** ds1.1/lib/obj/workroom.c Sun Feb 1 21:30:28 1998 --- ds2.0r27/lib/obj/workroom.c Wed Dec 31 19:00:00 1969 *************** *** 1,25 **** - /* /domains/Examples/room/simple.c - * from the Dead Souls LPC Library - * a simple example room, bare minimum stuff - * created by Descartes of Borg 950402 - */ - - #include <lib.h> - - inherit LIB_ROOM; - - static void create() { - room::create(); - SetProperties( ([ "light" : 4 ]) ); - SetClimate("indoors"); - SetShort("a workroom"); - SetLong("Endless miles of veldt stretch out underneath an oppressive " - "sky, awaiting your creative abilities."); - SetListen("default", "Rustling sounds can be heard in all directions."); - SetItems( ([ "brush" : "Across the veldt is a high brush which can " - "conceal about anything.", - "carnivores" : "You do not see them, but you know they are " - "here.", - "sky" : "A vast sky hanging over the endless veldt." ]) ); - SetExits( ([ "out" : "/domains/Praxis/room/square" ]) ); - } --- 0 ---- diff -c -r --new-file ds1.1/lib/obj/worn_storage.c ds2.0r27/lib/obj/worn_storage.c *** ds1.1/lib/obj/worn_storage.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/obj/worn_storage.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_WORN_STORAGE; + + static void create(){ + ::create(); + SetKeyName("generic worn storage"); + SetId(({"thing","storage","worn_storage","storage","article"})); + SetAdjectives(({"article of","generic","worn"})); + SetShort("a generic article of worn storage"); + SetLong("This is a thing that can be worn which can also hold things."); + SetCanClose(1); + SetMaxCarry(100); + SetMass(200); + SetBaseCost("silver",10); + SetDamagePoints(100); + SetArmorType(A_PANTS); + SetProtection(COLD, 1); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/realms/template/area/armor/chainmail.c ds2.0r27/lib/realms/template/area/armor/chainmail.c *** ds1.1/lib/realms/template/area/armor/chainmail.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/realms/template/area/armor/chainmail.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("chainmail shirt"); + SetId(({"armor","chainmail","mail","shirt","chain mail"})); + SetAdjectives(({"chainmail","sturdy","sturdy-looking","chain mail"})); + SetShort("a sturdy-looking chainmail shirt"); + SetLong("This is a shirt made of small, thin metal rings fashioned together as armor. "); + SetMass(500); + SetBaseCost(1000); + SetDamagePoints(100); + SetProtection(BLUNT,4); + SetProtection(BLADE,25); + SetProtection(KNIFE,25); + SetArmorType(A_ARMOR); + } diff -c -r --new-file ds1.1/lib/realms/template/area/armor/leather_boot_l.c ds2.0r27/lib/realms/template/area/armor/leather_boot_l.c *** ds1.1/lib/realms/template/area/armor/leather_boot_l.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/realms/template/area/armor/leather_boot_l.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,21 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("leather boot"); + SetId(({"boot","leather boot"})); + SetAdjectives( ({"leather","strong","tough","left"}) ); + SetShort("a leather boot"); + SetLong("This is the leather combat boot of a professional soldier. "+ + "It is very thick and very strong. It is designed for wear on the left foot."); + SetMass(50); + SetBaseCost(50); + SetDamagePoints(20); + SetProtection(BLUNT,10); + SetProtection(BLADE,20); + SetProtection(KNIFE,20); + SetArmorType(A_BOOT); + SetRestrictLimbs(({"left foot"})); + } diff -c -r --new-file ds1.1/lib/realms/template/area/armor/leather_boot_r.c ds2.0r27/lib/realms/template/area/armor/leather_boot_r.c *** ds1.1/lib/realms/template/area/armor/leather_boot_r.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/realms/template/area/armor/leather_boot_r.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,21 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + static void create(){ + armor::create(); + SetKeyName("leather boot"); + SetId(({"boot","leather boot"})); + SetAdjectives( ({"leather","strong","tough","right"}) ); + SetShort("a leather boot"); + SetLong("This is the leather combat boot of a professional soldier. "+ + "It is very thick and very strong. It is designed for wear on the right foot."); + SetMass(50); + SetBaseCost(50); + SetDamagePoints(20); + SetProtection(BLUNT,10); + SetProtection(BLADE,20); + SetProtection(KNIFE,20); + SetArmorType(A_BOOT); + SetRestrictLimbs(({"right foot"})); + } diff -c -r --new-file ds1.1/lib/realms/template/area/npc/fighter.c ds2.0r27/lib/realms/template/area/npc/fighter.c *** ds1.1/lib/realms/template/area/npc/fighter.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/realms/template/area/npc/fighter.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,25 ---- + #include <lib.h> + #include "../../customdefs.h" + + inherit LIB_NPC; + + static void create(){ + npc::create(); + SetKeyName("fighter"); + SetId( ({"human","npc","warrior","fighter"}) ); + SetShort("a fighter"); + SetLong("This is a sample warrior NPC."); + SetLevel(10); + SetRace("human"); + SetClass("fighter"); + SetGender("male"); + SetInventory(([ + MY_ARMOR "/chainmail.c" : "wear chainmail", + MY_ARMOR "/leather_boot_r.c" : "wear boot", + MY_ARMOR "/leather_boot_l.c" : "wear boot", + MY_WEAP "/sword.c" : "wield sword", + ])); + } + void init(){ + ::init(); + } \ No newline at end of file diff -c -r --new-file ds1.1/lib/realms/template/area/obj/case.c ds2.0r27/lib/realms/template/area/obj/case.c *** ds1.1/lib/realms/template/area/obj/case.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/realms/template/area/obj/case.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,26 ---- + #include <lib.h> + #include "../../customdefs.h" + + inherit LIB_STORAGE; + + void create() { + ::create(); + SetKeyName("case"); + SetId( ({ "container" }) ); + SetAdjectives( ({ "generic","nondescript" }) ); + SetShort("a glass case"); + SetLong("This is an expensive looking, ornamented glass case. It looks perfect for storing trophies or jewelry for display."); + SetInventory(([ + MY_AREA "/obj/watch" : 1, + ])); + SetOpacity(10); + SetCanClose(1); + SetMass(274); + SetBaseCost("silver",1); + SetMaxCarry(500); + } + void init(){ + ::init(); + } + + mixed CanGet(object ob) { return "The case does not budge.";} diff -c -r --new-file ds1.1/lib/realms/template/area/obj/key.c ds2.0r27/lib/realms/template/area/obj/key.c *** ds1.1/lib/realms/template/area/obj/key.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/realms/template/area/obj/key.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,19 ---- + #include <lib.h> + + inherit LIB_ITEM; + + + static void create() { + item::create(); + SetKeyName("key"); + SetId( ({ "key", "sample key" }) ); + SetAdjectives( ({ "simple","sample" }) ); + SetShort("a sample key"); + SetLong("It is a simple sample key with no markings."); + SetMass(50); + SetBaseCost(1); + SetDisableChance(100); + } + void init(){ + ::init(); + } \ No newline at end of file diff -c -r --new-file ds1.1/lib/realms/template/area/obj/table.c ds2.0r27/lib/realms/template/area/obj/table.c *** ds1.1/lib/realms/template/area/obj/table.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/realms/template/area/obj/table.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,22 ---- + #include <lib.h> + #include "../../customdefs.h" + + inherit LIB_TABLE; + + + void create() { + ::create(); + SetKeyName("sample table"); + SetId( ({ "table" ,"sample table"}) ); + SetAdjectives( ({ "simple","sample" }) ); + SetShort("a simple table"); + SetLong("It is a simple sample table."); + SetBaseCost(1200); + SetMaxCarry(5000); + SetInventory( ([ + MY_OBJ "/key" : 1, + ]) ); + } + void init(){ + ::init(); + } \ No newline at end of file diff -c -r --new-file ds1.1/lib/realms/template/area/obj/watch.c ds2.0r27/lib/realms/template/area/obj/watch.c *** ds1.1/lib/realms/template/area/obj/watch.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/realms/template/area/obj/watch.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,68 ---- + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + #include <localtime.h> + #include <daemons.h> + + inherit LIB_ARMOR; + + int eventReadWatch(); + + static void create(){ + armor::create(); + SetKeyName("pocket watch"); + SetId(({"watch","pocketwatch","pocket watch","timepiece"})); + SetShort("a pocket watch"); + SetLong("This is a beautifully decorated and intricately carved "+ + "pocket watch. It glows with a bright, polished bronze "+ + "luster. It is quietly ticking the seconds, and it looks like you can get the "+ + "accurate time by reading the watch."); + SetMass(10); + SetBaseCost("silver",40); + SetProtection(BLUNT,1); + SetProtection(BLADE,1); + SetProtection(KNIFE,1); + SetArmorType(A_AMULET); + SetDefaultRead( (: eventReadWatch :) ); + } + void init(){ + ::init(); + } + + int eventReadWatch(){ + int hour, minutes; + int *time_of_day; + string hour_string, minute_string; + + time_of_day = SEASONS_D->GetMudTime(); + hour = time_of_day[0]; + minutes = time_of_day[1]; + + if(hour > 12) hour -= 12; + + hour_string = cardinal(hour); + switch(minutes){ + case 0 : minute_string ="o'clock"; break; + case 1 : minute_string = hour_string;hour_string ="one minute past"; break; + case 2 : minute_string = hour_string;hour_string ="two minutes past"; break; + case 3 : minute_string = hour_string;hour_string ="three minutes past"; break; + case 4 : minute_string = hour_string;hour_string ="four minutes past"; break; + case 5 : minute_string = hour_string;hour_string ="five past"; break; + case 6 : minute_string = hour_string;hour_string ="six minutes past"; break; + case 7 : minute_string = hour_string;hour_string ="seven minutes past"; break; + case 8 : minute_string = hour_string;hour_string ="eight minutes past"; break; + case 9 : minute_string = hour_string;hour_string ="nine minutes past"; break; + case 10 : minute_string = hour_string;hour_string ="ten past"; break; + case 15 : minute_string = hour_string;hour_string ="quarter past"; break; + case 45 : minute_string = cardinal(hour+1);hour_string ="quarter of"; break; + case 50 : minute_string = cardinal(hour+1);;hour_string ="ten of"; break; + case 55 : minute_string = cardinal(hour+1);hour_string ="five of"; break; + default : minute_string = cardinal(minutes);break; + } + + if(minute_string == "thirteen") minute_string = "one"; + + write("According to the watch, it is "+hour_string+" "+minute_string+"."); + + return 1; + } diff -c -r --new-file ds1.1/lib/realms/template/area/room/sample_room.c ds2.0r27/lib/realms/template/area/room/sample_room.c *** ds1.1/lib/realms/template/area/room/sample_room.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/realms/template/area/room/sample_room.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,27 ---- + #include <lib.h> + #include "../../customdefs.h" + + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Sample Room"); + SetLong("This is a room you can use as a template."); + SetItems( ([ + "template" : "That's what this is.", + ]) ); + SetExits( ([ + "west" : MY_DIR "/workroom", + "east" : MY_ROOM "/sample_two.c", + ]) ); + SetInventory( ([ + MY_OBJ "/table" : 1, + MY_NPC "/fighter" : 1, + ]) ); + } + + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/realms/template/area/room/sample_two.c ds2.0r27/lib/realms/template/area/room/sample_two.c *** ds1.1/lib/realms/template/area/room/sample_two.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/realms/template/area/room/sample_two.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,26 ---- + #include <lib.h> + #include "../../customdefs.h" + + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Second Sample Room"); + SetLong("This is another sample room."); + SetItems( ([ + "template" : "That's what this is.", + ]) ); + SetInventory(([ + MY_OBJ "/case" :1, + ])); + SetExits(([ + "west" : MY_AREA "/room/sample_room", + ])); + + } + + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/realms/template/area/weap/sword.c ds2.0r27/lib/realms/template/area/weap/sword.c *** ds1.1/lib/realms/template/area/weap/sword.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/realms/template/area/weap/sword.c Wed Jul 5 00:01:15 2006 *************** *** 0 **** --- 1,20 ---- + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + + inherit LIB_ITEM; + + static void create() { + item::create(); + SetKeyName("short sword"); + SetId( ({ "sword", "short sword" }) ); + SetAdjectives( ({ "short" }) ); + SetShort("a short sword"); + SetLong("A cheap and rather dull short sword."); + SetMass(300); + SetBaseCost(50); + SetVendorType(VT_WEAPON); + SetClass(20); + SetDamageType(BLADE); + SetWeaponType("blade"); + } diff -c -r --new-file ds1.1/lib/realms/template/bak/bk.db ds2.0r27/lib/realms/template/bak/bk.db *** ds1.1/lib/realms/template/bak/bk.db Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/realms/template/bak/bk.db Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1 ---- + workroom.orig : workroom.orig diff -c -r --new-file ds1.1/lib/realms/template/bak/workroom.orig ds2.0r27/lib/realms/template/bak/workroom.orig *** ds1.1/lib/realms/template/bak/workroom.orig Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/realms/template/bak/workroom.orig Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,55 ---- + #include <lib.h> + #include "./customdefs.h" + + inherit LIB_ROOM; + int ReadSign(); + int ReadSheet(); + + static void create() { + string privs; + + privs = query_privs(); + if( privs ) privs = capitalize(privs); + else privs = "a creator"; + room::create(); + SetClimate("indoors"); + SetAmbientLight(40); + SetShort(possessive_noun(privs) + " workroom"); + SetLong("You are standing in the workroom of the mighty " + privs + "! \n"+ + "You may return to the Creators' Hall by going down.\n"+ + "A sample room is east."+ + "\n%^GREEN%^There is a sign here you can read.%^RESET%^"+ + "\n%^YELLOW%^There is a sheet here you can read.%^RESET%^"+ + ""); + SetItems( ([ "workroom" : "It looks very nice.", + ({"sign","hint","hints"}) : "A sign with hints for creators.", + ({"sheet","reminder","reminders"}) : "A sheet with quick reminders for creators.", + ]) ); + SetRead( ([ + ({"sign","hint","hints"}) : (: ReadSign :), + ({"sheet","reminder","reminders"}) : (: ReadSheet :) + ]) ); + SetInventory( ([ + "/domains/default/obj/chest" : 1, + "/domains/default/obj/bbucket" :1, + ]) ); + SetObviousExits("e,d"); + SetExits( ([ "down" : "/domains/default/room/wiz_hall.c", + "east" : MY_ROOM "/sample_room" + ]) ); + SetNoModify(1); + } + + int ReadSign(){ + this_player()->eventPage("/news/hints.txt"); + return 1; + } + + int ReadSheet(){ + this_player()->eventPage("/news/reminders.txt"); + return 1; + } + + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/realms/template/cmds/custom.c ds2.0r27/lib/realms/template/cmds/custom.c *** ds1.1/lib/realms/template/cmds/custom.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/realms/template/cmds/custom.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,10 ---- + + #include <lib.h> + + inherit LIB_DAEMON; + + mixed cmd(string str) { + return "This is your own, personal command."; + } + + diff -c -r --new-file ds1.1/lib/realms/template/customdefs.h ds2.0r27/lib/realms/template/customdefs.h *** ds1.1/lib/realms/template/customdefs.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/realms/template/customdefs.h Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,14 ---- + #ifndef r_mydirs_h + #define r_mydirs_h + + #define MY_DIR "/realms/template" + #define MY_CMDS MY_DIR "/cmds" + #define MY_LOG MY_DIR "/log" + #define MY_AREA MY_DIR "/area" + #define MY_WEAP MY_AREA "/weap" + #define MY_ROOM MY_AREA "/room" + #define MY_OBJ MY_AREA "/obj" + #define MY_ARMOR MY_AREA "/armor" + #define MY_NPC MY_AREA "/npc" + + #endif /* r_mydirs_h */ diff -c -r --new-file ds1.1/lib/realms/template/customdefs.part1 ds2.0r27/lib/realms/template/customdefs.part1 *** ds1.1/lib/realms/template/customdefs.part1 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/realms/template/customdefs.part1 Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,3 ---- + #ifndef r_mydirs_h + #define r_mydirs_h + diff -c -r --new-file ds1.1/lib/realms/template/customdefs.part2 ds2.0r27/lib/realms/template/customdefs.part2 *** ds1.1/lib/realms/template/customdefs.part2 Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/realms/template/customdefs.part2 Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,10 ---- + #define MY_CMDS MY_DIR "/cmds" + #define MY_LOG MY_DIR "/log" + #define MY_AREA MY_DIR "/area" + #define MY_WEAP MY_AREA "/weap" + #define MY_ROOM MY_AREA "/room" + #define MY_OBJ MY_AREA "/obj" + #define MY_ARMOR MY_AREA "/armor" + #define MY_NPC MY_AREA "/npc" + + #endif /* r_mydirs_h */ diff -c -r --new-file ds1.1/lib/realms/template/plan ds2.0r27/lib/realms/template/plan *** ds1.1/lib/realms/template/plan Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/realms/template/plan Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1 ---- + This is an empty plan file. diff -c -r --new-file ds1.1/lib/realms/template/profile ds2.0r27/lib/realms/template/profile *** ds1.1/lib/realms/template/profile Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/realms/template/profile Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,3 ---- + cd + people + uptime diff -c -r --new-file ds1.1/lib/realms/template/workroom.bak ds2.0r27/lib/realms/template/workroom.bak *** ds1.1/lib/realms/template/workroom.bak Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/realms/template/workroom.bak Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,55 ---- + #include <lib.h> + #include "./customdefs.h" + + inherit LIB_ROOM; + int ReadSign(); + int ReadSheet(); + + static void create() { + string privs; + + privs = query_privs(); + if( privs ) privs = capitalize(privs); + else privs = "a creator"; + room::create(); + SetClimate("indoors"); + SetAmbientLight(40); + SetShort(possessive_noun(privs) + " workroom"); + SetLong("You are standing in the workroom of the mighty " + privs + "! \n"+ + "You may return to the Creators' Hall by going down.\n"+ + "A sample room is east."+ + "\n%^GREEN%^There is a sign here you can read.%^RESET%^"+ + "\n%^YELLOW%^There is a sheet here you can read.%^RESET%^"+ + ""); + SetItems( ([ "workroom" : "It looks very nice.", + ({"sign","hint","hints"}) : "A sign with hints for creators.", + ({"sheet","reminder","reminders"}) : "A sheet with quick reminders for creators.", + ]) ); + SetRead( ([ + ({"sign","hint","hints"}) : (: ReadSign :), + ({"sheet","reminder","reminders"}) : (: ReadSheet :) + ]) ); + SetInventory( ([ + "/domains/default/obj/chest" : 1, + "/domains/default/obj/bbucket" :1, + ]) ); + SetObviousExits("e,d"); + SetExits( ([ "down" : "/domains/default/room/wiz_hall.c", + "east" : MY_ROOM "/sample_room" + ]) ); + SetNoModify(1); + } + + int ReadSign(){ + this_player()->eventPage("/news/hints.txt"); + return 1; + } + + int ReadSheet(){ + this_player()->eventPage("/news/reminders.txt"); + return 1; + } + + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/realms/template/workroom.c ds2.0r27/lib/realms/template/workroom.c *** ds1.1/lib/realms/template/workroom.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/realms/template/workroom.c Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,54 ---- + #include <lib.h> + #include "./customdefs.h" + + inherit LIB_ROOM; + int ReadSign(); + int ReadSheet(); + + static void create() { + string privs; + + privs = query_privs(); + if( privs ) privs = capitalize(privs); + else privs = "a creator"; + room::create(); + SetClimate("indoors"); + SetAmbientLight(40); + SetShort(possessive_noun(privs) + " workroom"); + SetLong("You are standing in the workroom of the mighty " + privs + "! \n"+ + "You may return to the Creators' Hall by going down.\n"+ + "A sample room is east."+ + "\n%^GREEN%^There is a sign here you can read.%^RESET%^"+ + "\n%^YELLOW%^There is a sheet here you can read.%^RESET%^"+ + ""); + SetItems( ([ "workroom" : "It looks very nice.", + ({"sign","hint","hints"}) : "A sign with hints for creators.", + ({"sheet","reminder","reminders"}) : "A sheet with quick reminders for creators.", + ]) ); + SetRead( ([ + ({"sign","hint","hints"}) : (: ReadSign :), + ({"sheet","reminder","reminders"}) : (: ReadSheet :) + ]) ); + SetInventory( ([ + "/domains/default/obj/chest" : 1, + "/domains/default/obj/bbucket" :1, + ]) ); + SetExits( ([ "down" : "/domains/default/room/wiz_hall.c", + "east" : MY_ROOM "/sample_room" + ]) ); + SetNoModify(0); + } + + int ReadSign(){ + this_player()->eventPage("/news/hints.txt"); + return 1; + } + + int ReadSheet(){ + this_player()->eventPage("/news/reminders.txt"); + return 1; + } + + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/save/classes.o ds2.0r27/lib/save/classes.o *** ds1.1/lib/save/classes.o Fri Jan 3 22:14:34 1997 --- ds2.0r27/lib/save/classes.o Wed Jul 5 00:00:58 2006 *************** *** 1,2 **** #/daemon/classes.c ! Classes (["priest":(/1,(["fighter":"druid",]),(["stealth":(/4,0,/),"projectile defense":(/3,1,/),"magic attack":(/5,0,/),"conjuring":(/5,0,/),"blade defense":(/3,1,/),"projectile attack":(/4,0,/),"blunt attack":(/5,0,/),"healing":(/1,1,/),"knife attack":(/5,0,/),"fishing":(/2,0,/),"blunt defense":(/1,1,/),"magic defense":(/1,1,/),"melee attack":(/3,0,/),"bargaining":(/5,1,/),"faith":(/1,1,/),"knife defense":(/3,1,/),"melee defense":(/2,1,/),]),/),"fighter":(/1,(["priest":"druid",]),(["projectile defense":(/4,1,/),"multi-hand":(/1,1,/),"blade defense":(/1,1,/),"projectile attack":(/3,1,/),"blade attack":(/1,1,/),"blunt attack":(/3,1,/),"healing":(/5,0,/),"knife attack":(/2,1,/),"blunt defense":(/2,1,/),"magic defense":(/5,0,/),"melee attack":(/2,0,/),"bargaining":(/4,0,/),"knife defense":(/3,1,/),"murder":(/5,0,/),"melee defense":(/2,1,/),"multi-weapon":(/1,1,/),]),/),]) --- 1,2 ---- #/daemon/classes.c ! Classes (["fighter":(/1,([]),(["blade attack":(/0,1,/),"blunt defense":(/0,1,/),"multi-weapon":(/1,1,/),"bargaining":(/4,1,/),"projectile attack":(/1,1,/),"melee attack":(/1,0,/),"blade defense":(/0,1,/),"multi-hand":(/1,1,/),"blunt attack":(/0,1,/),"knife defense":(/0,1,/),"melee defense":(/0,1,/),"knife attack":(/0,1,/),"projectile defense":(/1,1,/),]),/),"explorer":(/1,([]),(["magic attack":(/1,1,/),"blade attack":(/1,1,/),"blunt defense":(/2,1,/),"bargaining":(/4,1,/),"projectile attack":(/1,0,/),"melee attack":(/1,0,/),"blade defense":(/1,1,/),"blunt attack":(/2,1,/),"knife defense":(/2,1,/),"melee defense":(/2,1,/),"magic defense":(/1,1,/),"knife attack":(/2,1,/),"projectile defense":(/1,1,/),]),/),"thief":(/1,([]),(["murder":(/2,0,/),"stealing":(/0,0,/),"blunt defense":(/1,1,/),"bargaining":(/0,0,/),"projectile attack":(/1,0,/),"melee attack":(/3,0,/),"fishing":(/1,0,/),"blade defense":(/2,1,/),"blunt attack":(/2,1,/),"knife defense":(/3,0,/),"melee defense":(/2,0,/),"stealth":(/0,0,/),"knife attack":(/0,0,/),"projectile defense":(/0,0,/),]),/),"priest":(/1,(["fighter":"druid",]),(["magic attack":(/0,0,/),"conjuring":(/0,0,/),"healing":(/0,1,/),"blunt defense":(/1,1,/),"projectile attack":(/4,0,/),"bargaining":(/1,1,/),"melee attack":(/3,0,/),"faith":(/0,1,/),"fishing":(/2,0,/),"blade defense":(/3,1,/),"blunt attack":(/5,0,/),"knife defense":(/3,1,/),"melee defense":(/2,1,/),"magic defense":(/1,1,/),"stealth":(/4,0,/),"projectile defense":(/3,1,/),]),/),"mage":(/1,([]),(["magic attack":(/0,1,/),"conjuring":(/0,1,/),"blunt defense":(/2,0,/),"bargaining":(/1,0,/),"melee attack":(/2,0,/),"blunt attack":(/1,0,/),"melee defense":(/2,0,/),"knife defense":(/2,0,/),"magic defense":(/0,1,/),"knife attack":(/1,0,/),]),/),]) diff -c -r --new-file ds1.1/lib/save/economy.o ds2.0r27/lib/save/economy.o *** ds1.1/lib/save/economy.o Fri Jan 3 22:14:33 1997 --- ds2.0r27/lib/save/economy.o Wed Jul 5 00:00:58 2006 *************** *** 1,3 **** ! #/daemon/economy.c ! Currencies (["electrum":(["inflation":0.03,"weight":0.004,"rate":10,]),"silver":(["inflation":0.03,"weight":0.8,"rate":101,]),"gold":(["inflation":0.03,"weight":0.1,"rate":1,]),"platinum":(["inflation":0.03,"weight":0.2,"rate":0.127528,]),"copper":(["inflation":0.03,"weight":0.01,"rate":1045,]),]) ! LastInflation 852180288 --- 1,3 ---- ! #/secure/daemon/economy.c ! Currencies (["dollars":(["rate":100.000000,"weight":0.001000,"inflation":0.000000,]),"silver":(["rate":100,"weight":0.800000,"inflation":0.000000,]),"electrum":(["rate":500,"weight":0.004000,"inflation":0.000000,]),"platinum":(["rate":10000,"weight":0.200000,"inflation":0.000000,]),"copper":(["rate":1,"weight":0.010000,"inflation":0.000000,]),"gold":(["rate":1000,"weight":0.100000,"inflation":0.000000,]),]) ! LastInflation 1150654990 diff -c -r --new-file ds1.1/lib/save/events.c ds2.0r27/lib/save/events.c *** ds1.1/lib/save/events.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/save/events.c Wed Jul 5 00:00:58 2006 *************** *** 0 **** --- 1,3 ---- + #/secure/daemon/events.c + RebootInterval 1000 + Events ([]) diff -c -r --new-file ds1.1/lib/save/events.o ds2.0r27/lib/save/events.o *** ds1.1/lib/save/events.o Fri Jan 3 22:14:34 1997 --- ds2.0r27/lib/save/events.o Wed Jul 5 00:00:58 2006 *************** *** 1,3 **** #/secure/daemon/events.c RebootInterval 1000 ! Events ([]) --- 1,3 ---- #/secure/daemon/events.c RebootInterval 1000 ! Events ([1151333254:(["interval":7200,"args":({}),"object":"/secure/daemon/log","function":"RotateLogs","regular":7200,"creator":"/secure/daemon/log",]),]) diff -c -r --new-file ds1.1/lib/save/kills/a/antichrist ds2.0r27/lib/save/kills/a/antichrist *** ds1.1/lib/save/kills/a/antichrist Fri Jan 3 22:14:32 1997 --- ds2.0r27/lib/save/kills/a/antichrist Wed Dec 31 19:00:00 1969 *************** *** 1 **** - (["Max, the local armourer":1,]) \ No newline at end of file --- 0 ---- diff -c -r --new-file ds1.1/lib/save/kills/b/bill ds2.0r27/lib/save/kills/b/bill *** ds1.1/lib/save/kills/b/bill Fri Jan 3 22:14:33 1997 --- ds2.0r27/lib/save/kills/b/bill Wed Dec 31 19:00:00 1969 *************** *** 1 **** - (["Bob":1,]) \ No newline at end of file --- 0 ---- diff -c -r --new-file ds1.1/lib/save/kills/f/faldirtest ds2.0r27/lib/save/kills/f/faldirtest *** ds1.1/lib/save/kills/f/faldirtest Fri Jan 3 22:14:33 1997 --- ds2.0r27/lib/save/kills/f/faldirtest Wed Dec 31 19:00:00 1969 *************** *** 1 **** - (["High mortal Fisher Faldirtest the skeleton":1,]) \ No newline at end of file --- 0 ---- diff -c -r --new-file ds1.1/lib/save/kills/m/matusa ds2.0r27/lib/save/kills/m/matusa *** ds1.1/lib/save/kills/m/matusa Fri Jan 3 22:14:33 1997 --- ds2.0r27/lib/save/kills/m/matusa Wed Dec 31 19:00:00 1969 *************** *** 1 **** - (["A wandering klingon rogue":1,"Max, the local armourer":6,"A wandering kobold kataan":1,"an avidryl guard":4,"Ambassador Harold":4,"Shiela, the local weapon vendor":5,"A wandering gnome rogue":1,"A wandering kobold rogue":2,"a golem":30,"Lars, the keeper of Lars' Pub":4,"a bear":3,"A wandering elf rogue":1,"A wandering avidryl rogue":1,"A wandering nymph rogue":1,"A wandering gnome fisher":1,"A wandering kender kataan":1,"a chipmunk":1,"a unicorn":4,"a dragon":1,"A wandering satyr rogue":1,]) \ No newline at end of file --- 0 ---- diff -c -r --new-file ds1.1/lib/save/kills/o/one ds2.0r27/lib/save/kills/o/one *** ds1.1/lib/save/kills/o/one Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/save/kills/o/one Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1 ---- + (["a mean-looking troll":1,"a thief in a bathtowel":1,"the boss orc":1,"a rat":1,"a dirty orc":5,"the orc shaman":1,]) \ No newline at end of file diff -c -r --new-file ds1.1/lib/save/kills/q/qtest ds2.0r27/lib/save/kills/q/qtest *** ds1.1/lib/save/kills/q/qtest Fri Jan 3 22:14:33 1997 --- ds2.0r27/lib/save/kills/q/qtest Wed Dec 31 19:00:00 1969 *************** *** 1 **** - (["Max, the local armourer":1,"a wicked balrog":4,"Shiela, the local weapon vendor":1,"Lars, the keeper of Lars' Pub":3,]) \ No newline at end of file --- 0 ---- diff -c -r --new-file ds1.1/lib/save/kills/r/rath ds2.0r27/lib/save/kills/r/rath *** ds1.1/lib/save/kills/r/rath Fri Jan 3 22:14:33 1997 --- ds2.0r27/lib/save/kills/r/rath Wed Dec 31 19:00:00 1969 *************** *** 1 **** - (["a golem":18,"a unicorn":4,"Lars, the keeper of Lars' Pub":1,"a chipmunk":2,"a bear":3,]) \ No newline at end of file --- 0 ---- diff -c -r --new-file ds1.1/lib/save/notify.o ds2.0r27/lib/save/notify.o *** ds1.1/lib/save/notify.o Fri Jan 3 22:14:34 1997 --- ds2.0r27/lib/save/notify.o Wed Jul 5 00:00:58 2006 *************** *** 1,2 **** #/daemon/notify.c ! Notes ({({847046018,"Descartes","Wrote new spell system /lib/spell.c, /lib/magic.c.",}),({847046059,"Descartes","Made up a disaster thing in /lib/disaster and /daemon/disasters.",}),({847078904,"Descartes","Fixed a bug in eat.c which would cause someone to lose their HB if they dropped food they were going to eat before the eating occurred.",}),({847845189,"Descartes","Fixed a problem in currency.c with currency weights... reuired mods to /lib/currency.c, /lib/living.c, and /lib/pile.c",}),({847851131,"Descartes","Added PK flag support in rooms.",}),({847851155,"Descartes","Added support for heart speed modifiers in LIB_BODY",}),({850276175,"Descartes","Changed messasing to be useable by things that do not need to print out immediately but need themessaging tokens... see the create_message() simul.",}),({850276199,"Descartes","Wrote a new soul daemon.",}),({850276213,"Descartes","Added support for emotes over channels.",}),({850670981,"Descartes","Added support for emote responses to sentient.c and cleaned up the sentient code. I am of course supposed to be working on my book and not LPMud stuff.",}),({850671447,"Descartes","Changed vendor.c to inherit LIB_SENTIENT",}),({850709006,"Descartes","Rewrote germ.c a bit to be more modern.",}),({850709086,"Descartes","Added a call to eventEncounter(object ob) in objects in a room when a new object enters. In other words, when an object ismoved somewhere, it calls eventEncounter(this_object()) in all objects in the new room telling them it is now there.",}),({851053706,"Descartes","Rewrote /lib/server and renamed it to /secure/lib/net/server.c. It now uses the new socket object and the new file object and will not screw up no matter how big files and data gets.",}),({851053807,"Descartes","Created /secure/lib/file.c It handles al sorts of file operations without having to concern about file sizes. It also contains methods for reading and writing in both binary and ascii formats. It also supports the creation of temporary files. new(LIB_FILE) creates a temp file.",}),({851053897,"Descartes","Created /lib/socket.c. Specific read/write functionality for sockets now should be handled by inheriting this object. Err, /secure/lib/net/socket.c See /secure/lib/net/http.c",}),({851053943,"Descartes","Created /secure/daemon/inet.c Can be configured to create internet services based on a port offset, socket type, and socket object. HTTP now runs through inet instead of as a daemon.",}),({851053953,"Descartes","Removed /daemon/http.c",}),({851053963,"Descartes","Created /secure/lib/net/http.c",}),({851151243,"Descartes","Movied positional stuff to /lib/position.h",}),({851151257,"Descartes","Added /lib/sit.c for things you can sit in.",}),({851207146,"Descartes","Started a restructure of the /lib directory since it is getting so crowded... /lib/comp: composite objects made up of different modules /lib/events: verb event handlers /lib/livings: composite objects specific to livngs More likely to come... /",}),({852162759,"Descartes","Added the sefun explode_items() to take an itemized list and explode it into elements without articles and ands.",}),}) --- 1,2 ---- #/daemon/notify.c ! Notes ({}) diff -c -r --new-file ds1.1/lib/save/races.o ds2.0r27/lib/save/races.o *** ds1.1/lib/save/races.o Fri Jan 3 22:14:34 1997 --- ds2.0r27/lib/save/races.o Wed Jul 5 00:00:58 2006 *************** *** 1,2 **** #/daemon/races.c ! Races (["demi-god":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),({"left leg","torso",2,({32,524288,1024,128,}),}),({"left arm","torso",2,({8,4096,131072,524288,65536,}),}),({"right arm","torso",2,({8,4096,131072,524288,65536,}),}),({"right leg","torso",2,({32,524288,1024,128,}),}),({"right foot","right leg",4,({64,128,16,32,}),}),({"right hand","right arm",4,({4,8,32768,65536,}),}),({"left foot","left leg",4,({64,128,16,32,}),}),({"left hand","left arm",4,({4,8,32768,65536,}),}),}),([64:"low",32:"high",]),(["coordination":(/2,31,/),"charisma":(/2,31,/),"speed":(/1,43,/),"luck":(/1,43,/),"intelligence":(/2,31,/),"durability":(/2,31,/),"agility":(/2,31,/),"strength":(/2,31,/),"wisdom":(/2,31,/),]),(["right hand":5,"left hand":5,]),({20,80,}),1,0,"Demi-godish",/),"tortoise":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),({"left rear leg","torso",3,({32,524288,1024,128,}),}),({"right rear leg","torso",3,({32,524288,1024,128,}),}),({"right foreleg","torso",3,({32,524288,1024,128,}),}),({"left foreleg","torso",3,({32,524288,1024,128,}),}),({"left forepaw","left foreleg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),}),([64:"medium",32:"high",16:"low",128:"medium",4:"low",2:"low",8:"low",]),(["coordination":(/2,31,/),"charisma":(/4,10,/),"speed":(/5,1,/),"luck":(/3,21,/),"charsima":(/5,1,/),"intelligence":(/3,21,/),"durability":(/1,43,/),"agility":(/4,10,/),"strength":(/5,1,/),"wisdom":(/1,43,/),]),([]),({20,80,}),1,0,"Tortoiseish",/),"deer":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),({"right rear leg","torso",3,({32,524288,1024,128,}),}),({"left foreleg","torso",3,({32,524288,1024,128,}),}),({"left rear leg","torso",3,({32,524288,1024,128,}),}),({"right foreleg","torso",3,({32,524288,1024,128,}),}),({"left fore-hoof","left foreleg",4,({}),}),({"left rear hoof","left rear leg",4,({}),}),({"right fore-hoof","right foreleg",4,({}),}),({"right rear hoof","right rear leg",4,({}),}),}),([64:"low",32:"high",]),(["coordination":(/4,10,/),"charisma":(/3,21,/),"speed":(/2,31,/),"luck":(/4,10,/),"intelligence":(/5,1,/),"durability":(/2,31,/),"agility":(/3,21,/),"strength":(/1,43,/),"wisdom":(/5,1,/),]),([]),({20,80,}),1,0,"Deerish",/),"fish":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),}),([64:"low",32:"high",16:"low",2:"low",]),(["coordination":(/2,31,/),"charisma":(/5,1,/),"speed":(/3,21,/),"luck":(/5,1,/),"intelligence":(/5,1,/),"durability":(/4,10,/),"agility":(/2,31,/),"strength":(/4,10,/),"wisdom":(/3,21,/),]),([]),({20,80,}),1,0,"Fishish",/),"faerie":(/({({"torso",0,1,({4096,8192,16384,65536,131072,524288,2048,}),}),({"head","torso",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,524288,}),}),({"left leg","torso",2,({32,128,1024,524288,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left arm","torso",3,({8,65536,8192,131072,524288,}),}),({"right arm","torso",3,({8,65536,8192,131072,524288,}),}),}),([16:"low",]),(["coordination":(/1,40,/),"charisma":(/3,30,/),"speed":(/2,40,/),"luck":(/2,30,/),"intelligence":(/2,10,/),"durability":(/5,10,/),"agility":(/1,60,/),"strength":(/5,5,/),"wisdom":(/2,15,/),]),(["right hand":5,"left wing":0,"left hand":5,"right wing":0,]),({30,80,}),1,1,"Elcharean",/),"ogre":(/({({"torso",0,1,({4096,8192,16384,65536,131072,524288,2048,}),}),({"head","torso",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,524288,}),}),({"left leg","torso",2,({32,128,1024,524288,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"right arm","torso",2,({8,65536,8192,131072,524288,}),}),({"left arm","torso",2,({8,65536,8192,131072,524288,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),}),([4:"low",2:"low",8:"low",]),(["coordination":(/5,2,/),"charisma":(/5,1,/),"speed":(/4,7,/),"luck":(/5,1,/),"intelligence":(/4,10,/),"durability":(/1,68,/),"agility":(/5,1,/),"strength":(/1,50,/),"wisdom":(/5,1,/),]),(["right hand":6,"left hand":6,]),({25,70,}),1,1,"Shangtai",/),"bear":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),({"left rear leg","torso",3,({32,524288,1024,128,}),}),({"right rear leg","torso",3,({32,524288,1024,128,}),}),({"right foreleg","torso",3,({32,524288,1024,128,}),}),({"left foreleg","torso",3,({32,524288,1024,128,}),}),({"left forepaw","left foreleg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),}),([64:"low",32:"high",]),(["coordination":(/5,1,/),"charisma":(/3,21,/),"speed":(/5,1,/),"luck":(/4,10,/),"intelligence":(/3,21,/),"durability":(/1,43,/),"agility":(/5,1,/),"strength":(/1,43,/),"wisdom":(/2,31,/),]),([]),({20,80,}),1,0,"Bearish",/),"hobbit":(/({({"torso",0,1,({4096,8192,16384,65536,131072,524288,2048,}),}),({"head","torso",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,524288,}),}),({"left leg","torso",2,({32,128,1024,524288,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left arm","torso",2,({8,65536,8192,131072,524288,}),}),({"right arm","torso",2,({8,65536,8192,131072,524288,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),}),([64:"low",]),(["coordination":(/3,60,/),"charisma":(/3,33,/),"speed":(/2,30,/),"luck":(/1,80,/),"intelligence":(/5,10,/),"durability":(/2,20,/),"agility":(/1,20,/),"strength":(/4,10,/),"wisdom":(/3,20,/),]),(["right hand":4,"left hand":4,]),({20,70,}),1,1,"Terrakarn",/),"goblin":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),({"left leg","torso",2,({32,524288,1024,128,}),}),({"left arm","torso",2,({8,4096,131072,524288,65536,}),}),({"right arm","torso",2,({8,4096,131072,524288,65536,}),}),({"right leg","torso",2,({32,524288,1024,128,}),}),({"right foot","right leg",4,({64,128,16,32,}),}),({"right hand","right arm",4,({4,8,32768,65536,}),}),({"left foot","left leg",4,({64,128,16,32,}),}),({"left hand","left arm",4,({4,8,32768,65536,}),}),}),([64:"high",32:"high",16:"low",2:"medium",]),(["coordination":(/3,21,/),"charisma":(/5,1,/),"speed":(/2,31,/),"luck":(/4,10,/),"intelligence":(/4,10,/),"durability":(/1,43,/),"agility":(/1,43,/),"strength":(/3,21,/),"wisdom":(/3,21,/),]),([]),({20,80,}),1,0,"Goblinish",/),"elf":(/({({"torso",0,1,({4096,8192,16384,65536,131072,524288,2048,}),}),({"head","torso",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,524288,}),}),({"left leg","torso",2,({32,128,1024,524288,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"right arm","torso",2,({8,65536,8192,131072,524288,}),}),({"left arm","torso",2,({8,65536,8192,131072,524288,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),}),([]),(["coordination":(/2,10,/),"charisma":(/1,40,/),"speed":(/3,4,/),"luck":(/1,50,/),"intelligence":(/1,40,/),"durability":(/4,20,/),"agility":(/3,40,/),"strength":(/5,15,/),"wisdom":(/1,30,/),]),(["right hand":5,"left hand":5,]),({17,73,}),1,1,"Eltherian",/),"sheep":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),({"right rear leg","torso",3,({32,524288,1024,128,}),}),({"left foreleg","torso",3,({32,524288,1024,128,}),}),({"left rear leg","torso",3,({32,524288,1024,128,}),}),({"right foreleg","torso",3,({32,524288,1024,128,}),}),({"left fore-hoof","left foreleg",4,({}),}),({"left rear hoof","left rear leg",4,({}),}),({"right fore-hoof","right foreleg",4,({}),}),({"right rear hoof","right rear leg",4,({}),}),}),([64:"medium",32:"high",16:"low",128:"medium",4:"low",2:"low",8:"low",]),(["coordination":(/4,10,/),"charisma":(/3,21,/),"speed":(/4,10,/),"luck":(/5,1,/),"charsima":(/5,1,/),"intelligence":(/5,1,/),"durability":(/3,21,/),"agility":(/3,21,/),"strength":(/3,21,/),"wisdom":(/5,1,/),]),([]),({20,80,}),1,0,"Sheepish",/),"bird":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),({"left leg","torso",2,({32,524288,1024,128,}),}),({"right leg","torso",2,({32,524288,1024,128,}),}),({"left foot","left leg",4,({64,128,16,32,}),}),({"right foot","right leg",4,({64,128,16,32,}),}),({"right wing","torso",4,({}),}),({"left wing","torso",4,({}),}),}),([64:"low",32:"high",]),(["coordination":(/4,10,/),"charisma":(/2,31,/),"speed":(/1,43,/),"luck":(/3,21,/),"intelligence":(/5,1,/),"durability":(/5,1,/),"agility":(/1,43,/),"strength":(/4,10,/),"wisdom":(/4,10,/),]),([]),({20,80,}),1,0,"Birdish",/),"cat":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),({"left rear leg","torso",3,({32,524288,1024,128,}),}),({"right rear leg","torso",3,({32,524288,1024,128,}),}),({"right foreleg","torso",3,({32,524288,1024,128,}),}),({"left foreleg","torso",3,({32,524288,1024,128,}),}),({"left forepaw","left foreleg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),({"tail","torso",5,({}),}),}),([64:"low",32:"high",]),(["coordination":(/3,21,/),"charisma":(/1,43,/),"speed":(/2,31,/),"luck":(/1,43,/),"intelligence":(/5,1,/),"durability":(/4,10,/),"agility":(/1,43,/),"strength":(/4,10,/),"wisdom":(/4,10,/),]),([]),({20,80,}),1,0,"Catish",/),"snake":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),}),([64:"medium",32:"high",16:"low",128:"medium",4:"low",2:"low",8:"low",]),(["coordination":(/5,1,/),"charisma":(/5,1,/),"speed":(/4,10,/),"luck":(/1,43,/),"charsima":(/5,1,/),"intelligence":(/4,10,/),"durability":(/4,10,/),"agility":(/4,10,/),"strength":(/5,1,/),"wisdom":(/2,31,/),]),([]),({20,80,}),1,0,"Snakeish",/),"pig":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),({"right rear leg","torso",3,({32,524288,1024,128,}),}),({"left foreleg","torso",3,({32,524288,1024,128,}),}),({"left rear leg","torso",3,({32,524288,1024,128,}),}),({"right foreleg","torso",3,({32,524288,1024,128,}),}),({"left fore-hoof","left foreleg",4,({}),}),({"left rear hoof","left rear leg",4,({}),}),({"right fore-hoof","right foreleg",4,({}),}),({"right rear hoof","right rear leg",4,({}),}),}),([64:"medium",32:"high",16:"low",128:"medium",4:"low",2:"low",8:"low",]),(["coordination":(/3,21,/),"charisma":(/5,1,/),"speed":(/4,10,/),"luck":(/5,1,/),"charsima":(/5,1,/),"intelligence":(/5,1,/),"durability":(/1,43,/),"agility":(/5,1,/),"strength":(/3,21,/),"wisdom":(/2,31,/),]),([]),({20,80,}),1,0,"Pigish",/),"cow":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),({"right rear leg","torso",3,({32,524288,1024,128,}),}),({"left foreleg","torso",3,({32,524288,1024,128,}),}),({"left rear leg","torso",3,({32,524288,1024,128,}),}),({"right foreleg","torso",3,({32,524288,1024,128,}),}),({"left fore-hoof","left foreleg",4,({}),}),({"left rear hoof","left rear leg",4,({}),}),({"right fore-hoof","right foreleg",4,({}),}),({"right rear hoof","right rear leg",4,({}),}),}),([64:"low",32:"high",]),(["coordination":(/3,21,/),"charisma":(/4,10,/),"speed":(/5,1,/),"luck":(/5,1,/),"intelligence":(/5,1,/),"durability":(/1,43,/),"agility":(/5,1,/),"strength":(/2,31,/),"wisdom":(/5,1,/),]),([]),({20,80,}),1,0,"Cowish",/),"half-orc":(/({({"torso",0,1,({4096,8192,16384,65536,131072,524288,2048,}),}),({"head","torso",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,524288,}),}),({"left leg","torso",2,({32,128,1024,524288,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left arm","torso",2,({8,65536,8192,131072,524288,}),}),({"right arm","torso",2,({8,65536,8192,131072,524288,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),}),([]),(["coordination":(/3,20,/),"charisma":(/5,4,/),"speed":(/1,70,/),"luck":(/5,1,/),"intelligence":(/2,15,/),"durability":(/2,40,/),"agility":(/4,2,/),"strength":(/2,20,/),"wisdom":(/5,10,/),]),(["right hand":4,"left hand":4,]),({12,62,}),1,1,"Tangetto",/),"lizard":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),}),([64:"medium",32:"high",16:"low",4:"medium",2:"medium",8:"medium",128:"medium",]),(["coordination":(/3,21,/),"charisma":(/4,10,/),"speed":(/3,21,/),"luck":(/4,10,/),"charsima":(/5,1,/),"intelligence":(/5,1,/),"durability":(/3,21,/),"agility":(/3,21,/),"strength":(/3,21,/),"wisdom":(/5,1,/),]),([]),({20,80,}),1,0,"Lizardish",/),"rodent":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),({"left rear leg","torso",3,({32,524288,1024,128,}),}),({"right rear leg","torso",3,({32,524288,1024,128,}),}),({"right foreleg","torso",3,({32,524288,1024,128,}),}),({"left foreleg","torso",3,({32,524288,1024,128,}),}),({"left forepaw","left foreleg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),}),([64:"medium",32:"high",16:"low",128:"medium",4:"low",2:"low",8:"low",]),(["coordination":(/4,10,/),"charisma":(/5,1,/),"speed":(/2,31,/),"luck":(/5,1,/),"charsima":(/5,1,/),"intelligence":(/5,1,/),"durability":(/4,10,/),"agility":(/3,21,/),"strength":(/5,1,/),"wisdom":(/4,10,/),]),([]),({20,80,}),1,0,"Rodentish",/),"artrell":(/({({"torso",0,1,({4096,8192,16384,65536,131072,524288,2048,}),}),({"head","torso",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,524288,}),}),({"left leg","torso",2,({32,128,1024,524288,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"first arm","torso",3,({8,65536,8192,131072,524288,}),}),({"second arm","torso",3,({8,65536,8192,131072,524288,}),}),({"third arm","torso",3,({8,65536,8192,131072,524288,}),}),({"fourth arm","torso",3,({8,65536,8192,131072,524288,}),}),({"first hand","first arm",4,({2,4,8,32768,65536,}),}),({"second hand","second arm",4,({2,4,8,32768,65536,}),}),({"third hand","third arm",4,({2,4,8,32768,65536,}),}),({"fourth hand","fourth arm",4,({2,4,8,32768,65536,}),}),}),([64:"low",32:"high",]),(["coordination":(/3,40,/),"charisma":(/4,0,/),"speed":(/2,40,/),"luck":(/3,33,/),"intelligence":(/4,10,/),"durability":(/3,10,/),"agility":(/1,50,/),"strength":(/3,10,/),"wisdom":(/5,5,/),]),(["first hand":2,"fourth hand":2,"second hand":2,"third hand":2,]),({7,61,}),1,1,"Artrexcian",/),"primate":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),({"left leg","torso",2,({32,524288,1024,128,}),}),({"left arm","torso",2,({8,4096,131072,524288,65536,}),}),({"right arm","torso",2,({8,4096,131072,524288,65536,}),}),({"right leg","torso",2,({32,524288,1024,128,}),}),({"right foot","right leg",4,({64,128,16,32,}),}),({"right hand","right arm",4,({4,8,32768,65536,}),}),({"left foot","left leg",4,({64,128,16,32,}),}),({"left hand","left arm",4,({4,8,32768,65536,}),}),}),([64:"medium",32:"high",16:"low",128:"medium",4:"low",2:"low",8:"low",]),(["coordination":(/3,21,/),"charisma":(/3,21,/),"speed":(/3,21,/),"luck":(/3,21,/),"charsima":(/5,1,/),"intelligence":(/3,21,/),"durability":(/4,10,/),"agility":(/3,21,/),"strength":(/4,10,/),"wisdom":(/4,10,/),]),([]),({20,80,}),1,0,"Primateish",/),"arachnid":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),({"1st leg","torso",3,({32,524288,1024,128,}),}),({"8th leg","torso",3,({32,524288,1024,128,}),}),({"2nd leg","torso",3,({32,524288,1024,128,}),}),({"5th leg","torso",3,({32,524288,1024,128,}),}),({"7th leg","torso",3,({32,524288,1024,128,}),}),({"4th leg","torso",3,({32,524288,1024,128,}),}),({"3rd leg","torso",3,({32,524288,1024,128,}),}),({"6th leg","torso",3,({32,524288,1024,128,}),}),}),([]),(["coordination":(/1,43,/),"charisma":(/5,1,/),"speed":(/2,31,/),"luck":(/3,21,/),"intelligence":(/3,21,/),"durability":(/5,1,/),"agility":(/1,43,/),"strength":(/4,10,/),"wisdom":(/5,1,/),]),([]),({20,80,}),1,0,"Arachnidish",/),"dwarf":(/({({"torso",0,1,({4096,8192,16384,65536,131072,524288,2048,}),}),({"head","torso",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,524288,}),}),({"left leg","torso",2,({32,128,1024,524288,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left arm","torso",2,({8,65536,8192,131072,524288,}),}),({"right arm","torso",2,({8,65536,8192,131072,524288,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),}),([64:"low",2:"low",]),(["coordination":(/2,10,/),"charisma":(/3,11,/),"speed":(/3,20,/),"luck":(/1,60,/),"intelligence":(/3,11,/),"durability":(/1,60,/),"agility":(/2,10,/),"strength":(/1,40,/),"wisdom":(/3,20,/),]),(["right hand":4,"left hand":4,]),({15,65,}),1,1,"Malkierien",/),"nymph":(/({({"torso",0,1,({4096,8192,16384,65536,131072,524288,2048,}),}),({"head","torso",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,524288,}),}),({"left leg","torso",2,({32,128,1024,524288,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left arm","torso",2,({8,65536,8192,131072,524288,}),}),({"right arm","torso",2,({8,65536,8192,131072,524288,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),}),([]),(["coordination":(/2,20,/),"charisma":(/1,80,/),"speed":(/2,60,/),"luck":(/2,50,/),"intelligence":(/4,25,/),"durability":(/5,7,/),"agility":(/1,50,/),"strength":(/5,3,/),"wisdom":(/4,20,/),]),(["right hand":5,"left hand":5,]),({26,76,}),1,1,"Nymal",/),"troll":(/({({"torso",0,1,({4096,8192,16384,65536,131072,524288,2048,}),}),({"head","torso",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,524288,}),}),({"left leg","torso",2,({32,128,1024,524288,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left arm","torso",2,({8,65536,8192,131072,524288,}),}),({"right arm","torso",2,({8,65536,8192,131072,524288,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),}),([2:"low",]),(["coordination":(/2,10,/),"charisma":(/3,11,/),"speed":(/3,20,/),"luck":(/4,15,/),"intelligence":(/3,11,/),"durability":(/1,65,/),"agility":(/2,10,/),"strength":(/1,50,/),"wisdom":(/5,5,/),]),(["right hand":4,"left hand":4,]),({15,65,}),1,0,"Trollish",/),"pegasus":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),({"left foreleg","torso",3,({32,524288,1024,128,}),}),({"left wing","torso",3,({}),}),({"right rear leg","torso",3,({32,524288,1024,128,}),}),({"right foreleg","torso",3,({32,524288,1024,128,}),}),({"left rear leg","torso",3,({32,524288,1024,128,}),}),({"right wing","torso",3,({}),}),({"right rear hoof","right rear leg",4,({}),}),({"left fore-hoof","left foreleg",4,({}),}),({"left rear hoof","left rear leg",4,({}),}),({"right fore-hoof","right foreleg",4,({}),}),}),([64:"medium",32:"high",16:"low",128:"medium",4:"low",2:"low",8:"low",]),(["coordination":(/2,31,/),"charisma":(/1,43,/),"speed":(/2,31,/),"luck":(/1,43,/),"charsima":(/5,1,/),"intelligence":(/3,21,/),"durability":(/2,31,/),"agility":(/1,43,/),"strength":(/2,31,/),"wisdom":(/2,31,/),]),([]),({20,80,}),1,0,"Pegasusish",/),"elephant":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),({"left rear leg","torso",3,({32,524288,1024,128,}),}),({"right rear leg","torso",3,({32,524288,1024,128,}),}),({"left foreleg","torso",3,({32,524288,1024,128,}),}),({"right foreleg","torso",3,({32,524288,1024,128,}),}),({"trunk","head",3,({}),}),({"right forepaw","right foreleg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"left forepaw","left foreleg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),}),([64:"low",32:"high",2:"low",]),(["coordination":(/3,21,/),"charisma":(/4,10,/),"speed":(/4,10,/),"luck":(/3,21,/),"intelligence":(/4,10,/),"durability":(/1,43,/),"agility":(/5,1,/),"strength":(/1,43,/),"wisdom":(/1,43,/),]),([]),({20,80,}),1,0,"Elephantish",/),"griffin":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),({"right rear leg","torso",3,({32,524288,1024,128,}),}),({"left foreleg","torso",3,({32,524288,1024,128,}),}),({"left rear leg","torso",3,({32,524288,1024,128,}),}),({"left wing","torso",3,({}),}),({"right wing","torso",3,({}),}),({"right foreleg","torso",3,({32,524288,1024,128,}),}),({"left forepaw","left foreleg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),}),([64:"high",32:"high",16:"low",2:"medium",]),(["coordination":(/2,31,/),"charisma":(/5,1,/),"speed":(/2,31,/),"luck":(/1,43,/),"intelligence":(/5,1,/),"durability":(/1,43,/),"agility":(/2,31,/),"strength":(/1,43,/),"wisdom":(/4,10,/),]),([]),({20,80,}),1,0,"Griffinish",/),"chimera":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"lion head","torso",2,({524288,512,256,8192,}),}),({"goat head","torso",2,({524288,512,256,8192,}),}),({"dragon head","torso",2,({524288,512,256,8192,}),}),({"right wing","torso",3,({}),}),({"left wing","torso",3,({}),}),({"left rear leg","torso",3,({32,524288,1024,128,}),}),({"right rear leg","torso",3,({32,524288,1024,128,}),}),({"left foreleg","torso",3,({32,524288,1024,128,}),}),({"right foreleg","torso",3,({32,524288,1024,128,}),}),({"left forepaw","left foreleg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),}),([64:"low",32:"high",]),(["coordination":(/4,10,/),"charisma":(/5,1,/),"speed":(/1,43,/),"luck":(/4,10,/),"intelligence":(/3,21,/),"durability":(/2,31,/),"agility":(/2,31,/),"strength":(/3,21,/),"wisdom":(/3,21,/),]),([]),({20,80,}),1,0,"Chimeraish",/),"dryad":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),({"left leg","torso",2,({32,524288,1024,128,}),}),({"left arm","torso",2,({8,4096,131072,524288,65536,}),}),({"right arm","torso",2,({8,4096,131072,524288,65536,}),}),({"right leg","torso",2,({32,524288,1024,128,}),}),({"right foot","right leg",4,({64,128,16,32,}),}),({"right hand","right arm",4,({4,8,32768,65536,}),}),({"left foot","left leg",4,({64,128,16,32,}),}),}),([64:"low",32:"high",]),(["coordination":(/3,21,/),"charisma":(/1,43,/),"speed":(/2,31,/),"luck":(/2,31,/),"intelligence":(/4,10,/),"durability":(/5,1,/),"agility":(/2,31,/),"strength":(/4,10,/),"wisdom":(/2,31,/),]),(["right hand":5,"left hand":0,]),({20,80,}),1,0,"Dryadish",/),"gnoll":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),({"left leg","torso",2,({32,524288,1024,128,}),}),({"left arm","torso",2,({8,4096,131072,524288,65536,}),}),({"right arm","torso",2,({8,4096,131072,524288,65536,}),}),({"right leg","torso",2,({32,524288,1024,128,}),}),({"right foot","right leg",4,({64,128,16,32,}),}),({"right hand","right arm",4,({4,8,32768,65536,}),}),({"left foot","left leg",4,({64,128,16,32,}),}),({"left hand","left arm",4,({4,8,32768,65536,}),}),}),([64:"high",32:"high",16:"low",2:"medium",]),(["coordination":(/2,31,/),"charisma":(/5,1,/),"speed":(/3,21,/),"luck":(/2,31,/),"intelligence":(/4,10,/),"durability":(/3,21,/),"agility":(/2,31,/),"strength":(/3,21,/),"wisdom":(/4,10,/),]),([]),({20,80,}),1,0,"Gnollish",/),"plant":(/({({"trunk",0,1,({}),}),({"1st branch","trunk",3,({}),}),}),([64:"medium",32:"high",16:"low",128:"medium",4:"low",2:"low",8:"low",]),(["coordination":(/5,1,/),"charisma":(/3,21,/),"speed":(/5,1,/),"luck":(/3,21,/),"charsima":(/5,1,/),"intelligence":(/5,1,/),"durability":(/3,21,/),"agility":(/5,1,/),"strength":(/3,21,/),"wisdom":(/5,1,/),]),([]),({20,80,}),1,0,"Plantish",/),"kobold":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),({"left leg","torso",2,({32,524288,1024,128,}),}),({"left arm","torso",2,({8,4096,131072,524288,65536,}),}),({"right arm","torso",2,({8,4096,131072,524288,65536,}),}),({"right leg","torso",2,({32,524288,1024,128,}),}),({"left hand","left arm",4,({4,8,32768,65536,}),}),({"right hand","right arm",4,({4,8,32768,65536,}),}),({"left hoof","left leg",4,({}),}),({"right hoof","right leg",4,({}),}),}),([64:"medium",32:"high",16:"low",4:"medium",2:"medium",8:"medium",128:"medium",]),(["coordination":(/2,31,/),"charisma":(/4,10,/),"speed":(/3,21,/),"luck":(/3,21,/),"charsima":(/5,1,/),"intelligence":(/4,10,/),"durability":(/1,43,/),"agility":(/3,21,/),"strength":(/1,43,/),"wisdom":(/4,10,/),]),([]),({20,80,}),1,1,"Koboldish",/),"human":(/({({"torso",0,1,({4096,8192,16384,65536,131072,524288,2048,}),}),({"head","torso",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,524288,}),}),({"left leg","torso",2,({32,128,1024,524288,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"right arm","torso",2,({8,65536,8192,131072,524288,}),}),({"left arm","torso",2,({8,65536,8192,131072,524288,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),}),([]),(["coordination":(/2,33,/),"charisma":(/2,33,/),"speed":(/3,20,/),"luck":(/3,10,/),"intelligence":(/1,50,/),"durability":(/4,30,/),"agility":(/3,33,/),"strength":(/4,10,/),"wisdom":(/3,50,/),]),(["right hand":5,"left hand":5,]),({25,75,}),1,1,"Farsi",/),"horse":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),({"right rear leg","torso",3,({32,524288,1024,128,}),}),({"left foreleg","torso",3,({32,524288,1024,128,}),}),({"left rear leg","torso",3,({32,524288,1024,128,}),}),({"right foreleg","torso",3,({32,524288,1024,128,}),}),({"left fore-hoof","left foreleg",4,({}),}),({"left rear hoof","left rear leg",4,({}),}),({"right fore-hoof","right foreleg",4,({}),}),({"right rear hoof","right rear leg",4,({}),}),}),([64:"low",32:"high",16:"low",2:"medium",]),(["coordination":(/4,10,/),"charisma":(/3,21,/),"speed":(/2,31,/),"luck":(/5,1,/),"charsima":(/5,1,/),"intelligence":(/5,1,/),"durability":(/2,31,/),"agility":(/2,31,/),"strength":(/1,43,/),"wisdom":(/5,1,/),]),([]),({20,80,}),1,0,"Horseish",/),"halfling":(/({({"torso",0,1,({4096,8192,16384,65536,131072,524288,2048,}),}),({"head","torso",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,524288,}),}),({"left leg","torso",2,({32,128,1024,524288,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left arm","torso",2,({8,65536,8192,131072,524288,}),}),({"right arm","torso",2,({8,65536,8192,131072,524288,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),}),([]),(["coordination":(/3,33,/),"charisma":(/2,20,/),"speed":(/1,30,/),"luck":(/2,80,/),"intelligence":(/5,1,/),"durability":(/3,10,/),"agility":(/2,40,/),"strength":(/3,20,/),"wisdom":(/4,10,/),]),(["right hand":5,"left hand":5,]),({15,65,}),1,1,"Ersi",/),"slug":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),}),([64:"medium",32:"high",16:"low",128:"medium",4:"low",2:"low",8:"low",]),(["coordination":(/5,1,/),"charisma":(/5,1,/),"speed":(/5,1,/),"luck":(/5,1,/),"charsima":(/5,1,/),"intelligence":(/5,1,/),"durability":(/5,1,/),"agility":(/5,1,/),"strength":(/4,10,/),"wisdom":(/4,10,/),]),([]),({20,80,}),1,0,"Slugish",/),"tree":(/({({"trunk",0,1,({}),}),({"1st branch","trunk",3,({}),}),}),([64:"medium",32:"high",16:"low",128:"medium",4:"low",2:"low",8:"low",]),(["coordination":(/5,1,/),"charisma":(/3,21,/),"speed":(/5,1,/),"luck":(/1,43,/),"charsima":(/5,1,/),"intelligence":(/5,1,/),"durability":(/1,43,/),"agility":(/5,1,/),"strength":(/3,21,/),"wisdom":(/4,10,/),]),([]),({20,80,}),1,0,"Treeish",/),"unicorn":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),}),([64:"medium",32:"high",16:"low",128:"medium",4:"low",2:"low",8:"low",]),(["coordination":(/2,31,/),"charisma":(/5,1,/),"speed":(/3,21,/),"luck":(/1,43,/),"charsima":(/5,1,/),"intelligence":(/4,10,/),"durability":(/3,21,/),"agility":(/2,31,/),"strength":(/3,21,/),"wisdom":(/2,31,/),]),([]),({20,80,}),1,0,"Unicornish",/),"dragon":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),({"right rear leg","torso",3,({32,524288,1024,128,}),}),({"left foreleg","torso",3,({32,524288,1024,128,}),}),({"left rear leg","torso",3,({32,524288,1024,128,}),}),({"left wing","torso",3,({}),}),({"right wing","torso",3,({}),}),({"right foreleg","torso",3,({32,524288,1024,128,}),}),({"left forepaw","left foreleg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),}),([64:"low",32:"high",]),(["coordination":(/3,21,/),"charisma":(/2,31,/),"speed":(/3,21,/),"luck":(/1,43,/),"intelligence":(/2,31,/),"durability":(/1,43,/),"agility":(/1,43,/),"strength":(/1,43,/),"wisdom":(/1,43,/),]),([]),({20,80,}),1,0,"Dragonish",/),"wraith":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),({"left leg","torso",2,({32,524288,1024,128,}),}),({"left arm","torso",2,({8,4096,131072,524288,65536,}),}),({"right arm","torso",2,({8,4096,131072,524288,65536,}),}),({"right leg","torso",2,({32,524288,1024,128,}),}),({"right foot","right leg",4,({64,128,16,32,}),}),({"right hand","right arm",4,({4,8,32768,65536,}),}),({"left foot","left leg",4,({64,128,16,32,}),}),({"left hand","left arm",4,({4,8,32768,65536,}),}),}),([64:"medium",32:"high",16:"low",128:"medium",4:"low",2:"low",8:"low",]),(["coordination":(/2,31,/),"charisma":(/5,1,/),"speed":(/3,21,/),"luck":(/1,43,/),"charsima":(/5,1,/),"intelligence":(/4,10,/),"durability":(/3,21,/),"agility":(/2,31,/),"strength":(/3,21,/),"wisdom":(/2,31,/),]),([]),({20,80,}),1,0,"Wraithish",/),"giant":(/({({"torso",0,1,({4096,8192,16384,65536,131072,524288,2048,}),}),({"head","torso",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,524288,}),}),({"left leg","torso",2,({32,128,1024,524288,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left arm","torso",2,({8,65536,8192,131072,524288,}),}),({"right arm","torso",2,({8,65536,8192,131072,524288,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),}),([2:"medium",]),(["coordination":(/3,10,/),"charisma":(/4,10,/),"speed":(/5,1,/),"luck":(/4,5,/),"intelligence":(/3,10,/),"durability":(/1,70,/),"agility":(/5,2,/),"strength":(/1,80,/),"wisdom":(/5,1,/),]),(["right hand":6,"left hand":6,]),({27,65,}),1,1,"Loyavenku",/),"gargoyle":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),({"left arm","torso",3,({8,4096,131072,524288,65536,}),}),({"right rear leg","torso",3,({32,524288,1024,128,}),}),({"right arm","torso",3,({8,4096,131072,524288,65536,}),}),({"left foreleg","torso",3,({32,524288,1024,128,}),}),({"left rear leg","torso",3,({32,524288,1024,128,}),}),({"left wing","torso",3,({}),}),({"right wing","torso",3,({}),}),({"right foreleg","torso",3,({32,524288,1024,128,}),}),({"left forepaw","left foreleg",4,({}),}),({"left hand","left arm",4,({4,8,32768,65536,}),}),({"right forepaw","right foreleg",4,({}),}),({"right hand","right arm",4,({4,8,32768,65536,}),}),({"left rear paw","left rear leg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),}),([64:"low",32:"high",16:"low",2:"low",]),(["coordination":(/2,31,/),"charisma":(/5,1,/),"speed":(/4,10,/),"luck":(/4,10,/),"intelligence":(/4,10,/),"durability":(/1,43,/),"agility":(/5,1,/),"strength":(/1,43,/),"wisdom":(/2,31,/),]),([]),({20,80,}),1,0,"Gargoyleish",/),"orc":(/({({"torso",0,1,({4096,8192,16384,65536,131072,524288,2048,}),}),({"head","torso",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,524288,}),}),({"left leg","torso",2,({32,128,1024,524288,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left arm","torso",2,({8,65536,8192,131072,524288,}),}),({"right arm","torso",2,({8,65536,8192,131072,524288,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),}),([]),(["coordination":(/3,33,/),"charisma":(/5,1,/),"speed":(/2,40,/),"luck":(/4,3,/),"intelligence":(/5,3,/),"durability":(/2,30,/),"agility":(/4,10,/),"strength":(/2,35,/),"wisdom":(/5,3,/),]),(["right hand":6,"left hand":6,]),({21,71,}),1,1,"Tangetto",/),"golem":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),({"left leg","torso",2,({32,524288,1024,128,}),}),({"left arm","torso",2,({8,4096,131072,524288,65536,}),}),({"right arm","torso",2,({8,4096,131072,524288,65536,}),}),({"right leg","torso",2,({32,524288,1024,128,}),}),({"right foot","right leg",4,({64,128,16,32,}),}),({"right hand","right arm",4,({4,8,32768,65536,}),}),({"left foot","left leg",4,({64,128,16,32,}),}),({"left hand","left arm",4,({4,8,32768,65536,}),}),}),([64:"high",32:"high",16:"low",2:"medium",]),(["coordination":(/3,21,/),"charisma":(/5,1,/),"speed":(/3,21,/),"luck":(/5,1,/),"intelligence":(/4,10,/),"durability":(/2,31,/),"agility":(/3,21,/),"strength":(/1,43,/),"wisdom":(/2,31,/),]),([]),({20,80,}),1,0,"Golemish",/),"balrog":(/({({"torso",0,1,({4096,8192,16384,65536,131072,524288,2048,}),}),({"head","torso",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,524288,}),}),({"left leg","torso",2,({32,128,1024,524288,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"right arm","torso",2,({8,65536,8192,131072,524288,}),}),({"left arm","torso",2,({8,65536,8192,131072,524288,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),}),([128:"high",]),(["coordination":(/3,30,/),"charisma":(/5,1,/),"speed":(/2,30,/),"luck":(/3,20,/),"intelligence":(/2,30,/),"durability":(/1,40,/),"agility":(/1,40,/),"strength":(/3,30,/),"wisdom":(/3,10,/),]),(["right hand":6,"left hand":6,]),({10,67,}),1,0,"Balrog",/),"klingon":(/({({"torso",0,1,({4096,8192,16384,65536,131072,524288,2048,}),}),({"head","torso",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,524288,}),}),({"left leg","torso",2,({32,128,1024,524288,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"right arm","torso",2,({8,65536,8192,131072,524288,}),}),({"left arm","torso",2,({8,65536,8192,131072,524288,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),}),([64:"medium",8:"medium",128:"medium",2:"medium",4:"medium",]),(["coordination":(/2,10,/),"charisma":(/5,10,/),"speed":(/3,30,/),"luck":(/4,1,/),"intelligence":(/4,5,/),"durability":(/1,60,/),"agility":(/2,30,/),"strength":(/1,60,/),"wisdom":(/5,1,/),]),(["right hand":5,"left hand":5,]),({19,65,}),1,1,"T'linghan",/),"insect":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),({"4th leg","torso",3,({32,524288,1024,128,}),}),({"6th leg","torso",3,({32,524288,1024,128,}),}),({"5th leg","torso",3,({32,524288,1024,128,}),}),({"1st leg","torso",3,({32,524288,1024,128,}),}),({"3rd leg","torso",3,({32,524288,1024,128,}),}),({"2nd leg","torso",3,({32,524288,1024,128,}),}),}),([64:"low",32:"high",16:"low",2:"medium",]),(["coordination":(/3,21,/),"charisma":(/5,1,/),"speed":(/1,43,/),"luck":(/1,43,/),"charsima":(/5,1,/),"intelligence":(/5,1,/),"durability":(/5,1,/),"agility":(/2,31,/),"strength":(/5,1,/),"wisdom":(/5,1,/),]),([]),({20,80,}),1,0,"Insectish",/),"dog":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),({"left rear leg","torso",3,({32,524288,1024,128,}),}),({"right rear leg","torso",3,({32,524288,1024,128,}),}),({"right foreleg","torso",3,({32,524288,1024,128,}),}),({"left foreleg","torso",3,({32,524288,1024,128,}),}),({"left forepaw","left foreleg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),}),([64:"low",32:"high",]),(["coordination":(/4,10,/),"charisma":(/2,31,/),"speed":(/3,21,/),"luck":(/4,10,/),"intelligence":(/4,10,/),"durability":(/3,21,/),"agility":(/3,21,/),"strength":(/3,21,/),"wisdom":(/5,1,/),]),([]),({20,80,}),1,0,"Dogish",/),"kender":(/({({"torso",0,1,({4096,8192,16384,65536,131072,524288,2048,}),}),({"head","torso",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,524288,}),}),({"left leg","torso",2,({32,128,1024,524288,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left arm","torso",2,({8,65536,8192,131072,524288,}),}),({"right arm","torso",2,({8,65536,8192,131072,524288,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),}),([]),(["coordination":(/2,50,/),"charisma":(/2,40,/),"speed":(/1,50,/),"luck":(/3,33,/),"intelligence":(/2,20,/),"durability":(/1,20,/),"agility":(/3,40,/),"strength":(/5,3,/),"wisdom":(/4,7,/),]),(["right hand":5,"left hand":5,]),({23,78,}),1,1,"Kendrall",/),"satyr":(/({({"torso",0,1,({4096,8192,16384,65536,131072,524288,2048,}),}),({"head","torso",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,524288,}),}),({"left leg","torso",2,({32,128,1024,524288,}),}),({"right hoof","right leg",4,({16,32,64,128,}),}),({"left hoof","left leg",4,({16,32,64,128,}),}),({"left arm","torso",2,({8,65536,8192,131072,524288,}),}),({"right arm","torso",2,({8,65536,8192,131072,524288,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),}),([]),(["coordination":(/1,60,/),"charisma":(/5,3,/),"speed":(/2,5,/),"luck":(/1,10,/),"intelligence":(/3,33,/),"durability":(/2,25,/),"agility":(/2,50,/),"strength":(/4,2,/),"wisdom":(/1,80,/),]),(["right hand":4,"left hand":4,]),({27,77,}),1,1,"Wulinaxian",/),"avidryl":(/({({"torso",0,1,({4096,8192,16384,65536,131072,524288,2048,}),}),({"head","torso",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,524288,8192,}),}),({"left leg","torso",2,({32,128,1024,524288,8192,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"right arm","torso",2,({8,65536,8192,131072,524288,}),}),({"left arm","torso",2,({8,65536,8192,131072,524288,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"right wing","torso",4,({}),}),({"left wing","torso",4,({}),}),}),([]),(["coordination":(/1,30,/),"charisma":(/3,20,/),"speed":(/3,20,/),"intelligence":(/4,15,/),"luck":(/5,2,/),"durability":(/2,20,/),"agility":(/1,50,/),"strength":(/2,40,/),"wisdom":(/5,10,/),]),(["right hand":5,"left hand":5,]),({15,85,}),1,0,"Avidryl",/),"half-elf":(/({({"torso",0,1,({4096,8192,16384,65536,131072,524288,2048,}),}),({"head","torso",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,524288,}),}),({"left leg","torso",2,({32,128,1024,524288,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left arm","torso",2,({8,65536,8192,131072,524288,}),}),({"right arm","torso",2,({8,65536,8192,131072,524288,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),}),([]),(["coordination":(/1,50,/),"charisma":(/3,3,/),"speed":(/1,60,/),"luck":(/4,2,/),"intelligence":(/3,33,/),"durability":(/5,5,/),"agility":(/2,10,/),"strength":(/3,15,/),"wisdom":(/2,33,/),]),(["right hand":4,"left hand":4,]),({12,62,}),1,1,"Eltherian",/),"gnome":(/({({"torso",0,1,({4096,8192,16384,65536,131072,524288,2048,}),}),({"head","torso",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,524288,}),}),({"left leg","torso",2,({32,128,1024,524288,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left arm","torso",2,({8,65536,8192,131072,524288,}),}),({"right arm","torso",2,({8,65536,8192,131072,524288,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),}),([]),(["coordination":(/3,35,/),"charisma":(/5,1,/),"speed":(/2,20,/),"luck":(/2,40,/),"intelligence":(/1,50,/),"durability":(/4,10,/),"agility":(/3,20,/),"strength":(/3,30,/),"wisdom":(/1,40,/),]),(["right hand":4,"left hand":4,]),({8,61,}),1,1,"Nibelungen",/),"god":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),({"left leg","torso",2,({32,524288,1024,128,}),}),({"left arm","torso",2,({8,4096,131072,524288,65536,}),}),({"right arm","torso",2,({8,4096,131072,524288,65536,}),}),({"right leg","torso",2,({32,524288,1024,128,}),}),({"right foot","right leg",4,({64,128,16,32,}),}),({"right hand","right arm",4,({4,8,32768,65536,}),}),({"left foot","left leg",4,({64,128,16,32,}),}),({"left hand","left arm",4,({4,8,32768,65536,}),}),}),([64:"high",32:"high",16:"low",2:"medium",]),(["coordination":(/1,43,/),"charisma":(/1,43,/),"speed":(/1,43,/),"luck":(/1,43,/),"intelligence":(/1,43,/),"durability":(/1,43,/),"agility":(/1,43,/),"strength":(/1,43,/),"wisdom":(/1,43,/),]),([]),({20,80,}),1,0,"Godish",/),"elemental":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),}),([64:"low",32:"high",2:"low",]),(["coordination":(/3,21,/),"charisma":(/3,21,/),"speed":(/3,21,/),"luck":(/3,21,/),"intelligence":(/3,21,/),"durability":(/3,21,/),"agility":(/3,21,/),"strength":(/3,21,/),"wisdom":(/3,21,/),]),([]),({20,80,}),1,0,"Elementalish",/),"bat":(/({({"torso",0,1,({4096,8192,16384,65536,131072,524288,2048,}),}),({"head","torso",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,524288,}),}),({"left leg","torso",2,({32,128,1024,524288,}),}),({"right claw","right leg",4,({16,32,64,128,}),}),({"left claw","left leg",4,({16,32,64,128,}),}),({"left wing","torso",2,({8,65536,8192,131072,524288,}),}),({"right wing","torso",2,({8,65536,8192,131072,524288,}),}),}),([]),(["coordination":(/2,10,/),"charisma":(/3,11,/),"speed":(/3,52,/),"luck":(/3,24,/),"intelligence":(/3,2,/),"durability":(/1,65,/),"agility":(/2,10,/),"strength":(/4,13,/),"wisdom":(/5,10,/),]),([]),({15,65,}),1,0,"Battish",/),"amphibian":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),({"left rear leg","torso",3,({32,524288,1024,128,}),}),({"right rear leg","torso",3,({32,524288,1024,128,}),}),({"right foreleg","torso",3,({32,524288,1024,128,}),}),({"left foreleg","torso",3,({32,524288,1024,128,}),}),({"left forepaw","left foreleg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),}),([]),(["coordination":(/2,31,/),"charisma":(/4,10,/),"speed":(/5,1,/),"luck":(/3,21,/),"intelligence":(/3,21,/),"durability":(/3,21,/),"agility":(/4,10,/),"strength":(/5,1,/),"wisdom":(/1,43,/),]),([]),({20,80,}),1,0,"Amphibianish",/),"centaur":(/({({"torso",0,1,({131072,524288,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({524288,512,256,8192,}),}),({"lower torso","head",1,({}),}),({"right arm","torso",2,({}),}),}),([64:"low",32:"high",]),(["coordination":(/4,10,/),"charisma":(/3,21,/),"speed":(/2,31,/),"luck":(/1,43,/),"intelligence":(/3,21,/),"durability":(/1,43,/),"agility":(/3,21,/),"strength":(/2,31,/),"wisdom":(/2,31,/),]),(["right foreleg":0,"left back leg":0,"right forehoof":0,"left hand":5,"right hand":5,"left foreleg":0,"right back leg":0,"right back hoof":0,"left arm":0,"left back hoof":0,"left forehoof":0,]),({20,80,}),1,0,"Centaurish",/),]) --- 1,7 ---- #/daemon/races.c ! Races (["troll":(/({({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),}),([2:"low",]),(["durability":(/1,65,/),"speed":(/3,20,/),"intelligence":(/3,11,/),"wisdom":(/5,5,/),"agility":(/2,10,/),"coordination":(/2,10,/),"strength":(/1,50,/),"luck":(/4,15,/),"charisma":(/3,11,/),]),(["right hand":4,"left hand":4,]),({15,65,}),1,0,"Trollish",(["poison bite":({"1","3","2","4",}),]),/),"sheep":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"left fore-hoof","left foreleg",4,({}),}),({"left fore-hoof","left foreleg",4,({}),}),({"left rear hoof","left rear leg",4,({}),}),({"left rear hoof","left rear leg",4,({}),}),({"right fore-hoof","right foreleg",4,({}),}),({"right fore-hoof","right foreleg",4,({}),}),({"right rear hoof","right rear leg",4,({}),}),({"right rear hoof","right rear leg",4,({}),}),}),([64:"medium",32:"high",16:"low",8:"low",2:"low",4:"low",128:"medium",]),(["durability":(/3,21,/),"intelligence":(/5,1,/),"speed":(/4,10,/),"wisdom":(/5,1,/),"agility":(/3,21,/),"coordination":(/4,10,/),"strength":(/3,21,/),"luck":(/5,1,/),"charisma":(/5,1,/),]),([]),({20,80,}),1,0,"Sheepish",([]),/),"orc":(/({({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),}),([]),(["durability":(/2,30,/),"speed":(/2,40,/),"intelligence":(/5,3,/),"wisdom":(/5,3,/),"agility":(/4,10,/),"coordination":(/3,33,/),"strength":(/2,35,/),"luck":(/4,3,/),"charisma":(/5,1,/),]),(["right hand":6,"left hand":6,]),({21,71,}),1,1,"Tangetto",([]),/),"elephant":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"trunk","head",3,({}),}),({"trunk","head",3,({}),}),({"right forepaw","right foreleg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"left forepaw","left foreleg",4,({}),}),({"left forepaw","left foreleg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),}),([64:"low",32:"high",2:"low",]),(["durability":(/1,43,/),"intelligence":(/4,10,/),"speed":(/4,10,/),"wisdom":(/1,43,/),"agility":(/5,1,/),"coordination":(/3,21,/),"strength":(/1,43,/),"luck":(/3,21,/),"charisma":(/4,10,/),]),([]),({20,80,}),1,0,"Elephantish",([]),/),"satyr":(/({({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"right hoof","right leg",4,({16,32,64,128,}),}),({"right hoof","right leg",4,({16,32,64,128,}),}),({"left hoof","left leg",4,({16,32,64,128,}),}),({"left hoof","left leg",4,({16,32,64,128,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),}),([]),(["durability":(/2,25,/),"speed":(/2,5,/),"intelligence":(/3,33,/),"wisdom":(/1,80,/),"agility":(/2,50,/),"coordination":(/1,60,/),"strength":(/4,2,/),"luck":(/1,10,/),"charisma":(/5,3,/),]),(["right hand":4,"left hand":4,]),({27,77,}),1,0,"Wulinaxian",([]),/),"bird":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"left leg","torso",2,({32,1048576,1024,128,}),}),({"left leg","torso",2,({32,1048576,1024,128,}),}),({"right leg","torso",2,({32,1048576,1024,128,}),}),({"right leg","torso",2,({32,1048576,1024,128,}),}),({"left foot","left leg",4,({64,128,16,32,}),}),({"left foot","left leg",4,({64,128,16,32,}),}),({"right foot","right leg",4,({64,128,16,32,}),}),({"right foot","right leg",4,({64,128,16,32,}),}),({"right wing","torso",4,({}),}),({"right wing","torso",4,({}),}),({"left wing","torso",4,({}),}),({"left wing","torso",4,({}),}),}),([64:"low",32:"high",]),(["durability":(/5,1,/),"intelligence":(/5,1,/),"speed":(/1,43,/),"wisdom":(/4,10,/),"agility":(/1,43,/),"coordination":(/4,10,/),"strength":(/4,10,/),"luck":(/3,21,/),"charisma":(/2,31,/),]),([]),({20,80,}),1,0,"Birdish",([]),/),"halfling":(/({({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),}),([]),(["durability":(/3,10,/),"speed":(/1,30,/),"intelligence":(/5,1,/),"wisdom":(/4,10,/),"agility":(/2,40,/),"coordination":(/3,33,/),"strength":(/3,20,/),"luck":(/2,80,/),"charisma":(/2,20,/),]),(["right hand":5,"left hand":5,]),({15,65,}),1,1,"Ersi",([]),/),"primate":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"left leg","torso",2,({32,1048576,1024,128,}),}),({"left leg","torso",2,({32,1048576,1024,128,}),}),({"left arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"left arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"right arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"right arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"right leg","torso",2,({32,1048576,1024,128,}),}),({"right leg","torso",2,({32,1048576,1024,128,}),}),({"right foot","right leg",4,({64,128,16,32,}),}),({"right foot","right leg",4,({64,128,16,32,}),}),({"right hand","right arm",4,({4,8,32768,65536,}),}),({"right hand","right arm",4,({4,8,32768,65536,}),}),({"left foot","left leg",4,({64,128,16,32,}),}),({"left foot","left leg",4,({64,128,16,32,}),}),({"left hand","left arm",4,({4,8,32768,65536,}),}),({"left hand","left arm",4,({4,8,32768,65536,}),}),}),([64:"medium",32:"high",16:"low",8:"low",2:"low",4:"low",128:"medium",]),(["durability":(/4,10,/),"intelligence":(/3,21,/),"speed":(/3,21,/),"wisdom":(/4,10,/),"agility":(/3,21,/),"coordination":(/3,21,/),"strength":(/4,10,/),"luck":(/3,21,/),"charisma":(/5,1,/),]),([]),({20,80,}),1,0,"Primateish",([]),/),"god":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"left leg","torso",2,({32,1048576,1024,128,}),}),({"left leg","torso",2,({32,1048576,1024,128,}),}),({"left arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"left arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"right arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"right arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"right leg","torso",2,({32,1048576,1024,128,}),}),({"right leg","torso",2,({32,1048576,1024,128,}),}),({"right foot","right leg",4,({64,128,16,32,}),}),({"right foot","right leg",4,({64,128,16,32,}),}),({"right hand","right arm",4,({4,8,32768,65536,}),}),({"right hand","right arm",4,({4,8,32768,65536,}),}),({"left foot","left leg",4,({64,128,16,32,}),}),({"left foot","left leg",4,({64,128,16,32,}),}),({"left hand","left arm",4,({4,8,32768,65536,}),}),({"left hand","left arm",4,({4,8,32768,65536,}),}),}),([64:"high",32:"high",16:"low",2:"medium",]),(["durability":(/1,43,/),"intelligence":(/1,43,/),"speed":(/1,43,/),"wisdom":(/1,43,/),"agility":(/1,43,/),"coordination":(/1,43,/),"strength":(/1,43,/),"luck":(/1,43,/),"charisma":(/1,43,/),]),([]),({20,80,}),1,0,"Godish",([]),/),"klingon":(/({({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),}),([64:"medium",8:"medium",128:"medium",2:"medium",4:"medium",]),(["durability":(/1,60,/),"speed":(/3,30,/),"intelligence":(/4,5,/),"wisdom":(/5,1,/),"agility":(/2,30,/),"coordination":(/2,10,/),"strength":(/1,60,/),"luck":(/4,1,/),"charisma":(/5,10,/),]),(["right hand":5,"left hand":5,]),({19,65,}),1,0,"T'linghan",([]),/),"half-elf":(/({({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),}),([]),(["durability":(/5,5,/),"speed":(/1,60,/),"intelligence":(/3,33,/),"wisdom":(/2,33,/),"agility":(/2,10,/),"coordination":(/1,50,/),"strength":(/3,15,/),"luck":(/4,2,/),"charisma":(/3,3,/),]),(["right hand":4,"left hand":4,]),({12,62,}),1,1,"Edhellen",([]),/),"hobbit":(/({({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),}),([64:"low",]),(["durability":(/2,20,/),"speed":(/2,30,/),"intelligence":(/5,10,/),"wisdom":(/3,20,/),"agility":(/1,20,/),"coordination":(/3,60,/),"strength":(/4,10,/),"luck":(/1,80,/),"charisma":(/3,33,/),]),(["right hand":4,"left hand":4,]),({20,70,}),1,0,"Terrakarn",([]),/),"deer":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"left fore-hoof","left foreleg",4,({}),}),({"left fore-hoof","left foreleg",4,({}),}),({"left rear hoof","left rear leg",4,({}),}),({"left rear hoof","left rear leg",4,({}),}),({"right fore-hoof","right foreleg",4,({}),}),({"right fore-hoof","right foreleg",4,({}),}),({"right rear hoof","right rear leg",4,({}),}),({"right rear hoof","right rear leg",4,({}),}),}),([64:"low",32:"high",]),(["durability":(/2,31,/),"intelligence":(/5,1,/),"speed":(/2,31,/),"wisdom":(/5,1,/),"agility":(/3,21,/),"coordination":(/4,10,/),"strength":(/1,43,/),"luck":(/4,10,/),"charisma":(/3,21,/),]),([]),({20,80,}),1,0,"Deerish",([]),/),"elf":(/({({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),}),([]),(["durability":(/4,20,/),"speed":(/3,4,/),"intelligence":(/1,40,/),"wisdom":(/1,30,/),"agility":(/3,40,/),"coordination":(/2,10,/),"strength":(/5,15,/),"luck":(/1,50,/),"charisma":(/1,40,/),]),(["right hand":5,"left hand":5,]),({17,73,}),1,1,"Edhellen",([]),/),"centaur":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"lower torso","head",1,({}),}),({"lower torso","head",1,({}),}),({"right arm","torso",2,({}),}),({"right arm","torso",2,({}),}),({"right foreleg","lower torso",3,({}),}),({"right foreleg","lower torso",3,({}),}),({"left foreleg","lower torso",3,({}),}),({"left foreleg","lower torso",3,({}),}),({"right back leg","lower torso",3,({}),}),({"right back leg","lower torso",3,({}),}),({"left back leg","lower torso",3,({}),}),({"left back leg","lower torso",3,({}),}),({"right hand","right arm",4,({}),}),({"right hand","right arm",4,({}),}),({"left hand","left arm",4,({}),}),({"left hand","left arm",4,({}),}),({"right forehoof","right foreleg",4,({}),}),({"right forehoof","right foreleg",4,({}),}),({"left forehoof","left foreleg",4,({}),}),({"left forehoof","left foreleg",4,({}),}),({"right back hoof","right back leg",4,({}),}),({"right back hoof","right back leg",4,({}),}),({"left back hoof","left back leg",4,({}),}),({"left back hoof","left back leg",4,({}),}),}),([64:"low",32:"high",]),(["durability":(/1,43,/),"intelligence":(/3,21,/),"speed":(/2,31,/),"wisdom":(/2,31,/),"agility":(/3,21,/),"coordination":(/4,10,/),"strength":(/2,31,/),"luck":(/1,43,/),"charisma":(/3,21,/),]),(["right hand":5,"left hand":5,]),({20,80,}),1,0,"Centaurish",([]),/),"human":(/({({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),}),([]),(["durability":(/4,30,/),"speed":(/3,20,/),"intelligence":(/1,50,/),"wisdom":(/3,50,/),"agility":(/3,33,/),"coordination":(/2,33,/),"strength":(/4,10,/),"luck":(/3,10,/),"charisma":(/2,33,/),]),(["right hand":5,"left hand":5,]),({25,75,}),1,1,"English",(["psionic defense":({"2","3","4","5",}),]),/),"wraith":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"left leg","torso",2,({32,1048576,1024,128,}),}),({"left leg","torso",2,({32,1048576,1024,128,}),}),({"left arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"left arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"right arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"right arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"right leg","torso",2,({32,1048576,1024,128,}),}),({"right leg","torso",2,({32,1048576,1024,128,}),}),({"right foot","right leg",4,({64,128,16,32,}),}),({"right foot","right leg",4,({64,128,16,32,}),}),({"right hand","right arm",4,({4,8,32768,65536,}),}),({"right hand","right arm",4,({4,8,32768,65536,}),}),({"left foot","left leg",4,({64,128,16,32,}),}),({"left foot","left leg",4,({64,128,16,32,}),}),({"left hand","left arm",4,({4,8,32768,65536,}),}),({"left hand","left arm",4,({4,8,32768,65536,}),}),}),([64:"medium",32:"high",16:"low",8:"low",2:"low",4:"low",128:"medium",]),(["durability":(/3,21,/),"intelligence":(/4,10,/),"speed":(/3,21,/),"wisdom":(/2,31,/),"agility":(/2,31,/),"coordination":(/2,31,/),"strength":(/3,21,/),"luck":(/1,43,/),"charisma":(/5,1,/),]),([]),({20,80,}),1,0,"Wraithish",([]),/),"demi-god":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"left leg","torso",2,({32,1048576,1024,128,}),}),({"left leg","torso",2,({32,1048576,1024,128,}),}),({"left arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"left arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"right arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"right arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"right leg","torso",2,({32,1048576,1024,128,}),}),({"right leg","torso",2,({32,1048576,1024,128,}),}),({"right foot","right leg",4,({64,128,16,32,}),}),({"right foot","right leg",4,({64,128,16,32,}),}),({"right hand","right arm",4,({4,8,32768,65536,}),}),({"right hand","right arm",4,({4,8,32768,65536,}),}),({"left foot","left leg",4,({64,128,16,32,}),}),({"left foot","left leg",4,({64,128,16,32,}),}),({"left hand","left arm",4,({4,8,32768,65536,}),}),({"left hand","left arm",4,({4,8,32768,65536,}),}),}),([64:"low",32:"high",]),(["durability":(/2,31,/),"intelligence":(/2,31,/),"speed":(/1,43,/),"wisdom":(/2,31,/),"agility":(/2,31,/),"coordination":(/2,31,/),"strength":(/2,31,/),"luck":(/1,43,/),"charisma":(/2,31,/),]),(["right hand":5,"left hand":5,]),({20,80,}),1,0,"Demi-godish",([]),/),"lizard":(/({({"torso",0,1,({262144,}),}),({"torso",0,1,({262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"left forepaw","left foreleg",4,({}),}),({"left forepaw","left foreleg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),}),([64:"medium",32:"high",16:"low",128:"medium",8:"medium",2:"medium",4:"medium",]),(["durability":(/3,21,/),"intelligence":(/5,1,/),"speed":(/3,21,/),"wisdom":(/5,1,/),"agility":(/3,21,/),"coordination":(/3,21,/),"strength":(/3,21,/),"luck":(/4,10,/),"charisma":(/5,1,/),]),([]),({20,80,}),1,0,"Lizardish",([]),/),"dwarf":(/({({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),}),([64:"low",2:"low",]),(["durability":(/1,60,/),"speed":(/3,20,/),"intelligence":(/3,11,/),"wisdom":(/3,20,/),"agility":(/2,10,/),"coordination":(/2,10,/),"strength":(/1,40,/),"luck":(/1,60,/),"charisma":(/3,11,/),]),(["right hand":4,"left hand":4,]),({15,65,}),1,1,"Malkierien",([]),/),"plant":(/({({"trunk",0,1,({}),}),({"trunk",0,1,({}),}),({"1st branch","trunk",3,({}),}),({"1st branch","trunk",3,({}),}),}),([64:"medium",32:"high",16:"low",8:"low",2:"low",4:"low",128:"medium",]),(["durability":(/3,21,/),"intelligence":(/5,1,/),"speed":(/5,1,/),"wisdom":(/5,1,/),"agility":(/5,1,/),"coordination":(/5,1,/),"strength":(/3,21,/),"luck":(/3,21,/),"charisma":(/5,1,/),]),([]),({20,80,}),1,0,"Plantish",([]),/),"pegasus":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left wing","torso",3,({}),}),({"left wing","torso",3,({}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"right wing","torso",3,({}),}),({"right wing","torso",3,({}),}),({"right rear hoof","right rear leg",4,({}),}),({"right rear hoof","right rear leg",4,({}),}),({"left fore-hoof","left foreleg",4,({}),}),({"left fore-hoof","left foreleg",4,({}),}),({"left rear hoof","left rear leg",4,({}),}),({"left rear hoof","left rear leg",4,({}),}),({"right fore-hoof","right foreleg",4,({}),}),({"right fore-hoof","right foreleg",4,({}),}),}),([64:"medium",32:"high",16:"low",8:"low",2:"low",4:"low",128:"medium",]),(["durability":(/2,31,/),"intelligence":(/3,21,/),"speed":(/2,31,/),"wisdom":(/2,31,/),"agility":(/1,43,/),"coordination":(/2,31,/),"strength":(/2,31,/),"luck":(/1,43,/),"charisma":(/5,1,/),]),([]),({20,80,}),1,0,"Pegasusish",([]),/),"cat":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left forepaw","left foreleg",4,({}),}),({"left forepaw","left foreleg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),({"tail","torso",5,({}),}),({"tail","torso",5,({}),}),}),([]),(["durability":(/4,10,/),"intelligence":(/5,1,/),"speed":(/2,31,/),"wisdom":(/4,10,/),"agility":(/1,43,/),"coordination":(/3,21,/),"strength":(/4,10,/),"luck":(/1,43,/),"charisma":(/1,43,/),]),([]),({20,80,}),1,0,"Feline",(["stealth":({"1","5","4","6",}),]),/),"gnome":(/({({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),}),([]),(["durability":(/4,10,/),"speed":(/2,20,/),"intelligence":(/1,50,/),"wisdom":(/1,40,/),"agility":(/3,20,/),"coordination":(/3,35,/),"strength":(/3,30,/),"luck":(/2,40,/),"charisma":(/5,1,/),]),(["right hand":4,"left hand":4,]),({8,61,}),1,0,"Nibelungen",([]),/),"tree":(/({({"trunk",0,1,({}),}),({"trunk",0,1,({}),}),({"1st branch","trunk",3,({}),}),({"1st branch","trunk",3,({}),}),}),([64:"medium",32:"high",16:"low",8:"low",2:"low",4:"low",128:"medium",]),(["durability":(/1,43,/),"intelligence":(/5,1,/),"speed":(/5,1,/),"wisdom":(/4,10,/),"agility":(/5,1,/),"coordination":(/5,1,/),"strength":(/3,21,/),"luck":(/1,43,/),"charisma":(/5,1,/),]),([]),({20,80,}),1,0,"Treeish",([]),/),"elemental":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({1048576,512,256,8192,}),}),({"head","torso",1,({1048576,512,256,8192,}),}),}),([64:"low",32:"high",2:"low",]),(["durability":(/3,21,/),"intelligence":(/3,21,/),"speed":(/3,21,/),"wisdom":(/3,21,/),"agility":(/3,21,/),"coordination":(/3,21,/),"strength":(/3,21,/),"luck":(/3,21,/),"charisma":(/3,21,/),]),([]),({20,80,}),1,0,"Elementalish",([]),/),"horse":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"left fore-hoof","left foreleg",4,({}),}),({"left fore-hoof","left foreleg",4,({}),}),({"left rear hoof","left rear leg",4,({}),}),({"left rear hoof","left rear leg",4,({}),}),({"right fore-hoof","right foreleg",4,({}),}),({"right fore-hoof","right foreleg",4,({}),}),({"right rear hoof","right rear leg",4,({}),}),({"right rear hoof","right rear leg",4,({}),}),}),([64:"low",32:"high",16:"low",2:"medium",]),(["durability":(/2,31,/),"intelligence":(/5,1,/),"speed":(/2,31,/),"wisdom":(/5,1,/),"agility":(/2,31,/),"coordination":(/4,10,/),"strength":(/1,43,/),"luck":(/5,1,/),"charisma":(/5,1,/),]),([]),({20,80,}),1,0,"Horseish",([]),/),"giant":(/({({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),}),([2:"medium",]),(["durability":(/1,70,/),"speed":(/5,1,/),"intelligence":(/3,10,/),"wisdom":(/5,1,/),"agility":(/5,2,/),"coordination":(/3,10,/),"strength":(/1,80,/),"luck":(/4,5,/),"charisma":(/4,10,/),]),(["right hand":6,"left hand":6,]),({27,65,}),1,0,"Loyavenku",([]),/),"insect":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({1048576,512,256,8192,}),}),({"head","torso",1,({1048576,512,256,8192,}),}),({"4th leg","torso",3,({32,1048576,1024,128,}),}),({"4th leg","torso",3,({32,1048576,1024,128,}),}),({"6th leg","torso",3,({32,1048576,1024,128,}),}),({"6th leg","torso",3,({32,1048576,1024,128,}),}),({"5th leg","torso",3,({32,1048576,1024,128,}),}),({"5th leg","torso",3,({32,1048576,1024,128,}),}),({"1st leg","torso",3,({32,1048576,1024,128,}),}),({"1st leg","torso",3,({32,1048576,1024,128,}),}),({"3rd leg","torso",3,({32,1048576,1024,128,}),}),({"3rd leg","torso",3,({32,1048576,1024,128,}),}),({"2nd leg","torso",3,({32,1048576,1024,128,}),}),({"2nd leg","torso",3,({32,1048576,1024,128,}),}),}),([64:"low",32:"high",16:"low",2:"medium",]),(["durability":(/5,1,/),"intelligence":(/5,1,/),"speed":(/1,43,/),"wisdom":(/5,1,/),"agility":(/2,31,/),"coordination":(/3,21,/),"strength":(/5,1,/),"luck":(/1,43,/),"charisma":(/5,1,/),]),([]),({20,80,}),1,0,"Insectish",([]),/),"arachnid":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({1048576,512,256,8192,}),}),({"head","torso",1,({1048576,512,256,8192,}),}),({"1st leg","torso",3,({32,1048576,1024,128,}),}),({"1st leg","torso",3,({32,1048576,1024,128,}),}),({"8th leg","torso",3,({32,1048576,1024,128,}),}),({"8th leg","torso",3,({32,1048576,1024,128,}),}),({"2nd leg","torso",3,({32,1048576,1024,128,}),}),({"2nd leg","torso",3,({32,1048576,1024,128,}),}),({"5th leg","torso",3,({32,1048576,1024,128,}),}),({"5th leg","torso",3,({32,1048576,1024,128,}),}),({"7th leg","torso",3,({32,1048576,1024,128,}),}),({"7th leg","torso",3,({32,1048576,1024,128,}),}),({"4th leg","torso",3,({32,1048576,1024,128,}),}),({"4th leg","torso",3,({32,1048576,1024,128,}),}),({"3rd leg","torso",3,({32,1048576,1024,128,}),}),({"3rd leg","torso",3,({32,1048576,1024,128,}),}),({"6th leg","torso",3,({32,1048576,1024,128,}),}),({"6th leg","torso",3,({32,1048576,1024,128,}),}),}),([]),(["durability":(/5,1,/),"intelligence":(/3,21,/),"speed":(/2,31,/),"wisdom":(/5,1,/),"agility":(/1,43,/),"coordination":(/1,43,/),"strength":(/4,10,/),"luck":(/3,21,/),"charisma":(/5,1,/),]),([]),({20,80,}),1,0,"Arachnidish",([]),/),"demon":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"left leg","torso",2,({32,1048576,1024,128,}),}),({"left leg","torso",2,({32,1048576,1024,128,}),}),({"left arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"left arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"right arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"right arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"right leg","torso",2,({32,1048576,1024,128,}),}),({"right leg","torso",2,({32,1048576,1024,128,}),}),({"right foot","right leg",4,({64,128,16,32,}),}),({"right foot","right leg",4,({64,128,16,32,}),}),({"right hand","right arm",4,({4,8,32768,65536,}),}),({"right hand","right arm",4,({4,8,32768,65536,}),}),({"left foot","left leg",4,({64,128,16,32,}),}),({"left foot","left leg",4,({64,128,16,32,}),}),({"left hand","left arm",4,({4,8,32768,65536,}),}),({"left hand","left arm",4,({4,8,32768,65536,}),}),}),([64:"low",32:"high",]),(["durability":(/2,31,/),"intelligence":(/2,31,/),"speed":(/2,31,/),"wisdom":(/4,10,/),"agility":(/2,31,/),"coordination":(/2,31,/),"strength":(/2,31,/),"luck":(/1,43,/),"charisma":(/2,31,/),]),([]),({20,80,}),1,0,"Demonish",([]),/),"dog":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left forepaw","left foreleg",4,({}),}),({"left forepaw","left foreleg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),}),([64:"low",32:"high",]),(["durability":(/3,21,/),"intelligence":(/4,10,/),"speed":(/3,21,/),"wisdom":(/5,1,/),"agility":(/3,21,/),"coordination":(/4,10,/),"strength":(/3,21,/),"luck":(/4,10,/),"charisma":(/2,31,/),]),([]),({20,80,}),1,0,"Dogish",([]),/),"goblin":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"left leg","torso",2,({32,1048576,1024,128,}),}),({"left leg","torso",2,({32,1048576,1024,128,}),}),({"left arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"left arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"right arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"right arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"right leg","torso",2,({32,1048576,1024,128,}),}),({"right leg","torso",2,({32,1048576,1024,128,}),}),({"right foot","right leg",4,({64,128,16,32,}),}),({"right foot","right leg",4,({64,128,16,32,}),}),({"right hand","right arm",4,({4,8,32768,65536,}),}),({"right hand","right arm",4,({4,8,32768,65536,}),}),({"left foot","left leg",4,({64,128,16,32,}),}),({"left foot","left leg",4,({64,128,16,32,}),}),({"left hand","left arm",4,({4,8,32768,65536,}),}),({"left hand","left arm",4,({4,8,32768,65536,}),}),}),([64:"high",32:"high",16:"low",2:"medium",]),(["durability":(/1,43,/),"intelligence":(/4,10,/),"speed":(/2,31,/),"wisdom":(/3,21,/),"agility":(/1,43,/),"coordination":(/3,21,/),"strength":(/3,21,/),"luck":(/4,10,/),"charisma":(/5,1,/),]),([]),({20,80,}),1,0,"Goblinish",([]),/),"nymph":(/({({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),}),([]),(["durability":(/5,7,/),"speed":(/2,60,/),"intelligence":(/4,25,/),"wisdom":(/4,20,/),"agility":(/1,50,/),"coordination":(/2,20,/),"strength":(/5,3,/),"luck":(/2,50,/),"charisma":(/1,80,/),]),(["right hand":5,"left hand":5,]),({26,76,}),1,0,"Nymal",([]),/),"snake":(/({({"torso",0,1,({16384,}),}),({"torso",0,1,({16384,}),}),({"head","torso",1,({256,}),}),({"head","torso",1,({256,}),}),}),([64:"medium",32:"high",16:"low",8:"low",2:"low",4:"low",128:"medium",]),(["durability":(/4,10,/),"intelligence":(/4,10,/),"speed":(/4,10,/),"wisdom":(/2,31,/),"agility":(/4,10,/),"coordination":(/5,1,/),"strength":(/5,1,/),"luck":(/1,43,/),"charisma":(/5,1,/),]),([]),({20,80,}),1,0,"Snakeish",([]),/),"slug":(/({({"torso",0,1,({16384,}),}),({"torso",0,1,({16384,}),}),({"head","torso",1,({256,}),}),({"head","torso",1,({256,}),}),}),([64:"medium",32:"high",16:"low",8:"low",2:"low",4:"low",128:"medium",]),(["durability":(/5,1,/),"intelligence":(/5,1,/),"speed":(/5,1,/),"wisdom":(/4,10,/),"agility":(/5,1,/),"coordination":(/5,1,/),"strength":(/4,10,/),"luck":(/5,1,/),"charisma":(/5,1,/),]),([]),({20,80,}),1,0,"Slugish",([]),/),"ogre":(/({({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),}),([8:"low",2:"low",4:"low",]),(["durability":(/1,68,/),"speed":(/4,7,/),"intelligence":(/4,10,/),"wisdom":(/5,1,/),"agility":(/5,1,/),"coordination":(/5,2,/),"strength":(/1,50,/),"luck":(/5,1,/),"charisma":(/5,1,/),]),(["right hand":6,"left hand":6,]),({25,70,}),1,0,"Shangtai",([]),/),"pig":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"left fore-hoof","left foreleg",4,({}),}),({"left fore-hoof","left foreleg",4,({}),}),({"left rear hoof","left rear leg",4,({}),}),({"left rear hoof","left rear leg",4,({}),}),({"right fore-hoof","right foreleg",4,({}),}),({"right fore-hoof","right foreleg",4,({}),}),({"right rear hoof","right rear leg",4,({}),}),({"right rear hoof","right rear leg",4,({}),}),}),([64:"medium",32:"high",16:"low",8:"low",2:"low",4:"low",128:"medium",]),(["durability":(/1,43,/),"intelligence":(/5,1,/),"speed":(/4,10,/),"wisdom":(/2,31,/),"agility":(/5,1,/),"coordination":(/3,21,/),"strength":(/3,21,/),"luck":(/5,1,/),"charisma":(/5,1,/),]),([]),({20,80,}),1,0,"Pigish",([]),/),"fish":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({1048576,512,256,8192,}),}),({"head","torso",1,({1048576,512,256,8192,}),}),}),([64:"low",32:"high",16:"low",2:"low",]),(["durability":(/4,10,/),"intelligence":(/5,1,/),"speed":(/3,21,/),"wisdom":(/3,21,/),"agility":(/2,31,/),"coordination":(/2,31,/),"strength":(/4,10,/),"luck":(/5,1,/),"charisma":(/5,1,/),]),([]),({20,80,}),1,0,"Fishish",([]),/),"android":(/({({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),}),([]),(["durability":(/4,50,/),"speed":(/3,50,/),"intelligence":(/1,50,/),"wisdom":(/3,50,/),"agility":(/3,50,/),"coordination":(/2,50,/),"strength":(/4,50,/),"luck":(/3,10,/),"charisma":(/2,50,/),]),(["right hand":5,"left hand":5,]),({25,75,}),1,0,"English",([]),/),"tortoise":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left forepaw","left foreleg",4,({}),}),({"left forepaw","left foreleg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),}),([64:"medium",32:"high",16:"low",8:"low",2:"low",4:"low",128:"medium",]),(["durability":(/1,43,/),"intelligence":(/3,21,/),"speed":(/5,1,/),"wisdom":(/1,43,/),"agility":(/4,10,/),"coordination":(/2,31,/),"strength":(/5,1,/),"luck":(/3,21,/),"charisma":(/5,1,/),]),([]),({20,80,}),1,0,"Tortoiseish",([]),/),"viper":(/({({"torso",0,1,({16384,}),}),({"torso",0,1,({16384,}),}),({"head","torso",1,({256,}),}),({"head","torso",1,({256,}),}),}),([64:"medium",32:"high",16:"low",8:"low",2:"low",4:"low",128:"medium",]),(["durability":(/4,10,/),"intelligence":(/4,10,/),"speed":(/4,10,/),"wisdom":(/2,31,/),"agility":(/4,10,/),"coordination":(/5,1,/),"strength":(/5,1,/),"luck":(/1,43,/),"charisma":(/5,1,/),]),([]),({20,80,}),1,0,"Aspish",([]),/),"bugbear":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left forepaw","left foreleg",4,({}),}),({"left forepaw","left foreleg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),}),([64:"low",32:"high",]),(["durability":(/1,43,/),"intelligence":(/3,21,/),"speed":(/5,1,/),"wisdom":(/2,31,/),"agility":(/5,1,/),"coordination":(/5,1,/),"strength":(/1,43,/),"luck":(/4,10,/),"ugliness":(/3,91,/),"charisma":(/3,21,/),]),([]),({20,80,}),1,0,"Bugbearish",([]),/),"cow":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"left fore-hoof","left foreleg",4,({}),}),({"left fore-hoof","left foreleg",4,({}),}),({"left rear hoof","left rear leg",4,({}),}),({"left rear hoof","left rear leg",4,({}),}),({"right fore-hoof","right foreleg",4,({}),}),({"right fore-hoof","right foreleg",4,({}),}),({"right rear hoof","right rear leg",4,({}),}),({"right rear hoof","right rear leg",4,({}),}),}),([64:"low",32:"high",]),(["durability":(/1,43,/),"intelligence":(/5,1,/),"speed":(/5,1,/),"wisdom":(/5,1,/),"agility":(/5,1,/),"coordination":(/3,21,/),"strength":(/2,31,/),"luck":(/5,1,/),"charisma":(/4,10,/),]),([]),({20,80,}),1,0,"Cowish",([]),/),"kobold":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"left leg","torso",2,({32,1048576,1024,128,}),}),({"left leg","torso",2,({32,1048576,1024,128,}),}),({"left arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"left arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"right arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"right arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"right leg","torso",2,({32,1048576,1024,128,}),}),({"right leg","torso",2,({32,1048576,1024,128,}),}),({"left hand","left arm",4,({4,8,32768,65536,}),}),({"left hand","left arm",4,({4,8,32768,65536,}),}),({"right hand","right arm",4,({4,8,32768,65536,}),}),({"right hand","right arm",4,({4,8,32768,65536,}),}),({"left hoof","left leg",4,({}),}),({"left hoof","left leg",4,({}),}),({"right hoof","right leg",4,({}),}),({"right hoof","right leg",4,({}),}),}),([64:"medium",32:"high",16:"low",128:"medium",8:"medium",2:"medium",4:"medium",]),(["durability":(/1,43,/),"intelligence":(/4,10,/),"speed":(/3,21,/),"wisdom":(/4,10,/),"agility":(/3,21,/),"coordination":(/2,31,/),"strength":(/1,43,/),"luck":(/3,21,/),"charisma":(/5,1,/),]),(["right hand":5,"left hand":5,]),({20,80,}),1,0,"Koboldish",([]),/),"gargoyle":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"left arm","torso",3,({8,4096,131072,1048576,65536,}),}),({"left arm","torso",3,({8,4096,131072,1048576,65536,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"right arm","torso",3,({8,4096,131072,1048576,65536,}),}),({"right arm","torso",3,({8,4096,131072,1048576,65536,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"left wing","torso",3,({}),}),({"left wing","torso",3,({}),}),({"right wing","torso",3,({}),}),({"right wing","torso",3,({}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"left forepaw","left foreleg",4,({}),}),({"left forepaw","left foreleg",4,({}),}),({"left hand","left arm",4,({4,8,32768,65536,}),}),({"left hand","left arm",4,({4,8,32768,65536,}),}),({"right forepaw","right foreleg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"right hand","right arm",4,({4,8,32768,65536,}),}),({"right hand","right arm",4,({4,8,32768,65536,}),}),({"left rear paw","left rear leg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),}),([64:"low",32:"high",16:"low",2:"low",]),(["durability":(/1,43,/),"intelligence":(/4,10,/),"speed":(/4,10,/),"wisdom":(/2,31,/),"agility":(/5,1,/),"coordination":(/2,31,/),"strength":(/1,43,/),"luck":(/4,10,/),"charisma":(/5,1,/),]),([]),({20,80,}),1,0,"Gargoyleish",([]),/),"chimera":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"lion head","torso",2,({1048576,512,256,8192,}),}),({"lion head","torso",2,({1048576,512,256,8192,}),}),({"goat head","torso",2,({1048576,512,256,8192,}),}),({"goat head","torso",2,({1048576,512,256,8192,}),}),({"dragon head","torso",2,({1048576,512,256,8192,}),}),({"dragon head","torso",2,({1048576,512,256,8192,}),}),({"right wing","torso",3,({}),}),({"right wing","torso",3,({}),}),({"left wing","torso",3,({}),}),({"left wing","torso",3,({}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"left forepaw","left foreleg",4,({}),}),({"left forepaw","left foreleg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),}),([64:"low",32:"high",]),(["durability":(/2,31,/),"intelligence":(/3,21,/),"speed":(/1,43,/),"wisdom":(/3,21,/),"agility":(/2,31,/),"coordination":(/4,10,/),"strength":(/3,21,/),"luck":(/4,10,/),"charisma":(/5,1,/),]),([]),({20,80,}),1,0,"Chimeraish",([]),/),"unicorn":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"left fore-hoof","left foreleg",4,({}),}),({"left fore-hoof","left foreleg",4,({}),}),({"left rear hoof","left rear leg",4,({}),}),({"left rear hoof","left rear leg",4,({}),}),({"right fore-hoof","right foreleg",4,({}),}),({"right fore-hoof","right foreleg",4,({}),}),({"right rear hoof","right rear leg",4,({}),}),({"right rear hoof","right rear leg",4,({}),}),}),([64:"medium",32:"high",16:"low",8:"low",2:"low",4:"low",128:"medium",]),(["durability":(/3,21,/),"intelligence":(/4,10,/),"speed":(/3,21,/),"wisdom":(/2,31,/),"agility":(/2,31,/),"coordination":(/2,31,/),"strength":(/3,21,/),"luck":(/1,43,/),"charisma":(/5,1,/),]),([]),({20,80,}),1,0,"Unicornish",([]),/),"kender":(/({({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),}),([]),(["durability":(/1,20,/),"speed":(/1,50,/),"intelligence":(/2,20,/),"wisdom":(/4,7,/),"agility":(/3,40,/),"coordination":(/2,50,/),"strength":(/5,3,/),"luck":(/3,33,/),"charisma":(/2,40,/),]),(["right hand":5,"left hand":5,]),({23,78,}),1,0,"Kendrall",(["stealing":({"1","5","5","5",}),]),/),"golem":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"head","torso",1,({1048576,512,256,8192,}),}),({"head","torso",1,({1048576,512,256,8192,}),}),({"left leg","torso",2,({32,1048576,1024,128,}),}),({"left leg","torso",2,({32,1048576,1024,128,}),}),({"left arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"left arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"right arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"right arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"right leg","torso",2,({32,1048576,1024,128,}),}),({"right leg","torso",2,({32,1048576,1024,128,}),}),({"right foot","right leg",4,({64,128,16,32,}),}),({"right foot","right leg",4,({64,128,16,32,}),}),({"right hand","right arm",4,({4,8,32768,65536,}),}),({"right hand","right arm",4,({4,8,32768,65536,}),}),({"left foot","left leg",4,({64,128,16,32,}),}),({"left foot","left leg",4,({64,128,16,32,}),}),({"left hand","left arm",4,({4,8,32768,65536,}),}),({"left hand","left arm",4,({4,8,32768,65536,}),}),}),([64:"high",32:"high",16:"low",2:"medium",]),(["durability":(/2,31,/),"intelligence":(/4,10,/),"speed":(/3,21,/),"wisdom":(/2,31,/),"agility":(/3,21,/),"coordination":(/3,21,/),"strength":(/1,43,/),"luck":(/5,1,/),"charisma":(/5,1,/),]),([]),({20,80,}),1,0,"Golemish",([]),/),"artrell":(/({({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,}),}),({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,}),}),({"head","torso",1,({256,512,262144,}),}),({"head","torso",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"first arm","torso",3,({8,65536,8192,131072,1048576,}),}),({"first arm","torso",3,({8,65536,8192,131072,1048576,}),}),({"second arm","torso",3,({8,65536,8192,131072,1048576,}),}),({"second arm","torso",3,({8,65536,8192,131072,1048576,}),}),({"third arm","torso",3,({8,65536,8192,131072,1048576,}),}),({"third arm","torso",3,({8,65536,8192,131072,1048576,}),}),({"fourth arm","torso",3,({8,65536,8192,131072,1048576,}),}),({"fourth arm","torso",3,({8,65536,8192,131072,1048576,}),}),({"first hand","first arm",4,({2,4,8,32768,65536,}),}),({"first hand","first arm",4,({2,4,8,32768,65536,}),}),({"second hand","second arm",4,({2,4,8,32768,65536,}),}),({"second hand","second arm",4,({2,4,8,32768,65536,}),}),({"third hand","third arm",4,({2,4,8,32768,65536,}),}),({"third hand","third arm",4,({2,4,8,32768,65536,}),}),({"fourth hand","fourth arm",4,({2,4,8,32768,65536,}),}),({"fourth hand","fourth arm",4,({2,4,8,32768,65536,}),}),}),([64:"low",32:"high",]),(["durability":(/3,10,/),"speed":(/2,40,/),"intelligence":(/4,10,/),"wisdom":(/5,5,/),"agility":(/1,50,/),"coordination":(/3,40,/),"strength":(/3,10,/),"luck":(/3,33,/),"charisma":(/4,0,/),]),(["third hand":2,"second hand":2,"fourth hand":2,"first hand":2,]),({7,61,}),1,0,"Artrexcian",([]),/),"bear":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left forepaw","left foreleg",4,({}),}),({"left forepaw","left foreleg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),}),([64:"low",32:"high",]),(["durability":(/1,43,/),"intelligence":(/3,21,/),"speed":(/5,1,/),"wisdom":(/2,31,/),"agility":(/5,1,/),"coordination":(/5,1,/),"strength":(/1,43,/),"luck":(/4,10,/),"charisma":(/3,21,/),]),([]),({20,80,}),1,0,"Bearish",([]),/),"avidryl":(/({({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,}),}),({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,}),}),({"head","torso",1,({256,512,262144,}),}),({"head","torso",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,1048576,8192,}),}),({"right leg","torso",2,({32,128,1024,1048576,8192,}),}),({"left leg","torso",2,({32,128,1024,1048576,8192,}),}),({"left leg","torso",2,({32,128,1024,1048576,8192,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"right wing","torso",4,({}),}),({"right wing","torso",4,({}),}),({"left wing","torso",4,({}),}),({"left wing","torso",4,({}),}),}),([]),(["durability":(/2,20,/),"speed":(/3,20,/),"intelligence":(/4,15,/),"wisdom":(/5,10,/),"agility":(/1,50,/),"coordination":(/1,30,/),"strength":(/2,40,/),"luck":(/5,2,/),"charisma":(/3,20,/),]),(["right hand":5,"left hand":5,]),({15,85,}),1,0,"Avidryl",([]),/),"amphibian":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,262144,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left forepaw","left foreleg",4,({}),}),({"left forepaw","left foreleg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),}),([]),(["durability":(/3,21,/),"intelligence":(/3,21,/),"speed":(/5,1,/),"wisdom":(/1,43,/),"agility":(/4,10,/),"coordination":(/2,31,/),"strength":(/5,1,/),"luck":(/3,21,/),"charisma":(/4,10,/),]),([]),({20,80,}),1,0,"Amphibianish",([]),/),"balrog":(/({({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),}),([128:"high",]),(["durability":(/1,40,/),"speed":(/2,30,/),"intelligence":(/2,30,/),"wisdom":(/3,10,/),"agility":(/1,40,/),"coordination":(/3,30,/),"strength":(/3,30,/),"luck":(/3,20,/),"charisma":(/5,1,/),]),(["right hand":6,"left hand":6,]),({10,67,}),1,0,"Balrog",([]),/),"griffin":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"left wing","torso",3,({}),}),({"left wing","torso",3,({}),}),({"right wing","torso",3,({}),}),({"right wing","torso",3,({}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"left forepaw","left foreleg",4,({}),}),({"left forepaw","left foreleg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),}),([64:"high",32:"high",16:"low",2:"medium",]),(["durability":(/1,43,/),"intelligence":(/5,1,/),"speed":(/2,31,/),"wisdom":(/4,10,/),"agility":(/2,31,/),"coordination":(/2,31,/),"strength":(/1,43,/),"luck":(/1,43,/),"charisma":(/5,1,/),]),([]),({20,80,}),1,0,"Griffinish",([]),/),"dragon":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"left wing","torso",3,({}),}),({"left wing","torso",3,({}),}),({"right wing","torso",3,({}),}),({"right wing","torso",3,({}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"left forepaw","left foreleg",4,({}),}),({"left forepaw","left foreleg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),}),([64:"low",32:"high",]),(["durability":(/1,43,/),"intelligence":(/2,31,/),"speed":(/3,21,/),"wisdom":(/1,43,/),"agility":(/1,43,/),"coordination":(/3,21,/),"strength":(/1,43,/),"luck":(/1,43,/),"charisma":(/2,31,/),]),([]),({20,80,}),1,0,"Dragonish",([]),/),"rodent":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"left rear leg","torso",3,({32,1048576,1024,128,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"right rear leg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"right foreleg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left foreleg","torso",3,({32,1048576,1024,128,}),}),({"left forepaw","left foreleg",4,({}),}),({"left forepaw","left foreleg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"right forepaw","right foreleg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"left rear paw","left rear leg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),({"right rear paw","right rear leg",4,({}),}),}),([64:"medium",32:"high",16:"low",8:"low",2:"low",4:"low",128:"medium",]),(["durability":(/4,10,/),"intelligence":(/5,1,/),"speed":(/2,31,/),"wisdom":(/4,10,/),"agility":(/3,21,/),"coordination":(/4,10,/),"strength":(/5,1,/),"luck":(/5,1,/),"charisma":(/5,1,/),]),([]),({20,80,}),1,0,"Rodentish",([]),/),"half-orc":(/({({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",2,({8,65536,8192,131072,1048576,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),}),([]),(["durability":(/2,40,/),"speed":(/1,70,/),"intelligence":(/2,15,/),"wisdom":(/5,10,/),"agility":(/4,2,/),"coordination":(/3,20,/),"strength":(/2,20,/),"luck":(/5,1,/),"charisma":(/5,4,/),]),(["right hand":4,"left hand":4,]),({12,62,}),1,1,"Tangetto",([]),/),"faerie":(/({({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"right foot","right leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left foot","left leg",4,({16,32,64,128,}),}),({"left arm","torso",3,({8,65536,8192,131072,1048576,}),}),({"left arm","torso",3,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",3,({8,65536,8192,131072,1048576,}),}),({"right arm","torso",3,({8,65536,8192,131072,1048576,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"left hand","left arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),({"right hand","right arm",4,({2,4,8,32768,65536,}),}),}),([16:"low",]),(["durability":(/5,10,/),"speed":(/2,40,/),"intelligence":(/2,10,/),"wisdom":(/2,15,/),"agility":(/1,60,/),"coordination":(/1,40,/),"strength":(/5,5,/),"luck":(/2,30,/),"charisma":(/3,30,/),]),(["right hand":5,"left hand":5,]),({30,80,}),1,0,"Elcharean",([]),/),"dryad":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"left leg","torso",2,({32,1048576,1024,128,}),}),({"left leg","torso",2,({32,1048576,1024,128,}),}),({"left arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"left arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"right arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"right arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"right leg","torso",2,({32,1048576,1024,128,}),}),({"right leg","torso",2,({32,1048576,1024,128,}),}),({"right foot","right leg",4,({64,128,16,32,}),}),({"right foot","right leg",4,({64,128,16,32,}),}),({"right hand","right arm",4,({4,8,32768,65536,}),}),({"right hand","right arm",4,({4,8,32768,65536,}),}),({"left foot","left leg",4,({64,128,16,32,}),}),({"left foot","left leg",4,({64,128,16,32,}),}),({"left hand","left arm",4,({4,8,32768,65536,}),}),({"left hand","left arm",4,({4,8,32768,65536,}),}),}),([64:"low",32:"high",]),(["durability":(/5,1,/),"intelligence":(/4,10,/),"speed":(/2,31,/),"wisdom":(/2,31,/),"agility":(/2,31,/),"coordination":(/3,21,/),"strength":(/4,10,/),"luck":(/2,31,/),"charisma":(/1,43,/),]),(["right hand":5,"left hand":5,]),({20,80,}),1,0,"Dryadish",([]),/),"bat":(/({({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,}),}),({"torso",0,1,({4096,8192,16384,65536,131072,1048576,2048,}),}),({"head","torso",1,({256,512,262144,}),}),({"head","torso",1,({256,512,262144,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"right leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"left leg","torso",2,({32,128,1024,1048576,}),}),({"right claw","right leg",4,({16,32,64,128,}),}),({"right claw","right leg",4,({16,32,64,128,}),}),({"left claw","left leg",4,({16,32,64,128,}),}),({"left claw","left leg",4,({16,32,64,128,}),}),({"left wing","torso",2,({8,65536,8192,131072,1048576,}),}),({"left wing","torso",2,({8,65536,8192,131072,1048576,}),}),({"right wing","torso",2,({8,65536,8192,131072,1048576,}),}),({"right wing","torso",2,({8,65536,8192,131072,1048576,}),}),}),([]),(["durability":(/1,65,/),"speed":(/3,52,/),"intelligence":(/3,2,/),"wisdom":(/5,10,/),"agility":(/2,10,/),"coordination":(/2,10,/),"strength":(/4,13,/),"luck":(/3,24,/),"charisma":(/3,11,/),]),([]),({15,65,}),1,0,"Battish",([]),/),"gnoll":(/({({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"torso",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({"neck","torso",1,({524288,262144,}),}),({"neck","torso",1,({524288,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"head","neck",1,({256,512,262144,}),}),({"left leg","torso",2,({32,1048576,1024,128,}),}),({"left leg","torso",2,({32,1048576,1024,128,}),}),({"left arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"left arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"right arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"right arm","torso",2,({8,4096,131072,1048576,65536,}),}),({"right leg","torso",2,({32,1048576,1024,128,}),}),({"right leg","torso",2,({32,1048576,1024,128,}),}),({"right foot","right leg",4,({64,128,16,32,}),}),({"right foot","right leg",4,({64,128,16,32,}),}),({"right hand","right arm",4,({4,8,32768,65536,}),}),({"right hand","right arm",4,({4,8,32768,65536,}),}),({"left foot","left leg",4,({64,128,16,32,}),}),({"left foot","left leg",4,({64,128,16,32,}),}),({"left hand","left arm",4,({4,8,32768,65536,}),}),({"left hand","left arm",4,({4,8,32768,65536,}),}),}),([64:"high",32:"high",16:"low",2:"medium",]),(["durability":(/3,21,/),"intelligence":(/4,10,/),"speed":(/3,21,/),"wisdom":(/4,10,/),"agility":(/2,31,/),"coordination":(/2,31,/),"strength":(/3,21,/),"luck":(/2,31,/),"charisma":(/5,1,/),]),([]),({20,80,}),1,0,"Gnollish",([]),/),]) ! FlyingRaces ({"avidryl","bat","bird","demon","dragon","faerie","gargoyle","griffin","insect","pegasus","wraith","avidryl","bat","bird","demon","dragon","faerie","gargoyle","griffin","insect","pegasus","wraith","avidryl","bat","bird","demon","dragon","faerie","gargoyle","griffin","insect","pegasus","wraith","avidryl","bat","bird","demon","dragon","faerie","gargoyle","griffin","insect","pegasus","wraith","avidryl","bat","bird","demon","dragon","faerie","gargoyle","griffin","insect","pegasus","wraith","avidryl","bat","bird","demon","dragon","faerie","gargoyle","griffin","insect","pegasus","wraith","avidryl","bat","bird","avidryl","bat","bird","avidryl","bat","bird","avidryl","bat","bird","avidryl","bat","bird","demon","dragon","faerie","gargoyle","griffin","insect","pegasus","wraith",}) ! LimblessCombatRaces ({"snake","android","elemental","fish","god","plant","slug","tree",}) ! LimblessRaces ({"snake","elemental","fish","slug",}) ! NonBitingRaces ({"android","cow","deer","elemental","god","golem","android","cow","deer","elemental","god","golem","android","cow","deer","elemental","god","golem","android","cow","deer","elemental","god","golem","android","cow","deer","elemental","god","golem","android","cow","deer","elemental","god","golem","android","android","android","android","android","cow","deer","elemental","god","golem",}) ! wtf "(/({({\"torso\",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({\"torso\",0,1,({131072,1048576,8192,16384,4096,262144,2048,}),}),({\"neck\",\"torso\",1,({524288,262144,}),}),({\"neck\",\"torso\",1,({524288,262144,}),}),({\"head\",\"neck\",1,({256,512,262144,}),}),({\"head\",\"neck\",1,({256,512,262144,}),}),({\"left leg\",\"torso\",2,({32,1048576,1024,128,}),}),({\"left leg\",\"torso\",2,({32,1048576,1024,128,}),}),({\"left arm\",\"torso\",2,({8,4096,131072,1048576,65536,}),}),({\"left arm\",\"torso\",2,({8,4096,131072,1048576,65536,}),}),({\"right arm\",\"torso\",2,({8,4096,131072,1048576,65536,}),}),({\"right arm\",\"torso\",2,({8,4096,131072,1048576,65536,}),}),({\"right leg\",\"torso\",2,({32,1048576,1024,128,}),}),({\"right leg\",\"torso\",2,({32,1048576,1024,128,}),}),({\"right foot\",\"right leg\",4,({64,128,16,32,}),}),({\"right foot\",\"right leg\",4,({64,128,16,32,}),}),({\"right hand\",\"right arm\",4,({4,8,32768,65536,}),}),({\"right hand\",\"right arm\",4,({4,8,32768,65536,}),}),({\"left foot\",\"left leg\",4,({64,128,16,32,}),}),({\"left foot\",\"left leg\",4,({64,128,16,32,}),}),({\"left hand\",\"left arm\",4,({4,8,32768,65536,}),}),({\"left hand\",\"left arm\",4,({4,8,32768,65536,}),}),}),([64:\"medium\",32:\"high\",16:\"low\",8:\"low\",2:\"low\",4:\"low\",128:\"medium\",]),([\"durability\":(/3,21,/),\"intelligence\":(/4,10,/),\"speed\":(/3,21,/),\"wisdom\":(/2,31,/),\"agility\":(/2,31,/),\"coordination\":(/2,31,/),\"strength\":(/3,21,/),\"luck\":(/1,43,/),\"charisma\":(/5,1,/),]),([]),({20,80,}),1,0,\"Wraithish\",([]),/)" diff -c -r --new-file ds1.1/lib/save/services.o ds2.0r27/lib/save/services.o *** ds1.1/lib/save/services.o Fri Jan 3 22:14:34 1997 --- ds2.0r27/lib/save/services.o Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #/daemon/services.c - Ucache (["Nightmare":([]),"Dysfunctional Mud":([]),"Archon":([]),]) --- 0 ---- diff -c -r --new-file ds1.1/lib/save/stargate.o ds2.0r27/lib/save/stargate.o *** ds1.1/lib/save/stargate.o Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/save/stargate.o Wed Jul 5 00:00:59 2006 *************** *** 0 **** --- 1,2 ---- + #/daemon/stargate.c + Stargates (["stargate lab":(["destination":"/domains/default/room/stargate_lab","status":"idle","endpoint":"",]),"tower":(["destination":"/domains/Ylsrim/room/tower","status":"idle","endpoint":"",]),"campus lab":(["destination":"/domains/campus/room/slab","status":"idle","endpoint":"",]),]) diff -c -r --new-file ds1.1/lib/save/unique.o ds2.0r27/lib/save/unique.o *** ds1.1/lib/save/unique.o Fri Jan 3 22:14:34 1997 --- ds2.0r27/lib/save/unique.o Wed Dec 31 19:00:00 1969 *************** *** 1,2 **** - #/daemon/unique.c - Objects (["/domains/Ylsrim/npc/traveller":852347111,"/realms/zackron/metro/train/obj/trnpass":844236994,]) --- 0 ---- diff -c -r --new-file ds1.1/lib/secure/cfg/classes/explorer ds2.0r27/lib/secure/cfg/classes/explorer *** ds1.1/lib/secure/cfg/classes/explorer Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cfg/classes/explorer Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,14 ---- + explorer + blade attack:1:1 + blade defense:1:1 + melee attack:0:1 + blunt attack:1:2 + knife attack:1:2 + projectile attack:0:1 + melee defense:1:2 + blunt defense:1:2 + knife defense:1:2 + projectile defense:1:1 + magic attack:1:1 + magic defense:1:1 + bargaining:1:4 diff -c -r --new-file ds1.1/lib/secure/cfg/classes/fighter ds2.0r27/lib/secure/cfg/classes/fighter *** ds1.1/lib/secure/cfg/classes/fighter Fri Jan 3 22:15:57 1997 --- ds2.0r27/lib/secure/cfg/classes/fighter Wed Jul 5 00:01:12 2006 *************** *** 1,19 **** fighter ! priest:druid ! blade attack:1:1 multi-hand:1:1 multi-weapon:1:1 ! blade defense:1:1 ! melee attack:0:2 ! blunt attack:1:3 ! knife attack:1:2 ! projectile attack:1:3 ! melee defense:1:2 ! blunt defense:1:2 ! knife defense:1:3 ! projectile defense:1:4 ! magic defense:0:5 ! healing:0:5 ! bargaining:0:4 ! murder:0:5 --- 1,15 ---- fighter ! blade attack:1:0 multi-hand:1:1 multi-weapon:1:1 ! blade defense:1:0 ! melee attack:0:1 ! blunt attack:1:0 ! knife attack:1:0 ! projectile attack:1:1 ! melee defense:1:0 ! blunt defense:1:0 ! knife defense:1:0 ! projectile defense:1:1 ! bargaining:1:4 diff -c -r --new-file ds1.1/lib/secure/cfg/classes/mage ds2.0r27/lib/secure/cfg/classes/mage *** ds1.1/lib/secure/cfg/classes/mage Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cfg/classes/mage Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,11 ---- + mage + magic attack:1:0 + magic defense:1:0 + conjuring:1:0 + bargaining:0:1 + blunt defense:0:2 + knife defense:0:2 + melee defense:0:2 + blunt attack:0:1 + knife attack:0:1 + melee attack:0:2 diff -c -r --new-file ds1.1/lib/secure/cfg/classes/priest ds2.0r27/lib/secure/cfg/classes/priest *** ds1.1/lib/secure/cfg/classes/priest Fri Jan 3 22:15:56 1997 --- ds2.0r27/lib/secure/cfg/classes/priest Wed Jul 5 00:01:12 2006 *************** *** 2,19 **** fighter:druid melee attack:0:3 blunt attack:0:5 - knife attack:0:5 projectile attack:0:4 ! magic attack:0:5 melee defense:1:2 blade defense:1:3 knife defense:1:3 projectile defense:1:3 ! conjuring:0:5 ! bargaining:1:5 stealth:0:4 fishing:0:2 blunt defense:1:1 magic defense:1:1 ! faith:1:1 ! healing:1:1 --- 2,18 ---- fighter:druid melee attack:0:3 blunt attack:0:5 projectile attack:0:4 ! magic attack:0:0 melee defense:1:2 blade defense:1:3 knife defense:1:3 projectile defense:1:3 ! conjuring:0:0 ! bargaining:1:1 stealth:0:4 fishing:0:2 blunt defense:1:1 magic defense:1:1 ! faith:1:0 ! healing:1:0 diff -c -r --new-file ds1.1/lib/secure/cfg/classes/thief ds2.0r27/lib/secure/cfg/classes/thief *** ds1.1/lib/secure/cfg/classes/thief Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cfg/classes/thief Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,15 ---- + thief + melee attack:0:3 + blunt attack:1:2 + knife attack:0:0 + projectile attack:0:1 + melee defense:0:2 + blade defense:1:2 + knife defense:0:3 + projectile defense:0:0 + bargaining:0:0 + stealth:0:0 + stealing:0:0 + fishing:0:1 + murder:0:2 + blunt defense:1:1 diff -c -r --new-file ds1.1/lib/secure/cfg/groups.cfg ds2.0r27/lib/secure/cfg/groups.cfg *** ds1.1/lib/secure/cfg/groups.cfg Fri Jan 3 23:11:26 1997 --- ds2.0r27/lib/secure/cfg/groups.cfg Wed Jul 5 00:01:05 2006 *************** *** 5,7 **** --- 5,10 ---- (SECURE) ADMIN (ASSIST) ADMIN + (ELDER) ADMIN + (TEST) ADMIN + (INTERMUD) ADMIN diff -c -r --new-file ds1.1/lib/secure/cfg/mudos.cfg ds2.0r27/lib/secure/cfg/mudos.cfg *** ds1.1/lib/secure/cfg/mudos.cfg Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cfg/mudos.cfg Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,156 ---- + # DO NOT CHANGE THE "mudlib directory" LINE. + # DOING SO WILL MAKE THE DRIVER FAIL TO RUN. + # + # It's a linefeed problem we hope to fix soon. + # in the meantime, you have to run the mud from c:\ds + # + ############################################################################### + # Customizable runtime config file for MudOS # + # NOTE: All paths specified here are relative to the mudlib directory except # + # for mudlib directory, and binary directory. # + # Lines beginning with a # or a newline are ignored. # + ############################################################################### + # name of this mud + name : DeadSoulsWin + + # port number to accept users on + external_port_1 : telnet 6666 + + + # the address server is an external program that lets the mud translate + # internet names to numbers (and vice versa). select an unused port. + address server ip : localhost + address server port : 9999 + + # absolute pathname of mudlib + + + mudlib directory : c:/ds/lib + + + + # absolute pathname of driver/config dir + + binary directory : c:/ds/bin + + + # debug.log and author/domain stats are stored here + log directory : /log + + # the directories which are searched by #include <...> + # for multiple dirs, separate each path with a ':' + include directories : /secure/include:/include + + # Directory to save binaries in. (if BINARIES is defined) + save binaries directory : /secure/save/binaries + + # the file which defines the master object + master file : /secure/daemon/master + + # the file where all global simulated efuns are defined. + simulated efun file : /secure/sefun/sefun + + # file to swap out objects; not used if time to swap is 0 + swap file : /secure/tmp/swap + + # alternate debug.log file name (assumed to be in specified 'log directory') + debug log file : runtime + + # This is an include file which is automatically #include'd in all objects + global include file : <global.h> + + # if an object is left alone for a certain time, then the + # function clean_up will be called. This function can do anything, + # like destructing the object. If the function isn't defined by the + # object, then nothing will happen. + # This time should be substantially longer than the swapping time. + time to clean up : 14400 + + # How long time until an unused object is swapped out. + # Machine with too many players and too little memory: 900 (15 minutes) + # Machine with few players and lot of memory: 10000 + # Machine with infinite memory: 0 (never swap). + time to swap : 90000 + + # How many seconds until an object is reset again. + time to reset : 900000 + + # Maximum number of bits in a bit field. They are stored in printable + # strings, 6 bits per byte. + maximum bits in a bitfield : 1200 + + # Max number of local variables in a function. + maximum local variables : 30 + + # Maximum amount of "eval cost" per thread - execution is halted when + # it is exceeded. + maximum evaluation cost : 5000000 + + # This is the maximum array size allowed for one single array. + maximum array size : 15000 + + # This is the maximum allowed size of a variable of type 'buffer'. + maximum buffer size : 400000 + + # Max size for a mapping + maximum mapping size : 15000 + + # Max inherit chain size + inherit chain size : 30 + + # maximum length of a string variable + maximum string length : 200000 + + # Max size of a file allowed to be read by 'read_file()'. + maximum read file size : 200000 + + # max number of bytes you allow to be read and written with read_bytes + # and write_bytes + maximum byte transfer : 10000 + + # Reserve an extra memory area from malloc(), to free when we run out + # of memory and allow the mudlib to shutdown. + # If this value is 0, no area will be reserved. + reserved size : 0 + + # Define the size of the shared string hash table. This number should + # a prime, probably between 1000 and 30000; if you set it to about 1/5 + # of the number of distinct strings you have, you will get a hit ratio + # (number of comparisons to find a string) very close to 1, as found strings + # are automatically moved to the head of a hash chain. You will never + # need more, and you will still get good results with a smaller table. + hash table size : 7001 + + # Object hash table size. + # Define this like you did with the strings; probably set to about 1/4 of + # the number of objects in a game, as the distribution of accesses to + # objects is somewhat more uniform than that of strings. + object table size : 1501 + + # default no-matching-action message + default fail message : What? + + # default message when error() occurs (optional) + default error message : Something *REALLY* bad just happened. + + ############################################################################### + # The following aren't currently used or implemented (yet) # + ############################################################################### + + # maximum number of users in the game (unused currently) + maximum users : 40 + + # Define the maximum stack size of the stack machine. This stack will also + # contain all local variables and arguments. (unused currently) + evaluator stack size : 1000 + + # Define the size of the compiler stack. This defines how complex + # expressions the compiler can parse. (unused currently) + compiler stack size : 200 + + # Define the maximum call depth for functions. (unused currently) + maximum call depth : 30 + + # There is a hash table for living objects, used by find_living(). + # (unused currently) + living hash table size : 100 diff -c -r --new-file ds1.1/lib/secure/cfg/preload.cfg ds2.0r27/lib/secure/cfg/preload.cfg *** ds1.1/lib/secure/cfg/preload.cfg Fri Jan 3 23:11:26 1997 --- ds2.0r27/lib/secure/cfg/preload.cfg Wed Jul 5 00:01:05 2006 *************** *** 4,20 **** # # this needs to be loaded, as many objects use it # /daemon/command /daemon/verbs ! /daemon/chat ! /daemon/economy /daemon/intermud - /daemon/http /daemon/seasons /secure/daemon/events /secure/daemon/folders /secure/daemon/letters /secure/daemon/localpost - /secure/daemon/remotepost - /secure/daemon/remote /lib/player --- 4,34 ---- # # this needs to be loaded, as many objects use it # + #/secure/daemon/imc2 + #/secure/daemon/remotepost + #/secure/daemon/remote + #/secure/daemon/inet + /secure/daemon/log + /secure/daemon/snoop + /secure/room/arch + /secure/room/control + /secure/daemon/update + /secure/daemon/ping + /daemon/reaper + /daemon/decay + /daemon/preload_check /daemon/command /daemon/verbs ! /secure/daemon/chat ! /secure/daemon/economy /daemon/intermud /daemon/seasons /secure/daemon/events /secure/daemon/folders /secure/daemon/letters /secure/daemon/localpost /lib/player + /daemon/soul + /lib/std/room + /lib/std/table + /lib/sentient diff -c -r --new-file ds1.1/lib/secure/cfg/races/,kobold ds2.0r27/lib/secure/cfg/races/,kobold *** ds1.1/lib/secure/cfg/races/,kobold Fri Jan 3 22:15:56 1997 --- ds2.0r27/lib/secure/cfg/races/,kobold Wed Dec 31 19:00:00 1969 *************** *** 1,30 **** - kobold - 20:80 - Koboldish - SHOCK:high - BLADE:medium - BLUNT:medium - KNIFE:medium - COLD:medium - HEAT:medium - WATER:low - charisma:10:4 - durability:43:1 - intelligence:10:4 - luck:21:3 - agility:21:3 - wisdom:10:4 - charsima:1:5 - speed:21:3 - strength:43:1 - coordination:31:2 - torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT - head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK - left leg:torso:2:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK - left arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOUR,A_BODY_ARMOUR,A_SHIELD - right arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOUR,A_BODY_ARMOUR,A_SHIELD - right leg:torso:2:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK - left hand:left arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD - right hand:right arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD - left hoof:left leg:4:: - right hoof:right leg:4:: --- 0 ---- diff -c -r --new-file ds1.1/lib/secure/cfg/races/SCCS/s.kobold ds2.0r27/lib/secure/cfg/races/SCCS/s.kobold *** ds1.1/lib/secure/cfg/races/SCCS/s.kobold Fri Jan 3 22:15:56 1997 --- ds2.0r27/lib/secure/cfg/races/SCCS/s.kobold Wed Jul 5 00:01:15 2006 *************** *** 33,44 **** speed:21:3 strength:43:1 coordination:31:2 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! left leg:torso:2:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOUR,A_BODY_ARMOUR,A_SHIELD ! right arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOUR,A_BODY_ARMOUR,A_SHIELD ! right leg:torso:2:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK left hand:left arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD right hand:right arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD left hoof:left leg:4:: --- 33,44 ---- speed:21:3 strength:43:1 coordination:31:2 ! torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOR,A_VISOR,A_HELMET,A_CLOAK ! left leg:torso:2:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! left arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOR,A_BODY_ARMOR,A_SHIELD ! right arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOR,A_BODY_ARMOR,A_SHIELD ! right leg:torso:2:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK left hand:left arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD right hand:right arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD left hoof:left leg:4:: diff -c -r --new-file ds1.1/lib/secure/cfg/races/amphibian ds2.0r27/lib/secure/cfg/races/amphibian *** ds1.1/lib/secure/cfg/races/amphibian Fri Jan 3 22:15:53 1997 --- ds2.0r27/lib/secure/cfg/races/amphibian Wed Jul 5 00:01:12 2006 *************** *** 1,22 **** ! amphibian ! 20:80 ! Amphibianish ! charisma:10:4 ! durability:21:3 ! intelligence:21:3 ! luck:21:3 ! agility:10:4 ! wisdom:43:1 ! speed:1:5 ! strength:1:5 ! coordination:31:2 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left forepaw:left foreleg:4:: ! right forepaw:right foreleg:4:: ! left rear paw:left rear leg:4:: ! right rear paw:right rear leg:4:: --- 1,23 ---- ! RACE amphibian ! SENSITIVITY 20:80 ! LANGUAGE Amphibianish ! STATS charisma:10:4 ! STATS durability:21:3 ! STATS intelligence:21:3 ! STATS luck:21:3 ! STATS agility:10:4 ! STATS wisdom:43:1 ! STATS speed:1:5 ! STATS strength:1:5 ! STATS coordination:31:2 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT,A_AMULET ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left forepaw:left foreleg:4:: ! LIMB right forepaw:right foreleg:4:: ! LIMB left rear paw:left rear leg:4:: ! LIMB right rear paw:right rear leg:4:: diff -c -r --new-file ds1.1/lib/secure/cfg/races/android ds2.0r27/lib/secure/cfg/races/android *** ds1.1/lib/secure/cfg/races/android Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cfg/races/android Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,27 ---- + RACE android + SENSITIVITY 25:75 + LANGUAGE English + STATS agility:50:3 + STATS charisma:50:2 + STATS coordination:50:2 + STATS durability:50:4 + STATS intelligence:50:1 + STATS luck:10:3 + STATS speed:50:3 + STATS strength:50:4 + STATS wisdom:50:3 + LIMB torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOR,A_BODY_ARMOR,A_BELT,A_AMULET + LIMB neck:torso:1:A_COLLAR,A_AMULET + LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET + LIMB right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR + LIMB left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR + LIMB right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK + LIMB left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK + LIMB right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR + LIMB left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR + LIMB right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD + LIMB left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD + HAND right hand:5 + HAND left hand:5 + LIMBLESSCOMBATRACE + NONBITINGRACE diff -c -r --new-file ds1.1/lib/secure/cfg/races/arachnid ds2.0r27/lib/secure/cfg/races/arachnid *** ds1.1/lib/secure/cfg/races/arachnid Fri Jan 3 22:15:53 1997 --- ds2.0r27/lib/secure/cfg/races/arachnid Wed Jul 5 00:01:12 2006 *************** *** 1,22 **** ! arachnid ! 20:80 ! Arachnidish ! charisma:1:5 ! durability:1:5 ! intelligence:21:3 ! luck:21:3 ! agility:43:1 ! wisdom:1:5 ! speed:31:2 ! strength:10:4 ! coordination:43:1 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! 1st leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! 8th leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! 2nd leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! 5th leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! 7th leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! 4th leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! 3rd leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! 6th leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK --- 1,22 ---- ! RACE arachnid ! SENSITIVITY 20:80 ! LANGUAGE Arachnidish ! STATS charisma:1:5 ! STATS durability:1:5 ! STATS intelligence:21:3 ! STATS luck:21:3 ! STATS agility:43:1 ! STATS wisdom:1:5 ! STATS speed:31:2 ! STATS strength:10:4 ! STATS coordination:43:1 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB head:torso:1:A_BODY_ARMOR,A_VISOR,A_HELMET,A_CLOAK ! LIMB 1st leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB 8th leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB 2nd leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB 5th leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB 7th leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB 4th leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB 3rd leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB 6th leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK diff -c -r --new-file ds1.1/lib/secure/cfg/races/artrell ds2.0r27/lib/secure/cfg/races/artrell *** ds1.1/lib/secure/cfg/races/artrell Fri Jan 3 22:15:52 1997 --- ds2.0r27/lib/secure/cfg/races/artrell Wed Jul 5 00:01:12 2006 *************** *** 1,48 **** ! # Nightmare race configuration file ! # To add a race, make one of these files where the race name equals ! # the file name, and type <addrace race> or <addrace race 1>. The ! # 1 means the race is a player race. This file has the following ! # format: ! # line 1: race name ! # line 2: min sight value:max sight value ! # line 3: language (case sensitive) ! # line 4..n: damage type:resistance level ! # line n+1..o: stat:average value:stat class ! # line o+1..p: limb:parent limb:limb class:comma separated armour types ! # line p+1..q: hand:number of fingers ! # damage types come from /include/damage_types.h ! # armour types come from /include/armour_types.h ! # Note that you may in fact have no resistances, thus line 4 would be ! # the first stat. ! artrell ! 7:61 ! Artrexcian ! COLD:low ! SHOCK:high ! agility:50:1 ! charisma:0:4 ! coordination:40:3 ! durability:10:3 ! intelligence:10:4 ! luck:33:3 ! speed:40:2 ! strength:10:3 ! wisdom:5:5 ! torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOUR,A_BODY_ARMOUR,A_BELT ! head:torso:1:A_HELMET,A_VISOR,A_AMULET ! right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! first arm:torso:3:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! second arm:torso:3:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! third arm:torso:3:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! fourth arm:torso:3:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! first hand:first arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! second hand:second arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! third hand:third arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! fourth hand:fourth arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! first hand:2 ! second hand:2 ! third hand:2 ! fourth hand:2 --- 1,32 ---- ! RACE artrell ! SENSITIVITY 7:61 ! LANGUAGE Artrexcian ! RESISTANCE COLD:low ! RESISTANCE SHOCK:high ! STATS agility:50:1 ! STATS charisma:0:4 ! STATS coordination:40:3 ! STATS durability:10:3 ! STATS intelligence:10:4 ! STATS luck:33:3 ! STATS speed:40:2 ! STATS strength:10:3 ! STATS wisdom:5:5 ! LIMB torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOR,A_BODY_ARMOR,A_BELT ! LIMB head:torso:1:A_HELMET,A_VISOR,A_AMULET ! LIMB right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB first arm:torso:3:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB second arm:torso:3:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB third arm:torso:3:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB fourth arm:torso:3:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB first hand:first arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB second hand:second arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB third hand:third arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB fourth hand:fourth arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! HAND first hand:2 ! HAND second hand:2 ! HAND third hand:2 ! HAND fourth hand:2 diff -c -r --new-file ds1.1/lib/secure/cfg/races/avidryl ds2.0r27/lib/secure/cfg/races/avidryl *** ds1.1/lib/secure/cfg/races/avidryl Fri Jan 3 22:15:56 1997 --- ds2.0r27/lib/secure/cfg/races/avidryl Wed Jul 5 00:01:12 2006 *************** *** 1,42 **** ! # Nightmare race configuration file ! # To add a race, make one of these files where the race name equals ! # the file name, and type <addrace race> or <addrace race 1>. The ! # 1 means the race is a player race. This file has the following ! # format: ! # line 1: race name ! # line 2: min sight value:max sight value ! # line 3: language (case sensitive) ! # line 4..n: damage type:resistance level ! # line n+1..o: stat:average value:stat class ! # line o+1..p: limb:parent limb:limb class:comma separated armour types ! # line p+1..q: hand:number of fingers ! # damage types come from /include/damage_types.h ! # armour types come from /include/armour_types.h ! # Note that you may in fact have no resistances, thus line 4 would be ! # the first stat. ! avidryl ! 15:85 ! Avidryl ! agility:50:1 ! charisma:20:3 ! coordination:30:1 ! durability:20:2 ! intelligence:15:4 ! luck:2:5 ! speed:20:3 ! strength:40:2 ! wisdom:10:5 ! torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOUR,A_BODY_ARMOUR,A_BELT ! head:torso:1:A_HELMET,A_VISOR,A_AMULET ! right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR,A_CLOAK ! left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR,A_CLOAK ! right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! right wing:torso:4:: ! left wing:torso:4:: ! right hand:5 ! left hand:5 --- 1,27 ---- ! RACE avidryl ! SENSITIVITY 15:85 ! LANGUAGE Avidryl ! STATS agility:50:1 ! STATS charisma:20:3 ! STATS coordination:30:1 ! STATS durability:20:2 ! STATS intelligence:15:4 ! STATS luck:2:5 ! STATS speed:20:3 ! STATS strength:40:2 ! STATS wisdom:10:5 ! LIMB torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOR,A_BODY_ARMOR,A_BELT ! LIMB head:torso:1:A_HELMET,A_VISOR,A_AMULET ! LIMB right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR,A_CLOAK ! LIMB left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR,A_CLOAK ! LIMB right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB right wing:torso:4:: ! LIMB left wing:torso:4:: ! HAND right hand:5 ! HAND left hand:5 ! FLYINGRACE diff -c -r --new-file ds1.1/lib/secure/cfg/races/balrog ds2.0r27/lib/secure/cfg/races/balrog *** ds1.1/lib/secure/cfg/races/balrog Fri Jan 3 22:15:52 1997 --- ds2.0r27/lib/secure/cfg/races/balrog Wed Jul 5 00:01:12 2006 *************** *** 1,42 **** ! # Nightmare race configuration file ! # To add a race, make one of these files where the race name equals ! # the file name, and type <addrace race> or <addrace race 1>. The ! # 1 means the race is a player race. This file has the following ! # format: ! # line 1: race name ! # line 2: min sight value:max sight value ! # line 3: language (case sensitive) ! # line 4..n: damage type:resistance level ! # line n+1..o: stat:average value:stat class ! # line o+1..p: limb:parent limb:limb class:comma separated armour types ! # line p+1..q: hand:number of fingers ! # damage types come from /include/damage_types.h ! # armour types come from /include/armour_types.h ! # Note that you may in fact have no resistances, thus line 4 would be ! # the first stat. ! balrog ! 10:67 ! Balrog ! HEAT:high ! agility:40:1 ! charisma:1:5 ! coordination:30:3 ! durability:40:1 ! intelligence:30:2 ! luck:20:3 ! speed:30:2 ! strength:30:3 ! wisdom:10:3 ! torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOUR,A_BODY_ARMOUR,A_BELT ! head:torso:1:A_HELMET,A_VISOR,A_AMULET ! right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! right hand:6 ! left hand:6 ! --- 1,26 ---- ! RACE balrog ! SENSITIVITY 10:67 ! LANGUAGE Balrog ! RESISTANCE HEAT:high ! STATS agility:40:1 ! STATS charisma:1:5 ! STATS coordination:30:3 ! STATS durability:40:1 ! STATS intelligence:30:2 ! STATS luck:20:3 ! STATS speed:30:2 ! STATS strength:30:3 ! STATS wisdom:10:3 ! LIMB torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOR,A_BODY_ARMOR,A_BELT,A_AMULET ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! HAND right hand:6 ! HAND left hand:6 diff -c -r --new-file ds1.1/lib/secure/cfg/races/bat ds2.0r27/lib/secure/cfg/races/bat *** ds1.1/lib/secure/cfg/races/bat Fri Jan 3 22:15:56 1997 --- ds2.0r27/lib/secure/cfg/races/bat Wed Jul 5 00:01:12 2006 *************** *** 1,38 **** ! # Nightmare race configuration file ! # To add a race, make one of these files where the race name equals ! # the file name, and type <addrace race> or <addrace race 1>. The ! # 1 means the race is a player race. This file has the following ! # format: ! # line 1: race name ! # line 2: min sight value:max sight value ! # line 3: language (case sensitive) ! # line 4..n: damage type:resistance level ! # line n+1..o: stat:average value:stat class ! # line o+1..p: limb:parent limb:limb class:comma separated armour types ! # line p+1..q: hand:number of fingers ! # damage types come from /include/damage_types.h ! # armour types come from /include/armour_types.h ! # Note that you may in fact have no resistances, thus line 4 would be ! # the first stat. ! bat ! 15:65 ! Battish ! agility:10:2 ! charisma:11:3 ! coordination:10:2 ! durability:65:1 ! intelligence:2:3 ! luck:24:3 ! speed:52:3 ! strength:13:4 ! wisdom:10:5 ! torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOUR,A_BODY_ARMOUR,A_BELT ! head:torso:1:A_HELMET,A_VISOR,A_AMULET ! right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! right claw:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left claw:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left wing:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! right wing:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! ! --- 1,21 ---- ! RACE bat ! SENSITIVITY 15:65 ! LANGUAGE Battish ! STATS agility:10:2 ! STATS charisma:11:3 ! STATS coordination:10:2 ! STATS durability:65:1 ! STATS intelligence:2:3 ! STATS luck:24:3 ! STATS speed:52:3 ! STATS strength:13:4 ! STATS wisdom:10:5 ! LIMB torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOR,A_BODY_ARMOR,A_BELT ! LIMB head:torso:1:A_HELMET,A_VISOR,A_AMULET ! LIMB right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB right claw:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left claw:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left wing:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB right wing:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! FLYINGRACE diff -c -r --new-file ds1.1/lib/secure/cfg/races/bear ds2.0r27/lib/secure/cfg/races/bear *** ds1.1/lib/secure/cfg/races/bear Fri Jan 3 22:15:53 1997 --- ds2.0r27/lib/secure/cfg/races/bear Wed Jul 5 00:01:12 2006 *************** *** 1,24 **** ! bear ! 20:80 ! Bearish ! SHOCK:high ! COLD:low ! charisma:21:3 ! durability:43:1 ! intelligence:21:3 ! luck:10:4 ! agility:1:5 ! wisdom:31:2 ! speed:1:5 ! strength:43:1 ! coordination:1:5 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left forepaw:left foreleg:4:: ! right forepaw:right foreleg:4:: ! left rear paw:left rear leg:4:: ! right rear paw:right rear leg:4:: --- 1,25 ---- ! RACE bear ! SENSITIVITY 20:80 ! LANGUAGE Bearish ! RESISTANCE SHOCK:high ! RESISTANCE COLD:low ! STATS charisma:21:3 ! STATS durability:43:1 ! STATS intelligence:21:3 ! STATS luck:10:4 ! STATS agility:1:5 ! STATS wisdom:31:2 ! STATS speed:1:5 ! STATS strength:43:1 ! STATS coordination:1:5 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left forepaw:left foreleg:4:: ! LIMB right forepaw:right foreleg:4:: ! LIMB left rear paw:left rear leg:4:: ! LIMB right rear paw:right rear leg:4:: diff -c -r --new-file ds1.1/lib/secure/cfg/races/bird ds2.0r27/lib/secure/cfg/races/bird *** ds1.1/lib/secure/cfg/races/bird Fri Jan 3 22:15:53 1997 --- ds2.0r27/lib/secure/cfg/races/bird Wed Jul 5 00:01:12 2006 *************** *** 1,22 **** ! bird ! 20:80 ! Birdish ! SHOCK:high ! COLD:low ! charisma:31:2 ! durability:1:5 ! intelligence:1:5 ! luck:21:3 ! agility:43:1 ! wisdom:10:4 ! speed:43:1 ! strength:10:4 ! coordination:10:4 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! left leg:torso:2:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right leg:torso:2:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left foot:left leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! right foot:right leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! right wing:torso:4:: ! left wing:torso:4:: --- 1,24 ---- ! RACE bird ! SENSITIVITY 20:80 ! LANGUAGE Birdish ! RESISTANCE SHOCK:high ! RESISTANCE COLD:low ! STATS charisma:31:2 ! STATS durability:1:5 ! STATS intelligence:1:5 ! STATS luck:21:3 ! STATS agility:43:1 ! STATS wisdom:10:4 ! STATS speed:43:1 ! STATS strength:10:4 ! STATS coordination:10:4 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB left leg:torso:2:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right leg:torso:2:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left foot:left leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! LIMB right foot:right leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! LIMB right wing:torso:4:: ! LIMB left wing:torso:4:: ! FLYINGRACE diff -c -r --new-file ds1.1/lib/secure/cfg/races/bugbear ds2.0r27/lib/secure/cfg/races/bugbear *** ds1.1/lib/secure/cfg/races/bugbear Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cfg/races/bugbear Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,27 ---- + RACE bugbear + PLAYER_RACE 0 + SENSITIVITY 20:80 + LANGUAGE Bugbearish + RESISTANCE SHOCK:high + RESISTANCE COLD:low + STATS charisma:21:3 + STATS ugliness:91:3 + STATS durability:43:1 + STATS intelligence:21:3 + STATS luck:10:4 + STATS agility:1:5 + STATS wisdom:31:2 + STATS speed:1:5 + STATS strength:43:1 + STATS coordination:1:5 + LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT + LIMB neck:torso:1:A_COLLAR,A_AMULET + LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET + LIMB left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK + LIMB right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK + LIMB right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK + LIMB left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK + LIMB left forepaw:left foreleg:4:: + LIMB right forepaw:right foreleg:4:: + LIMB left rear paw:left rear leg:4:: + LIMB right rear paw:right rear leg:4:: diff -c -r --new-file ds1.1/lib/secure/cfg/races/cat ds2.0r27/lib/secure/cfg/races/cat *** ds1.1/lib/secure/cfg/races/cat Fri Jan 3 22:15:53 1997 --- ds2.0r27/lib/secure/cfg/races/cat Wed Jul 5 00:01:12 2006 *************** *** 1,25 **** ! cat ! 20:80 ! Catish ! SHOCK:high ! COLD:low ! charisma:43:1 ! durability:10:4 ! intelligence:1:5 ! luck:43:1 ! agility:43:1 ! wisdom:10:4 ! speed:31:2 ! strength:10:4 ! coordination:21:3 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left forepaw:left foreleg:4:: ! right forepaw:right foreleg:4:: ! left rear paw:left rear leg:4:: ! right rear paw:right rear leg:4:: ! tail:torso:5:: --- 1,25 ---- ! RACE cat ! SENSITIVITY 20:80 ! LANGUAGE Feline ! SKILL stealth:1:5:4:6 ! STATS charisma:43:1 ! STATS durability:10:4 ! STATS intelligence:1:5 ! STATS luck:43:1 ! STATS agility:43:1 ! STATS wisdom:10:4 ! STATS speed:31:2 ! STATS strength:10:4 ! STATS coordination:21:3 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left forepaw:left foreleg:4:: ! LIMB right forepaw:right foreleg:4:: ! LIMB left rear paw:left rear leg:4:: ! LIMB right rear paw:right rear leg:4:: ! LIMB tail:torso:5:: diff -c -r --new-file ds1.1/lib/secure/cfg/races/centaur ds2.0r27/lib/secure/cfg/races/centaur *** ds1.1/lib/secure/cfg/races/centaur Fri Jan 3 22:15:53 1997 --- ds2.0r27/lib/secure/cfg/races/centaur Wed Jul 5 00:01:12 2006 *************** *** 1,31 **** ! centaur ! 20:80 ! Centaurish ! SHOCK:high ! COLD:low ! charisma:21:3 ! durability:43:1 ! intelligence:21:3 ! luck:43:1 ! agility:21:3 ! wisdom:31:2 ! speed:31:2 ! strength:31:2 ! coordination:10:4 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! lower torso:head:1:: ! right arm:torso:2:: left arm::torso:2:: ! right foreleg:lower torso:3:: ! left foreleg:lower torso:3:: ! right back leg:lower torso:3:: ! left back leg:lower torso:3:: ! right hand:right arm:4:: ! left hand:left arm:4:: ! right forehoof:right foreleg:4:: ! left forehoof:left foreleg:4:: ! right back hoof:right back leg:4:: ! left back hoof:left back leg:4:: ! right hand:5 ! left hand:5 --- 1,32 ---- ! RACE centaur ! SENSITIVITY 20:80 ! LANGUAGE Centaurish ! RESISTANCE SHOCK:high ! RESISTANCE COLD:low ! STATS charisma:21:3 ! STATS durability:43:1 ! STATS intelligence:21:3 ! STATS luck:43:1 ! STATS agility:21:3 ! STATS wisdom:31:2 ! STATS speed:31:2 ! STATS strength:31:2 ! STATS coordination:10:4 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB lower torso:head:1:: ! LIMB right arm:torso:2:: left arm::torso:2:: ! LIMB right foreleg:lower torso:3:: ! LIMB left foreleg:lower torso:3:: ! LIMB right back leg:lower torso:3:: ! LIMB left back leg:lower torso:3:: ! LIMB right hand:right arm:4:: ! LIMB left hand:left arm:4:: ! LIMB right forehoof:right foreleg:4:: ! LIMB left forehoof:left foreleg:4:: ! LIMB right back hoof:right back leg:4:: ! LIMB left back hoof:left back leg:4:: ! HAND right hand:5 ! HAND left hand:5 diff -c -r --new-file ds1.1/lib/secure/cfg/races/chimera ds2.0r27/lib/secure/cfg/races/chimera *** ds1.1/lib/secure/cfg/races/chimera Fri Jan 3 22:15:53 1997 --- ds2.0r27/lib/secure/cfg/races/chimera Wed Jul 5 00:01:12 2006 *************** *** 1,28 **** ! chimera ! 20:80 ! Chimeraish ! SHOCK:high ! COLD:low ! charisma:1:5 ! durability:31:2 ! intelligence:21:3 ! luck:10:4 ! agility:31:2 ! wisdom:21:3 ! speed:43:1 ! strength:21:3 ! coordination:10:4 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! lion head:torso:2:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! goat head:torso:2:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! dragon head:torso:2:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! right wing:torso:3:: ! left wing:torso:3:: ! left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left forepaw:left foreleg:4:: ! left rear paw:left rear leg:4:: ! right forepaw:right foreleg:4:: ! right rear paw:right rear leg:4:: --- 1,28 ---- ! RACE chimera ! SENSITIVITY 20:80 ! LANGUAGE Chimeraish ! RESISTANCE SHOCK:high ! RESISTANCE COLD:low ! STATS charisma:1:5 ! STATS durability:31:2 ! STATS intelligence:21:3 ! STATS luck:10:4 ! STATS agility:31:2 ! STATS wisdom:21:3 ! STATS speed:43:1 ! STATS strength:21:3 ! STATS coordination:10:4 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB lion head:torso:2:A_BODY_ARMOR,A_VISOR,A_HELMET,A_CLOAK ! LIMB goat head:torso:2:A_BODY_ARMOR,A_VISOR,A_HELMET,A_CLOAK ! LIMB dragon head:torso:2:A_BODY_ARMOR,A_VISOR,A_HELMET,A_CLOAK ! LIMB right wing:torso:3:: ! LIMB left wing:torso:3:: ! LIMB left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left forepaw:left foreleg:4:: ! LIMB left rear paw:left rear leg:4:: ! LIMB right forepaw:right foreleg:4:: ! LIMB right rear paw:right rear leg:4:: diff -c -r --new-file ds1.1/lib/secure/cfg/races/cow ds2.0r27/lib/secure/cfg/races/cow *** ds1.1/lib/secure/cfg/races/cow Fri Jan 3 22:15:53 1997 --- ds2.0r27/lib/secure/cfg/races/cow Wed Jul 5 00:01:12 2006 *************** *** 1,24 **** ! cow ! 20:80 ! Cowish ! SHOCK:high ! COLD:low ! charisma:10:4 ! durability:43:1 ! intelligence:1:5 ! luck:1:5 ! agility:1:5 ! wisdom:1:5 ! speed:1:5 ! strength:31:2 ! coordination:21:3 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left fore-hoof:left foreleg:4:: ! left rear hoof:left rear leg:4:: ! right fore-hoof:right foreleg:4:: ! right rear hoof:right rear leg:4:: --- 1,26 ---- ! RACE cow ! SENSITIVITY 20:80 ! LANGUAGE Cowish ! RESISTANCE SHOCK:high ! RESISTANCE COLD:low ! STATS charisma:10:4 ! STATS durability:43:1 ! STATS intelligence:1:5 ! STATS luck:1:5 ! STATS agility:1:5 ! STATS wisdom:1:5 ! STATS speed:1:5 ! STATS strength:31:2 ! STATS coordination:21:3 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left fore-hoof:left foreleg:4:: ! LIMB left rear hoof:left rear leg:4:: ! LIMB right fore-hoof:right foreleg:4:: ! LIMB right rear hoof:right rear leg:4:: ! NONBITINGRACE diff -c -r --new-file ds1.1/lib/secure/cfg/races/deer ds2.0r27/lib/secure/cfg/races/deer *** ds1.1/lib/secure/cfg/races/deer Fri Jan 3 22:15:54 1997 --- ds2.0r27/lib/secure/cfg/races/deer Wed Jul 5 00:01:12 2006 *************** *** 1,24 **** ! deer ! 20:80 ! Deerish ! SHOCK:high ! COLD:low ! charisma:21:3 ! durability:31:2 ! intelligence:1:5 ! luck:10:4 ! agility:21:3 ! wisdom:1:5 ! speed:31:2 ! strength:43:1 ! coordination:10:4 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left fore-hoof:left foreleg:4:: ! left rear hoof:left rear leg:4:: ! right fore-hoof:right foreleg:4:: ! right rear hoof:right rear leg:4:: --- 1,26 ---- ! RACE deer ! SENSITIVITY 20:80 ! LANGUAGE Deerish ! RESISTANCE SHOCK:high ! RESISTANCE COLD:low ! STATS charisma:21:3 ! STATS durability:31:2 ! STATS intelligence:1:5 ! STATS luck:10:4 ! STATS agility:21:3 ! STATS wisdom:1:5 ! STATS speed:31:2 ! STATS strength:43:1 ! STATS coordination:10:4 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left fore-hoof:left foreleg:4:: ! LIMB left rear hoof:left rear leg:4:: ! LIMB right fore-hoof:right foreleg:4:: ! LIMB right rear hoof:right rear leg:4:: ! NONBITINGRACE diff -c -r --new-file ds1.1/lib/secure/cfg/races/demi-god ds2.0r27/lib/secure/cfg/races/demi-god *** ds1.1/lib/secure/cfg/races/demi-god Fri Jan 3 22:15:54 1997 --- ds2.0r27/lib/secure/cfg/races/demi-god Wed Jul 5 00:01:12 2006 *************** *** 1,26 **** ! demi-god ! 20:80 ! Demi-godish ! SHOCK:high ! COLD:low ! charisma:31:2 ! durability:31:2 ! intelligence:31:2 ! luck:43:1 ! agility:31:2 ! wisdom:31:2 ! speed:43:1 ! strength:31:2 ! coordination:31:2 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! left leg:torso:2:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOUR,A_BODY_ARMOUR,A_SHIELD ! right arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOUR,A_BODY_ARMOUR,A_SHIELD ! right leg:torso:2:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right foot:right leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! right hand:right arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! left foot:left leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! left hand:left arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! right hand:5 ! left hand:5 --- 1,27 ---- ! RACE demi-god ! SENSITIVITY 20:80 ! LANGUAGE Demi-godish ! RESISTANCE SHOCK:high ! RESISTANCE COLD:low ! STATS charisma:31:2 ! STATS durability:31:2 ! STATS intelligence:31:2 ! STATS luck:43:1 ! STATS agility:31:2 ! STATS wisdom:31:2 ! STATS speed:43:1 ! STATS strength:31:2 ! STATS coordination:31:2 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB left leg:torso:2:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOR,A_BODY_ARMOR,A_SHIELD ! LIMB right arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOR,A_BODY_ARMOR,A_SHIELD ! LIMB right leg:torso:2:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right foot:right leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! LIMB right hand:right arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB left foot:left leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! LIMB left hand:left arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! HAND right hand:5 ! HAND left hand:5 diff -c -r --new-file ds1.1/lib/secure/cfg/races/demon ds2.0r27/lib/secure/cfg/races/demon *** ds1.1/lib/secure/cfg/races/demon Fri Jan 3 22:15:54 1997 --- ds2.0r27/lib/secure/cfg/races/demon Wed Jul 5 00:01:12 2006 *************** *** 1,24 **** ! demon ! 20:80 ! Demonish ! SHOCK:high ! COLD:low ! charisma:31:2 ! durability:31:2 ! intelligence:31:2 ! luck:43:1 ! agility:31:2 ! wisdom:10:4 ! speed:31:2 ! strength:31:2 ! coordination:31:2 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! left leg:torso:2:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOUR,A_BODY_ARMOUR,A_SHIELD ! right arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOUR,A_BODY_ARMOUR,A_SHIELD ! right leg:torso:2:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right foot:right leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! right hand:right arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! left foot:left leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! left hand:left arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD --- 1,26 ---- ! RACE demon ! SENSITIVITY 20:80 ! LANGUAGE Demonish ! RESISTANCE SHOCK:high ! RESISTANCE COLD:low ! STATS charisma:31:2 ! STATS durability:31:2 ! STATS intelligence:31:2 ! STATS luck:43:1 ! STATS agility:31:2 ! STATS wisdom:10:4 ! STATS speed:31:2 ! STATS strength:31:2 ! STATS coordination:31:2 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB left leg:torso:2:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOR,A_BODY_ARMOR,A_SHIELD ! LIMB right arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOR,A_BODY_ARMOR,A_SHIELD ! LIMB right leg:torso:2:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right foot:right leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! LIMB right hand:right arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB left foot:left leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! LIMB left hand:left arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! FLYINGRACE diff -c -r --new-file ds1.1/lib/secure/cfg/races/dog ds2.0r27/lib/secure/cfg/races/dog *** ds1.1/lib/secure/cfg/races/dog Fri Jan 3 22:15:54 1997 --- ds2.0r27/lib/secure/cfg/races/dog Wed Jul 5 00:01:12 2006 *************** *** 1,24 **** ! dog ! 20:80 ! Dogish ! SHOCK:high ! COLD:low ! charisma:31:2 ! durability:21:3 ! intelligence:10:4 ! luck:10:4 ! agility:21:3 ! wisdom:1:5 ! speed:21:3 ! strength:21:3 ! coordination:10:4 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left forepaw:left foreleg:4:: ! right forepaw:right foreleg:4:: ! left rear paw:left rear leg:4:: ! right rear paw:right rear leg:4:: --- 1,25 ---- ! RACE dog ! SENSITIVITY 20:80 ! LANGUAGE Dogish ! RESISTANCE SHOCK:high ! RESISTANCE COLD:low ! STATS charisma:31:2 ! STATS durability:21:3 ! STATS intelligence:10:4 ! STATS luck:10:4 ! STATS agility:21:3 ! STATS wisdom:1:5 ! STATS speed:21:3 ! STATS strength:21:3 ! STATS coordination:10:4 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left forepaw:left foreleg:4:: ! LIMB right forepaw:right foreleg:4:: ! LIMB left rear paw:left rear leg:4:: ! LIMB right rear paw:right rear leg:4:: diff -c -r --new-file ds1.1/lib/secure/cfg/races/dragon ds2.0r27/lib/secure/cfg/races/dragon *** ds1.1/lib/secure/cfg/races/dragon Fri Jan 3 22:15:53 1997 --- ds2.0r27/lib/secure/cfg/races/dragon Wed Jul 5 00:01:12 2006 *************** *** 1,26 **** ! dragon ! 20:80 ! Dragonish ! SHOCK:high ! COLD:low ! charisma:31:2 ! durability:43:1 ! intelligence:31:2 ! luck:43:1 ! agility:43:1 ! wisdom:43:1 ! speed:21:3 ! strength:43:1 ! coordination:21:3 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left wing:torso:3:: ! right wing:torso:3:: ! right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left forepaw:left foreleg:4:: ! left rear paw:left rear leg:4:: ! right forepaw:right foreleg:4:: ! right rear paw:right rear leg:4:: --- 1,28 ---- ! RACE dragon ! SENSITIVITY 20:80 ! LANGUAGE Dragonish ! RESISTANCE SHOCK:high ! RESISTANCE COLD:low ! STATS charisma:31:2 ! STATS durability:43:1 ! STATS intelligence:31:2 ! STATS luck:43:1 ! STATS agility:43:1 ! STATS wisdom:43:1 ! STATS speed:21:3 ! STATS strength:43:1 ! STATS coordination:21:3 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left wing:torso:3:: ! LIMB right wing:torso:3:: ! LIMB right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left forepaw:left foreleg:4:: ! LIMB left rear paw:left rear leg:4:: ! LIMB right forepaw:right foreleg:4:: ! LIMB right rear paw:right rear leg:4:: ! FLYINGRACE diff -c -r --new-file ds1.1/lib/secure/cfg/races/dryad ds2.0r27/lib/secure/cfg/races/dryad *** ds1.1/lib/secure/cfg/races/dryad Fri Jan 3 22:15:54 1997 --- ds2.0r27/lib/secure/cfg/races/dryad Wed Jul 5 00:01:12 2006 *************** *** 1,26 **** ! dryad ! 20:80 ! Dryadish ! SHOCK:high ! COLD:low ! charisma:43:1 ! durability:1:5 ! intelligence:10:4 ! luck:31:2 ! agility:31:2 ! wisdom:31:2 ! speed:31:2 ! strength:10:4 ! coordination:21:3 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! left leg:torso:2:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOUR,A_BODY_ARMOUR,A_SHIELD ! right arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOUR,A_BODY_ARMOUR,A_SHIELD ! right leg:torso:2:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right foot:right leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! right hand:right arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! left foot:left leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! right hand:5 ! left hand:5 ! left hand:left arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD --- 1,27 ---- ! RACE dryad ! SENSITIVITY 20:80 ! LANGUAGE Dryadish ! RESISTANCE SHOCK:high ! RESISTANCE COLD:low ! STATS charisma:43:1 ! STATS durability:1:5 ! STATS intelligence:10:4 ! STATS luck:31:2 ! STATS agility:31:2 ! STATS wisdom:31:2 ! STATS speed:31:2 ! STATS strength:10:4 ! STATS coordination:21:3 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB left leg:torso:2:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOR,A_BODY_ARMOR,A_SHIELD ! LIMB right arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOR,A_BODY_ARMOR,A_SHIELD ! LIMB right leg:torso:2:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right foot:right leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! LIMB right hand:right arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB left foot:left leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! HAND right hand:5 ! HAND left hand:5 ! LIMB left hand:left arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD diff -c -r --new-file ds1.1/lib/secure/cfg/races/dwarf ds2.0r27/lib/secure/cfg/races/dwarf *** ds1.1/lib/secure/cfg/races/dwarf Fri Jan 3 22:15:52 1997 --- ds2.0r27/lib/secure/cfg/races/dwarf Wed Jul 5 00:01:12 2006 *************** *** 1,43 **** ! # Nightmare race configuration file ! # To add a race, make one of these files where the race name equals ! # the file name, and type <addrace race> or <addrace race 1>. The ! # 1 means the race is a player race. This file has the following ! # format: ! # line 1: race name ! # line 2: min sight value:max sight value ! # line 3: language (case sensitive) ! # line 4..n: damage type:resistance level ! # line n+1..o: stat:average value:stat class ! # line o+1..p: limb:parent limb:limb class:comma separated armour types ! # line p+1..q: hand:number of fingers ! # damage types come from /include/damage_types.h ! # armour types come from /include/armour_types.h ! # Note that you may in fact have no resistances, thus line 4 would be ! # the first stat. ! dwarf ! 15:65 ! Malkierien ! COLD:low ! BLUNT:low ! agility:10:2 ! charisma:11:3 ! coordination:10:2 ! durability:60:1 ! intelligence:11:3 ! luck:60:1 ! speed:20:3 ! strength:40:1 ! wisdom:20:3 ! torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOUR,A_BODY_ARMOUR,A_BELT ! head:torso:1:A_HELMET,A_VISOR,A_AMULET ! right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! left hand:4 ! right hand:4 ! --- 1,28 ---- ! RACE dwarf ! PLAYER_RACE 1 ! SENSITIVITY 15:65 ! LANGUAGE Malkierien ! RESISTANCE COLD:low ! RESISTANCE BLUNT:low ! STATS agility:10:2 ! STATS charisma:11:3 ! STATS coordination:10:2 ! STATS durability:60:1 ! STATS intelligence:11:3 ! STATS luck:60:1 ! STATS speed:20:3 ! STATS strength:40:1 ! STATS wisdom:20:3 ! LIMB torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOR,A_BODY_ARMOR,A_BELT,A_AMULET ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! HAND left hand:4 ! HAND right hand:4 diff -c -r --new-file ds1.1/lib/secure/cfg/races/elemental ds2.0r27/lib/secure/cfg/races/elemental *** ds1.1/lib/secure/cfg/races/elemental Fri Jan 3 22:15:54 1997 --- ds2.0r27/lib/secure/cfg/races/elemental Wed Jul 5 00:01:12 2006 *************** *** 1,17 **** ! elemental ! 20:80 ! Elementalish ! SHOCK:high ! BLUNT:low ! COLD:low ! charisma:21:3 ! durability:21:3 ! intelligence:21:3 ! luck:21:3 ! agility:21:3 ! wisdom:21:3 ! speed:21:3 ! strength:21:3 ! coordination:21:3 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK --- 1,20 ---- ! RACE elemental ! SENSITIVITY 20:80 ! LANGUAGE Elementalish ! RESISTANCE SHOCK:high ! RESISTANCE BLUNT:low ! RESISTANCE COLD:low ! STATS charisma:21:3 ! STATS durability:21:3 ! STATS intelligence:21:3 ! STATS luck:21:3 ! STATS agility:21:3 ! STATS wisdom:21:3 ! STATS speed:21:3 ! STATS strength:21:3 ! STATS coordination:21:3 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB head:torso:1:A_BODY_ARMOR,A_VISOR,A_HELMET,A_CLOAK ! LIMBLESSCOMBATRACE ! LIMBLESSRACE ! NONBITINGRACE diff -c -r --new-file ds1.1/lib/secure/cfg/races/elephant ds2.0r27/lib/secure/cfg/races/elephant *** ds1.1/lib/secure/cfg/races/elephant Fri Jan 3 22:15:54 1997 --- ds2.0r27/lib/secure/cfg/races/elephant Wed Jul 5 00:01:12 2006 *************** *** 1,26 **** ! elephant ! 20:80 ! Elephantish ! SHOCK:high ! BLUNT:low ! COLD:low ! charisma:10:4 ! durability:43:1 ! intelligence:10:4 ! luck:21:3 ! agility:1:5 ! wisdom:43:1 ! speed:10:4 ! strength:43:1 ! coordination:21:3 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! trunk:head:3:: ! right forepaw:right foreleg:4:: ! left rear paw:left rear leg:4:: ! left forepaw:left foreleg:4:: ! right rear paw:right rear leg:4:: --- 1,27 ---- ! RACE elephant ! SENSITIVITY 20:80 ! LANGUAGE Elephantish ! RESISTANCE SHOCK:high ! RESISTANCE BLUNT:low ! RESISTANCE COLD:low ! STATS charisma:10:4 ! STATS durability:43:1 ! STATS intelligence:10:4 ! STATS luck:21:3 ! STATS agility:1:5 ! STATS wisdom:43:1 ! STATS speed:10:4 ! STATS strength:43:1 ! STATS coordination:21:3 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB trunk:head:3:: ! LIMB right forepaw:right foreleg:4:: ! LIMB left rear paw:left rear leg:4:: ! LIMB left forepaw:left foreleg:4:: ! LIMB right rear paw:right rear leg:4:: diff -c -r --new-file ds1.1/lib/secure/cfg/races/elf ds2.0r27/lib/secure/cfg/races/elf *** ds1.1/lib/secure/cfg/races/elf Fri Jan 3 22:15:52 1997 --- ds2.0r27/lib/secure/cfg/races/elf Wed Jul 5 00:01:12 2006 *************** *** 1,40 **** ! # Nightmare race configuration file ! # To add a race, make one of these files where the race name equals ! # the file name, and type <addrace race> or <addrace race 1>. The ! # 1 means the race is a player race. This file has the following ! # format: ! # line 1: race name ! # line 2: min sight value:max sight value ! # line 3: language (case sensitive) ! # line 4..n: damage type:resistance level ! # line n+1..o: stat:average value:stat class ! # line o+1..p: limb:parent limb:limb class:comma separated armour types ! # line p+1..q: hand:number of fingers ! # damage types come from /include/damage_types.h ! # armour types come from /include/armour_types.h ! # Note that you may in fact have no resistances, thus line 4 would be ! # the first stat. ! elf ! 17:73 ! Eltherian ! agility:40:3 ! charisma:40:1 ! coordination:10:2 ! durability:20:4 ! intelligence:40:1 ! luck:50:1 ! speed:4:3 ! strength:15:5 ! wisdom:30:1 ! torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOUR,A_BODY_ARMOUR,A_BELT ! head:torso:1:A_HELMET,A_VISOR,A_AMULET ! right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! right hand:5 ! left hand:5 --- 1,26 ---- ! RACE elf ! PLAYER_RACE 1 ! SENSITIVITY 17:73 ! LANGUAGE Edhellen ! STATS agility:40:3 ! STATS charisma:40:1 ! STATS coordination:10:2 ! STATS durability:20:4 ! STATS intelligence:40:1 ! STATS luck:50:1 ! STATS speed:4:3 ! STATS strength:15:5 ! STATS wisdom:30:1 ! LIMB torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOR,A_BODY_ARMOR,A_BELT,A_AMULET ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! HAND right hand:5 ! HAND left hand:5 diff -c -r --new-file ds1.1/lib/secure/cfg/races/faerie ds2.0r27/lib/secure/cfg/races/faerie *** ds1.1/lib/secure/cfg/races/faerie Fri Jan 3 22:15:53 1997 --- ds2.0r27/lib/secure/cfg/races/faerie Wed Jul 5 00:01:12 2006 *************** *** 1,44 **** ! # Nightmare race configuration file ! # To add a race, make one of these files where the race name equals ! # the file name, and type <addrace race> or <addrace race 1>. The ! # 1 means the race is a player race. This file has the following ! # format: ! # line 1: race name ! # line 2: min sight value:max sight value ! # line 3: language (case sensitive) ! # line 4..n: damage type:resistance level ! # line n+1..o: stat:average value:stat class ! # line o+1..p: limb:parent limb:limb class:comma separated armour types ! # line p+1..q: hand:number of fingers ! # damage types come from /include/damage_types.h ! # armour types come from /include/armour_types.h ! # Note that you may in fact have no resistances, thus line 4 would be ! # the first stat. ! faerie ! 30:80 ! Elcharean ! WATER:low ! agility:60:1 ! charisma:30:3 ! coordination:40:1 ! durability:10:5 ! intelligence:10:2 ! luck:30:2 ! speed:40:2 ! strength:5:5 ! wisdom:15:2 ! torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOUR,A_BODY_ARMOUR,A_BELT ! head:torso:1:A_HELMET,A_VISOR,A_AMULET ! right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left arm:torso:3:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! right arm:torso:3:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR right wing:torso:3 left wing:torso:3 ! left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! left hand:5 ! right hand:5 ! --- 1,29 ---- ! RACE faerie ! SENSITIVITY 30:80 ! LANGUAGE Elcharean ! RESISTANCE WATER:low ! STATS agility:60:1 ! STATS charisma:30:3 ! STATS coordination:40:1 ! STATS durability:10:5 ! STATS intelligence:10:2 ! STATS luck:30:2 ! STATS speed:40:2 ! STATS strength:5:5 ! STATS wisdom:15:2 ! LIMB torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOR,A_BODY_ARMOR,A_BELT,A_AMULET ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left arm:torso:3:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB right arm:torso:3:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR right wing:torso:3 left wing:torso:3 ! LIMB left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! HAND left hand:5 ! HAND right hand:5 ! FLYINGRACE diff -c -r --new-file ds1.1/lib/secure/cfg/races/fish ds2.0r27/lib/secure/cfg/races/fish *** ds1.1/lib/secure/cfg/races/fish Fri Jan 3 22:15:54 1997 --- ds2.0r27/lib/secure/cfg/races/fish Wed Jul 5 00:01:12 2006 *************** *** 1,18 **** ! fish ! 20:80 ! Fishish ! SHOCK:high ! BLUNT:low ! COLD:low ! WATER:low ! charisma:1:5 ! durability:10:4 ! intelligence:1:5 ! luck:1:5 ! agility:31:2 ! wisdom:21:3 ! speed:21:3 ! strength:10:4 ! coordination:31:2 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK --- 1,20 ---- ! RACE fish ! SENSITIVITY 20:80 ! LANGUAGE Fishish ! RESISTANCE SHOCK:high ! RESISTANCE BLUNT:low ! RESISTANCE COLD:low ! RESISTANCE WATER:low ! STATS charisma:1:5 ! STATS durability:10:4 ! STATS intelligence:1:5 ! STATS luck:1:5 ! STATS agility:31:2 ! STATS wisdom:21:3 ! STATS speed:21:3 ! STATS strength:10:4 ! STATS coordination:31:2 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB head:torso:1:A_BODY_ARMOR,A_VISOR,A_HELMET,A_CLOAK ! LIMBLESSCOMBATRACE ! LIMBLESSRACE diff -c -r --new-file ds1.1/lib/secure/cfg/races/gargoyle ds2.0r27/lib/secure/cfg/races/gargoyle *** ds1.1/lib/secure/cfg/races/gargoyle Fri Jan 3 22:15:54 1997 --- ds2.0r27/lib/secure/cfg/races/gargoyle Wed Jul 5 00:01:12 2006 *************** *** 1,32 **** ! gargoyle ! 20:80 ! Gargoyleish ! SHOCK:high ! BLUNT:low ! COLD:low ! WATER:low ! charisma:1:5 ! durability:43:1 ! intelligence:10:4 ! luck:10:4 ! agility:1:5 ! wisdom:31:2 ! speed:10:4 ! strength:43:1 ! coordination:31:2 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! left arm:torso:3:A_LONG_GLOVE,A_SHIRT,A_ARMOUR,A_BODY_ARMOUR,A_SHIELD ! right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right arm:torso:3:A_LONG_GLOVE,A_SHIRT,A_ARMOUR,A_BODY_ARMOUR,A_SHIELD ! left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left wing:torso:3:: ! right wing:torso:3:: ! right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left forepaw:left foreleg:4:: ! left hand:left arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! right forepaw:right foreleg:4:: ! right hand:right arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! left rear paw:left rear leg:4:: ! right rear paw:right rear leg:4:: --- 1,34 ---- ! RACE gargoyle ! SENSITIVITY 20:80 ! LANGUAGE Gargoyleish ! RESISTANCE SHOCK:high ! RESISTANCE BLUNT:low ! RESISTANCE COLD:low ! RESISTANCE WATER:low ! STATS charisma:1:5 ! STATS durability:43:1 ! STATS intelligence:10:4 ! STATS luck:10:4 ! STATS agility:1:5 ! STATS wisdom:31:2 ! STATS speed:10:4 ! STATS strength:43:1 ! STATS coordination:31:2 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB left arm:torso:3:A_LONG_GLOVE,A_SHIRT,A_ARMOR,A_BODY_ARMOR,A_SHIELD ! LIMB right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right arm:torso:3:A_LONG_GLOVE,A_SHIRT,A_ARMOR,A_BODY_ARMOR,A_SHIELD ! LIMB left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left wing:torso:3:: ! LIMB right wing:torso:3:: ! LIMB right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left forepaw:left foreleg:4:: ! LIMB left hand:left arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB right forepaw:right foreleg:4:: ! LIMB right hand:right arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB left rear paw:left rear leg:4:: ! LIMB right rear paw:right rear leg:4:: ! FLYINGRACE diff -c -r --new-file ds1.1/lib/secure/cfg/races/giant ds2.0r27/lib/secure/cfg/races/giant *** ds1.1/lib/secure/cfg/races/giant Fri Jan 3 22:15:53 1997 --- ds2.0r27/lib/secure/cfg/races/giant Wed Jul 5 00:01:12 2006 *************** *** 1,43 **** ! # Nightmare race configuration file ! # To add a race, make one of these files where the race name equals ! # the file name, and type <addrace race> or <addrace race 1>. The ! # 1 means the race is a player race. This file has the following ! # format: ! # line 1: race name ! # line 2: min sight value:max sight value ! # line 3: language (case sensitive) ! # line 4..n: damage type:resistance level ! # line n+1..o: stat:average value:stat class ! # line o+1..p: limb:parent limb:limb class:comma separated armour types ! # line p+1..q: hand:number of fingers ! # damage types come from /include/damage_types.h ! # armour types come from /include/armour_types.h ! # Note that you may in fact have no resistances, thus line 4 would be ! # the first stat. ! giant ! 27:65 ! Loyavenku ! BLUNT:medium ! agility:2:5 ! charisma:10:4 ! coordination:10:3 ! durability:70:1 ! intelligence:10:3 ! luck:5:4 ! speed:1:5 ! strength:80:1 ! wisdom:1:5 ! torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOUR,A_BODY_ARMOUR,A_BELT ! head:torso:1:A_HELMET,A_VISOR,A_AMULET ! right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! left hand:6 ! right hand:6 ! ! --- 1,26 ---- ! RACE giant ! SENSITIVITY 27:65 ! LANGUAGE Loyavenku ! RESISTANCE BLUNT:medium ! STATS agility:2:5 ! STATS charisma:10:4 ! STATS coordination:10:3 ! STATS durability:70:1 ! STATS intelligence:10:3 ! STATS luck:5:4 ! STATS speed:1:5 ! STATS strength:80:1 ! STATS wisdom:1:5 ! LIMB torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOR,A_BODY_ARMOR,A_BELT,A_AMULET ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! HAND left hand:6 ! HAND right hand:6 diff -c -r --new-file ds1.1/lib/secure/cfg/races/gnoll ds2.0r27/lib/secure/cfg/races/gnoll *** ds1.1/lib/secure/cfg/races/gnoll Fri Jan 3 22:15:54 1997 --- ds2.0r27/lib/secure/cfg/races/gnoll Wed Jul 5 00:01:12 2006 *************** *** 1,26 **** ! gnoll ! 20:80 ! Gnollish ! COLD:high ! SHOCK:high ! BLUNT:medium ! WATER:low ! charisma:1:5 ! durability:21:3 ! intelligence:10:4 ! luck:31:2 ! agility:31:2 ! wisdom:10:4 ! speed:21:3 ! strength:21:3 ! coordination:31:2 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! left leg:torso:2:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOUR,A_BODY_ARMOUR,A_SHIELD ! right arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOUR,A_BODY_ARMOUR,A_SHIELD ! right leg:torso:2:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right foot:right leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! right hand:right arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! left foot:left leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! left hand:left arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD --- 1,27 ---- ! RACE gnoll ! SENSITIVITY 20:80 ! LANGUAGE Gnollish ! RESISTANCE COLD:high ! RESISTANCE SHOCK:high ! RESISTANCE BLUNT:medium ! RESISTANCE WATER:low ! STATS charisma:1:5 ! STATS durability:21:3 ! STATS intelligence:10:4 ! STATS luck:31:2 ! STATS agility:31:2 ! STATS wisdom:10:4 ! STATS speed:21:3 ! STATS strength:21:3 ! STATS coordination:31:2 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB left leg:torso:2:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOR,A_BODY_ARMOR,A_SHIELD ! LIMB right arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOR,A_BODY_ARMOR,A_SHIELD ! LIMB right leg:torso:2:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right foot:right leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! LIMB right hand:right arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB left foot:left leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! LIMB left hand:left arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD diff -c -r --new-file ds1.1/lib/secure/cfg/races/gnome ds2.0r27/lib/secure/cfg/races/gnome *** ds1.1/lib/secure/cfg/races/gnome Fri Jan 3 22:15:53 1997 --- ds2.0r27/lib/secure/cfg/races/gnome Wed Jul 5 00:01:12 2006 *************** *** 1,41 **** ! # Nightmare race configuration file ! # To add a race, make one of these files where the race name equals ! # the file name, and type <addrace race> or <addrace race 1>. The ! # 1 means the race is a player race. This file has the following ! # format: ! # line 1: race name ! # line 2: min sight value:max sight value ! # line 3: language (case sensitive) ! # line 4..n: damage type:resistance level ! # line n+1..o: stat:average value:stat class ! # line o+1..p: limb:parent limb:limb class:comma separated armour types ! # line p+1..q: hand:number of fingers ! # damage types come from /include/damage_types.h ! # armour types come from /include/armour_types.h ! # Note that you may in fact have no resistances, thus line 4 would be ! # the first stat. ! gnome ! 8:61 ! Nibelungen ! agility:20:3 ! charisma:1:5 ! coordination:35:3 ! durability:10:4 ! intelligence:50:1 ! luck:40:2 ! speed:20:2 ! strength:30:3 ! wisdom:40:1 ! torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOUR,A_BODY_ARMOUR,A_BELT ! head:torso:1:A_HELMET,A_VISOR,A_AMULET ! right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! left hand:4 ! right hand:4 ! --- 1,25 ---- ! RACE gnome ! SENSITIVITY 8:61 ! LANGUAGE Nibelungen ! STATS agility:20:3 ! STATS charisma:1:5 ! STATS coordination:35:3 ! STATS durability:10:4 ! STATS intelligence:50:1 ! STATS luck:40:2 ! STATS speed:20:2 ! STATS strength:30:3 ! STATS wisdom:40:1 ! LIMB torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOR,A_BODY_ARMOR,A_BELT,A_AMULET ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! HAND left hand:4 ! HAND right hand:4 diff -c -r --new-file ds1.1/lib/secure/cfg/races/goblin ds2.0r27/lib/secure/cfg/races/goblin *** ds1.1/lib/secure/cfg/races/goblin Fri Jan 3 22:15:54 1997 --- ds2.0r27/lib/secure/cfg/races/goblin Wed Jul 5 00:01:12 2006 *************** *** 1,26 **** ! goblin ! 20:80 ! Goblinish ! COLD:high ! SHOCK:high ! BLUNT:medium ! WATER:low ! charisma:1:5 ! durability:43:1 ! intelligence:10:4 ! luck:10:4 ! agility:43:1 ! wisdom:21:3 ! speed:31:2 ! strength:21:3 ! coordination:21:3 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! left leg:torso:2:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOUR,A_BODY_ARMOUR,A_SHIELD ! right arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOUR,A_BODY_ARMOUR,A_SHIELD ! right leg:torso:2:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right foot:right leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! right hand:right arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! left foot:left leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! left hand:left arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD --- 1,27 ---- ! RACE goblin ! SENSITIVITY 20:80 ! LANGUAGE Goblinish ! RESISTANCE COLD:high ! RESISTANCE SHOCK:high ! RESISTANCE BLUNT:medium ! RESISTANCE WATER:low ! STATS charisma:1:5 ! STATS durability:43:1 ! STATS intelligence:10:4 ! STATS luck:10:4 ! STATS agility:43:1 ! STATS wisdom:21:3 ! STATS speed:31:2 ! STATS strength:21:3 ! STATS coordination:21:3 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB left leg:torso:2:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOR,A_BODY_ARMOR,A_SHIELD ! LIMB right arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOR,A_BODY_ARMOR,A_SHIELD ! LIMB right leg:torso:2:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right foot:right leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! LIMB right hand:right arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB left foot:left leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! LIMB left hand:left arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD diff -c -r --new-file ds1.1/lib/secure/cfg/races/god ds2.0r27/lib/secure/cfg/races/god *** ds1.1/lib/secure/cfg/races/god Fri Jan 3 22:15:54 1997 --- ds2.0r27/lib/secure/cfg/races/god Wed Jul 5 00:01:12 2006 *************** *** 1,26 **** ! god ! 20:80 ! Godish ! COLD:high ! SHOCK:high ! BLUNT:medium ! WATER:low ! charisma:43:1 ! durability:43:1 ! intelligence:43:1 ! luck:43:1 ! agility:43:1 ! wisdom:43:1 ! speed:43:1 ! strength:43:1 ! coordination:43:1 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! left leg:torso:2:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOUR,A_BODY_ARMOUR,A_SHIELD ! right arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOUR,A_BODY_ARMOUR,A_SHIELD ! right leg:torso:2:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right foot:right leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! right hand:right arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! left foot:left leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! left hand:left arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD --- 1,29 ---- ! RACE god ! SENSITIVITY 20:80 ! LANGUAGE Godish ! RESISTANCE COLD:high ! RESISTANCE SHOCK:high ! RESISTANCE BLUNT:medium ! RESISTANCE WATER:low ! STATS charisma:43:1 ! STATS durability:43:1 ! STATS intelligence:43:1 ! STATS luck:43:1 ! STATS agility:43:1 ! STATS wisdom:43:1 ! STATS speed:43:1 ! STATS strength:43:1 ! STATS coordination:43:1 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB left leg:torso:2:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOR,A_BODY_ARMOR,A_SHIELD ! LIMB right arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOR,A_BODY_ARMOR,A_SHIELD ! LIMB right leg:torso:2:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right foot:right leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! LIMB right hand:right arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB left foot:left leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! LIMB left hand:left arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMBLESSCOMBATRACE ! NONBITINGRACE diff -c -r --new-file ds1.1/lib/secure/cfg/races/golem ds2.0r27/lib/secure/cfg/races/golem *** ds1.1/lib/secure/cfg/races/golem Fri Jan 3 22:15:54 1997 --- ds2.0r27/lib/secure/cfg/races/golem Wed Jul 5 00:01:12 2006 *************** *** 1,26 **** ! golem ! 20:80 ! Golemish ! COLD:high ! SHOCK:high ! BLUNT:medium ! WATER:low ! charisma:1:5 ! durability:31:2 ! intelligence:10:4 ! luck:1:5 ! agility:21:3 ! wisdom:31:2 ! speed:21:3 ! strength:43:1 ! coordination:21:3 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! left leg:torso:2:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOUR,A_BODY_ARMOUR,A_SHIELD ! right arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOUR,A_BODY_ARMOUR,A_SHIELD ! right leg:torso:2:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right foot:right leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! right hand:right arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! left foot:left leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! left hand:left arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD --- 1,27 ---- ! RACE golem ! SENSITIVITY 20:80 ! LANGUAGE Golemish ! RESISTANCE COLD:high ! RESISTANCE SHOCK:high ! RESISTANCE BLUNT:medium ! RESISTANCE WATER:low ! STATS charisma:1:5 ! STATS durability:31:2 ! STATS intelligence:10:4 ! STATS luck:1:5 ! STATS agility:21:3 ! STATS wisdom:31:2 ! STATS speed:21:3 ! STATS strength:43:1 ! STATS coordination:21:3 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB head:torso:1:A_BODY_ARMOR,A_VISOR,A_HELMET,A_CLOAK ! LIMB left leg:torso:2:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOR,A_BODY_ARMOR,A_SHIELD ! LIMB right arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOR,A_BODY_ARMOR,A_SHIELD ! LIMB right leg:torso:2:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right foot:right leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! LIMB right hand:right arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB left foot:left leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! LIMB left hand:left arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! NONBITINGRACE diff -c -r --new-file ds1.1/lib/secure/cfg/races/griffin ds2.0r27/lib/secure/cfg/races/griffin *** ds1.1/lib/secure/cfg/races/griffin Fri Jan 3 22:15:54 1997 --- ds2.0r27/lib/secure/cfg/races/griffin Wed Jul 5 00:01:12 2006 *************** *** 1,28 **** ! griffin ! 20:80 ! Griffinish ! COLD:high ! SHOCK:high ! BLUNT:medium ! WATER:low ! charisma:1:5 ! durability:43:1 ! intelligence:1:5 ! luck:43:1 ! agility:31:2 ! wisdom:10:4 ! speed:31:2 ! strength:43:1 ! coordination:31:2 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left wing:torso:3:: ! right wing:torso:3:: ! right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left forepaw:left foreleg:4:: ! left rear paw:left rear leg:4:: ! right forepaw:right foreleg:4:: ! right rear paw:right rear leg:4:: --- 1,30 ---- ! RACE griffin ! SENSITIVITY 20:80 ! LANGUAGE Griffinish ! RESISTANCE COLD:high ! RESISTANCE SHOCK:high ! RESISTANCE BLUNT:medium ! RESISTANCE WATER:low ! STATS charisma:1:5 ! STATS durability:43:1 ! STATS intelligence:1:5 ! STATS luck:43:1 ! STATS agility:31:2 ! STATS wisdom:10:4 ! STATS speed:31:2 ! STATS strength:43:1 ! STATS coordination:31:2 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left wing:torso:3:: ! LIMB right wing:torso:3:: ! LIMB right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left forepaw:left foreleg:4:: ! LIMB left rear paw:left rear leg:4:: ! LIMB right forepaw:right foreleg:4:: ! LIMB right rear paw:right rear leg:4:: ! FLYINGRACE diff -c -r --new-file ds1.1/lib/secure/cfg/races/half-elf ds2.0r27/lib/secure/cfg/races/half-elf *** ds1.1/lib/secure/cfg/races/half-elf Fri Jan 3 22:15:53 1997 --- ds2.0r27/lib/secure/cfg/races/half-elf Wed Jul 5 00:01:12 2006 *************** *** 1,41 **** ! # Nightmare race configuration file ! # To add a race, make one of these files where the race name equals ! # the file name, and type <addrace race> or <addrace race 1>. The ! # 1 means the race is a player race. This file has the following ! # format: ! # line 1: race name ! # line 2: min sight value:max sight value ! # line 3: language (case sensitive) ! # line 4..n: damage type:resistance level ! # line n+1..o: stat:average value:stat class ! # line o+1..p: limb:parent limb:limb class:comma separated armour types ! # line p+1..q: hand:number of fingers ! # damage types come from /include/damage_types.h ! # armour types come from /include/armour_types.h ! # Note that you may in fact have no resistances, thus line 4 would be ! # the first stat. ! half-elf ! 12:62 ! Eltherian ! agility:10:2 ! charisma:3:3 ! coordination:50:1 ! durability:5:5 ! intelligence:33:3 ! luck:2:4 ! speed:60:1 ! strength:15:3 ! wisdom:33:2 ! torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOUR,A_BODY_ARMOUR,A_BELT ! head:torso:1:A_HELMET,A_VISOR,A_AMULET ! right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! left hand:4 ! right hand:4 ! --- 1,26 ---- ! RACE half-elf ! PLAYER_RACE 1 ! SENSITIVITY 12:62 ! LANGUAGE Edhellen ! STATS agility:10:2 ! STATS charisma:3:3 ! STATS coordination:50:1 ! STATS durability:5:5 ! STATS intelligence:33:3 ! STATS luck:2:4 ! STATS speed:60:1 ! STATS strength:15:3 ! STATS wisdom:33:2 ! LIMB torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOR,A_BODY_ARMOR,A_BELT,A_AMULET ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! HAND left hand:4 ! HAND right hand:4 diff -c -r --new-file ds1.1/lib/secure/cfg/races/half-orc ds2.0r27/lib/secure/cfg/races/half-orc *** ds1.1/lib/secure/cfg/races/half-orc Fri Jan 3 22:15:53 1997 --- ds2.0r27/lib/secure/cfg/races/half-orc Wed Jul 5 00:01:12 2006 *************** *** 1,41 **** ! # Nightmare race configuration file ! # To add a race, make one of these files where the race name equals ! # the file name, and type <addrace race> or <addrace race 1>. The ! # 1 means the race is a player race. This file has the following ! # format: ! # line 1: race name ! # line 2: min sight value:max sight value ! # line 3: language (case sensitive) ! # line 4..n: damage type:resistance level ! # line n+1..o: stat:average value:stat class ! # line o+1..p: limb:parent limb:limb class:comma separated armour types ! # line p+1..q: hand:number of fingers ! # damage types come from /include/damage_types.h ! # armour types come from /include/armour_types.h ! # Note that you may in fact have no resistances, thus line 4 would be ! # the first stat. ! half-orc ! 12:62 ! Tangetto ! agility:2:4 ! charisma:4:5 ! coordination:20:3 ! durability:40:2 ! intelligence:15:2 ! luck:1:5 ! speed:70:1 ! strength:20:2 ! wisdom:10:5 ! torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOUR,A_BODY_ARMOUR,A_BELT ! head:torso:1:A_HELMET,A_VISOR,A_AMULET ! right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! left hand:4 ! right hand:4 ! --- 1,26 ---- ! RACE half-orc ! PLAYER_RACE 1 ! SENSITIVITY 12:62 ! LANGUAGE Tangetto ! STATS agility:2:4 ! STATS charisma:4:5 ! STATS coordination:20:3 ! STATS durability:40:2 ! STATS intelligence:15:2 ! STATS luck:1:5 ! STATS speed:70:1 ! STATS strength:20:2 ! STATS wisdom:10:5 ! LIMB torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOR,A_BODY_ARMOR,A_BELT,A_AMULET ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! HAND left hand:4 ! HAND right hand:4 diff -c -r --new-file ds1.1/lib/secure/cfg/races/halfling ds2.0r27/lib/secure/cfg/races/halfling *** ds1.1/lib/secure/cfg/races/halfling Fri Jan 3 22:15:53 1997 --- ds2.0r27/lib/secure/cfg/races/halfling Wed Jul 5 00:01:12 2006 *************** *** 1,42 **** ! # Nightmare race configuration file ! # To add a race, make one of these files where the race name equals ! # the file name, and type <addrace race> or <addrace race 1>. The ! # 1 means the race is a player race. This file has the following ! # format: ! # line 1: race name ! # line 2: min sight value:max sight value ! # line 3: language (case sensitive) ! # line 4..n: damage type:resistance level ! # line n+1..o: stat:average value:stat class ! # line o+1..p: limb:parent limb:limb class:comma separated armour types ! # line p+1..q: hand:number of fingers ! # damage types come from /include/damage_types.h ! # armour types come from /include/armour_types.h ! # Note that you may in fact have no resistances, thus line 4 would be ! # the first stat. ! halfling ! 15:65 ! Ersi ! agility:40:2 ! charisma:20:2 ! coordination:33:3 ! durability:10:3 ! intelligence:1:5 ! luck:80:2 ! speed:30:1 ! strength:20:3 ! wisdom:10:4 ! torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOUR,A_BODY_ARMOUR,A_BELT ! head:torso:1:A_HELMET,A_VISOR,A_AMULET ! right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! left hand:5 ! right hand:5 ! ! --- 1,26 ---- ! RACE halfling ! PLAYER_RACE 1 ! SENSITIVITY 15:65 ! LANGUAGE Ersi ! STATS agility:40:2 ! STATS charisma:20:2 ! STATS coordination:33:3 ! STATS durability:10:3 ! STATS intelligence:1:5 ! STATS luck:80:2 ! STATS speed:30:1 ! STATS strength:20:3 ! STATS wisdom:10:4 ! LIMB torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOR,A_BODY_ARMOR,A_BELT,A_AMULET ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! HAND left hand:5 ! HAND right hand:5 diff -c -r --new-file ds1.1/lib/secure/cfg/races/hobbit ds2.0r27/lib/secure/cfg/races/hobbit *** ds1.1/lib/secure/cfg/races/hobbit Fri Jan 3 22:15:53 1997 --- ds2.0r27/lib/secure/cfg/races/hobbit Wed Jul 5 00:01:12 2006 *************** *** 1,42 **** ! # Nightmare race configuration file ! # To add a race, make one of these files where the race name equals ! # the file name, and type <addrace race> or <addrace race 1>. The ! # 1 means the race is a player race. This file has the following ! # format: ! # line 1: race name ! # line 2: min sight value:max sight value ! # line 3: language (case sensitive) ! # line 4..n: damage type:resistance level ! # line n+1..o: stat:average value:stat class ! # line o+1..p: limb:parent limb:limb class:comma separated armour types ! # line p+1..q: hand:number of fingers ! # damage types come from /include/damage_types.h ! # armour types come from /include/armour_types.h ! # Note that you may in fact have no resistances, thus line 4 would be ! # the first stat. ! hobbit ! 20:70 ! Terrakarn ! COLD:low ! agility:20:1 ! charisma:33:3 ! coordination:60:3 ! durability:20:2 ! intelligence:10:5 ! luck:80:1 ! speed:30:2 ! strength:10:4 ! wisdom:20:3 ! torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOUR,A_BODY_ARMOUR,A_BELT ! head:torso:1:A_HELMET,A_VISOR,A_AMULET ! right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! left hand:4 ! right hand:4 ! --- 1,26 ---- ! RACE hobbit ! SENSITIVITY 20:70 ! LANGUAGE Terrakarn ! RESISTANCE COLD:low ! STATS agility:20:1 ! STATS charisma:33:3 ! STATS coordination:60:3 ! STATS durability:20:2 ! STATS intelligence:10:5 ! STATS luck:80:1 ! STATS speed:30:2 ! STATS strength:10:4 ! STATS wisdom:20:3 ! LIMB torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOR,A_BODY_ARMOR,A_BELT,A_AMULET ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! HAND left hand:4 ! HAND right hand:4 diff -c -r --new-file ds1.1/lib/secure/cfg/races/horse ds2.0r27/lib/secure/cfg/races/horse *** ds1.1/lib/secure/cfg/races/horse Fri Jan 3 22:15:54 1997 --- ds2.0r27/lib/secure/cfg/races/horse Wed Jul 5 00:01:12 2006 *************** *** 1,27 **** ! horse ! 20:80 ! Horseish ! SHOCK:high ! BLUNT:medium ! COLD:low ! WATER:low ! charisma:21:3 ! durability:31:2 ! intelligence:1:5 ! luck:1:5 ! agility:31:2 ! wisdom:1:5 ! charsima:1:5 ! speed:31:2 ! strength:43:1 ! coordination:10:4 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left fore-hoof:left foreleg:4:: ! left rear hoof:left rear leg:4:: ! right fore-hoof:right foreleg:4:: ! right rear hoof:right rear leg:4:: --- 1,28 ---- ! RACE horse ! SENSITIVITY 20:80 ! LANGUAGE Horseish ! RESISTANCE SHOCK:high ! RESISTANCE BLUNT:medium ! RESISTANCE COLD:low ! RESISTANCE WATER:low ! STATS charisma:21:3 ! STATS durability:31:2 ! STATS intelligence:1:5 ! STATS luck:1:5 ! STATS agility:31:2 ! STATS wisdom:1:5 ! STATS charisma:1:5 ! STATS speed:31:2 ! STATS strength:43:1 ! STATS coordination:10:4 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left fore-hoof:left foreleg:4:: ! LIMB left rear hoof:left rear leg:4:: ! LIMB right fore-hoof:right foreleg:4:: ! LIMB right rear hoof:right rear leg:4:: diff -c -r --new-file ds1.1/lib/secure/cfg/races/human ds2.0r27/lib/secure/cfg/races/human *** ds1.1/lib/secure/cfg/races/human Fri Jan 3 22:15:52 1997 --- ds2.0r27/lib/secure/cfg/races/human Wed Jul 5 00:01:12 2006 *************** *** 1,40 **** ! # Nightmare race configuration file ! # To add a race, make one of these files where the race name equals ! # the file name, and type <addrace race> or <addrace race 1>. The ! # 1 means the race is a player race. This file has the following ! # format: ! # line 1: race name ! # line 2: min sight value:max sight value ! # line 3: language (case sensitive) ! # line 4..n: damage type:resistance level ! # line n+1..o: stat:average value:stat class ! # line o+1..p: limb:parent limb:limb class:comma separated armour types ! # line p+1..q: hand:number of fingers ! # damage types come from /include/damage_types.h ! # armour types come from /include/armour_types.h ! # Note that you may in fact have no resistances, thus line 4 would be ! # the first stat. ! human ! 25:75 ! Farsi ! agility:33:3 ! charisma:33:2 ! coordination:33:2 ! durability:30:4 ! intelligence:50:1 ! luck:10:3 ! speed:20:3 ! strength:10:4 ! wisdom:50:3 ! torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOUR,A_BODY_ARMOUR,A_BELT ! head:torso:1:A_HELMET,A_VISOR,A_AMULET ! right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! right hand:5 ! left hand:5 --- 1,27 ---- ! RACE human ! PLAYER_RACE 1 ! SENSITIVITY 25:75 ! LANGUAGE English ! SKILL psionic defense:2:3:4:5 ! STATS agility:33:3 ! STATS charisma:33:2 ! STATS coordination:33:2 ! STATS durability:30:4 ! STATS intelligence:50:1 ! STATS luck:10:3 ! STATS speed:20:3 ! STATS strength:10:4 ! STATS wisdom:50:3 ! LIMB torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOR,A_BODY_ARMOR,A_BELT,A_AMULET ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! HAND right hand:5 ! HAND left hand:5 diff -c -r --new-file ds1.1/lib/secure/cfg/races/insect ds2.0r27/lib/secure/cfg/races/insect *** ds1.1/lib/secure/cfg/races/insect Fri Jan 3 22:15:54 1997 --- ds2.0r27/lib/secure/cfg/races/insect Wed Jul 5 00:01:12 2006 *************** *** 1,25 **** ! insect ! 20:80 ! Insectish ! SHOCK:high ! BLUNT:medium ! COLD:low ! WATER:low ! charisma:1:5 ! durability:1:5 ! intelligence:1:5 ! luck:43:1 ! agility:31:2 ! wisdom:1:5 ! charsima:1:5 ! speed:43:1 ! strength:1:5 ! coordination:21:3 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! 4th leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! 6th leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! 5th leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! 1st leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! 3rd leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! 2nd leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK --- 1,26 ---- ! RACE insect ! SENSITIVITY 20:80 ! LANGUAGE Insectish ! RESISTANCE SHOCK:high ! RESISTANCE BLUNT:medium ! RESISTANCE COLD:low ! RESISTANCE WATER:low ! STATS charisma:1:5 ! STATS durability:1:5 ! STATS intelligence:1:5 ! STATS luck:43:1 ! STATS agility:31:2 ! STATS wisdom:1:5 ! STATS charisma:1:5 ! STATS speed:43:1 ! STATS strength:1:5 ! STATS coordination:21:3 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB head:torso:1:A_BODY_ARMOR,A_VISOR,A_HELMET,A_CLOAK ! LIMB 4th leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB 6th leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB 5th leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB 1st leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB 3rd leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB 2nd leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! FLYINGRACE diff -c -r --new-file ds1.1/lib/secure/cfg/races/kender ds2.0r27/lib/secure/cfg/races/kender *** ds1.1/lib/secure/cfg/races/kender Fri Jan 3 22:15:53 1997 --- ds2.0r27/lib/secure/cfg/races/kender Wed Jul 5 00:01:12 2006 *************** *** 1,42 **** ! # Nightmare race configuration file ! # To add a race, make one of these files where the race name equals ! # the file name, and type <addrace race> or <addrace race 1>. The ! # 1 means the race is a player race. This file has the following ! # format: ! # line 1: race name ! # line 2: min sight value:max sight value ! # line 3: language (case sensitive) ! # line 4..n: damage type:resistance level ! # line n+1..o: stat:average value:stat class ! # line o+1..p: limb:parent limb:limb class:comma separated armour types ! # line p+1..q: hand:number of fingers ! # damage types come from /include/damage_types.h ! # armour types come from /include/armour_types.h ! # Note that you may in fact have no resistances, thus line 4 would be ! # the first stat. ! kender ! 23:78 ! Kendrall ! agility:40:3 ! charisma:40:2 ! coordination:50:2 ! durability:20:1 ! intelligence:20:2 ! luck:33:3 ! speed:50:1 ! strength:3:5 ! wisdom:7:4 ! torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOUR,A_BODY_ARMOUR,A_BELT ! head:torso:1:A_HELMET,A_VISOR,A_AMULET ! right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! left hand:5 ! right hand:5 ! ! --- 1,26 ---- ! RACE kender ! SENSITIVITY 23:78 ! LANGUAGE Kendrall ! SKILL stealing:1:5:5:5 ! STATS agility:40:3 ! STATS charisma:40:2 ! STATS coordination:50:2 ! STATS durability:20:1 ! STATS intelligence:20:2 ! STATS luck:33:3 ! STATS speed:50:1 ! STATS strength:3:5 ! STATS wisdom:7:4 ! LIMB torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOR,A_BODY_ARMOR,A_BELT,A_AMULET ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! HAND left hand:5 ! HAND right hand:5 diff -c -r --new-file ds1.1/lib/secure/cfg/races/klingon ds2.0r27/lib/secure/cfg/races/klingon *** ds1.1/lib/secure/cfg/races/klingon Fri Jan 3 22:15:52 1997 --- ds2.0r27/lib/secure/cfg/races/klingon Wed Jul 5 00:01:12 2006 *************** *** 1,45 **** ! # Nightmare race configuration file ! # To add a race, make one of these files where the race name equals ! # the file name, and type <addrace race> or <addrace race 1>. The ! # 1 means the race is a player race. This file has the following ! # format: ! # line 1: race name ! # line 2: min sight value:max sight value ! # line 3: language (case sensitive) ! # line 4..n: damage type:resistance level ! # line n+1..o: stat:average value:stat class ! # line o+1..p: limb:parent limb:limb class:comma separated armour types ! # line p+1..q: hand:number of fingers ! # damage types come from /include/damage_types.h ! # armour types come from /include/armour_types.h ! # Note that you may in fact have no resistances, thus line 4 would be ! # the first stat. ! klingon ! 19:65 ! T'linghan ! BLADE:medium ! BLUNT:medium ! COLD:medium ! HEAT:medium ! KNIFE:medium ! agility:30:2 ! charisma:10:5 ! coordination:10:2 ! durability:60:1 ! intelligence:5:4 ! luck:1:4 ! speed:30:3 ! strength:60:1 ! wisdom:1:5 ! torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOUR,A_BODY_ARMOUR,A_BELT ! head:torso:1:A_HELMET,A_VISOR,A_AMULET ! right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! right hand:5 ! left hand:5 --- 1,30 ---- ! RACE klingon ! SENSITIVITY 19:65 ! LANGUAGE T'linghan ! RESISTANCE BLADE:medium ! RESISTANCE BLUNT:medium ! RESISTANCE COLD:medium ! RESISTANCE HEAT:medium ! RESISTANCE KNIFE:medium ! STATS agility:30:2 ! STATS charisma:10:5 ! STATS coordination:10:2 ! STATS durability:60:1 ! STATS intelligence:5:4 ! STATS luck:1:4 ! STATS speed:30:3 ! STATS strength:60:1 ! STATS wisdom:1:5 ! LIMB torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOR,A_BODY_ARMOR,A_BELT,A_AMULET ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! HAND right hand:5 ! HAND left hand:5 diff -c -r --new-file ds1.1/lib/secure/cfg/races/kobold ds2.0r27/lib/secure/cfg/races/kobold *** ds1.1/lib/secure/cfg/races/kobold Fri Jan 3 22:15:54 1997 --- ds2.0r27/lib/secure/cfg/races/kobold Wed Jul 5 00:01:12 2006 *************** *** 1,32 **** ! kobold ! 20:80 ! Koboldish ! SHOCK:high ! BLADE:medium ! BLUNT:medium ! KNIFE:medium ! COLD:medium ! HEAT:medium ! WATER:low ! charisma:10:4 ! durability:43:1 ! intelligence:10:4 ! luck:21:3 ! agility:21:3 ! wisdom:10:4 ! charsima:1:5 ! speed:21:3 ! strength:43:1 ! coordination:31:2 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! left leg:torso:2:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOUR,A_BODY_ARMOUR,A_SHIELD ! right arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOUR,A_BODY_ARMOUR,A_SHIELD ! right leg:torso:2:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left hand:left arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! right hand:right arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! left hoof:left leg:4:: ! right hoof:right leg:4:: ! right hand:5 ! left hand:5 --- 1,33 ---- ! RACE kobold ! SENSITIVITY 20:80 ! LANGUAGE Koboldish ! RESISTANCE SHOCK:high ! RESISTANCE BLADE:medium ! RESISTANCE BLUNT:medium ! RESISTANCE KNIFE:medium ! RESISTANCE COLD:medium ! RESISTANCE HEAT:medium ! RESISTANCE WATER:low ! STATS charisma:10:4 ! STATS durability:43:1 ! STATS intelligence:10:4 ! STATS luck:21:3 ! STATS agility:21:3 ! STATS wisdom:10:4 ! STATS charisma:1:5 ! STATS speed:21:3 ! STATS strength:43:1 ! STATS coordination:31:2 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB left leg:torso:2:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOR,A_BODY_ARMOR,A_SHIELD ! LIMB right arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOR,A_BODY_ARMOR,A_SHIELD ! LIMB right leg:torso:2:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left hand:left arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB right hand:right arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB left hoof:left leg:4:: ! LIMB right hoof:right leg:4:: ! HAND right hand:5 ! HAND left hand:5 diff -c -r --new-file ds1.1/lib/secure/cfg/races/lizard ds2.0r27/lib/secure/cfg/races/lizard *** ds1.1/lib/secure/cfg/races/lizard Fri Jan 3 22:15:54 1997 --- ds2.0r27/lib/secure/cfg/races/lizard Wed Jul 5 00:01:12 2006 *************** *** 1,22 **** ! lizard ! 20:80 ! Lizardish ! SHOCK:high ! BLADE:medium ! BLUNT:medium ! KNIFE:medium ! COLD:medium ! HEAT:medium ! WATER:low ! charisma:10:4 ! durability:21:3 ! intelligence:1:5 ! luck:10:4 ! agility:21:3 ! wisdom:1:5 ! charsima:1:5 ! speed:21:3 ! strength:21:3 ! coordination:21:3 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK --- 1,31 ---- ! RACE lizard ! SENSITIVITY 20:80 ! LANGUAGE Lizardish ! RESISTANCE SHOCK:high ! RESISTANCE BLADE:medium ! RESISTANCE BLUNT:medium ! RESISTANCE KNIFE:medium ! RESISTANCE COLD:medium ! RESISTANCE HEAT:medium ! RESISTANCE WATER:low ! STATS charisma:10:4 ! STATS durability:21:3 ! STATS intelligence:1:5 ! STATS luck:10:4 ! STATS agility:21:3 ! STATS wisdom:1:5 ! STATS charisma:1:5 ! STATS speed:21:3 ! STATS strength:21:3 ! STATS coordination:21:3 ! LIMB torso:0:1:A_AMULET ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! left rear leg:torso:3: ! right rear leg:torso:3: ! right foreleg:torso:3: ! left foreleg:torso:3: ! LIMB left forepaw:left foreleg:4:: ! LIMB right forepaw:right foreleg:4:: ! LIMB left rear paw:left rear leg:4:: ! LIMB right rear paw:right rear leg:4:: diff -c -r --new-file ds1.1/lib/secure/cfg/races/nymph ds2.0r27/lib/secure/cfg/races/nymph *** ds1.1/lib/secure/cfg/races/nymph Fri Jan 3 22:15:53 1997 --- ds2.0r27/lib/secure/cfg/races/nymph Wed Jul 5 00:01:12 2006 *************** *** 1,42 **** ! # Nightmare race configuration file ! # To add a race, make one of these files where the race name equals ! # the file name, and type <addrace race> or <addrace race 1>. The ! # 1 means the race is a player race. This file has the following ! # format: ! # line 1: race name ! # line 2: min sight value:max sight value ! # line 3: language (case sensitive) ! # line 4..n: damage type:resistance level ! # line n+1..o: stat:average value:stat class ! # line o+1..p: limb:parent limb:limb class:comma separated armour types ! # line p+1..q: hand:number of fingers ! # damage types come from /include/damage_types.h ! # armour types come from /include/armour_types.h ! # Note that you may in fact have no resistances, thus line 4 would be ! # the first stat. ! nymph ! 26:76 ! Nymal ! agility:50:1 ! charisma:80:1 ! coordination:20:2 ! durability:7:5 ! intelligence:25:4 ! luck:50:2 ! speed:60:2 ! strength:3:5 ! wisdom:20:4 ! torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOUR,A_BODY_ARMOUR,A_BELT ! head:torso:1:A_HELMET,A_VISOR,A_AMULET ! right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! left hand:5 ! right hand:5 ! ! --- 1,25 ---- ! RACE nymph ! SENSITIVITY 26:76 ! LANGUAGE Nymal ! STATS agility:50:1 ! STATS charisma:80:1 ! STATS coordination:20:2 ! STATS durability:7:5 ! STATS intelligence:25:4 ! STATS luck:50:2 ! STATS speed:60:2 ! STATS strength:3:5 ! STATS wisdom:20:4 ! LIMB torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOR,A_BODY_ARMOR,A_BELT,A_AMULET ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! HAND left hand:5 ! HAND right hand:5 diff -c -r --new-file ds1.1/lib/secure/cfg/races/ogre ds2.0r27/lib/secure/cfg/races/ogre *** ds1.1/lib/secure/cfg/races/ogre Fri Jan 3 22:15:52 1997 --- ds2.0r27/lib/secure/cfg/races/ogre Wed Jul 5 00:01:12 2006 *************** *** 1,44 **** ! # Nightmare race configuration file ! # To add a race, make one of these files where the race name equals ! # the file name, and type <addrace race> or <addrace race 1>. The ! # 1 means the race is a player race. This file has the following ! # format: ! # line 1: race name ! # line 2: min sight value:max sight value ! # line 3: language (case sensitive) ! # line 4..n: damage type:resistance level ! # line n+1..o: stat:average value:stat class ! # line o+1..p: limb:parent limb:limb class:comma separated armour types ! # line p+1..q: hand:number of fingers ! # damage types come from /include/damage_types.h ! # armour types come from /include/armour_types.h ! # Note that you may in fact have no resistances, thus line 4 would be ! # the first stat. ! ogre ! 25:70 ! Shangtai ! BLADE:low ! BLUNT:low ! KNIFE:low ! agility:1:5 ! charisma:1:5 ! coordination:2:5 ! durability:68:1 ! intelligence:10:4 ! luck:1:5 ! speed:7:4 ! strength:50:1 ! wisdom:1:5 ! torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOUR,A_BODY_ARMOUR,A_BELT ! head:torso:1:A_HELMET,A_VISOR,A_AMULET ! right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! right hand:6 ! left hand:6 ! --- 1,28 ---- ! RACE ogre ! SENSITIVITY 25:70 ! LANGUAGE Shangtai ! RESISTANCE BLADE:low ! RESISTANCE BLUNT:low ! RESISTANCE KNIFE:low ! STATS agility:1:5 ! STATS charisma:1:5 ! STATS coordination:2:5 ! STATS durability:68:1 ! STATS intelligence:10:4 ! STATS luck:1:5 ! STATS speed:7:4 ! STATS strength:50:1 ! STATS wisdom:1:5 ! LIMB torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOR,A_BODY_ARMOR,A_BELT,A_AMULET ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! HAND right hand:6 ! HAND left hand:6 diff -c -r --new-file ds1.1/lib/secure/cfg/races/orc ds2.0r27/lib/secure/cfg/races/orc *** ds1.1/lib/secure/cfg/races/orc Fri Jan 3 22:15:53 1997 --- ds2.0r27/lib/secure/cfg/races/orc Wed Jul 5 00:01:12 2006 *************** *** 1,42 **** ! # Nightmare race configuration file ! # To add a race, make one of these files where the race name equals ! # the file name, and type <addrace race> or <addrace race 1>. The ! # 1 means the race is a player race. This file has the following ! # format: ! # line 1: race name ! # line 2: min sight value:max sight value ! # line 3: language (case sensitive) ! # line 4..n: damage type:resistance level ! # line n+1..o: stat:average value:stat class ! # line o+1..p: limb:parent limb:limb class:comma separated armour types ! # line p+1..q: hand:number of fingers ! # damage types come from /include/damage_types.h ! # armour types come from /include/armour_types.h ! # Note that you may in fact have no resistances, thus line 4 would be ! # the first stat. ! orc ! 21:71 ! Tangetto ! agility:10:4 ! charisma:1:5 ! coordination:33:3 ! durability:30:2 ! intelligence:3:5 ! luck:3:4 ! speed:40:2 ! strength:35:2 ! wisdom:3:5 ! torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOUR,A_BODY_ARMOUR,A_BELT ! head:torso:1:A_HELMET,A_VISOR,A_AMULET ! right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! left hand:6 ! right hand:6 ! ! --- 1,26 ---- ! RACE orc ! PLAYER_RACE 1 ! SENSITIVITY 21:71 ! LANGUAGE Tangetto ! STATS agility:10:4 ! STATS charisma:1:5 ! STATS coordination:33:3 ! STATS durability:30:2 ! STATS intelligence:3:5 ! STATS luck:3:4 ! STATS speed:40:2 ! STATS strength:35:2 ! STATS wisdom:3:5 ! LIMB torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOR,A_BODY_ARMOR,A_BELT,A_AMULET ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! HAND left hand:6 ! HAND right hand:6 diff -c -r --new-file ds1.1/lib/secure/cfg/races/pegasus ds2.0r27/lib/secure/cfg/races/pegasus *** ds1.1/lib/secure/cfg/races/pegasus Fri Jan 3 22:15:55 1997 --- ds2.0r27/lib/secure/cfg/races/pegasus Wed Jul 5 00:01:12 2006 *************** *** 1,32 **** ! pegasus ! 20:80 ! Pegasusish ! SHOCK:high ! COLD:medium ! HEAT:medium ! BLADE:low ! BLUNT:low ! KNIFE:low ! WATER:low ! charisma:43:1 ! durability:31:2 ! intelligence:21:3 ! luck:43:1 ! agility:43:1 ! wisdom:31:2 ! charsima:1:5 ! speed:31:2 ! strength:31:2 ! coordination:31:2 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left wing:torso:3:: ! right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right wing:torso:3:: ! right rear hoof:right rear leg:4:: ! left fore-hoof:left foreleg:4:: ! left rear hoof:left rear leg:4:: ! right fore-hoof:right foreleg:4:: --- 1,34 ---- ! RACE pegasus ! SENSITIVITY 20:80 ! LANGUAGE Pegasusish ! RESISTANCE SHOCK:high ! RESISTANCE COLD:medium ! RESISTANCE HEAT:medium ! RESISTANCE BLADE:low ! RESISTANCE BLUNT:low ! RESISTANCE KNIFE:low ! RESISTANCE WATER:low ! STATS charisma:43:1 ! STATS durability:31:2 ! STATS intelligence:21:3 ! STATS luck:43:1 ! STATS agility:43:1 ! STATS wisdom:31:2 ! STATS charisma:1:5 ! STATS speed:31:2 ! STATS strength:31:2 ! STATS coordination:31:2 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left wing:torso:3:: ! LIMB right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right wing:torso:3:: ! LIMB right rear hoof:right rear leg:4:: ! LIMB left fore-hoof:left foreleg:4:: ! LIMB left rear hoof:left rear leg:4:: ! LIMB right fore-hoof:right foreleg:4:: ! FLYINGRACE diff -c -r --new-file ds1.1/lib/secure/cfg/races/pig ds2.0r27/lib/secure/cfg/races/pig *** ds1.1/lib/secure/cfg/races/pig Fri Jan 3 22:15:55 1997 --- ds2.0r27/lib/secure/cfg/races/pig Wed Jul 5 00:01:12 2006 *************** *** 1,30 **** ! pig ! 20:80 ! Pigish ! SHOCK:high ! COLD:medium ! HEAT:medium ! BLADE:low ! BLUNT:low ! KNIFE:low ! WATER:low ! charisma:1:5 ! durability:43:1 ! intelligence:1:5 ! luck:1:5 ! agility:1:5 ! wisdom:31:2 ! charsima:1:5 ! speed:10:4 ! strength:21:3 ! coordination:21:3 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left fore-hoof:left foreleg:4:: ! left rear hoof:left rear leg:4:: ! right fore-hoof:right foreleg:4:: ! right rear hoof:right rear leg:4:: --- 1,31 ---- ! RACE pig ! SENSITIVITY 20:80 ! LANGUAGE Pigish ! RESISTANCE SHOCK:high ! RESISTANCE COLD:medium ! RESISTANCE HEAT:medium ! RESISTANCE BLADE:low ! RESISTANCE BLUNT:low ! RESISTANCE KNIFE:low ! RESISTANCE WATER:low ! STATS charisma:1:5 ! STATS durability:43:1 ! STATS intelligence:1:5 ! STATS luck:1:5 ! STATS agility:1:5 ! STATS wisdom:31:2 ! STATS charisma:1:5 ! STATS speed:10:4 ! STATS strength:21:3 ! STATS coordination:21:3 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left fore-hoof:left foreleg:4:: ! LIMB left rear hoof:left rear leg:4:: ! LIMB right fore-hoof:right foreleg:4:: ! LIMB right rear hoof:right rear leg:4:: diff -c -r --new-file ds1.1/lib/secure/cfg/races/plant ds2.0r27/lib/secure/cfg/races/plant *** ds1.1/lib/secure/cfg/races/plant Fri Jan 3 22:15:55 1997 --- ds2.0r27/lib/secure/cfg/races/plant Wed Jul 5 00:01:12 2006 *************** *** 1,22 **** ! plant ! 20:80 ! Plantish ! SHOCK:high ! COLD:medium ! HEAT:medium ! BLADE:low ! BLUNT:low ! KNIFE:low ! WATER:low ! charisma:21:3 ! durability:21:3 ! intelligence:1:5 ! luck:21:3 ! agility:1:5 ! wisdom:1:5 ! charsima:1:5 ! speed:1:5 ! strength:21:3 ! coordination:1:5 ! trunk:0:1:: ! 1st branch:trunk:3:: --- 1,23 ---- ! RACE plant ! SENSITIVITY 20:80 ! LANGUAGE Plantish ! RESISTANCE SHOCK:high ! RESISTANCE COLD:medium ! RESISTANCE HEAT:medium ! RESISTANCE BLADE:low ! RESISTANCE BLUNT:low ! RESISTANCE KNIFE:low ! RESISTANCE WATER:low ! STATS charisma:21:3 ! STATS durability:21:3 ! STATS intelligence:1:5 ! STATS luck:21:3 ! STATS agility:1:5 ! STATS wisdom:1:5 ! STATS charisma:1:5 ! STATS speed:1:5 ! STATS strength:21:3 ! STATS coordination:1:5 ! LIMB trunk:0:1:: ! LIMB 1st branch:trunk:3:: ! LIMBLESSCOMBATRACE diff -c -r --new-file ds1.1/lib/secure/cfg/races/primate ds2.0r27/lib/secure/cfg/races/primate *** ds1.1/lib/secure/cfg/races/primate Fri Jan 3 22:15:56 1997 --- ds2.0r27/lib/secure/cfg/races/primate Wed Jul 5 00:01:12 2006 *************** *** 1,30 **** ! primate ! 20:80 ! Primateish ! SHOCK:high ! COLD:medium ! HEAT:medium ! BLADE:low ! BLUNT:low ! KNIFE:low ! WATER:low ! charisma:21:3 ! durability:10:4 ! intelligence:21:3 ! luck:21:3 ! agility:21:3 ! wisdom:10:4 ! charsima:1:5 ! speed:21:3 ! strength:10:4 ! coordination:21:3 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! left leg:torso:2:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOUR,A_BODY_ARMOUR,A_SHIELD ! right arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOUR,A_BODY_ARMOUR,A_SHIELD ! right leg:torso:2:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right foot:right leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! right hand:right arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! left foot:left leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! left hand:left arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD --- 1,31 ---- ! RACE primate ! SENSITIVITY 20:80 ! LANGUAGE Primateish ! RESISTANCE SHOCK:high ! RESISTANCE COLD:medium ! RESISTANCE HEAT:medium ! RESISTANCE BLADE:low ! RESISTANCE BLUNT:low ! RESISTANCE KNIFE:low ! RESISTANCE WATER:low ! STATS charisma:21:3 ! STATS durability:10:4 ! STATS intelligence:21:3 ! STATS luck:21:3 ! STATS agility:21:3 ! STATS wisdom:10:4 ! STATS charisma:1:5 ! STATS speed:21:3 ! STATS strength:10:4 ! STATS coordination:21:3 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB left leg:torso:2:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOR,A_BODY_ARMOR,A_SHIELD ! LIMB right arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOR,A_BODY_ARMOR,A_SHIELD ! LIMB right leg:torso:2:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right foot:right leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! LIMB right hand:right arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB left foot:left leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! LIMB left hand:left arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD diff -c -r --new-file ds1.1/lib/secure/cfg/races/rodent ds2.0r27/lib/secure/cfg/races/rodent *** ds1.1/lib/secure/cfg/races/rodent Fri Jan 3 22:15:56 1997 --- ds2.0r27/lib/secure/cfg/races/rodent Wed Jul 5 00:01:12 2006 *************** *** 1,30 **** ! rodent ! 20:80 ! Rodentish ! SHOCK:high ! COLD:medium ! HEAT:medium ! BLADE:low ! BLUNT:low ! KNIFE:low ! WATER:low ! charisma:1:5 ! durability:10:4 ! intelligence:1:5 ! luck:1:5 ! agility:21:3 ! wisdom:10:4 ! charsima:1:5 ! speed:31:2 ! strength:1:5 ! coordination:10:4 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left forepaw:left foreleg:4:: ! right forepaw:right foreleg:4:: ! left rear paw:left rear leg:4:: ! right rear paw:right rear leg:4:: --- 1,31 ---- ! RACE rodent ! SENSITIVITY 20:80 ! LANGUAGE Rodentish ! RESISTANCE SHOCK:high ! RESISTANCE COLD:medium ! RESISTANCE HEAT:medium ! RESISTANCE BLADE:low ! RESISTANCE BLUNT:low ! RESISTANCE KNIFE:low ! RESISTANCE WATER:low ! STATS charisma:1:5 ! STATS durability:10:4 ! STATS intelligence:1:5 ! STATS luck:1:5 ! STATS agility:21:3 ! STATS wisdom:10:4 ! STATS charisma:1:5 ! STATS speed:31:2 ! STATS strength:1:5 ! STATS coordination:10:4 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left forepaw:left foreleg:4:: ! LIMB right forepaw:right foreleg:4:: ! LIMB left rear paw:left rear leg:4:: ! LIMB right rear paw:right rear leg:4:: diff -c -r --new-file ds1.1/lib/secure/cfg/races/satyr ds2.0r27/lib/secure/cfg/races/satyr *** ds1.1/lib/secure/cfg/races/satyr Fri Jan 3 22:15:53 1997 --- ds2.0r27/lib/secure/cfg/races/satyr Wed Jul 5 00:01:12 2006 *************** *** 1,42 **** ! # Nightmare race configuration file ! # To add a race, make one of these files where the race name equals ! # the file name, and type <addrace race> or <addrace race 1>. The ! # 1 means the race is a player race. This file has the following ! # format: ! # line 1: race name ! # line 2: min sight value:max sight value ! # line 3: language (case sensitive) ! # line 4..n: damage type:resistance level ! # line n+1..o: stat:average value:stat class ! # line o+1..p: limb:parent limb:limb class:comma separated armour types ! # line p+1..q: hand:number of fingers ! # damage types come from /include/damage_types.h ! # armour types come from /include/armour_types.h ! # Note that you may in fact have no resistances, thus line 4 would be ! # the first stat. ! satyr ! 27:77 ! Wulinaxian ! agility:50:2 ! charisma:3:5 ! coordination:60:1 ! durability:25:2 ! intelligence:33:3 ! luck:10:1 ! speed:5:2 ! strength:2:4 ! wisdom:80:1 ! torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOUR,A_BODY_ARMOUR,A_BELT ! head:torso:1:A_HELMET,A_VISOR,A_AMULET ! right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! right hoof:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left hoof:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! left hand:4 ! right hand:4 ! ! --- 1,25 ---- ! RACE satyr ! SENSITIVITY 27:77 ! LANGUAGE Wulinaxian ! STATS agility:50:2 ! STATS charisma:3:5 ! STATS coordination:60:1 ! STATS durability:25:2 ! STATS intelligence:33:3 ! STATS luck:10:1 ! STATS speed:5:2 ! STATS strength:2:4 ! STATS wisdom:80:1 ! LIMB torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOR,A_BODY_ARMOR,A_BELT,A_AMULET ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB right hoof:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left hoof:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! HAND left hand:4 ! HAND right hand:4 diff -c -r --new-file ds1.1/lib/secure/cfg/races/sheep ds2.0r27/lib/secure/cfg/races/sheep *** ds1.1/lib/secure/cfg/races/sheep Fri Jan 3 22:15:56 1997 --- ds2.0r27/lib/secure/cfg/races/sheep Wed Jul 5 00:01:12 2006 *************** *** 1,30 **** ! sheep ! 20:80 ! Sheepish ! SHOCK:high ! COLD:medium ! HEAT:medium ! BLADE:low ! BLUNT:low ! KNIFE:low ! WATER:low ! charisma:21:3 ! durability:21:3 ! intelligence:1:5 ! luck:1:5 ! agility:21:3 ! wisdom:1:5 ! charsima:1:5 ! speed:10:4 ! strength:21:3 ! coordination:10:4 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left fore-hoof:left foreleg:4:: ! left rear hoof:left rear leg:4:: ! right fore-hoof:right foreleg:4:: ! right rear hoof:right rear leg:4:: --- 1,31 ---- ! RACE sheep ! SENSITIVITY 20:80 ! LANGUAGE Sheepish ! RESISTANCE SHOCK:high ! RESISTANCE COLD:medium ! RESISTANCE HEAT:medium ! RESISTANCE BLADE:low ! RESISTANCE BLUNT:low ! RESISTANCE KNIFE:low ! RESISTANCE WATER:low ! STATS charisma:21:3 ! STATS durability:21:3 ! STATS intelligence:1:5 ! STATS luck:1:5 ! STATS agility:21:3 ! STATS wisdom:1:5 ! STATS charisma:1:5 ! STATS speed:10:4 ! STATS strength:21:3 ! STATS coordination:10:4 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left fore-hoof:left foreleg:4:: ! LIMB left rear hoof:left rear leg:4:: ! LIMB right fore-hoof:right foreleg:4:: ! LIMB right rear hoof:right rear leg:4:: diff -c -r --new-file ds1.1/lib/secure/cfg/races/slug ds2.0r27/lib/secure/cfg/races/slug *** ds1.1/lib/secure/cfg/races/slug Fri Jan 3 22:15:56 1997 --- ds2.0r27/lib/secure/cfg/races/slug Wed Jul 5 00:01:12 2006 *************** *** 1,21 **** ! slug ! 20:80 ! Slugish ! SHOCK:high ! COLD:medium ! HEAT:medium ! BLADE:low ! BLUNT:low ! KNIFE:low ! WATER:low ! charisma:1:5 ! durability:1:5 ! intelligence:1:5 ! luck:1:5 ! agility:1:5 ! wisdom:10:4 ! charsima:1:5 ! speed:1:5 ! strength:10:4 ! coordination:1:5 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT --- 1,24 ---- ! RACE slug ! SENSITIVITY 20:80 ! LANGUAGE Slugish ! RESISTANCE SHOCK:high ! RESISTANCE COLD:medium ! RESISTANCE HEAT:medium ! RESISTANCE BLADE:low ! RESISTANCE BLUNT:low ! RESISTANCE KNIFE:low ! RESISTANCE WATER:low ! STATS charisma:1:5 ! STATS durability:1:5 ! STATS intelligence:1:5 ! STATS luck:1:5 ! STATS agility:1:5 ! STATS wisdom:10:4 ! STATS charisma:1:5 ! STATS speed:1:5 ! STATS strength:10:4 ! STATS coordination:1:5 ! LIMB torso:0:1:A_VEST ! LIMB head:torso:1:A_HELMET ! LIMBLESSCOMBATRACE ! LIMBLESSRACE diff -c -r --new-file ds1.1/lib/secure/cfg/races/snake ds2.0r27/lib/secure/cfg/races/snake *** ds1.1/lib/secure/cfg/races/snake Fri Jan 3 22:15:56 1997 --- ds2.0r27/lib/secure/cfg/races/snake Wed Jul 5 00:01:12 2006 *************** *** 1,21 **** ! snake ! 20:80 ! Snakeish ! SHOCK:high ! COLD:medium ! HEAT:medium ! BLADE:low ! BLUNT:low ! KNIFE:low ! WATER:low ! charisma:1:5 ! durability:10:4 ! intelligence:10:4 ! luck:43:1 ! agility:10:4 ! wisdom:31:2 ! charsima:1:5 ! speed:10:4 ! strength:1:5 ! coordination:1:5 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT --- 1,24 ---- ! RACE snake ! SENSITIVITY 20:80 ! LANGUAGE Snakeish ! RESISTANCE SHOCK:high ! RESISTANCE COLD:medium ! RESISTANCE HEAT:medium ! RESISTANCE BLADE:low ! RESISTANCE BLUNT:low ! RESISTANCE KNIFE:low ! RESISTANCE WATER:low ! STATS charisma:1:5 ! STATS durability:10:4 ! STATS intelligence:10:4 ! STATS luck:43:1 ! STATS agility:10:4 ! STATS wisdom:31:2 ! STATS charisma:1:5 ! STATS speed:10:4 ! STATS strength:1:5 ! STATS coordination:1:5 ! LIMB torso:0:1:A_VEST ! LIMB head:torso:1:A_HELMET ! LIMBLESSCOMBATRACE ! LIMBLESSRACE diff -c -r --new-file ds1.1/lib/secure/cfg/races/tortoise ds2.0r27/lib/secure/cfg/races/tortoise *** ds1.1/lib/secure/cfg/races/tortoise Fri Jan 3 22:15:56 1997 --- ds2.0r27/lib/secure/cfg/races/tortoise Wed Jul 5 00:01:12 2006 *************** *** 1,30 **** ! tortoise ! 20:80 ! Tortoiseish ! SHOCK:high ! COLD:medium ! HEAT:medium ! BLADE:low ! BLUNT:low ! KNIFE:low ! WATER:low ! charisma:10:4 ! durability:43:1 ! intelligence:21:3 ! luck:21:3 ! agility:10:4 ! wisdom:43:1 ! charsima:1:5 ! speed:1:5 ! strength:1:5 ! coordination:31:2 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left forepaw:left foreleg:4:: ! right forepaw:right foreleg:4:: ! left rear paw:left rear leg:4:: ! right rear paw:right rear leg:4:: --- 1,31 ---- ! RACE tortoise ! SENSITIVITY 20:80 ! LANGUAGE Tortoiseish ! RESISTANCE SHOCK:high ! RESISTANCE COLD:medium ! RESISTANCE HEAT:medium ! RESISTANCE BLADE:low ! RESISTANCE BLUNT:low ! RESISTANCE KNIFE:low ! RESISTANCE WATER:low ! STATS charisma:10:4 ! STATS durability:43:1 ! STATS intelligence:21:3 ! STATS luck:21:3 ! STATS agility:10:4 ! STATS wisdom:43:1 ! STATS charisma:1:5 ! STATS speed:1:5 ! STATS strength:1:5 ! STATS coordination:31:2 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left forepaw:left foreleg:4:: ! LIMB right forepaw:right foreleg:4:: ! LIMB left rear paw:left rear leg:4:: ! LIMB right rear paw:right rear leg:4:: diff -c -r --new-file ds1.1/lib/secure/cfg/races/tree ds2.0r27/lib/secure/cfg/races/tree *** ds1.1/lib/secure/cfg/races/tree Fri Jan 3 22:15:56 1997 --- ds2.0r27/lib/secure/cfg/races/tree Wed Jul 5 00:01:12 2006 *************** *** 1,22 **** ! tree ! 20:80 ! Treeish ! SHOCK:high ! COLD:medium ! HEAT:medium ! BLADE:low ! BLUNT:low ! KNIFE:low ! WATER:low ! charisma:21:3 ! durability:43:1 ! intelligence:1:5 ! luck:43:1 ! agility:1:5 ! wisdom:10:4 ! charsima:1:5 ! speed:1:5 ! strength:21:3 ! coordination:1:5 ! trunk:0:1:: ! 1st branch:trunk:3:: --- 1,23 ---- ! RACE tree ! SENSITIVITY 20:80 ! LANGUAGE Treeish ! RESISTANCE SHOCK:high ! RESISTANCE COLD:medium ! RESISTANCE HEAT:medium ! RESISTANCE BLADE:low ! RESISTANCE BLUNT:low ! RESISTANCE KNIFE:low ! RESISTANCE WATER:low ! STATS charisma:21:3 ! STATS durability:43:1 ! STATS intelligence:1:5 ! STATS luck:43:1 ! STATS agility:1:5 ! STATS wisdom:10:4 ! STATS charisma:1:5 ! STATS speed:1:5 ! STATS strength:21:3 ! STATS coordination:1:5 ! LIMB trunk:0:1:: ! LIMB 1st branch:trunk:3:: ! LIMBLESSCOMBATRACE diff -c -r --new-file ds1.1/lib/secure/cfg/races/troll ds2.0r27/lib/secure/cfg/races/troll *** ds1.1/lib/secure/cfg/races/troll Fri Jan 3 22:15:56 1997 --- ds2.0r27/lib/secure/cfg/races/troll Wed Jul 5 00:01:12 2006 *************** *** 1,42 **** ! # Nightmare race configuration file ! # To add a race, make one of these files where the race name equals ! # the file name, and type <addrace race> or <addrace race 1>. The ! # 1 means the race is a player race. This file has the following ! # format: ! # line 1: race name ! # line 2: min sight value:max sight value ! # line 3: language (case sensitive) ! # line 4..n: damage type:resistance level ! # line n+1..o: stat:average value:stat class ! # line o+1..p: limb:parent limb:limb class:comma separated armour types ! # line p+1..q: hand:number of fingers ! # damage types come from /include/damage_types.h ! # armour types come from /include/armour_types.h ! # Note that you may in fact have no resistances, thus line 4 would be ! # the first stat. ! troll ! 15:65 ! Trollish ! BLUNT:low ! agility:10:2 ! charisma:11:3 ! coordination:10:2 ! durability:65:1 ! intelligence:11:3 ! luck:15:4 ! speed:20:3 ! strength:50:1 ! wisdom:5:5 ! torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOUR,A_BODY_ARMOUR,A_BELT ! head:torso:1:A_HELMET,A_VISOR,A_AMULET ! right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOUR ! right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOUR,A_BODY_ARMOUR ! left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! left hand:4 ! right hand:4 ! --- 1,27 ---- ! RACE troll ! SENSITIVITY 15:65 ! LANGUAGE Trollish ! SKILL poison bite:1:3:2:4 ! RESISTANCE BLUNT:low ! STATS agility:10:2 ! STATS charisma:11:3 ! STATS coordination:10:2 ! STATS durability:65:1 ! STATS intelligence:11:3 ! STATS luck:15:4 ! STATS speed:20:3 ! STATS strength:50:1 ! STATS wisdom:5:5 ! LIMB torso:0:1:A_SHIRT,A_CLOAK,A_VEST,A_SHIELD,A_ARMOR,A_BODY_ARMOR,A_BELT,A_AMULET ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB right leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB left leg:torso:2:A_LONG_BOOT,A_LONG_SOCK,A_PANTS,A_BODY_ARMOR ! LIMB right foot:right leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left foot:left leg:4:A_BOOT,A_LONG_BOOT,A_SOCK,A_LONG_SOCK ! LIMB left arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB right arm:torso:2:A_LONG_GLOVE,A_SHIELD,A_CLOAK,A_ARMOR,A_BODY_ARMOR ! LIMB left hand:left arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB right hand:right arm:4:A_RING,A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! HAND left hand:4 ! HAND right hand:4 diff -c -r --new-file ds1.1/lib/secure/cfg/races/unicorn ds2.0r27/lib/secure/cfg/races/unicorn *** ds1.1/lib/secure/cfg/races/unicorn Fri Jan 3 22:15:56 1997 --- ds2.0r27/lib/secure/cfg/races/unicorn Wed Jul 5 00:01:12 2006 *************** *** 1,22 **** ! unicorn ! 20:80 ! Unicornish ! SHOCK:high ! COLD:medium ! HEAT:medium ! BLADE:low ! BLUNT:low ! KNIFE:low ! WATER:low ! charisma:1:5 ! durability:21:3 ! intelligence:10:4 ! luck:43:1 ! agility:31:2 ! wisdom:31:2 ! charsima:1:5 ! speed:21:3 ! strength:21:3 ! coordination:31:2 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK --- 1,31 ---- ! RACE unicorn ! SENSITIVITY 20:80 ! LANGUAGE Unicornish ! RESISTANCE SHOCK:high ! RESISTANCE COLD:medium ! RESISTANCE HEAT:medium ! RESISTANCE BLADE:low ! RESISTANCE BLUNT:low ! RESISTANCE KNIFE:low ! RESISTANCE WATER:low ! STATS charisma:1:5 ! STATS durability:21:3 ! STATS intelligence:10:4 ! STATS luck:43:1 ! STATS agility:31:2 ! STATS wisdom:31:2 ! STATS charisma:1:5 ! STATS speed:21:3 ! STATS strength:21:3 ! STATS coordination:31:2 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB right rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left rear leg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right foreleg:torso:3:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left fore-hoof:left foreleg:4:: ! LIMB left rear hoof:left rear leg:4:: ! LIMB right fore-hoof:right foreleg:4:: ! LIMB right rear hoof:right rear leg:4:: diff -c -r --new-file ds1.1/lib/secure/cfg/races/viper ds2.0r27/lib/secure/cfg/races/viper *** ds1.1/lib/secure/cfg/races/viper Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cfg/races/viper Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,23 ---- + RACE viper + SENSITIVITY 20:80 + LANGUAGE Aspish + RESISTANCE SHOCK:high + RESISTANCE COLD:medium + RESISTANCE HEAT:medium + RESISTANCE BLADE:low + RESISTANCE BLUNT:low + RESISTANCE KNIFE:low + RESISTANCE WATER:low + STATS charisma:1:5 + STATS durability:10:4 + STATS intelligence:10:4 + STATS luck:43:1 + STATS agility:10:4 + STATS wisdom:31:2 + STATS charisma:1:5 + STATS speed:10:4 + STATS strength:1:5 + STATS coordination:1:5 + poison bite:1:3:2:4 + LIMB torso:0:1:A_VEST + LIMB head:torso:1:A_HELMET diff -c -r --new-file ds1.1/lib/secure/cfg/races/wraith ds2.0r27/lib/secure/cfg/races/wraith *** ds1.1/lib/secure/cfg/races/wraith Fri Jan 3 22:15:56 1997 --- ds2.0r27/lib/secure/cfg/races/wraith Wed Jul 5 00:01:12 2006 *************** *** 1,30 **** ! wraith ! 20:80 ! Wraithish ! SHOCK:high ! COLD:medium ! HEAT:medium ! BLADE:low ! BLUNT:low ! KNIFE:low ! WATER:low ! charisma:1:5 ! durability:21:3 ! intelligence:10:4 ! luck:43:1 ! agility:31:2 ! wisdom:31:2 ! charsima:1:5 ! speed:21:3 ! strength:21:3 ! coordination:31:2 ! torso:0:1:A_ARMOUR,A_BODY_ARMOUR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! head:torso:1:A_BODY_ARMOUR,A_VISOR,A_HELMET,A_CLOAK ! left leg:torso:2:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! left arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOUR,A_BODY_ARMOUR,A_SHIELD ! right arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOUR,A_BODY_ARMOUR,A_SHIELD ! right leg:torso:2:A_LONG_BOOT,A_BODY_ARMOUR,A_PANTS,A_LONG_SOCK ! right foot:right leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! right hand:right arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! left foot:left leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! left hand:left arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD --- 1,32 ---- ! RACE wraith ! SENSITIVITY 20:80 ! LANGUAGE Wraithish ! RESISTANCE SHOCK:high ! RESISTANCE COLD:medium ! RESISTANCE HEAT:medium ! RESISTANCE BLADE:low ! RESISTANCE BLUNT:low ! RESISTANCE KNIFE:low ! RESISTANCE WATER:low ! STATS charisma:1:5 ! STATS durability:21:3 ! STATS intelligence:10:4 ! STATS luck:43:1 ! STATS agility:31:2 ! STATS wisdom:31:2 ! STATS charisma:1:5 ! STATS speed:21:3 ! STATS strength:21:3 ! STATS coordination:31:2 ! LIMB torso:0:1:A_ARMOR,A_BODY_ARMOR,A_CLOAK,A_VEST,A_SHIRT,A_AMULET,A_BELT ! LIMB neck:torso:1:A_COLLAR,A_AMULET ! LIMB head:neck:1:A_HELMET,A_VISOR,A_AMULET ! LIMB left leg:torso:2:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB left arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOR,A_BODY_ARMOR,A_SHIELD ! LIMB right arm:torso:2:A_LONG_GLOVE,A_SHIRT,A_ARMOR,A_BODY_ARMOR,A_SHIELD ! LIMB right leg:torso:2:A_LONG_BOOT,A_BODY_ARMOR,A_PANTS,A_LONG_SOCK ! LIMB right foot:right leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! LIMB right hand:right arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! LIMB left foot:left leg:4:A_SOCK,A_LONG_SOCK,A_BOOT,A_LONG_BOOT ! LIMB left hand:left arm:4:A_GLOVE,A_LONG_GLOVE,A_WEAPON,A_SHIELD ! FLYINGRACE diff -c -r --new-file ds1.1/lib/secure/cfg/read.cfg ds2.0r27/lib/secure/cfg/read.cfg *** ds1.1/lib/secure/cfg/read.cfg Fri Jan 3 23:11:26 1997 --- ds2.0r27/lib/secure/cfg/read.cfg Wed Jul 5 00:01:05 2006 *************** *** 1,3 **** --- 1,13 ---- (/realms/) ASSIST:CMDS (/secure/etc/) ASSIST (/secure/save/) ASSIST + (/secure/save/snoop.o) SECURE + (/secure/log/) ASSIST + (/secure/room/) ASSIST + (/secure/npc/) ASSIST + (/secure/obj/) ASSIST:CMDS + (/doc/) all + (/open/) all + (/tmp/) all + (/doc/hbook) all + diff -c -r --new-file ds1.1/lib/secure/cfg/write.cfg ds2.0r27/lib/secure/cfg/write.cfg *** ds1.1/lib/secure/cfg/write.cfg Fri Jan 3 23:11:26 1997 --- ds2.0r27/lib/secure/cfg/write.cfg Wed Jul 5 00:01:05 2006 *************** *** 14,19 **** --- 14,21 ---- (/realms/) ASSIST:CMDS (/save/) MUDLIBPRIV:ASSIST (/secure/save/) ASSIST + (/secure/save/snoop.o) SECURE (/tmp/) all + (/open/) all (/verbs/) ASSIST (/www/) ASSIST diff -c -r --new-file ds1.1/lib/secure/cmds/admins/addadverb.c ds2.0r27/lib/secure/cmds/admins/addadverb.c *** ds1.1/lib/secure/cmds/admins/addadverb.c Sun Feb 1 21:30:29 1998 --- ds2.0r27/lib/secure/cmds/admins/addadverb.c Wed Jul 5 00:01:12 2006 *************** *** 13,19 **** mixed cmd(string args) { string array adverbs; ! if( !args || args == "" ) { return "Add which adverb?"; } --- 13,19 ---- mixed cmd(string args) { string array adverbs; ! if( !args || args == "" ) { return "Add which adverb?"; } *************** *** 28,35 **** string GetHelp(string args) { return ("Syntax: <addadverb ADVERB1,..,ADVERBn>\n\n" ! "Allows you to add 1 or more adverbs separated by commas to " ! "the system adverbs that can be used as adverbs in most soul " ! "commands.\n\n" ! "See also: addemote,removeadverb,removeemote"); } --- 28,35 ---- string GetHelp(string args) { return ("Syntax: <addadverb ADVERB1,..,ADVERBn>\n\n" ! "Allows you to add 1 or more adverbs separated by commas to " ! "the system adverbs that can be used as adverbs in most soul " ! "commands.\n\n" ! "See also: addemote,removeadverb,removeemote"); } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/addclass.c ds2.0r27/lib/secure/cmds/admins/addclass.c *** ds1.1/lib/secure/cmds/admins/addclass.c Sun Feb 1 21:30:28 1998 --- ds2.0r27/lib/secure/cmds/admins/addclass.c Wed Jul 5 00:01:12 2006 *************** *** 24,45 **** string GetHelp(string str) { return ("Syntax: <addclass CLASS>\n\n" ! "Allows you to add a new class to the class data stored in the " ! "classes daemon. Specifically, you create a configuration file " ! "and then issue this command to load the new class into the " ! "classes daemon. The file should be in " + DIR_SECURE_CFG + ! "/classes. The format of the file being read is:\n" ! "class_name\n" ! "main_class1:multi_class_name1\n" ! "...\n" ! "main_classN:multi_class_nameN\n" ! "skill1:skill_average1:skill_class1\n" ! "...\n" ! "skillN:skill_averageN:skill_classN\n" ! "An example of a fighter exists in /secure/cfg/classes/fighter. " ! "This system is admittedly rather complex, but it beats hard " ! "coding these values. In addition, a web-based administration " ! "client is being developed to make class creation nothing more " ! "than filling in a form.\n\n" ! "See also: addemote, addrace"); } --- 24,45 ---- string GetHelp(string str) { return ("Syntax: <addclass CLASS>\n\n" ! "Allows you to add a new class to the class data stored in the " ! "classes daemon. Specifically, you create a configuration file " ! "and then issue this command to load the new class into the " ! "classes daemon. The file should be in " + DIR_SECURE_CFG + ! "/classes. The format of the file being read is:\n" ! "class_name\n" ! "main_class1:multi_class_name1\n" ! "...\n" ! "main_classN:multi_class_nameN\n" ! "skill1:skill_average1:skill_class1\n" ! "...\n" ! "skillN:skill_averageN:skill_classN\n" ! "An example of a fighter exists in /secure/cfg/classes/fighter. " ! "This system is admittedly rather complex, but it beats hard " ! "coding these values. In addition, a web-based administration " ! "client is being developed to make class creation nothing more " ! "than filling in a form.\n\n" ! "See also: addemote, addrace"); } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/addemote.c ds2.0r27/lib/secure/cmds/admins/addemote.c *** ds1.1/lib/secure/cmds/admins/addemote.c Sun Feb 1 21:30:29 1998 --- ds2.0r27/lib/secure/cmds/admins/addemote.c Wed Jul 5 00:01:12 2006 *************** *** 70,78 **** } static void AddAdverbs(string adv, string emote, string array rules, ! string array verbs, string msg) { string array adverbs; ! if( !adv || adv == "" ) { adverbs = ({}); } --- 70,78 ---- } static void AddAdverbs(string adv, string emote, string array rules, ! string array verbs, string msg) { string array adverbs; ! if( !adv || adv == "" ) { adverbs = ({}); } *************** *** 84,92 **** } this_player()->eventPrint("Emote '" + emote + "' added."); } ! static void AddMessage(string msg, string emote, string array rules, ! string array verbs) { if( !msg || msg == "" ) { this_player()->eventPrint("Which message? [q to quit] ", MSG_PROMPT); input_to((: AddMessage :), emote, rules, verbs); --- 84,92 ---- } this_player()->eventPrint("Emote '" + emote + "' added."); } ! static void AddMessage(string msg, string emote, string array rules, ! string array verbs) { if( !msg || msg == "" ) { this_player()->eventPrint("Which message? [q to quit] ", MSG_PROMPT); input_to((: AddMessage :), emote, rules, verbs); *************** *** 116,122 **** this_player()->eventPrint("Enter the verbs: ", MSG_PROMPT); input_to((: AddVerbs :), emote, rules); } ! static void AddErrorMessage(string msg, string emote) { if( !msg || msg == "" ) { this_player()->eventPrint("Which message? [q to quit] ", MSG_PROMPT); --- 116,122 ---- this_player()->eventPrint("Enter the verbs: ", MSG_PROMPT); input_to((: AddVerbs :), emote, rules); } ! static void AddErrorMessage(string msg, string emote) { if( !msg || msg == "" ) { this_player()->eventPrint("Which message? [q to quit] ", MSG_PROMPT); *************** *** 135,141 **** } SOUL_D->AddVerb(emote, msg); this_player()->eventPrint("Enter a parser rule for " + emote + ": ", ! MSG_PROMPT); input_to((: AddRule :), emote); } --- 135,141 ---- } SOUL_D->AddVerb(emote, msg); this_player()->eventPrint("Enter a parser rule for " + emote + ": ", ! MSG_PROMPT); input_to((: AddRule :), emote); } *************** *** 174,184 **** static void EditErrorMessage(string emote) { this_player()->eventPrint("Enter new error message: ", MSG_PROMPT); input_to(function(string str, string emote) { ! if( str && str != "" ) { ! SOUL_D->SetErrorMessage(emote, str); ! } ! ShowEmote(emote); ! }, emote); } static void ShowEmote(string emote) { --- 174,184 ---- static void EditErrorMessage(string emote) { this_player()->eventPrint("Enter new error message: ", MSG_PROMPT); input_to(function(string str, string emote) { ! if( str && str != "" ) { ! SOUL_D->SetErrorMessage(emote, str); ! } ! ShowEmote(emote); ! }, emote); } static void ShowEmote(string emote) { *************** *** 188,194 **** string tmp = center("Dead Souls V Emote Editor", screen[0]) + "\n\n"; string array rule_array = allocate(sizeof(rules)); int i = 0; ! tmp += "%^GREEN%^Emote%^RESET%^: " + emote + "\n"; tmp += "%^GREEN%^Error Message%^RESET%^: " + err + "\n"; tmp += "%^GREEN%^Rules%^RESET%^:\n"; --- 188,194 ---- string tmp = center("Dead Souls V Emote Editor", screen[0]) + "\n\n"; string array rule_array = allocate(sizeof(rules)); int i = 0; ! tmp += "%^GREEN%^Emote%^RESET%^: " + emote + "\n"; tmp += "%^GREEN%^Error Message%^RESET%^: " + err + "\n"; tmp += "%^GREEN%^Rules%^RESET%^:\n"; *************** *** 199,212 **** i++; } this_player()->eventPage(explode(tmp, "\n"), MSG_SYSTEM, ! function(mixed args) { ! string tmp = "Enter rule to edit, 'a' to " ! "add rule, 'e' to edit error " ! "msg, or 'q' to quit: "; ! ! this_player()->eventPrint(tmp, MSG_PROMPT); ! input_to((: EnterEditChoice :), args...); ! }, ({ rule_array, emote })); } mixed cmd(string args) { --- 199,212 ---- i++; } this_player()->eventPage(explode(tmp, "\n"), MSG_SYSTEM, ! function(mixed args) { ! string tmp = "Enter rule to edit, 'a' to " ! "add rule, 'e' to edit error " ! "msg, or 'q' to quit: "; ! ! this_player()->eventPrint(tmp, MSG_PROMPT); ! input_to((: EnterEditChoice :), args...); ! }, ({ rule_array, emote })); } mixed cmd(string args) { *************** *** 239,310 **** string GetHelp(string str) { return ("Syntax: <addemote>\n" ! " <addemote EMOTE>\n" ! " <addemote -edit>\n" ! " <addemote -add>\n\n" ! "Used to add and edit emotes in the soul daemon using complex " ! "rules and the Dead Souls V messaging system. In order to add " ! "a new emote using this command, you need to know the following " ! "information:\n" ! "\t* Verb parse rule\n" ! "\t* Verbs to be conjugated in the message\n" ! "\t* The messaging system generic format for the message\n" ! "\t* Any adverbs supported specially for the message\n\n" ! "The verb parse rule is a set of tokens governing how the " ! "command should be entered. The only tokens supported by the " ! "soul are LIV (for one living thing), LVS (for one to many living " ! "things), and STR (for any arbitrary string). In addition, the " ! "rule can contains prepositions like to, at, on, about, etc. " ! "For example, to allow a player to do <smile at descartes>, you " ! "need the parse rule <at LIV> or <at LVS>. <smile oddly at " ! "descartes> would be <STR at LIV> or <STR at LVS>.\n" ! "In general, you should allow players to enter in commands using " ! "correct English and a syntax without prepositions. For " ! "example, since we have <at LVS>, we should also allow " ! "<LVS>. To support identical rules like this, when the " ! "<addemote> command asks for a parser rule, you can enter in " ! "multiple identical rules on the same line, separated by " ! "commas:\n" ! "Enter parser rule: at LVS,LVS\n\n" ! "The next step is defining which verbs need conjugating in your " ! "message for the emote. With the smile emote, the only verb is " ! "\"smile\". However, for more complex emotes, you may have " ! "multiple verbs which need conjugating. Just enter them as a " ! "comma separated list. For example, if you have an emote that " ! "should print the message \"Descartes rants and raves.\", then " ! "you will need to enter the verbs rant and rave:\n" ! "Enter verbs: rant,rave\n\n" ! "The next step is specifying the message that gets shown. Your " ! "message uses place holders, also called tokens, to stand in " ! "for bits of the message that change depending on point of " ! "view. In the rant and rave example, Descartes would see:\n" ! "You rant and rave.\n" ! "Everyone else sees:\n" ! "Descartes rants and raves.\n" ! "The only thing that stays the same is the word \"and\". You " ! "need tokens to stand for the rest. A full list of tokens is " ! "specified in <help messaging> and they all begin with a $ sign. " ! "One extremely important thing to remember is that you need " ! "the exact same number of $agent_verb or $target_verb tokens in " ! "your message as the number of verbs you specified for " ! "conjugation. In the rant and rave example, I need two verb " ! "tokens to match up with my two verbs I am conjugating. They " ! "will be handled in the order they appear. In other words, the " ! "rant verb will match to the first verb token, and the rave " ! "verb will match to the second verb token. Verb tokens count " ! "as any combination of $agent_verb and $target_verb:\n" ! "Enter message: $agent_name $agent_verb and $agent_verb.\n\n" ! "The last thing you need to enter is a list of adverbs. " ! "As with other lists, this list is comma separated. And as with " ! "other bits of this system, it has a little complexity to it. " ! "If you do not enter anything, then no adverbs are used for this " ! "rule. In fact, you must specify a STR token in the rule for " ! "adverbs to be relevant. If you do specify an STR rule, you " ! "should specify something on the adverb line. Any adverbs you " ! "enter are considered special adverbs just for this rule. If " ! "you wish the general list of adverbs to be available as well, " ! "you can enter a - as one of the adverbs. If you wish the " ! "player to be able to add anything that comes to mind, enter " ! "a *:\n" ! "Enter adverbs: -"); } --- 239,310 ---- string GetHelp(string str) { return ("Syntax: <addemote>\n" ! " <addemote EMOTE>\n" ! " <addemote -edit>\n" ! " <addemote -add>\n\n" ! "Used to add and edit emotes in the soul daemon using complex " ! "rules and the Dead Souls V messaging system. In order to add " ! "a new emote using this command, you need to know the following " ! "information:\n" ! "\t* Verb parse rule\n" ! "\t* Verbs to be conjugated in the message\n" ! "\t* The messaging system generic format for the message\n" ! "\t* Any adverbs supported specially for the message\n\n" ! "The verb parse rule is a set of tokens governing how the " ! "command should be entered. The only tokens supported by the " ! "soul are LIV (for one living thing), LVS (for one to many living " ! "things), and STR (for any arbitrary string). In addition, the " ! "rule can contains prepositions like to, at, on, about, etc. " ! "For example, to allow a player to do <smile at descartes>, you " ! "need the parse rule <at LIV> or <at LVS>. <smile oddly at " ! "descartes> would be <STR at LIV> or <STR at LVS>.\n" ! "In general, you should allow players to enter in commands using " ! "correct English and a syntax without prepositions. For " ! "example, since we have <at LVS>, we should also allow " ! "<LVS>. To support identical rules like this, when the " ! "<addemote> command asks for a parser rule, you can enter in " ! "multiple identical rules on the same line, separated by " ! "commas:\n" ! "Enter parser rule: at LVS,LVS\n\n" ! "The next step is defining which verbs need conjugating in your " ! "message for the emote. With the smile emote, the only verb is " ! "\"smile\". However, for more complex emotes, you may have " ! "multiple verbs which need conjugating. Just enter them as a " ! "comma separated list. For example, if you have an emote that " ! "should print the message \"Descartes rants and raves.\", then " ! "you will need to enter the verbs rant and rave:\n" ! "Enter verbs: rant,rave\n\n" ! "The next step is specifying the message that gets shown. Your " ! "message uses place holders, also called tokens, to stand in " ! "for bits of the message that change depending on point of " ! "view. In the rant and rave example, Descartes would see:\n" ! "You rant and rave.\n" ! "Everyone else sees:\n" ! "Descartes rants and raves.\n" ! "The only thing that stays the same is the word \"and\". You " ! "need tokens to stand for the rest. A full list of tokens is " ! "specified in <help messaging> and they all begin with a $ sign. " ! "One extremely important thing to remember is that you need " ! "the exact same number of $agent_verb or $target_verb tokens in " ! "your message as the number of verbs you specified for " ! "conjugation. In the rant and rave example, I need two verb " ! "tokens to match up with my two verbs I am conjugating. They " ! "will be handled in the order they appear. In other words, the " ! "rant verb will match to the first verb token, and the rave " ! "verb will match to the second verb token. Verb tokens count " ! "as any combination of $agent_verb and $target_verb:\n" ! "Enter message: $agent_name $agent_verb and $agent_verb.\n\n" ! "The last thing you need to enter is a list of adverbs. " ! "As with other lists, this list is comma separated. And as with " ! "other bits of this system, it has a little complexity to it. " ! "If you do not enter anything, then no adverbs are used for this " ! "rule. In fact, you must specify a STR token in the rule for " ! "adverbs to be relevant. If you do specify an STR rule, you " ! "should specify something on the adverb line. Any adverbs you " ! "enter are considered special adverbs just for this rule. If " ! "you wish the general list of adverbs to be available as well, " ! "you can enter a - as one of the adverbs. If you wish the " ! "player to be able to add anything that comes to mind, enter " ! "a *:\n" ! "Enter adverbs: -"); } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/addguest.c ds2.0r27/lib/secure/cmds/admins/addguest.c *** ds1.1/lib/secure/cmds/admins/addguest.c Sun Feb 1 21:30:28 1998 --- ds2.0r27/lib/secure/cmds/admins/addguest.c Wed Jul 5 00:01:12 2006 *************** *** 13,29 **** mixed res; int i; ! if(!archp(previous_object())) return 0; if(!str) { ! notify_fail("Correct syntax: addguest [guestlist]\n"); ! return 0; } i = sizeof(guests = explode(str, " ")); while(i--) { ! if(!guests[i] || guests[i] == "") continue; ! if(res = catch(call_other(BANISH_D, "add_guest", guests[i]))) ! message("admin", sprintf("Error in adding guest %s: %s", ! guests[i], res), this_player()); } message("admin", "Guests added.", this_player()); return 1; --- 13,33 ---- mixed res; int i; ! if(!(int)master()->valid_apply(({ "SECURE", "ASSIST" }))){ ! error("Illegal attempt to add a guest."); ! //tc("foo"); ! } ! if(!str) { ! notify_fail("Correct syntax: addguest [guestlist]\n"); ! return 0; } i = sizeof(guests = explode(str, " ")); while(i--) { ! if(!guests[i] || guests[i] == "") continue; ! if(res = catch(call_other(BANISH_D, "add_guest", guests[i]))) ! message("admin", sprintf("Error in adding guest %s: %s", ! guests[i], res), this_player()); } message("admin", "Guests added.", this_player()); return 1; *************** *** 36,41 **** "allowed onto the mud when it is locked. This is generally used to " "allow people in who are not in any of the groups defined in " "LOCKED_ACCESS_ALLOWED or to allow on player testers.\n\n" ! "See also: removeguests, whoguests", this_player() ); } --- 40,45 ---- "allowed onto the mud when it is locked. This is generally used to " "allow people in who are not in any of the groups defined in " "LOCKED_ACCESS_ALLOWED or to allow on player testers.\n\n" ! "See also: removeguests, whoguests", this_player() ); } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/addrace.c ds2.0r27/lib/secure/cmds/admins/addrace.c *** ds1.1/lib/secure/cmds/admins/addrace.c Sun Feb 1 21:30:28 1998 --- ds2.0r27/lib/secure/cmds/admins/addrace.c Wed Jul 5 00:01:12 2006 *************** *** 28,68 **** string GetHelp(string str) { return ("Syntax: <addrace RACE>\n" ! " <addrace RACE 0|1>\n\n" ! "Allows you to add a new race to the racial data stored in the " ! "races daemon. Specifically, you create a configuration file " ! "and then issue this command to load the new race into the " ! "races daemon. The optional second argument specifies if this " ! "race is a player or not. If it is omitted or it is 0, the race " ! "is assumed to be NPC-only. If it is 1, then it is assumed to " ! "be useable by players as well.\n" ! "The format of the file being read is:\n" ! "race_name\n" ! "min_light_sensitivity:max_light_sensitivity\n" ! "language\n" ! "resistance1:resistance_level1\n" ! "...\n" ! "resistanceN:resistance_levelN\n" ! "stat1:stat_average1:stat_class1\n" ! "...\n" ! "statN:stat_averageN:stat_classN\n" ! "limb1:limb_parent1:limb_class1:limb_armours_list1\n" ! "...\n" ! "limbN:limb_parentN:limb_classN:limb_armours_listN\n" ! "fingered_limb1:num_fingers1\n" ! "...\n" ! "fingered_limbN:num_fingersN\n\n" ! "An example of a human exists in /secure/cfg/races/human. " ! "You will notice that a human hs no special resistances. The " ! "number of times resistances, stats, limbs, and fingers appear " ! "does not matter so long as they appear in the file in the order " ! "resistances, stats, limbs, fingers. In addition, parent " ! "limbs need to be listed sometime *before* any child limbs. " ! "For example, the right hand may come any time after the right " ! "arm, but it must come after the right arm.\n" ! "This system is admittedly rather complex, but it beats hard " ! "coding these values. In addition, a web-based administration " ! "client is being developed to make race creation nothing more " ! "than filling in a form.\n\n" ! "See also: addclass, addemote"); } --- 28,53 ---- string GetHelp(string str) { return ("Syntax: <addrace RACE>\n" ! " <addrace RACE 0|1>\n\n" ! "Allows you to add a new race to the racial data stored in the " ! "races daemon. Specifically, you create a configuration file " ! "and then issue this command to load the new race into the " ! "races daemon. The optional second argument specifies if this " ! "race is a player or not. If it is omitted or it is 0, the race " ! "is assumed to be NPC-only. If it is 1, then it is assumed to " ! "be usable by players as well.\n" ! "NOTE: The PLAYER_RACE setting in the race file overrides that flag.\n" ! "The format of the file is explained here:\n" ! "http://dead-souls.net/ds-creator-faq.html#2.45\n\n" ! "An example of a human exists in /secure/cfg/races/human. " ! "You will notice that a human hs no special resistances. The " ! "number of times resistances, stats, limbs, and fingers appear " ! "does not matter so long as they appear in the file in the order " ! "resistances, stats, limbs, fingers. In addition, parent " ! "limbs need to be listed sometime *before* any child limbs. " ! "For example, the right hand may come any time after the right " ! "arm, but it must come after the right arm.\n" ! "This system is admittedly rather complex, but it beats hard " ! "coding these values.\n\n" ! "See also: addclass, addemote"); } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/addraces.c ds2.0r27/lib/secure/cmds/admins/addraces.c *** ds1.1/lib/secure/cmds/admins/addraces.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cmds/admins/addraces.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,30 ---- + #include <lib.h> + #include <cfg.h> + #include <daemons.h> + + inherit LIB_DAEMON; + + mixed cmd(string args) { + string *races = get_dir(CFG_RACES+"/"); + foreach(string race in races){ + string str = CFG_RACES+"/"+race; + if(file_exists(str)) { + if(race == "human") RACES_D->AddRace(str, 1); + else RACES_D->AddRace(str, 0); + } + } + write("Done."); + return 1; + } + + string GetHelp(string str) { + return ("Syntax: <addraces>\n" + "Imports all the race files in CFG_RACES into " + "RACES_D. By default, this command sets humans " + "as the only player-usable race. If there are other " + "races (such as your own, if you're not human) that " + "need to be player-usable, you'll need to use the " + "removerace command to remove them " + "and use the addrace command with the proper " + "options to add them with player-usability."); + } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/admintool.c ds2.0r27/lib/secure/cmds/admins/admintool.c *** ds1.1/lib/secure/cmds/admins/admintool.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cmds/admins/admintool.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,1288 ---- + #include <lib.h> + #include <privs.h> + #include <daemons.h> + #include <config.h> + + inherit LIB_DAEMON; + + static private void validate() { + if(!this_player()) return 0; + if( !((int)master()->valid_apply(({ "ASSIST" }))) ) + error("Illegal attempt to access admintool: "+get_stack()+" "+identify(previous_object(-1))); + } + + varargs int Menu(string str); + int MainMenu(); + int MainMenuChoice(); + int GeneralMenu(); + int DaemonMenu(); + int UsersMenu(); + int DriverMenu(); + int GroupsMenu(); + int ToggleMudLock(); + int ShowLock(); + int SetTZ(); + int eventSetTZ(string str); + int ChangeEmail(); + varargs int eventChangeEmail(string str, int auto); + int SetReboot(); + int eventSetReboot(int i); + int AddClass(); + int eventAddClass(string str); + int RemoveClass(); + int eventRemoveClass(string str); + int AddRace(); + int eventAddRace(string str); + int RemoveRace(); + int PlayerRace(string str); + int eventRemoveRace(string str); + int AddCurrency(); + int eventAddCurrency(string str); + int CurrencyRate(string str); + int CurrencyWeight(string str); + int CurrencyInflation(string str); + int RemoveCurrency(); + int eventRemoveCurrency(string str); + int EncrePlayer(); + int eventEncrePlayer(string str); + int DecreCreator(); + int eventDecreCreator(string str); + mixed EnCre(string args); + mixed DeCre(string args); + int RidUser(); + int eventRidUser(string str); + int LogRid(string str); + int DoRid(string who); + int BanishUser(); + int eventBanishUser(string str); + int UnBanishUser(); + int eventUnBanishUser(string str); + int ChangeName(); + int eventChangeName(string str); + int ChangePort(); + int eventChangePort(int i); + int ShutDownMud(); + int eventShutDownMud(string str); + int RemoveGroup(); + int eventRemoveGroup(string str); + int AddGroup(); + int eventAddGroup(string str); + int ModGroup(); + int eventModGroup(string str); + int eventEditGroup(string str); + int ShowGroups(); + + string process_input(string str); + + string global_group_temp, menu, racepath, currency, ridded, globalstr, file; + string *currencies; + + float rate, weight, inflation; + + + mixed InvalidChoice(){ + validate(); + write("Invalid choice. Try again or choose q to quit.\n"); + Menu(); + return 1; + } + + int PlaceHolder(){ + validate(); + write("This function has not yet been defined."); + Menu(); + return 1; + } + + varargs int Menu(string str){ + + validate(); + if(str) menu = str; + if(!menu) menu = "main"; + + switch (menu){ + case "main" : MainMenu(); break; + case "general" : GeneralMenu(); break; + case "daemon" : DaemonMenu();break; + case "users" : UsersMenu();break; + case "driver" : DriverMenu();break; + case "groups" : GroupsMenu();break; + default : menu = "main"; MainMenu(); break; + } + return 1; + } + + string process_input(string str){ + //write("Input is "+str+"."); + validate(); + switch (str) { + case "q" : write("Ok, quitting admintool.\nBye.\n");return " "; + case "x" : write("Ok, quitting admintool.\nBye.\n");return " "; + case "y" : write("Ok, quitting admintool.\nBye.\n");return " "; + case "z" : Menu("main"); break; + case "1" : Menu("general"); break; + case "2" : Menu("daemon");break; + case "3" : Menu("users");break; + case "4" : Menu("driver");break; + case "5" : Menu("groups");break; + case "a" : ToggleMudLock();break; + case "b" : ShowLock();break; + case "c" : SetTZ();break; + case "d" : ChangeEmail();break; + case "e" : SetReboot();break; + case "f" : AddClass();break; + case "g" : RemoveClass();break; + case "h" : AddRace();break; + case "i" : RemoveRace();break; + case "j" : AddCurrency();break; + case "k" : RemoveCurrency();break; + case "l" : EncrePlayer();break; + case "m" : DecreCreator();break; + case "n" : RidUser();break; + case "o" : BanishUser();break; + case "p" : UnBanishUser();break; + case "r" : ChangeName();break; + case "s" : ChangePort();break; + case "t" : AddGroup();break; + case "u" : RemoveGroup();break; + case "v" : ModGroup();break; + case "w" : ShowGroups();break; + case "SD": ShutDownMud();break; + default : InvalidChoice(); + } + return "(process_input fun finished.)"; + } + + + varargs mixed MainMenu(string str) { + string tmp; + validate(); + tmp = "\tDead Souls Admin Tool\n"; + tmp += "\t=====================\n\n"; + tmp += "\t\t1) general\n"; + tmp += "\t\t2) daemon\n"; + tmp += "\t\t3) users\n"; + tmp += "\t\t4) driver\n"; + tmp += "\t\t5) groups\n\n"; + tmp += "\t\tq) quit\n"; + + this_player()->eventPrint(tmp, "foo"); + + input_to((: process_input :)); + return 1; + } + + static int GeneralMenu() { + string tmp; + + validate(); + tmp = "\tDead Souls Admin Tool General Menu\n"; + tmp += "\t\n\n"; + tmp += "\t\ta) toggle mud lock\n"; + tmp += "\t\tb) display current lock status\n"; + tmp += "\t\tc) change timezone\n"; + tmp += "\t\td) change admin email\n"; + tmp += "\t\te) change shutdown interval\n"; + tmp += "\t\tSD) shut down the MUD\n\n"; + tmp += "\t\tz) return to main menu\n"; + tmp += "\t\tq) quit\n"; + + this_player()->eventPrint(tmp, "foo"); + input_to((: process_input :)); + return 1; + } + + int DaemonMenu() { + string tmp; + + validate(); + tmp = "\tDead Souls Admin Tool Daemon Menu\n"; + tmp += "\t\n\n"; + tmp += "\t\tf) add class\n"; + tmp += "\t\tg) remove class\n"; + tmp += "\t\th) add race\n"; + tmp += "\t\ti) remove race\n"; + tmp += "\t\tj) add currency\n"; + tmp += "\t\tk) remove currency\n\n"; + tmp += "\t\tz) return to main menu\n"; + tmp += "\t\tq) quit\n"; + + this_player()->eventPrint(tmp, "foo"); + input_to((: process_input :)); + return 1; + } + + int UsersMenu() { + string tmp; + + validate(); + tmp = "\tDead Souls Admin Tool Users Menu\n"; + tmp += "\t\n\n"; + tmp += "\t\tl) promote a player to creator\n"; + tmp += "\t\tm) demote a creator to player\n"; + tmp += "\t\tn) completely erase a user\n"; + tmp += "\t\to) banish a username\n"; + tmp += "\t\tp) unbanish a username\n\n"; + tmp += "\t\tz) return to main menu\n"; + tmp += "\t\tq) quit\n"; + + this_player()->eventPrint(tmp, "foo"); + input_to((: process_input :)); + + return 1; + } + + int DriverMenu(){ + string tmp; + + validate(); + tmp = "\tDead Souls Admin Tool Driver Menu\n"; + tmp += "\t^^^^^^^^^^^^^^^^^^^^^^*******^^^^^\n"; + tmp += "\t\n\n"; + tmp += "\t\tr) change the MUD's name\n"; + tmp += "\t\ts) change the MUD's connection port\n\n"; + tmp += "\t\tz) return to main menu\n"; + tmp += "\t\tq) quit\n"; + + this_player()->eventPrint(tmp, "foo"); + input_to((: process_input :)); + + return 1; + } + + int GroupsMenu(){ + string tmp; + + validate(); + tmp = "\tDead Souls Admin Tool Groups Menu\n"; + tmp += "\t^^^^^^^^^^^^^^^^^^^^^^*******^^^^^\n"; + tmp += "\t\n\n"; + tmp += "\t\tt) Add a group\n"; + tmp += "\t\tu) Remove a group\n"; + tmp += "\t\tv) Modify a group\n"; + tmp += "\t\tw) Show groups\n\n"; + tmp += "\t\tz) return to main menu\n"; + tmp += "\t\tq) quit\n"; + + this_player()->eventPrint(tmp, "foo"); + input_to((: process_input :)); + + return 1; + } + + string GetHelp(string str) { + return ("Syntax: <admintool>\n\n" + "Menu-driven tool used to edit the MUD's configuration.\n" + "To change mud name or port number, choose the Driver menu.\n" + "Use the Users menu for promoting a player to creator status.\n" + "Use the Groups menu to make someone an assistant admin.\n"); + } + + int ToggleMudLock(){ + string *line_array; + string lockline, newline, newfile, line_string, junk; + int num; + + validate(); + line_string = read_file("/secure/include/config.h"); + if(!sizeof(line_string)) write("Couldn't read file."); + line_array = explode(line_string, "\n"); + if(!sizeof(line_array)) write("Array is zero length."); + + foreach(string line in line_array){ + if(strsrch(line,"MUD_IS_LOCKED") != -1){ + lockline = line; + } + } + if(sscanf(lockline,"%s%d",junk, num) < 2) { + write("Operation failed. You need to hand-"+ + "edit /secure/include/config.h immediately."); + return 0; + } + if(num == 0) { + write("Locking mud.\n"); + num = 1; + } + else { + write("Unlocking mud.\n"); + num = 0; + } + newline = junk + num; + newfile = replace_string(line_string, lockline, newline); + write_file("/secure/include/config.h",newfile,1); + load_object("/secure/cmds/creators/update")->cmd("/secure/daemon/master"); + load_object("/secure/cmds/creators/update")->cmd("/secure/lib/connect"); + write("\n"); + Menu(); + return 1; + } + + int ShowLock(){ + validate(); + if(load_object("/secure/daemon/master")->is_locked()){ + write("Mud is locked. Only admins and designated personnel can log in.\n"); + } + else write("Mud is unlocked. Players are free to login.\n"); + Menu(); + return 1; + } + + + int SetTZ(){ + validate(); + write("Please enter the desired time zone: \n"); + input_to( (: eventSetTZ :) ); + return 1; + } + + int eventSetTZ(string str){ + string ret; + + validate(); + ret = set_tz(str); + write(ret+"\n"); + load_object("/secure/cmds/creators/update")->cmd("/daemon/time"); + Menu(); + return 1; + } + + int ChangeEmail(){ + validate(); + write("Current admin email is: "+admin_email()); + write("Please enter the new email address of the mud administrator: \n"); + input_to( (: eventChangeEmail :) ); + return 1; + } + + varargs int eventChangeEmail(string str, int auto){ + string *line_array; + string lockline, newline, newfile, line_string, junk, email; + + validate(); + if(strsrch(str,"@") == -1 ) { + write("That isn't a valid email address."); + if(!auto) Menu(); + return 0; + } + str == replace_string(str, "#", ""); + line_string = read_file("/secure/include/config.h"); + if(!sizeof(line_string)) write("Couldn't read file."); + line_array = explode(line_string, "\n"); + if(!sizeof(line_array)) write("Array is zero length."); + foreach(string line in line_array){ + if(strsrch(line,"ADMIN_EMAIL") != -1){ + lockline = line; + } + } + if(sscanf(lockline,"%s\"%s\"",junk, email) < 2) { + write("Operation failed. You need to hand-"+ + "edit /secure/include/config.h immediately."); + if(!auto) Menu(); + return 0; + } + + newline = junk + "\""+str+"\""; + newfile = replace_string(line_string, lockline, newline); + write_file("/secure/include/config.h",newfile,1); + load_object("/secure/cmds/creators/update")->cmd("/secure/sefun/sefun"); + write("\n"); + if(!auto) Menu(); + return 1; + } + + int SetReboot(){ + validate(); + write("Current reboot interval is set to "+EVENTS_D->GetRebootInterval()+" hours."); + write(load_object("/cmds/players/nextreboot")->cmd("string")); + write("Please enter the new desired interval in hours:\n"); + input_to( (: eventSetReboot :) ); + return 1; + } + + int eventSetReboot(mixed i){ + int num; + + validate(); + if(!intp(i) && !sscanf(i,"%d",num)){ + write("Failed to set new interval.\n"); + Menu(); + return 1; + } + if(intp(i)) num = i; + EVENTS_D->SetRebootInterval(num); + write("Reboot interval set to "+EVENTS_D->GetRebootInterval()+" hours."); + Menu(); + return 1; + } + + int AddClass(){ + validate(); + write("Classes currently available: "+implode(load_object(CLASSES_D)->GetClasses()," ")); + write("Please enter the name of the class you'd like to add: \n"); + input_to( (: eventAddClass :) ); + return 1; + } + + int eventAddClass(string str){ + string classpath; + array *classes; + + validate(); + if(!str) { + write("Invalid class name.\n"); + Menu(); + return 1; + } + + classpath = "/secure/cfg/classes/"+str; + write("Looking for "+classpath+"..."); + classes = load_object(CLASSES_D)->GetClasses(); + if(member_array(str,classes) != -1) { + write("That class is already available.\n"); + Menu(); + return 1; + } + if(file_size(classpath) < 1) { + write("For a class to be added, you must create and "); + write("edit a class file, then place it in /secure/cfg/classes "); + write("with the other class files.\n"); + write("Operation Failed: no such class file\n"); + Menu(); + return 1; + } + CLASSES_D->AddClass(classpath); + write("Classes currently available: "+implode(load_object(CLASSES_D)->GetClasses()," ")+"\n"); + + Menu(); + return 1; + } + + int RemoveClass(){ + validate(); + write("Classes currently available: "+implode(load_object(CLASSES_D)->GetClasses()," ")); + write("Please enter the class you'd like to remove: \n"); + input_to( (: eventRemoveClass :) ); + return 1; + } + + int eventRemoveClass(string str){ + validate(); + if(!str){ + write("That is not a valid class.\n"); + Menu(); + return 1; + } + + if(member_array(str,load_object(CLASSES_D)->GetClasses()) == -1) { + write("That class is already unavailable.\n"); + Menu(); + return 1; + } + + load_object(CLASSES_D)->RemoveClass(str); + write("Classes currently available: "+implode(load_object(CLASSES_D)->GetClasses()," ")+"\n"); + Menu(); + return 1; + } + + int AddRace(){ + validate(); + write("Races currently available: "+implode(load_object(RACES_D)->GetRaces()," ")); + write("Please enter the name of the race you'd like to add: \n"); + input_to( (: eventAddRace :) ); + return 1; + } + + int eventAddRace(string str){ + array *races; + + validate(); + if(!str) { + write("Invalid race name.\n"); + Menu(); + return 1; + } + + racepath = "/secure/cfg/races/"+str; + write("Looking for "+racepath+"..."); + races = load_object(RACES_D)->GetRaces(); + if(member_array(str,races) != -1) { + write("That race is already available.\n"); + Menu(); + return 1; + } + if(file_size(racepath) < 1) { + write("For a race to be added, you must create and "); + write("edit a race file, then place it in /secure/cfg/races "); + write("with the other race files.\n"); + write("Operation Failed: no such race file\n"); + Menu(); + return 1; + } + + write("Should players be able to play as this race?"); + write("A response other than yes will be interpreted as a no.\n"); + input_to( (: PlayerRace :) ); + return 1; + } + + int PlayerRace(string str){ + string *response_array = ({"yes","ok","y","yeah","yes, please"}); + + validate(); + if(!str) str = "no"; + if(member_array(str,response_array) != -1) RACES_D->AddRace(racepath, 1); + else RACES_D->AddRace(racepath); + write("Races currently available: "+implode(load_object(RACES_D)->GetRaces()," ")+"\n"); + + Menu(); + return 1; + } + + int RemoveRace(){ + validate(); + write("Races currently available: "+implode(load_object(RACES_D)->GetRaces()," ")); + write("Please enter the race you'd like to remove: \n"); + input_to( (: eventRemoveRace :) ); + return 1; + } + + int eventRemoveRace(string str){ + validate(); + if(!str){ + write("That is not a valid race.\n"); + Menu(); + return 1; + } + + if(member_array(str,load_object(RACES_D)->GetRaces()) == -1) { + write("That race is already unavailable.\n"); + Menu(); + return 1; + } + + load_object(RACES_D)->RemoveRace(str); + write("Races currently available: "+implode(load_object(RACES_D)->GetRaces()," ")+"\n"); + Menu(); + return 1; + } + + int AddCurrency(){ + validate(); + write("Currencies currently available: "+implode(ECONOMY_D->__QueryCurrencies()," ")); + write("Please enter the name of the curency you'd like to add: \n"); + input_to( (: eventAddCurrency :) ); + return 1; + } + + int eventAddCurrency(string str){ + string query; + + validate(); + currency = str; + if(!str || str == "") { + write("Invalid currency name.\n"); + Menu(); + return 1; + } + + currencies = ECONOMY_D->__QueryCurrencies(); + if(member_array(str,currencies) != -1) { + write("That currency is already available.\n"); + Menu(); + return 1; + } + + query = "What should its exchange rate, or value be? For comparison, "+currencies[0]+" "; + query += "has a rate of "+ ECONOMY_D->__Query(currencies[0],"rate")+", "+currencies[1]+" "; + query += "has a rate of "+ ECONOMY_D->__Query(currencies[1],"rate")+", and "+currencies[2]+" "; + query += "has a rate of "+ ECONOMY_D->__Query(currencies[2],"rate")+".\n"; + + write(query); + input_to( (: CurrencyRate :) ); + return 1; + } + + int CurrencyRate(string str){ + string query; + + validate(); + if(!str || !sscanf(str,"%f",rate) ){ + write("Invalid rate. Currency not added.\n"); + Menu(); + return 1; + } + + query = "What should its weight be? For comparison, "+currencies[0]+" "; + query += "has a weight of "+ ECONOMY_D->__Query(currencies[0],"weight")+", "+currencies[1]+" "; + query += "has a weight of "+ ECONOMY_D->__Query(currencies[1],"weight")+", and "+currencies[2]+" "; + query += "has a weight of "+ ECONOMY_D->__Query(currencies[2],"weight")+".\n"; + + write(query); + input_to( (: CurrencyWeight :) ); + return 1; + } + + + int CurrencyWeight(string str){ + string query; + + validate(); + if(!str || !sscanf(str,"%f",weight) ){ + write("Invalid weight. Currency not added.\n"); + Menu(); + return 1; + } + + query = "What should its inflation rate be? For comparison, "+currencies[0]+" "; + query += "has an inflation rate of "+ ECONOMY_D->__Query(currencies[0],"inflation")+", "+currencies[1]+" "; + query += "has an inflation rate of "+ ECONOMY_D->__Query(currencies[1],"inflation")+", and "+currencies[2]+" "; + query += "has an inflation rate of "+ ECONOMY_D->__Query(currencies[2],"inflation")+".\n"; + + write(query); + input_to( (: CurrencyInflation :) ); + return 1; + } + + int CurrencyInflation(string str){ + validate(); + if(!str || !sscanf(str,"%f",inflation) ){ + write("Invalid inflation rate. Currency not added.\n"); + Menu(); + return 1; + } + write(identify(previous_object(-1))); + write("ECONOMY_D->add_currency(\""+currency+"\", "+rate+", "+inflation+", "+weight+");"); + ECONOMY_D->add_currency(currency, rate, inflation, weight); + write("Thank you. Currency added.\n"); + Menu(); + return 1; + } + + int RemoveCurrency(){ + validate(); + currencies = ECONOMY_D->__QueryCurrencies(); + if(sizeof(currencies) == 1) { + write("Please add a currency before removing this last one."); + write("Removing the last currency would cause the mud to "+ + "behave unexpectedly."); + return 1; + } + write("Available currencies: "+ identify(currencies) +"."); + write("Which currency would you like to remove?\n"); + + input_to( (: eventRemoveCurrency :) ); + return 1; + } + + int eventRemoveCurrency(string str){ + validate(); + if(!str || member_array(str, currencies) == -1) { + write("Invalid currency. No currency removed.\n"); + Menu(); + return 1; + } + ECONOMY_D->remove_currency(str); + write("Remaining currencies: "+identify(ECONOMY_D->__QueryCurrencies())+"\n"); + Menu(); + return 1; + } + + int EncrePlayer(){ + validate(); + write("Please enter the name of the player you'd like to promote: \n"); + input_to( (: eventEncrePlayer :) ); + return 1; + } + + int eventEncrePlayer(string str){ + validate(); + EnCre(str); + Menu(); + return 1; + } + + int DecreCreator(){ + validate(); + write("Please enter the name of the player you'd like to demote: \n"); + input_to( (: eventDecreCreator :) ); + return 1; + } + + int eventDecreCreator(string str){ + validate(); + DeCre(str); + Menu(); + return 1; + } + + mixed EnCre(string args) { + object ob; + string file, nom; + + validate(); + nom = convert_name(args); + if( !user_exists(nom) ){ + write(capitalize(nom) + " is not a member of " + + possessive_noun(mud_name()) + " reality."); + Menu(); + return 1; + } + load_object("/secure/cmds/admins/encre")->cmd(nom); + Menu(); + return 1; + } + + mixed DeCre(string args) { + object ob; + string nom, file; + nom = convert_name(args); + if( !user_exists(nom) ){ + write(capitalize(nom) + " is not a member of " + + possessive_noun(mud_name()) + " reality."); + Menu(); + return 1; + } + load_object("/secure/cmds/admins/decre")->cmd(nom); + Menu(); + return 1; + } + + int RidUser(){ + validate(); + write("Please enter the name of the player you'd like to erase.\n"); + //write("You will be asked to enter a reason for this ridding."); + //write("When you have finished, Type a single period on a blank line, "); + //write("then the letter x and enter.\n"); + input_to( (: eventRidUser :) ); + return 1; + } + + int eventRidUser(string str){ + validate(); + if(!str){ + write("Invalid entry.\n"); + Menu(); + return 1; + } + + if( !user_exists(str) ) { + write("No such person: " + str + ".\n"); + Menu(); + } + DoRid(str); + return 1; + } + + int DoRid(string who) { + object ob; + string str; + + validate(); + ridded = lower_case(who); + str = convert_name(who); + who = capitalize(who); + if( member_group(str, PRIV_SECURE) || member_group(str, PRIV_ASSIST) ){ + write("You must first remove this person from a secure group."); + Menu(); + return 1; + } + if( ob = find_player(ridded)) { + who = (string)ob->GetCapName(); + message("system", "You are being ridded from " + mud_name() + ".", + ob); + ob->eventForce("quit"); + //if( !((int)ob->eventDestruct()) ) destruct(ob); + } + file = save_file(ridded) + __SAVE_EXTENSION__; + //if( rename(file, DIR_RID + "/" + str + __SAVE_EXTENSION__) ) { + // write("Rename failed, security violation logged."); + // log_file("security", "\n*****\nRid violation attempted\n" + // "Target: " + who + "\nCall stack:\n" + + // sprintf("%O\n", previous_object(-1))); + // return 1; + // } + write("Target is: "+ridded); + write("Please enter the reason for ridding " + ridded + ".\n"); + unguarded( (: rm(file) :) ); + input_to( (: LogRid :) ); + return 1; + } + + int LogRid(string str){ + validate(); + globalstr = str; + log_file("rid", "\n" + ridded + " by " + (string)this_player()->GetCapName() + "\n" + str + "\n"); + //unguarded( (: write_file("/log/rid",timestamp()+" "+globalstr) :) ); + write(ridded + " has been ridded from " + mud_name() + "."); + Menu(); + return 1; + } + + int BanishUser(){ + validate(); + write("Please enter the name to banish: \n"); + input_to( (: eventBanishUser :) ); + return 1; + } + + int evenBanishUser(string str){ + validate(); + if(member_array(str,BANISH_D->query_banished()) != -1) { + write("That name is already banished.\n"); + Menu(); + return 1; + } + if(!user_exists(str = lower_case(str))) { + write(capitalize(str)+" is now banished.\n"); + catch(call_other(BANISH_D, "banish_name", str)); + } + else { + write("A player by that name already exists.\n"); + this_player()->eventPrint((string)FINGER_D->GetFinger(str)); + } + Menu(); + return 1; + } + + int UnBanishUser(){ + validate(); + write("Please enter the name to unbanish: \n"); + input_to( (: eventUnBanishUser :) ); + return 1; + } + + int eventUnBanishUser(string str){ + validate(); + if(member_array(str,BANISH_D->query_banished()) == -1) { + write("That is not a banished name."); + Menu(); + return 1; + } + catch(call_other(BANISH_D, "unbanish_name", str)); + write(str+" is unbanished.\n"); + Menu(); + return 1; + } + + int ChangeName(){ + validate(); + write("Current MUD name is "+mud_name()); + write("Please enter the new name for your MUD:\n"); + input_to( (: eventChangeName :) ); + return 1; + } + + varargs int eventChangeName(string newname, int automated){ + string *line_array; + string nameline, newline, newfile, line_string, junk, name; + + validate(); + if(!newname || newname == "") { + write("Name change cancelled.\n"); + Menu(); + return 1; + } + + if(automated){ + if(mud_name() != "DeadSoulsNew" && + mud_name() != "DeadSoulsWin") + return 0; + } + + line_string = read_file("/secure/cfg/mudos.cfg"); + if(!sizeof(line_string)) write("Couldn't read file."); + line_array = explode(line_string, "\n"); + if(!sizeof(line_array)) write("Array is zero length."); + + if(!sizeof(line_array) || !sizeof(line_string)) { + if(!automated) Menu(); + return 0; + } + + foreach(string line in line_array){ + if(strsrch(line,"name :") != -1){ + nameline = line; + } + } + + if(!nameline || sscanf(nameline,"%s : %s",junk, name) < 2) { + write("Operation failed. You need to copy over "+ + "/secure/cfg/mudos.cfg immediately with an original."); + if(!automated) Menu(); + return 0; + } + + if(automated){ + if(name != "DeadSoulsWin" && name != "DeadSouls" && + name != "Dead Souls" && name != "DeadSoulsNew") newname = name; + cp("/secure/cfg/mudos.cfg","/secure/cfg/mudos.orig"); + } + + newline = junk + " : " + newname; + newfile = replace_string(line_string, nameline, newline); + write_file("/secure/cfg/mudos.cfg",newfile,1); + cp("/secure/cfg/mudos.cfg","/secure/cfg/mudos.autobak"); + write("\n"); + if(!automated) { + write("\nMUD's name changed. Reboot the MUD to activate new name.\n"); + write("\n Do you want to shut down the MUD now to activate the change?\n"); + input_to( (: eventShutDownMud :) ); + } + return 1; + } + + int ChangePort(){ + validate(); + write("Current MUD network port is "+query_host_port()); + write("Please enter the new network port for your MUD:\n"); + input_to( (: eventChangePort :) ); + return 1; + } + + varargs int eventChangePort(string newport, int automated){ + string *line_array; + string nameline, newline, newfile, line_string, junk, name; + int num; + + validate(); + if(!newport || newport == "") { + write("Port change cancelled.\n"); + Menu(); + return 1; + } + + if(!sscanf(newport,"%d", num) > 0 || num < 1 || num > 65535 ) { + write("Invalid port: numeral between 1 and 65535 expected."); + write("Port change cancelled.\n"); + Menu(); + return 1; + } + + line_string = read_file("/secure/cfg/mudos.cfg"); + if(!sizeof(line_string)) write("Couldn't read file."); + line_array = explode(line_string, "\n"); + if(!sizeof(line_array)) write("Array is zero length."); + + foreach(string line in line_array){ + if(strsrch(line,"external_port_1 :") != -1){ + nameline = line; + } + } + + if(!nameline || sscanf(nameline,"%s : %s",junk, name) < 2) { + write("Operation failed. You need to copy over "+ + "/secure/cfg/mudos.cfg immediately with an original."); + if(!automated) Menu(); + return 0; + } + + newline = junk + " : telnet " + newport; + //write("newline is: "+newline); + newfile = replace_string(line_string, nameline, newline); + write_file("/secure/cfg/mudos.cfg",newfile,1); + if(!automated) { + write("\nMUD's port changed. Reboot the MUD to activate new port."); + write("NOTE: If the port you selected is 1024 or below, your OS "+ + "may require the MUD to run as a privileged user."); + write("\n Do you want to shut down the MUD now to activate the change?\n"); + input_to( (: eventShutDownMud :) ); + } + return 1; + } + + int ShutDownMud(){ + validate(); + write("Are you sure?"); + input_to( (: eventShutDownMud :) ); + return 1; + } + + int eventShutDownMud(string str){ + string *response_array = ({"yes","ok","y","yeah","yes, please"}); + + validate(); + if(!str) str = "no"; + if(member_array(str,response_array) == -1){ + write("Shutdown cancelled.\n"); + Menu(); + return 1; + } + + write("Shutdown initiated.\n"); + if(this_player()->GetForced()) return 0; + + shout("Game is shut down by " + this_player()->GetKeyName() + ".\n"); + log_file("game_log", ctime(time())+" Game shutdown by "+ + this_player()->GetKeyName()+"(admintool)\n"); + foreach(object dude in users()){ + if(sizeof(base_name(dude)) && !archp(dude)) dude->eventForce("quit"); + } + shutdown(); + write("Shutdown complete."); + Menu(); + return 1; + } + + int AddGroup(){ + validate(); + write("\nCurrent groups file: \n"+read_file("/secure/cfg/groups.cfg")+"\n\n"); + write("\nWhat is the name of the group you'd like to add?\n"); + input_to( (: eventAddGroup :) ); + return 1; + } + + int eventAddGroup(string str){ + string config_file, new_config_file; + string *line_array; + string *top_array; + string *bottom_array; + + validate(); + top_array = ({}); + bottom_array = ({}); + + if(!str || str == "") { + write("\nGroup addition cancelled.\n"); + Menu(); + return 1; + } + config_file = read_file("/secure/cfg/groups.cfg"); + if(!sizeof(config_file)) { + write("Couldn't read file. Addition cancelled.\n"); + Menu(); + return 1; + } + + str = upper_case(str); + if(strsrch(config_file,"("+str+")") != -1 ) { + write("\nThat group already exists. Addition cancelled.\n"); + Menu(); + return 1; + } + + line_array = explode(config_file, "\n"); + if(!sizeof(line_array)) { + write("\nArray is zero length. Addition cancelled.\n"); + Menu(); + return 1; + } + + foreach(string line in line_array){ + if(strsrch(line,"(") != -1 && + first(line,1) != "#"){ + bottom_array += ({ line }); + } + else top_array += ({ line }); + } + + bottom_array += ({"("+str+") "}); + + new_config_file = implode(top_array,"\n"); + new_config_file += "\n"; + new_config_file += implode(bottom_array,"\n"); + write_file("/secure/cfg/groups.cfg",new_config_file,1); + write("\nGroup "+str+" added.\n"); + load_object("/secure/cmds/creators/update")->cmd("/secure/daemon/master"); + load_object("/secure/cmds/creators/update")->cmd("/secure/lib/connect"); + Menu(); + return 1; + } + + int RemoveGroup(){ + validate(); + write("\nCurrent groups file: \n"+read_file("/secure/cfg/groups.cfg")+"\n\n"); + write("\nWhat is the name of the group you'd like to remove?\n"); + input_to( (: eventRemoveGroup :) ); + return 1; + } + + int eventRemoveGroup(string str){ + string config_file, new_config_file; + string *line_array; + string *top_array; + string *bottom_array; + + validate(); + top_array = ({}); + bottom_array = ({}); + + if(!str || str == "") { + write("\nGroup removal cancelled.\n"); + Menu(); + return 1; + } + config_file = read_file("/secure/cfg/groups.cfg"); + if(!sizeof(config_file)) { + write("Couldn't read file. removal cancelled.\n"); + Menu(); + return 1; + } + + str = upper_case(str); + if(strsrch(config_file,"("+str+")") == -1 ) { + write("\nThat group doesn't exist. removal cancelled.\n"); + Menu(); + return 1; + } + + if(str == "SECURE" || str == "ASSIST"){ + write("\nThis is a configured administrative group. You "+ + "can't remove it with admintool. If you really, really, really "+ + "know what you're doing and you want to remove that group, you'll "+ + "have to do it manually with an editor.\n"); + Menu(); + return 1; + } + + line_array = explode(config_file, "\n"); + if(!sizeof(line_array)) { + write("\nArray is zero length. removal cancelled.\n"); + Menu(); + return 1; + } + + foreach(string line in line_array){ + if(strsrch(line,"(") != -1 && first(line,1) != "#"){ + if(strsrch(line,"("+str+")") == -1 ) bottom_array += ({ line }); + } + else if(strsrch(line,"("+str+")") == -1 ) top_array += ({ line }); + } + + new_config_file = implode(top_array,"\n"); + new_config_file += "\n"; + new_config_file += implode(bottom_array,"\n"); + write_file("/secure/cfg/groups.cfg",new_config_file,1); + load_object("/secure/cmds/creators/update")->cmd("/secure/daemon/master"); + load_object("/secure/cmds/creators/update")->cmd("/secure/lib/connect"); + write("\nGroup "+str+" removed.\n"); + Menu(); + return 1; + } + + int ModGroup(){ + validate(); + write("\nCurrent groups file: \n"+read_file("/secure/cfg/groups.cfg")+"\n\n"); + write("\nWhat is the name of the group you'd like to modify?\n"); + input_to( (: eventModGroup :) ); + return 1; + } + + int eventModGroup(string str){ + string config_file; + + validate(); + if(!str || str == "") { + write("\nGroup modification cancelled.\n"); + Menu(); + return 1; + } + config_file = read_file("/secure/cfg/groups.cfg"); + if(!sizeof(config_file)) { + write("Couldn't read file. modification cancelled.\n"); + Menu(); + return 1; + } + + str = upper_case(str); + if(strsrch(config_file,"("+str+")") == -1 ) { + write("\nThat group doesn't exist. modification cancelled.\n"); + Menu(); + return 1; + } + + if(!sizeof(explode(config_file, "\n"))) { + write("\nArray is zero length. modification cancelled.\n"); + Menu(); + return 1; + } + + write(str); + global_group_temp = str; + write("The group format must be entered correctly. If the members are larry, moe, and curly, enter:\n"); + write("larry:moe:curly\n"); + write("\nIt's important to put those colons between names. If the only member is shemp, enter:\n"); + write("shemp\n"); + write("\nWhat would you like that group to contain?\n"); + input_to ( (: eventEditGroup :) ); + return 1; + } + + int eventEditGroup(string members){ + string config_file, new_config_file, str; + string *line_array; + string *top_array; + string *bottom_array; + string *dudes; + + validate(); + top_array = ({}); + bottom_array = ({}); + + config_file = read_file("/secure/cfg/groups.cfg"); + line_array = explode(config_file, "\n"); + str = global_group_temp; + global_group_temp = ""; + + + if(str == "ASSIST" || str == "SECURE" ) { + if(!securep(this_player())){ + write("Only full admins may do this."); + Menu(); + return 1; + } + } + + //tc("str: "+str); + //tc("green","green"); + + if(str == "SECURE"){ + validate(); + if(!members || members == "") { + write("You're not leaving the SECURE group empty. Modification cancelled.\n"); + Menu(); + return 1; + } + if(strsrch(members,":") != -1) dudes = explode(members,":"); + else dudes = ({ members }); + + if(member_array(this_player()->GetKeyName(),dudes) == -1) { + write("You can only modify this line with admintool if you include yourself in it. Modification cancelled.\n"); + Menu(); + return 1; + } + } + + foreach(string line in line_array){ + if(strsrch(line,"(") != -1 && first(line,1) != "#"){ + if(strsrch(line,"("+str+")") == -1 ) bottom_array += ({ line }); + } + else if(strsrch(line,"("+str+")") == -1 ) top_array += ({ line }); + } + + new_config_file = implode(top_array,"\n"); + new_config_file += "\n"; + new_config_file += implode(bottom_array,"\n"); + new_config_file += "\n"; + new_config_file += "("+str+") "+members; + write_file("/secure/cfg/groups.cfg",new_config_file,1); + load_object("/secure/cmds/creators/update")->cmd("/secure/daemon/master"); + load_object("/secure/cmds/creators/update")->cmd("/secure/lib/connect"); + write("\nGroup "+str+" modified.\n"); + Menu(); + return 1; + } + + int ShowGroups(){ + validate(); + write("\nCurrent groups file: \n"+read_file("/secure/cfg/groups.cfg")+"\n\n"); + Menu(); + return 1; + } + + mixed cmd(string args) { + validate(); + Menu("main"); + return 1; + } + diff -c -r --new-file ds1.1/lib/secure/cmds/admins/allow.c ds2.0r27/lib/secure/cmds/admins/allow.c *** ds1.1/lib/secure/cmds/admins/allow.c Sun Feb 1 21:30:28 1998 --- ds2.0r27/lib/secure/cmds/admins/allow.c Wed Jul 5 00:01:12 2006 *************** *** 15,24 **** if(!archp(previous_object())) return 0; if(!member_group(previous_object(), PRIV_SECURE)) { ! if(!member_group(previous_object(), "LAW")) { ! notify_fail("Only law may allow new players in the game.\n"); ! return 0; ! } } if(!str) return 0; if(sscanf(lower_case(str), "%s %s", who, email) != 2) { --- 15,24 ---- if(!archp(previous_object())) return 0; if(!member_group(previous_object(), PRIV_SECURE)) { ! if(!member_group(previous_object(), "LAW")) { ! notify_fail("Only law may allow new players in the game.\n"); ! return 0; ! } } if(!str) return 0; if(sscanf(lower_case(str), "%s %s", who, email) != 2) { *************** *** 31,37 **** } write(capitalize(who)+" is now allowed to create a character.\n"); if(res = catch(call_other(BANISH_D, "allow_name", who))) ! write("Error in letting in "+who+": "+res+"\n"); log_file("watch/players", capitalize(who)+": "+email+" ("+ctime(time())+")\n"); return 1; } --- 31,37 ---- } write(capitalize(who)+" is now allowed to create a character.\n"); if(res = catch(call_other(BANISH_D, "allow_name", who))) ! write("Error in letting in "+who+": "+res+"\n"); log_file("watch/players", capitalize(who)+": "+email+" ("+ctime(time())+")\n"); return 1; } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/banish.c ds2.0r27/lib/secure/cmds/admins/banish.c *** ds1.1/lib/secure/cmds/admins/banish.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cmds/admins/banish.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,36 ---- + // /bin/dev/_banish.c + // from the Dead Souls Mudlib + // prevents a name being used by a new player + // created by Descartes of Borg ??? + + #include <lib.h> + #include <daemons.h> + + inherit LIB_DAEMON; + + int cmd(string str) { + if(!str || str == ""){ + write("Syntax: banish <string>"); + return 1; + } + if(!user_exists(str = lower_case(str))) { + write(capitalize(str)+" is now banished.\n"); + catch(call_other(BANISH_D, "banish_name", str)); + } + else { + write("A player by that name already exists.\n"); + this_player()->eventPrint((string)FINGER_D->GetFinger(str)); + } + return 1; + } + + void help() { + write("Syntax: <banish [name]>\n\n" + "Protects a name from being used by a new player.\n" + "For example, if you have created a monster named Cassandra, in order\n" + "to avoid problems with player complaining \"I typed 'kill\n" + "cassandra' meaning to kill the evil enchantress, but Cassandra\n" + "walked in and I accidentally killed her.\" It is also to be\n" + "used to keep people from using offensive names.\n" + ); + } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/chanban.c ds2.0r27/lib/secure/cmds/admins/chanban.c *** ds1.1/lib/secure/cmds/admins/chanban.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cmds/admins/chanban.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,31 ---- + // This command is only useful if you own an intermud channel + + #include <lib.h> + #include <daemons.h> + + inherit LIB_DAEMON; + + mixed cmd(string args) { + string chan, mud; + + if(!archp(previous_object())) return 0; + if( !args || args == "" || sscanf(args,"%s %s",chan,mud) != 2) { + return "Huh?"; + } + mud = INTERMUD_D->GetMudName(mud); + if(!mud) return "No such mud."; + + if(member_array(chan,INTERMUD_D->GetChannels()) == -1) + return "No such channel."; + + else INTERMUD_D->eventWrite( ({ "channel-admin", 5, mud_name(), + this_player()->GetKeyName(), INTERMUD_D->GetNameserver(), + 0, chan, ({ mud }), ({}) }) ); + + //unguarded( (: update("/daemon/intermud") :) ); + load_object("/secure/cmds/creators/update")->cmd("/daemon/intermud"); + + write(mud+" has been banned from "+chan+"."); + + return 1; + } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/chanunban.c ds2.0r27/lib/secure/cmds/admins/chanunban.c *** ds1.1/lib/secure/cmds/admins/chanunban.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cmds/admins/chanunban.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,31 ---- + // This command is only useful if you own an intermud channel + + #include <lib.h> + #include <daemons.h> + + inherit LIB_DAEMON; + + mixed cmd(string args) { + string chan, mud; + + if(!archp(previous_object())) return 0; + if( !args || args == "" || sscanf(args,"%s %s",chan,mud) != 2) { + return "Huh?"; + } + mud = INTERMUD_D->GetMudName(mud); + if(!mud) return "No such mud."; + + if(member_array(chan,INTERMUD_D->GetChannels()) == -1) + return "No such channel."; + + else INTERMUD_D->eventWrite( ({ "channel-admin", 5, mud_name(), + this_player()->GetKeyName(), INTERMUD_D->GetNameserver(), + 0, chan, ({}), ({ mud }) }) ); + + //unguarded( (: update("/daemon/intermud") :) ); + load_object("/secure/cmds/creators/update")->cmd("/daemon/intermud"); + + write(mud+" has been unbanned from "+chan+"."); + + return 1; + } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/decre.c ds2.0r27/lib/secure/cmds/admins/decre.c *** ds1.1/lib/secure/cmds/admins/decre.c Sun Feb 1 21:30:29 1998 --- ds2.0r27/lib/secure/cmds/admins/decre.c Wed Jul 5 00:01:12 2006 *************** *** 5,10 **** --- 5,13 ---- */ #include <lib.h> + #include <privs.h> + #include <rooms.h> + #include <daemons.h> inherit LIB_DAEMON; *************** *** 12,50 **** mixed cmd(string args) { object ob, player_ob; string nom, file; if( args == "" || !stringp(args) ) ! return "Who do you want to make a player?"; nom = convert_name(args); if( !user_exists(nom) ) return capitalize(nom) + " is not a member of " + ! possessive_noun(mud_name()) + " reality."; if( !strsrch(file = save_file(nom), DIR_PLAYERS) ) ! return "You cannot make "+capitalize(args)+" a player."; if( file_size(DIR_PLAYERS+"/"+nom[0..0]) != -2) ! mkdir(DIR_PLAYERS+"/"+nom[0..0]); if(rename(file+__SAVE_EXTENSION__, DIR_PLAYERS+"/"+nom[0..0]+"/"+nom+__SAVE_EXTENSION__)) ! return "You failed due to lack of write access to "+DIR_PLAYERS+"."; if( ob = find_player(nom) ) { ! PlayerName = nom; ! catch(player_ob = (object)master()->player_object(nom)); ! PlayerName = 0; ! if( !player_ob ) { message("system", "Failed to create a player object.", ! this_player()); message("system", "Please log out and log back in.", ob); return 1; } exec(player_ob, ob); ! all_inventory(ob)->eventMove(player_ob); player_ob->Setup(); ob->eventDestruct(); message("system", "You are now a player.", player_ob); message("system", (string)player_ob->GetName() + " is now a player!", ! this_player()); if( file_size(file+__SAVE_EXTENSION__) > -1 ) rm(file+__SAVE_EXTENSION__); } return 1; } string GetKeyName() { return PlayerName; } --- 15,90 ---- mixed cmd(string args) { object ob, player_ob; + object *inv; string nom, file; + if( !((int)master()->valid_apply(({ PRIV_ASSIST, PRIV_SECURE, LIB_CONNECT }))) ) + error("Illegal decre attempt: "+get_stack()+" "+identify(previous_object(-1))); + if( args == "" || !stringp(args) ) ! return "Who do you want to make a player?"; nom = convert_name(args); if( !user_exists(nom) ) return capitalize(nom) + " is not a member of " + ! possessive_noun(mud_name()) + " reality."; if( !strsrch(file = save_file(nom), DIR_PLAYERS) ) ! return "You cannot make "+capitalize(args)+" a player."; ! ! if(!ob = find_player(nom)){ ! PLAYERS_D->RemovePendingEncre(lower_case(nom)); ! PLAYERS_D->AddPendingDecre(lower_case(nom)); ! write(capitalize(nom)+" will be demoted on their next login."); ! return 1; ! } ! ! if(ob == this_player()){ ! return "Nonsense."; ! } ! if( file_size(DIR_PLAYERS+"/"+nom[0..0]) != -2) ! mkdir(DIR_PLAYERS+"/"+nom[0..0]); if(rename(file+__SAVE_EXTENSION__, DIR_PLAYERS+"/"+nom[0..0]+"/"+nom+__SAVE_EXTENSION__)) ! return "You failed due to lack of write access to "+DIR_PLAYERS+"."; ! PLAYERS_D->eventDecre(lower_case(nom)); ! if( ob = find_player(nom) ) { ! PlayerName = nom; ! inv = deep_inventory(ob); ! ob->eventMove(ROOM_FURNACE); ! if(sizeof(inv)) inv->eventMove(ROOM_FURNACE); ! catch(player_ob = (object)master()->player_object(nom)); ! PlayerName = 0; ! if( !player_ob ) { message("system", "Failed to create a player object.", ! this_player()); message("system", "Please log out and log back in.", ob); return 1; } exec(player_ob, ob); ! inv=deep_inventory(ob); ! if(sizeof(inv)) inv->eventMove(ROOM_FURNACE); player_ob->Setup(); ob->eventDestruct(); + inv=deep_inventory(player_ob); + if(sizeof(inv)) inv->eventMove(ROOM_FURNACE); message("system", "You are now a player.", player_ob); message("system", (string)player_ob->GetName() + " is now a player!", ! this_player()); if( file_size(file+__SAVE_EXTENSION__) > -1 ) rm(file+__SAVE_EXTENSION__); } + player_ob->eventMove(ROOM_START); return 1; } string GetKeyName() { return PlayerName; } + void help() { + message("help", + "Syntax: decre <person>\n\n" + "Demotes the specified creator to player status. " + "If the target is not " + "logged in, they will be made a player when " + "they next log in." + "\n\n" + "See also: encre, rid", this_player() + ); + } + diff -c -r --new-file ds1.1/lib/secure/cmds/admins/domainadmin.c ds2.0r27/lib/secure/cmds/admins/domainadmin.c *** ds1.1/lib/secure/cmds/admins/domainadmin.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cmds/admins/domainadmin.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,128 ---- + #include <lib.h> + #include <daemons.h> + + inherit LIB_DAEMON; + + mixed cmd(string args) { + string rep, flag, domain, person; + string write_perms = read_file("/secure/cfg/write.cfg"); + string *tmp_array = explode(write_perms, "\n"); + string *admin_array = ({}); + mapping DomainsMap = ([]); + + + if(!archp(previous_object()) || this_player()->GetForced()){ + return "No."; + } + + //tc("tp_array: "+identify(tmp_array),"white"); + + if(!args || args == ""){ + write(this_object()->GetHelp()); + return 1; + } + + if(sscanf(args,"%s %s %s", flag, domain, person) != 3){ + write(this_object()->GetHelp()); + return 1; + } + + person = lower_case(person); + + if(!user_exists(person)){ + write("Invalid person."); + return 1; + } + + if(!directory_exists("/domains/"+domain)){ + write("Invalid domain."); + return 1; + } + + write_perms = replace_string(write_perms, "\n",";\n"); + + foreach(string line in tmp_array){ + string where, admins; + if(sscanf(line,"(/domains/%s/) %s", where, admins)){ + DomainsMap[where] = admins; + if(sizeof(DomainsMap[domain])) admin_array = explode(DomainsMap[domain],":"); + } + } + + if(flag == "-a"){ + + if(member_array(person, admin_array) != -1){ + write("That person already administers that domain."); + return 1; + } + + else admin_array += ({ person }); + + rep = "(/domains/"+domain+"/) "+implode(admin_array, ":"); + + //tc("rep: "+rep,"blue"); + + if(grepp(write_perms, "(/domains/"+domain+"/)")){ + write_perms = replace_matching_line(write_perms, "/domains/"+domain, rep); + write_perms = replace_string(write_perms, ";\n","\n"); + //tc("write_perms: "+write_perms, "yellow"); + } + else{ + write_perms = replace_string(write_perms, ";\n","\n"); + write_perms = newline_trim(write_perms); + write_perms += "\n(/domains/"+domain+"/) "+person+"\n"; + //tc("write_perms: "+write_perms); + } + } + + else if(flag == "-d"){ + if(member_array(person, admin_array) == -1){ + write("That person does not administer that domain."); + return 1; + } + + else admin_array -= ({ person }); + //tc("admin_array: "+identify(admin_array),"cyan"); + //tc("domain: "+domain,"cyan"); + //tc("erite_terms: "+write_perms,"cyan"); + + if(!sizeof(admin_array)){ + write_perms = remove_matching_line(write_perms, "(/domains/"+domain+"/)",1); + write_perms = replace_string(write_perms, ";\n","\n"); + //tc("write_perms: "+write_perms); + } + else { + rep = "(/domains/"+domain+"/) "+implode(admin_array, ":"); + //tc("rep: "+rep,"blue"); + write_perms = replace_matching_line(write_perms, "/domains/"+domain, rep); + write_perms = replace_string(write_perms, ";\n","\n"); + //tc("write_perms: "+write_perms); + } + } + + else { + write("Invalid flag."); + return 1; + } + + //tc("write_perms: "+write_perms,"green"); + write_file("/secure/cfg/write.cfg", write_perms, 1); + update("/secure/daemon/master"); + write("Ok."); + return 1; + } + + string GetHelp(string args) { + return ("Syntax: domainadmin [-a | -d] <domain> <person>\n\n" + "This command manages the write permissions to a specified " + "domain. For example, to give a creator named Snuffy write " + "privileges to /domains/SnuffLand, you would type: " + "\ndomainadmin -a SnuffLand snuffy\n" + "To revoke those privileges:\n" + "\domainadmin -d SnuffLand snuffy\n" + "This permits the creator to use QCS within the domain's " + "directories. " + "Write privileges are listed in /secure/cfg/write.cfg" + "\n\n" + "See also: domaincreate, admintool"); + } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/domaincreate.c ds2.0r27/lib/secure/cmds/admins/domaincreate.c *** ds1.1/lib/secure/cmds/admins/domaincreate.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cmds/admins/domaincreate.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,65 ---- + #include <lib.h> + #include <daemons.h> + + inherit LIB_DAEMON; + + mixed cmd(string args) { + string domain_path; + string *subdirs = ({"room","weap","armor","npc","etc","adm","doors","meals","obj"}); + string *alphabet = ({",", "#", ";", "^", "&", "(", ")","\"","\'","\`","?", " " }); + subdirs += ({"txt","virtual"}); + alphabet += ({ "@", "!", "$", "%", "=", "{", "}", "[", "]", ":", "<", ">", "\*" }); + alphabet += ({ "\\", "\/", "\|" }); + + if(!archp(previous_object()) || this_player()->GetForced()){ + return "No."; + } + + if(!args || args == "" || args == "/domains" || args == "/domains/" || + args == "domain"){ + write(this_object()->GetHelp()); + return 1; + } + + if(first(args, 9) == "/domains/"){ + domain_path = args; + } + else domain_path = "/domains/"+args; + + if(sscanf(domain_path,"/domains/%s",args) != 1) return 0; + if(last(args,1) == "/") args = truncate(args,1); + + foreach(string booboo in alphabet){ + args = replace_string(args, booboo, "_"); + } + + domain_path = "/domains/"+args; + + write("Domain path is: "+domain_path); + + if(directory_exists(domain_path)){ + write("That domain already exists."); + return 1; + } + + mkdir(domain_path); + + foreach(string dir in subdirs){ + string newdir = domain_path + "/" + dir; + write("Creating: "+newdir); + mkdir(newdir); + } + + cp("/obj/room.c",domain_path+"/room/start.c"); + + write("Ok."); + return 1; + } + + string GetHelp(string args) { + return ("Syntax: domaincreate DOMAIN\n\n" + "This command creates a new directory in the /domains dir, " + "and adds the appropriate subdirs needed by a domain." + "\n\n" + "See also: domainadmin, admintool"); + } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/encre.c ds2.0r27/lib/secure/cmds/admins/encre.c *** ds1.1/lib/secure/cmds/admins/encre.c Sun Feb 1 21:30:29 1998 --- ds2.0r27/lib/secure/cmds/admins/encre.c Wed Jul 5 00:01:12 2006 *************** *** 4,49 **** */ #include <lib.h> inherit LIB_DAEMON; string PlayerName; mixed cmd(string args) { ! object ob, cre_ob; ! string nom, file; if( args == "" || !stringp(args) ) ! return "Who do you want to make a creator?"; nom = convert_name(args); if( !user_exists(nom) ) return capitalize(nom) + " is not a member of " + ! possessive_noun(mud_name()) + " reality."; if( !strsrch(file = save_file(nom), DIR_CRES) ) ! return "You cannot make "+capitalize(args)+" a creator."; if( file_size(DIR_CRES+"/"+nom[0..0]) != -2) mkdir(DIR_CRES+"/"+nom[0..0]); if(rename(file+__SAVE_EXTENSION__, DIR_CRES+"/"+nom[0..0]+"/"+nom+__SAVE_EXTENSION__)) ! return "You failed due to lack of write access to "+DIR_CRES+"."; ! mkdir(user_path(nom)); if( ob = find_player(nom) ) { ! PlayerName = nom; ! catch(cre_ob = (object)master()->player_object(nom)); ! PlayerName = 0; ! if( !cre_ob ) { message("system", "Failed to create a cre object.", this_player()); message("system", "Please log out and log back in.", ob); return 1; } exec(cre_ob, ob); ! all_inventory(ob)->eventMove(cre_ob); cre_ob->Setup(); ob->eventDestruct(); message("system", "You are now a creator.", cre_ob); message("shout", (string)cre_ob->GetName() + " is now a creator!", ! users(), ({ this_player(), cre_ob })); if( file_size(file+__SAVE_EXTENSION__) > -1 ) rm(file+__SAVE_EXTENSION__); } - message("system", "You make "+capitalize(args) + " a creator.", this_player()); return 1; } string GetKeyName() { return PlayerName; } --- 4,103 ---- */ #include <lib.h> + #include <privs.h> + #include <daemons.h> + #include <rooms.h> inherit LIB_DAEMON; string PlayerName; mixed cmd(string args) { ! object ob, cre_ob, jeans, shirt, robe, hat, book, staff; ! string file, nom; ! ! if( !((int)master()->valid_apply(({ PRIV_ASSIST, PRIV_SECURE, LIB_CONNECT }))) ) ! error("Illegal encre attempt: "+get_stack()+" "+identify(previous_object(-1))); if( args == "" || !stringp(args) ) ! return "Who do you want to make a creator?"; nom = convert_name(args); if( !user_exists(nom) ) return capitalize(nom) + " is not a member of " + ! possessive_noun(mud_name()) + " reality."; if( !strsrch(file = save_file(nom), DIR_CRES) ) ! return "You cannot make "+capitalize(args)+" a creator."; ! ! if(!ob=find_player(nom)){ ! if(member_array(nom, PLAYERS_D->GetPendingEncres()) != -1){ ! write("That person is already pending creatorship."); ! return 1; ! } ! PLAYERS_D->RemovePendingDecre(lower_case(nom)); ! PLAYERS_D->AddPendingEncre(lower_case(nom)); ! write(capitalize(nom)+" will be a creator next time they log in."); ! return 1; ! } ! if( file_size(DIR_CRES+"/"+nom[0..0]) != -2) mkdir(DIR_CRES+"/"+nom[0..0]); if(rename(file+__SAVE_EXTENSION__, DIR_CRES+"/"+nom[0..0]+"/"+nom+__SAVE_EXTENSION__)) ! return "You failed due to lack of write access to "+DIR_CRES+"."; ! PLAYERS_D->eventCre(lower_case(nom)); if( ob = find_player(nom) ) { ! ob->SetProperty("brand_spanking_new",0); ! PlayerName = nom; ! catch(cre_ob = (object)master()->player_object(nom)); ! PlayerName = 0; ! if( !cre_ob ) { message("system", "Failed to create a cre object.", this_player()); message("system", "Please log out and log back in.", ob); return 1; } exec(cre_ob, ob); ! cre_ob->SetProperty("brand_spanking_new",0); cre_ob->Setup(); ob->eventDestruct(); message("system", "You are now a creator.", cre_ob); message("shout", (string)cre_ob->GetName() + " is now a creator!", ! users(), ({ this_player(), cre_ob })); if( file_size(file+__SAVE_EXTENSION__) > -1 ) rm(file+__SAVE_EXTENSION__); + make_workroom(cre_ob); + cre_ob->eventForce("home"); + cre_ob->eventForce("cd"); + jeans = present("jeans",cre_ob); + shirt = present("t-shirt",cre_ob); + if(jeans) jeans->eventMove(ROOM_FURNACE); + if(shirt) shirt->eventMove(ROOM_FURNACE); + robe = new("/domains/default/armor/robe"); + if(robe) robe->eventMove(cre_ob); + hat = new("/domains/default/armor/wizard_hat"); + if(hat) hat->eventMove(cre_ob); + robe = present("robe",cre_ob); + if(robe) cre_ob->eventForce("wear robe"); + hat = present("wizard hat",cre_ob); + if(hat) cre_ob->eventForce("wear wizard hat"); + staff = new("/secure/obj/staff"); + if(staff) staff->eventMove(cre_ob); + book = new("/domains/default/obj/manual"); + if(book && !present("manual",cre_ob)) book->eventMove(cre_ob); + else if(book) book->eventMove(ROOM_FURNACE); + cre_ob->save_player((string)cre_ob->GetKeyName()); + //message("system", "You will now be logged off.", cre_ob); + //message("system", "Please log back in to use your new powers.", cre_ob); + //cre_ob->eventForce("quit"); } return 1; } string GetKeyName() { return PlayerName; } + + void help() { + message("help", + "Syntax: encre <person>\n\n" + "Makes the target a creator. If the target is not " + "logged in, they will be made a creator when " + "they next log in." + "\n\n" + "See also: decre, rid", this_player() + ); + } + diff -c -r --new-file ds1.1/lib/secure/cmds/admins/end.c ds2.0r27/lib/secure/cmds/admins/end.c *** ds1.1/lib/secure/cmds/admins/end.c Sun Feb 1 21:30:29 1998 --- ds2.0r27/lib/secure/cmds/admins/end.c Wed Jul 5 00:01:12 2006 *************** *** 12,17 **** --- 12,18 ---- mixed cmd(string args) { int x; + if(!archp(previous_object())) return 0; if( !args || args == "" ) return "You must specify a delay in minutes."; if( !(x = to_int(args)) ) return "You must specify a delay in minutes."; if( x < 2 ) return "The delay must be at least 2 minutes."; *************** *** 22,29 **** void help() { message("help", "Syntax: <end [delay]>\n\n" ! "Initiates a reboot sequence which will end in a reboot after " ! "the specified delay period. The delay must be specified in " ! "minutes and it must be of at least two minutes.\n\n" ! "See also: nextreboot, setreboot, shutdown", this_player()); } --- 23,30 ---- void help() { message("help", "Syntax: <end [delay]>\n\n" ! "Initiates a reboot sequence which will end in a reboot after " ! "the specified delay period. The delay must be specified in " ! "minutes and it must be of at least two minutes.\n\n" ! "See also: nextreboot, setreboot, shutdown", this_player()); } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/link.c ds2.0r27/lib/secure/cmds/admins/link.c *** ds1.1/lib/secure/cmds/admins/link.c Sun Feb 1 21:30:29 1998 --- ds2.0r27/lib/secure/cmds/admins/link.c Wed Jul 5 00:01:12 2006 *************** *** 14,117 **** inherit LIB_DAEMON; mixed cmd(string args) { ! mixed tmp; ! string primary, secondary; ! if( !archp(previous_object()) ) return 0; ! // If no arguments are specified, dump all links. ! if( !args || args == "" ) { ! mapping links; ! string formatString; ! int screenSize = ((int *)this_player()->GetScreen())[0]; ! int playerSize = ((screenSize * 4) / 16) -1; ! int emailSize = ((screenSize * 6) / 16) - 1; ! int lastOnSize = ((screenSize * 6) / 16) - 1; ! ! if(playerSize < 14) playerSize = 14; ! if(emailSize < 25) emailSize = 25; ! if(lastOnSize < 25) lastOnSize = 25; ! ! formatString = "%:-" + playerSize + "s %:-" + emailSize ! + "s %:-" + lastOnSize + "s"; ! ! tmp = ({ center("%^CYAN%^ " + mud_name() ! + " Approved Character Links%^YELLOW%^", screenSize) }); ! ! tmp += ({ sprintf(formatString, "Player", "Email", "Last On%^RESET%^") }); ! ! links = (mapping)CHARACTER_D->GetLinks(); ! foreach(string p in sort_array(keys(links), 1)) { ! class char_link l; ! int maxi; ! ! l = links[p]; ! if( !(maxi = sizeof(l->Secondaries)) ) continue; ! tmp += ({ sprintf(formatString, capitalize(p), l->Email, ! ((l->LastOnWith == p) ? ctime(l->LastOnDate) : "unknown")) }); ! foreach(string pl in l->Secondaries) ! tmp += ({ sprintf(formatString, " " + capitalize(pl), "", ! ((l->LastOnWith == pl) ? ctime(l->LastOnDate) : "unknown")) }); } this_player(1)->eventPage(tmp, MSG_SYSTEM); return 1; ! } ! ! // Or, link a secondary to a primary. ! else if( sscanf(args, "%s to %s", secondary, primary) == 2 ) { ! this_player(1)->eventPrint("Email for player: ", MSG_PROMPT); ! input_to(function(string email, string primary, string secondary) { ! mixed tmp; ! ! if( !email || email == "" ) { ! this_player(1)->eventPrint("Aborted.", MSG_SYSTEM); ! return; ! } ! tmp = (mixed)CHARACTER_D->eventLink(primary, secondary, email); ! if( !tmp ) this_player(1)->eventPrint("Failed.", MSG_SYSTEM); ! else if( tmp == 1) this_player(1)->eventPrint("Linked.", MSG_SYSTEM); ! else this_player(1)->eventPrint(tmp, MSG_SYSTEM); ! }, primary, secondary); ! return 1; ! } ! ! // Otherwise, get link information on a specific player. ! else { ! mapping mp; ! string str; ! ! mp = (mapping)CHARACTER_D->GetLink(convert_name(args)); ! if( !mp ) this_player()->eventPrint(capitalize(args) + " has no " ! "links listed.", MSG_SYSTEM); else { ! str = "Primary: " + capitalize(mp["primary"]) + "\n"; ! str += "Last on " + ctime(mp["last on"]) + " with " + ! capitalize(mp["last char"]) + "\n"; ! str += "Secondaries: " + implode(mp["secondaries"], ","); ! this_player()->eventPrint(str, MSG_SYSTEM); } - return 1; - } } string GetHelp(string str) { return ("Syntax: <link SECONDARY to PRIMARY>\n" ! " <link PLAYER>\n" ! " <link>\n\n" ! "In the first form, it allows you to mark two characters " ! "as being controlled by the same real individual. It " ! "creates a relationship where one character is considered " ! "primary, and the other is secondary. If link relationships " ! "already exist for one or more, this will alter those " ! "and create a new one with the primary one you specify as " ! "primary. For example, if both characters were already set " ! "up as primary links, the one you specify with this command " ! "as primary becomes the sole primary link for these characters, " ! "and the secondary plus its secondaries all become secondaries " ! "fot his primary.\n\n" ! "If you just pass a player name as an argument, this command " ! "will show you the link information on that player.\n\n" ! "If you give no arguments, then this command will list all " ! "known links/\n\n" ! "See also: finger, unlink"); } --- 14,117 ---- inherit LIB_DAEMON; mixed cmd(string args) { ! mixed tmp; ! string primary, secondary; ! if( !archp(previous_object()) ) return 0; ! // If no arguments are specified, dump all links. ! if( !args || args == "" ) { ! mapping links; ! string formatString; ! int screenSize = ((int *)this_player()->GetScreen())[0]; ! int playerSize = ((screenSize * 4) / 16) -1; ! int emailSize = ((screenSize * 6) / 16) - 1; ! int lastOnSize = ((screenSize * 6) / 16) - 1; ! ! if(playerSize < 14) playerSize = 14; ! if(emailSize < 25) emailSize = 25; ! if(lastOnSize < 25) lastOnSize = 25; ! ! formatString = "%:-" + playerSize + "s %:-" + emailSize ! + "s %:-" + lastOnSize + "s"; ! ! tmp = ({ center("%^CYAN%^ " + mud_name() ! + " Approved Character Links%^YELLOW%^", screenSize) }); ! ! tmp += ({ sprintf(formatString, "Player", "Email", "Last On%^RESET%^") }); ! ! links = (mapping)CHARACTER_D->GetLinks(); ! foreach(string p in sort_array(keys(links), 1)) { ! class char_link l; ! int maxi; ! ! l = links[p]; ! if( !(maxi = sizeof(l->Secondaries)) ) continue; ! tmp += ({ sprintf(formatString, capitalize(p), l->Email, ! ((l->LastOnWith == p) ? ctime(l->LastOnDate) : "unknown")) }); ! foreach(string pl in l->Secondaries) ! tmp += ({ sprintf(formatString, " " + capitalize(pl), "", ! ((l->LastOnWith == pl) ? ctime(l->LastOnDate) : "unknown")) }); } this_player(1)->eventPage(tmp, MSG_SYSTEM); return 1; ! } ! ! // Or, link a secondary to a primary. ! else if( sscanf(args, "%s to %s", secondary, primary) == 2 ) { ! this_player(1)->eventPrint("Email for player: ", MSG_PROMPT); ! input_to(function(string email, string primary, string secondary) { ! mixed tmp; ! ! if( !email || email == "" ) { ! this_player(1)->eventPrint("Aborted.", MSG_SYSTEM); ! return; ! } ! tmp = (mixed)CHARACTER_D->eventLink(primary, secondary, email); ! if( !tmp ) this_player(1)->eventPrint("Failed.", MSG_SYSTEM); ! else if( tmp == 1) this_player(1)->eventPrint("Linked.", MSG_SYSTEM); ! else this_player(1)->eventPrint(tmp, MSG_SYSTEM); ! }, primary, secondary); ! return 1; ! } ! ! // Otherwise, get link information on a specific player. else { ! mapping mp; ! string str; ! ! mp = (mapping)CHARACTER_D->GetLink(convert_name(args)); ! if( !mp ) this_player()->eventPrint(capitalize(args) + " has no " ! "links listed.", MSG_SYSTEM); ! else { ! str = "Primary: " + capitalize(mp["primary"]) + "\n"; ! str += "Last on " + ctime(mp["last on"]) + " with " + ! capitalize(mp["last char"]) + "\n"; ! str += "Secondaries: " + implode(mp["secondaries"], ","); ! this_player()->eventPrint(str, MSG_SYSTEM); ! } ! return 1; } } string GetHelp(string str) { return ("Syntax: <link SECONDARY to PRIMARY>\n" ! " <link PLAYER>\n" ! " <link>\n\n" ! "In the first form, it allows you to mark two characters " ! "as being controlled by the same real individual. It " ! "creates a relationship where one character is considered " ! "primary, and the other is secondary. If link relationships " ! "already exist for one or more, this will alter those " ! "and create a new one with the primary one you specify as " ! "primary. For example, if both characters were already set " ! "up as primary links, the one you specify with this command " ! "as primary becomes the sole primary link for these characters, " ! "and the secondary plus its secondaries all become secondaries " ! "fot his primary.\n\n" ! "If you just pass a player name as an argument, this command " ! "will show you the link information on that player.\n\n" ! "If you give no arguments, then this command will list all " ! "known links/\n\n" ! "See also: finger, unlink"); } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/notify.c ds2.0r27/lib/secure/cmds/admins/notify.c *** ds1.1/lib/secure/cmds/admins/notify.c Sun Feb 1 21:30:30 1998 --- ds2.0r27/lib/secure/cmds/admins/notify.c Wed Jul 5 00:01:12 2006 *************** *** 2,56 **** * from the Dead Souls V Mud Library * created by Blitz@Dead Souls 950115 */ ! #include <lib.h> #include <daemons.h> ! ! varargs private void eventNotify(object who, string text); ! mixed cmd(string str) { object ob = previous_object(); string who; if( !ob ) return 0; who = (string)ob->GetKeyName(); if( sizeof(str) ) { ! eventNotify(ob, str); ! return 1; } ob->eventPrint("[ Dead Souls Notification System ]"); ob->eventPrint("Please compose your notification now. \n"); ob->eventEdit(DIR_TMP + "/" +who+ ".notice", (: eventNotify, ob, 0 :)); return 1; } ! varargs private void eventNotify(object who, string text) { int x; string file, str; if( !who ) return; if( !text ) { ! string * lines; ! file = DIR_TMP + "/" +(string)who->GetKeyName() + ".notice"; ! if( file_size(file) < 1 ) return; ! str = read_file(file); ! str = implode(filter(lines = explode(str, "\n"), (: sizeof :)), "\n"); ! rm(file); } else str = text; if( !sizeof(str) ) return; x = (int)NOTIFY_D->eventAddNotice(who, str); if( x ) ! who->eventPrint("Your notice [id #"+(x-1)+"] has been posted!"); else ! who->eventPrint("Error adding notice."); } ! string GetHelp(string str) { return ("Syntax: notify\n" ! " notify <message>\n\n" ! "This command allows users with proper access to " ! "add a message to a database of notifications. " ! "All new notifications are displayed to any creator " ! "upon login. Typing \"notify\" alone will put you " ! "into the text editor. Otherwise, the passed " ! "message will be used.\n\n"); } --- 2,58 ---- * from the Dead Souls V Mud Library * created by Blitz@Dead Souls 950115 */ ! #include <lib.h> #include <daemons.h> ! ! varargs private void eventNotify(object who, string text); ! mixed cmd(string str) { object ob = previous_object(); string who; + + if(!archp(previous_object())) return 0; if( !ob ) return 0; who = (string)ob->GetKeyName(); if( sizeof(str) ) { ! eventNotify(ob, str); ! return 1; } ob->eventPrint("[ Dead Souls Notification System ]"); ob->eventPrint("Please compose your notification now. \n"); ob->eventEdit(DIR_TMP + "/" +who+ ".notice", (: eventNotify, ob, 0 :)); return 1; } ! varargs private void eventNotify(object who, string text) { int x; string file, str; if( !who ) return; if( !text ) { ! string * lines; ! file = DIR_TMP + "/" +(string)who->GetKeyName() + ".notice"; ! if( file_size(file) < 1 ) return; ! str = read_file(file); ! str = implode(filter(lines = explode(str, "\n"), (: sizeof :)), "\n"); ! rm(file); } else str = text; if( !sizeof(str) ) return; x = (int)NOTIFY_D->eventAddNotice(who, str); if( x ) ! who->eventPrint("Your notice [id #"+(x-1)+"] has been posted!"); else ! who->eventPrint("Error adding notice."); } ! string GetHelp(string str) { return ("Syntax: notify\n" ! " notify <message>\n\n" ! "This command allows users with proper access to " ! "add a message to a database of notifications. " ! "All new notifications are displayed to any creator " ! "upon login. Typing \"notify\" alone will put you " ! "into the text editor. Otherwise, the passed " ! "message will be used.\n\n"); } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/opcprof.c ds2.0r27/lib/secure/cmds/admins/opcprof.c *** ds1.1/lib/secure/cmds/admins/opcprof.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cmds/admins/opcprof.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,28 ---- + #include <lib.h> + #include <dirs.h> + + + inherit LIB_DAEMON; + + int + cmd(string arg) + { + if(!archp(previous_object())) return 0; + unguarded( (: opcprof("/log/opcprof.out") :) ); + write("Please review /log/opcprof.out.efun and "+ + "/log/opcprof.out.eoper to see the output of this command."); + + return 1; + } + + int help() + { + write( @EndText + Syntax: opcprof + Effect: Puts a list of efuns and eoperators in /log/opcprof.out.* + See man: opcprof + See also: fdinfo, netstat, mstatus, cache, callouts, dumpallobj, + EndText + ); + return 1; + } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/register.c ds2.0r27/lib/secure/cmds/admins/register.c *** ds1.1/lib/secure/cmds/admins/register.c Sun Feb 1 21:30:30 1998 --- ds2.0r27/lib/secure/cmds/admins/register.c Wed Jul 5 00:01:12 2006 *************** *** 14,26 **** void abort(); int cmd(string str) { ! if(!archp(this_player())) return 0; if(!str) { ! notify_fail("Syntax: register <site-ip>\n\n"); ! return 0; } write("%^RED%^Enter all applicable information, including names, " ! "offenses and email addresses."); rm(DIR_TMP+"/"+this_player()->GetKeyName()+".tmp"); this_player()->eventEdit( DIR_TMP "/" + (string)this_player()->GetKeyName(), (: end_edit($(str)) :)); --- 14,26 ---- void abort(); int cmd(string str) { ! if(!archp(previous_object())) return 0; if(!str) { ! notify_fail("Syntax: register <site-ip>\n\n"); ! return 0; } write("%^RED%^Enter all applicable information, including names, " ! "offenses and email addresses."); rm(DIR_TMP+"/"+this_player()->GetKeyName()+".tmp"); this_player()->eventEdit( DIR_TMP "/" + (string)this_player()->GetKeyName(), (: end_edit($(str)) :)); *************** *** 28,57 **** } void end_edit(string site) { ! string *lines; ! string tmpfile, res, str; ! int x, num; ! ! tmpfile = read_file(DIR_TMP+"/"+this_player()->GetKeyName()); ! rm(DIR_TMP+"/"+this_player()->GetKeyName()); ! tmpfile = replace_string(tmpfile, "\n", " "); ! num = sizeof(lines = explode(wrap(tmpfile, 60), "\n")); ! str = " - "+site+" placed on Registration\n"; ! str += " by "+(string)previous_object()->GetName()+": "+ ! ctime(time())+"\n"; ! for(x=0; x<num; x++) ! str += " * "+lines[x]+"\n"; ! ! if(res = catch(call_other(BANISH_D, "register_site", site))) ! write("Error in registering site: "+res+"\n"); ! ! log_file("watch/register", "\n" + str); ! write("%^RED%^%^BOLD%^"+site+" is now on registeration!"); } void abort() { ! rm(DIR_TMP+"/"+this_player()->GetKeyName()+".tmp"); ! write("%^RED%^Site not registered!"); } void help() { --- 28,57 ---- } void end_edit(string site) { ! string *lines; ! string tmpfile, res, str; ! int x, num; ! ! tmpfile = read_file(DIR_TMP+"/"+this_player()->GetKeyName()); ! rm(DIR_TMP+"/"+this_player()->GetKeyName()); ! tmpfile = replace_string(tmpfile, "\n", " "); ! num = sizeof(lines = explode(wrap(tmpfile, 60), "\n")); ! str = " - "+site+" placed on Registration\n"; ! str += " by "+(string)previous_object()->GetName()+": "+ ! ctime(time())+"\n"; ! for(x=0; x<num; x++) ! str += " * "+lines[x]+"\n"; ! ! if(res = catch(call_other(BANISH_D, "register_site", site))) ! write("Error in registering site: "+res+"\n"); ! ! log_file("watch/register", "\n" + str); ! write("%^RED%^%^BOLD%^"+site+" is now on registeration!"); } void abort() { ! rm(DIR_TMP+"/"+this_player()->GetKeyName()+".tmp"); ! write("%^RED%^Site not registered!"); } void help() { diff -c -r --new-file ds1.1/lib/secure/cmds/admins/removeadverb.c ds2.0r27/lib/secure/cmds/admins/removeadverb.c *** ds1.1/lib/secure/cmds/admins/removeadverb.c Sun Feb 1 21:30:29 1998 --- ds2.0r27/lib/secure/cmds/admins/removeadverb.c Wed Jul 5 00:01:12 2006 *************** *** 25,32 **** string GetHelp(string args) { return ("Syntax: <removeadverb ADVERB>\n\n" ! "Allows you to remove an adverb from the list of" ! "system adverbs that can be used as adverbs in most soul " ! "commands.\n\n" ! "See also: addadverb, addemote, removeemote"); } --- 25,32 ---- string GetHelp(string args) { return ("Syntax: <removeadverb ADVERB>\n\n" ! "Allows you to remove an adverb from the list of" ! "system adverbs that can be used as adverbs in most soul " ! "commands.\n\n" ! "See also: addadverb, addemote, removeemote"); } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/removeclass.c ds2.0r27/lib/secure/cmds/admins/removeclass.c *** ds1.1/lib/secure/cmds/admins/removeclass.c Sun Feb 1 21:30:28 1998 --- ds2.0r27/lib/secure/cmds/admins/removeclass.c Wed Jul 5 00:01:12 2006 *************** *** 20,25 **** string GetHelp(string str) { return ("Syntax: <removeclass CLASS>\n\n" ! "Removes a class from the game.\n\n" ! "See also: addclass, addemote, addrace, removerace"); } --- 20,25 ---- string GetHelp(string str) { return ("Syntax: <removeclass CLASS>\n\n" ! "Removes a class from the game.\n\n" ! "See also: addclass, addemote, addrace, removerace"); } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/removeemote.c ds2.0r27/lib/secure/cmds/admins/removeemote.c *** ds1.1/lib/secure/cmds/admins/removeemote.c Sun Feb 1 21:30:29 1998 --- ds2.0r27/lib/secure/cmds/admins/removeemote.c Wed Jul 5 00:01:12 2006 *************** *** 13,19 **** mixed cmd(string args) { string verb, rule; ! if( !args || args == "" ) { return "Remove which emote?"; } --- 13,19 ---- mixed cmd(string args) { string verb, rule; ! if( !args || args == "" ) { return "Remove which emote?"; } *************** *** 40,47 **** string GetHelp(string args) { return ("Syntax: <removeemote EMOTE (RULE)>\n\n" ! "Allows you to remove an emote or a rule for an emote from " ! "the soul. If you specify a rule, only that rule gets removed. " ! "If you fail to specify a rule, the entire emote is removed.\n\n" ! "See also: addadverb, addemote, removeadverb"); } --- 40,47 ---- string GetHelp(string args) { return ("Syntax: <removeemote EMOTE (RULE)>\n\n" ! "Allows you to remove an emote or a rule for an emote from " ! "the soul. If you specify a rule, only that rule gets removed. " ! "If you fail to specify a rule, the entire emote is removed.\n\n" ! "See also: addadverb, addemote, removeadverb"); } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/removeguest.c ds2.0r27/lib/secure/cmds/admins/removeguest.c *** ds1.1/lib/secure/cmds/admins/removeguest.c Sun Feb 1 21:30:30 1998 --- ds2.0r27/lib/secure/cmds/admins/removeguest.c Wed Jul 5 00:01:12 2006 *************** *** 14,21 **** if(!archp(previous_object())) return 0; if(!str) { ! notify_fail("Correct syntax: removeguest [guestlist]\n"); ! return 0; } i = sizeof(guests = explode(str, " ")); while(i--) BANISH_D->remove_guest(guests[i]); --- 14,21 ---- if(!archp(previous_object())) return 0; if(!str) { ! notify_fail("Correct syntax: removeguest [guestlist]\n"); ! return 0; } i = sizeof(guests = explode(str, " ")); while(i--) BANISH_D->remove_guest(guests[i]); diff -c -r --new-file ds1.1/lib/secure/cmds/admins/removerace.c ds2.0r27/lib/secure/cmds/admins/removerace.c *** ds1.1/lib/secure/cmds/admins/removerace.c Sun Feb 1 21:30:29 1998 --- ds2.0r27/lib/secure/cmds/admins/removerace.c Wed Jul 5 00:01:12 2006 *************** *** 20,25 **** string GetHelp(string str) { return ("Syntax: <removerace RACE>\n\n" ! "Removes a race from the game.\n\n" ! "See also: addclass, addemote, addrace, removeclass"); } --- 20,25 ---- string GetHelp(string str) { return ("Syntax: <removerace RACE>\n\n" ! "Removes a race from the game.\n\n" ! "See also: addclass, addemote, addrace, removeclass"); } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/removeraces.c ds2.0r27/lib/secure/cmds/admins/removeraces.c *** ds1.1/lib/secure/cmds/admins/removeraces.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cmds/admins/removeraces.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,20 ---- + + #include <lib.h> + #include <daemons.h> + + inherit LIB_DAEMON; + + mixed cmd(string args) { + foreach(string str in RACES_D->GetRaces()){ + RACES_D->RemoveRace(str); + } + write("Done."); + return 1; + } + + string GetHelp(string str) { + return ("Syntax: <removeraces>\n" + "Gets rid of ALL races known by the race daemon. " + "Unless you want to be very sad later, you should " + "add your races with the addrace command immediately. "); + } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/resetall.c ds2.0r27/lib/secure/cmds/admins/resetall.c *** ds1.1/lib/secure/cmds/admins/resetall.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cmds/admins/resetall.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,41 ---- + #include <lib.h> + #include <rooms.h> + + inherit LIB_DAEMON; + + int cmd(string str) { + object *rooms = ({}); + + write("Compiling list of loaded rooms..."); + flush_messages(this_player()); + + rooms = filter(objects(), (: inherits(LIB_ROOM, $1) :) ); + + + if(archp(previous_object())){ + + foreach(object room in rooms){ + write("Updating: "+base_name(room)); + update(base_name(room)); + } + + update(ROOM_FURNACE); + reap_other(); + reap_other(); + + write("Done."); + + return 1; + } + write("You are not admin. This is command forbidden."); + return 1; + } + + + void help() { + write("Syntax: <resetall>\n\n"+ + "Unloads and reloads all rooms currently in memory.\n"+ + "This tends to destroy all non-interactive objects in "+ + "the rooms, and dumps all players at the start room "+ + "or The Void, so use this command with caution.\n"); + } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/resetpasswd.c ds2.0r27/lib/secure/cmds/admins/resetpasswd.c *** ds1.1/lib/secure/cmds/admins/resetpasswd.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cmds/admins/resetpasswd.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,96 ---- + #include <lib.h> + #include <dirs.h> + #include <flags.h> + #include <message_class.h> + + inherit LIB_DAEMON; + + static void NewPass(string pass); + static void ConfirmPass(string str, string newpass); + + string savefile; + + mixed cmd(string args) { + + if(!archp(previous_object())) { + write("No."); + return 1; + } + + args = lower_case(args); + + if(args == "me" || args == this_player()->GetKeyName()){ + write("To reset your own password, use the command: passwd"); + return 1; + } + + if( (int)previous_object()->GetForced() ) + return "You cannot be forced to change a password."; + if( previous_object() != this_player() ) + return "You're being sploited to reset someone's password."; + + if(!user_exists(args)){ + write("That person does not exist on this mud."); + return 1; + } + + if(find_player(args)){ + write("That player is currently logged on. Please use " + "the passwd command to reset their password."); + return 1; + } + + savefile = DIR_CRES + "/" + args[0..0] + "/" + args + ".o"; + if(!file_exists(savefile)) { + write("Couldn't find "+savefile+". Looking for alternate."); + savefile = DIR_PLAYERS + "/" + args[0..0] + "/"+ args + ".o"; + } + + if(!file_exists(savefile)){ + write("Save file could not be found. Exiting."); + return 1; + } + + write("Found "+savefile+"."); + + previous_object()->eventPrint("New password: ", MSG_PROMPT); + input_to( (: NewPass :), I_NOECHO | I_NOESC, previous_object() || args); + return 1; + } + + static void NewPass(string pass) { + if( !pass || strlen(pass) < 5 ) { + this_player()->eventPrint("Password must be at least 5 " + "characters, password change failed.", + MSG_SYSTEM); + return; + } + this_player()->eventPrint("\nConfirm: ", MSG_PROMPT); + input_to( (: ConfirmPass :), I_NOECHO | I_NOESC, pass); + } + + static void ConfirmPass(string str, string newpass) { + string *lines; + if( str != newpass ) { + this_player()->eventPrint("Passwords do not match.", MSG_SYSTEM); + return; + } + + lines = explode(unguarded((: read_file, savefile :)),"\n"); + unguarded((: rm, savefile :)); + foreach(string line in lines) { + string val; + + if( sscanf(line, "Password %s", val) ) + line = "Password \"" + crypt(newpass, 0) + "\""; + unguarded((: write_file, savefile, line + "\n" :)); + } + this_player()->eventPrint("\nPassword changed.", MSG_SYSTEM); + } + + void help() { + message("help", "Syntax: resetpasswd <player>\n\n" + "Allows you to change someone's password if they " + "are not logged on.\n\n" + "See also: passwd", this_player()); + } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/rid.c ds2.0r27/lib/secure/cmds/admins/rid.c *** ds1.1/lib/secure/cmds/admins/rid.c Sun Feb 1 21:30:30 1998 --- ds2.0r27/lib/secure/cmds/admins/rid.c Wed Jul 5 00:01:12 2006 *************** *** 3,44 **** * command to get rid of players * created by Descartes of Borg 951015 */ ! #include <lib.h> #include <dirs.h> #include <privs.h> inherit LIB_DAEMON; static void EndRid(string str); ! mixed cmd(string who) { object ob; string str, file; ! if( !who || who == "" ) return "Rid whom?"; str = convert_name(who); who = capitalize(who); ! if( member_group(str, PRIV_SECURE) || member_group(str, PRIV_ASSIST) ) ! return "You must first remove this person from a secure group."; ! if( !user_exists(str) ) return "No such person: " + who + "."; if( ob = find_player(str) ) { who = (string)ob->GetCapName(); message("system", "You are being ridded from " + mud_name() + ".", ! ob); if( !((int)ob->eventDestruct()) ) destruct(ob); } file = save_file(str) + __SAVE_EXTENSION__; if( rename(file, DIR_RID + "/" + str + __SAVE_EXTENSION__) ) { ! message("system", "Rename failed, security violation logged.", ! this_player()); log_file("security", "\n*****\nRid violation attempted\n" ! "Target: " + who + "\nCall stack:\n" + ! sprintf("%O\n", previous_object(-1))); return 1; } ! message("system", "Enter reason for ridding " + who + ".", ! this_player()); file = DIR_TMP + "/" + (string)this_player()->GetKeyName(); rm(file); this_player()->eventEdit(file, (: EndRid, who :)); --- 3,55 ---- * command to get rid of players * created by Descartes of Borg 951015 */ ! #include <lib.h> #include <dirs.h> + #include <daemons.h> #include <privs.h> inherit LIB_DAEMON; static void EndRid(string str); ! int cmd(string who) { object ob; string str, file; ! if(!archp(previous_object())) return 0; ! if( !who || who == "" ) { ! write("Rid whom?"); ! return 1; ! } ! str = convert_name(who); who = capitalize(who); ! if( member_group(str, PRIV_SECURE) || member_group(str, PRIV_ASSIST) ){ ! write("You must first remove this person from a secure group."); ! return 1; ! } ! ! if( !user_exists(str) ) { ! write("No such person: " + who + "."); ! return 1; ! } ! if( ob = find_player(str) ) { who = (string)ob->GetCapName(); message("system", "You are being ridded from " + mud_name() + ".", ! ob); if( !((int)ob->eventDestruct()) ) destruct(ob); } file = save_file(str) + __SAVE_EXTENSION__; if( rename(file, DIR_RID + "/" + str + __SAVE_EXTENSION__) ) { ! write("Rename failed, security violation logged."); log_file("security", "\n*****\nRid violation attempted\n" ! "Target: " + who + "\nCall stack:\n" + ! sprintf("%O\n", previous_object(-1))); return 1; } ! write("Enter reason for ridding " + who + "."); file = DIR_TMP + "/" + (string)this_player()->GetKeyName(); rm(file); this_player()->eventEdit(file, (: EndRid, who :)); *************** *** 51,67 **** file = DIR_TMP + "/" + (string)this_player()->GetKeyName(); if( !(str = read_file(file)) ) str = "No comment.\n"; log_file("rid", "\n" + who + " by " + (string)this_player()->GetCapName() + ! "\n" + str + "\n"); ! message("system", who + " has been ridded from " + mud_name() + ".", ! this_player()); } void help() { ! write( @EndText Syntax: rid <name> Effect: Deletes, nukes, wipes out and annhilates unwanted player <name> See also: demote, promote, sponsor EndText ! ); } --- 62,78 ---- file = DIR_TMP + "/" + (string)this_player()->GetKeyName(); if( !(str = read_file(file)) ) str = "No comment.\n"; log_file("rid", "\n" + who + " by " + (string)this_player()->GetCapName() + ! "\n" + str + "\n"); ! write(who + " has been ridded from " + mud_name() + "."); ! PLAYERS_D->RemoveUser(lower_case(who)); } void help() { ! write( @EndText Syntax: rid <name> Effect: Deletes, nukes, wipes out and annhilates unwanted player <name> See also: demote, promote, sponsor EndText ! ); } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/router.c ds2.0r27/lib/secure/cmds/admins/router.c *** ds1.1/lib/secure/cmds/admins/router.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cmds/admins/router.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,45 ---- + #include <lib.h> + #include <daemons.h> + + inherit LIB_DAEMON; + + mixed cmd(string args) { + string subcmd, arg1, arg2; + + if(!archp(previous_object())) return 0; + if(find_object(ROUTER_D)) + write("I3 router daemon is loaded."); + else { + write("I3 router daemon is not loaded."); + return 1; + } + + if(!args || args == ""){ + return 1; + } + + if(args == "show"){ + write("Router config: \n"+ROUTER_D->get_info()); + return 1; + } + + if(sscanf(args,"%s %s",subcmd, arg1) != 2){ + write("Invalid router subcommand."); + return 1; + } + + if(arg1 == "mudlist"){ + mapping mudlist = ROUTER_D->query_mudinfo(); + write("Mudlist: \n"+identify(mudlist)); + } + + + write("Router command completed."); + return 1; + } + + string GetHelp(string args) { + return ("Syntax: \n\n" + "\n\n" + ""); + } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/sconvert.c ds2.0r27/lib/secure/cmds/admins/sconvert.c *** ds1.1/lib/secure/cmds/admins/sconvert.c Sun Feb 1 21:30:30 1998 --- ds2.0r27/lib/secure/cmds/admins/sconvert.c Wed Jul 5 00:01:12 2006 *************** *** 3,93 **** * in a file by a specified percentage. * created by Blitz@Dead Souls */ ! void GetHelp(string str); ! string ConvertLine(string str, int change, int line, string search) { ! string s1, s2, cut, n, tmp; ! int a, b, val; ! ! while( (a = strsrch(str, search)) > -1 ) { ! tmp = str[a..]; ! b = strsrch(tmp, ")"); ! if( b < 0) break; ! cut = tmp[0..b]; ! if( sscanf(cut, "%s,%s", s1, s2) != 2 ) break; ! s2 = replace_string(s2, " ", ""); ! sscanf(s2, "%s)", s2); ! val = to_int(s2); ! if( !val ) break; ! val = val - (val / (100 / change)); ! n = sprintf("%s, %d)", s1[0] + "@@@" + s1[1..], val); ! str = replace_string(str, cut, n); ! write("Line "+line+": "+cut+" -> "+val+"."); ! } ! str = replace_string(str, search[0] + "@@@" + search[1..], search); ! return str; } ! void Convert(string s, int change) { ! string args, file, str; ! string *files, *tmp; ! int i, skill; ! ! if( !sizeof(s) ) args = "*.c"; ! else args = s; ! files = (string *)this_player()->wild_card(args); ! if( !i = sizeof(files) ) { ! message("info", "No file(s) found: "+implode(files, " "), ! this_player() ); ! return; ! } ! foreach(file in files) { ! string line; ! int changed = 0; ! ! str = read_file(file); ! if( !sizeof(str) ) continue; ! i = sizeof(tmp = explode(str, "\n")); ! write("Checking: "+file); ! while(i--) { ! line = tmp[i]; ! line = ConvertLine(line, change, i, "SetSkill"); ! line = ConvertLine(line, change, i, "SetStat"); ! if( tmp[i] != line ) changed = 1; ! if( changed ) tmp[i] = line; } ! if( changed ) { ! rename(file, file+"~"); ! write(file+": Writing new file..."); ! write_file(file, implode(tmp, "\n")); } - } } ! mixed cmd(string str) { ! string files; ! int change; ! if( !sizeof(str) || (sscanf(str, "%s %d", files, change) != 2) || !change) { ! GetHelp(0); return 1; - } - files = absolute_path((string)this_player()->query_cwd(), files); - Convert(files, change); - return 1; } ! ! void GetHelp(string str) { ! message("info", ! "Syntax: sconvert <filename | wild card> <percentage>\n\n" ! "This command searches through the specified file(s) and lowers " ! "all occurrences of SetSkill and SetStat by a <percentage> " ! "amount.\n\n" ! "Example: sconvert *.c 10\n" ! " - Searches all .c files in your currenct path, and reduces\n" ! " all skill and stat settings by 10%\n\n" ! "Note: It is possible to raise settings by passing a negative number.", ! this_player() ); } --- 3,97 ---- * in a file by a specified percentage. * created by Blitz@Dead Souls */ ! void GetHelp(string str); ! string ConvertLine(string str, int change, int line, string search) { ! string s1, s2, cut, n, tmp; ! int a, b, val; ! ! if(!archp(previous_object())) return 0; ! while( (a = strsrch(str, search)) > -1 ) { ! tmp = str[a..]; ! b = strsrch(tmp, ")"); ! if( b < 0) break; ! cut = tmp[0..b]; ! if( sscanf(cut, "%s,%s", s1, s2) != 2 ) break; ! s2 = replace_string(s2, " ", ""); ! sscanf(s2, "%s)", s2); ! val = to_int(s2); ! if( !val ) break; ! val = val - (val / (100 / change)); ! n = sprintf("%s, %d)", s1[0] + "@@@" + s1[1..], val); ! str = replace_string(str, cut, n); ! write("Line "+line+": "+cut+" -> "+val+"."); ! } ! str = replace_string(str, search[0] + "@@@" + search[1..], search); ! return str; } ! void Convert(string s, int change) { ! string args, file, str; ! string *files, *tmp; ! int i; ! ! if(!archp(previous_object())) return 0; ! if( !sizeof(s) ) args = "*.c"; ! else args = s; ! files = (string *)this_player()->wild_card(args); ! if( !i = sizeof(files) ) { ! message("info", "No file(s) found: "+implode(files, " "), ! this_player() ); ! return; } ! foreach(file in files) { ! string line; ! int changed = 0; ! ! str = read_file(file); ! if( !sizeof(str) ) continue; ! i = sizeof(tmp = explode(str, "\n")); ! write("Checking: "+file); ! while(i--) { ! line = tmp[i]; ! line = ConvertLine(line, change, i, "SetSkill"); ! line = ConvertLine(line, change, i, "SetStat"); ! if( tmp[i] != line ) changed = 1; ! if( changed ) tmp[i] = line; ! } ! if( changed ) { ! rename(file, file+"~"); ! write(file+": Writing new file..."); ! write_file(file, implode(tmp, "\n")); ! } } } ! mixed cmd(string str) { ! string files; ! int change; ! ! if(!archp(previous_object())) return 0; ! if( !sizeof(str) || (sscanf(str, "%s %d", files, change) != 2) || !change) { ! GetHelp(0); ! return 1; ! } ! files = absolute_path((string)this_player()->query_cwd(), files); ! Convert(files, change); return 1; } ! ! void GetHelp(string str) { ! message("info", ! "Syntax: sconvert <filename | wild card> <percentage>\n\n" ! "This command searches through the specified file(s) and lowers " ! "all occurrences of SetSkill and SetStat by a <percentage> " ! "amount.\n\n" ! "Example: sconvert *.c 10\n" ! " - Searches all .c files in your currenct path, and reduces\n" ! " all skill and stat settings by 10%\n\n" ! "Note: It is possible to raise settings by passing a negative number.", ! this_player() ); } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/setreboot.c ds2.0r27/lib/secure/cmds/admins/setreboot.c *** ds1.1/lib/secure/cmds/admins/setreboot.c Sun Feb 1 21:30:30 1998 --- ds2.0r27/lib/secure/cmds/admins/setreboot.c Wed Jul 5 00:01:12 2006 *************** *** 6,13 **** int cmd(string str) { int x; ! if(!str || !archp(previous_object())) return 0; ! sscanf(str, "%d", x); x = (int)EVENTS_D->SetRebootInterval(x); message("info", "Reboot interval set to "+x+" hours.", this_player()); return 1; --- 6,18 ---- int cmd(string str) { int x; ! if( !((int)master()->valid_apply(({ "ASSIST" }))) ){ ! return 0; ! } ! ! if(!str || str == "" || !sscanf(str, "%d", x)){ ! this_object()->help(); ! } x = (int)EVENTS_D->SetRebootInterval(x); message("info", "Reboot interval set to "+x+" hours.", this_player()); return 1; diff -c -r --new-file ds1.1/lib/secure/cmds/admins/shutdown.c ds2.0r27/lib/secure/cmds/admins/shutdown.c *** ds1.1/lib/secure/cmds/admins/shutdown.c Sun Feb 1 21:30:30 1998 --- ds2.0r27/lib/secure/cmds/admins/shutdown.c Wed Jul 5 00:01:12 2006 *************** *** 7,17 **** inherit LIB_DAEMON; int cmd(string str) { if(this_player()->GetForced()) return 0; if(!archp(previous_object())) { ! notify_fail("You are not permitted to shutdown the game.\n"); ! return 0; } if(!str) { notify_fail("You must give a shutdown reason as argument.\n"); --- 7,21 ---- inherit LIB_DAEMON; + void ShutDown(){ + shutdown(); + } + int cmd(string str) { if(this_player()->GetForced()) return 0; if(!archp(previous_object())) { ! notify_fail("You are not permitted to shutdown the game.\n"); ! return 0; } if(!str) { notify_fail("You must give a shutdown reason as argument.\n"); *************** *** 19,26 **** } shout("Game is shut down by " + this_player()->GetKeyName() + ".\n"); log_file("game_log", ctime(time())+" Game shutdown by "+ ! this_player()->GetKeyName()+"("+str+")\n"); shutdown(); return 1; } --- 23,34 ---- } shout("Game is shut down by " + this_player()->GetKeyName() + ".\n"); log_file("game_log", ctime(time())+" Game shutdown by "+ ! this_player()->GetKeyName()+"("+str+")\n"); ! foreach(object dude in users()){ ! if(dude && sizeof(base_name(dude)) && !archp(dude)) dude->eventForce("quit"); ! } shutdown(); + return 1; } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/stupidemote.c ds2.0r27/lib/secure/cmds/admins/stupidemote.c *** ds1.1/lib/secure/cmds/admins/stupidemote.c Sun Feb 1 21:30:29 1998 --- ds2.0r27/lib/secure/cmds/admins/stupidemote.c Wed Jul 5 00:01:12 2006 *************** *** 15,21 **** string array rules = ({ "", "STR" }); string array adverbs; string emote, xtra, prep; ! if( !args || args == "" ) { return "Add which emote?"; } --- 15,21 ---- string array rules = ({ "", "STR" }); string array adverbs; string emote, xtra, prep; ! if( !args || args == "" ) { return "Add which emote?"; } *************** *** 29,42 **** } else { string token; ! if( strlen(xtra) < 5 ) { return "The expression " + xtra + " makes no sense."; } prep = xtra[0..<5]; token = xtra[<3..]; if( member_array(prep, master()->parse_command_prepos_list()) == ! -1 ) { return "The preposition " + prep + " is not a valid."; } if( member_array(token, ({ "LIV", "LVS" })) == -1 ) { --- 29,42 ---- } else { string token; ! if( strlen(xtra) < 5 ) { return "The expression " + xtra + " makes no sense."; } prep = xtra[0..<5]; token = xtra[<3..]; if( member_array(prep, master()->parse_command_prepos_list()) == ! -1 ) { return "The preposition " + prep + " is not a valid."; } if( member_array(token, ({ "LIV", "LVS" })) == -1 ) { *************** *** 55,61 **** } foreach(string rule in rules) { string msg; ! if( rule == "" ) { msg = "$agent_name $agent_verb."; adverbs = 0; --- 55,61 ---- } foreach(string rule in rules) { string msg; ! if( rule == "" ) { msg = "$agent_name $agent_verb."; adverbs = 0; *************** *** 75,81 **** else { if( prep ) { msg = "$agent_name $agent_verb $adverb " + prep + ! " $target_name."; } else { msg = "$agent_name $agent_verb $target_name $adverb."; --- 75,81 ---- else { if( prep ) { msg = "$agent_name $agent_verb $adverb " + prep + ! " $target_name."; } else { msg = "$agent_name $agent_verb $target_name $adverb."; *************** *** 94,118 **** string GetHelp(string args) { return ("Syntax: <stupidemote EMOTE>\n" ! " <stupidemote EMOTE RULE>\n" ! "This command allows you to add the most common kinds of " ! "emote straight from the command line. Using the first syntax, " ! "You can add a simple, untargetted emote. For example, " ! "if you did <stupidemote cheese>, this would create an emote " ! "that would allow people to do <cheese> and <cheese adverb> " ! "with a message that looks like \"Descartes cheeses.\"\n" ! "The second syntax is for targetted emotes. You specify a " ! "targetting rule. Targetting rules can be one of the following:\n" ! "\t* LIV\n" ! "\t* LVS\n" ! "\t* preposition LIV\n" ! "\t* preposition LVS\n" ! "The difference between LIV and LVS just determines whether the " ! "emote can be targetted at a single living being or one or more " ! "living beings. So, to add the \"smile\" emote, you would " ! "do:\n" ! "> stupidemote smile at LVS\n" ! "and that would give you all the functionality of the \"smile\" " ! "emote that exists on this mudlib.\n\n" ! "See also: addadverb, addemote, removeadverb, removeemote"); } --- 94,118 ---- string GetHelp(string args) { return ("Syntax: <stupidemote EMOTE>\n" ! " <stupidemote EMOTE RULE>\n" ! "This command allows you to add the most common kinds of " ! "emote straight from the command line. Using the first syntax, " ! "You can add a simple, untargetted emote. For example, " ! "if you did <stupidemote cheese>, this would create an emote " ! "that would allow people to do <cheese> and <cheese adverb> " ! "with a message that looks like \"Descartes cheeses.\"\n" ! "The second syntax is for targetted emotes. You specify a " ! "targetting rule. Targetting rules can be one of the following:\n" ! "\t* LIV\n" ! "\t* LVS\n" ! "\t* preposition LIV\n" ! "\t* preposition LVS\n" ! "The difference between LIV and LVS just determines whether the " ! "emote can be targetted at a single living being or one or more " ! "living beings. So, to add the \"smile\" emote, you would " ! "do:\n" ! "> stupidemote smile at LVS\n" ! "and that would give you all the functionality of the \"smile\" " ! "emote that exists on this mudlib.\n\n" ! "See also: addadverb, addemote, removeadverb, removeemote"); } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/switchrouter.c ds2.0r27/lib/secure/cmds/admins/switchrouter.c *** ds1.1/lib/secure/cmds/admins/switchrouter.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cmds/admins/switchrouter.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,71 ---- + #include <lib.h> + #include <daemons.h> + + inherit LIB_DAEMON; + + string file; + + mixed cmd(string args) { + string ip, name; + int port, octet1, octet2, octet3, octet4; + + if(!archp(previous_object())) return "No."; + + if(find_object(INTERMUD_D))find_object(INTERMUD_D)->eventClearVars(); + if(find_object(INTERMUD_D))find_object(INTERMUD_D)->eventDestruct(); + //rm("/save/intermud.o"); + + if(!args || args == ""){ + write("Reloading intermud daemon."); + if( load_object(INTERMUD_D) ) write("Intermud daemon reloaded."); + else write("Failed to reload intermud daemon."); + return 1; + } + + if(sscanf(args,"%s %s %d", name, ip, port) != 3 || port > 65534 || + sscanf(ip,"%d.%d.%d.%d", octet1, octet2, octet3, octet4) != 4){ + write("Invalid router reference. \nTry: switchrouter <ROUTERNAME> <NUMERICAL IP> <PORT>"); + write("For example: switchrouter yatmim 149.152.218.102 23"); + if( load_object(INTERMUD_D) ) write("Intermud daemon reloaded."); + else write("Failed to reload intermud daemon."); + return 1; + } + + file = read_file(INTERMUD_D+".c"); + //write_file("/tmp/1.txt",file,1); + + file = replace_matching_line(file, "//Nameservers", ""); + + //write_file("/tmp/2.txt",file,1); + if(first(name,1) != "*") name = "*"+name; + + file = replace_matching_line(file, "Nameservers = ({", + " Nameservers = ({ ({ \""+name+"\", \""+ip+" "+port+"\" }) });", 1); + + //write_file("/tmp/3.txt",file,1); + + unguarded( (: write_file(INTERMUD_D+".c",file,1) :) ); + + if( load_object(INTERMUD_D) ) write("Intermud daemon reloaded."); + else write("Failed to reload intermud daemon."); + + write("Done."); + return 1; + } + + + string GetHelp(string args) { + return ("Syntax: switchrouter <NAME> <IP> <PORT>\n\n" + "Stops the intermud daemon, changes the default intermud " + "router to the ip and port you specify, wipes the previous " + "router data, and reloads INTERMUD_D. Without arguments, " + "this command will clear your intermud cache and reload " + "the daemon. Known routers are:\n" + "*gjs 198.144.203.194 9000 (The \"official\" intermud.org router)\n" + "*yatmim 149.152.218.102 23 (The \"official\" Dead Souls router)\n" + "The official current Dead Souls router's IP will always be " + "available at:\n" + "http://dead-souls.net/router.html" + "\n\n" + "See also: router, mudlist"); + } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/tempban.c ds2.0r27/lib/secure/cmds/admins/tempban.c *** ds1.1/lib/secure/cmds/admins/tempban.c Sun Feb 1 21:30:30 1998 --- ds2.0r27/lib/secure/cmds/admins/tempban.c Wed Jul 5 00:01:12 2006 *************** *** 3,46 **** // A command so that all those law-types can place sites on registration for a // specified, limited amount of time. // 01July1994 by Gregon@Dead Souls ! ! #include <lib.h> #include <daemons.h> ! inherit LIB_DAEMON; ! int cmd(string str) { string site; int time; ! ! if(!archp(this_player())) return 0; ! if(!str) { ! write("The following sites are on temporary registration:\n"+ ! BANISH_D->query_temp_site_info()); ! return 1; } ! ! if(sscanf(str, "%s %d", site, time) != 2) { ! notify_fail("Correct syntax: tempban [site] [time in minutes]>\n\n"); ! return 0; } ! write(site+" is now on register for "+time+" minutes."); BANISH_D->temporary_register(site, time*60); log_file("watch/register", site+" for "+time+" minutes.\n"); log_file("watch/register", "by " +this_player()->GetName()+"\n"); return 1; } ! void help() { write("Syntax: tempban [site] [time]\n\nThis will make new players from " ! "[site] unable to log in for a period of time [time] " ! "(given in minutes). This will last across reboots and site ip " ! "numbers should be entered in the same manner as the \"register\" " ! "command requires. See \"help register\" for more details.\n\n" ! "Note: tempban without arguments will list all sites on temporary " ! "registration along with their times of expiration."); } --- 3,46 ---- // A command so that all those law-types can place sites on registration for a // specified, limited amount of time. // 01July1994 by Gregon@Dead Souls ! ! #include <lib.h> #include <daemons.h> ! inherit LIB_DAEMON; ! int cmd(string str) { string site; int time; ! ! if(!archp(previous_object())) return 0; ! if(!str) { ! write("The following sites are on temporary registration:\n"+ ! BANISH_D->query_temp_site_info()); ! return 1; } ! ! if(sscanf(str, "%s %d", site, time) != 2) { ! notify_fail("Correct syntax: tempban [site] [time in minutes]>\n\n"); ! return 0; } ! write(site+" is now on register for "+time+" minutes."); BANISH_D->temporary_register(site, time*60); log_file("watch/register", site+" for "+time+" minutes.\n"); log_file("watch/register", "by " +this_player()->GetName()+"\n"); return 1; } ! void help() { write("Syntax: tempban [site] [time]\n\nThis will make new players from " ! "[site] unable to log in for a period of time [time] " ! "(given in minutes). This will last across reboots and site ip " ! "numbers should be entered in the same manner as the \"register\" " ! "command requires. See \"help register\" for more details.\n\n" ! "Note: tempban without arguments will list all sites on temporary " ! "registration along with their times of expiration."); } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/ticktock.c ds2.0r27/lib/secure/cmds/admins/ticktock.c *** ds1.1/lib/secure/cmds/admins/ticktock.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cmds/admins/ticktock.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,50 ---- + #include <lib.h> + #include <daemons.h> + + inherit LIB_DAEMON; + + mixed cmd(mixed args) { + int *mudtime; + int integer, hours, minutes; + string meridiem = " am"; + string nulle = ""; + + if(!archp(previous_object())) return 0; + if(!args) args = 0; + if(stringp(args)){ + if(sscanf(args,"%d",integer) != 1) return "Failed."; + args = integer; + } + + if(args != 0 || SEASONS_D->GetTickTock()) SEASONS_D->eventTickTock(args); + + mudtime = SEASONS_D->GetMudTime(); + hours = mudtime[0]; + minutes = mudtime[1]; + + //tod = SEASONS_D->GetTimeOfDay(); + + if(hours >= 12 && hours != 24) { + if(hours != 12) hours -= 12; + meridiem = " pm"; + } + + if(!hours || hours == 0) hours = 12; + + if(minutes < 10) nulle = "0"; + + write("In the MUD, the time is "+hours+":"+nulle+minutes+meridiem+"."); + + return 1; + + } + + void help() { + message("help", "Syntax: <ticktock [seconds]>\n\n" + "Changes in-game mud time by the number of seconds " + "specified. This is useful for changing night to " + "day and vice versa, when testing ambient light and " + "variable room descriptions. The timeshift does not " + "persist between reboots.\n\n" + "", this_player()); + } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/unallow.c ds2.0r27/lib/secure/cmds/admins/unallow.c *** ds1.1/lib/secure/cmds/admins/unallow.c Sun Feb 1 21:30:30 1998 --- ds2.0r27/lib/secure/cmds/admins/unallow.c Wed Jul 5 00:01:12 2006 *************** *** 5,20 **** int cmd(string str) { if(!member_group(previous_object(), "SECURE")) { ! if(!member_group(previous_object(), "LAW")) return 0; } if(!str) { ! notify_fail("Correct syntax: <unallow [str]>\n"); ! return 0; } if(member_array(str = lower_case(str), ! (string *)BANISH_D->query_allowed()) == -1) { ! notify_fail(capitalize(str)+" is not set to be let in.\n"); ! return 0; } BANISH_D->unallow_name(str); log_file("watch/players", (string)previous_object()->GetKeyName()+ --- 5,20 ---- int cmd(string str) { if(!member_group(previous_object(), "SECURE")) { ! if(!member_group(previous_object(), "LAW")) return 0; } if(!str) { ! notify_fail("Correct syntax: <unallow [str]>\n"); ! return 0; } if(member_array(str = lower_case(str), ! (string *)BANISH_D->query_allowed()) == -1) { ! notify_fail(capitalize(str)+" is not set to be let in.\n"); ! return 0; } BANISH_D->unallow_name(str); log_file("watch/players", (string)previous_object()->GetKeyName()+ diff -c -r --new-file ds1.1/lib/secure/cmds/admins/unlink.c ds2.0r27/lib/secure/cmds/admins/unlink.c *** ds1.1/lib/secure/cmds/admins/unlink.c Sun Feb 1 21:30:30 1998 --- ds2.0r27/lib/secure/cmds/admins/unlink.c Wed Jul 5 00:01:12 2006 *************** *** 12,22 **** mixed cmd(string args) { string primary, secondary; mixed tmp; ! if( !archp(previous_object()) ) return 0; if( !args || args == "" ) return "Unlink whom from whom?"; if( sscanf(args, "%s from %s", secondary, primary) != 2 ) ! return "Unlink whom from whom?"; tmp = (mixed)CHARACTER_D->eventUnlink(primary, secondary); if( !tmp ) return "Unlink failed."; else if( tmp == 1 ){ --- 12,22 ---- mixed cmd(string args) { string primary, secondary; mixed tmp; ! if( !archp(previous_object()) ) return 0; if( !args || args == "" ) return "Unlink whom from whom?"; if( sscanf(args, "%s from %s", secondary, primary) != 2 ) ! return "Unlink whom from whom?"; tmp = (mixed)CHARACTER_D->eventUnlink(primary, secondary); if( !tmp ) return "Unlink failed."; else if( tmp == 1 ){ *************** *** 28,36 **** string GetHelp(string str) { return ("Syntax: <unlink CHARACTER from PRIMARY>\n\n" ! "Unlinks the named primary or secondary player from its " ! "primary character. If the player you are unlinking is " ! "is itself a primary and has more than two secondaries, the " ! "first secondary will become a primary. Otherwise the entire " ! "link will be removed.\n\n"); } --- 28,36 ---- string GetHelp(string str) { return ("Syntax: <unlink CHARACTER from PRIMARY>\n\n" ! "Unlinks the named primary or secondary player from its " ! "primary character. If the player you are unlinking is " ! "is itself a primary and has more than two secondaries, the " ! "first secondary will become a primary. Otherwise the entire " ! "link will be removed.\n\n"); } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/unmonitor.c ds2.0r27/lib/secure/cmds/admins/unmonitor.c *** ds1.1/lib/secure/cmds/admins/unmonitor.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cmds/admins/unmonitor.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,34 ---- + #include <lib.h> + #include <daemons.h> + + inherit LIB_DAEMON; + + int cmd(string str) { + object ob; + + if(!archp(previous_object())) { + write("Only an arch may halt a monitoring process."); + return 0; + } + if( !str || str == "" ) { + write("Unmonitor whom?\n"); + } + else if(!user_exists(str)) + write(str+": no such player.\n"); + else{ + SNOOP_D->RemoveMonitor(this_player(), str); + write("The snoop daemon has received your request."); + } + return 1; + } + + int help() + { + write( @EndText + Syntax: unmonitor <user> + Effect: Stops the logging of a user's input and output. + See also: monitor, snoop, unsnoop + EndText + ); + return 1; + } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/unregister.c ds2.0r27/lib/secure/cmds/admins/unregister.c *** ds1.1/lib/secure/cmds/admins/unregister.c Sun Feb 1 21:30:30 1998 --- ds2.0r27/lib/secure/cmds/admins/unregister.c Wed Jul 5 00:01:12 2006 *************** *** 11,22 **** int cmd(string str) { if(!member_group(previous_object(), "SECURE")) { ! if(!member_group(previous_object(), "LAW")) return 0; } if(!str) return 0; if(member_array(str, (string *)BANISH_D->query_registered()) == -1) { ! write("That site is not on the list of sites needing to register.\n"); ! return 1; } BANISH_D->unregister_site(str); log_file("watch/register", (string)previous_object()->GetKeyName()+ --- 11,22 ---- int cmd(string str) { if(!member_group(previous_object(), "SECURE")) { ! if(!member_group(previous_object(), "LAW")) return 0; } if(!str) return 0; if(member_array(str, (string *)BANISH_D->query_registered()) == -1) { ! write("That site is not on the list of sites needing to register.\n"); ! return 1; } BANISH_D->unregister_site(str); log_file("watch/register", (string)previous_object()->GetKeyName()+ diff -c -r --new-file ds1.1/lib/secure/cmds/admins/unrid.c ds2.0r27/lib/secure/cmds/admins/unrid.c *** ds1.1/lib/secure/cmds/admins/unrid.c Sun Feb 1 21:30:31 1998 --- ds2.0r27/lib/secure/cmds/admins/unrid.c Wed Jul 5 00:01:12 2006 *************** *** 8,35 **** inherit LIB_DAEMON; mixed cmd(string str) { ! string file, dest; if( !sizeof(str) ) return "Unrid whom?"; str = convert_name(str); file = DIR_RID + "/" + str + __SAVE_EXTENSION__; if( !file_exists(file) ) ! return (file + ": file not found. Cannot unrid."); if( rename(file, save_file(str) + __SAVE_EXTENSION__) ) { ! this_player()->eventPrint("Unrid failed, security " ! "violation logged."); ! log_file("security", "\n**** Unrid violation attempted\n" ! "Target: " + file + "\nCall Stack: " + ! sprintf("%O", previous_object(-1))); ! return 1; } this_player()->eventPrint("Unrid successful."); return 1; } string GetHelp(string str) { return "Syntax: unrid <user name>\n\n" ! "This command restores a character that was " ! "banished via the \"rid\" command."; } --- 8,37 ---- inherit LIB_DAEMON; mixed cmd(string str) { ! string file; + if(!archp(previous_object())) return 0; if( !sizeof(str) ) return "Unrid whom?"; str = convert_name(str); file = DIR_RID + "/" + str + __SAVE_EXTENSION__; if( !file_exists(file) ) ! return (file + ": file not found. Cannot unrid."); if( rename(file, save_file(str) + __SAVE_EXTENSION__) ) { ! this_player()->eventPrint("Unrid failed, security " ! "violation logged."); ! log_file("security", "\n**** Unrid violation attempted\n" ! "Target: " + file + "\nCall Stack: " + ! sprintf("%O", previous_object(-1))); ! return 1; } this_player()->eventPrint("Unrid successful."); + PLAYER_D->AddPlayerInfo(str); return 1; } string GetHelp(string str) { return "Syntax: unrid <user name>\n\n" ! "This command restores a character that was " ! "banished via the \"rid\" command."; } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/unwatch.c ds2.0r27/lib/secure/cmds/admins/unwatch.c *** ds1.1/lib/secure/cmds/admins/unwatch.c Sun Feb 1 21:30:30 1998 --- ds2.0r27/lib/secure/cmds/admins/unwatch.c Wed Jul 5 00:01:12 2006 *************** *** 6,24 **** int cmd(string str) { string which, nom; if(!str) { ! notify_fail("Unwatch which name or site?\n"); ! return 0; } if(sscanf(str, "%s %s", which, nom) != 2) { ! notify_fail("Correct syntax: <unwatch [name|site] [ip or name]>\n"); ! return 0; } if(which == "name") BANISH_D->unwatch_name(nom); else if(which == "site") BANISH_D->unwatch_site(nom); else { ! notify_fail("Undefined unwatch type: "+str+"\n"); ! return 0; } message("info", nom+" is now an unwatched "+which, this_player()); return 1; --- 6,25 ---- int cmd(string str) { string which, nom; + if(!archp(previous_object())) return 0; if(!str) { ! notify_fail("Unwatch which name or site?\n"); ! return 0; } if(sscanf(str, "%s %s", which, nom) != 2) { ! notify_fail("Correct syntax: <unwatch [name|site] [ip or name]>\n"); ! return 0; } if(which == "name") BANISH_D->unwatch_name(nom); else if(which == "site") BANISH_D->unwatch_site(nom); else { ! notify_fail("Undefined unwatch type: "+str+"\n"); ! return 0; } message("info", nom+" is now an unwatched "+which, this_player()); return 1; *************** *** 26,35 **** void help() { message("help", ! "Syntax: <unwatch [site|name] [ip or site to be unwatched]>\n\n" ! "Sets it up so that whenever a player of a certain name, or " ! "a player from a certain site logs in it will get logged. " ! "Examples: unwatch name forlock unwatch site 134.181.*\n\n" ! "See also: watch, whowatched", this_player() ); } --- 27,36 ---- void help() { message("help", ! "Syntax: <unwatch [site|name] [ip or site to be unwatched]>\n\n" ! "Sets it up so that whenever a player of a certain name, or " ! "a player from a certain site logs in it will get logged. " ! "Examples: unwatch name forlock unwatch site 134.181.*\n\n" ! "See also: watch, whowatched", this_player() ); } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/usage.c ds2.0r27/lib/secure/cmds/admins/usage.c *** ds1.1/lib/secure/cmds/admins/usage.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cmds/admins/usage.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,27 ---- + + #include <lib.h> + + inherit LIB_DAEMON; + + mixed cmd(string str) { + mapping info; + string *cles; + string ret; + float x, fraction; + + if(!archp(previous_object())) return 0; + info = rusage(); + cles = keys(info); + + foreach(string schlussel in cles){ + write(schlussel + ": "+info[schlussel]); + } + + x = (info["utime"] + info["stime"])/1000; + fraction = x / uptime(); + ret = sprintf("\nsingle CPU usage: %2.2f%%\n", fraction * 100); + return ret; + + } + + diff -c -r --new-file ds1.1/lib/secure/cmds/admins/watch.c ds2.0r27/lib/secure/cmds/admins/watch.c *** ds1.1/lib/secure/cmds/admins/watch.c Sun Feb 1 21:30:31 1998 --- ds2.0r27/lib/secure/cmds/admins/watch.c Wed Jul 5 00:01:12 2006 *************** *** 6,24 **** int cmd(string str) { string which, nom; if(!str) { ! notify_fail("Watch which name or site?\n"); ! return 0; } if(sscanf(str, "%s %s", which, nom) != 2) { ! notify_fail("Correct syntax: <watch [name|site] [ip or name]>\n"); ! return 0; } if(which == "name") BANISH_D->watch_name(nom); else if(which == "site") BANISH_D->watch_site(nom); else { ! notify_fail("Undefined watch type: "+str+"\n"); ! return 0; } message("info", nom+" is now an watched "+which, this_player()); return 1; --- 6,25 ---- int cmd(string str) { string which, nom; + if(!archp(previous_object())) return 0; if(!str) { ! notify_fail("Watch which name or site?\n"); ! return 0; } if(sscanf(str, "%s %s", which, nom) != 2) { ! notify_fail("Correct syntax: <watch [name|site] [ip or name]>\n"); ! return 0; } if(which == "name") BANISH_D->watch_name(nom); else if(which == "site") BANISH_D->watch_site(nom); else { ! notify_fail("Undefined watch type: "+str+"\n"); ! return 0; } message("info", nom+" is now an watched "+which, this_player()); return 1; *************** *** 26,35 **** void help() { message("help", ! "Syntax: <watch [site|name] [ip or site to be watched]>\n\n" ! "Sets it up so that whenever a player of a certain name, or " ! "a player from a certain site logs in it will get logged. " ! "Examples: watch name forlock watch site 134.181.*\n\n" ! "See also: unwatch, whowatched", this_player() ); } --- 27,36 ---- void help() { message("help", ! "Syntax: <watch [site|name] [ip or site to be watched]>\n\n" ! "Sets it up so that whenever a player of a certain name, or " ! "a player from a certain site logs in it will get logged. " ! "Examples: watch name forlock watch site 134.181.*\n\n" ! "See also: unwatch, whowatched", this_player() ); } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/whoallowed.c ds2.0r27/lib/secure/cmds/admins/whoallowed.c *** ds1.1/lib/secure/cmds/admins/whoallowed.c Sun Feb 1 21:30:31 1998 --- ds2.0r27/lib/secure/cmds/admins/whoallowed.c Wed Jul 5 00:01:12 2006 *************** *** 14,30 **** if(!archp(previous_object())) return 0; if(!sizeof(noms = (string *)BANISH_D->query_allowed())) { ! write("No one is currently allowed to login from a restricted site.\n"); ! return 1; } if(str) { ! if(member_array(lower_case(str), noms) != -1) ! write("You have already allowed "+capitalize(str)+" in.\n"); ! else write("That name is not currently setup for registration login.\n"); } else { ! write("These names may be used by people from restricted sites:\n"); ! write(format_page(noms, 5)+"\n"); } return 1; } --- 14,30 ---- if(!archp(previous_object())) return 0; if(!sizeof(noms = (string *)BANISH_D->query_allowed())) { ! write("No one is currently allowed to login from a restricted site.\n"); ! return 1; } if(str) { ! if(member_array(lower_case(str), noms) != -1) ! write("You have already allowed "+capitalize(str)+" in.\n"); ! else write("That name is not currently setup for registration login.\n"); } else { ! write("These names may be used by people from restricted sites:\n"); ! write(format_page(noms, 5)+"\n"); } return 1; } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/whobanished.c ds2.0r27/lib/secure/cmds/admins/whobanished.c *** ds1.1/lib/secure/cmds/admins/whobanished.c Sun Feb 1 21:30:31 1998 --- ds2.0r27/lib/secure/cmds/admins/whobanished.c Wed Jul 5 00:01:12 2006 *************** *** 14,26 **** if(!archp(previous_object())) return 0; noms = (string *)BANISH_D->query_banished(); if(str) { ! if(member_array(lower_case(str), noms) == -1) ! write(str+" is not currently a banished name.\n"); ! else write(str+" is a banished name.\n"); } else { ! write("These names are currently banished:\n"); ! this_player()->more(explode(format_page(noms, 4), "\n")); } return 1; } --- 14,26 ---- if(!archp(previous_object())) return 0; noms = (string *)BANISH_D->query_banished(); if(str) { ! if(member_array(lower_case(str), noms) == -1) ! write(str+" is not currently a banished name.\n"); ! else write(str+" is a banished name.\n"); } else { ! write("These names are currently banished:\n"); ! this_player()->more(explode(format_page(noms, 4), "\n")); } return 1; } diff -c -r --new-file ds1.1/lib/secure/cmds/admins/whoguests.c ds2.0r27/lib/secure/cmds/admins/whoguests.c *** ds1.1/lib/secure/cmds/admins/whoguests.c Sun Feb 1 21:30:31 1998 --- ds2.0r27/lib/secure/cmds/admins/whoguests.c Wed Jul 5 00:01:12 2006 *************** *** 13,20 **** if(!archp(previous_object())) return 0; if(str) { ! notify_fail("Correct syntax: whoguests\n"); ! return 0; } catch(guests = (string *)BANISH_D->query_guests()); message("info", "The following people are currently allowed in when " --- 13,20 ---- if(!archp(previous_object())) return 0; if(str) { ! notify_fail("Correct syntax: whoguests\n"); ! return 0; } catch(guests = (string *)BANISH_D->query_guests()); message("info", "The following people are currently allowed in when " diff -c -r --new-file ds1.1/lib/secure/cmds/admins/whoregistered.c ds2.0r27/lib/secure/cmds/admins/whoregistered.c *** ds1.1/lib/secure/cmds/admins/whoregistered.c Sun Feb 1 21:30:31 1998 --- ds2.0r27/lib/secure/cmds/admins/whoregistered.c Wed Jul 5 00:01:12 2006 *************** *** 9,26 **** if(!archp(previous_object())) return 0; if(res=catch(sites = (string *)call_other(BANISH_D, "query_registered"))) { ! write("Error in checking sites: "+res+"\n"); ! return 1; } sites = sort_array(sites, "order_sites", this_object()); if(str) { ! if(member_array(str, sites) == -1) ! write("Site \""+str+"\" is not currently on registration.\n"); ! else write("Site \""+str+"\" is currently on registration.\n"); } else { ! write("These sites must currently registered in order to get characters:\n"); ! this_player()->more(explode(format_page(sites, 5), "\n")); } return 1; } --- 9,26 ---- if(!archp(previous_object())) return 0; if(res=catch(sites = (string *)call_other(BANISH_D, "query_registered"))) { ! write("Error in checking sites: "+res+"\n"); ! return 1; } sites = sort_array(sites, "order_sites", this_object()); if(str) { ! if(member_array(str, sites) == -1) ! write("Site \""+str+"\" is not currently on registration.\n"); ! else write("Site \""+str+"\" is currently on registration.\n"); } else { ! write("These sites must currently registered in order to get characters:\n"); ! this_player()->more(explode(format_page(sites, 5), "\n")); } return 1; } *************** *** 32,41 **** a = explode(alpha, "."); b = explode(beta, "."); for(i=0; i<sizeof(a) && i<sizeof(b); i++) { ! if(!(x = to_int(a[i]))) return -1; ! if(!(y = to_int(b[i]))) return 1; ! if(x > y) return 1; ! if(y > x) return -1; } if(sizeof(a) < sizeof(b)) return -1; else return (sizeof(a) > sizeof(b)); --- 32,41 ---- a = explode(alpha, "."); b = explode(beta, "."); for(i=0; i<sizeof(a) && i<sizeof(b); i++) { ! if(!(x = to_int(a[i]))) return -1; ! if(!(y = to_int(b[i]))) return 1; ! if(x > y) return 1; ! if(y > x) return -1; } if(sizeof(a) < sizeof(b)) return -1; else return (sizeof(a) > sizeof(b)); diff -c -r --new-file ds1.1/lib/secure/cmds/admins/whowatched.c ds2.0r27/lib/secure/cmds/admins/whowatched.c *** ds1.1/lib/secure/cmds/admins/whowatched.c Sun Feb 1 21:30:31 1998 --- ds2.0r27/lib/secure/cmds/admins/whowatched.c Wed Jul 5 00:01:12 2006 *************** *** 7,21 **** string *who; if(!str) { ! notify_fail("Check site or name?\n"); ! return 0; } if(!archp(previous_object())) return 0; if(str == "name") who = (string *)BANISH_D->query_watched_names(); else if(str == "site") who = (string *)BANISH_D->query_watched_sites(); else { ! notify_fail("Whowatched what?\n"); ! return 0; } message("info", sprintf("These %ss are being watched:", str),this_player()); this_player()->more(explode(format_page(who, 5), "\n")); --- 7,21 ---- string *who; if(!str) { ! notify_fail("Check site or name?\n"); ! return 0; } if(!archp(previous_object())) return 0; if(str == "name") who = (string *)BANISH_D->query_watched_names(); else if(str == "site") who = (string *)BANISH_D->query_watched_sites(); else { ! notify_fail("Whowatched what?\n"); ! return 0; } message("info", sprintf("These %ss are being watched:", str),this_player()); this_player()->more(explode(format_page(who, 5), "\n")); diff -c -r --new-file ds1.1/lib/secure/cmds/creators/about.c ds2.0r27/lib/secure/cmds/creators/about.c *** ds1.1/lib/secure/cmds/creators/about.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cmds/creators/about.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,43 ---- + /* /secure/cmds/creator/about.c + * Based on Descartes' <more> + * Created by Magnafix 9-8-96 + */ + + #include <lib.h> + #include <message_class.h> + #include "include/more.h" + + inherit LIB_DAEMON; + + mixed cmd(string str) { + object thing; + string name, tmp; + if( !str || str == "" ) return "Syntax: <about OBJECT>"; + if(!present(str, this_player()) && str != "here" && + !present(str, environment(this_player()))) + return notify_fail("You don't see that.\n"); + if(str == "here") thing = environment(this_player()); + else thing = present( str, this_player()); + if(!thing) thing = present(str, environment(this_player())); + if(thing->GetDoor()) thing = load_object(thing->GetDoor()); + if(!thing) return notify_fail("Uh oh, error.\n"); + if(interactive(thing)){ + message( "info","Players do not have files with LPC code. " + "Player save files are not subject to examination with this command.", + this_player()); + return 1; + } + name = base_name(thing) + ".c"; + message( "info", name + "\n", this_player() ); + return (mixed)this_player()->eventPage(name, MSG_SYSTEM | MSG_NOCOLOUR); + } + + string GetHelp(string str) { + return ("Syntax: <about OBJECT>\n\n" + "Pages through the file referenced by the file name of " + "the object that you name. OBJECT can either be in " + "your inventory or in the room.\nWhile inside the pager, you " + "have access to the following commands:\n" + + (string)LIB_PAGER->GetHelp("pager") + "\n\n" + "See also: cat, ed, head, tail"); + } diff -c -r --new-file ds1.1/lib/secure/cmds/creators/banish.c ds2.0r27/lib/secure/cmds/creators/banish.c *** ds1.1/lib/secure/cmds/creators/banish.c Sun Feb 1 21:30:34 1998 --- ds2.0r27/lib/secure/cmds/creators/banish.c Wed Dec 31 19:00:00 1969 *************** *** 1,34 **** - // /bin/dev/_banish.c - // from the Dead Souls Mudlib - // prevents a name being used by a new player - // created by Descartes of Borg ??? - - #include <lib.h> - #include <daemons.h> - - inherit LIB_DAEMON; - - int cmd(string str) { - if(!user_exists(str = lower_case(str))) { - write(capitalize(str)+" is now banished.\n"); - //seteuid(UID_BANISH); - catch(call_other(BANISH_D, "banish_name", str)); - //seteuid(getuid()); - } - else { - write("A player by that name already exists.\n"); - this_player()->eventPrint((string)FINGER_D->GetFinger(str)); - } - return 1; - } - - void help() { - write("Syntax: <banish [name]>\n\n" - "Protects a name from being used by a new player.\n" - "For example, if you have created a monster named Cassandra, in order\n" - "to avoid problems with player complaining \"I typed 'kill\n" - "cassandra' meaning to kill the evil enchantress, but Cassandra\n" - "walked in and I accidentally killed her.\" It is also to be\n" - "used to keep people from using offensive names.\n" - ); - } --- 0 ---- diff -c -r --new-file ds1.1/lib/secure/cmds/creators/bk.c ds2.0r27/lib/secure/cmds/creators/bk.c *** ds1.1/lib/secure/cmds/creators/bk.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cmds/creators/bk.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,48 ---- + #include <lib.h> + #include <dirs.h> + + inherit LIB_DAEMON; + + mixed cmd(string str) { + string *arr; + string *file_arr; + string tmp, filename, str2, orig; + int time; + object ob; + + orig = str; + if( !str ) return "You must specify a file to backup."; + else str = absolute_path((string)this_player()->query_cwd(), str); + if( !file_exists(str) ) str2 = str+".c"; + if( !file_exists(str) && !file_exists(str2)) { + if(str == "here" || str == "room") ob = environment(this_player()); + else { + ob = present(orig,environment(this_player())); + if(!ob) ob = present(orig, this_player()); + if(!ob) return "File not found."; + } + str2 = base_name(ob)+".c"; + } + if(str2 && !file_exists(str2)) return "File unfound."; + else if(str2) str = str2; + if( !(tmp = read_file(str)) ) + return "Unable to read file " + str + "."; + + else { + time = time(); + file_arr = explode(str,"/"); + filename = REALMS_DIRS + "/" + this_player()->GetKeyName(); + filename += "/bak/"+file_arr[sizeof(file_arr)-1]+"."+time; + write_file(REALMS_DIRS + "/" + this_player()->GetKeyName()+ + "/bak/bk.db",file_arr[sizeof(file_arr)-1]+"."+time+" : "+str+"\n"); + load_object("/secure/cmds/creators/cp")->cmd(str + " " +filename); + } + return 1; + } + + int help() { + message("help", "Syntax: <bk [file]>\n\n" + "Copies the specified file into your bak/ directory, and " + "appends a unique identifying number to the backup file name.", + this_player()); + } diff -c -r --new-file ds1.1/lib/secure/cmds/creators/call.c ds2.0r27/lib/secure/cmds/creators/call.c *** ds1.1/lib/secure/cmds/creators/call.c Sun Feb 1 21:30:32 1998 --- ds2.0r27/lib/secure/cmds/creators/call.c Wed Jul 5 00:01:12 2006 *************** *** 19,50 **** int i, maxi; if(!member_group(previous_object(), PRIV_SECURE)) { ! log_file("adm/call", query_privs(previous_object()) ! +" ("+ctime(time())+"): call "+args+"\n"); } if( !args || args == "" ) return "Call ob->func(arg1, arg2)\n"; if( sscanf(args, "%s->%s(%s", arg_targ, arg_func, args) != 3 ) ! return "Call ob->func(arg1, arg2)\n"; args = trim(args); if( args != ")" ) args = args[0..<2]; else args = ""; if( !(target = to_object(arg_targ)) ) ! return "Cannot identify any object as \"" + arg_targ + "\"."; if( !function_exists(arg_func, target) ) ! return "The function " + arg_func +"() is not in " + identify(target) + "\n"; f = (: call_other, target, arg_func :); if( args == "" ) { err = catch(val = evaluate(f)); if( err) { message("error", identify(target) + " -> " + arg_func + "()", ! this_player()); message("error", "Error in execution: " + err, this_player()); return 1; } else { message("system", identify(target) + " -> " + arg_func + "() = " + ! identify(val), this_player()); return 1; } } --- 19,50 ---- int i, maxi; if(!member_group(previous_object(), PRIV_SECURE)) { ! log_file("adm/call", query_privs(previous_object()) ! +" ("+ctime(time())+"): call "+args+"\n"); } if( !args || args == "" ) return "Call ob->func(arg1, arg2)\n"; if( sscanf(args, "%s->%s(%s", arg_targ, arg_func, args) != 3 ) ! return "Call ob->func(arg1, arg2)\n"; args = trim(args); if( args != ")" ) args = args[0..<2]; else args = ""; if( !(target = to_object(arg_targ)) ) ! return "Cannot identify any object as \"" + arg_targ + "\"."; if( !function_exists(arg_func, target) ) ! return "The function " + arg_func +"() is not in " + identify(target) + "\n"; f = (: call_other, target, arg_func :); if( args == "" ) { err = catch(val = evaluate(f)); if( err) { message("error", identify(target) + " -> " + arg_func + "()", ! this_player()); message("error", "Error in execution: " + err, this_player()); return 1; } else { message("system", identify(target) + " -> " + arg_func + "() = " + ! identify(val), this_player()); return 1; } } *************** *** 67,78 **** void help() { message("help", "Syntax: <call [object]->[function](([args]))>\n\n" ! "Examples:\n\tcall me->GetName()\n" ! "\tcall \"/realms/descartes/workroom\"->GetProperty(\"light\")\n\n" ! "Allows you to call any function in any object with any set of " ! "arguments from the command line. The syntax is identical to " ! "that you would use inside LPC code, except that you can refer " ! "to objects by their names or by pronouns in addition to the " ! "usual manners.\n\n" ! "See also: eval, gauge", this_player()); } --- 67,78 ---- void help() { message("help", "Syntax: <call [object]->[function](([args]))>\n\n" ! "Examples:\n\tcall me->GetName()\n" ! "\tcall \"/realms/descartes/workroom\"->GetProperty(\"light\")\n\n" ! "Allows you to call any function in any object with any set of " ! "arguments from the command line. The syntax is identical to " ! "that you would use inside LPC code, except that you can refer " ! "to objects by their names or by pronouns in addition to the " ! "usual manners.\n\n" ! "See also: eval, gauge", this_player()); } diff -c -r --new-file ds1.1/lib/secure/cmds/creators/cat.c ds2.0r27/lib/secure/cmds/creators/cat.c *** ds1.1/lib/secure/cmds/creators/cat.c Sun Feb 1 21:30:36 1998 --- ds2.0r27/lib/secure/cmds/creators/cat.c Wed Jul 5 00:01:12 2006 *************** *** 17,25 **** else str = absolute_path((string)this_player()->query_cwd(), str); if( !file_exists(str) ) return "File " + str + " not found."; else if( !(tmp = read_file(str)) ) ! return "Unable to read file " + str + "."; if( sizeof(arr = explode(tmp, "\n")) > 100 ) ! tmp = implode(arr[0..99], "\n") + "\n\t*** TRUNCATED ***"; message("system", tmp, this_player()); return 1; } --- 17,25 ---- else str = absolute_path((string)this_player()->query_cwd(), str); if( !file_exists(str) ) return "File " + str + " not found."; else if( !(tmp = read_file(str)) ) ! return "Unable to read file " + str + "."; if( sizeof(arr = explode(tmp, "\n")) > 100 ) ! tmp = implode(arr[0..99], "\n") + "\n\t*** TRUNCATED ***"; message("system", tmp, this_player()); return 1; } diff -c -r --new-file ds1.1/lib/secure/cmds/creators/changelog.c ds2.0r27/lib/secure/cmds/creators/changelog.c *** ds1.1/lib/secure/cmds/creators/changelog.c Sun Feb 1 21:30:37 1998 --- ds2.0r27/lib/secure/cmds/creators/changelog.c Wed Jul 5 00:01:12 2006 *************** *** 24,37 **** str = absolute_path((string)this_player()->get_path(), str); if(file_size(str) == -1) return notify_fail("Invalid path.\n"); if(file_size(file = str) != -2) { ! i = sizeof(tmp = explode(str, "/")); ! if(i < 2) str = "/"; ! else str = "/"+implode(tmp[0..i-2], "/"); } if(str[strlen(str)-1] != '/') str += "/"; str += CHANGELOG; message("system", "Logging changes to "+str+"...", this_player()); ! this_player()->eventEdit(TMP_FILE, (: post_change, ({ file, str }) :)); return 1; } --- 24,37 ---- str = absolute_path((string)this_player()->get_path(), str); if(file_size(str) == -1) return notify_fail("Invalid path.\n"); if(file_size(file = str) != -2) { ! i = sizeof(tmp = explode(str, "/")); ! if(i < 2) str = "/"; ! else str = "/"+implode(tmp[0..i-2], "/"); } if(str[strlen(str)-1] != '/') str += "/"; str += CHANGELOG; message("system", "Logging changes to "+str+"...", this_player()); ! this_player()->eventEdit(TMP_FILE, (: post_change, ({ file, str }) :)); return 1; } *************** *** 52,58 **** maxi = sizeof(tmp = explode(wrap(str, 60), "\n")); str = "- "+ change+"\n"; str += " "+ctime(time())+" by "+(string)previous_object()->GetCapName()+ ! "("+(string)previous_object()->query_rname()+"):\n"; for(i=0; i<maxi; i++) str += " * "+tmp[i]+"\n"; if(str2 = read_file(file)) str2 = str+"\n\n"+str2; else str2 = str; --- 52,58 ---- maxi = sizeof(tmp = explode(wrap(str, 60), "\n")); str = "- "+ change+"\n"; str += " "+ctime(time())+" by "+(string)previous_object()->GetCapName()+ ! "("+(string)previous_object()->query_rname()+"):\n"; for(i=0; i<maxi; i++) str += " * "+tmp[i]+"\n"; if(str2 = read_file(file)) str2 = str+"\n\n"+str2; else str2 = str; *************** *** 66,74 **** void help() { message( "help", ! "Syntax: changelog <directory>\n" ! "Lets you enter documentation on changes you have made to files in " ! "directory <directory>\n" ! , this_player() ); } --- 66,74 ---- void help() { message( "help", ! "Syntax: changelog <directory>\n" ! "Lets you enter documentation on changes you have made to files in " ! "directory <directory>\n" ! , this_player() ); } diff -c -r --new-file ds1.1/lib/secure/cmds/creators/codefor.c ds2.0r27/lib/secure/cmds/creators/codefor.c *** ds1.1/lib/secure/cmds/creators/codefor.c Sun Feb 1 21:30:37 1998 --- ds2.0r27/lib/secure/cmds/creators/codefor.c Wed Dec 31 19:00:00 1969 *************** *** 1,36 **** - // /bin/dev/_codefor.c - - #include <lib.h> - inherit LIB_DAEMON; - - #define SYNTAX "Syntax: \"codefor <lpc commands>\".\n" - - int cmd( string a ) - { - string file, filename; - mixed err, ret; - string path; - - if( !a ) { notify_fail( SYNTAX ); return 0; } - file = "mixed eval() { " + a + "; }\n"; - path = user_path(lower_case(this_player()->GetName())); - if( file_size( path ) != -2 ) - path = "/open/" +lower_case(this_player()->GetName()); - filename = path +"CMD_EVAL_TMP_FILE.c"; - rm( filename ); - if( ret = find_object( filename ) ) destruct( ret ); - write_file( filename, file ); - if( err = catch( (mixed)call_other( filename, "???" ) ) ) - write( "Error = " + err ); - else - ret = find_object(filename); - dump_prog(ret, 1, "/tmp/CODE_TMP_FILE"); - ret = read_file( "/tmp/CODE_TMP_FILE"); - rm("/tmp/CODE_TMP_FILE"); - rm( filename ); - - ret = explode(ret, ";;; *** Disassembly ***"); - write(ret[1]); - return 1; - } - --- 0 ---- diff -c -r --new-file ds1.1/lib/secure/cmds/creators/cp.c ds2.0r27/lib/secure/cmds/creators/cp.c *** ds1.1/lib/secure/cmds/creators/cp.c Sun Feb 1 21:30:37 1998 --- ds2.0r27/lib/secure/cmds/creators/cp.c Wed Jul 5 00:01:12 2006 *************** *** 6,11 **** --- 6,12 ---- // Help added by Brian (1/28/92) // Single arg cp added by Scythe@Dead Souls (1/25/93) // Bug in single arg cp fixed by Pallando (5/26/93) + // Added wild card support by Brodbane@Eve (4/3/06) */ #include <lib.h> *************** *** 13,125 **** int help(); ! int ! cmd(string str) { string line; string file1; string file2; int localdest; if(this_player()->GetForced()) { ! write("Someone has tried forcing you to cp " + str); ! return 1; } localdest = 0; /* Assume it's not a local destination */ if (!str || sscanf(str, "%s %s", file1, file2) != 2) { ! if (str && sscanf(str, "%s", file1)) { ! file2 = ""; // Check to see if it's a one arg ! localdest = 1; // cp function. Assume localdest. ! } else { ! help(); ! return 1; ! } } /* check for last parameter == "." */ if (file2 == ".") { ! localdest = 1; /* It's a local destination */ ! file2 = ""; } /* Given the player's current working directory and the path(s) for the file, construct the new full path for both files */ file1 = absolute_path(this_player()->query_cwd(), file1); file2 = absolute_path(this_player()->query_cwd(), file2); ! /* This used to give and lstat error, fixed 930208 by Plura */ ! if(file_size(file1) < 1) ! { ! notify_fail("cp: couldn't find "+file1+"\n"); ! return 0; ! } ! ! /* Check if the destination is a directory */ ! if (!localdest) { ! if (file_size(file2) == -2) ! localdest = 1; ! } ! if (localdest) { ! /* Extract the root file name from the source and use ! it for the destination. file2 should be just a ! directory path at this point so that the rootname can ! be appended. */ ! string newroot; ! string path; ! string rootname; ! rootname = file1; ! while(sscanf(rootname, "%s/%s", path, newroot) == 2) { ! rootname = newroot; ! } ! file2 = file2 + "/" + rootname; ! } ! if(file_size(file1) == -2) /*Plura 930120*/ ! { ! notify_fail("cp: "+file1+" is a directory.\n"); ! return 0; ! } ! #if 0 ! if(file_size(file2) > 0) /* Plura 930120 */ ! { ! notify_fail("cp: "+file2+" already exists.\n"); ! return 0; ! } ! #endif ! if (file1 == file2) { ! notify_fail("cp: can not copy a file on top of itself!\n"); ! return 0; ! } ! if(!master()->valid_read(file1, this_player(), "cp")) ! { ! notify_fail(file1 + ": Permission denied.\n"); ! return 0; ! } ! if(!master()->valid_write(file2, this_player(), "cp")) ! { ! notify_fail(file2 + ": Permission denied.\n"); ! return 0; ! } ! line = read_file(file1); ! if (line == 0) { ! /* Uhoh. Can't read source file. */ ! notify_fail("cp: file not found: " + file1 + "\n"); ! return 0; ! } ! if (file_size(file2) == -2) { ! notify_fail("Tried to overwrite the directory "+ file2 + "\n"); ! return 0; ! } ! rm(file2); ! write_file(file2, line); ! message("system", "Copied: " + file1 + " to " + file2, this_player()); ! return 1; } int help() { ! message("help", "Command: cp\nSyntax: cp <oldfile> [pathname]<newfile>\n" ! "This command makes a copy of the file using the new name " ! "and location passed. If a new pathname is not specified " ! "then the copy is put into the present working directory.", ! this_player()); ! return 1; } /* EOF */ --- 14,108 ---- int help(); ! string rmSlash(string str) { return replace_string(str,"//","/"); } ! ! int cmd(string str) { string line; string file1; string file2; int localdest; + string * files; + int ow; + if(this_player()->GetForced()) { ! write("Someone has tried forcing you to cp " + str); ! return 1; } localdest = 0; /* Assume it's not a local destination */ if (!str || sscanf(str, "%s %s", file1, file2) != 2) { ! if (str && sscanf(str, "%s", file1)) { ! file2 = ""; // Check to see if it's a one arg ! localdest = 1; // cp function. Assume localdest. ! } else { ! help(); ! return 1; ! } } + + if( str && sscanf( str, "-o %s", str)) ow = 1; /* check for last parameter == "." */ if (file2 == ".") { ! localdest = 1; /* It's a local destination */ ! file2 = ""; } /* Given the player's current working directory and the path(s) for the file, construct the new full path for both files */ file1 = absolute_path(this_player()->query_cwd(), file1); file2 = absolute_path(this_player()->query_cwd(), file2); ! /* Added by Brodbane to handle wild card options, 3/3/06 */ ! if( !sizeof( files = wild_card( file1 ) ) ) ! files = ({ file1 }); ! if( sizeof(files) > 1 ) { ! switch( file_size(file2) ) ! { ! case -1: ! this_player()->eventForce("mkdir "+file2); ! break; ! case -2: ! break; ! default: ! return(write("Cannot copy wild card to a single file."),1); ! } ! } ! ! foreach( string file in files ) { ! string dest = (file_size(file2)==-2 ? rmSlash(file2+"/"+ ! explode( file, "/")[<1]) : file2 ); ! ! ! if( file_size( file ) == -2 ) { ! localdest = 1; ! if( sizeof(files) > 1 ) ! continue; ! else write( "cp: "+file+" is a directory." ); ! } ! else if( file_size(file) < 1 ) { write( "cp: couldn't find "+file ); } ! else if( file == dest ) write( "cp: You cant copy a file on to itself!" ); ! else if( file_size(dest) > 0 && !ow && !sscanf(dest, "%*s.save" )) write( "cp: "+dest+" already exists." ); ! else if( !master()->valid_read( file, this_player(), "cp" ) ) write( file+": Permission denied." ); ! else if( !master()->valid_write( dest, this_player(), "cp" ) ) write( dest+": Permission denied." ); ! else { ! write_file( dest, read_file(file), 1 ); ! write( "Copied: "+file+" to "+dest ); ! } ! } ! return 1; } + int help() { ! message("help", "Command: cp\nSyntax: cp <oldfile> [pathname]<newfile>\n" ! "This command makes a copy of the file using the new name " ! "and location passed. If a new pathname is not specified " ! "then the copy is put into the present working directory." ! "Optionally, wild cards can be used by employing the * operator.", ! this_player()); ! return 1; } /* EOF */ + + diff -c -r --new-file ds1.1/lib/secure/cmds/creators/create.c ds2.0r27/lib/secure/cmds/creators/create.c *** ds1.1/lib/secure/cmds/creators/create.c Sun Feb 1 21:30:37 1998 --- ds2.0r27/lib/secure/cmds/creators/create.c Wed Jul 5 00:01:12 2006 *************** *** 1,48 **** - /* /secure/cmds/creators/create.c - * from the Dead Soulsr2.2 Object Library - * create WRD WRD STR - * created by Descartes of Borg 951202 - */ - #include <lib.h> ! #include <objects.h> ! #include "include/create.h" ! mixed cmd(string args) { ! string file, cmd, tmp; ! ! if( !args || args == "" ) return "Create in which file what?"; ! if( sscanf(args, "%s %s %s", file, cmd, tmp) != 3 ) { ! if( sscanf(args, "%s %s", file, cmd) != 2 ) ! return "Create in which file what?"; ! else args = 0; ! } ! file = absolute_path((string)this_player()->query_cwd(), file); ! if( file[<2..] != ".c" ) file = file + ".c"; ! switch(cmd) { ! case "room": ! CreateRoom(file, cmd); return 1; ! default: ! return "I don't know how to create " + add_article(cmd) + "."; } - } ! static void CreateRoom(string file, string args) { ! object ob; ! if( !(ob = new(OBJ_ROOMMAKER)) ) { ! this_player()->eventPrint("Unable to create a room maker."); ! return; ! } ! ob->eventCreateRoom(file, args); } ! string GetHelp(string str) { ! return ("Syntax: <create FILE room>\n" ! " <create FILE room CLIMATE>\n\n" ! "Allows you to use a menu interface to create an object. " ! "Currently only room making is supported.\n\n" ! "See also: ed"); } --- 1,63 ---- #include <lib.h> ! #include <modules.h> ! #include <rooms.h> ! inherit LIB_DAEMON; ! ! mixed cmd(string str) { ! string arg; ! object staff; ! int room; ! ! if(!str || str == "") { ! write("You'll need to be more specific. Try 'help create'"); return 1; + } ! staff = present("tanstaafl",this_player()); ! if(!staff) { ! write("You must be holding the creator staff in order to use this command."); ! write("If you don't know where you put it, get another one from the chest "); ! write("in your workroom."); ! return 1; } ! if(sscanf(str,"room%s",arg) == 1 || ! sscanf(str,"enter%s",arg) == 1 || ! sscanf(str,"exit%s",arg) == 1 ) room = 1; ! if(room && environment(this_player())->GetNoModify() ) ! return "This should be edited by hand. Change cancelled."; ! ! if(room) staff->make(arg); ! else staff->gmake(str); ! ! return 1; } ! int help() { ! message("system", "Syntax: create room DIRECTION FILE\n" ! " create npc FILE\n" ! " create barkeep FILE\n" ! " create vendor FILE\n" ! " create trainer FILE\n" ! " create armor FILE\n" ! " create worn_storage FILE\n" ! " create weapon FILE\n" ! " create item FILE\n" ! " create container FILE\n" ! " create bed FILE\n" ! " create chair FILE\n" ! " create table FILE\n" ! " create book FILE\n" ! " create door DIRECTION FILE\n" ! "\nThis command makes a generic copy of the type of thing " ! "you specify. In the case of a room, the room you are in is " ! "copied into the direction you specify. In the case of other " ! "objects, a generic object appears in the room you are in. " ! "After that object materializes, you can make changes to it " ! "with the \"modify\" command. These changes are saved to file " ! "automatically.\n\n" ! "See also: modify, copy, delete, add, initfix\n", ! this_player()); } diff -c -r --new-file ds1.1/lib/secure/cmds/creators/dbxframe.c ds2.0r27/lib/secure/cmds/creators/dbxframe.c *** ds1.1/lib/secure/cmds/creators/dbxframe.c Sun Feb 1 21:30:37 1998 --- ds2.0r27/lib/secure/cmds/creators/dbxframe.c Wed Jul 5 00:01:12 2006 *************** *** 1,49 **** ! string print_vars(mixed *vars) { ! string *result = allocate(sizeof(vars)); ! int i; ! for (i=0; i<sizeof(vars); i++) { ! if (mapp(vars[i])) ! result[i] = "([ ... ])"; ! else if (functionp(vars[i])) ! result[i] = "(: ... :)"; ! else if (intp(vars[i])) ! { ! if (vars[i]) result[i]=vars[i]+""; ! else if (nullp(vars[i])) result[i]="NULL"; ! else if (undefinedp(vars[i])) result[i]="UNDEFINED"; ! else result[i]="0"; ! } ! else if (stringp(vars[i])) ! result[i] = "\""+vars[i]+"\""; ! else if (pointerp(vars[i])) ! result[i] = "({ ... })"; ! else if (floatp(vars[i])) ! result[i] = vars[i]+""; ! else if (bufferp(vars[i])) ! result[i] = "<BUFFER>"; ! } ! return implode(result, ", "); ! } ! ! int ! cmd(string str) { ! mapping frame; object ob; string who; ! int num; ! int i; if (!str || (sscanf(str, "%d", num)==0 && sscanf(str, "%s %d", who, num)==0)) { ! write("dbxframe [<who>] <frame>"); return 1; } if (who) { ! ob = find_player(who); ! if (!ob) { ! write("No such player."); ! return 1; ! } } else ob = this_player(); frame = ob->GetLastError(); --- 1,21 ---- ! mapping frame; ! int cmd(string str) { object ob; string who; ! int num, i; ! string ret = ""; if (!str || (sscanf(str, "%d", num)==0 && sscanf(str, "%s %d", who, num)==0)) { ! write("dbxframe [<who>] <frame>"); return 1; } if (who) { ! ob = find_player(who); ! if (!ob) { ! write("No such player."); ! return 1; ! } } else ob = this_player(); frame = ob->GetLastError(); *************** *** 55,68 **** return notify_fail("No such frame.\n"); frame = frame["trace"][num]; ! printf("------%s:%i - %s(%s)\n", frame["program"], frame["line"], ! frame["function"],print_vars(frame["arguments"])); ! printf("locals: %s\n", print_vars(frame["locals"])); ! printf("----------------------------------------------------------------\n"); ! printf("%s=>%s%s", ! read_file("/"+frame["program"], frame["line"]-5, 5), ! read_file("/"+frame["program"], frame["line"], 1), ! read_file("/"+frame["program"], frame["line"]+1, 5)); ! return 1; } --- 27,39 ---- return notify_fail("No such frame.\n"); frame = frame["trace"][num]; ! ret += sprintf("------\n%s:%i - %s(%s)\n", frame["program"], frame["line"], ! frame["function"],frame["arguments"]); ! ret += sprintf("----------------------------------------------------------------\n"); ! ret += sprintf("%s=>%s%s", ! unguarded( (: read_file(frame["program"], frame["line"]-5, 5) :) ), ! unguarded( (: read_file(frame["program"], frame["line"], 1) :) ), ! unguarded( (: read_file(frame["program"], frame["line"]+1, 5) :) )); ! tell_object(this_player(),ret); return 1; } diff -c -r --new-file ds1.1/lib/secure/cmds/creators/dbxwhere.c ds2.0r27/lib/secure/cmds/creators/dbxwhere.c *** ds1.1/lib/secure/cmds/creators/dbxwhere.c Sun Feb 1 21:30:38 1998 --- ds2.0r27/lib/secure/cmds/creators/dbxwhere.c Wed Jul 5 00:01:12 2006 *************** *** 3,24 **** inherit LIB_DAEMON; ! int ! cmd(string str) { mapping error; object ob; int i; if (str) { ! ob = find_player(str); ! if (!ob) { ! write("No such player."); ! return 1; ! } } else ! ob = this_player(); if (error = (mapping)ob->GetLastError()) { ! printf("%s\n", master()->standard_trace(error, 1)); } else write("No error.\n"); ! return 1; } --- 3,23 ---- inherit LIB_DAEMON; ! mixed cmd(string str) { mapping error; object ob; int i; if (str) { ! ob = find_player(str); ! if (!ob) { ! //write("No such player."); ! return "Player not found."; ! } } else ! ob = this_player(); if (error = (mapping)ob->GetLastError()) { ! return sprintf("%s\n", master()->standard_trace(error, 1)); } else write("No error.\n"); ! return "dbxwhere run complete."; } diff -c -r --new-file ds1.1/lib/secure/cmds/creators/diff.c ds2.0r27/lib/secure/cmds/creators/diff.c *** ds1.1/lib/secure/cmds/creators/diff.c Sun Feb 1 21:30:38 1998 --- ds2.0r27/lib/secure/cmds/creators/diff.c Wed Jul 5 00:01:12 2006 *************** *** 19,98 **** int sort( string mem, mixed arr ) { ! return -1 == member_array( mem, arr ); } mixed get_lines( string file_name ) { ! string file; ! file_name = absolute_path( "cwd", file_name ); ! switch( file_size( file_name ) ) ! { case -2: { write( file_name + " is a directory.\n" ); return 0; } case -1: { write( file_name + " is not a file.\n" ); return 0; } ! } ! if( !master()-> valid_read( file_name, ! previous_object(), "diff" ) ) ! { ! write( file_name + " : Permission denied.\n" ); ! return 0; ! } ! file = read_file( file_name ); ! if( !file ) ! { ! write( file_name + " is empty.\n" ); ! return 0; ! } ! return explode( file, "\n" ); } int cmd( string a ) { ! string output, file_name1, file_name2; ! string *lines1, *lines2; ! string *ONEnotTWO, *TWOnotONE; ! ! if( !a || 2 != sscanf( a, "%s %s", file_name1, file_name2 ) ) ! { ! notify_fail( "Syntax: diff <file1> <file2>\n" ); ! return 0; ! } ! lines1 = get_lines( file_name1 ); ! lines2 = get_lines( file_name2 ); ! if( !pointerp( lines1 ) || !pointerp( lines2 ) ) ! { ! notify_fail( "No comparison made.\n" ); ! return 0; ! } ! if( lines1 == lines2 ) ! { ! write( file_name1 + " and " + file_name2 + " are the same file.\n" ); ! return 1; ! } ! ONEnotTWO = filter( lines1, "sort", this_object(), lines2 ); ! TWOnotONE = filter( lines2, "sort", this_object(), lines1 ); ! if( ONEnotTWO == TWOnotONE ) ! { ! write( file_name1 + " and " + file_name2 + " have the same lines.\n" ); return 1; - } - output = "[In " + file_name1 + " but not in " + file_name2 + ":]\n" + - implode( ONEnotTWO, "\n" ) + "\n" + - "\n[In " + file_name2 + " but not in " + file_name1 + ":]\n" + - implode( TWOnotONE, "\n" ) + "\n"; - - this_player()->eventPage( explode(output, "\n"), MSG_SYSTEM | MSG_NOCOLOUR); - - return 1; } int help() { ! write( ""+ ! "Syntax: diff <file1> <file2>\n"+ ! "Effect: Finds the differences between two files.\n"+ ! "" ); ! return 1; } --- 19,98 ---- int sort( string mem, mixed arr ) { ! return -1 == member_array( mem, arr ); } mixed get_lines( string file_name ) { ! string file; ! file_name = absolute_path( "cwd", file_name ); ! switch( file_size( file_name ) ) ! { case -2: { write( file_name + " is a directory.\n" ); return 0; } case -1: { write( file_name + " is not a file.\n" ); return 0; } ! } ! if( !master()-> valid_read( file_name, ! previous_object(), "diff" ) ) ! { ! write( file_name + " : Permission denied.\n" ); ! return 0; ! } ! file = read_file( file_name ); ! if( !file ) ! { ! write( file_name + " is empty.\n" ); ! return 0; ! } ! return explode( file, "\n" ); } int cmd( string a ) { ! string output, file_name1, file_name2; ! string *lines1, *lines2; ! string *ONEnotTWO, *TWOnotONE; ! ! if( !a || 2 != sscanf( a, "%s %s", file_name1, file_name2 ) ) ! { ! notify_fail( "Syntax: diff <file1> <file2>\n" ); ! return 0; ! } ! lines1 = get_lines( file_name1 ); ! lines2 = get_lines( file_name2 ); ! if( !pointerp( lines1 ) || !pointerp( lines2 ) ) ! { ! notify_fail( "No comparison made.\n" ); ! return 0; ! } ! if( lines1 == lines2 ) ! { ! write( file_name1 + " and " + file_name2 + " are the same file.\n" ); ! return 1; ! } ! ONEnotTWO = filter( lines1, "sort", this_object(), lines2 ); ! TWOnotONE = filter( lines2, "sort", this_object(), lines1 ); ! if( ONEnotTWO == TWOnotONE ) ! { ! write( file_name1 + " and " + file_name2 + " have the same lines.\n" ); ! return 1; ! } ! output = "[In " + file_name1 + " but not in " + file_name2 + ":]\n" + ! implode( ONEnotTWO, "\n" ) + "\n" + ! "\n[In " + file_name2 + " but not in " + file_name1 + ":]\n" + ! implode( TWOnotONE, "\n" ) + "\n"; ! ! this_player()->eventPage( explode(output, "\n"), MSG_SYSTEM | MSG_NOCOLOUR); ! return 1; } int help() { ! write( ""+ ! "Syntax: diff <file1> <file2>\n"+ ! "Effect: Finds the differences between two files.\n"+ ! "" ); ! return 1; } diff -c -r --new-file ds1.1/lib/secure/cmds/creators/dsversion.c ds2.0r27/lib/secure/cmds/creators/dsversion.c *** ds1.1/lib/secure/cmds/creators/dsversion.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cmds/creators/dsversion.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,277 ---- + /* /secure/cmds/creators/dsversion.c + * Created by Brodbane of Eve + * Date Created: 4/1/06 + */ + + #include <lib.h> + #include <network.h> + #include <socket_err.h> + #include <message_class.h> + + inherit LIB_DAEMON; + + #define HTTP_ADDRESS "149.152.218.102" + #define HTTP_HOST "www.dead-souls.net" + #define HTTP_PORT 80 + #define HTTP_PATH "/RELEASE_NOTES" + #define NOTES_DELIM "----" + + #define SAVE_FILE "/doc/RELEASE_NOTES_HTTP" + + + #define SOCK_FIND 0 + #define SOCK_CONNECTING 1 + #define SOCK_CONNECTED 2 + #define SOCK_DISCONNECTED 3 + #define SOC_ERROR 4 + + //#define _DEBUG + + int socket; + int status; + object player; + object person; + + string results; + + void sendHTTPGet(); + + int http_file_found; + + private string args_list; + + void ProcessHTTPResult() + { + int i = 0; + string * parts; + string * arg_array; + string * temp; + + //player->eventPrint(results); + parts = explode( results, NOTES_DELIM ); + //player->eventPrint( "Size of elements "+sizeof(parts) ); + + //found = regexp( parts, args_list+" +" ); + //player->eventPrint( sizeof( found ) ); + //if( !args_list ){ + //player->eventPrint( parts[0] ); + temp = explode( parts[0], "---" ); + player->eventPrint( "Current Version of "+mud_name()+": " + mudlib_version() ); + player->eventPrint( "Latest Version of Dead Souls: %^RED%^"+trim(temp[0])+ "%^RESET%^" ); + write_file( SAVE_FILE, results, 1 ); + //player->eventPrint( "\nFor complete release notes refer to "+SAVE_FILE ); + //return; + //} + + arg_array = explode( args_list, " " ); + foreach( string str in arg_array ){ + temp = regexp( parts, args_list+" +" ); + if( sizeof( temp ) > 3 ){ + player->eventPrint( "Too many results, truncating..." ); + player->eventPrint( temp[0]+temp[1]+temp[2] ); + } + else{ + foreach( string s in temp ) + { + player->eventPrint( "---- "+s ); + i++; + } + } + } + + + write_file( SAVE_FILE, results, 1 ); + player->eventPrint( "For complete release notes refer to "+SAVE_FILE ); + } + + void read_callback( int fd, mixed message ) + { + if( !http_file_found ){ + if( message[9..11] != "200" ){ + player->eventPrint( "Error, unable to locate page requested." ); + + http_file_found = 3; + } + else + { + //player->eventPrint( message ); Uncomment this to see http header debug + http_file_found = 1; + } + } + else if( http_file_found == 1 ){ + //player->eventPrint( message ); + results += message; + } + else{ + + } + //player->eventPrint( message ); + //results += message; + //player->eventPrint( message ); + //player->eventPrint( "------------------" ); + } + + void write_callback( int fd ) + { + #ifdef _DEBUG + player->eventPrint("Connected!"); + #endif + status = SOCK_CONNECTED; + http_file_found = 0; + sendHTTPGet(); + } + + void close_callback( int fd ) + { + if( status == SOCK_CONNECTED ) + { + // Process HTML here + #ifdef _DEBUG + player->eventPrint("Connection closed by host."); + #endif + ProcessHTTPResult(); + } + if( status == SOCK_CONNECTING ) + { + player->eventPrint("Connection attempt failed."); + } + socket_close( fd ) ; + status = SOCK_DISCONNECTED; + } + + void sendHTTPGet() + { + string str ="GET "+HTTP_PATH+" HTTP/1.0\r\n"+ + "Host: "+HTTP_HOST+"\r\n" + + "User-Agent: "+ player->GetName() + "@" + mud_name() + " " + + mudlib()+ "/" + mudlib_version() +" ("+ query_os_type()+";) "+ + version() + "\r\n\r\n"; + int result = 0; + results = ""; + #ifdef _DEBUG + player->eventPrint("Sending HTTP get request..." ); + #endif + if( status == SOCK_CONNECTED ) + { + result = socket_write( socket, (string)str ); + #ifdef _DEBUG + player->eventPrint( "HTTP request sent to " + socket + " result = "+result ); + #endif + } + } + + int openHTTPConnection() + { + + int sock, sc_result; + string error; + status = SOCK_FIND; + + + status = SOCK_CONNECTING; + sock = socket_create( STREAM, "read_callback", "close_callback" ) ; + if (sock < 0) { + switch( sock ) + { + case EEMODENOTSUPP : + error = "Socket mode not supported.\n" ; + break ; + case EESOCKET : + error = "Problem creating socket.\n" ; + break ; + case EESETSOCKOPT : + error = "Problem with setsockopt.\n" ; + break ; + case EENONBLOCK : + error = "Problem with setting non-blocking mode.\n" ; + break ; + case EENOSOCKS : + error = "No more available efun sockets.\n" ; + break ; + case EESECURITY : + error = "Security violation attempted.\n" ; + break ; + default : + error = "Unknown error code: " + sock + ".\n" ; + break ; + } + notify_fail( "Unable to connect, problem with socket_create.\n" + "Reason: " + error ) ; + return 0 ; + } + #ifdef _DEBUG + write("Attempting to connect to "+HTTP_HOST+ " on port "+ HTTP_PORT + "\n"); + #endif + sc_result = socket_connect( sock, HTTP_ADDRESS + " " + HTTP_PORT, + "read_callback", "write_callback" ) ; + if( sc_result != EESUCCESS ) + { + status = SOCK_DISCONNECTED; + notify_fail( "Failed to connect.\n" ) ; + return 0 ; + } + else{ + #ifdef _DEBUG + player->eventPrint( "Socket connecting..." ); + #endif + } + + socket = sock; + return 1; + } + + void hostResolved( string address, string resolved, int key ) + { + if( !resolved ){ + #ifdef _DEBUG + player->eventPrint( "Unable to resolve "+address ); + #endif + return; + } + #ifdef _DEBUG + player->eventPrint( "Resolved "+address+" to "+ resolved ); + #endif + player->eventPrint( "Retrieving updated release notes from: http://www.dead-souls.net\n" ); + openHTTPConnection(); + } + + void resolveHost() + { + resolve( HTTP_HOST, "hostResolved" ); + } + + + mixed cmd(string args) { + player = previous_object(); + if(args) args_list = args; + else args_list = ""; + //resolveHost(); + openHTTPConnection(); + return 1; + } + + string GetErorMessage() { + return "There was a problem"; + } + + string GetHelp() { + return ("Syntax: dsversion [version]\n\n" + + "Shows the latest version of Dead Souls and release notes.\n"+ + "e.g. dsversion, dsversion r1, dsversion 2.0r1"); + } + + + + + + + + + + + + + + + + diff -c -r --new-file ds1.1/lib/secure/cmds/creators/economy.c ds2.0r27/lib/secure/cmds/creators/economy.c *** ds1.1/lib/secure/cmds/creators/economy.c Sun Feb 1 21:30:38 1998 --- ds2.0r27/lib/secure/cmds/creators/economy.c Wed Jul 5 00:01:12 2006 *************** *** 10,35 **** if( !str ) { string *tmp; string curr; ! tmp = ({ "Currency Rate Infl Mass" }); foreach( curr in (string *)ECONOMY_D->__QueryCurrencies() ) ! tmp += ({ sprintf("%:-15s %:-7s %:-7s %f", ! curr, currency_rate(curr) + "" , ! currency_inflation(curr) + "", ! (float)ECONOMY_D->__Query(curr, "weight")) }); this_player()->more(tmp, "system"); return 1; } if(!archp(previous_object())) return 0; log_file("economy", (string)previous_object()->GetCapName()+": " + ! str+" ("+ctime(time())+")\n"); if(sscanf(str, "add %s %f %f %f", type, rate, infl, wt) == 4) { ! ECONOMY_D->add_currency(type, rate, infl, wt); ! message("info", "Currency "+type+" added!", this_player()); } else if(sscanf(str, "change %s for %s to %f", key, type, wt) == 3) { ! ECONOMY_D->change_currency(type, key, wt); ! message("info", "Changed: "+key+" for "+type+" to "+wt, this_player()); } else return 0; return 1; --- 10,35 ---- if( !str ) { string *tmp; string curr; ! tmp = ({ "Currency Rate Infl Mass" }); foreach( curr in (string *)ECONOMY_D->__QueryCurrencies() ) ! tmp += ({ sprintf("%:-15s %:-7s %:-7s %f", ! curr, currency_rate(curr) + "" , ! currency_inflation(curr) + "", ! (float)ECONOMY_D->__Query(curr, "weight")) }); this_player()->more(tmp, "system"); return 1; } if(!archp(previous_object())) return 0; log_file("economy", (string)previous_object()->GetCapName()+": " + ! str+" ("+ctime(time())+")\n"); if(sscanf(str, "add %s %f %f %f", type, rate, infl, wt) == 4) { ! ECONOMY_D->add_currency(type, rate, infl, wt); ! message("info", "Currency "+type+" added!", this_player()); } else if(sscanf(str, "change %s for %s to %f", key, type, wt) == 3) { ! ECONOMY_D->change_currency(type, key, wt); ! message("info", "Changed: "+key+" for "+type+" to "+wt, this_player()); } else return 0; return 1; diff -c -r --new-file ds1.1/lib/secure/cmds/creators/ed.c ds2.0r27/lib/secure/cmds/creators/ed.c *** ds1.1/lib/secure/cmds/creators/ed.c Sun Feb 1 21:30:32 1998 --- ds2.0r27/lib/secure/cmds/creators/ed.c Wed Jul 5 00:01:12 2006 *************** *** 12,36 **** int x; if( args == "" || !args ) ! args = user_path((string)this_player()->GetKeyName()) + "tmp.edit"; if( (int)this_player()->GetForced() ) { message("system", "Someone tried to force you to edit "+ args +"\n" + ! identify(previous_object(-1)), this_player()); return 0; } args = absolute_path( (string)this_player()->query_cwd(), args ); if( (x = file_size(args)) == -2 ) ! return "You cannot edit a directory!"; else if( x == -1 ) ! message("editor", args + ", new file, starting in input mode.\n", ! this_player()); else message("editor", args + ", " + x + " bytes\n", this_player()); this_player()->eventEdit(args, 1); return 1; } void help() { ! message("help", "Syntax: <ed ([filename])>\n\n" ! "Enters the editor editing the file you name.\n\n" ! "See also: led", this_player()); } --- 12,45 ---- int x; if( args == "" || !args ) ! args = user_path((string)this_player()->GetKeyName()) + "tmp.edit"; if( (int)this_player()->GetForced() ) { message("system", "Someone tried to force you to edit "+ args +"\n" + ! identify(previous_object(-1)), this_player()); return 0; } + + if(!this_player()->GetProperty("EdWarned")){ + write("This is the first time you've used ed. If you get stuck, simply " + "hit return a few times, then enter a dot on a blank line, hit return, " + "then type Q, then enter. Then visit this page to learn more about " + "using the ed editor: http://dead-souls.net/editor.html"); + this_player()->SetProperty("EdWarned", 1); + } args = absolute_path( (string)this_player()->query_cwd(), args ); if( (x = file_size(args)) == -2 ) ! return "You cannot edit a directory!"; else if( x == -1 ) ! message("editor", args + ", new file, starting in input mode.\n", ! this_player()); else message("editor", args + ", " + x + " bytes\n", this_player()); this_player()->eventEdit(args, 1); return 1; } void help() { ! message("help", "Syntax: <ed ([filename])>\n\n", this_player()); ! tell_player(this_player(),"For a briefer walkthrough, quit this help doc by typing: %^GREEN%^q%^RESET%^"); ! tell_player(this_player(),"Then type: %^GREEN%^faq ed%^RESET%^\n\n"); ! this_player()->eventPage(explode(read_file("/doc/help/creators/editor"), "\n"), "help"); } diff -c -r --new-file ds1.1/lib/secure/cmds/creators/eval.c ds2.0r27/lib/secure/cmds/creators/eval.c *** ds1.1/lib/secure/cmds/creators/eval.c Sun Feb 1 21:30:33 1998 --- ds2.0r27/lib/secure/cmds/creators/eval.c Wed Jul 5 00:01:12 2006 *************** *** 12,66 **** int cmd( string a ) { ! string file, filename; ! mixed err, ret; ! string x,y; ! if(!member_group(previous_object(), PRIV_SECURE)) { ! log_file("adm/eval", query_privs(previous_object()) ! +" ("+ctime(time())+"): eval "+a+"\n"); ! } ! if( !a ) { notify_fail( SYNTAX ); return 0; } ! // The includes in the file arn't necessary (and can be removed if the ! // include files on your mud are called something different). They ! // just to make things like "eval return children( USER )" possible. ! file = ""+ "#include <lib.h>\n"+ "#include <daemons.h>\n"+ "#include <objects.h>\n"+ "#include <commands.h>\n"+ "inherit LIB_ITEM;\n"+ "mixed eval() { " + a + "; }\n"+ ""; ! filename = user_path((string)previous_object()->GetKeyName()); ! if( file_size( filename ) != -2 ) { ! notify_fail( "You must have a valid home directory!\n" ); ! return 0; ! } ! filename += "CMD_EVAL_TMP_FILE.c"; ! // long name so won't coincide with file already in your directory by accident ! rm( filename ); ! if( ret = find_object( filename ) ) destruct( ret ); ! write_file( filename, file ); ! // if( err = catch( ret = (mixed)call_other( filename, "eval" ) ) ) ! // write( "Error = " + err ); ! // else ! ret = (mixed)call_other(filename, "eval"); ! write( wrap( "Result = " + identify( ret ) ) ); ! rm( filename ); ! if( ret = find_object( filename ) ) destruct( ret ); ! // Some muds prefer to change these lines so filename isn't deleted if ! // an error occurs. Also, if you don't have the identify() simul_efun ! // the less through dump_variable() simul_efun can be used instead. ! return 1; } int help() { ! write( SYNTAX + @EndText Effect: calls a function containing <lpc commands> Example: If you type: eval return 1 + cos( 0.0 ) --- 12,77 ---- int cmd( string a ) { ! string file, filename; ! mixed err, ret; ! string x,y; ! if(!member_group(previous_object(), PRIV_SECURE)) { ! log_file("adm/eval", query_privs(previous_object()) ! +" ("+ctime(time())+"): eval "+a+"\n"); ! } ! if( !a ) { notify_fail( SYNTAX ); return 0; } ! // The includes in the file arn't necessary (and can be removed if the ! // include files on your mud are called something different). They ! // just to make things like "eval return children( USER )" possible. ! file = ""+ "#include <lib.h>\n"+ + "#include <privs.h>\n"+ + "#include <cfg.h>\n"+ + "#include <save.h>\n"+ + "#include <rooms.h>\n"+ + "#include <config.h>\n"+ "#include <daemons.h>\n"+ "#include <objects.h>\n"+ "#include <commands.h>\n"+ + "#include <armor_types.h>\n"+ + "#include <damage_types.h>\n"+ + "#include <position.h>\n"+ "inherit LIB_ITEM;\n"+ "mixed eval() { " + a + "; }\n"+ ""; ! filename = user_path((string)previous_object()->GetKeyName()); ! if( file_size( filename ) != -2 ) { ! notify_fail( "You must have a valid home directory!\n" ); ! return 0; ! } ! filename += "CMD_EVAL_TMP_FILE.c"; ! if(securep(previous_object())) filename = "/secure/tmp/"+previous_object()->GetKeyName()+"_CMD_EVAL_TMP_FILE.c"; ! //tc("filename: "+filename); ! //tc("previous_object: "+identify(previous_object())); ! // long name so won't coincide with file already in your directory by accident ! rm( filename ); ! if( ret = find_object( filename ) ) destruct( ret ); ! write_file( filename, file,1 ); ! // if( err = catch( ret = (mixed)call_other( filename, "eval" ) ) ) ! // write( "Error = " + err ); ! // else ! ret = (mixed)call_other(filename, "eval"); ! write( wrap( "Result = " + identify( ret ) ) ); ! //rm( filename ); ! if( ret = find_object( filename ) ) destruct( ret ); ! // Some muds prefer to change these lines so filename isn't deleted if ! // an error occurs. Also, if you don't have the identify() simul_efun ! // the less through dump_variable() simul_efun can be used instead. ! return 1; } int help() { ! write( SYNTAX + @EndText Effect: calls a function containing <lpc commands> Example: If you type: eval return 1 + cos( 0.0 ) *************** *** 69,74 **** then does call_other on the files's eval() function, giving: Result = 2.000000 EndText ! ); ! return 1; } --- 80,85 ---- then does call_other on the files's eval() function, giving: Result = 2.000000 EndText ! ); ! return 1; } diff -c -r --new-file ds1.1/lib/secure/cmds/creators/flushobs.c ds2.0r27/lib/secure/cmds/creators/flushobs.c *** ds1.1/lib/secure/cmds/creators/flushobs.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cmds/creators/flushobs.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,33 ---- + #include <lib.h> + #include <rooms.h> + + inherit LIB_DAEMON; + + int cmd(string str) { + object *rooms = ({}); + + write("Number of currently loaded objects: "+sizeof(objects())); + + write("Destroying objects in the furnace...\n"); + flush_messages(this_player()); + update(ROOM_FURNACE); + + + write("Destroying non-environment objects..."); + flush_messages(this_player()); + + reap_other(); + reap_other(); + + write("Done."); + + write("Number of currently loaded objects: "+sizeof(objects())); + return 1; + } + + void help() { + write("Syntax: <flushobs>\n\n"+ + "Immediately incinerates anything in the furnace and "+ + "destructs all cloned non-interactive objects that "+ + "lack an environment.\n"); + } diff -c -r --new-file ds1.1/lib/secure/cmds/creators/force.c ds2.0r27/lib/secure/cmds/creators/force.c *** ds1.1/lib/secure/cmds/creators/force.c Sun Feb 1 21:30:32 1998 --- ds2.0r27/lib/secure/cmds/creators/force.c Wed Jul 5 00:01:12 2006 *************** *** 1,9 **** ! /* /secure/cmds/creators/force.c * From the Dead Souls V Object Library ! * the same as call foo->eventForce("whatever") ! * Created by Descartes of Borg 961117 ! * Version: @(#) force.c 1.3@(#) ! * Last modified: 96/11/17 */ #include <lib.h> --- 1,8 ---- ! /* /cmds/creators/force.c * From the Dead Souls V Object Library ! * Created by Descartes of Borg 961018 ! * Version: %A% ! * Last modified: %D% */ #include <lib.h> *************** *** 11,56 **** inherit LIB_DAEMON; mixed cmd(string args) { ! string cmd = args; ! object who; ! int i; ! ! if( !cmd || cmd == "" ) { ! return "Syntax: <force LIVING COMMAND>"; } ! args = ""; ! while( (i = strsrch(cmd, " ")) != -1 ) { ! args = args + cmd[0..(i-1)]; ! if( i == strlen(cmd) - 1 ) { ! cmd = ""; ! } ! else { ! cmd = cmd[(i+1)..]; ! } ! if( who = find_living(args) ) { ! break; } } ! if( !who ) { ! return "Who are you looking for?"; } ! if( archp(who) ) { ! return "You cannot do that!"; } ! previous_object()->eventPrint("You force " + who->GetName() + ! " to " + cmd + "."); ! if( !archp(previous_object()) ) { ! who->eventPrint("WARNING: " + previous_object()->GetCapName() + ! " forces you to: " + cmd); ! } ! who->eventForce(cmd); return 1; } ! string GetHelp(string topic) { ! return ("Syntax: <force LIVING COMMAND>\n\n" ! "Allows you to force some living being to do something. " ! "Abuse of this command is grounds for removal from " ! "%^I%^" + mud_name() + "%^/I%^. Creators should only ever " ! "use this command on test characters and NPC's in unopen areas."); } --- 10,53 ---- inherit LIB_DAEMON; mixed cmd(string args) { ! object who = previous_object(); ! object target; ! string name, cmd; ! ! if(!args || args==""){ ! who->eventPrint("Force whom to do what?"); ! return 1; } ! if( sscanf(args, "%s to %s", name, cmd) < 1 ) { ! if(sscanf(args, "%s %s", name,cmd) < 1) { ! who->eventPrint("Force whom to do what?"); ! return 1; } } ! target = present(lower_case(name),environment(who)); ! if( !target ) { ! who->eventPrint("Cannot find any living thing called: " + name); ! return 1; } ! if(archp(target) && !archp(who)){ ! who->eventPrint(target->GetName()+" shakes "+possessive(target)+ ! " head and forces you to dest yourself."); ! tell_room(environment(who), who->GetName()+" dests "+objective(who)+ ! "self while trying to pull a foolish joke on "+target->GetName()+".", who); ! who->eventDestruct(); ! return 1; } ! target->eventPrint(who->GetName() + " forces you to: " + cmd); ! who->eventPrint("You force " + target->GetShort() + " to: " + cmd); ! target->eventForce(cmd); return 1; } ! string GetErorMessage() { ! return "Force whom to do what?"; ! } ! ! string GetHelp() { ! return ("Syntax: <force LIVING to COMMAND>\n\n" ! "Allows you to force a living object to take a certain action."); } diff -c -r --new-file ds1.1/lib/secure/cmds/creators/gauge.c ds2.0r27/lib/secure/cmds/creators/gauge.c *** ds1.1/lib/secure/cmds/creators/gauge.c Sun Feb 1 21:30:38 1998 --- ds2.0r27/lib/secure/cmds/creators/gauge.c Wed Jul 5 00:01:12 2006 *************** *** 9,38 **** inherit LIB_DAEMON; mixed cmd(string args) { ! object act_ob; ! mapping before, after; ! int stime, usertime, eval_cost; ! ! if( !args || args == "" ) return "You must specify a command to execute."; ! before = rusage(); ! catch(eval_cost = (int)previous_object()->eventForce(args)); ! after = rusage(); ! usertime = after["utime"] - before["utime"]; ! stime = after["stime"] - before["stime"]; ! message("system", "\n" + stime + " ms system time, " + usertime + ! " ms user time, and " + eval_cost + " CPU cycles eval cost.", ! this_player()); ! return 1; } int help() { ! write( @EndText Syntax: gauge <command> Effect: Gauges how many CPU cycles <command> takes to execute. and how much system and user time. Nota Bene: <command> must be typed in full (no aliases) EndText ! ); ! return 1; } --- 9,38 ---- inherit LIB_DAEMON; mixed cmd(string args) { ! object act_ob; ! mapping before, after; ! int stime, usertime, eval_cost; ! ! if( !args || args == "" ) return "You must specify a command to execute."; ! before = rusage(); ! catch(eval_cost = (int)previous_object()->eventForce(args)); ! after = rusage(); ! usertime = after["utime"] - before["utime"]; ! stime = after["stime"] - before["stime"]; ! message("system", "\n" + stime + " ms system time, " + usertime + ! " ms user time, and " + eval_cost + " CPU cycles eval cost.", ! this_player()); ! return 1; } int help() { ! write( @EndText Syntax: gauge <command> Effect: Gauges how many CPU cycles <command> takes to execute. and how much system and user time. Nota Bene: <command> must be typed in full (no aliases) EndText ! ); ! return 1; } diff -c -r --new-file ds1.1/lib/secure/cmds/creators/grant.c ds2.0r27/lib/secure/cmds/creators/grant.c *** ds1.1/lib/secure/cmds/creators/grant.c Sun Feb 1 21:30:38 1998 --- ds2.0r27/lib/secure/cmds/creators/grant.c Wed Jul 5 00:01:12 2006 *************** *** 13,46 **** if(!str) return notify_fail("Syntax: grant [access] to [who] on [file]\n"); else if(sscanf(str, "%s to %s on %s", type, who, file) != 3) ! return notify_fail("Syntax: grant [access] to [who] on [file]\n"); if(sizeof(tmp = explode(file, "/")) < 2) ! return notify_fail("You cannot grant such access.\n"); if(tmp[0] != "domains" && tmp[0] != "realms") ! return notify_fail("You cannot grant such access.\n"); path = "/"+tmp[0]+"/"+tmp[1]+"/"; if(file_size(path+"adm") != -2) mkdir(path+"adm"); file = absolute_path((string)this_player()->query_cwd(), file); if(!file_exists(path+"adm/access.c")) ! write_file(path+"adm/access.c", "#include <lib.h>\n\ninherit LIB_ACCESS;\n"); if(file_size(file) == -2 && file[strlen(file)-1] != '/') file = file + "/"; if(type == "read" || type == "all") { ! if(!((int)call_other(path+"adm/access","grant_access","read",file,who))) ! return notify_fail("Read access grant failed!\n"); ! if( file_size(file) == -2 ) { ! if( !((int)call_other(path + "adm/access", "grant_access", "read", ! file[0..<2], who)) ) ! return notify_fail("Read access grant failed.\n"); ! } } if(type == "write" || type == "all") { ! if(!((int)call_other(path+"adm/access","grant_access","write",file,who))) ! return notify_fail("Write access grant failed!\n"); ! if( file_size(file) == -2 ) { ! if( !((int)call_other(path + "adm/access", "grant_access", "write", ! file[0..<2], who)) ) ! return notify_fail("Write access grant failed.\n"); ! } } message("system",capitalize(type)+" access granted to "+who+" on "+file+".", this_player()); --- 13,46 ---- if(!str) return notify_fail("Syntax: grant [access] to [who] on [file]\n"); else if(sscanf(str, "%s to %s on %s", type, who, file) != 3) ! return notify_fail("Syntax: grant [access] to [who] on [file]\n"); if(sizeof(tmp = explode(file, "/")) < 2) ! return notify_fail("You cannot grant such access.\n"); if(tmp[0] != "domains" && tmp[0] != "realms") ! return notify_fail("You cannot grant such access.\n"); path = "/"+tmp[0]+"/"+tmp[1]+"/"; if(file_size(path+"adm") != -2) mkdir(path+"adm"); file = absolute_path((string)this_player()->query_cwd(), file); if(!file_exists(path+"adm/access.c")) ! write_file(path+"adm/access.c", "#include <lib.h>\n\ninherit LIB_ACCESS;\n"); if(file_size(file) == -2 && file[strlen(file)-1] != '/') file = file + "/"; if(type == "read" || type == "all") { ! if(!((int)call_other(path+"adm/access","grant_access","read",file,who))) ! return notify_fail("Read access grant failed!\n"); ! if( file_size(file) == -2 ) { ! if( !((int)call_other(path + "adm/access", "grant_access", "read", ! file[0..<2], who)) ) ! return notify_fail("Read access grant failed.\n"); ! } } if(type == "write" || type == "all") { ! if(!((int)call_other(path+"adm/access","grant_access","write",file,who))) ! return notify_fail("Write access grant failed!\n"); ! if( file_size(file) == -2 ) { ! if( !((int)call_other(path + "adm/access", "grant_access", "write", ! file[0..<2], who)) ) ! return notify_fail("Write access grant failed.\n"); ! } } message("system",capitalize(type)+" access granted to "+who+" on "+file+".", this_player()); diff -c -r --new-file ds1.1/lib/secure/cmds/creators/grep.c ds2.0r27/lib/secure/cmds/creators/grep.c *** ds1.1/lib/secure/cmds/creators/grep.c Sun Feb 1 21:30:38 1998 --- ds2.0r27/lib/secure/cmds/creators/grep.c Wed Jul 5 00:01:12 2006 *************** *** 16,46 **** notify_fail("Correct syntax: <grep '[pattern]' [file] (> [output])>\n"); if(!str) return 0; if(sscanf(str, "%s > %s", tmp, output) == 2) { ! if(output[0] != '/') ! output = (string)previous_object()->get_path()+"/"+output; ! str = tmp; } else output = 0; if(sscanf(str, "'%s' %s", exp, file) != 2 && sscanf(str, "%s %s", exp, file) != 2) return 0; if(!(max = sizeof(files = (string *)previous_object()->wild_card(file)))) { ! message("system", "File not found.", this_player()); ! return 1; } for(i=0, borg = ([]); i<max; i++) { ! if(!(txt = read_file(files[i]))) continue; ! borg[files[i]] = regexp(explode(txt, "\n"), exp); ! if(!sizeof(borg[files[i]])) map_delete(borg, files[i]); } if(!(max = sizeof(files = keys(borg)))) str = "No matches found.\n"; else { ! for(i=0, str = ""; i<max; i++) ! str += sprintf("%s:\n%s\n\n", files[i], implode(borg[files[i]],"\n")); } if(output) { ! if(!write_file(output, str)) ! message("system", "Failed to write to: "+output, this_player()); ! else message("system", "Grep sent to: "+output, this_player()); } else message("Nsystem", str, this_player()); return 1; --- 16,46 ---- notify_fail("Correct syntax: <grep '[pattern]' [file] (> [output])>\n"); if(!str) return 0; if(sscanf(str, "%s > %s", tmp, output) == 2) { ! if(output[0] != '/') ! output = (string)previous_object()->get_path()+"/"+output; ! str = tmp; } else output = 0; if(sscanf(str, "'%s' %s", exp, file) != 2 && sscanf(str, "%s %s", exp, file) != 2) return 0; if(!(max = sizeof(files = (string *)previous_object()->wild_card(file)))) { ! message("system", "File not found.", this_player()); ! return 1; } for(i=0, borg = ([]); i<max; i++) { ! if(!(txt = read_file(files[i]))) continue; ! borg[files[i]] = regexp(explode(txt, "\n"), exp); ! if(!sizeof(borg[files[i]])) map_delete(borg, files[i]); } if(!(max = sizeof(files = keys(borg)))) str = "No matches found.\n"; else { ! for(i=0, str = ""; i<max; i++) ! str += sprintf("%s:\n%s\n\n", files[i], implode(borg[files[i]],"\n")); } if(output) { ! if(!write_file(output, str)) ! message("system", "Failed to write to: "+output, this_player()); ! else message("system", "Grep sent to: "+output, this_player()); } else message("Nsystem", str, this_player()); return 1; diff -c -r --new-file ds1.1/lib/secure/cmds/creators/head.c ds2.0r27/lib/secure/cmds/creators/head.c *** ds1.1/lib/secure/cmds/creators/head.c Sun Feb 1 21:30:38 1998 --- ds2.0r27/lib/secure/cmds/creators/head.c Wed Jul 5 00:01:12 2006 *************** *** 17,23 **** file = absolute_path((string)this_player()->query_cwd(),str); if(!file_exists(file)) return notify_fail("No such file: "+file+"\n"); else if(!(str = read_file(file))) ! return notify_fail("Empty file: "+file+"\n"); if((x = sizeof(lines = explode(str, "\n"))) > 22) x = 23; str = implode(lines[0..x-1], "\n"); message("system", str, this_player()); --- 17,23 ---- file = absolute_path((string)this_player()->query_cwd(),str); if(!file_exists(file)) return notify_fail("No such file: "+file+"\n"); else if(!(str = read_file(file))) ! return notify_fail("Empty file: "+file+"\n"); if((x = sizeof(lines = explode(str, "\n"))) > 22) x = 23; str = implode(lines[0..x-1], "\n"); message("system", str, this_player()); diff -c -r --new-file ds1.1/lib/secure/cmds/creators/heal.c ds2.0r27/lib/secure/cmds/creators/heal.c *** ds1.1/lib/secure/cmds/creators/heal.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cmds/creators/heal.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,65 ---- + #include <lib.h> + + inherit LIB_DAEMON; + + int eventRegenerate(object who){ + int i; + string *stumps; + stumps=who->GetMissingLimbs(); + if(sizeof(stumps)) { + for(i=0;i<sizeof(stumps);i++){ + who->RestoreLimb(stumps[i]); + } + } + return 1; + } + + mixed cmd(string args) { + string cmd = args; + object who; + mapping stumps; + string *limb_arr = ({}); + int i, mhp, msp, mmp, self; + + if( !cmd || cmd == "" ) { + return "Syntax: <heal LIVING>"; + } + + if(member_array(args,({"me","myself"})) != -1 ) self = 1; + else self = 0; + + if( !self && !who = find_living(args) ) { + write("That being is unavailable."); + return 1; + } + if(!self){ + previous_object()->eventPrint("You heal " + who->GetName() + "."); + who->eventPrint(previous_object()->GetCapName() + " heals you."); + say(this_player()->GetCapName() + " heals "+ who->GetName() + "."); + } + else { + who = this_player(); + previous_object()->eventPrint("You heal thyself."); + say(this_player()->GetCapName() + " heals "+ + objective(this_player())+"self."); + } + mhp = who->GetMaxHealthPoints(); + msp = who->GetMaxStaminaPoints(); + mmp = who->GetMaxMagicPoints(); + who->AddHP(mhp); + who->AddStaminaPoints(msp); + who->AddMagicPoints(mmp); + if(who->GetPoison() > 0) who->AddPoison(0 - who->GetPoison()); + eventRegenerate(who); + limb_arr = who->GetLimbs(); + foreach(string limb in limb_arr) { + who->HealLimb(limb); + } + return 1; + } + + string GetHelp(string topic) { + return ("Syntax: <heal LIVING>\n\n" + "Allows you to restore a living being's health, stamina, " + "magic, and severed limbs."); + } diff -c -r --new-file ds1.1/lib/secure/cmds/creators/imc2.c ds2.0r27/lib/secure/cmds/creators/imc2.c *** ds1.1/lib/secure/cmds/creators/imc2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cmds/creators/imc2.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,4 ---- + int cmd(string str){ + return "/secure/daemon/imc2.c"->command(str); + } + string GetHelp(){ return "/secure/daemon/imc2.c"->main_help(); } diff -c -r --new-file ds1.1/lib/secure/cmds/creators/indent.c ds2.0r27/lib/secure/cmds/creators/indent.c *** ds1.1/lib/secure/cmds/creators/indent.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cmds/creators/indent.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,60 ---- + #include <lib.h> + + inherit LIB_DAEMON; + + string cmd(string str) { + + string *files, *paths; + string where, rulefile, tmp; + int flag; + + notify_fail("Syntax: <indent [file | * | */*]\n"); + + if( !str ) return "You must specify a file or wildcard."; + else if(str == "*") flag = 1; + else if(str == "*/*") flag = 2; + else str = absolute_path((string)this_player()->query_cwd(), str); + if( !file_exists(str) && !flag) return "File " + str + " not found."; + else if( !(tmp = read_file(str)) && !flag) + return "Unable to read file " + str + "."; + + rulefile = "/tmp/"+this_player()->GetKeyName()+".indent"; + write_file(rulefile, "I",1); + + if(flag){ + + where = this_player()->query_cwd(); + if(flag == 1) paths = ({ where }); + else { + paths = ({}); + files = get_dir(this_player()->query_cwd()+"/"); + //tc("files: "+identify(files)); + if(sizeof(files)) foreach(string s1 in files){ + if(file_size(where + "/" +s1) == -2 ){ + paths += ({ where + "/" +s1 }); + //tc("paths: "+identify(paths)); + } + } + } + if(sizeof(paths)) foreach(string path in paths){ + //tc("path: "+path); + load_object("/secure/cmds/creators/lsed")->cmd(rulefile + " "+ path + "/*.c"); + load_object("/secure/cmds/creators/lsed")->cmd(rulefile + " "+ path + "/*.h"); + } + } + + else { + load_object("/secure/cmds/creators/lsed")->cmd(rulefile + " "+str); + } + + rm(rulefile); + return "Done."; + } + + void help() { + message("help", + "Syntax: <indent [file | * | */*]>\n\n" + "Indents a specified file, or all files in a directory." + "\n\nSee also: cd, ls, mv, pwd, rm, lsed, grep", this_player() + ); + } diff -c -r --new-file ds1.1/lib/secure/cmds/creators/isql.c ds2.0r27/lib/secure/cmds/creators/isql.c *** ds1.1/lib/secure/cmds/creators/isql.c Sun Feb 1 21:30:38 1998 --- ds2.0r27/lib/secure/cmds/creators/isql.c Wed Jul 5 00:01:12 2006 *************** *** 15,26 **** string GetHelp(string str) { return ("Syntax: <isql DATABASE>\n\n" ! "Allows you to interactively issue SQL statements. Besides " ! "SQL statements, you may also issue the follow commands on " ! "lines by themselves:\n" ! "\tgo\n" ! "\tSends the current buffer to the database engine for " ! "interpretation.\n" ! "\tquit\n" ! "\tExits the ISQL interface."); } --- 15,26 ---- string GetHelp(string str) { return ("Syntax: <isql DATABASE>\n\n" ! "Allows you to interactively issue SQL statements. Besides " ! "SQL statements, you may also issue the follow commands on " ! "lines by themselves:\n" ! "\tgo\n" ! "\tSends the current buffer to the database engine for " ! "interpretation.\n" ! "\tquit\n" ! "\tExits the ISQL interface."); } diff -c -r --new-file ds1.1/lib/secure/cmds/creators/localcmds.c ds2.0r27/lib/secure/cmds/creators/localcmds.c *** ds1.1/lib/secure/cmds/creators/localcmds.c Sun Feb 1 21:30:38 1998 --- ds2.0r27/lib/secure/cmds/creators/localcmds.c Wed Jul 5 00:01:12 2006 *************** *** 18,34 **** cols = ((int *)previous_object()->GetScreen())[0]; cmds = (mixed *)ob->GetCommands(); previous_object()->more(({ center("Local commands for " + ! (string)ob->GetName(), cols) }) + ! map(cmds, (: sprintf("%:-10s %:-40s %s", ! $1[0], ! sprintf("%O", $1[2]), ! $1[3]) :) ), ! "system"); return 1; } void help() { message("help", "Syntax: <localcmds>\n\n" ! "Gives you a listing of all commands available to the living " ! "thing you name.", this_player()); } --- 18,34 ---- cols = ((int *)previous_object()->GetScreen())[0]; cmds = (mixed *)ob->GetCommands(); previous_object()->more(({ center("Local commands for " + ! (string)ob->GetName(), cols) }) + ! map(cmds, (: sprintf("%:-10s %:-40s %s", ! $1[0], ! sprintf("%O", $1[2]), ! $1[3]) :) ), ! "system"); return 1; } void help() { message("help", "Syntax: <localcmds>\n\n" ! "Gives you a listing of all commands available to the living " ! "thing you name.", this_player()); } diff -c -r --new-file ds1.1/lib/secure/cmds/creators/log.c ds2.0r27/lib/secure/cmds/creators/log.c *** ds1.1/lib/secure/cmds/creators/log.c Sun Feb 1 21:30:38 1998 --- ds2.0r27/lib/secure/cmds/creators/log.c Wed Jul 5 00:01:12 2006 *************** *** 10,17 **** int cmd(string str) { if(!str) { ! notify_fail("Correct syntax: <log [log file]>\n"); ! return 0; } write(str+":\n"); if(!tail(DIR_LOGS+"/"+str)) write("No such log file: "+str+"\n"); --- 10,17 ---- int cmd(string str) { if(!str) { ! notify_fail("Correct syntax: <log [log file]>\n"); ! return 0; } write(str+":\n"); if(!tail(DIR_LOGS+"/"+str)) write("No such log file: "+str+"\n"); diff -c -r --new-file ds1.1/lib/secure/cmds/creators/ls.c ds2.0r27/lib/secure/cmds/creators/ls.c *** ds1.1/lib/secure/cmds/creators/ls.c Sun Feb 1 21:30:38 1998 --- ds2.0r27/lib/secure/cmds/creators/ls.c Wed Jul 5 00:01:12 2006 *************** *** 23,68 **** if(!str) return notify_fail("No current working directory.\n"); i = sizeof(args = explode(str, " ")); if(args[0][0] == '-') { ! if((x = strlen(args[0])) > 1) options = explode(args[0][1..x-1], ""); ! else options = ({}); ! if(i == 1) paths = ({ (string)previous_object()->query_cwd() }); ! else paths = args[1..i-1]; } else { ! options = ({}); ! paths = args; } i = sizeof(options); while(i--) { ! switch(options[i]) { ! case "a": all_files = 1; break; ! case "l": long_details = 1; break; ! case "t": time_sort = 1; break; ! case "m": moref = 1; break; ! case "n": no_load_info = 1; break; ! case "b": brief = 1; break; ! case "s": size = 1; break; ! } } for(i=0, maxi = sizeof(paths), files = ({}); i<maxi; i++) ! if(tmp = (string *)previous_object()->wild_card(paths[i])) files += tmp; if(!sizeof(files)) { ! message("error", "No such file or directory.", this_player()); ! return 1; } dirs = filter(files, "is_dir", this_object()); if(sizeof(files = files - dirs)) ! show = display_ls(file_mapping(files),all_files,long_details, time_sort, ! no_load_info, brief, size); else show = ""; if(!(maxi = sizeof(dirs))) { ! if(moref) previous_object()->more(explode(show, "\n"), "system"); ! else message("system", show, previous_object()); ! return 1; } for(i=0; i<maxi; i++) ! show += display_ls(dirs[i], all_files, long_details, time_sort, ! no_load_info, brief, size); if(moref) previous_object()->more(explode(show, "\n"), "system"); else message("system", show, previous_object()); return 1; --- 23,68 ---- if(!str) return notify_fail("No current working directory.\n"); i = sizeof(args = explode(str, " ")); if(args[0][0] == '-') { ! if((x = strlen(args[0])) > 1) options = explode(args[0][1..x-1], ""); ! else options = ({}); ! if(i == 1) paths = ({ (string)previous_object()->query_cwd() }); ! else paths = args[1..i-1]; } else { ! options = ({}); ! paths = args; } i = sizeof(options); while(i--) { ! switch(options[i]) { ! case "a": all_files = 1; break; ! case "l": long_details = 1; break; ! case "t": time_sort = 1; break; ! case "m": moref = 1; break; ! case "n": no_load_info = 1; break; ! case "b": brief = 1; break; ! case "s": size = 1; break; ! } } for(i=0, maxi = sizeof(paths), files = ({}); i<maxi; i++) ! if(tmp = (string *)previous_object()->wild_card(paths[i])) files += tmp; if(!sizeof(files)) { ! message("error", "No such file or directory.", this_player()); ! return 1; } dirs = filter(files, "is_dir", this_object()); if(sizeof(files = files - dirs)) ! show = display_ls(file_mapping(files),all_files,long_details, time_sort, ! no_load_info, brief, size); else show = ""; if(!(maxi = sizeof(dirs))) { ! if(moref) previous_object()->more(explode(show, "\n"), "system"); ! else message("system", show, previous_object()); ! return 1; } for(i=0; i<maxi; i++) ! show += display_ls(dirs[i], all_files, long_details, time_sort, ! no_load_info, brief, size); if(moref) previous_object()->more(explode(show, "\n"), "system"); else message("system", show, previous_object()); return 1; *************** *** 77,87 **** int i, maxi, x; for(i=0, maxi = sizeof(files), borg = ([]); i<maxi; i++) { ! x = sizeof(tmp = explode(files[i], "/")); ! if(x == 1) dir = "/"; ! else dir = "/"+implode(tmp[0..x-2], "/")+"/"; ! if(borg[dir]) borg[dir] += get_dir(dir+tmp[x-1], -1); ! else borg[dir] = get_dir(dir+tmp[x-1], -1); } return borg; } --- 77,87 ---- int i, maxi, x; for(i=0, maxi = sizeof(files), borg = ([]); i<maxi; i++) { ! x = sizeof(tmp = explode(files[i], "/")); ! if(x == 1) dir = "/"; ! else dir = "/"+implode(tmp[0..x-2], "/")+"/"; ! if(borg[dir]) borg[dir] += get_dir(dir+tmp[x-1], -1); ! else borg[dir] = get_dir(dir+tmp[x-1], -1); } return borg; } *************** *** 93,110 **** int i, maxi; if(stringp(targ) && targ == "/") targ = ([ "/" : get_dir("/", -1) ]); ! else if(stringp(targ)) targ = ([ targ+"/" : get_dir(targ+"/", -1) ]); ! for(i=0, maxi = sizeof(cles = keys(targ)); i<maxi; i++) { ! if(!bflag) ret = cles[i]+":\n"; ! if(!aflag) targ[cles[i]] = filter(targ[cles[i]], "filter_dots", ! this_object()); ! if(tflag) ! targ[cles[i]]=sort_array(targ[cles[i]],"time_sort",this_object()); ! if(lflag) ret += long_list(cles[i], targ[cles[i]]); ! else ret += short_list(cles[i], targ[cles[i]], nflag, sflag); ! ret += "\n"; ! } ! return ret; } static int filter_dots(mixed *file) { return (file[0][0] != '.'); } --- 93,110 ---- int i, maxi; if(stringp(targ) && targ == "/") targ = ([ "/" : get_dir("/", -1) ]); ! else if(stringp(targ)) targ = ([ targ+"/" : get_dir(targ+"/", -1) ]); ! for(i=0, maxi = sizeof(cles = keys(targ)); i<maxi; i++) { ! if(!bflag) ret = cles[i]+":\n"; ! if(!aflag) targ[cles[i]] = filter(targ[cles[i]], "filter_dots", ! this_object()); ! if(tflag) ! targ[cles[i]]=sort_array(targ[cles[i]],"time_sort",this_object()); ! if(lflag) ret += long_list(cles[i], targ[cles[i]]); ! else ret += short_list(cles[i], targ[cles[i]], nflag, sflag); ! ret += "\n"; ! } ! return ret; } static int filter_dots(mixed *file) { return (file[0][0] != '.'); } *************** *** 126,141 **** if((int)master()->valid_write(dir, previous_object())) acc += "w"; else acc += "-"; if(member_array(dir[0..strlen(dir)-2], ! (string *)previous_object()->GetSearchPath()) != -1) acc += "x"; else acc += "-"; for(i=0, maxi=sizeof(files); i<maxi; i++) { ! if(files[i][1] == -2) loaded = ""; ! else loaded = (find_object(dir+files[i][0]) ? "*" : ""); ! ret += sprintf("%:-3s%:-5s%:-30s%:-10d%s", ! loaded, acc, ctime(files[i][2]), ! files[i][1], files[i][0]); ! if(files[i][1] == -2) ret += "/\n"; ! else ret += "\n"; } return ret; } --- 126,141 ---- if((int)master()->valid_write(dir, previous_object())) acc += "w"; else acc += "-"; if(member_array(dir[0..strlen(dir)-2], ! (string *)previous_object()->GetSearchPath()) != -1) acc += "x"; else acc += "-"; for(i=0, maxi=sizeof(files); i<maxi; i++) { ! if(files[i][1] == -2) loaded = ""; ! else loaded = (find_object(dir+files[i][0]) ? "*" : ""); ! ret += sprintf("%:-3s%:-5s%:-30s %d\t%s", ! loaded, acc, ctime(files[i][2]), ! files[i][1], files[i][0]); ! if(files[i][1] == -2) ret += "/\n"; ! else ret += "\n"; } return ret; } *************** *** 156,167 **** if(max % cols) rows++; ret = ""; for(i=0; i<rows; i++) { ! for(j=0; j<cols; j++) { ! ind = (rows * j) + i; ! if(ind < max) ret += sprintf("%:-"+(long+3)+"s", newfiles[ind]); ! else ret += sprintf("%:-"+(long+3)+"s", ""); ! } ! ret += "\n"; } return ret; } --- 156,167 ---- if(max % cols) rows++; ret = ""; for(i=0; i<rows; i++) { ! for(j=0; j<cols; j++) { ! ind = (rows * j) + i; ! if(ind < max) ret += sprintf("%:-"+(long+3)+"s", newfiles[ind]); ! else ret += sprintf("%:-"+(long+3)+"s", ""); ! } ! ret += "\n"; } return ret; } *************** *** 170,188 **** string tmp; if(flags[1] && flags[2]) { ! if(file[1] == -2) return file[0]+"/"; ! else return file[0]; } if(!flags[1]) { ! if(find_object((string)flags[0]+file[0]) && file[1] != -2) tmp = "*"; ! else tmp = " "; } else tmp = ""; if(!flags[2]) { ! if(file[1] == -2) tmp = tmp + " "; ! else if(!file[1]) tmp = tmp + "0 "; ! else if(file[1] < 1024) tmp = " 1 "; ! else tmp = sprintf("%s%:-3d ", tmp, (file[1]/1024)); } return tmp + file[0] + ((file[1] == -2) ? "/" : ""); } --- 170,188 ---- string tmp; if(flags[1] && flags[2]) { ! if(file[1] == -2) return file[0]+"/"; ! else return file[0]; } if(!flags[1]) { ! if(find_object((string)flags[0]+file[0]) && file[1] != -2) tmp = "*"; ! else tmp = " "; } else tmp = ""; if(!flags[2]) { ! if(file[1] == -2) tmp = tmp + " "; ! else if(!file[1]) tmp = tmp + "0 "; ! else if(file[1] < 1024) tmp = " 1 "; ! else tmp = sprintf("%s%:-3d ", tmp, (file[1]/1024)); } return tmp + file[0] + ((file[1] == -2) ? "/" : ""); } diff -c -r --new-file ds1.1/lib/secure/cmds/creators/lsed.c ds2.0r27/lib/secure/cmds/creators/lsed.c *** ds1.1/lib/secure/cmds/creators/lsed.c Sun Feb 1 21:30:39 1998 --- ds2.0r27/lib/secure/cmds/creators/lsed.c Wed Jul 5 00:01:12 2006 *************** *** 17,23 **** if( args == "" || !args ) return "Syntax: <lsed [script] [filelist]>"; if( (maxi = sizeof(files = explode(args, " "))) == 1 ) ! return "You must specify the name of a file to run the script on."; pwd = (string)this_player()->query_cwd(); script = absolute_path( pwd, files[0] ); files = files[1..]; --- 17,23 ---- if( args == "" || !args ) return "Syntax: <lsed [script] [filelist]>"; if( (maxi = sizeof(files = explode(args, " "))) == 1 ) ! return "You must specify the name of a file to run the script on."; pwd = (string)this_player()->query_cwd(); script = absolute_path( pwd, files[0] ); files = files[1..]; *************** *** 35,46 **** y = file_size(files[i]); if( y == -2 ) { message("system", "lsed: File " + files[i] + " is a directory.", ! this_player()); continue; } else if( y == -1 ) { message("system", "lsed: File " + files[i] + " does not exist.", ! this_player()); continue; } LsedFile(files[i], lines, x); --- 35,46 ---- y = file_size(files[i]); if( y == -2 ) { message("system", "lsed: File " + files[i] + " is a directory.", ! this_player()); continue; } else if( y == -1 ) { message("system", "lsed: File " + files[i] + " does not exist.", ! this_player()); continue; } LsedFile(files[i], lines, x); *************** *** 61,68 **** ret = ed_cmd(cmds[i]); if( query_ed_mode() == -1 ) { message("system", "lsed: Script quit unexpectedly on line " + ! (i+1) + " for file " + file + " with message: " + ret, ! this_player()); return; } } --- 61,68 ---- ret = ed_cmd(cmds[i]); if( query_ed_mode() == -1 ) { message("system", "lsed: Script quit unexpectedly on line " + ! (i+1) + " for file " + file + " with message: " + ret, ! this_player()); return; } } *************** *** 70,76 **** if( query_ed_mode() != -1 ) { ed_cmd("Q"); message("system", "lsed: permission denied for " + file, ! this_player()); return; } message("system", ret, this_player()); --- 70,76 ---- if( query_ed_mode() != -1 ) { ed_cmd("Q"); message("system", "lsed: permission denied for " + file, ! this_player()); return; } message("system", ret, this_player()); *************** *** 78,97 **** void help() { message("system", "Syntax: <lsed [script] [filelist]>\n\n" ! "Allows you to perform editor commands on a file or set of files " ! "from a script. You simply write a script of editor commands " ! "and save it to a file. For example, say that you wanted to " ! "change set_item_functions() to SetItems() and " ! "set_search_function() to SetSearch() in every file in your home " ! "directory. You would write a script that looks like:\n\n" ! "s/set_item_functions/SetItems/g\n" ! "s/set_search_function/SetSearch/g\n\n" ! "save it as convert.lsed, and then at the command line type: " ! "\"lsed sconvert.lsed *\". Keep in mind that the MudOS " ! "driver will only let an execution thread run so long " ! "before automatically terminating it with a too long evaluation " ! "error, so avoid running lsed on a large number of files at " ! "once.\n\n" ! "See also: ed", this_player()); } ! --- 78,97 ---- void help() { message("system", "Syntax: <lsed [script] [filelist]>\n\n" ! "Allows you to perform editor commands on a file or set of files " ! "from a script. You simply write a script of editor commands " ! "and save it to a file. For example, say that you wanted to " ! "change set_item_functions() to SetItems() and " ! "set_search_function() to SetSearch() in every file in your home " ! "directory. You would write a script that looks like:\n\n" ! "s/set_item_functions/SetItems/g\n" ! "s/set_search_function/SetSearch/g\n\n" ! "save it as convert.lsed, and then at the command line type: " ! "\"lsed sconvert.lsed *\". Keep in mind that the MudOS " ! "driver will only let an execution thread run so long " ! "before automatically terminating it with a too long evaluation " ! "error, so avoid running lsed on a large number of files at " ! "once.\n\n" ! "See also: ed", this_player()); } ! diff -c -r --new-file ds1.1/lib/secure/cmds/creators/memcheck.c ds2.0r27/lib/secure/cmds/creators/memcheck.c *** ds1.1/lib/secure/cmds/creators/memcheck.c Sun Feb 1 21:30:39 1998 --- ds2.0r27/lib/secure/cmds/creators/memcheck.c Wed Jul 5 00:01:12 2006 *************** *** 8,16 **** inherit LIB_DAEMON; ! int cmd(string unused) { ! check_memory(); ! return 1; } void help() { --- 8,15 ---- inherit LIB_DAEMON; ! string cmd(string unused) { ! return check_memory(); } void help() { diff -c -r --new-file ds1.1/lib/secure/cmds/creators/mkdir.c ds2.0r27/lib/secure/cmds/creators/mkdir.c *** ds1.1/lib/secure/cmds/creators/mkdir.c Sun Feb 1 21:30:39 1998 --- ds2.0r27/lib/secure/cmds/creators/mkdir.c Wed Jul 5 00:01:12 2006 *************** *** 11,42 **** int help(); int cmd(string str) { ! if( !str ) ! { ! return help(); ! } ! str = absolute_path(this_player()->query_cwd(), str); ! if( file_size(str) != -1 ) ! { ! notify_fail("mkdir: "+str+": file already exists.\n"); ! return 0; ! } ! if( (int)master()->valid_write(str, previous_object(), "rmdir") == 0 ) ! { ! notify_fail(str+": Permission denied.\n"); ! return 0; ! } ! write(mkdir(str) ? "Ok.\n" : str+": couldn't make directory.\n"); ! return 1; } int help() { ! write("Command: mkdir\nSyntax: mkdidr <directory>\n"); ! write("This command makes a new directory with the name specified.\n"+ ! "If no path information is supplied, th new directory will be\n"+ ! "a sub directory of the present working directory. For more\n"+ ! "on specifying paths see help cd.\n"); ! return 1; } /* EOF */ --- 11,42 ---- int help(); int cmd(string str) { ! if( !str ) ! { ! return help(); ! } ! str = absolute_path(this_player()->query_cwd(), str); ! if( file_size(str) != -1 ) ! { ! notify_fail("mkdir: "+str+": file already exists.\n"); ! return 0; ! } ! if( (int)master()->valid_write(str, previous_object(), "rmdir") == 0 ) ! { ! notify_fail(str+": Permission denied.\n"); ! return 0; ! } ! write(mkdir(str) ? "Ok.\n" : str+": couldn't make directory.\n"); ! return 1; } int help() { ! write("Command: mkdir\nSyntax: mkdidr <directory>\n"); ! write("This command makes a new directory with the name specified.\n"+ ! "If no path information is supplied, th new directory will be\n"+ ! "a sub directory of the present working directory. For more\n"+ ! "on specifying paths see help cd.\n"); ! return 1; } /* EOF */ diff -c -r --new-file ds1.1/lib/secure/cmds/creators/monitor.c ds2.0r27/lib/secure/cmds/creators/monitor.c *** ds1.1/lib/secure/cmds/creators/monitor.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cmds/creators/monitor.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,31 ---- + #include <lib.h> + #include <daemons.h> + + inherit LIB_DAEMON; + + int cmd(string str) { + object ob; + + if( !str || str == "" ) { + write("Monitor whom?\n"); + } + else if(!user_exists(str)) + write(str+": no such player.\n"); + else{ + SNOOP_D->AddMonitor(this_player()->GetKeyName(), str); + write("The snoop daemon has received your request."); + } + return 1; + } + + int help() + { + write( @EndText + Syntax: monitor <user> + Effect: Logs to a file everything <user> sees or types. + To stop monitoring, an admin must type "unmonitor <user>" + See also: unmonitor, snoop, unsnoop + EndText + ); + return 1; + } diff -c -r --new-file ds1.1/lib/secure/cmds/creators/more.c ds2.0r27/lib/secure/cmds/creators/more.c *** ds1.1/lib/secure/cmds/creators/more.c Sun Feb 1 21:30:39 1998 --- ds2.0r27/lib/secure/cmds/creators/more.c Wed Jul 5 00:01:12 2006 *************** *** 17,24 **** string GetHelp(string str) { return ("Syntax: <more FILE>\n\n" ! "Pages through the file you name. While inside the pager, you " ! "have access to the following commands:\n" + ! (string)LIB_PAGER->GetHelp("pager") + "\n\n" ! "See also: cat, ed, head, tail"); } --- 17,24 ---- string GetHelp(string str) { return ("Syntax: <more FILE>\n\n" ! "Pages through the file you name. While inside the pager, you " ! "have access to the following commands:\n" + ! (string)LIB_PAGER->GetHelp("pager") + "\n\n" ! "See also: cat, ed, head, tail"); } diff -c -r --new-file ds1.1/lib/secure/cmds/creators/mudtime.c ds2.0r27/lib/secure/cmds/creators/mudtime.c *** ds1.1/lib/secure/cmds/creators/mudtime.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cmds/creators/mudtime.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,36 ---- + #include <lib.h> + #include <daemons.h> + + inherit LIB_DAEMON; + + mixed cmd() { + int *mudtime; + int integer, hours, minutes; + string meridiem = " am"; + string nulle = ""; + + mudtime = SEASONS_D->GetMudTime(); + hours = mudtime[0]; + minutes = mudtime[1]; + + if(hours >= 12 && hours != 24) { + if(hours != 12) hours -= 12; + meridiem = " pm"; + } + + if(!hours || hours == 0) hours = 12; + + if(minutes < 10) nulle = "0"; + + write("In the MUD, the time is "+hours+":"+nulle+minutes+meridiem+"."); + + return 1; + + } + + void help() { + message("help", "Syntax: <mudtime>\n\n" + "Displays the time inside of the MUD. This is entirely " + "separate from what time it is anywhere in the real world." + "\n", this_player()); + } diff -c -r --new-file ds1.1/lib/secure/cmds/creators/mv.c ds2.0r27/lib/secure/cmds/creators/mv.c *** ds1.1/lib/secure/cmds/creators/mv.c Sun Feb 1 21:30:39 1998 --- ds2.0r27/lib/secure/cmds/creators/mv.c Wed Jul 5 00:01:12 2006 *************** *** 14,54 **** int cmd(string str) { ! string t1, t2, *tmp; if(this_player()->GetForced()) { ! write("Someone tried forcing you to mv "+str+"\n"); ! return 1; } ! if(!str||sscanf(str,"%s %s",t1,t2)!=2) { ! /* We should add checks for flags here. */ ! return help(); ! } else { ! #if 0 ! if(file_size(t2=absolute_path((string)this_player()->query_cwd(),t2)) > 0) ! { ! notify_fail("mv: "+t2+" already exists.\n"); ! return 0; ! } ! #endif ! t2=absolute_path((string)this_player()->query_cwd(),t2); ! rename(t1=absolute_path(this_player()->query_cwd(),t1),t2); ! if(file_size(t2) == -2) { ! tmp = explode(t1, "/"); ! t2 += "/" + tmp[sizeof(tmp)-1]; ! } ! write( ! ((file_size(t1)<0)&&(file_size(t2)!=-1)) ? t1+" -> "+t2+"\n" ! :"mv failed.\n"); ! } ! return 1; } int help() { ! write( "Syntax:\nmv <file1> <file2|directory>\n" + "Renames a file or moves it into the directory specified.\n" + "It wont overwrite an existing file.\n"); ! return 1; } /* EOF */ --- 14,54 ---- int cmd(string str) { ! string t1, t2, *tmp; if(this_player()->GetForced()) { ! write("Someone tried forcing you to mv "+str+"\n"); ! return 1; } ! if(!str||sscanf(str,"%s %s",t1,t2)!=2) { ! /* We should add checks for flags here. */ ! return help(); ! } else { ! //#if 0 ! if(file_size(t2=absolute_path((string)this_player()->query_cwd(),t2)) > 0) ! { ! notify_fail("mv: "+t2+" already exists.\n"); ! return 0; ! } ! //#endif ! t2=absolute_path((string)this_player()->query_cwd(),t2); ! rename(t1=absolute_path(this_player()->query_cwd(),t1),t2); ! if(file_size(t2) == -2) { ! tmp = explode(t1, "/"); ! t2 += "/" + tmp[sizeof(tmp)-1]; ! } ! write( ! ((file_size(t1)<0)&&(file_size(t2)!=-1)) ? t1+" -> "+t2+"\n" ! :"mv failed.\n"); ! } ! return 1; } int help() { ! write( "Syntax:\nmv <file1> <file2|directory>\n" + "Renames a file or moves it into the directory specified.\n" + "It wont overwrite an existing file.\n"); ! return 1; } /* EOF */ diff -c -r --new-file ds1.1/lib/secure/cmds/creators/restore.c ds2.0r27/lib/secure/cmds/creators/restore.c *** ds1.1/lib/secure/cmds/creators/restore.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cmds/creators/restore.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,77 ---- + #include <lib.h> + #include <dirs.h> + #include <commands.h> + + inherit LIB_DAEMON; + string globalstr1, globalstr2; + int globalint; + + mixed cmd(string str) { + string *sorted_array, *sub_arr, *new_arr, *bkarr; + string line, s1, bkname, bkcontents; + int number; + + if( !str ) return "You must specify a file to restore."; + if(str && sscanf(str,"%s %d",s1, number) > 1) str = s1; + else false(); + + new_arr = ({}); + sub_arr = ({}); + + bkname = homedir(this_player())+"/bak/bk.db"; + if( !str ) return "You must specify a file to restore."; + if( !file_exists(bkname)) { + write("The backup database file does not exist. Aborting."); + return 1; + } + bkcontents = read_file(bkname); + if(strsrch(bkcontents,str) == -1) { + write("You haven't backed up a file by that name."); + return 1; + } + if(str == "workroom.orig") { + unguarded( (: globalint = cp(homedir(this_player())+"/bak/workroom.orig", + homedir(this_player())+"/workroom.c") :) ); + if(globalint) { + write("Workroom file restored."); + load_object(CMD_UPDATE)->cmd("-a "+homedir(this_player())+"/workroom.c"); + } + else write("Workroom could not be restored."); + return 1; + } + bkarr = explode(bkcontents,"\n"); + foreach(string zline in bkarr){ + if(strsrch(zline,str) != -1) new_arr += ({ zline }); + } + + if(!number || number < 1) number = 1; + sorted_array = sort_array(new_arr, -1); + if(number > sizeof(sorted_array)) number = sizeof(sorted_array); + line = sorted_array[(number - 1)]; + + sub_arr = explode(line," : "); + if(!file_exists(REALMS_DIRS + "/" + this_player()->GetKeyName()+"/bak/"+sub_arr[0])){ + write("That file has an entry in the backup database but can't be found in your backup directory."); + return 1; + } + globalstr1 = REALMS_DIRS + "/" + this_player()->GetKeyName()+"/bak/"+sub_arr[0]; + globalstr2 = sub_arr[1]; + unguarded( (: cp(globalstr1, globalstr2) :) ); + write("File restored."); + return 1; + } + + int help() { + message("help", "Syntax: <restore STRING> [NUMBER]\n\n" + "Restores the specified file from your bak/ directory. " + "If you specify a number, the command will try to find " + "the Nth newest file to restore. Examples:\n" + "To restore the most recent version of file.c:\n" + "restore file.c\n" + "To restore the version you backed up before the most " + "recent version:\n" + "restore file.c 2\n" + "And so on.\n" + "See also: bk", + this_player()); + } diff -c -r --new-file ds1.1/lib/secure/cmds/creators/rm.c ds2.0r27/lib/secure/cmds/creators/rm.c *** ds1.1/lib/secure/cmds/creators/rm.c Sun Feb 1 21:30:39 1998 --- ds2.0r27/lib/secure/cmds/creators/rm.c Wed Jul 5 00:01:12 2006 *************** *** 14,53 **** int i; if(!str) { ! notify_fail("Correct syntax: <rm [file]>\n"); ! return 0; } if((ob=previous_object())->GetForced()) { ! write("Someone attempted to force you to rm "+str+"."); ! return 1; } tmp = absolute_path((string)ob->query_cwd(), str); if(!archp(ob) || !sizeof(files = (string *)ob->wild_card(tmp))) ! files = ({ tmp }); if(!(i=sizeof(files))) { ! message("system", "File "+tmp+" does not exist.", this_player()); ! return 1; } while(i--) { ! switch(file_size(files[i])) { ! case -1: message("system", "File "+files[i]+" does not exist.", ! this_player()); break; ! case -2: message("system", files[i]+" is a directory.", ! this_player()); break; ! default: message("system", rm(files[i]) ? files[i]+": Ok." : ! files[i]+": Permission denied.", this_player()); ! break; ! } } return 1; } void help() { message("help", "Syntax: <rm [file]>\n\n" ! "The command deletes the file named. Once deleted, the file " ! "cannot be recovered.", this_player()); if(archp(this_player())) ! message("help", "Note for arches: wild cards work with this command, " ! "but there is no prompt, so be VERY CAREFULL!!!!", ! this_player()); } --- 14,53 ---- int i; if(!str) { ! notify_fail("Correct syntax: <rm [file]>\n"); ! return 0; } if((ob=previous_object())->GetForced()) { ! write("Someone attempted to force you to rm "+str+"."); ! return 1; } tmp = absolute_path((string)ob->query_cwd(), str); if(!archp(ob) || !sizeof(files = (string *)ob->wild_card(tmp))) ! files = ({ tmp }); if(!(i=sizeof(files))) { ! message("system", "File "+tmp+" does not exist.", this_player()); ! return 1; } while(i--) { ! switch(file_size(files[i])) { ! case -1: message("system", "File "+files[i]+" does not exist.", ! this_player()); break; ! case -2: message("system", files[i]+" is a directory.", ! this_player()); break; ! default: message("system", rm(files[i]) ? files[i]+": Ok." : ! files[i]+": Permission denied.", this_player()); ! break; ! } } return 1; } void help() { message("help", "Syntax: <rm [file]>\n\n" ! "The command deletes the file named. Once deleted, the file " ! "cannot be recovered.", this_player()); if(archp(this_player())) ! message("help", "Note for arches: wild cards work with this command, " ! "but there is no prompt, so be VERY CAREFULL!!!!", ! this_player()); } diff -c -r --new-file ds1.1/lib/secure/cmds/creators/rmdir.c ds2.0r27/lib/secure/cmds/creators/rmdir.c *** ds1.1/lib/secure/cmds/creators/rmdir.c Sun Feb 1 21:30:39 1998 --- ds2.0r27/lib/secure/cmds/creators/rmdir.c Wed Jul 5 00:01:12 2006 *************** *** 13,48 **** int cmd(string str) { ! if( !str ) ! { ! return help(); ! } ! str = absolute_path(this_player()->query_cwd(), str); ! switch( file_size(str) ) ! { ! case -1: ! notify_fail("rmdir: "+str+": No such file.\n"); ! return 0; break; ! case -2: ! break; ! default: ! notify_fail("rmdir: "+str+": not a directory.\n"); ! return 0; break; ! } ! if( (int)master()->valid_write(str, this_object(), "rmdir") == 0 ) ! { ! notify_fail(str+": Permission denied.\n"); ! return 0; ! } ! write(rmdir(str) ? "Ok.\n" : str+": couldn't remove directory.\n"); ! return 1; } int help() { ! write("Command: rmdir\nSyntax: rmdir <directory>\n"+ ! "This command allows you to remove the specified directory. If\n"+ ! "the directory is not empty then the command will fail.\n"); ! return 1; } /* EOF */ --- 13,48 ---- int cmd(string str) { ! if( !str ) ! { ! return help(); ! } ! str = absolute_path(this_player()->query_cwd(), str); ! switch( file_size(str) ) ! { ! case -1: ! notify_fail("rmdir: "+str+": No such file.\n"); ! return 0; break; ! case -2: ! break; ! default: ! notify_fail("rmdir: "+str+": not a directory.\n"); ! return 0; break; ! } ! if( (int)master()->valid_write(str, this_object(), "rmdir") == 0 ) ! { ! notify_fail(str+": Permission denied.\n"); ! return 0; ! } ! write(rmdir(str) ? "Ok.\n" : str+": couldn't remove directory.\n"); ! return 1; } int help() { ! write("Command: rmdir\nSyntax: rmdir <directory>\n"+ ! "This command allows you to remove the specified directory. If\n"+ ! "the directory is not empty then the command will fail.\n"); ! return 1; } /* EOF */ diff -c -r --new-file ds1.1/lib/secure/cmds/creators/snoop.c ds2.0r27/lib/secure/cmds/creators/snoop.c *** ds1.1/lib/secure/cmds/creators/snoop.c Sun Feb 1 21:30:39 1998 --- ds2.0r27/lib/secure/cmds/creators/snoop.c Wed Jul 5 00:01:12 2006 *************** *** 5,37 **** */ #include <lib.h> inherit LIB_DAEMON; int cmd(string str) { ! object ob; ! if( !str || str == "" ) { ! if(snoop(this_player())) ! write("Ok.\n"); ! else write("Couldn't stop snoop\n"); ! } ! else if(!(ob=find_player(str=lower_case(str)))) ! write(str+": no such player.\n"); ! else ! write(snoop(this_player(), ob)?"Now snooping.\n":str+": snoop failed.\n"); ! ! return 1; } int help() { ! write( @EndText Syntax: snoop <user> ! Effect: Echos to your screen everything <user> sees or types. ! To stop snooping, type just "snoop" ! See also: snoopable EndText ! ); ! return 1; } --- 5,40 ---- */ #include <lib.h> + #include <daemons.h> inherit LIB_DAEMON; int cmd(string str) { ! object ob; ! if( !str || str == "" ) { ! write("Snoop whom?\n"); ! } ! else if(str == this_player()->GetKeyName()){ ! write("That would be very foolish."); ! return 1; ! } ! else if(!(ob=find_player(str=lower_case(str)))) ! write(str+": no such player.\n"); ! else ! SNOOP_D->AddWatcher(this_player()->GetKeyName(), str); ! write("The snoop daemon has received your request."); ! return 1; } int help() { ! write( @EndText Syntax: snoop <user> ! Effect: Echoes to your screen everything <user> sees or types. ! To stop snooping, type just "unsnoop <user>" ! See also: unsnoop, monitor, unmonitor EndText ! ); ! return 1; } diff -c -r --new-file ds1.1/lib/secure/cmds/creators/source.c ds2.0r27/lib/secure/cmds/creators/source.c *** ds1.1/lib/secure/cmds/creators/source.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cmds/creators/source.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,55 ---- + /* /secure/cmds/creator/source.c + * from the Dead Souls LPC Library + * reads a file and forces you to execute each line as a command + */ + + #include <lib.h> + + inherit LIB_DAEMON; + + mixed cmd(string args) { + string file; + string *lines; + + if(!args) { + write("Please specify a file as an argument."); + return 1; + } + + + if(file_size(args) > 0 ) file = args; + else if(file_size(this_player()->query_cwd()+"/"+args) > 0){ + file = this_player()->query_cwd()+"/"+args; + } + else { + write("That is not a valid file."); + return 1; + } + + lines = explode(read_file(file),"\n"); + if(!sizeof(lines)) { + write("Either the file is unreadable or it is empty."); + return 1; + } + + foreach( string line in lines ){ + if(line && line != "") write("sourcing command: "+line); + this_player()->eventForce(line); + } + + write("Sourcing complete."); + return 1; + + } + + void help() { + message("system", "Syntax: <source [filename]>\n\n" + "If [filename] exists and is readable, this command " + "will read each line of that file and force you to " + "execute that line as if you had entered it on the " + "command line. If there is a file called .profile " + "in your home directory, it is automatically executed " + "in this way each time you log in.\n\n" + "", this_player()); + } + diff -c -r --new-file ds1.1/lib/secure/cmds/creators/tail.c ds2.0r27/lib/secure/cmds/creators/tail.c *** ds1.1/lib/secure/cmds/creators/tail.c Sun Feb 1 21:30:39 1998 --- ds2.0r27/lib/secure/cmds/creators/tail.c Wed Jul 5 00:01:12 2006 *************** *** 20,33 **** scr = (((int *)this_player()->GetScreen())[1] || 24); if( scr > 100 ) scr = 100; if( sizeof(lines = explode(buff, "\n")) > scr ) ! buff = implode(lines[<scr..], "\n"); message("system", buff, this_player()); return 1; } void help() { message("help", "Syntax: <tail [file]>\n\n" ! "Displays the last screenful of information for the specified " ! "file.\n\n" ! "See also: cat, head, more.", this_player()); } --- 20,33 ---- scr = (((int *)this_player()->GetScreen())[1] || 24); if( scr > 100 ) scr = 100; if( sizeof(lines = explode(buff, "\n")) > scr ) ! buff = implode(lines[<scr..], "\n"); message("system", buff, this_player()); return 1; } void help() { message("help", "Syntax: <tail [file]>\n\n" ! "Displays the last screenful of information for the specified " ! "file.\n\n" ! "See also: cat, head, more.", this_player()); } diff -c -r --new-file ds1.1/lib/secure/cmds/creators/unsnoop.c ds2.0r27/lib/secure/cmds/creators/unsnoop.c *** ds1.1/lib/secure/cmds/creators/unsnoop.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cmds/creators/unsnoop.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,29 ---- + #include <lib.h> + #include <daemons.h> + + inherit LIB_DAEMON; + + int cmd(string str) { + object ob; + + if( !str || str == "" ) { + write("Unsnoop whom?\n"); + } + else if(!(ob=find_player(str=lower_case(str)))) + write(str+": no such player.\n"); + else + SNOOP_D->RemoveWatcher(this_player()->GetKeyName(), str); + write("The snoop daemon has received your request."); + return 1; + } + + int help() + { + write( @EndText + Syntax: unsnoop <user> + Effect: Stops snooping the specified user. + See also: snoop, monitor, unmonitor + EndText + ); + return 1; + } diff -c -r --new-file ds1.1/lib/secure/cmds/creators/update.c ds2.0r27/lib/secure/cmds/creators/update.c *** ds1.1/lib/secure/cmds/creators/update.c Sun Feb 1 21:30:32 1998 --- ds2.0r27/lib/secure/cmds/creators/update.c Wed Jul 5 00:01:12 2006 *************** *** 6,125 **** * Version: @(#) update.c 1.2@(#) * Last modified: 96/12/17 */ ! #include <lib.h> #include <rooms.h> ! inherit LIB_DAEMON; inherit LIB_HELP; #define U_RECURSIVE (1 << 1) #define U_INTERACTIVE (1 << 2) ! ! static void eventUpdate(string args, int flags); static void create() { SetHelp("Syntax: <update [-r] [file list]>\n" ! "Destructs the master copy of the file named " ! "and then attempts to reload a new version " ! "of it.\n" ! "The -r flag attempts to update all " ! "files in the target's inheritance tree.\n"); } ! mixed cmd(string args) { object *obs, ob; string *files, *tmpfiles; mixed tmp; string file; int i, flags; ! if( sizeof(args) ) { ! string str = args; ! args = ""; ! foreach(string foo in explode(str, " ")) { ! switch(foo) { ! case "-r" : flags |= U_RECURSIVE; break; ! case "-e" : flags |= U_INTERACTIVE; break; ! default: args += " " + foo; ! } ! } } if( args == "" || !args ) { ! ob = environment(this_player()); ! if( !ob ) return "You have no environment."; ! file = base_name(ob); ! this_player()->eventPrint("Updating environment"); ! obs = filter(all_inventory(ob), (: userp :)); ! if( sizeof(obs) ) obs->eventMove(ROOM_VOID); ! if( !eventUpdate(base_name(ob), flags) ) { ! obs->eventPrint("You are thrown into the void as your " ! "surroundings violently destruct."); ! return "Error in reloading environment."; ! } ! obs = filter(obs, (: $1 :)); ! if( sizeof(obs) ) obs->eventMove(file); ! return 1; } tmpfiles = map(explode(args, " "), ! function(string x) { ! string tmp = (string)this_player()->query_cwd(); ! if( x[<2..] != ".c" ) x = x + ".c"; ! return absolute_path(tmp, x); ! }); ! tmpfiles = map(tmpfiles, ! (: ((file_size($1) == -2) ? ! (($1[<1] == '/') ? ($1 + "*.c") : ($1 + "/*.c")) : $1) ! :)); ! i = sizeof(tmpfiles); ! files = ({}); ! while(i--) { ! if( sizeof(tmp = (string *)this_player()->wild_card(tmpfiles[i])) ) ! files += tmp; ! else this_player()->eventPrint(tmpfiles[i] + ": File not found."); ! } ! i = sizeof(files); ! while(i--) eventUpdate(files[i], flags); ! return 1; ! } ! ! static int eventUpdate(string args, int flags) { ! object ob; ! string tmp; ! ! if( flags & U_RECURSIVE ) { ! string *ancestors; ! int i; ! ! if( !eventUpdate(args, flags ^ U_RECURSIVE) ) return 0; ! if( !(ob = find_object(args)) ) return 0; ! ancestors = deep_inherit_list(ob); ! this_player()->eventPrint("(%^CYAN%^Recursive " ! "update: " + args + "%^RESET%^)\n"); ! i = sizeof(ancestors); ! while(i--) if( !eventUpdate(ancestors[i], flags ^ U_RECURSIVE) ) { ! this_player()->eventPrint("Recursive update failed."); ! return 0; ! } ! } ! if( args[<2..] == ".c" ) args = args[0..<3]; ! if( ob = find_object(args) ) { ! if( tmp = catch( ob->eventDestruct()) ) ! this_player()->eventPrint(args + ": error in eventDestruct()"); ! if( ob ) destruct(ob); ! if( ob ) ! this_player()->eventPrint(args + ": Failed to destruct old object."); ! } ! if( args == base_name(this_object()) ) { ! this_player()->eventPrint("Cannot reload update after destruct.\n" ! "It will be reloaded at next reference."); ! return 0; } - tmp = catch(call_other(args, "???")); - if( !tmp ) { - this_player()->eventPrint(args + ": Ok"); - return 1; - } else this_player()->eventPrint(args + ": Error in update\n" + tmp); - return 0; - } --- 6,155 ---- * Version: @(#) update.c 1.2@(#) * Last modified: 96/12/17 */ ! #include <lib.h> #include <rooms.h> ! inherit LIB_DAEMON; inherit LIB_HELP; #define U_RECURSIVE (1 << 1) #define U_INTERACTIVE (1 << 2) ! #define U_AUTOMATED (1 << 3) ! ! mapping LocationsMap = ([]); ! ! static int eventUpdate(string args, int flags); ! ! static void CacheAndCarry(object *obs){ ! if(!sizeof(obs)) return; ! foreach(object fellow in obs){ ! string ubi = fellow->GetProperty("LastLocation"); ! if(ubi) LocationsMap[fellow->GetKeyName()] = ubi; ! } ! obs->eventMove(ROOM_VOID); ! } ! ! static void ReturnAndRelease(object *dudes, string file){ ! if(!sizeof(dudes)) return; ! if(!file) return; ! dudes->eventMove(file); ! foreach(object fellow in dudes){ ! if(sizeof(LocationsMap[fellow->GetKeyName()])){ ! fellow->SetProperty("LastLocation",LocationsMap[fellow->GetKeyName()]); ! } ! } ! } ! static void create() { SetHelp("Syntax: <update [-r] [file list]>\n" ! "Destructs the master copy of the file named " ! "and then attempts to reload a new version " ! "of it.\n" ! "The -r flag attempts to update all " ! "files in the target's inheritance tree.\n"); } ! mixed cmd(string args) { object *obs, ob; string *files, *tmpfiles; mixed tmp; string file; int i, flags; ! if( sizeof(args) ) { ! string str = args; ! args = ""; ! foreach(string foo in explode(str, " ")) { ! switch(foo) { ! case "-r" : flags |= U_RECURSIVE; break; ! case "-e" : flags |= U_INTERACTIVE; break; ! case "-a" : flags |= U_AUTOMATED; break; ! default: args += " " + foo; ! } ! } } if( args == "" || !args ) { ! ob = environment(this_player()); ! if( !ob ) return "You have no environment."; ! file = base_name(ob); ! this_player()->eventPrint("Updating environment"); ! obs = filter(all_inventory(ob), (: userp :)); ! //if( sizeof(obs) ) obs->eventMove(ROOM_VOID); ! if( sizeof(obs) ) CacheAndCarry(obs); ! if( !eventUpdate(base_name(ob), flags) ) { ! obs->eventPrint("You are thrown into the void as your " ! "surroundings violently destruct."); ! return "Error in reloading environment."; ! } ! obs = filter(obs, (: $1 :)); ! //if( sizeof(obs) ) obs->eventMove(file); ! if( sizeof(obs) ) ReturnAndRelease(obs, file); ! return 1; } tmpfiles = map(explode(args, " "), ! function(string x) { ! string tmp = (string)this_player()->query_cwd(); ! if( x[<2..] != ".c" ) x = x + ".c"; ! return absolute_path(tmp, x); ! }); ! tmpfiles = map(tmpfiles, ! (: ((file_size($1) == -2) ? ! (($1[<1] == '/') ? ($1 + "*.c") : ($1 + "/*.c")) : $1) ! :)); ! i = sizeof(tmpfiles); ! files = ({}); ! while(i--) { ! if( sizeof(tmp = (string *)this_player()->wild_card(tmpfiles[i])) ) ! files += tmp; ! else this_player()->eventPrint(tmpfiles[i] + ": File not found."); ! } ! i = sizeof(files); ! while(i--) eventUpdate(files[i], flags); ! return 1; ! } ! ! static int eventUpdate(string args, int flags) { ! object ob; ! string tmp; ! ! if( flags & U_RECURSIVE ) { ! string *ancestors; ! int i; ! ! if( !eventUpdate(args, flags ^ U_RECURSIVE) ) return 0; ! if( !(ob = find_object(args)) ) return 0; ! ancestors = deep_inherit_list(ob); ! if(identify(flags ^ U_AUTOMATED) == "8") ! this_player()->eventPrint("(%^CYAN%^Recursive " ! "update: " + args + "%^RESET%^)\n"); ! i = sizeof(ancestors); ! while(i--) if( !eventUpdate(ancestors[i], flags ^ U_RECURSIVE) ) { ! this_player()->eventPrint("Recursive update failed."); ! return 0; ! } ! } ! if( args[<2..] == ".c" ) args = args[0..<3]; ! ob = find_object(args); ! if(!ob) ob = load_object(args); ! if( ob ) { ! if( tmp = catch( ob->eventDestruct()) ) ! this_player()->eventPrint(args + ": error in eventDestruct()"); ! if( ob ) destruct(ob); ! if( ob ) ! this_player()->eventPrint(args + ": Failed to destruct old object."); ! } ! if( args == base_name(this_object()) ) { ! this_player()->eventPrint("Cannot reload update after destruct.\n" ! "It will be reloaded at next reference."); ! return 0; ! } ! tmp = catch(call_other(args, "???")); ! if( !tmp ) { ! if(identify(flags ^ U_AUTOMATED) == "8")this_player()->eventPrint(args + ": Ok"); ! return 1; ! } else this_player()->eventPrint(args + ": Error in update\n" + tmp); ! return 0; } diff -c -r --new-file ds1.1/lib/secure/cmds/players/afk.c ds2.0r27/lib/secure/cmds/players/afk.c *** ds1.1/lib/secure/cmds/players/afk.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/cmds/players/afk.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,28 ---- + /* /secure/cmds/player/afk.c + * From the Frontiers LPC library + * created by Cratylus, 17Nov96 + */ + + #include <lib.h> + + inherit LIB_DAEMON; + + mixed cmd(string args) { + int afk; + afk = this_player()->GetProperty("afk"); + if(afk){ + afk = 0; + message("system", "You are back.", this_player() ); + } + else { + afk = 1; + message("system", "You are away from your keyboard.", this_player() ); + } + this_player()->SetProperty("afk", afk); + return 1; + } + + void help() { + message("help", "Syntax: <afk>\n\n" + "Toggles your 'away from keyboard' flag.\n\n", this_player()); + } diff -c -r --new-file ds1.1/lib/secure/cmds/players/bug.c ds2.0r27/lib/secure/cmds/players/bug.c *** ds1.1/lib/secure/cmds/players/bug.c Sun Feb 1 21:30:31 1998 --- ds2.0r27/lib/secure/cmds/players/bug.c Wed Jul 5 00:01:12 2006 *************** *** 41,53 **** if( i == 1 ) args = ({}); else args = args[1..]; switch(opt) { ! case "-a": Assign(args); break; ! case "-c": Complete(args); break; ! case "-d": Delete(args); break; ! case "-r": Report(args); break; ! case "-p": View(args, 1); break; ! case "-v": View(args); break; ! default: return "To report a bug, use \"bug -r\"."; } } return 1; --- 41,53 ---- if( i == 1 ) args = ({}); else args = args[1..]; switch(opt) { ! case "-a": Assign(args); break; ! case "-c": Complete(args); break; ! case "-d": Delete(args); break; ! case "-r": Report(args); break; ! case "-p": View(args, 1); break; ! case "-v": View(args); break; ! default: return "To report a bug, use \"bug -r\"."; } } return 1; *************** *** 67,82 **** if( str && str != "" ) { switch(str) { ! case "a": Assign(({})); return; ! case "c": Complete(({})); return; ! case "d": Delete(({})); return; ! case "r": Report(({})); return; ! case "p": View(({}), 1); return; ! case "v": View(({})); return; ! case "q": ! message("system", "Exiting the bug tracking system.", ! this_player()); ! return; } } cols = ((int *)this_player()->GetScreen())[0] || 80; --- 67,82 ---- if( str && str != "" ) { switch(str) { ! case "a": Assign(({})); return; ! case "c": Complete(({})); return; ! case "d": Delete(({})); return; ! case "r": Report(({})); return; ! case "p": View(({}), 1); return; ! case "v": View(({})); return; ! case "q": ! message("system", "Exiting the bug tracking system.", ! this_player()); ! return; } } cols = ((int *)this_player()->GetScreen())[0] || 80; *************** *** 99,511 **** if( !creatorp(this_player()) ) { message("system", "Only creators may use the -a option.", ! this_player()); return; } if( !(i = sizeof(args)) ) { message("prompt", "Enter in the bug ID: ", this_player()); input_to(function(string str) { Assign(({ str })); }); ! return; ! } ! else if( i == 1 ) { ! int x; ! ! if( (x = to_int(args[0])) > 0 ) { /* assume a bug id for now */ ! if( !archp(this_player()) ) ! Assign( ({ args[0], (string)this_player()->GetCapName() }) ); else { ! message("prompt", "Enter the creator to assign it to [" + ! (string)this_player()->GetCapName() + "]: ", ! this_player()); ! input_to(function(string str, string id) { ! if( !str || str == "" ) ! str = (string)this_player()->GetCapName(); ! Assign( ({ str, id }) ); ! }, args[0]); } - return; } ! else { ! message("prompt", "Enter in the bug ID to assign to " + ! capitalize(args[0]) + ": ", this_player()); ! input_to(function(string id, string str) { ! Assign( ({ id, str }) ); ! }, args[0]); return; } ! } ! else if( i == 2 ) { ! message("prompt", "Do you wish to comment? [n]: ", this_player()); ! input_to(function(string str, string *args) { ! if( !str || str == "" ) str = "n"; ! else str = lower_case(str[0..0]); ! if( str == "y" ) { ! string file; ! message("system", "Enter comments on the bug...", ! this_player()); ! file = DIR_TMP "/" + (string)this_player()->GetKeyName(); ! rm(file); ! this_player()->eventEdit(file, (: EndAssign, args :)); return; } ! else Assign(args + ({ "" })); ! }, args); ! return; ! } ! else { ! string who, comments; ! int x; ! ! if( (x = to_int(args[0])) < 1 ) { ! who = args[0]; ! if( (x = to_int(args[1])) < 1 ) { ! message("system", "Invalid bug ID " + x + ".", this_player()); message("prompt", "Hit return: ", this_player()); input_to( (: PreMenu :) ); return; } ! } ! else who = args[1]; ! comments = args[2]; ! if( !archp(this_player()) && (convert_name(who) != ! (string)this_player()->GetKeyName()) ) { ! message("system", "Only arches may assign bugs to other people.", ! this_player()); ! message("prompt", "Hit return: ", this_player()); ! input_to( (: PreMenu :) ); ! return; ! } ! if( !user_exists(convert_name(who)) ) { ! message("system", "No such creator: " + who, this_player()); ! message("prompt", "Hit return: ", this_player()); ! input_to( (: PreMenu :) ); ! return; ! } ! if( !((int)BUGS_D->eventAssign(x, who)) ) { ! message("system", "Failed to assign bug.", this_player()); ! return; ! } ! if( comments != "" ) BUGS_D->AddComment(x, comments); ! message("system", "Assigned bug to " + who + ".", this_player()); ! return; ! } ! } ! ! static void EndAssign(string *args) { ! string file, contents; ! ! file = DIR_TMP "/" + (string)this_player()->GetKeyName(); ! contents = (read_file(file) || ""); ! rm(file); ! Assign(args + ({ contents })); ! } ! ! static void Complete(string *args) { ! string file; ! int x; ! ! if( !sizeof(args) ) { ! message("prompt", "Enter the bug ID: ", this_player()); ! input_to(function(string str) { Complete( ({ str }) ); }); ! return; ! } ! else if( !creatorp(this_player()) ) { ! message("system", "Invalid command.", this_player()); ! message("prompt", "Hit return: ", this_player()); ! input_to( (: PreMenu :) ); ! return; ! } ! else if( (x = to_int(args[0])) < 1 ) { ! message("system", "Invalid bug ID.", this_player()); ! message("prompt", "Hit return: ", this_player()); ! input_to( (: PreMenu :) ); ! return; ! } ! message("system", "Enter in your comments:", this_player()); ! file = DIR_TMP "/" + (string)this_player()->GetKeyName(); ! if( file_exists(file) ) rm(file); ! this_player()->eventEdit(file, (: EndComplete, x :)); ! } ! ! void EndComplete(int x) { ! string file, stuff; ! ! if( previous_object() != this_player(1) ) return; ! file = DIR_TMP "/" + (string)this_player()->GetKeyName(); ! if( !(stuff = read_file(file)) ) { ! message("system", "Edit aborted.", this_player()); ! rm(file); ! return; ! } ! rm(file); ! if( !((int)BUGS_D->eventComplete(x, stuff)) ) { ! message("system", "Failed to set the bug completed.", this_player()); ! return; ! } ! message("system", "Bug marked completed!", this_player()); ! } ! ! static void Delete(string *args) { ! if( !archp(this_player()) ) { ! message("system","You must be an arch to delete bugs.", this_player()); ! return; ! } ! if( !sizeof(args) ) { ! message("prompt", "Delete which bug? ", this_player()); ! input_to(function(string str) { Delete( ({ str }) ); }); ! return; ! } ! else { ! int x; ! ! if( (x = to_int(args[0])) < 1 ) ! message("system", "Invalid bug ID.", this_player()); ! else if( !((int)BUGS_D->eventDelete(x)) ) ! message("system", "Delete failed.", this_player()); ! else message("system", "Deletion succeeded.", this_player()); ! return; ! } ! } ! ! static void Report(string *args) { ! if( archp(this_player()) && sizeof(args) ) { ! string data; ! string bug; ! int x; ! ! data = "Room: " + file_name(environment(this_player())); ! bug = implode(args, " "); ! if( x = (int)BUGS_D->eventReport((string)this_player()->GetCapName(), ! "approval", bug, data) ) { ! BUGS_D->eventAssign(x, query_privs(environment(this_player()))); ! message("system", "Bug reported.", this_player()); ! return; ! } ! else { ! message("system", "Error in reporting bug.", this_player()); return; } } - else EndReport(0, "Room: " + file_name(environment(this_player())), 0); - } ! static void EndReport(string type, string data, string file) { ! string tmp; ! int x; - if( !type ) { - message("system", "Choose a bug type from among the following:\n", - this_player()); - message("system", "\tidea (some nifty idea to add to the game)", - this_player()); - message("system", "\ttypo (misspelling, lexigraphical weirdness)", - this_player()); - message("system", "\tunexplained behaviour (something " - "contrary to how you would expect it)", this_player()); - message("system", "\truntime (one of those nasty error messages)\n", - this_player()); - message("system", "\tother\n", this_player()); - message("prompt", "Enter type: ", this_player()); - input_to( (: EndReport :), data, 0); - return; - } - if( !file ) { file = DIR_TMP "/" + (string)this_player()->GetKeyName(); rm(file); ! message("system", "Enter in a description of the bug. When done, " ! "enter a period on a line by itself.", this_player()); ! this_player()->eventEdit(file, (: EndReport, type, data, file :)); ! return; ! } ! if( !(tmp = read_file(file)) ) { ! message("system", "Bug report aborted.", this_player()); ! rm(file); ! return; } - rm(file); - if( type == "runtime" ) { - mapping last_error; ! if( last_error = (mapping)this_player()->GetLastError() ) ! data += "\n" + (string)master()->standard_trace(last_error) + "\n"; ! } ! if( !(x = (int)BUGS_D->eventReport((string)this_player()->GetCapName(), ! type, tmp, data)) ) { ! message("system", "Bug report failed.", this_player()); ! return; ! } ! message("system", "Bug reported, thank you! Your tracking id is " + ! x + ".", this_player()); ! } ! varargs static void View(string *args, int print) { ! mapping bugs; ! function f; ! string whose; ! int x; ! ! f = function() { ! message("prompt", "\nHit return: ", this_player()); ! input_to( (: PreMenu :) ); ! }; ! if( !sizeof(args) ) { ! message("system", "View:\n\t1) all bugs\n" ! "\t2) unassigned bugs only\n" ! "\t3) assigned bugs only\n" ! "\t4) completed bugs only\n", this_player()); ! if( creatorp(this_player()) ) ! message("prompt", "Enter a choice [3]: " , this_player()); ! else message("prompt", "Enter a choice [1]: ", this_player()); ! input_to(function(string str, string it_sucks, int print) { ! if( !str || str == "" ) { ! if( creatorp(this_player()) ) str = "3"; ! else str = "1"; ! } ! if( str < "1" || str > "4" ) { ! message("system", "Invalid selection", this_player()); message("prompt", "Hit return: ", this_player()); input_to( (: PreMenu :) ); return; ! } ! View( ({ str }), print ); ! }, "", print); ! return; ! } ! else if( sizeof(args) == 1 && !creatorp(this_player()) ) { ! mapping bug; ! string tmp = ""; ! int bug_id; ! ! bugs = (mapping)BUGS_D->GetBugs(); ! foreach( bug_id, bug in bugs ) { ! if( bug["who"] != (string)this_player()->GetCapName() ) ! continue; ! if( args[0] == "1" || (args[0] == "2" && !bug["assigned"]) || ! (args[0] == "3" && bug["assigned"] && !bug["date fixed"]) || ! (args[0] == "4" && bug["date fixed"]) ) ! tmp += GetBugString(bug_id, bugs) + "\n*****\n\n"; ! } ! if( tmp == "" ) { ! message("system", "No bugs meet your query criteria.", ! this_player()); ! message("prompt", "Hit return: ", this_player()); ! input_to( (: PreMenu :) ); ! return; ! } ! this_player()->eventPage(explode(tmp, "\n"), MSG_SYSTEM, f); ! return; ! } ! else if( sizeof(args) == 1 ) { ! message("system", "View:\n\t1) all bugs\n" ! "\t2) bugs assigned to me\n" ! "\t3) bugs reported by me\n", this_player()); ! message("prompt", "Enter choice [2]: ", this_player()); ! input_to(function(string str, string one, int print) { ! if( !str || str == "" ) str = "2"; ! else if( str < "1" || str > "3" ) { ! message("system", "Invalid selection.", this_player()); message("prompt", "Hit return: ", this_player()); input_to( (: PreMenu :) ); return; } ! View( ({ one, str }), print ); ! }, args[0], print); ! return; ! } ! else { ! mapping bug; ! string nom, tmp = ""; ! int bug_id; ! ! nom = (string)this_player()->GetKeyName(); ! bugs = (mapping)BUGS_D->GetBugs(); ! if( !creatorp(this_player()) ) { ! View( ({ args[0] }), print ); ! return; } - else foreach(bug_id, bug in bugs) { - string opt1, opt2; ! opt1 = args[0]; ! opt2 = args[1]; ! if( opt1 == "1" && opt2 == "1" ) ! tmp += GetBugString(bug_id, bugs) + "\n*****\n\n"; ! else { ! if( opt2 == "2" && (!bug["assigned"] || ! convert_name(bug["assigned"]) != nom) ) ! continue; ! else if(opt2 == "3" && convert_name(bug["who"]) != nom ) ! continue; ! if( opt1 == "2" && !bug["assigned"] ) ! tmp += GetBugString(bug_id, bugs) + "\n*****\n\n"; ! else if( opt1 == "3" && bug["assigned"] && !bug["date fixed"] ) ! tmp += GetBugString(bug_id, bugs) + "\n*****\n\n"; ! else if( opt1 == "4" && bug["date fixed"] ) ! tmp += GetBugString(bug_id, bugs) + "\n*****\n\n"; } } - if( tmp == "" ) { - message("system", "No bugs match your query.", this_player()); - message("prompt", "Hit return: ", this_player()); - input_to( (: PreMenu :) ); - return; - } - if( print && creatorp(this_player()) ) { - string file; - - rm(file = user_path((string)this_player()->GetKeyName()) + "bugs"); - write_file(file, strip_colours(tmp)); - } - else this_player()->eventPage(explode(tmp, "\n"), MSG_SYSTEM, f); - return; - } - } ! static string GetBugString(int id, mapping bugs) { ! string tmp; ! tmp = "%^YELLOW%^Bug ID:%^RESET%^ " + id + "\n"; ! tmp += "%^YELLOW%^Reported by:%^RESET%^ " + ! bugs[id]["who"] + "\n"; ! if( bugs[id]["assigned"] ) { ! tmp += "%^YELLOW%^Status: %^RESET%^"; ! if( !bugs[id]["date fixed"] ) ! tmp += "assigned to " + bugs[id]["assigned"] + "\n"; ! else tmp += "completed " + ctime(bugs[id]["date fixed"]) + "\n"; ! } ! else tmp += "%^YELLOW%^Status:%^RESET%^ unassigned\n"; ! tmp += "%^YELLOW%^Type:%^RESET%^ " + bugs[id]["type"] + "\n"; ! if( bugs[id]["date fixed"] ) ! tmp += "%^YELLOW%^Notes:%^RESET%^\n" + bugs[id]["resolution"] + "\n"; ! if( creatorp(this_player()) ) ! tmp += "\n%^YELLOW%^Creator info:%^RESET%^\n" + bugs[id]["data"] + "\n"; ! tmp += "\n%^YELLOW%^Bug info:%^RESET%^\n" + bugs[id]["bug"] + "\n"; ! return tmp; ! } ! string GetHelp(string str) { ! string tmp; - tmp = "Syntax: <bug>\n"; - if( creatorp(this_player()) ) { - tmp += " <bug -a (BUG_ID CREATOR>)\n"; - tmp += " <bug -c (BUG_ID)>\n"; - } - if( archp(this_player()) ) tmp += " <bug -d (BUG_ID)>\n"; - tmp += " <bug -r>\n <bug -v ([1-4] [1-3])>\n\n"; - tmp += "The command interface to the Dead Souls Bug Tracking System. " - "You can simply type \"bug\" and be prompted for further options, " - "or, if you understand the system, pass command line arguments " - "to the bug command to make things go faster. This system allows " - "players to report bugs or ideas and periodically see what has " - "been done about their report. It also allows creators a way " - "to track bugs which have been reported to them and give feedback " - "to the players who have reported them. It gives admins a way to " - "track and assign mudlib level bugs. The options above correspond " - "to assigning, completing, deleting, reporting, and viewing bugs " - "respectively.\n\n" - "See also: praise"; - return tmp; - } - --- 99,509 ---- if( !creatorp(this_player()) ) { message("system", "Only creators may use the -a option.", ! this_player()); return; } if( !(i = sizeof(args)) ) { message("prompt", "Enter in the bug ID: ", this_player()); input_to(function(string str) { Assign(({ str })); }); ! return; ! } ! else if( i == 1 ) { ! int x; ! ! if( (x = to_int(args[0])) > 0 ) { /* assume a bug id for now */ ! if( !archp(this_player()) ) ! Assign( ({ args[0], (string)this_player()->GetCapName() }) ); ! else { ! message("prompt", "Enter the creator to assign it to [" + ! (string)this_player()->GetCapName() + "]: ", ! this_player()); ! input_to(function(string str, string id) { ! if( !str || str == "" ) ! str = (string)this_player()->GetCapName(); ! Assign( ({ str, id }) ); ! }, args[0]); ! } ! return; ! } else { ! message("prompt", "Enter in the bug ID to assign to " + ! capitalize(args[0]) + ": ", this_player()); ! input_to(function(string id, string str) { ! Assign( ({ id, str }) ); ! }, args[0]); ! return; } } ! else if( i == 2 ) { ! message("prompt", "Do you wish to comment? [n]: ", this_player()); ! input_to(function(string str, string *args) { ! if( !str || str == "" ) str = "n"; ! else str = lower_case(str[0..0]); ! if( str == "y" ) { ! string file; ! ! message("system", "Enter comments on the bug...", ! this_player()); ! file = DIR_TMP "/" + (string)this_player()->GetKeyName(); ! rm(file); ! this_player()->eventEdit(file, (: EndAssign, args :)); ! return; ! } ! else Assign(args + ({ "" })); ! }, args); return; } ! else { ! string who, comments; ! int x; ! if( (x = to_int(args[0])) < 1 ) { ! who = args[0]; ! if( (x = to_int(args[1])) < 1 ) { ! message("system", "Invalid bug ID " + x + ".", this_player()); ! message("prompt", "Hit return: ", this_player()); ! input_to( (: PreMenu :) ); ! return; ! } ! } ! else who = args[1]; ! comments = args[2]; ! if( !archp(this_player()) && (convert_name(who) != ! (string)this_player()->GetKeyName()) ) { ! message("system", "Only arches may assign bugs to other people.", ! this_player()); ! message("prompt", "Hit return: ", this_player()); ! input_to( (: PreMenu :) ); return; } ! if( !user_exists(convert_name(who)) ) { ! message("system", "No such creator: " + who, this_player()); message("prompt", "Hit return: ", this_player()); input_to( (: PreMenu :) ); return; } ! if( !((int)BUGS_D->eventAssign(x, who)) ) { ! message("system", "Failed to assign bug.", this_player()); ! return; ! } ! if( comments != "" ) BUGS_D->AddComment(x, comments); ! message("system", "Assigned bug to " + who + ".", this_player()); return; } } ! static void EndAssign(string *args) { ! string file, contents; file = DIR_TMP "/" + (string)this_player()->GetKeyName(); + contents = (read_file(file) || ""); rm(file); ! Assign(args + ({ contents })); } ! static void Complete(string *args) { ! string file; ! int x; ! if( !sizeof(args) ) { ! message("prompt", "Enter the bug ID: ", this_player()); ! input_to(function(string str) { Complete( ({ str }) ); }); ! return; ! } ! else if( !creatorp(this_player()) ) { ! message("system", "Invalid command.", this_player()); message("prompt", "Hit return: ", this_player()); input_to( (: PreMenu :) ); return; ! } ! else if( (x = to_int(args[0])) < 1 ) { ! message("system", "Invalid bug ID.", this_player()); message("prompt", "Hit return: ", this_player()); input_to( (: PreMenu :) ); return; } ! message("system", "Enter in your comments:", this_player()); ! file = DIR_TMP "/" + (string)this_player()->GetKeyName(); ! if( file_exists(file) ) rm(file); ! this_player()->eventEdit(file, (: EndComplete, x :)); } ! void EndComplete(int x) { ! string file, stuff; ! ! if( previous_object() != this_player(1) ) return; ! file = DIR_TMP "/" + (string)this_player()->GetKeyName(); ! if( !(stuff = read_file(file)) ) { ! message("system", "Edit aborted.", this_player()); ! rm(file); ! return; } + rm(file); + if( !((int)BUGS_D->eventComplete(x, stuff)) ) { + message("system", "Failed to set the bug completed.", this_player()); + return; + } + message("system", "Bug marked completed!", this_player()); } ! static void Delete(string *args) { ! if( !archp(this_player()) ) { ! message("system","You must be an arch to delete bugs.", this_player()); ! return; ! } ! if( !sizeof(args) ) { ! message("prompt", "Delete which bug? ", this_player()); ! input_to(function(string str) { Delete( ({ str }) ); }); ! return; ! } ! else { ! int x; ! ! if( (x = to_int(args[0])) < 1 ) ! message("system", "Invalid bug ID.", this_player()); ! else if( !((int)BUGS_D->eventDelete(x)) ) ! message("system", "Delete failed.", this_player()); ! else message("system", "Deletion succeeded.", this_player()); ! return; ! } ! } ! static void Report(string *args) { ! if( archp(this_player()) && sizeof(args) ) { ! string data; ! string bug; ! int x; ! ! data = "Room: " + file_name(environment(this_player())); ! bug = implode(args, " "); ! if( x = (int)BUGS_D->eventReport((string)this_player()->GetCapName(), ! "approval", bug, data) ) { ! BUGS_D->eventAssign(x, query_privs(environment(this_player()))); ! message("system", "Bug reported.", this_player()); ! return; ! } ! else { ! message("system", "Error in reporting bug.", this_player()); ! return; ! } ! } ! else EndReport(0, "Room: " + file_name(environment(this_player())), 0); ! } ! static void EndReport(string type, string data, string file) { ! string tmp; ! int x; ! ! if( !type ) { ! message("system", "Choose a bug type from among the following:\n", ! this_player()); ! message("system", "\tidea (some nifty idea to add to the game)", ! this_player()); ! message("system", "\ttypo (misspelling, lexigraphical weirdness)", ! this_player()); ! message("system", "\tunexplained behaviour (something " ! "contrary to how you would expect it)", this_player()); ! message("system", "\truntime (one of those nasty error messages)\n", ! this_player()); ! message("system", "\tother\n", this_player()); ! message("prompt", "Enter type: ", this_player()); ! input_to( (: EndReport :), data, 0); ! return; ! } ! if( !file ) { ! file = DIR_TMP "/" + (string)this_player()->GetKeyName(); ! rm(file); ! message("system", "Enter in a description of the bug. When done, " ! "enter a period on a line by itself.", this_player()); ! this_player()->eventEdit(file, (: EndReport, type, data, file :)); ! return; ! } ! if( !(tmp = read_file(file)) ) { ! message("system", "Bug report aborted.", this_player()); ! rm(file); ! return; ! } ! rm(file); ! if( type == "runtime" ) { ! mapping last_error; ! ! if( last_error = (mapping)this_player()->GetLastError() ) ! data += "\n" + (string)master()->standard_trace(last_error) + "\n"; ! } ! if( !(x = (int)BUGS_D->eventReport((string)this_player()->GetCapName(), ! type, tmp, data)) ) { ! message("system", "Bug report failed.", this_player()); ! return; ! } ! message("system", "Bug reported, thank you! Your tracking id is " + ! x + ".", this_player()); ! } ! ! varargs static void View(string *args, int print) { ! mapping bugs; ! function f; ! ! f = function() { ! message("prompt", "\nHit return: ", this_player()); ! input_to( (: PreMenu :) ); ! }; ! if( !sizeof(args) ) { ! message("system", "View:\n\t1) all bugs\n" ! "\t2) unassigned bugs only\n" ! "\t3) assigned bugs only\n" ! "\t4) completed bugs only\n", this_player()); ! if( creatorp(this_player()) ) ! message("prompt", "Enter a choice [3]: " , this_player()); ! else message("prompt", "Enter a choice [1]: ", this_player()); ! input_to(function(string str, string it_sucks, int print) { ! if( !str || str == "" ) { ! if( creatorp(this_player()) ) str = "3"; ! else str = "1"; ! } ! if( str < "1" || str > "4" ) { ! message("system", "Invalid selection", this_player()); ! message("prompt", "Hit return: ", this_player()); ! input_to( (: PreMenu :) ); ! return; ! } ! View( ({ str }), print ); ! }, "", print); ! return; ! } ! else if( sizeof(args) == 1 && !creatorp(this_player()) ) { ! mapping bug; ! string tmp = ""; ! int bug_id; ! ! bugs = (mapping)BUGS_D->GetBugs(); ! foreach( bug_id, bug in bugs ) { ! if( bug["who"] != (string)this_player()->GetCapName() ) ! continue; ! if( args[0] == "1" || (args[0] == "2" && !bug["assigned"]) || ! (args[0] == "3" && bug["assigned"] && !bug["date fixed"]) || ! (args[0] == "4" && bug["date fixed"]) ) ! tmp += GetBugString(bug_id, bugs) + "\n*****\n\n"; ! } ! if( tmp == "" ) { ! message("system", "No bugs meet your query criteria.", ! this_player()); ! message("prompt", "Hit return: ", this_player()); ! input_to( (: PreMenu :) ); ! return; ! } ! this_player()->eventPage(explode(tmp, "\n"), MSG_SYSTEM, f); ! return; ! } ! else if( sizeof(args) == 1 ) { ! message("system", "View:\n\t1) all bugs\n" ! "\t2) bugs assigned to me\n" ! "\t3) bugs reported by me\n", this_player()); ! message("prompt", "Enter choice [2]: ", this_player()); ! input_to(function(string str, string one, int print) { ! if( !str || str == "" ) str = "2"; ! else if( str < "1" || str > "3" ) { ! message("system", "Invalid selection.", this_player()); ! message("prompt", "Hit return: ", this_player()); ! input_to( (: PreMenu :) ); ! return; ! } ! View( ({ one, str }), print ); ! }, args[0], print); ! return; ! } ! else { ! mapping bug; ! string nom, tmp = ""; ! int bug_id; ! ! nom = (string)this_player()->GetKeyName(); ! bugs = (mapping)BUGS_D->GetBugs(); ! if( !creatorp(this_player()) ) { ! View( ({ args[0] }), print ); ! return; ! } ! else foreach(bug_id, bug in bugs) { ! string opt1, opt2; ! ! opt1 = args[0]; ! opt2 = args[1]; ! if( opt1 == "1" && opt2 == "1" ) ! tmp += GetBugString(bug_id, bugs) + "\n*****\n\n"; ! else { ! if( opt2 == "2" && (!bug["assigned"] || ! convert_name(bug["assigned"]) != nom) ) ! continue; ! else if(opt2 == "3" && convert_name(bug["who"]) != nom ) ! continue; ! if( opt1 == "2" && !bug["assigned"] ) ! tmp += GetBugString(bug_id, bugs) + "\n*****\n\n"; ! else if( opt1 == "3" && bug["assigned"] && !bug["date fixed"] ) ! tmp += GetBugString(bug_id, bugs) + "\n*****\n\n"; ! else if( opt1 == "4" && bug["date fixed"] ) ! tmp += GetBugString(bug_id, bugs) + "\n*****\n\n"; ! } ! } ! if( tmp == "" ) { ! message("system", "No bugs match your query.", this_player()); ! message("prompt", "Hit return: ", this_player()); ! input_to( (: PreMenu :) ); ! return; ! } ! if( print && creatorp(this_player()) ) { ! string file; ! ! rm(file = user_path((string)this_player()->GetKeyName()) + "bugs"); ! write_file(file, strip_colours(tmp)); ! } ! else this_player()->eventPage(explode(tmp, "\n"), MSG_SYSTEM, f); ! return; ! } ! } ! ! static string GetBugString(int id, mapping bugs) { ! string tmp; ! ! tmp = "%^YELLOW%^Bug ID:%^RESET%^ " + id + "\n"; ! tmp += "%^YELLOW%^Reported by:%^RESET%^ " + ! bugs[id]["who"] + "\n"; ! if( bugs[id]["assigned"] ) { ! tmp += "%^YELLOW%^Status: %^RESET%^"; ! if( !bugs[id]["date fixed"] ) ! tmp += "assigned to " + bugs[id]["assigned"] + "\n"; ! else tmp += "completed " + ctime(bugs[id]["date fixed"]) + "\n"; ! } ! else tmp += "%^YELLOW%^Status:%^RESET%^ unassigned\n"; ! tmp += "%^YELLOW%^Type:%^RESET%^ " + bugs[id]["type"] + "\n"; ! if( bugs[id]["date fixed"] ) ! tmp += "%^YELLOW%^Notes:%^RESET%^\n" + bugs[id]["resolution"] + "\n"; ! if( creatorp(this_player()) ) ! tmp += "\n%^YELLOW%^Creator info:%^RESET%^\n" + bugs[id]["data"] + "\n"; ! tmp += "\n%^YELLOW%^Bug info:%^RESET%^\n" + bugs[id]["bug"] + "\n"; ! return tmp; ! } ! ! string GetHelp(string str) { ! string tmp; ! ! tmp = "Syntax: <bug>\n"; ! if( creatorp(this_player()) ) { ! tmp += " <bug -a (BUG_ID CREATOR>)\n"; ! tmp += " <bug -c (BUG_ID)>\n"; ! } ! if( archp(this_player()) ) tmp += " <bug -d (BUG_ID)>\n"; ! tmp += " <bug -r>\n <bug -v ([1-4] [1-3])>\n\n"; ! tmp += "The command interface to the Dead Souls Bug Tracking System. " ! "You can simply type \"bug\" and be prompted for further options, " ! "or, if you understand the system, pass command line arguments " ! "to the bug command to make things go faster. This system allows " ! "players to report bugs or ideas and periodically see what has " ! "been done about their report. It also allows creators a way " ! "to track bugs which have been reported to them and give feedback " ! "to the players who have reported them. It gives admins a way to " ! "track and assign mudlib level bugs. The options above correspond " ! "to assigning, completing, deleting, reporting, and viewing bugs " ! "respectively.\n\n" ! "See also: praise"; ! return tmp; ! } diff -c -r --new-file ds1.1/lib/secure/cmds/players/chfn.c ds2.0r27/lib/secure/cmds/players/chfn.c *** ds1.1/lib/secure/cmds/players/chfn.c Sun Feb 1 21:30:31 1998 --- ds2.0r27/lib/secure/cmds/players/chfn.c Wed Jul 5 00:01:12 2006 *************** *** 13,19 **** string rname; message("system", "Changing user information for " + ! (string)previous_object()->GetCapName() + ": ", previous_object()); rname = (string)previous_object()->GetRealName(); message("prompt", "Real name [" + rname + "] ", previous_object()); f = function(string str, string old, object ob) { --- 13,19 ---- string rname; message("system", "Changing user information for " + ! (string)previous_object()->GetCapName() + ": ", previous_object()); rname = (string)previous_object()->GetRealName(); message("prompt", "Real name [" + rname + "] ", previous_object()); f = function(string str, string old, object ob) { *************** *** 27,36 **** else message("system", "Real name unchanged.", ob); str = (string)ob->GetEmail(); message("prompt", "Email (preceed with # to make admin only) [" ! + str + "] ", ob); g = function(string str, string old, object ob) { function h; ! if( !str || str == "" ) str = old; if( str != old ) { string a, b; --- 27,36 ---- else message("system", "Real name unchanged.", ob); str = (string)ob->GetEmail(); message("prompt", "Email (preceed with # to make admin only) [" ! + str + "] ", ob); g = function(string str, string old, object ob) { function h; ! if( !str || str == "" ) str = old; if( str != old ) { string a, b; *************** *** 46,82 **** str = (ob->GetWebPage() || ""); message("prompt", "Home Page [" + str + "]: ", ob); h = function(string str, object who) { ! if( str == "" ) { ! str = 0; } ! else if( str ) { ! if( strlen(str) < 5 ) { str = "http://" + str; } - else { - if( str[0..3] != "http" ) { - str = "http://" + str; - } - } - } - if( !str ) { - message("system", "Home paged unchanged.", who); } ! else { ! who->SetWebPage(str); message("system", "Home page changed.", who); ! } ! }; input_to(h, 0, ob); }; input_to(g, 0, str, ob); }; input_to(f, "" + rname, previous_object()); return 1; } void help() { message("help", "Syntax: <chfn>\n\n" ! "Allows you to change your real life information.\n\n" ! "See also: passwd", this_player()); } --- 46,90 ---- str = (ob->GetWebPage() || ""); message("prompt", "Home Page [" + str + "]: ", ob); h = function(string str, object who) { ! if( str == "" ) { ! str = 0; ! } ! else if( str ) { ! if( strlen(str) < 5 ) { ! str = "http://" + str; } ! else { ! if( str[0..3] != "http" ) { str = "http://" + str; } } ! } ! if( !str ) { ! message("system", "Home paged unchanged.", who); ! } ! else { ! who->SetWebPage(str); message("system", "Home page changed.", who); ! this_player()->save_player((string)this_player()->GetKeyName()); ! update("/secure/daemon/finger"); ! } ! }; input_to(h, 0, ob); + this_player()->save_player((string)this_player()->GetKeyName()); + update("/secure/daemon/finger"); }; input_to(g, 0, str, ob); + this_player()->save_player((string)this_player()->GetKeyName()); + update("/secure/daemon/finger"); }; input_to(f, "" + rname, previous_object()); + this_player()->save_player((string)this_player()->GetKeyName()); + update("/secure/daemon/finger"); return 1; } void help() { message("help", "Syntax: <chfn>\n\n" ! "Allows you to change your real life information.\n\n" ! "See also: passwd", this_player()); } diff -c -r --new-file ds1.1/lib/secure/cmds/players/finger.c ds2.0r27/lib/secure/cmds/players/finger.c *** ds1.1/lib/secure/cmds/players/finger.c Sun Feb 1 21:30:31 1998 --- ds2.0r27/lib/secure/cmds/players/finger.c Wed Jul 5 00:01:12 2006 *************** *** 8,16 **** void remote_finger(object me, string target, string mud); mixed cmd(string str) { - object ob; string wer, wo; if(!str) { string ret; --- 8,17 ---- void remote_finger(object me, string target, string mud); mixed cmd(string str) { string wer, wo; + if(!str) return "Finger whom?"; + if(!str) { string ret; *************** *** 20,26 **** return 1; } else if(sscanf(str, "%s@%s", wer, wo)) ! remote_finger(this_player(), (wer ? wer : ""), wo); else { string ret; --- 21,27 ---- return 1; } else if(sscanf(str, "%s@%s", wer, wo)) ! remote_finger(this_player(), (wer ? wer : ""), wo); else { string ret; *************** *** 30,48 **** } return 1; } ! void remote_finger(object ob, string who, string mud) { - int tc_flag, ud_flag, id; if( !(mud = (string)INTERMUD_D->GetMudName(mud)) ) { message("system", mud_name() + " is blissfully unaware of the MUD " ! "you seek.", this_player()); return; } SERVICES_D->eventSendFingerRequest(convert_name(who), mud); message("system", "Remote finger sent to " + mud + ".", this_player()); } ! void help() { message("help", "Syntax: <finger (([player])(@)([mud]))>\n\n" --- 31,48 ---- } return 1; } ! void remote_finger(object ob, string who, string mud) { if( !(mud = (string)INTERMUD_D->GetMudName(mud)) ) { message("system", mud_name() + " is blissfully unaware of the MUD " ! "you seek.", this_player()); return; } SERVICES_D->eventSendFingerRequest(convert_name(who), mud); message("system", "Remote finger sent to " + mud + ".", this_player()); } ! void help() { message("help", "Syntax: <finger (([player])(@)([mud]))>\n\n" diff -c -r --new-file ds1.1/lib/secure/cmds/players/history.c ds2.0r27/lib/secure/cmds/players/history.c *** ds1.1/lib/secure/cmds/players/history.c Sun Feb 1 21:30:31 1998 --- ds2.0r27/lib/secure/cmds/players/history.c Wed Jul 5 00:01:12 2006 *************** *** 12,24 **** mixed cmd(string args) { int x; ! if( x = to_int(args) ) { if( (int)previous_object()->SetHistorySize(x) != x ) { if( x < MIN_HISTORY_SIZE ) ! return "History size must be at least " + MIN_HISTORY_SIZE + "."; else if( x > MAX_HISTORY_SIZE ) ! return "History size can be no larger than " + MAX_HISTORY_SIZE + "."; else return "Invalid history size."; } --- 12,24 ---- mixed cmd(string args) { int x; ! if( x = to_int(args) ) { if( (int)previous_object()->SetHistorySize(x) != x ) { if( x < MIN_HISTORY_SIZE ) ! return "History size must be at least " + MIN_HISTORY_SIZE + "."; else if( x > MAX_HISTORY_SIZE ) ! return "History size can be no larger than " + MAX_HISTORY_SIZE + "."; else return "Invalid history size."; } *************** *** 29,35 **** else { string array history, arr, tmp = ({}); int cmd_num, i; ! history = (string array)previous_object()->GetHistoryList(); cmd_num = (int)previous_object()->GetCommandNumber(); x = (cmd_num - 2) % sizeof(history); --- 29,35 ---- else { string array history, arr, tmp = ({}); int cmd_num, i; ! history = (string array)previous_object()->GetHistoryList(); cmd_num = (int)previous_object()->GetCommandNumber(); x = (cmd_num - 2) % sizeof(history); *************** *** 45,71 **** } return 1; } ! string GetHelp(string str) { return ("Syntax: <history>\n" ! " <history SIZE>\n\n" ! "This command lets you check your command history. A command " ! "history is kept for the commands you enter, allowing you " ! "quick access to execute or modify previous commands. The size " ! "of your command buffer defaults to " + MIN_HISTORY_SIZE + " but " ! "may be expanded to " + MAX_HISTORY_SIZE + " if you desire. You " ! "can change the size of your history buffer by passing the size " ! "as an argument to the history command. Without arguments, the " ! "command simply prints the commands in your history buffer.\n\n" ! "The following syntaxes are available for accessing previously " ! "issued commands:\n" ! "\t!!\t\texecute the last command\n" ! "\t!#\t\texecute command number #\n" ! "\t!-#\t\texecute #th command prior\n" ! "\t^old^new\treplace 'old' with 'new' in last command and " ! "execute\n" ! "\t!#^old^new\tsame as above, except for command number #\n" ! "\t!#s/old/new/g\tsame as above, except replacing all " ! "occurrences of 'old'\n\n" ! "See also: alias, nickname"); } --- 45,71 ---- } return 1; } ! string GetHelp(string str) { return ("Syntax: <history>\n" ! " <history SIZE>\n\n" ! "This command lets you check your command history. A command " ! "history is kept for the commands you enter, allowing you " ! "quick access to execute or modify previous commands. The size " ! "of your command buffer defaults to " + MIN_HISTORY_SIZE + " but " ! "may be expanded to " + MAX_HISTORY_SIZE + " if you desire. You " ! "can change the size of your history buffer by passing the size " ! "as an argument to the history command. Without arguments, the " ! "command simply prints the commands in your history buffer.\n\n" ! "The following syntaxes are available for accessing previously " ! "issued commands:\n" ! "\t!!\t\texecute the last command\n" ! "\t!#\t\texecute command number #\n" ! "\t!-#\t\texecute #th command prior\n" ! "\t^old^new\treplace 'old' with 'new' in last command and " ! "execute\n" ! "\t!#^old^new\tsame as above, except for command number #\n" ! "\t!#s/old/new/g\tsame as above, except replacing all " ! "occurrences of 'old'\n\n" ! "See also: alias, nickname"); } diff -c -r --new-file ds1.1/lib/secure/cmds/players/mc.c ds2.0r27/lib/secure/cmds/players/mc.c *** ds1.1/lib/secure/cmds/players/mc.c Sun Feb 1 21:30:31 1998 --- ds2.0r27/lib/secure/cmds/players/mc.c Wed Jul 5 00:01:12 2006 *************** *** 10,25 **** mixed cmd(string args) { string file; float net_worth, max_worth; ! file = MONEY_DIR + (string)previous_object()->GetKeyName(); account = ([]); if( !file_exists(file + __SAVE_EXTENSION__) ) ! return "You have no bank account on the old Dead Souls."; restore_object(file); foreach(string bank, mapping data in account) { foreach(string curr, int val in data) { float tmp; ! if( curr == "time" || curr == "transaction" ) continue; if( (tmp = currency_rate(curr)) < 1 ) continue; net_worth += val / tmp; --- 10,25 ---- mixed cmd(string args) { string file; float net_worth, max_worth; ! file = MONEY_DIR + (string)previous_object()->GetKeyName(); account = ([]); if( !file_exists(file + __SAVE_EXTENSION__) ) ! return "You have no bank account on the old Dead Souls."; restore_object(file); foreach(string bank, mapping data in account) { foreach(string curr, int val in data) { float tmp; ! if( curr == "time" || curr == "transaction" ) continue; if( (tmp = currency_rate(curr)) < 1 ) continue; net_worth += val / tmp; *************** *** 28,49 **** max_worth = (int)previous_object()->GetLevel() * 2000; if( net_worth > max_worth ) net_worth = max_worth; if( previous_object()->AddBank("Mariner's Bank of Praxis", "electrum", ! to_int(currency_value(net_worth, "electrum"))) ! < 0 ) return "An error occurred in conversion."; unguarded((: rm, file + __SAVE_EXTENSION__ :)); previous_object()->eventPrint("You should now save, since a game crash " ! "between now and your next save will " ! "lose all money frm your newly created " ! "Praxis account without allowing you to " ! "convert again.", MSG_SYSTEM); return 1; } string GetHelp(string str) { return ("Syntax: <mc>\n\n" ! "For people with old Dead Souls bank accounts, this allows " ! "you to convert that bank account over into " ! "the Mariner's Bank of Praxis."); } ! --- 28,49 ---- max_worth = (int)previous_object()->GetLevel() * 2000; if( net_worth > max_worth ) net_worth = max_worth; if( previous_object()->AddBank("Mariner's Bank of Praxis", "electrum", ! to_int(currency_value(net_worth, "electrum"))) ! < 0 ) return "An error occurred in conversion."; unguarded((: rm, file + __SAVE_EXTENSION__ :)); previous_object()->eventPrint("You should now save, since a game crash " ! "between now and your next save will " ! "lose all money frm your newly created " ! "Praxis account without allowing you to " ! "convert again.", MSG_SYSTEM); return 1; } string GetHelp(string str) { return ("Syntax: <mc>\n\n" ! "For people with old Dead Souls bank accounts, this allows " ! "you to convert that bank account over into " ! "the Mariner's Bank of Praxis."); } ! diff -c -r --new-file ds1.1/lib/secure/cmds/players/passwd.c ds2.0r27/lib/secure/cmds/players/passwd.c *** ds1.1/lib/secure/cmds/players/passwd.c Sun Feb 1 21:30:32 1998 --- ds2.0r27/lib/secure/cmds/players/passwd.c Wed Jul 5 00:01:12 2006 *************** *** 15,33 **** object ob; if( (int)previous_object()->GetForced() ) ! return "You cannot be forced to change your password."; if( args && args != "" ) { if( !archp(previous_object()) ) ! return "You may not change other people's passwords."; if( !user_exists(args = convert_name(args)) ) ! return "No such user exists."; ob = find_player(args); } else ob = previous_object(); previous_object()->eventPrint("Changing password for " + ! (ob ? (string)ob->GetCapName() : ! capitalize(args)) + " on " + ! mud_name() + ".", MSG_SYSTEM); if( previous_object() == ob ) { ob->eventPrint("Old password: ", MSG_PROMPT); input_to( (: OldPass :), I_NOECHO | I_NOESC, ob); --- 15,33 ---- object ob; if( (int)previous_object()->GetForced() ) ! return "You cannot be forced to change your password."; if( args && args != "" ) { if( !archp(previous_object()) ) ! return "You may not change other people's passwords."; if( !user_exists(args = convert_name(args)) ) ! return "No such user exists."; ob = find_player(args); } else ob = previous_object(); previous_object()->eventPrint("Changing password for " + ! (ob ? (string)ob->GetCapName() : ! capitalize(args)) + " on " + ! mud_name() + ".", MSG_SYSTEM); if( previous_object() == ob ) { ob->eventPrint("Old password: ", MSG_PROMPT); input_to( (: OldPass :), I_NOECHO | I_NOESC, ob); *************** *** 41,47 **** static void OldPass(string pass, object who) { string oldpass; ! if( who != this_player() ) return; if( !pass || pass == "" ) { who->eventPrint("\nPassword change failed.", MSG_SYSTEM); --- 41,47 ---- static void OldPass(string pass, object who) { string oldpass; ! if( who != this_player() ) return; if( !pass || pass == "" ) { who->eventPrint("\nPassword change failed.", MSG_SYSTEM); *************** *** 59,66 **** static void NewPass(string pass, mixed who) { if( !pass || strlen(pass) < 5 ) { this_player()->eventPrint("Password must be at least 5 " ! "characters, password change failed.", ! MSG_SYSTEM); return; } this_player()->eventPrint("\nConfirm: ", MSG_PROMPT); --- 59,66 ---- static void NewPass(string pass, mixed who) { if( !pass || strlen(pass) < 5 ) { this_player()->eventPrint("Password must be at least 5 " ! "characters, password change failed.", ! MSG_SYSTEM); return; } this_player()->eventPrint("\nConfirm: ", MSG_PROMPT); *************** *** 81,89 **** unguarded((: rm, who :)); foreach(string line in lines) { string val; ! if( sscanf(line, "Password %s", val) ) ! line = "Password \"" + crypt(newpass, 0) + "\""; unguarded((: write_file, who, line + "\n" :)); } } --- 81,89 ---- unguarded((: rm, who :)); foreach(string line in lines) { string val; ! if( sscanf(line, "Password %s", val) ) ! line = "Password \"" + crypt(newpass, 0) + "\""; unguarded((: write_file, who, line + "\n" :)); } } *************** *** 92,100 **** string GetHelp(string str) { return ("Syntax: <passwd>\n" ! " <passwd PLAYER>\n\n" ! "If you are not an arch, then the second syntax is not available " ! "to you. This command allows you to change your password.\n\n" ! "See also: chfn"); } ! --- 92,100 ---- string GetHelp(string str) { return ("Syntax: <passwd>\n" ! " <passwd PLAYER>\n\n" ! "If you are not an arch, then the second syntax is not available " ! "to you. This command allows you to change your password.\n\n" ! "See also: chfn"); } ! diff -c -r --new-file ds1.1/lib/secure/cmds/players/peer.c ds2.0r27/lib/secure/cmds/players/peer.c *** ds1.1/lib/secure/cmds/players/peer.c Sun Feb 1 21:30:32 1998 --- ds2.0r27/lib/secure/cmds/players/peer.c Wed Jul 5 00:01:12 2006 *************** *** 2,119 **** * Peer into an adjacent room wihout actually entering * Blitz@Dead SoulsIV */ ! #include <lib.h> ! inherit LIB_DAEMON; ! string DescribeItems(mixed var); string DescribeLiving(mixed var); ! mixed cmd(string str) { ! int i; ! string file; ! object env, *livings, *items; ! ! if( !sizeof(str) ) return "Syntax: peer <direction>"; ! env = environment(this_player()); ! if( !file = (string)env->GetExit(str) ) file = (string)env->GetEnter(str); ! if( !sizeof(file) ) ! return "You cannot peer that way."; ! if( i = effective_light(this_player()) > 6 ) ! return "It is too bright to do that."; ! else if( i < 0 ) ! return "It is too dark to attempt that."; ! if( env->GetDoor(str) && ((string)env->GetDoor(str))->GetClosed() ) { ! message("my_action", sprintf("%s is blocking your view %s.", ! ((string)env->GetDoor(str))->GetShort(str), str), ! this_player() ); ! return 1; ! } ! if( !unguarded((: file_exists, file + ".c" :)) || (!env = load_object(file)) ) { ! message("my_action", "It is not safe to peer "+str+"!", this_player() ); ! return 1; ! } ! if( (int)env->GetProperty("light") < 0 || ! (int)env->GetProperty("light") > 6 ) { ! message("my_action", "You cannot see "+str+" very well.", this_player()); ! return 1; ! } ! items = filter(all_inventory(env), ! (: !(int)$1->GetInvis(this_player()) :) ); ! items = items - (livings = filter(items, (: living :))); ! message("my_action", "%^GREEN%^" ! "Peering "+str+" you see...", ! this_player() ); ! message("other_action", ! (string)this_player()->GetCapName()+" peers "+str+".", ! environment(this_player()), this_player() ); ! message("room_description", ! ("\n"+(string)env->GetLong(0)+"\n" || "\nA void.\n"), ! this_player() ); ! if( sizeof(items) ) ! message("room_inventory", ! "%^MAGENTA%^" + DescribeItems(items) + "%^RESET%^\n", ! this_player() ); ! if( sizeof(livings) ) ! message("room_inventory", ! "%^BOLD%^%^RED%^" + DescribeLiving(livings) + "%^RESET%^", this_player() ); ! return 1; } ! string DescribeItems(mixed var) { ! mapping m = ([ ]); ! string *shorts, ret; ! int i, max; ! ! if( !arrayp(var) ) return ""; ! i = sizeof( shorts = map(var, (: $1->GetShort() :)) ); ! while(i--) { ! if( !sizeof(shorts[i]) ) continue; ! if( m[ shorts[i] ] ) m[ shorts[i] ]++; ! else m[ shorts[i] ] = 1; ! } ! i = max = sizeof( shorts = keys(m) ); ! ret = ""; ! for(i=0; i<max; i++) { ! if( m[ shorts[i] ] < 2 ) ret += shorts[i]; ! else ret += consolidate(m[shorts[i]], shorts[i]); ! if( i == (max - 1) ) { ! if( max>1 || m[ shorts[i] ] > 1 ) ret += " are here."; ! else ret += " is here."; ! } ! else if( i == (max - 2) ) ret += ", and "; ! else ret += ", "; ! } ! return capitalize(ret); } ! string DescribeLiving(mixed var) { ! mapping m = ([ ]); ! string *shorts, ret; ! int i; ! if( !arrayp(var) ) return ""; ! i = sizeof( shorts = map(var, (: $1->GetShort() :)) ); ! while(i--) { ! if( !sizeof(shorts[i]) ) continue; ! if( m[ shorts[i] ] ) m[ shorts[i] ]++; ! else m[ shorts[i] ] = 1; ! } ! ret = ""; ! i = sizeof( shorts = keys(m) ); ! while(i--) if( m[ shorts[i] ] > 1 ) ! ret += (consolidate(m[shorts[i]], shorts[i]) + "\n"); ! else ret += (shorts[i] + "\n"); ! return ret; } ! void help() { ! message("help", ! "Syntax: peer <direction>\n\n" ! "Allows you to look into an adjacent room without actually " ! "entering it. Note that light and doorways affect what you " ! "see.\n\n", ! this_player() ); } --- 2,134 ---- * Peer into an adjacent room wihout actually entering * Blitz@Dead SoulsIV */ ! #include <lib.h> ! inherit LIB_DAEMON; ! string DescribeItems(mixed var); string DescribeLiving(mixed var); ! mixed cmd(string str) { ! int i; ! string file; ! object env, *livings, *items; ! ! if( !sizeof(str) ) return "Syntax: peer <direction>"; ! switch(str){ ! case "n" : str = "north";break; ! case "ne" : str = "northeast";break; ! case "nw" : str = "northwest";break; ! case "s" : str = "south";break; ! case "se" : str = "southeast";break; ! case "sw" : str = "southwest";break; ! case "e" : str = "east";break; ! case "w" : str = "west";break; ! case "u" : str = "up";break; ! case "d" : str = "down";break; ! } ! env = environment(this_player()); ! if( !file = (string)env->GetExit(str) ) file = (string)env->GetEnter(str); ! if( !sizeof(file) ) ! return "You cannot peer that way."; ! if( (i = this_player()->GetEffectiveVision()) > 5 ) ! return "It is too bright to do that."; ! if( i < 3 ) ! return "It is too dark to attempt that."; ! if( env->GetDoor(str) && ((string)env->GetDoor(str))->GetClosed() ) { ! message("my_action", sprintf("%s is blocking your view %s.", ! ((string)env->GetDoor(str))->GetShort(str), str), ! this_player() ); ! return 1; ! } ! if( !unguarded((: file_exists, file + ".c" :)) || (!env = load_object(file)) ) { ! message("my_action", "It is not safe to peer "+str+"!", this_player() ); ! return 1; ! } ! if(env->GetProperty("no peer")){ ! return "You can't see in that direction."; ! } ! if( (i = this_player()->GetEffectiveVision(1,file)) > 5 ) ! return "It is too bright in that direction."; ! else if( i < 3 ) ! return "It is too dark there."; ! ! items = filter(all_inventory(env), ! (: !(int)$1->GetInvis(this_player()) :) ); ! items = items - (livings = filter(items, (: living :))); ! message("my_action", "%^GREEN%^" ! "Peering "+str+" you see...", this_player() ); ! message("other_action", ! (string)this_player()->GetCapName()+" peers "+str+".", ! environment(this_player()), this_player() ); ! message("room_description", ! ("\n"+(string)env->GetLong(0)+"\n" || "\nA void.\n"), ! this_player() ); ! if( sizeof(items) ) ! message("room_inventory", ! "%^MAGENTA%^" + DescribeItems(items) + "%^RESET%^\n", ! this_player() ); ! if( sizeof(livings) ) ! message("room_inventory", ! "%^BOLD%^%^RED%^" + DescribeLiving(livings) + "%^RESET%^", ! this_player() ); ! return 1; } ! string DescribeItems(mixed var) { ! mapping m = ([ ]); ! string *shorts, ret; ! int i, max; ! ! if( !arrayp(var) ) return ""; ! i = sizeof( shorts = map(var, (: $1->GetShort() :)) ); ! while(i--) { ! if( !sizeof(shorts[i]) ) continue; ! if( m[ shorts[i] ] ) m[ shorts[i] ]++; ! else m[ shorts[i] ] = 1; ! } ! i = max = sizeof( shorts = keys(m) ); ! ret = ""; ! for(i=0; i<max; i++) { ! if( m[ shorts[i] ] < 2 ) ret += shorts[i]; ! else ret += consolidate(m[shorts[i]], shorts[i]); ! if( i == (max - 1) ) { ! if( max>1 || m[ shorts[i] ] > 1 ) ret += " are here."; ! else ret += " is here."; ! } ! else if( i == (max - 2) ) ret += ", and "; ! else ret += ", "; ! } ! return capitalize(ret); } ! string DescribeLiving(mixed var) { ! mapping m = ([ ]); ! string *shorts, ret; ! int i; ! if( !arrayp(var) ) return ""; ! i = sizeof( shorts = map(var, (: $1->GetShort() :)) ); ! while(i--) { ! if( !sizeof(shorts[i]) ) continue; ! if( m[ shorts[i] ] ) m[ shorts[i] ]++; ! else m[ shorts[i] ] = 1; ! } ! ret = ""; ! i = sizeof( shorts = keys(m) ); ! while(i--) if( m[ shorts[i] ] > 1 ) ! ret += (consolidate(m[shorts[i]], shorts[i]) + "\n"); ! else ret += (shorts[i] + "\n"); ! return ret; } ! void help() { ! message("help", ! "Syntax: peer <direction>\n\n" ! "Allows you to look into an adjacent room without actually " ! "entering it. Note that light and doorways affect what you " ! "see.\n\n", ! this_player() ); } diff -c -r --new-file ds1.1/lib/secure/cmds/players/praise.c ds2.0r27/lib/secure/cmds/players/praise.c *** ds1.1/lib/secure/cmds/players/praise.c Sun Feb 1 21:30:32 1998 --- ds2.0r27/lib/secure/cmds/players/praise.c Wed Jul 5 00:01:12 2006 *************** *** 3,14 **** * makes a praisereport * created by Descartes of Borg 950427 */ ! #include <lib.h> #include <dirs.h> ! inherit LIB_DAEMON; ! void eventEndEdit(object ob); string GetCreator(object ob); --- 3,14 ---- * makes a praisereport * created by Descartes of Borg 950427 */ ! #include <lib.h> #include <dirs.h> ! inherit LIB_DAEMON; ! void eventEndEdit(object ob); string GetCreator(object ob); *************** *** 42,52 **** if( text != "" ) { if( ob ) { tmp = (string)this_player()->GetCapName() + " reports praise in: " + ! identify(ob) + "\non " + ctime(time()) + "\n"; secondary = GetCreator(ob); } else ! tmp = (string)this_player()->GetCapName() + " reports praise on: " + ctime(time()) + ":\n"; log_file("praise", tmp + text + "\n\n"); if( secondary ) log_file("reports/" + secondary, tmp + text + "\n\n"); --- 42,52 ---- if( text != "" ) { if( ob ) { tmp = (string)this_player()->GetCapName() + " reports praise in: " + ! identify(ob) + "\non " + ctime(time()) + "\n"; secondary = GetCreator(ob); } else ! tmp = (string)this_player()->GetCapName() + " reports praise on: " + ctime(time()) + ":\n"; log_file("praise", tmp + text + "\n\n"); if( secondary ) log_file("reports/" + secondary, tmp + text + "\n\n"); *************** *** 60,66 **** void eventEndEdit(object ob) { string tmp, text, file, secondary; ! file = DIR_TMP "/" + (string)this_player()->GetKeyName(); if( !file_exists(file) || !(text = read_file(file)) ) { message("system", "Praise report aborted.", this_player()); --- 60,66 ---- void eventEndEdit(object ob) { string tmp, text, file, secondary; ! file = DIR_TMP "/" + (string)this_player()->GetKeyName(); if( !file_exists(file) || !(text = read_file(file)) ) { message("system", "Praise report aborted.", this_player()); *************** *** 69,79 **** rm(file); if( ob ) { tmp = (string)this_player()->GetCapName() + " reports praise in: " + ! identify(ob) + "\non: " + ctime(time()) + "\n"; secondary = GetCreator(ob); } else ! tmp = (string)this_player()->GetCapName() + " reports praise on " + ctime(time()) + ":\n"; log_file("praise", tmp + text + "\n\n"); if( secondary ) log_file("reports/" + secondary, tmp + text + "\n\n"); --- 69,79 ---- rm(file); if( ob ) { tmp = (string)this_player()->GetCapName() + " reports praise in: " + ! identify(ob) + "\non: " + ctime(time()) + "\n"; secondary = GetCreator(ob); } else ! tmp = (string)this_player()->GetCapName() + " reports praise on " + ctime(time()) + ":\n"; log_file("praise", tmp + text + "\n\n"); if( secondary ) log_file("reports/" + secondary, tmp + text + "\n\n"); *************** *** 91,102 **** void help() { message("help", "Syntax: <praise ([object]) ([praise message])>\n\n" ! "Allows you to praise things in the MUD to both the MUD " ! "administrators as well as to the creator of the object you " ! "are referencing (if any). If you do not specify an object, " ! "then the report will be sent to the creator of the room in which " ! "you are located in addition to the MUD administrators. If you " ! "fail to specify text on the command line, then you will be put " ! "into the editor in order to compose the report.\n\n" ! "See also: bug, idea", this_player()); } --- 91,102 ---- void help() { message("help", "Syntax: <praise ([object]) ([praise message])>\n\n" ! "Allows you to praise things in the MUD to both the MUD " ! "administrators as well as to the creator of the object you " ! "are referencing (if any). If you do not specify an object, " ! "then the report will be sent to the creator of the room in which " ! "you are located in addition to the MUD administrators. If you " ! "fail to specify text on the command line, then you will be put " ! "into the editor in order to compose the report.\n\n" ! "See also: bug, idea", this_player()); } diff -c -r --new-file ds1.1/lib/secure/cmds/players/reply.c ds2.0r27/lib/secure/cmds/players/reply.c *** ds1.1/lib/secure/cmds/players/reply.c Sun Feb 1 21:30:32 1998 --- ds2.0r27/lib/secure/cmds/players/reply.c Wed Jul 5 00:01:12 2006 *************** *** 1,46 **** // /bin/user/_reply.c ! // from the Dead Souls mudlib // replies to the person who previously told to you // created by Descartes of Borg 06 february 1993 ! #include <lib.h> #include <talk_type.h> #include <daemons.h> ! inherit LIB_DAEMON; ! int cmd(string str) { ! string reply, a, b; ! object ob; mixed err; ! reply = (string)this_player()->GetProperty("reply"); if(!reply) reply = "no one"; if(!str) { ! notify_fail("Current reply addressee: "+capitalize(reply)+"\n"); ! return 0; } if(reply == "no one") { ! notify_fail("No current reply addressee.\n"); ! return 0; } ob = find_living(reply); if(!ob && (sscanf(reply, "%s@%s", a, b) != 2)) { ! notify_fail(capitalize(reply)+" is not currently in our reality.\n"); ! return 0; } if(sscanf(reply, "%s@%s", a, b) == 2) { ! a = lower_case(a); SERVICES_D->eventSendTell(a, b, str); return 1; } if( (err = (mixed)this_player()->CanSpeak(ob, "reply", str)) != 1 ) ! return err; this_player()->eventSpeak(ob, TALK_PRIVATE, str); ob->SetProperty("reply", this_player()->GetKeyName()); return 1; } ! void help() { message("help", "Syntax: <reply [(message)]>\n\n" --- 1,58 ---- // /bin/user/_reply.c ! // from the Nightmare mudlib // replies to the person who previously told to you // created by Descartes of Borg 06 february 1993 ! #include <lib.h> #include <talk_type.h> #include <daemons.h> ! inherit LIB_DAEMON; ! int cmd(string str) { ! string reply,a,b,msg,machine_message,frm; ! object ob, machine; mixed err; ! reply = (string)this_player()->GetProperty("reply"); if(!reply) reply = "no one"; if(!str) { ! notify_fail("Current reply addressee: "+capitalize(reply)+"\n"); ! return 0; } if(reply == "no one") { ! notify_fail("No current reply addressee.\n"); ! return 0; } ob = find_living(reply); if(!ob && (sscanf(reply, "%s@%s", a, b) != 2)) { ! notify_fail(capitalize(reply)+" is not currently in our reality.\n"); ! return 0; } if(sscanf(reply, "%s@%s", a, b) == 2) { ! a = lower_case(a); SERVICES_D->eventSendTell(a, b, str); return 1; } if( (err = (mixed)this_player()->CanSpeak(ob, "reply", str)) != 1 ) ! return err; ! machine=present("cratylus' answering machine",ob); ! if(machine){ ! int parse_it; ! parse_it=machine->query_answer(); ! frm=(string)this_player()->GetName(); ! if(parse_it){ ! machine->get_message(frm+" tells you: "+msg+".\n"); ! machine_message=machine->send_message(); ! message("info",machine_message,this_player()); ! return 1; ! } ! } this_player()->eventSpeak(ob, TALK_PRIVATE, str); ob->SetProperty("reply", this_player()->GetKeyName()); return 1; } ! void help() { message("help", "Syntax: <reply [(message)]>\n\n" diff -c -r --new-file ds1.1/lib/secure/cmds/players/suicide.c ds2.0r27/lib/secure/cmds/players/suicide.c *** ds1.1/lib/secure/cmds/players/suicide.c Sun Feb 1 21:30:32 1998 --- ds2.0r27/lib/secure/cmds/players/suicide.c Wed Jul 5 00:01:12 2006 *************** *** 3,121 **** * Allows players to obliterate their character * created by Blitz@Dead Souls */ ! #include <lib.h> #include <dirs.h> #include <flags.h> #include <privs.h> #include <message_class.h> ! inherit LIB_DAEMON; ! static private void GetPassword(string input); static private void GetYesOrNo(string input); static private void EndSuicide(string who); ! mixed cmd(string str) { ! string who; ! object ob; ! ! if( sizeof(str) ) return "Suicide does not require any arguments."; ! ob = previous_object(); ! if( this_player(1) != ob || !userp(ob) ) { ! log_file("security", "** Illegal suicide attempt **\n " ! "Call stack:\n"+ sprintf("%O\n", previous_object(-1))); ! return "Suicide failed."; ! } ! if( this_player()->GetForced() ) { ! log_file("security", "*** Illegal \"Forced\" Suicide **\n" ! "Call stack:\n"+ sprintf("%O\n", previous_object(-1))); ! return 0; ! } ! who = (string)this_player()->GetKeyName(); ! if( who == "guest" ) return "Guest is not suicidal!"; ! if( member_group(who, PRIV_SECURE) || member_group(who, PRIV_ASSIST) ) ! return "You must first have your security privledges removed."; ! this_player()->eventPrint("Committing suicide means having your character " ! "completely erased from "+mud_name()+"'s database. If you " ! "are certain this is what you want, enter in your correct " ! "password. Otherwise enter in a wrong password."); ! this_player()->eventPrint("Password: ", MSG_EDIT); ! input_to((: GetPassword :), I_NOECHO | I_NOESC); ! return 1; } ! static private void GetPassword(string input) { ! string tmp; ! if( !sizeof(input) ) { ! this_player()->eventPrint("Suicide aborted."); return; - } - tmp = (string)this_player()->GetPassword(); - if( tmp != crypt(input, tmp) ) { - this_player()->eventPrint("Wrong password. Suicide aborted."); - return; - } - this_player()->eventPrint("\nLeave a suicide note? (a)bort, (y)es, (N)o :", - MSG_EDIT); - input_to((: GetYesOrNo :)); - return; } static private void GetYesOrNo(string input) { ! string tmp = (string)this_player()->GetKeyName(); ! if( !sizeof(input) || (input = lower_case(input))[0] != 'y' ) { ! if( input && input[0] == 'a' ) { ! this_player()->eventPrint("Suicide has been aborted."); ! return; ! } ! EndSuicide(tmp); ! return; ! } ! this_player()->eventPrint("\nYou may now enter a letter " ! "explaining why you suicided. If you do not wish to write a " ! "letter, simply exit the editor without writing anything. " ! "(enter \".\" on a blank line to exit editor.)"); ! this_player()->eventEdit(DIR_TMP + "/" + tmp, (: EndSuicide, tmp :)); } ! static private void EndSuicide(string who) { ! string tmp, file, newfile; ! object *ob; ! ! file = DIR_TMP + "/" + who; ! newfile = DIR_TMP + "/suicide/" + who; ! if( file_size(file) > 0 ) { ! tmp = possessive_noun(who)+" suicide note.\n" ! "Dated: "+ctime(time())+"\n"; ! tmp += read_file(file); ! write_file(newfile, tmp, 1); ! } ! if( file_exists(file) ) rm(file); ! log_file("suicide", who+" suicided at "+ctime(time()) ! +". (from "+query_ip_name(this_player())+")\n"); ! tmp = save_file(who) + __SAVE_EXTENSION__; ! unguarded((: rename, tmp, DIR_SUICIDE + "/" + who + __SAVE_EXTENSION__ :)); ! this_player()->eventPrint("You have suicided. Please try " ! "again another time."); ! environment(this_player())->eventPrint( ! (string)this_player()->GetName()+" has ended "+ ! possessive(this_player())+" own life before your very eyes.", ! this_player() ); ! if( sizeof( ob = filter(users(), (: archp :)) ) ) ! ob->eventPrint("["+(string)this_player()->GetName()+" has " ! "comitted suicide]"); ! this_player()->eventDestruct(); ! return; } ! string GetHelp(string str) { return "Syntax: suicide\n\n" ! "Ends your character's existence on "+mud_name()+" FOREVER. " ! "It is non-reversible. Once you issue this command, tyou will be asked" ! "for a password to confirm your identity. Once password is confirmed, " ! "you will no longer exist in the MUD's database. You may also opt " ! "to write a final suicide note.\n\n" ! "NOTE: If you suicide from a restricted site, you will have to " ! "reregister!"; } --- 3,127 ---- * Allows players to obliterate their character * created by Blitz@Dead Souls */ ! #include <lib.h> #include <dirs.h> #include <flags.h> #include <privs.h> + #include <daemons.h> + #include <rooms.h> #include <message_class.h> ! inherit LIB_DAEMON; ! static private void GetPassword(string input); static private void GetYesOrNo(string input); static private void EndSuicide(string who); ! mixed cmd(string str) { ! string who; ! object ob; ! ! if( sizeof(str) ) return "Suicide does not require any arguments."; ! ob = previous_object(); ! if( this_player(1) != ob || !userp(ob) ) { ! log_file("security", "** Illegal suicide attempt **\n " ! "Call stack:\n"+ sprintf("%O\n", previous_object(-1))); ! return "Suicide failed."; ! } ! if( this_player()->GetForced() ) { ! log_file("security", "*** Illegal \"Forced\" Suicide **\n" ! "Call stack:\n"+ sprintf("%O\n", previous_object(-1))); ! return 0; ! } ! who = (string)this_player()->GetKeyName(); ! if( who == "guest" ) return "Guest is not suicidal!"; ! if( member_group(who, PRIV_SECURE) || member_group(who, PRIV_ASSIST) ) ! return "You must first have your security privledges removed."; ! this_player()->eventPrint("Committing suicide means having your character " ! "completely erased from "+mud_name()+"'s database. If you " ! "are certain this is what you want, enter in your correct " ! "password. Otherwise enter in a wrong password."); ! this_player()->eventPrint("Password: ", MSG_EDIT); ! input_to((: GetPassword :), I_NOECHO | I_NOESC); ! return 1; } ! static private void GetPassword(string input) { ! string tmp; ! if( !sizeof(input) ) { ! this_player()->eventPrint("Suicide aborted."); ! return; ! } ! tmp = (string)this_player()->GetPassword(); ! if( tmp != crypt(input, tmp) ) { ! this_player()->eventPrint("Wrong password. Suicide aborted."); ! return; ! } ! this_player()->eventPrint("\nLeave a suicide note? (a)bort, (y)es, (N)o :", ! MSG_EDIT); ! input_to((: GetYesOrNo :)); return; } static private void GetYesOrNo(string input) { ! string tmp = (string)this_player()->GetKeyName(); ! if( !sizeof(input) || (input = lower_case(input))[0] != 'y' ) { ! if( input && input[0] == 'a' ) { ! this_player()->eventPrint("Suicide has been aborted."); ! return; ! } ! EndSuicide(tmp); ! return; ! } ! this_player()->eventPrint("\nYou may now enter a letter " ! "explaining why you suicided. If you do not wish to write a " ! "letter, simply exit the editor without writing anything. " ! "(enter \".\" on a blank line to exit editor.)"); ! this_player()->eventEdit(DIR_TMP + "/" + tmp, (: EndSuicide, tmp :)); } ! static private void EndSuicide(string who) { ! string tmp, file, newfile; ! object *ob; ! ! if(!directory_exists(DIR_TMP + "/suicide/")) mkdir (DIR_TMP + "/suicide/"); ! ! file = DIR_TMP + "/" + who; ! newfile = DIR_TMP + "/suicide/" + who; ! if( file_size(file) > 0 ) { ! tmp = possessive_noun(who)+" suicide note.\n" ! "Dated: "+ctime(time())+"\n"; ! tmp += read_file(file); ! write_file(newfile, tmp, 1); ! } ! if( file_exists(file) ) rm(file); ! log_file("suicide", who+" suicided at "+ctime(time()) ! +". (from "+query_ip_name(this_player())+")\n"); ! tmp = save_file(who) + __SAVE_EXTENSION__; ! unguarded((: rename, tmp, DIR_SUICIDE + "/" + who + __SAVE_EXTENSION__ :)); ! this_player()->eventPrint("You have suicided. Please try " ! "again another time."); ! environment(this_player())->eventPrint( ! (string)this_player()->GetName()+" has ended "+ ! possessive(this_player())+" own life before your very eyes.", ! this_player() ); ! if( sizeof( ob = filter(users(), (: archp :)) ) ) ! ob->eventPrint("["+(string)this_player()->GetName()+" has " ! "comitted suicide]"); ! PLAYERS_D->RemoveUser((string)this_player()->GetKeyName()); ! this_player()->eventMove(ROOM_FURNACE); ! this_player()->eventDestruct(); ! return; } ! string GetHelp(string str) { return "Syntax: suicide\n\n" ! "Ends your character's existence on "+mud_name()+" FOREVER. " ! "It is non-reversible. Once you issue this command, tyou will be asked" ! "for a password to confirm your identity. Once password is confirmed, " ! "you will no longer exist in the MUD's database. You may also opt " ! "to write a final suicide note.\n\n" ! "NOTE: If you suicide from a restricted site, you will have to " ! "reregister!"; } diff -c -r --new-file ds1.1/lib/secure/cmds/players/tell.c ds2.0r27/lib/secure/cmds/players/tell.c *** ds1.1/lib/secure/cmds/players/tell.c Sun Feb 1 21:30:32 1998 --- ds2.0r27/lib/secure/cmds/players/tell.c Wed Jul 5 00:01:12 2006 *************** *** 1,89 **** /* /secure/cmds/player/tell.c ! * from the Dead Souls LPC Library * the tell command * created by Descartes of Borg 950523 */ ! #include <lib.h> #include <talk_type.h> #include <daemons.h> ! inherit LIB_DAEMON; ! mixed cmd(string str) { string *words; mixed mud; ! object ob; int i, maxi; ! string who, msg, tmp; ! if(!str) return notify_fail("Syntax: <tell [who] [message]>\n"); mud = 0; if((maxi=sizeof(words = explode(str, "@"))) > 1) { ! who = convert_name(words[0]); ! if(maxi > 2) words[1] = implode(words[1..maxi-1], "@"); ! maxi = sizeof(words = explode(words[1], " ")); ! for(i=0; i<maxi; i++) { ! string *mts; ! tmp = lower_case(implode(words[0..i], " ")); ! ! if( (string)INTERMUD_D->GetMudName(tmp) ) { ! mud = tmp; ! if(i+1 < maxi) msg = implode(words[i+1..maxi-1], " "); ! else msg = ""; ! break; ! } ! } ! if(msg == "") return notify_fail("Syntax: <tell [who] [message]>\n"); ! if(!mud) mud = -1; } if(!mud || mud == -1) { ! maxi = sizeof(words = explode(str, " ")); ! who = 0; ! for(i=0; i<maxi; i++) { ! if(ob=find_living(tmp=convert_name(implode(words[0..i], " ")))) { ! who = tmp; ! if(i+1 < maxi) msg = implode(words[i+1..maxi-1], " "); ! else msg = ""; ! break; ! } ! } ! if(!who) { ! if(!mud) return notify_fail("Tell whom what?\n"); ! else return notify_fail(mud_name()+" is not aware of that mud.\n"); ! } ! if(msg == "") return notify_fail("What do you wish to tell?\n"); } else { ! SERVICES_D->eventSendTell(who, mud, msg); ! return 1; } if(ob) { ! string frm; ! mixed err; ! ! if( (err = (mixed)this_player()->CanSpeak(ob, "tell", msg)) != 1) ! return err || "Tell whom what?"; ! if( ob->GetInvis() && creatorp(ob) && !archp(this_player()) ) { ! ob->eventPrint("%^BLUE%^%^BOLD%^" + ! (string)this_player()->GetName() + " unknowingly " ! "tells you, %^RESET%^\"" + msg + "\""); ! return "Tell whom what?"; ! } ! else this_player()->eventSpeak(ob, TALK_PRIVATE, msg); ! ob->SetProperty("reply", (string)this_player()->GetKeyName()); ! if(userp(ob) && (query_idle(ob) > 60)) ! message("my_action", (string)ob->GetName()+ ! " is idle and may not have been paying attention.", this_player()); ! else if(in_edit(ob) || in_input(ob)) ! message("my_action", (string)ob->GetCapName()+" is in input "+ ! "and may not be able to respond.", this_player()); } return 1; } ! ! string GetHelp(string str) { ! return ("help", "Syntax: <tell [player] [message]>\n" " <tell [player]@[mud] [message]>\n\n" "Sends the message to the player named either on this mud if no " --- 1,111 ---- /* /secure/cmds/player/tell.c ! * from the Nightmare IV LPC Library * the tell command * created by Descartes of Borg 950523 */ ! #include <lib.h> #include <talk_type.h> #include <daemons.h> ! inherit LIB_DAEMON; ! mixed cmd(string str) { string *words; mixed mud; ! object ob, machine; int i, maxi; ! string who, msg, tmp, tmp2, machine_message; ! if(!str) return notify_fail("Syntax: <tell [who] [message]>\n"); + if(!creatorp(this_player()) && this_player()->GetMagicPoints() < 15) { + write("You lack sufficient magic to tell to anyone right now."); + return 1; + } mud = 0; if((maxi=sizeof(words = explode(str, "@"))) > 1) { ! who = convert_name(words[0]); ! if(maxi > 2) words[1] = implode(words[1..maxi-1], "@"); ! maxi = sizeof(words = explode(words[1], " ")); ! for(i=0; i<maxi; i++) { ! tmp = lower_case(implode(words[0..i], " ")); ! tmp2 = lower_case(implode(words[0..i+1], " ")); ! ! if( (string)INTERMUD_D->GetMudName(tmp) ! && !((string)INTERMUD_D->GetMudName(tmp2)) ) { ! mud = tmp; ! if(i+1 < maxi) msg = implode(words[i+1..maxi-1], " "); ! else msg = ""; ! break; ! } ! } ! if(msg == "") return notify_fail("Syntax: <tell [who] [message]>\n"); ! if(!mud) mud = -1; } if(!mud || mud == -1) { ! maxi = sizeof(words = explode(str, " ")); ! who = 0; ! for(i=0; i<maxi; i++) { ! if(ob=find_living(tmp=convert_name(implode(words[0..i], " ")))) { ! who = tmp; ! if(i+1 < maxi) msg = implode(words[i+1..maxi-1], " "); ! else msg = ""; ! break; ! } ! } ! if(!who) { ! if(!mud) return notify_fail("Tell whom what?\n"); ! else return notify_fail(mud_name()+" is not aware of that mud.\n"); ! } ! if(msg == "") return notify_fail("What do you wish to tell?\n"); } else { ! if(!creatorp(this_player())) this_player()->AddMagicPoints(-15); ! SERVICES_D->eventSendTell(who, mud, msg); ! return 1; } if(ob) { ! string frm; ! mixed err; ! ! machine=present("answering machine",ob); ! if(archp(ob)) frm = (string)this_player()->GetCapName(); ! else frm = (string)this_player()->GetName(); ! if(ob && !creatorp(ob)) this_player()->AddMagicPoints(-15); ! if(machine && base_name(machine) == "/secure/obj/machine"){ ! int parse_it; ! parse_it=machine->query_answer(); ! if(parse_it){ ! machine->get_message(frm+" tells you: "+msg+"\n"); ! machine_message=machine->send_message(); ! message("info", machine_message, this_player()); ! return 1; ! } ! } ! if( (err = (mixed)this_player()->CanSpeak(ob, "tell", msg)) != 1){ ! if(ob && !creatorp(ob)) this_player()->AddMagicPoints(15); ! return err || "Tell whom what?"; ! } ! if( ob->GetInvis() && creatorp(ob) && !archp(this_player()) ) { ! ob->eventPrint("%^BLUE%^%^BOLD%^" + ! (string)this_player()->GetName() + " unknowingly " ! "tells you, %^RESET%^\"" + msg + "\""); ! return "Tell whom what?"; ! } ! else this_player()->eventSpeak(ob, TALK_PRIVATE, msg); ! ob->SetProperty("reply", (string)this_player()->GetKeyName()); ! if(!archp(ob) && userp(ob) && (query_idle(ob) > 60)) ! message("my_action", (string)ob->GetName()+ ! " is idle and may not have been paying attention.", this_player()); ! else if(in_edit(ob) || in_input(ob)) ! message("my_action", (string)ob->GetCapName()+" is in input "+ ! "and may not be able to respond.", this_player()); } return 1; } ! ! void help(string str) { ! message("help", "Syntax: <tell [player] [message]>\n" " <tell [player]@[mud] [message]>\n\n" "Sends the message to the player named either on this mud if no " *************** *** 91,113 **** "another mud is specified. For muds with more than one word in their " "names, use . (periods) to take place of spaces. Example: tell " "descartes@realms.of.chaos hi\n\n" ! "See also: say, shout, yell, emote"); } ! string morse(string msg) { ! mapping __Morse; string tmp; int x, i; ! __Morse = ([ "a" : ".-", "b" : "-...", "c" : "-.-.", ! "d" : "-..", "e" : ".", "f" : "..-.", "g" : "--.", "h" : "....", "i" : "..", ! "j" : ".---", "k" : "-.-", "l" : ".-..", "m" : "--", "n" : "-.", "o" : "---", ! "p" : ".--.", "q" : "--.-", "r" : " .-.", "s" : "...", "t" : "-", "u" : "..-", ! "v" : "...-", "w" : ".--", "x" : "-..-", "y" : "-.--", "z" : "--..", ! "1" : ".----", "2" : "..---", "3" : "...--", "4" : "....-", "5" : ".....", ! "6" : " -....", "7" : "--...", "8" : "---..", "9" : "----.","0" : " -----" ]); for(tmp = "", x = strlen(msg), i=0; i< x; i++) { ! if(__Morse[msg[i..i]]) tmp += __Morse[msg[i..i]]+" "; ! else tmp += msg[i..i]+ " "; } return tmp; } --- 113,135 ---- "another mud is specified. For muds with more than one word in their " "names, use . (periods) to take place of spaces. Example: tell " "descartes@realms.of.chaos hi\n\n" ! "See also: say, shout, yell, emote",this_player()); } ! string morse(string msg) { ! mapping __Morse; string tmp; int x, i; ! __Morse = ([ "a" : ".-", "b" : "-...", "c" : "-.-.", ! "d" : "-..", "e" : ".", "f" : "..-.", "g" : "--.", "h" : "....", "i" : "..", ! "j" : ".---", "k" : "-.-", "l" : ".-..", "m" : "--", "n" : "-.", "o" : "---", ! "p" : ".--.", "q" : "--.-", "r" : " .-.", "s" : "...", "t" : "-", "u" : "..-", ! "v" : "...-", "w" : ".--", "x" : "-..-", "y" : "-.--", "z" : "--..", ! "1" : ".----", "2" : "..---", "3" : "...--", "4" : "....-", "5" : ".....", ! "6" : " -....", "7" : "--...", "8" : "---..", "9" : "----.","0" : " -----" ]); for(tmp = "", x = strlen(msg), i=0; i< x; i++) { ! if(__Morse[msg[i..i]]) tmp += __Morse[msg[i..i]]+" "; ! else tmp += msg[i..i]+ " "; } return tmp; } diff -c -r --new-file ds1.1/lib/secure/daemon/autoexec.c ds2.0r27/lib/secure/daemon/autoexec.c *** ds1.1/lib/secure/daemon/autoexec.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/daemon/autoexec.c Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,23 ---- + #include <lib.h> + #include <config.h> + + inherit LIB_DAEMON; + + int hasrun = 0; + + static void eventRun() { + load_object("/secure/cmds/creators/update")->cmd("-r /lib/creator"); + if(RESET_INTERMUD){ + rm("/save/intermud.o"); + update("/daemon/intermud"); + } + load_object("/secure/cmds/creators/dsversion")->cmd(); + } + + static void create() { + daemon::create(); + if(hasrun) return; + call_out((: eventRun :), 10); + hasrun = 1; + } + diff -c -r --new-file ds1.1/lib/secure/daemon/bboard.c ds2.0r27/lib/secure/daemon/bboard.c *** ds1.1/lib/secure/daemon/bboard.c Sun Feb 1 21:30:41 1998 --- ds2.0r27/lib/secure/daemon/bboard.c Wed Jul 5 00:48:29 2006 *************** *** 1,5 **** /* /secure/daemon/bboard.c ! * from Dead Souls 3.3 * bulletin board daemon * created by Descartes of Borg 940920 */ --- 1,5 ---- /* /secure/daemon/bboard.c ! * from Nightmare 3.3 * bulletin board daemon * created by Descartes of Borg 940920 */ *************** *** 14,19 **** --- 14,20 ---- private string __Owner; private mapping *__Posts; static private string __CurrentID; + string list_new_posts(string id); void create() { daemon::create(); *************** *** 26,38 **** static private void save_board() { if(!__CurrentID) return; if(!unguarded((: file_exists,DIR_BOARDS+"/"+__CurrentID+__SAVE_EXTENSION__ :))){ ! int i; ! ! if(!sizeof(__Posts)) return; ! i = strlen(__CurrentID); ! while(i--) ! if((__CurrentID[i] < 'a' || __CurrentID[i] > 'z') && __CurrentID[i] != '_') ! error("Illegal bulletin board id."); } unguarded((: save_object, DIR_BOARDS+"/"+__CurrentID :)); } --- 27,39 ---- static private void save_board() { if(!__CurrentID) return; if(!unguarded((: file_exists,DIR_BOARDS+"/"+__CurrentID+__SAVE_EXTENSION__ :))){ ! int i; ! ! if(!sizeof(__Posts)) return; ! i = strlen(__CurrentID); ! while(i--) ! if((__CurrentID[i] < 'a' || __CurrentID[i] > 'z') && __CurrentID[i] != '_') ! error("Illegal bulletin board id."); } unguarded((: save_object, DIR_BOARDS+"/"+__CurrentID :)); } *************** *** 40,47 **** static private void restore_board() { if(!__CurrentID) return; if(!unguarded((: file_exists, DIR_BOARDS+"/"+__CurrentID+__SAVE_EXTENSION__ :))) { ! __Owner = query_privs(previous_object(0)); ! __Posts = ({}); } else unguarded((: restore_object, DIR_BOARDS+"/"+__CurrentID :)); } --- 41,48 ---- static private void restore_board() { if(!__CurrentID) return; if(!unguarded((: file_exists, DIR_BOARDS+"/"+__CurrentID+__SAVE_EXTENSION__ :))) { ! __Owner = query_privs(previous_object(0)); ! __Posts = ({}); } else unguarded((: restore_object, DIR_BOARDS+"/"+__CurrentID :)); } *************** *** 49,56 **** static private int valid_access() { string str; ! if(__Owner == PRIV_SECURE && !((int)master()->valid_access(({})))) ! return 0; str = query_privs(previous_object(0)); if(member_array(PRIV_SECURE, explode(str, ":")) != -1) return 1; return (__Owner == str); --- 50,60 ---- static private int valid_access() { string str; ! if(!this_player() && __Owner == PRIV_SECURE && !((int)master()->valid_apply(({PRIV_ASSIST})))) ! return 0; ! ! if(!archp(this_player())) return 0; ! str = query_privs(previous_object(0)); if(member_array(PRIV_SECURE, explode(str, ":")) != -1) return 1; return (__Owner == str); *************** *** 58,79 **** void add_post(string id, string who, string subj, string msg) { if(__CurrentID != id) { ! __CurrentID = id; ! restore_board(); } if(!valid_access()) return; if(!stringp(who)) return; if(!subj || subj == "") subj = "[No Subject]"; if(!msg || msg == "") return; __Posts += ({ ([ "author" : who, "subject" : subj, "time" : time(), ! "post" : msg, "read" : ({ convert_name(who) }) ]) }); save_board(); } void remove_post(string id, int post) { if(__CurrentID != id) { ! __CurrentID = id; ! restore_board(); } if(!valid_access()) return; if(post < 0 || post >= sizeof(__Posts)) return; --- 62,83 ---- void add_post(string id, string who, string subj, string msg) { if(__CurrentID != id) { ! __CurrentID = id; ! restore_board(); } if(!valid_access()) return; if(!stringp(who)) return; if(!subj || subj == "") subj = "[No Subject]"; if(!msg || msg == "") return; __Posts += ({ ([ "author" : who, "subject" : subj, "time" : time(), ! "post" : msg, "read" : ({ convert_name(who) }) ]) }); save_board(); } void remove_post(string id, int post) { if(__CurrentID != id) { ! __CurrentID = id; ! restore_board(); } if(!valid_access()) return; if(post < 0 || post >= sizeof(__Posts)) return; *************** *** 85,104 **** void mark_read(string id, int post, string reader) { if(__CurrentID != id) { ! __CurrentID = id; ! restore_board(); } if(!valid_access()) return; if(post < 0 || post > sizeof(__Posts)) return; if(reader && reader != "") ! __Posts[post]["read"] = distinct_array(__Posts[post]["read"]+({reader})); save_board(); } mapping query_post(string id, int post) { if(__CurrentID != id) { ! __CurrentID = id; ! restore_board(); } if(!valid_access()) return 0; if(post < 0 || post > sizeof(__Posts)) return 0; --- 89,108 ---- void mark_read(string id, int post, string reader) { if(__CurrentID != id) { ! __CurrentID = id; ! restore_board(); } if(!valid_access()) return; if(post < 0 || post > sizeof(__Posts)) return; if(reader && reader != "") ! __Posts[post]["read"] = distinct_array(__Posts[post]["read"]+({reader})); save_board(); } mapping query_post(string id, int post) { if(__CurrentID != id) { ! __CurrentID = id; ! restore_board(); } if(!valid_access()) return 0; if(post < 0 || post > sizeof(__Posts)) return 0; *************** *** 107,114 **** mapping *query_posts(string id) { if(__CurrentID != id) { ! __CurrentID = id; ! restore_board(); } if(!valid_access()) return 0; return copy(__Posts); --- 111,118 ---- mapping *query_posts(string id) { if(__CurrentID != id) { ! __CurrentID = id; ! restore_board(); } if(!valid_access()) return 0; return copy(__Posts); *************** *** 116,124 **** int query_number_posts(string id) { if(__CurrentID != id) { ! __CurrentID = id; ! restore_board(); } if(!valid_access()) return 0; return sizeof(__Posts); } --- 120,154 ---- int query_number_posts(string id) { if(__CurrentID != id) { ! __CurrentID = id; ! restore_board(); } if(!valid_access()) return 0; return sizeof(__Posts); } + + string list_new_posts(string id){ + string mag; + int i; + mixed count; + + if(__CurrentID != id) { + __CurrentID = id; + restore_board(); + } + + count = 0; + + for(i = 0; i < sizeof(__Posts); i++){ + if(member_array(convert_name(this_player()->GetKeyName()), + __Posts[i]["read"]) == -1) count++; + } + + id = replace_string(id, "_", " "); + mag = ""; + mag += capitalize(id) + " has "+(count ? count : "no") + " new message"+ + (count == 1 ? "" : "s")+ " posted."; + return mag; + } + + diff -c -r --new-file ds1.1/lib/secure/daemon/bugs.c ds2.0r27/lib/secure/daemon/bugs.c *** ds1.1/lib/secure/daemon/bugs.c Sun Feb 1 21:30:41 1998 --- ds2.0r27/lib/secure/daemon/bugs.c Wed Dec 31 19:00:00 1969 *************** *** 1,178 **** - /* /secure/daemon/bugs.c - * from the Dead Souls V Object Library - * only useable if you can define PACKAGE_DB - * manages the bug database - * created by Descartes of Borg 960125 - */ - - #include <lib.h> - - inherit LIB_DAEMON; - - private int dbConn = -1; - - static void create() { - daemon::create(); - SetNoClean(1); - Connect(); - } - - static int Connect() { - if( dbConn > 0 ) return; - dbConn = db_connect("nightmare.imaginary.com", "db_nmlp"); - return (dbConn > 0); - } - - static int Destruct() { - int x; - - if( !(x = daemon::Destruct()) ) return x; - if( dbConn != -1 ) db_close(dbConn); - return x; - } - - int eventAssign(int bug, string who) { - string sql; - - if( !user_exists(convert_name(who)) ) return 0; - else who = capitalize(who); - if( dbConn < 1 && !Connect() ) return 0; - sql = "UPDATE t_bug SET bug_assigned_to = " + who + - " WHERE bug_id = " + bug; - tmp = db_exec(dbConn, sql); - if( arrayp(tmp) && !sizeof(tmp) ) return 1; - return 0; - } - - int eventComment(int bug, string who, string comment) { - int id; - - if( bug < 1 || !who || !comment ) return 0; - if( !user_exists(who = convert_name(who)) ) return 0; - if( dbConn < 1 && !Connect() ) return 0; - if( strlen(comment) > 254 ) comment = comment[0..253]; - tmp = db_exec(dbConn, ("SELECT table_next_id " - "FROM t_gen_id " - "WHERE table_name = 't_bug_cmnt'")); - id = tmp[0][0]; - db_exec(dbConn, ("UPDATE t_gen_id " - "SET table_next_id = " +(id+1) + " " - "WHERE table_name = 't_bug_cmnt'")); - db_exec(dbConn, ("INSERT INTO t_bug_cmnt " - "(bug_cmnt_id, bug_id, bug_cmnt_by, bug_cmnt_text) " - "VALUES(" + id + ", " + bug + ", '" + who + "', '" + - comment + "')")); - return 1; - } - - int eventComplete(int bug, string who, string resolution) { - mixed tmp; - - if( !resolution || !bug || !who || !user_exists(who) ) return 0; - if( dbConn < 1 && !Connect() ) return 0; - if( strlen(resolution) > 254 ) reolution = resolution[0..253]; - tmp = db_exec(dbConn, ("UPDATE t_bug " - "SET bug_res = " + resolution + ", " - " bug_res_date = " + time() + ", " - " bug_res_by = " + convert_name(who) + " " - "WHERE bug_id = " + bug_id)); - if( arrayp(tmp) && !sizeof(tmp) ) return 1; - return 0; - } - - int eventDelete(int bug) { - mixed tmp; - - if( !((int)master()->valid_access(({}))) ) return 0; - if( bug < 1 || dbConn < 1 && !Connect() ) return 0; - tmp = db_exec(dbConn, ("DELETE from t_bug " - "WHERE bug_id = " + bug)); - if( arrayp(tmp) && !sizeof(tmp) ) return 1; - return 0; - } - - int eventReport(mapping data) { - mixed tmp; - int id; - - if( dbConn < 1 && !Connect() ) return 0; - tmp = db_exec(dbConn, ("SELECT table_next_id " - "FROM t_gen_id " - "WHERE table_name = 't_bug'")); - if( !arrayp(tmp) || sizeof(tmp) != 1 ) return 0; - id = tmp[0][0]; - tmp = db_exec(dbConn, ("UPDATE t_gen_id " - "SET table_next_id = " + (id+1) + " " - "WHERE table_name = 't_bug'")); - if( !arrayp(tmp) || sizeof(tmp) != 0 ) return 0; - tmp = db_exec(dbConn, ("INSERT INTO t_bug " - "(bug_id, bug_type, bug_status, bug_rpt_date, " - "bug_rpt_by, bug_rpt_room, bug_room_cre, bug_desc) " - "VALUES(" + id + ", 'new report', " + time() + ", " - "'" + convert_name(data["bug_rpt_by"]) + "', '" + - data["bug_rpt_room"] + "', '" + - convert_name(data["bug_room_cre"]) + "', '" + - data["bug_desc"] + "')")); - if( !arrayp(tmp) || sizeof(tmp) ) return 0; /* rollback is no big deal */ - foreach(string *obdata in data["inventory"]) { - /* Need to make sure the object is in t_inventory - * The object *probably* already exists, so catch the error and ignore - */ - catch(db_exec(dbConn, ("INSERT INTO t_inventory " - "(inventory_id, inventory_cre) " - "VALUES('" + obdata[0] + "', '" + - obdata[1] + "')"))); - db_exec(dbConn, ("INSERT INTO t_bug_inv " - "(bug_id, inventory_id) " - "VALUES(" + id + ", '" + obdata[1] + "')")); - } - return 1; - } - - int GetAssignedBugs(string who) { - mixed tmp; - - if( !who || !user_exists(who = convert_name(who)) ) return -1; - if( dbConn < 1 && !Connect() ) return -1; - tmp = db_exec(dbConn, ("SELECT bug_id " - "FROM t_bug " - "WHERE bug_assigned_to = '" + who + "'")); - return sizeof(tmp); - } - - mapping GetBugs(mapping where_clause) { - mixed tmp; - string where = "WHERE "; - - if( sizeof(where_clause) ) { - foreach(string key, mixed val in where_clause) { - where += key + " = "; - if( stringp(val) ) where += "'" + val + "' AND "; - else where += val + " AND "; - } - } - tmp = db_exec(dbConn, ("SELECT t_bug.bug_id, " - " t_bug.bug_type, " - " t_bug.bug_status, " - " t_bug.bug_rpt_date, " - " t_player.player_cap_name " - " t_bug.bug_rpt_room, " - " t_bug.bug_room_cre, " - " t_bug.bug_desc, " - " t_bug.bug_res, " - " t_bug.bug_res_date, " - " t_bug.bug_res_by, " - " t_bug.bug_assigned_to " - "FROM t_bug, t_player " - where + - " t_bug.bug_rpt_by = t_player.player_name ")); - foreach(mixed *row in tmp) { - ret[row[0]] = ([ "bug_type" : row[1], - "bug_status" : row[2], - "bug_rpt_date" : row[3], - - - - } - - --- 0 ---- diff -c -r --new-file ds1.1/lib/secure/daemon/character.c ds2.0r27/lib/secure/daemon/character.c *** ds1.1/lib/secure/daemon/character.c Sun Feb 1 21:30:42 1998 --- ds2.0r27/lib/secure/daemon/character.c Wed Jul 5 00:01:05 2006 *************** *** 20,33 **** SetNoClean(1); Links = ([]); if( unguarded( (: file_size(SAVE_CHARACTER __SAVE_EXTENSION__) :)) > 0 ) ! unguarded((: restore_object, SAVE_CHARACTER :)); } mixed eventConnect(string who) { class char_link c; string prime; int min_wait; ! if( base_name(previous_object()) != LIB_CONNECT ) return 0; if( !(c = Links[prime = who]) ) { foreach(string pl, class char_link cl in Links) { --- 20,33 ---- SetNoClean(1); Links = ([]); if( unguarded( (: file_size(SAVE_CHARACTER __SAVE_EXTENSION__) :)) > 0 ) ! unguarded((: restore_object, SAVE_CHARACTER :)); } mixed eventConnect(string who) { class char_link c; string prime; int min_wait; ! if( base_name(previous_object()) != LIB_CONNECT ) return 0; if( !(c = Links[prime = who]) ) { foreach(string pl, class char_link cl in Links) { *************** *** 43,49 **** if( find_player(ind) ) { if( who == ind ) return 1; if(member_group(who, PRIV_SECURE) || member_group(who,PRIV_ASSIST)) ! return 1; else if( archp(find_player(ind)) ) return 1; else return "You have a linked character currently logged in.\n"; } --- 43,49 ---- if( find_player(ind) ) { if( who == ind ) return 1; if(member_group(who, PRIV_SECURE) || member_group(who,PRIV_ASSIST)) ! return 1; else if( archp(find_player(ind)) ) return 1; else return "You have a linked character currently logged in.\n"; } *************** *** 59,65 **** if( x < 60 ) tmp = consolidate(x, "a second"); else tmp = consolidate(x/60, "a minute"); if( !(member_group(who, PRIV_SECURE) || member_group(who,PRIV_ASSIST))) ! return "\nYour character " + capitalize(c->LastOnWith) + " recently logged in at " + ctime(c->LastOnDate) + ".\n" + "You must wait another " + tmp + ".\n"; } --- 59,65 ---- if( x < 60 ) tmp = consolidate(x, "a second"); else tmp = consolidate(x/60, "a minute"); if( !(member_group(who, PRIV_SECURE) || member_group(who,PRIV_ASSIST))) ! return "\nYour character " + capitalize(c->LastOnWith) + " recently logged in at " + ctime(c->LastOnDate) + ".\n" + "You must wait another " + tmp + ".\n"; } *************** *** 68,81 **** save_object(SAVE_CHARACTER); return 1; } ! mixed eventLink(string primary, string secondary, string email) { class char_link ch; if( !((int)master()->valid_apply(({ PRIV_LAW }))) ) ! return "Permission denied."; if( !user_exists(primary = convert_name(primary)) ) ! return "No such user: primary"; if( !email ) return "Email is required for linking."; secondary = convert_name(secondary); if( Links[primary] ) { --- 68,81 ---- save_object(SAVE_CHARACTER); return 1; } ! mixed eventLink(string primary, string secondary, string email) { class char_link ch; if( !((int)master()->valid_apply(({ PRIV_LAW }))) ) ! return "Permission denied."; if( !user_exists(primary = convert_name(primary)) ) ! return "No such user: primary"; if( !email ) return "Email is required for linking."; secondary = convert_name(secondary); if( Links[primary] ) { *************** *** 117,123 **** class char_link c; object ob; string who; ! if( !userp(ob = previous_object()) ) return 0; who = (string)ob->GetKeyName(); if( !(c = Links[who]) ) { --- 117,123 ---- class char_link c; object ob; string who; ! if( !userp(ob = previous_object()) ) return 0; who = (string)ob->GetKeyName(); if( !(c = Links[who]) ) { *************** *** 137,145 **** mixed eventUnlink(string primary, string who) { class char_link ch; ! if( !((int)master()->valid_apply(({ PRIV_ASSIST }))) ) ! return "Permission denied."; primary = convert_name(primary); who = convert_name(who); if( !(ch = Links[primary]) ) return "No such primary character."; --- 137,145 ---- mixed eventUnlink(string primary, string who) { class char_link ch; ! if( !((int)master()->valid_apply(({ PRIV_ASSIST }))) ) ! return "Permission denied."; primary = convert_name(primary); who = convert_name(who); if( !(ch = Links[primary]) ) return "No such primary character."; *************** *** 157,163 **** return 1; } if( member_array(who, ch->Secondaries) == -1 ) ! return "Invalid secondary character for " + primary + "."; ch->Secondaries -= ({ who }); Links[primary] = ch; save_object(SAVE_CHARACTER); --- 157,163 ---- return 1; } if( member_array(who, ch->Secondaries) == -1 ) ! return "Invalid secondary character for " + primary + "."; ch->Secondaries -= ({ who }); Links[primary] = ch; save_object(SAVE_CHARACTER); *************** *** 177,183 **** else { class char_link l; string pl; ! foreach(pl, l in Links) { if( member_array(who, l->Secondaries) != -1 ) { ch = l; --- 177,183 ---- else { class char_link l; string pl; ! foreach(pl, l in Links) { if( member_array(who, l->Secondaries) != -1 ) { ch = l; *************** *** 188,192 **** if( !ch ) return 0; } return ([ "primary" : who, "last char" : ch->LastOnWith, ! "secondaries" : ch->Secondaries, "last on" : ch->LastOnDate ]); } --- 188,192 ---- if( !ch ) return 0; } return ([ "primary" : who, "last char" : ch->LastOnWith, ! "secondaries" : ch->Secondaries, "last on" : ch->LastOnDate ]); } diff -c -r --new-file ds1.1/lib/secure/daemon/chat.c ds2.0r27/lib/secure/daemon/chat.c *** ds1.1/lib/secure/daemon/chat.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/daemon/chat.c Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,634 ---- + /* /daemon/chat.c + * from the Nightmare 3.2 Mudlib + * daemon to handle all mud chat channels + * created by Descartes of Borg 931220 + */ + + #include <lib.h> + #include <config.h> + #include <pov.h> + #include <daemons.h> + #include <origin.h> + #include <message_class.h> + #include "include/chat.h" + + inherit LIB_DAEMON; + + string suspect,site,plainmsg,chan,foo,bar,baz; + static private mapping Channels; + static private mapping chanlast; + + static private string *local_chans = ({"newbie","cre","gossip","admin","error", + "priest", "mage", "explorer", "thief", "fighter", "death" }); + + + static void create() { + object pl; + string *tmp_arr = ({}); + daemon::create(); + SetNoClean(1); + Channels = ([]); + foreach(pl in users()) { + string *chans; + string channel; + + if( pl && !(chans = (string *)pl->GetChannels()) ) continue; + foreach(channel in chans) { + if( !Channels[channel] ) Channels[channel] = ({}); + Channels[channel] = distinct_array(Channels[channel] + ({ pl })); + } + } + foreach( string channel in local_chans ){ + tmp_arr += ({ channel + "emote" }); + } + + local_chans += tmp_arr; + } + + varargs int CanListen(object who, string canal){ + //tc("CanListen: who: "+identify(who)+", canal: "+canal); + if(RESTRICTED_INTERMUD == 0 || !RESTRICTED_INTERMUD) return 1; + if(canal && member_array(canal, local_chans) != -1) return 1; + else return imud_privp(who); + } + + varargs int CanTalk(object who, string canal){ + //tc("CanListen: who: "+identify(who)+", canal: "+canal); + if(RESTRICTED_INTERMUD == 0 || !RESTRICTED_INTERMUD) return 1; + if(canal && member_array(canal, local_chans) != -1) return 1; + else return imud_privp(who); + } + + string *eventRegisterMember(string *chans) { + string *tmp; + object ob; + string channel; + + if( !living(ob = previous_object()) ) return ({}); + tmp = ({}); + foreach(channel in chans) { + /* just check out for secure channels */ + switch(channel) { + case "admin": + if( !archp(ob) ) break; + case "cre": case "intercre": case "intergossip": + if( !creatorp(ob) ) break; + default: + if( !Channels[channel]) Channels[channel] = ({}); + Channels[channel] = distinct_array(Channels[channel] + ({ ob })); + tmp += ({ channel }); + } + } + return tmp; + } + + string *eventRemoveMember(string *chans) { + object ob; + string channel; + + if( !living(ob = previous_object()) ) return({}); + foreach(channel in chans) { + if( !Channels[channel] ) continue; + else Channels[channel] -= ({ ob }); + if( !sizeof(Channels[channel]) ) map_delete(Channels, channel); + } + return chans; + } + + int cmdLast(string feep){ + + if(!chanlast||!Channels[feep]||member_array(this_player(), Channels[feep])==-1){ + + this_player()->eventPrint(mud_name() + " does not have that channel on record.", MSG_ERROR); + return 1; + } + if(!sizeof(chanlast[feep])) + { + this_player()->eventPrint("That channel has no backlog.", MSG_ERROR); + return 1; + } + if(!CanListen(this_player(),feep)){ + write("You lack privileges to that channel."); + return 1; + } + this_player()->eventPrint(implode(chanlast[feep], "\n")); + return 1; + } + + varargs int eventAddLast(string feep, string str, string pchan, string pmsg, string pwho) + { + chan=feep; + if(!chanlast) + chanlast=([]); + if(!sizeof(chanlast[chan])) + chanlast[chan] = ({}); + if(sizeof(chanlast[chan]) == 50) + chanlast[chan] = chanlast[chan][1..sizeof(chanlast[chan])]; + chanlast[chan] += ({ str }); + if(!pchan || pchan == "") pchan = "foo"; + plainmsg = "bar"; + if(pchan) plainmsg = "<" + pchan + "> "; + if(pmsg) plainmsg += pmsg; + if(pwho && pwho !="") plainmsg = pwho+" "+plainmsg; + if(pchan && pchan != "admin"){ + unguarded( (: write_file("/log/chan/"+chan,"["+timestamp()+"] "+plainmsg+"\n") :) ); + if( file_size("/log/chan/"+chan) > 200000) { + unguarded( (: rename("/log/chan/"+chan,"/log/chan/"+chan+"."+timestamp() ) :) ); + } + } + else { + unguarded( (: write_file("/secure/log/"+chan,"["+timestamp()+"] "+plainmsg+"\n") :) ); + if( file_size("/secure/log/"+chan) > 200000) { + unguarded( (: rename("/secure/log/"+chan,"/secure/log/"+chan+"."+timestamp() ) :) ); + } + } + return 1; + } + + int cmdChannel(string verb, string str) { + string varb, msg, name, rc, target, targetkey, target_msg; + object ob = 0; + int emote; + + if(first(str,1) == ":" && sizeof(str) > 3){ + if(!grepp(verb,"emote")) verb += "emote"; + str = trim(replace_string(str,":","",1)); + } + + if(grepp(verb, "emote")) varb = replace_string(verb,"emote",""); + else if(last(verb, 1) == ":") varb = replace_string(verb,":",""); + else varb = verb; + + if( verb == "hist" ) { + if( !Channels[str] ) return 0; + if( member_array(this_player(), Channels[str]) == -1 ) return 0; + cmdLast(str); + return 1; + } + + if( verb == "list" ) { + string *who; + string ch, mud; + + if( !str ) { + return 0; + } + if( sscanf(str, "%s@%s", ch, mud) == 2 ) { + mud = trim(mud); + if(!alphap(last(mud,1))) mud = truncate(mud,1); + if( !Channels[ch] ) { + return 0; + } + if( member_array(this_player(), Channels[ch]) == -1 ) { + return 0; + } + if( ch == (ch = GetRemoteChannel(ch)) ) { + if(!creatorp(this_player())){ + write("Remote channel information is not available to players."); + return 1; + } + } + if( !(mud = (string)INTERMUD_D->GetMudName(mud)) ) { + this_player()->eventPrint(mud_name() + " is not aware of " + "such a place.", MSG_ERROR); + return 1; + } + if(!CanTalk(this_player(),verb)){ + write("You lack privileges to that channel."); + return 1; + } + SERVICES_D->eventSendChannelWhoRequest(ch, mud); + this_player()->eventPrint("Remote listing request sent.", + MSG_SYSTEM); + return 1; + } + else ch = str; + if( !Channels[ch] ) { + return 0; + } + if( member_array(this_player(), Channels[str]) == -1 ) { + return 0; + } + who = GetChannelList(str); + msg = "Online: " + implode(who, " "); + //tc("msg1"); + this_player()->eventPrint(msg, MSG_SYSTEM); + return 1; + } + if(!CanTalk(this_player(),verb)){ + write("You lack privileges to that channel."); + return 1; + } + + if( !Channels[verb] ) { + if( sscanf(verb, "%semote", verb) || sscanf(verb, "%s:", verb) ) { + string emote_cmd, remains; + mixed array msg_data; + int i; + //tc("we seem to think it's an emote"); + if( !Channels[verb] ) { + return 0; + } + rc = GetRemoteChannel(verb); + sscanf(str, "%s %s", emote_cmd, remains); + if( !emote_cmd ) { + emote_cmd = str; + remains = 0; + } + if( !remains ) { + msg_data = SOUL_D->GetChannelEmote(emote_cmd, ""); + if( !msg_data ) { + str = "$N " + str; + } + } + + else { + if( ob = find_living(target = convert_name(remains)) ) { + msg_data = SOUL_D->GetChannelEmote(emote_cmd, "LIV"); + if( !msg_data ) { + str = "$N " + str; + target = 0; + } + } + else if( strsrch(target, "@") == -1 || rc == verb ) { + string array words = explode(remains, " "); + target = ""; + for(i=0; i<sizeof(words); i++) { + target += lower_case(words[i]); + if( ob = find_living(target) ) { + if( i < sizeof(words)-1 ) { + remains = implode(words[(i+1)..], " "); + } + else { + remains = 0; + } + msg_data = SOUL_D->GetChannelEmote(emote_cmd, + "LIV STR", + remains); + break; + } + } + if( !ob ) { + msg_data = SOUL_D->GetChannelEmote(emote_cmd, "STR", + remains); + target = 0; + } + if( !msg_data ) { + str = "$N " + str; + target = 0; + } + } + else if( rc != verb ) { + string array words; + i = strsrch(remains, "@", -1); + if( i >= strlen(remains)-1 ) { + msg_data = SOUL_D->GetChannelEmote(emote_cmd, "STR", + remains); + target = 0; + } + else { + string mud; + + words = explode(remains[(i+1)..], " "); + target = remains[0..i]; + remains = ""; + while(sizeof(words)) { + mud = implode(words, " "); + mud = trim(mud); + if(!alphap(last(mud,1))) mud = truncate(mud,1); + mud = INTERMUD_D->GetMudName(lower_case(mud)); + if( mud ) { + target += mud; + break; + } + if( remains == "" ) { + remains = words[<1]; + } + else { + remains = words[<1] + " " + remains; + } + words = words[0..<2]; + } + if( !mud ) { + msg_data = SOUL_D->GetChannelEmote(emote_cmd, + "STR", remains); + target = 0; + } + else { + if( trim(remains) == "" ) { + msg_data = SOUL_D->GetChannelEmote(emote_cmd, + "LIV"); + } + else { + msg_data = SOUL_D->GetChannelEmote(emote_cmd, + "LIV STR", + remains); + } + if( !msg_data ) { + str = "$N " + str; + target = 0; + } + } + } + } + } + if( msg_data ) { + string sgen = this_player()->GetGender(); + string tgen = 0; + + if( ob ) { + target = ob->GetName(); + tgen = ob->GetGender(); + } + else if( target ) { + string user, mud; + + sscanf(target, "%s@%s", user, mud); + targetkey = target; + tgen = SERVICES_D->GetRemoteGender(user, mud); + target = SERVICES_D->GetRemoteDisplayName(user, mud); + if( !target ) { + target = capitalize(targetkey); + } + } + str = create_message(POV_OBSERVER, msg_data[0][0], + msg_data[0][1], "$N", sgen, "$O", tgen, + msg_data[1]); + if( target ) { + target_msg = create_message(POV_TARGET, msg_data[0][0], + msg_data[0][1], "$N", sgen, + "$O", tgen, msg_data[1]); + } + } + emote = 1; + } + else { + return 0; + } + } + else { + rc = GetRemoteChannel(verb); + } + if( member_array(this_player(), Channels[verb]) == -1 ) return 0; + if( !str || str == "" ) { + this_player()->SetBlocked(verb); + return 1; + } + if( (int)this_player()->GetBlocked(verb) ) { + if( (int)this_player()->GetBlocked("all") ) { + this_player()->eventPrint("You cannot chat while totally blocked.", + MSG_ERROR); + return 1; + } + //this_player()->SetBlocked(verb); + this_player()->eventPrint("Turn this channel on to talk on it.", MSG_ERROR); + return 1; + } + if( verb == "admin" || verb=="cre" ) { + if( !(name = (string)this_player()->GetCapName()) ) + name = capitalize((string)this_player()->GetKeyName()); + } + else name = (string)this_player()->GetName(); + if( target_msg ) { + target_msg = replace_string(target_msg, "$O's", "your"); + } + if(!grepp(str,"$N") && emote) str = "$N "+str; + + eventSendChannel(name, verb, str, emote, target, target_msg); + if( ob ) { + SERVICES_D->eventSendChannel(name, rc, str, emote, target, + target_msg); + } + else { + SERVICES_D->eventSendChannel(name, rc, str, emote, targetkey, + target_msg); + } + return 1; + } + + varargs void eventSendChannel(string who, string ch, string msg, int emote, + string target, string targmsg) { + string pchan,pmsg; + pchan=ch; + + if( file_name(previous_object()) == SERVICES_D) { + ch = GetLocalChannel(ch); + if( emote && sizeof(who)) msg = replace_string(msg, "$N", who); + } + else if( origin() != ORIGIN_LOCAL && previous_object() != master() && + file_name(previous_object()) != PARTY_D && ch != "death") return; + if( !Channels[ch] ) return; + if( emote ) { + object *obs; + object ob; + string this_msg, tmp; + if( target && (ob = find_player(convert_name(target))) ) { + target = (string)ob->GetName(); + } + switch(ch) + { + case "death": + this_msg = "%^RED%^"; + break; + case "cre": + this_msg = "%^GREEN%^"; + break; + case "admin": + this_msg = "%^MAGENTA%^"; + break; + case "intergossip": + this_msg = "%^CYAN%^"; + break; + case "intercre": + this_msg = "%^YELLOW%^"; + break; + case "ds": + this_msg = "%^YELLOW%^"; + break; + case "newbie": + this_msg = "%^B_YELLOW%^"; + break; + case "gossip": + this_msg = "%^B_BLUE%^"; + break; + default: + this_msg = "%^BLUE%^"; + } + this_msg += "<" + ch + ">%^RESET%^ "; + msg = replace_string(msg, "$N", who); + if( target ) { + msg = replace_string(msg, "$O", target); + targmsg = replace_string(targmsg, "$N", who); + targmsg = capitalize(replace_string(targmsg, "$O", "you")); + } + obs = filter(Channels[ch], (: $1 && !((int)$1->GetBlocked($(ch))) :)); + tmp = this_msg + msg; + //ch = GetLocalChannel(ch); + eventAddLast(ch, tmp, pchan, msg); + foreach(object listener in obs) { + int ignore; + if(sscanf(who,"%s@%s",suspect,site) < 2) { + suspect = who; + site = "@"+mud_name(); + } + else site = "@"+site; + if( listener == ob ) continue; + foreach(string jerk in listener->GetMuffed()){ + //tc("suspect: "+suspect); + //tc("site: "+site); + //tc("jerk: "+jerk); + //tc("msg: "+msg); + //sscanf(tmp,"%s %s %s", foo, bar, baz); + //if(jerk && grepp(lower_case(bar),lower_case(jerk))) ignore = 1; + if(jerk && lower_case(suspect) == lower_case(jerk)) ignore = 1; + if(jerk && lower_case(site) == lower_case(jerk)) ignore = 1; + } + //tc("msg2","red"); + if(!ignore && CanListen(listener,ch)) listener->eventPrint(tmp, MSG_CONV); + ignore = 0; + } + if( member_array(ob, obs) != -1 ) { + if( ob && !((int)ob->GetBlocked(ch)) ) { + int ignore; + tmp = this_msg + targmsg; + foreach(string jerk in ob->GetMuffed()){ + if(jerk && lower_case(suspect) == lower_case(jerk)) ignore = 1; + if(jerk && lower_case(site) == lower_case(jerk)) ignore = 1; + } + //tc("msg3","green"); + if(!ignore && CanListen(ob,ch)) ob->eventPrint(tmp, MSG_CONV); + ignore = 0; + } + } + suspect = ""; + site = ""; + } + else { + object *obs; + string tmsg; + + tmsg = who + " "; + switch(ch) + { + case "cre": + tmsg += "%^GREEN%^"; + break; + case "death": + tmsg += "%^RED%^"; + break; + case "admin": + tmsg += "%^MAGENTA%^"; + break; + case "intergossip": + tmsg += "%^CYAN%^"; + break; + case "intercre": + tmsg += "%^YELLOW%^"; + break; + case "ds": + tmsg += "%^YELLOW%^"; + break; + case "newbie": + tmsg += "%^B_YELLOW%^"; + break; + case "gossip": + tmsg += "%^B_BLUE%^"; + break; + default: + tmsg += "%^BLUE%^"; + } + + tmsg += "<"+ch+">%^RESET%^ " + msg; + pmsg = msg; + msg = tmsg; + //ch = GetLocalChannel(ch); + eventAddLast(ch, msg, pchan, pmsg, who); + obs = filter(Channels[ch], (: $1 && !((int)$1->GetBlocked($(ch))) :)); + foreach(object ob in obs){ + int ignore; + if(sscanf(who,"%s@%s",suspect,site) < 2) { + suspect = who; + site = "@"+mud_name(); + } + else site = "@"+site; + + foreach(string jerk in ob->GetMuffed()){ + //if(jerk) tc("jerk: "+jerk,"red"); + if(jerk && lower_case(suspect) == lower_case(jerk)) ignore = 1; + if(jerk && lower_case(site) == lower_case(jerk)) ignore = 1; + } + //tc("msg4","blue"); + //tc("who: "+who); + //tc("suspect: "+suspect); + //tc("site: "+site); + if(!ignore && CanListen(ob,ch)) ob->eventPrint(msg, MSG_CONV); + ignore = 0; + suspect =""; + site = ""; + } + + } + } + + string *GetChannelList(string ch) { + string *ret; + object who; + + if( file_name(previous_object()) == SERVICES_D ) ch = GetLocalChannel(ch); + else if( origin() != ORIGIN_LOCAL ) return ({}); + if( !Channels[ch] ) return ({}); + ret = ({}); + foreach(who in Channels[ch]) { + if( !who || (int)who->GetInvis() || (int)who->GetBlocked(ch) ) + continue; + ret += ({ (string)who->GetName() }); + } + return ret; + } + + string GetLocalChannel(string ch) { + switch(ch) { + case "imud_code": + return "intercre"; + + case "imud_gossip": + return "intergossip"; + + case "dutch": + return "dutch"; + + case "dead_test4": + return "ds_test"; + + case "dead_souls": + return "ds"; + + } + return ch; + } + + string GetRemoteChannel(string ch) { + switch(ch) { + case "intercre": + return "imud_code"; + + case "intergossip": + return "imud_gossip"; + + case "foundation": + return "ie_flibcode"; + + case "dutch": + return "dutch"; + + case "ds_test": + return "dead_test4"; + + case "ds": + return "dead_souls"; + + } + return ch; + } + + string *GetChannels() { return copy(keys(Channels)); } diff -c -r --new-file ds1.1/lib/secure/daemon/economy.c ds2.0r27/lib/secure/daemon/economy.c *** ds1.1/lib/secure/daemon/economy.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/daemon/economy.c Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,84 ---- + // /daemon/mudlib/economy_d.c + // from the Dead Souls Mudlib + // a daemon to handle currenciy inflation + // created by Descartes of Borg 931114 + + #include <lib.h> + #include <save.h> + #include <privs.h> + //#include <clock.h> + + inherit LIB_DAEMON; + + private mapping Currencies; + int LastInflation; + string oba; + + static void create() { + string *borg; + float temps, tmp; + int i; + + daemon::create(); + SetNoClean(1); + Currencies = ([]); + restore_object(SAVE_ECONOMY); + i = sizeof(borg = keys(Currencies)); + temps = percent(time()-LastInflation, 4800000)* 0.01; + while(i--) { + tmp = temps * Currencies[borg[i]]["inflation"]; + Currencies[borg[i]]["rate"] += tmp*Currencies[borg[i]]["rate"]; + } + LastInflation = time(); + unguarded( (: save_object(SAVE_ECONOMY) :) ); + } + + string ewrite(string str){ + oba = str; + unguarded( (: write_file("/save/test.txt",oba,1) :) ); + return read_file("/save/test.txt"); + } + + static private void validate() { + if( !((int)master()->valid_apply(({ PRIV_ASSIST }))) ){ + write(identify(previous_object(-1))); + error("Illegal attempt to modify economy data"); + } + } + + + void add_currency(string type, float rate, float infl, float wt) { + validate(); + if(!mapp(Currencies)) Currencies = ([]); + if(!type || !rate || !infl || !wt || Currencies[type]) return; + Currencies[type] = ([ "rate":rate, "inflation":infl, "weight":wt ]); + unguarded( (: save_object(SAVE_ECONOMY) :) ); + } + + void remove_currency(string type) { + validate(); + if(!mapp(Currencies)) return; + map_delete(Currencies, type); + unguarded( (: save_object(SAVE_ECONOMY) :) ); + } + + + void change_currency(string type, string key, float x) { + validate(); + if(!mapp(Currencies)) Currencies = ([]); + if(!type || !Currencies[type] || !key || !x) return; + if(!Currencies[type][key]) return; + Currencies[type][key] = x; + unguarded( (: save_object(SAVE_ECONOMY) :) ); + } + + float __Query(string type, string key) { + if(!Currencies[type]) return 0.0; + else return Currencies[type][key]; + } + + string *__QueryCurrencies() { + if(sizeof(Currencies)) + return keys(Currencies); + else return ({}); + } diff -c -r --new-file ds1.1/lib/secure/daemon/events.c ds2.0r27/lib/secure/daemon/events.c *** ds1.1/lib/secure/daemon/events.c Sun Feb 1 21:30:42 1998 --- ds2.0r27/lib/secure/daemon/events.c Wed Jul 5 00:01:05 2006 *************** *** 20,26 **** daemon::create(); SetNoClean(1); if( file_exists(SAVE_EVENTS __SAVE_EXTENSION__) ) ! unguarded((: restore_object, SAVE_EVENTS :)); if( !RebootInterval ) RebootInterval = 24; if( !Events ) Events = ([]); eventSave(); --- 20,26 ---- daemon::create(); SetNoClean(1); if( file_exists(SAVE_EVENTS __SAVE_EXTENSION__) ) ! unguarded((: restore_object, SAVE_EVENTS :)); if( !RebootInterval ) RebootInterval = 24; if( !Events ) Events = ([]); eventSave(); *************** *** 37,47 **** void eventReboot(int x) { if( previous_object() && !((int)master()->valid_apply(({ PRIV_ASSIST }))) ) ! return; if( x < 1 ) x = 1; x *= 60; message("broadcast", mud_name() + " will reboot in " + ! consolidate(x/60, "a minute") + ".", users()); if( x < 61 ) call_out( (: eventAnnounceReboot, 10 :), x - 10); else { int y; --- 37,47 ---- void eventReboot(int x) { if( previous_object() && !((int)master()->valid_apply(({ PRIV_ASSIST }))) ) ! return; if( x < 1 ) x = 1; x *= 60; message("broadcast", mud_name() + " will reboot in " + ! consolidate(x/60, "a minute") + ".", users()); if( x < 61 ) call_out( (: eventAnnounceReboot, 10 :), x - 10); else { int y; *************** *** 59,65 **** } else if( x < 61 ) { message("broadcast", mud_name() + " will reboot in a minute.", ! users()); call_out( (: eventAnnounceReboot, 10 :), 50); } else { --- 59,65 ---- } else if( x < 61 ) { message("broadcast", mud_name() + " will reboot in a minute.", ! users()); call_out( (: eventAnnounceReboot, 10 :), 50); } else { *************** *** 78,84 **** static void Shutdown() { message("broadcast", "Shutting down " + mud_name() + " immediately!", ! users()); map(users(), (: catch($1->cmdQuit()) :)); shutdown(); } --- 78,84 ---- static void Shutdown() { message("broadcast", "Shutting down " + mud_name() + " immediately!", ! users()); map(users(), (: catch($1->cmdQuit()) :)); shutdown(); } *************** *** 91,116 **** x = time(); i = sizeof(events = keys(Events)); while(i--) { ! if( events[i] <= x ) { object ob; function f; ! if( !(ob = load_object(Events[events[i]]["creator"])) ) { map_delete(Events, events[i]); continue; } f = (: call_other, Events[events[i]]["object"], ! Events[events[i]]["func"] :); f = bind(f, ob); ! catch(evaluate(f, Events[events[i]]["args"]...)); ! if( Events[events[i]]["regular"] > 3599 ) ! Events[x + Events[events[i]]["regular"]] = Events[events[i]]; map_delete(Events, events[i]); ! } } if( (uptime() > RebootInterval*3600) && !InReboot ) { InReboot = 1; ! eventReboot(MINUTES_REBOOT_WARNING); } eventSave(); } --- 91,117 ---- x = time(); i = sizeof(events = keys(Events)); while(i--) { ! if( events[i] <= x ) { object ob; function f; ! if( !(ob = find_object(Events[events[i]]["creator"]) ) ! && !(ob = load_object(Events[events[i]]["creator"])) ) { map_delete(Events, events[i]); continue; } f = (: call_other, Events[events[i]]["object"], ! Events[events[i]]["function"] :); f = bind(f, ob); ! catch(evaluate(f, Events[events[i]]["args"]...)); ! if( Events[events[i]]["regular"] > 0 ) ! Events[x + Events[events[i]]["interval"]] = Events[events[i]]; map_delete(Events, events[i]); ! } } if( (uptime() > RebootInterval*3600) && !InReboot ) { InReboot = 1; ! eventReboot(MINUTES_REBOOT_WARNING); } eventSave(); } *************** *** 129,138 **** void AddEvent(string c, string s, string f, mixed *a, int w, int r) { if( file_name(previous_object()) != SEFUN ) return; Events[time() + w] = ([ "object" : s, "function" : f, "args" : a, ! "creator" : c, "regular" : (r ? w : 0) ]); eventSave(1); } mapping GetEvents() { return copy(Events); } --- 130,149 ---- void AddEvent(string c, string s, string f, mixed *a, int w, int r) { if( file_name(previous_object()) != SEFUN ) return; Events[time() + w] = ([ "object" : s, "function" : f, "args" : a, ! "creator" : c, "regular" : (r ? w : 0), "interval" : w ]); eventSave(1); } + void RemoveEvent(int i){ + if( file_name(previous_object()) != SEFUN ) return; + if(sizeof(Events[i])){ + //tc("Events: "+identify(Events)); + map_delete(Events, i); + //tc("Events: "+identify(Events)); + eventSave(1); + } + } + mapping GetEvents() { return copy(Events); } diff -c -r --new-file ds1.1/lib/secure/daemon/finger.c ds2.0r27/lib/secure/daemon/finger.c *** ds1.1/lib/secure/daemon/finger.c Sun Feb 1 21:30:40 1998 --- ds2.0r27/lib/secure/daemon/finger.c Wed Jul 5 00:01:05 2006 *************** *** 5,23 **** * Version: @(#) finger.c 1.11@(#) * Last modified: 96/12/14 */ ! #include <lib.h> #include <daemons.h> #include <marriage.h> #include <clock.h> #include "finger.h" ! inherit LIB_DAEMON; ! private int LoginTime, Level, BirthTime, CreatorBirth, WhereBlock; private string CurrentUser, Short, CapName, RealName, Email; private string Town, Race, Gender, HostSite; ! private string Class, Guild, Long; private string Rank, WebPage; private string array Titles, Religion; private class marriage array Marriages; --- 5,23 ---- * Version: @(#) finger.c 1.11@(#) * Last modified: 96/12/14 */ ! #include <lib.h> #include <daemons.h> #include <marriage.h> #include <clock.h> #include "finger.h" ! inherit LIB_DAEMON; ! private int LoginTime, Level, BirthTime, CreatorBirth, WhereBlock; private string CurrentUser, Short, CapName, RealName, Email; private string Town, Race, Gender, HostSite; ! private string Class, Clan, Long; private string Rank, WebPage; private string array Titles, Religion; private class marriage array Marriages; *************** *** 26,80 **** daemon::create(); SetNoClean(1); } ! varargs string GetFinger(string who, int html) { mapping mail_stat; object ob; string ret; mixed creator; ! if( !who ) { ! object array people; ! string array lines = ({}); ! object person; ! int i, maxi; ! int array screen; ! ! screen = (int array)this_player()->GetScreen(); ! if( screen && sizeof(screen) ) i = screen[0]; else i = 80; ! ret = center(mud_name(), i) + "\n\n"; ! people = filter(users(), (: !((int)$1->GetInvis()) :)); ! foreach(person in people) { ! string str, clas, town; ! ! str = (string)person->GetShort(); ! if( !str ) str = (string)person->GetName(); ! if( !str ) continue; ! if( creatorp(person) ) clas = "creator"; ! else clas = (string)person->GetClass(); ! if( clas ) clas = capitalize(clas); ! else clas = "Drifter"; ! town = (string)person->GetTown(); ! if( !town ) town = "Homeless"; ! str = sprintf("%:-40s %:-11s %s", str, clas, town); ! lines += ({ str }); ! } ! ret += implode(lines, "\n"); ! return ret; } if( who != CurrentUser ) { creator = 0; ! if( !user_exists(who) ) ! return capitalize(who) + " has never visited " + mud_name() + "."; ! else if( !unguarded( (: restore_object, DIR_PLAYERS "/" + who[0..0] + ! "/" + who :)) && ! !(creator = unguarded( (: restore_object, DIR_CRES "/" + ! who[0..0] + "/" + who :) ) )) return 0; ! CurrentUser = who; } else if( !strsrch(save_file(who), DIR_CRES) ) creator = 1; ret = "%^STRONG%^" + replace_string(GetTitle(), "$N", CapName) + ! "%^/STRONG%^BR%^\n"; if( Long ) { ret += replace_string(Long, "$N", CapName) + "%^BR%^\n"; } --- 26,80 ---- daemon::create(); SetNoClean(1); } ! varargs string GetFinger(string who, int html) { mapping mail_stat; object ob; string ret; mixed creator; ! if( !who ) { ! object array people; ! string array lines = ({}); ! object person; ! int i; ! int array screen; ! ! screen = (int array)this_player()->GetScreen(); ! if( screen && sizeof(screen) ) i = screen[0]; else i = 80; ! ret = center(mud_name(), i) + "\n\n"; ! people = filter(users(), (: !((int)$1->GetInvis()) :)); ! foreach(person in people) { ! string str, clas, town; ! ! str = (string)person->GetShort(); ! if( !str ) str = (string)person->GetName(); ! if( !str ) continue; ! if( creatorp(person) ) clas = "creator"; ! else clas = (string)person->GetClass(); ! if( clas ) clas = capitalize(clas); ! else clas = "Drifter"; ! town = (string)person->GetTown(); ! if( !town ) town = "Homeless"; ! str = sprintf("%:-40s %:-11s %s", str, clas, town); ! lines += ({ str }); ! } ! ret += implode(lines, "\n"); ! return ret; } if( who != CurrentUser ) { creator = 0; ! if( !user_exists(who) ) ! return capitalize(who) + " has never visited " + mud_name() + "."; ! else if( !unguarded( (: restore_object, DIR_PLAYERS "/" + who[0..0] + ! "/" + who :)) && ! !(creator = unguarded( (: restore_object, DIR_CRES "/" + ! who[0..0] + "/" + who :) ) )) return 0; ! CurrentUser = who; } else if( !strsrch(save_file(who), DIR_CRES) ) creator = 1; ret = "%^STRONG%^" + replace_string(GetTitle(), "$N", CapName) + ! "%^/STRONG%^BR%^\n"; if( Long ) { ret += replace_string(Long, "$N", CapName) + "%^BR%^\n"; } *************** *** 92,170 **** } if( creator ) { ret += CapName + " is a " + Gender + " Creator of %^I%^" + mud_name() + ! "%^/I%^.%^BR%^\n"; ret += "Immortality Date: " + ctime(CreatorBirth) + "%^BR%^\n"; } else { string yrstr; int yr; ! ret += CapName+" the "+Gender+" "+Race+" "+(Class || "drifter"); ! if( Guild ) ret += " of the " + pluralize(Guild); ! if( creatorp(this_player()) && Level ) ret += " ("+Level+")"; ret += " is a " + Rank+" of " + Town + ".%^BR%^\n"; BirthTime = BirthTime - (18 * YEAR); if( (yr = query_year(BirthTime)) < 0 ) yrstr = -yr + " BN"; else yrstr = "" + yr; ret += sprintf("Birthday: the %d%s day of %s, %s", ! query_date(BirthTime), ordinal(query_date(BirthTime)), ! query_month(BirthTime), yrstr) + "%^BR%^\n"; } if( !Email ) Email = "#CHANGE"; ret += "%^TABLE%^TR%^TD%^" + ! sprintf("In real life: %:-30s %%^/TD%%^TD%%^Email: %s", RealName , ! (Email[0]!='#' || (this_player(1) && archp(this_player(1)))) ! ? (Email[0] == '#' ? Email[1..] : Email) : "Unlisted") + ! "%^/TD%^/TR%^\n"; ret += "%^TR%^TD%^" + ! sprintf("Religion: %:-34s %%^/TD%%^TD%%^Spouse: %s", ! (!creator && Religion[1]) ? Religion[1] : "Agnostic", ! !sizeof(Marriages) ? "Single" : ! (((class marriage)Marriages[0])->DivorceDate ? ! "Divorced" : ((class marriage)Marriages[0])->Spouse)) + ! "%^/TD%^/TR%^/TABLE%^\n"; if( (ob = find_player(who)) && (!ob->GetInvis()) ) { if( !interactive(ob) ) ret += "Currently net-dead"; else ret += "On since " + ctime(LoginTime); } else ret += "Last on " + ctime(LoginTime); if( !WhereBlock || (this_player(1) && archp(this_player(1))) ) ! ret += " from " + HostSite + "%^BR%^\n"; else ret += "%^BR%^\n"; mail_stat = (mapping)FOLDERS_D->mail_status(who); if( mail_stat["unread"] ) ! ret += CapName + " has " + consolidate(mail_stat["unread"], ! "an unread letter") + ".%^BR%^\n"; if( unguarded( (: file_size, user_path(who) + ".project" :) ) > 0 ) ! ret += "Project: %^PRE%^" + ! unguarded( (: read_file, user_path(who) + ".project" :) ) + ! "%^/PRE%^\n"; if( unguarded( (: file_size, user_path(who) + ".plan" :) ) > 0 ) ! ret += "Plan:%^PRE%^\n" + ! unguarded( (: read_file, user_path(who) + ".plan" :) ) + "%^/PRE%^\n"; return ret; } ! mixed array GetRemoteFinger(string who) { mixed array tmp; string plan; int creator; object ob; ! who = convert_name(who); if( who != CurrentUser ) { creator = 0; ! if( !user_exists(who) ) return 0; ! else if( !unguarded( (: restore_object, DIR_PLAYERS "/" + who[0..0] + ! "/" + who :)) && ! !(creator = unguarded( (: restore_object, DIR_CRES "/" + ! who[0..0] + "/" + who :) ) )) return 0; ! CurrentUser = who; } else if( !strsrch(save_file(who), DIR_CRES) ) creator = 1; ob = find_player(who); if( unguarded( (: file_size, user_path(who) + ".plan" :) ) > 0 ) { ! plan = unguarded( (: read_file, user_path(who) + ".plan", 1, 5 :) ); if( strlen(plan) ) { plan = "Plan: (truncated to 5 lines)\n" + plan; if( plan[<1] != '\n' ) plan += "\n"; --- 92,170 ---- } if( creator ) { ret += CapName + " is a " + Gender + " Creator of %^I%^" + mud_name() + ! "%^/I%^.%^BR%^\n"; ret += "Immortality Date: " + ctime(CreatorBirth) + "%^BR%^\n"; } else { string yrstr; int yr; ! ret += CapName+" the "+Gender+" "+Race+" "+(Class || "drifter"); ! if( Clan ) ret += " of the " + pluralize(Clan); ! if( creatorp(this_player()) && Level ) ret += " ("+Level+")"; ret += " is a " + Rank+" of " + Town + ".%^BR%^\n"; BirthTime = BirthTime - (18 * YEAR); if( (yr = query_year(BirthTime)) < 0 ) yrstr = -yr + " BN"; else yrstr = "" + yr; ret += sprintf("Birthday: the %d%s day of %s, %s", ! query_date(BirthTime), ordinal(query_date(BirthTime)), ! query_month(BirthTime), yrstr) + "%^BR%^\n"; } if( !Email ) Email = "#CHANGE"; ret += "%^TABLE%^TR%^TD%^" + ! sprintf("In real life: %:-30s %%^/TD%%^TD%%^Email: %s", RealName , ! (Email[0]!='#' || (this_player(1) && archp(this_player(1)))) ! ? (Email[0] == '#' ? Email[1..] : Email) : "Unlisted") + ! "%^/TD%^/TR%^\n"; ret += "%^TR%^TD%^" + ! sprintf("Religion: %:-34s %%^/TD%%^TD%%^Spouse: %s", ! (!creator && Religion[1]) ? Religion[1] : "Agnostic", ! !sizeof(Marriages) ? "Single" : ! (((class marriage)Marriages[0])->DivorceDate ? ! "Divorced" : ((class marriage)Marriages[0])->Spouse)) + ! "%^/TD%^/TR%^/TABLE%^\n"; if( (ob = find_player(who)) && (!ob->GetInvis()) ) { if( !interactive(ob) ) ret += "Currently net-dead"; else ret += "On since " + ctime(LoginTime); } else ret += "Last on " + ctime(LoginTime); if( !WhereBlock || (this_player(1) && archp(this_player(1))) ) ! ret += " from " + HostSite + "%^BR%^\n"; else ret += "%^BR%^\n"; mail_stat = (mapping)FOLDERS_D->mail_status(who); if( mail_stat["unread"] ) ! ret += CapName + " has " + consolidate(mail_stat["unread"], ! "an unread letter") + ".%^BR%^\n"; if( unguarded( (: file_size, user_path(who) + ".project" :) ) > 0 ) ! ret += "Project: %^PRE%^" + ! unguarded( (: read_file, user_path(who) + ".project" :) ) + ! "%^/PRE%^\n"; if( unguarded( (: file_size, user_path(who) + ".plan" :) ) > 0 ) ! ret += "Plan:%^PRE%^\n" + ! unguarded( (: read_file, user_path(who) + ".plan" :) ) + "%^/PRE%^\n"; return ret; } ! mixed array GetRemoteFinger(string who) { mixed array tmp; string plan; int creator; object ob; ! who = convert_name(who); if( who != CurrentUser ) { creator = 0; ! if( !user_exists(who) ) return 0; ! else if( !unguarded( (: restore_object, DIR_PLAYERS "/" + who[0..0] + ! "/" + who :)) && ! !(creator = unguarded( (: restore_object, DIR_CRES "/" + ! who[0..0] + "/" + who :) ) )) return 0; ! CurrentUser = who; } else if( !strsrch(save_file(who), DIR_CRES) ) creator = 1; ob = find_player(who); if( unguarded( (: file_size, user_path(who) + ".plan" :) ) > 0 ) { ! plan = unguarded( (: read_file, user_path(who) + ".plan", 1, 5 :) ); if( strlen(plan) ) { plan = "Plan: (truncated to 5 lines)\n" + plan; if( plan[<1] != '\n' ) plan += "\n"; *************** *** 173,183 **** } if( !Email ) Email = "#CHANGE"; tmp = ({ CapName, GetTitle(), RealName, (Email[0] != '#' ? Email : 0), ! ctime(LoginTime), (ob && interactive(ob) ? query_idle(ob) : -1), ! 0, (creator ? "Creator" : "" + Level), plan }); return tmp; } ! string GetTitle() { if( Short ) return Short; else if( Titles && sizeof(Titles) ) return Titles[0]; --- 173,183 ---- } if( !Email ) Email = "#CHANGE"; tmp = ({ CapName, GetTitle(), RealName, (Email[0] != '#' ? Email : 0), ! ctime(LoginTime), (ob && interactive(ob) ? query_idle(ob) : -1), ! 0, (creator ? "Creator" : "" + Level), plan }); return tmp; } ! string GetTitle() { if( Short ) return Short; else if( Titles && sizeof(Titles) ) return Titles[0]; diff -c -r --new-file ds1.1/lib/secure/daemon/folders.c ds2.0r27/lib/secure/daemon/folders.c *** ds1.1/lib/secure/daemon/folders.c Sun Feb 1 21:30:42 1998 --- ds2.0r27/lib/secure/daemon/folders.c Wed Jul 5 00:01:05 2006 *************** *** 31,46 **** OPTIONS_D->assure_box_exists(who); file = sprintf("%s/%s/%s/%s", DIR_POSTAL, who[0..0], who, folder); if(!unguarded((: file_exists, file+__SAVE_EXTENSION__ :))) { ! __BoxInfo = ({}); ! __Folder = folder; ! __Owner = who; ! } else { ! __Folder = folder; ! __Owner = who; ! if(!unguarded((: restore_object, file :))) __BoxInfo = ({}); ! } ! } static private void save_folder() { string file; --- 31,46 ---- OPTIONS_D->assure_box_exists(who); file = sprintf("%s/%s/%s/%s", DIR_POSTAL, who[0..0], who, folder); if(!unguarded((: file_exists, file+__SAVE_EXTENSION__ :))) { ! __BoxInfo = ({}); ! __Folder = folder; ! __Owner = who; ! } else { ! __Folder = folder; ! __Owner = who; ! if(!unguarded((: restore_object, file :))) __BoxInfo = ({}); ! } ! } static private void save_folder() { string file; *************** *** 48,60 **** if(!__Owner || !__Folder) return; file= sprintf("%s/%s/%s/%s", DIR_POSTAL, __Owner[0..0], __Owner, __Folder); unguarded((: save_object, file :)); ! } mapping *query_box_info(string who, string folder) { if(base_name(previous_object(0)) != OBJ_POST) return ({}); load_folder(who, folder); return __BoxInfo; ! } void add_post(string who, string folder, mapping borg) { string fwd, a, b, msg, tmp; --- 48,60 ---- if(!__Owner || !__Folder) return; file= sprintf("%s/%s/%s/%s", DIR_POSTAL, __Owner[0..0], __Owner, __Folder); unguarded((: save_object, file :)); ! } mapping *query_box_info(string who, string folder) { if(base_name(previous_object(0)) != OBJ_POST) return ({}); load_folder(who, folder); return __BoxInfo; ! } void add_post(string who, string folder, mapping borg) { string fwd, a, b, msg, tmp; *************** *** 65,81 **** tmp != LOCALPOST_D) return; if(folder=="new" && (fwd=(string)OPTIONS_D->query_option(who, "forward")) && strsrch(borg["subject"], "[FORWARD]") == -1) { ! borg["subject"] += " [FORWARD]"; ! if(sscanf(fwd, "%s@%s", a, b) == 2) { ! borg["message"] = (string)LETTERS_D->query_letter(borg["id"]); ! LOCALPOST_D->send_post(borg, fwd); ! return; ! } ! else if(user_exists(fwd)) { ! this_object()->add_post(fwd, "new", borg); ! return; ! } ! } load_folder(who, folder); if(__Folder != "new") borg["read"] = 1; else borg["read"] = 0; --- 65,81 ---- tmp != LOCALPOST_D) return; if(folder=="new" && (fwd=(string)OPTIONS_D->query_option(who, "forward")) && strsrch(borg["subject"], "[FORWARD]") == -1) { ! borg["subject"] += " [FORWARD]"; ! if(sscanf(fwd, "%s@%s", a, b) == 2) { ! borg["message"] = (string)LETTERS_D->query_letter(borg["id"]); ! LOCALPOST_D->send_post(borg, fwd); ! return; ! } ! else if(user_exists(fwd)) { ! this_object()->add_post(fwd, "new", borg); ! return; ! } ! } load_folder(who, folder); if(__Folder != "new") borg["read"] = 1; else borg["read"] = 0; *************** *** 84,97 **** save_folder(); if(folder != "new") return; if((pl=find_player(who)) && (int)OPTIONS_D->query_option(who, "notify")) { ! msg = (string)OPTIONS_D->query_option(who, "message"); ! if( !stringp(msg) ) msg = "New mail from $N!!!\n"; ! msg = replace_string(replace_string(msg, "$S", borg["subject"]), ! "$N", capitalize(borg["from"])); ! message("system", msg, pl); } if(pl && ob = present(POSTAL_ID, pl)) { ! ob->incoming_post(); } } --- 84,97 ---- save_folder(); if(folder != "new") return; if((pl=find_player(who)) && (int)OPTIONS_D->query_option(who, "notify")) { ! msg = (string)OPTIONS_D->query_option(who, "message"); ! if( !stringp(msg) ) msg = "New mail from $N!\n"; ! msg = replace_string(replace_string(msg, "$S", borg["subject"]), ! "$N", capitalize(borg["from"])); ! message("system", msg, pl); } if(pl && ob = present(POSTAL_ID, pl)) { ! ob->incoming_post(); } } *************** *** 102,114 **** load_folder(who, folder); if((i = sizeof(del)) != sizeof(__BoxInfo)) return; while(i--) { ! if(del[i]) { ! LETTERS_D->delete_folder(__Owner, __Folder, __BoxInfo[i]["id"]); ! __BoxInfo[i] = 0; ! } } __BoxInfo = sort_array(filter(__BoxInfo, "filter_folder", ! this_object()), "sort_folder", this_object()); save_folder(); } --- 102,114 ---- load_folder(who, folder); if((i = sizeof(del)) != sizeof(__BoxInfo)) return; while(i--) { ! if(del[i]) { ! LETTERS_D->delete_folder(__Owner, __Folder, __BoxInfo[i]["id"]); ! __BoxInfo[i] = 0; ! } } __BoxInfo = sort_array(filter(__BoxInfo, "filter_folder", ! this_object()), "sort_folder", this_object()); save_folder(); } *************** *** 125,132 **** load_folder(who, "new"); i = sizeof(__BoxInfo); while(i--) { ! total++; ! if(!__BoxInfo[i]["read"]) unread++; } return ([ "unread" : unread, "total" : total ]); } --- 125,132 ---- load_folder(who, "new"); i = sizeof(__BoxInfo); while(i--) { ! total++; ! if(!__BoxInfo[i]["read"]) unread++; } return ([ "unread" : unread, "total" : total ]); } diff -c -r --new-file ds1.1/lib/secure/daemon/i3router/broadcast_chanlist.h ds2.0r27/lib/secure/daemon/i3router/broadcast_chanlist.h *** ds1.1/lib/secure/daemon/i3router/broadcast_chanlist.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/daemon/i3router/broadcast_chanlist.h Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,31 ---- + // This file written completely by Tim Johnson (Tim@TimMUD) + + // broadcast the chanlist-reply when a channel just now got changed... + static void broadcast_chanlist(string channame){ + string name; // channel name in first loop, then mud name in later loop + #ifdef SEND_WHOLE_CHANLIST + mapping out=([]); // only used if whole chanlist is sent + trr("broadcasting chanlist to let them know about "+channame); + foreach(name in keys(channel_updates)){ + if(!channels[channame]) + out[name]=0; + else + out[name]=({ channels[name][1], channels[name][0] }); + } + #else + if(!channels[channame]) + out = ([ channame:0 ]); + else + out = ([ channame:({ channels[channame][1], channels[channame][0] }) ]); + #endif + foreach(name in keys(connected_muds)){ + trr("inside loop with "+name); + if(member_array("channel", keys(mudinfo[name]["services"]))!=-1){ + // only tell muds that have the "channel" service... + write_data(connected_muds[name], ({ + "chanlist-reply",5,router_name,0,name,0,channel_update_counter,out + })); + } + trr("done with: "+name); + } + } diff -c -r --new-file ds1.1/lib/secure/daemon/i3router/broadcast_mudlist.h ds2.0r27/lib/secure/daemon/i3router/broadcast_mudlist.h *** ds1.1/lib/secure/daemon/i3router/broadcast_mudlist.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/daemon/i3router/broadcast_mudlist.h Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,66 ---- + // This file written completely by Tim Johnson (Tim@TimMUD) + + // broadcast the mudlist when a mud just now got changed... + void broadcast_mudlist(string mudname){ + string targ_mudname; + mixed *packet1; // for muds that use protocol 1 or 2 + mixed *packet3; // for muds that use protocol 3 + trr("broadcasting mudlist to let them know about "+mudname,"red"); + packet1 = ({ "mudlist", 5, router_name, 0, "dummy", 0, mudinfo_update_counter,([ + mudname:({ + connected_muds[mudname] ? -1 : 0, + // -1=up, 0=down, n=down for n secs + mudinfo[mudname]["ip"], // ip_addr + mudinfo[mudname]["player_port"], // player_port + mudinfo[mudname]["imud_tcp_port"], // imud_tcp_port + mudinfo[mudname]["imud_udp_port"], // imud_udp_port + mudinfo[mudname]["mudlib"], // mudlib + mudinfo[mudname]["base_mudlib"], // base_mudlib + mudinfo[mudname]["driver"], // driver + mudinfo[mudname]["mud_type"], // mud_type + mudinfo[mudname]["open_status"], // open_status + mudinfo[mudname]["services"], // services + }) + ]) }); + packet3 = ({ "mudlist", 5, router_name, 0, "dummy", 0, mudinfo_update_counter,([ + mudname:({ + (connected_muds[mudname] ? -1 : 0), + // -1=up, 0=down, n=down for n secs + mudinfo[mudname]["ip"], // ip_addr + mudinfo[mudname]["player_port"], // player_port + mudinfo[mudname]["imud_tcp_port"], // imud_tcp_port + mudinfo[mudname]["imud_udp_port"], // imud_udp_port + mudinfo[mudname]["mudlib"], // mudlib + mudinfo[mudname]["base_mudlib"], // base_mudlib + mudinfo[mudname]["driver"], // driver + mudinfo[mudname]["mud_type"], // mud_type + mudinfo[mudname]["open_status"], // open_status + mudinfo[mudname]["admin_email"], // admin_email + mudinfo[mudname]["services"], // services + mudinfo[mudname]["other_data"], // other_data + }) + ]) }); + if(!mudinfo[mudname]){ // deleted mud... + // just send a 0 to everyone + foreach(targ_mudname in keys(connected_muds)){ + write_data(connected_muds[targ_mudname], ({ + "mudlist", 5, router_name, 0, targ_mudname, + 0, mudinfo_update_counter, ([mudname:0]) + }) ); + } + return; + } + foreach(targ_mudname in keys(connected_muds)){ + switch(mudinfo[targ_mudname]["protocol"]){ + case 1: + case 2: + packet1[4]=targ_mudname; + write_data(connected_muds[targ_mudname], packet1); + break; + case 3: + packet3[4]=targ_mudname; + write_data(connected_muds[targ_mudname], packet3); + break; + } + } + } diff -c -r --new-file ds1.1/lib/secure/daemon/i3router/core_stuff.h ds2.0r27/lib/secure/daemon/i3router/core_stuff.h *** ds1.1/lib/secure/daemon/i3router/core_stuff.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/daemon/i3router/core_stuff.h Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,74 ---- + // This file written completely by Tim Johnson (Tim@TimMUD) + #include <network.h> + #include <save.h> + + static void create(){ + SetNoClean(1); + sockets = ([]); + connected_muds = ([]); + if(!mudinfo) mudinfo = ([]); + if(!mudinfo_updates) mudinfo_updates = ([]); + if(!mudinfo_update_counter) mudinfo_update_counter = 1; + if(!listening) listening = ([]); + if(!channels) channels = ([]); + if(!channel_updates) channel_updates = ([]); + if(!channel_update_counter) channel_update_counter = 1; + if(!router_name) router_name = "*crossing"; + router_list = ({ ({"*crossing", "192.168.0.5 9000"}) }); + log_file("server", "Created when uptime = " + uptime() + "\n"); + trr("server got created"); + log_file("i3router",timestamp()+" router object created."); + call_out("setup", 5); + call_out("LocalHostedChans", 15); + set_heart_beat(10); + } + + void heart_beat(){ + trr("BING!","white"); + this_object()->clear_discs(); + } + + + static void setup(){ + trr("setup got called"); + if( file_size( SAVE_ROUTER __SAVE_EXTENSION__ ) > 0 ) + unguarded( (: restore_object, SAVE_ROUTER, 1 :) ); + if ((router_socket = socket_create(MUD, "read_callback", "close_callback")) < 0){ + log_file("server", "setup: Failed to create socket.\n"); + trr("setup: Failed to create socket.\n"); + return; + } + if (socket_bind(router_socket, MYSERVER) < 0) { + socket_close(router_socket); + log_file("server", "setup: Failed to bind socket to port.\n"); + trr("setup: Failed to bind socket to port.\n"); + return; + } + if (socket_listen(router_socket, "listen_callback") < 0) { + socket_close(router_socket); + log_file("server", "setup: Failed to listen to socket.\n"); + trr("setup: Failed to listen to socket.\n"); + } + trr("setup ended"); + } + + void remove(){ + string mudname; + log_file("server", "Being removed by: "+identify(previous_object())+"\n"); + trr("Being removed by: "+identify(previous_object())+"\n","red"); + log_file("server", "sockets:"+identify(sockets)+"\n"); + trr("sockets:"+identify(sockets)+"\n"); + log_file("server", "Starting to destruct at uptime = " + uptime() + "\n"); + trr("Starting to destruct at uptime = " + uptime() + "\n"); + mudinfo_update_counter++; // just increment once... all the connected muds + // getting simultaneously disconnected is okay to count as one change :) + foreach(mudname in keys(connected_muds)){ + mudinfo_updates[mudname]; + mudinfo[mudname]["disconnect_time"]=time(); + map_delete(connected_muds,mudname); // unneeded: connected_muds isn't saved anyway + } + log_file("server", "Successfully destructed when uptime = " + uptime() + "\n"); + trr("Successfully destructed when uptime = " + uptime() + "\n"); + destruct(this_object()); + } + int query_prevent_shadow(object ob){ return 1; } diff -c -r --new-file ds1.1/lib/secure/daemon/i3router/debug.h ds2.0r27/lib/secure/daemon/i3router/debug.h *** ds1.1/lib/secure/daemon/i3router/debug.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/daemon/i3router/debug.h Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,24 ---- + // This file written completely by Tim Johnson (Tim@TimMUD) + + varargs void Debug(string str, int level){ + if(find_player(DEBUGGER_GUY)) + switch(level){ + case DEB_IN: + message("trr", "%^BOLD%^%^WHITE%^SERVER INCOMING: %^MAGENTA%^"+str+"%^RESET%^\n", + find_player(DEBUGGER_GUY)); + break; + case DEB_OUT: + message("trr", "%^BOLD%^%^WHITE%^SERVER OUTGOING: %^CYAN%^"+str+"%^RESET%^\n", + find_player(DEBUGGER_GUY)); + break; + case DEB_INVALID: + message("trr", "%^BOLD%^%^WHITE%^SERVER THINKS THIS IS INVALID: %^RED%^"+str+"%^RESET%^\n", + find_player(DEBUGGER_GUY)); + break; + case DEB_OTHER: + default: + message("trr", "%^BOLD%^%^WHITE%^SERVER INFO: %^GREEN%^"+str+"%^RESET%^\n", + find_player(DEBUGGER_GUY)); + break; + } + } diff -c -r --new-file ds1.1/lib/secure/daemon/i3router/funcs.h ds2.0r27/lib/secure/daemon/i3router/funcs.h *** ds1.1/lib/secure/daemon/i3router/funcs.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/daemon/i3router/funcs.h Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,10 ---- + // This file written completely by Tim Johnson (Tim@TimMUD) + + static mapping muds_on_this_fd(int fd){ + return filter_mapping(connected_muds,"value_equals",this_object(),fd); + } + int value_equals(string a,int b, int c){ return b==c; } + static mapping muds_not_on_this_fd(int fd){ + return filter_mapping(connected_muds,"value_equals",this_object(),fd); + } + int value_not_equals(string a,int b, int c){ return b!=c; } diff -c -r --new-file ds1.1/lib/secure/daemon/i3router/hosted_channels.h ds2.0r27/lib/secure/daemon/i3router/hosted_channels.h *** ds1.1/lib/secure/daemon/i3router/hosted_channels.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/daemon/i3router/hosted_channels.h Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,27 ---- + int LocalHostedChans(){ + process_channel(1, ({ "channel-add", 5, + mud_name(), "cratylus", + "yatmim", 0, "dead_souls", 0 }) ); + + process_channel(1, ({ "channel-add", 5, + mud_name(), "cratylus", + "yatmim", 0, "dead_test4", 0 }) ); + + //process_channel(1, ({ "channel-add", 5, + //mud_name(), "cratylus", + //"yatmim", 0, "dead_test5", 0 }) ); + + process_channel(1, ({ "channel-add", 5, + mud_name(), "cratylus", + "yatmim", 0, "imud_gossip", 0 }) ); + + process_channel(1, ({ "channel-add", 5, + mud_name(), "cratylus", + "yatmim", 0, "imud_code", 0 }) ); + + process_channel(1, ({ "channel-add", 5, + "LPUni Outpost", "tacitus", + "yatmim", 0, "lpuni", 0 }) ); + + return 1; + } diff -c -r --new-file ds1.1/lib/secure/daemon/i3router/process_channel.h ds2.0r27/lib/secure/daemon/i3router/process_channel.h *** ds1.1/lib/secure/daemon/i3router/process_channel.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/daemon/i3router/process_channel.h Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,240 ---- + // This file written completely by Tim Johnson (Tim@TimMUD) + #include <save.h> + + static void process_channel(int fd, mixed *info){ + string mudname; + trr("extra stuff is ["+info[0][8..]+"]"); + switch(info[0][8..]){ // what is after the "channel-" + case "m": // message + case "e": // emote + case "t": // targetted emote + trr("they want to do a message..."); + // (drop-through from m/e is intentional) + // Probably should check if the target is 0@0 like it should be, + // and give a warning if it's not... I don't carethough, I'll just + // ignore the target and save some CPU. + // Check if string parts are strings... + if(info[0][8..]=="t"){ + if(sizeof(info)!=13 || !stringp(info[9]) || !stringp(info[10]) || + !stringp(info[11]) || !stringp(info[12])){ + send_error(info[2],info[3],"bad-pkt","Bad packet format.",info); + return; + } + } + else{ // m, e + if(sizeof(info)!=9){ + send_error(info[2],info[3],"bad-pkt","Bad packet format.",info); + return; + } + } + if(info[4]!=0 || info[5]!=0 || !stringp(info[6]) || + !stringp(info[7]) || !stringp(info[8])){ + send_error(info[2],info[3],"bad-pkt","Bad packet format.",info); + return; + } + if(!channels[info[6]]){ // error, channel is not registered! + send_error(info[2],info[3],"unk-channel", + "Unknown channel: "+info[6],info); + return; + } + if(member_array(info[2],listening[info[6]])==-1){ + // if mud is not listening, then make them listen + // and let them know they weren't listening. + send_error(info[2],info[3],"warning", + // No applicable message codes... change + // "warning" to something else if you want. + "Your mud wasn't listening to "+info[6]+ + ", so I'll start you listening right now.",info); + // Could do all the listen stuff, or could just + // pretend they requested it... I'm gonna pretend... + process_channel(fd,({ "channel-listen", 5, info[2], 0, + router_name, 0, info[6], 1 })); + return; + } + if(channels[info[6]][0]==2){ // filtered channel + if(channels[info[6]][1]!=info[2]){ // not from chan owner + // if from anybody else other than the owner, + // check if the owner is online, then either give + // an error, or forward to the owner... + if(!connected_muds[channels[info[6]][1]]){ + send_error(info[2],info[3],"unk-dst", + channels[info[6]][1]+" is not online to filter "+info[6], + info); + return; + } + if(info[4]!=0 || info[5]!=0 || !stringp(info[6]) || + !stringp(info[7]) || !stringp(info[8])){ + send_error(info[2],info[3],"bad-pkt","Bad packet format",info); + return; + } + write_data(connected_muds[channels[info[6]][1]],({ + "chan-filter-req", + 5, + router_name, + 0, + channels[info[6]][1], // mud name of chan owner + 0, + info[6], + info + })); + return; + } + // IS from chan owner, just broadcast it... + // drop through and broadcast like the other types do... + } + trr("CHAN: I think it's a good message at this point..."); + // at this point, they're wanting to do a message on a + // selective banned/allowed channel, or else are the owner + // of a filtered channel and they have not been + // blocked, so I will just do it... + foreach(mudname in keys(connected_muds)){ + if(member_array(mudname, listening[info[6]])!=-1) + write_data(connected_muds[mudname],info); + } + //broadcast_data(muds_not_on_this_fd(fd), info); + // send to all the other fd's that have a mud listening + // write_data(fd,info); + // also send the message to the connection that this mud is on + // from too... why do this? 'cause I'm allowing multiple muds to + // log on from the same connection :) + // I think the normal I3 server does this too, but I don't know + // since I can't test at the moment. + return; + case "add": + // check if already exists... + // check if a valid channel name (illegal characters?) + // check if other stuff is valid, like channel_type is 0,1,2 + // at this point, is being successfully added... + channel_update_counter++; + channels[info[6]]=({ info[7], info[2], ({}) }); + channel_updates[info[6]] = channel_update_counter; + trr(info[3]+"@"+info[2]+" created the channel: "+info[6],"yellow"); + // broadcast an update saying that this channel is added or changed now + // chanlist-reply packet to everybody (who has a channel service?) + broadcast_chanlist(info[6]); + // broadcast_data(muds_not_on_this_fd(fd), ({ + // "chanlist-reply",5,router_name,0, + // 0, // should be mudname, I think 0 would work just as well? + // 0, channel_update_counter, + // ([ info[6]:({ info[2], info[7] }) ]) + // })); + // write_data(fd,({ + // "chanlist-reply",5,router_name,0, + // 0, // should be mudname, I think 0 would work just as well? + // 0, channel_update_counter, + // ([ info[6]:({ info[2], info[7] }) ]) + // })); + save_object(SAVE_ROUTER); + return; + case "remove": + if(!channels[info[6]]){ // error, channel is not registered! + send_error(info[2],info[3],"unk-channel", + "Unknown channel: "+info[6],info); + return; + } + if(channels[info[6]][1]!=info[2]){ // error, not owner! + send_error(info[2],info[3],"not-allowed","Channel "+ + info[6]+" owned by: "+channels[info[6]][1],info); + return; + } + // at this point, is being removed by the owner... + channel_update_counter++; + map_delete(channels,info[6]); + channel_updates[info[6]] = channel_update_counter; + trr(info[3]+"@"+info[2]+" deleted the channel: "+info[6],"yellow"); + // broadcast an update saying that this channel is gone now + save_object(SAVE_ROUTER); + return; + case "admin": + // add/delete muds from the 2 lists... + if(!listening[info[6]]) listening[info[6]] = ({}); + if(info[7]){ // add to list... + channels[info[6]][2] += info[7]; + // if add to ban list, unlisten... + if(channels[info[6]][0]==0) // type 0 means selective ban + listening[info[6]] -= info[7]; + } + if(info[8]){ // remove from list... + channels[info[6]][2] += info[8]; + if(channels[info[6]][0]!=0) // type 0 means selective ban... + // selective allow and filtered are the same though... + // so if not selective ban, then act like selective allow... + // if removed from allow list, unlisten... + listening[info[6]] -= info[8]; + } + save_object(SAVE_ROUTER); + return; + case "listen": // mudname=info[2], channame=info[6], on_or_off=info[7] + if(!channels[info[6]]){ // error, channel is not registered! + send_error(info[2],info[3],"unk-channel", + "Unknown channel: "+info[6],info); + return; + } + if(!listening) listening=([ ]); + if(!listening[info[6]]) listening[info[6]]=({ }); // first MUD to listen + if(info[7]){ // on_or_off is on + if(member_array(info[2],listening[info[6]])!=-1) + return; // already listening, ignore them + } + else{ // on_or_off is on + if(member_array(info[2],listening[info[6]])==-1) + return; // already NOT listening, ignore them + } + trr("listening change on chan:"+info[6]+", mud="+info[2]+", on_or_off="+info[7]); + // only CHANGES should get to this point + switch(channels[info[6]][0]){ + case 0: // selectively banned + if(member_array(info[2],channels[info[6]][2])!=-1){ + // in list, you're banned... + send_error(info[2],0,"not-allowed", + "Banned from "+info[6],info); + save_object(SAVE_ROUTER); + return; + } + // not in ban list at this point + if(info[7]) + listening[info[6]] += ({ info[2] }); + else + listening[info[6]] -= ({ info[2] }); + save_object(SAVE_ROUTER); + return; + case 1: // selectively allowed + if(member_array(info[2],channels[info[6]][2])==-1 && + info[2] != channels[info[6]][1]){ + // NOT in list, you're banned! + send_error(info[2],0,"not-allowed", + "Not in allow list for "+info[6],info); + return; + } + // in allow list at this point + if(info[7]) + listening[info[6]] += ({ info[2] }); + else + listening[info[6]] -= ({ info[2] }); + save_object(SAVE_ROUTER); + return; + case 2: // filtered... act like selectively allowed + if(member_array(info[2],channels[info[6]][2])==-1 && + info[2] != channels[info[6]][1]){ + // NOT in list, you're banned! + send_error(info[2],0,"not-allowed", + "Not in allow list for "+info[6], + info); + return; + } + // in allow list at this point + if(info[7]) + listening[info[6]] += ({ info[2] }); + else + listening[info[6]] -= ({ info[2] }); + save_object(SAVE_ROUTER); + return; + } // switch + default: // trying to do "channel-blah" + send_error(info[2],info[3],"unk-type","I don't know what "+info[0]+ + " means.",info); + trr("Don't know what the ["+info[0]+"] packet means.", "yellow"); + return; + } + trr("can't get here?"); + } diff -c -r --new-file ds1.1/lib/secure/daemon/i3router/process_startup_req.h ds2.0r27/lib/secure/daemon/i3router/process_startup_req.h *** ds1.1/lib/secure/daemon/i3router/process_startup_req.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/daemon/i3router/process_startup_req.h Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,221 ---- + // This file written completely by Tim Johnson (Tim@TimMUD) + + string *banned_muds = ({}); + + static void process_startup_req(int protocol, mixed info, int fd){ + // Handles startup stuff. + // Loads info into newinfo mapping. + // Error if mud is already connected. + mapping newinfo; + string site_ip, junk; + // router name is info[4], I'll just pretend I'm every router though, ha-ha! + // also, should verify that all the fields are the right type + + trr("info: "+identify(info)); + trr("process_startup_req: protocol="+protocol+", mud="+info[2],"blue"); + + if(member_array(info[2], banned_muds) != -1) return; + + if(sizeof(info)<18){ + // smallest protocol is protocol 1/2 which have size 18 + trr("THIS SHOULDNT BE HERE"); + write_data(fd,({ + "error", + 5, + router_name, + 0, + info[2], + 0, + "bad-pkt", + "Bad startup_req packet", + info + })); + return; + } + trr("fd is:" +fd); + + site_ip=socket_address(fd); + trr("site_ip: "+site_ip); + newinfo = ([ + "name":info[2], + "ip":site_ip, + "connect_time":time(), + "disconnect_time":0, + "password":info[6], + "old_mudlist_id":info[7], + "old_chanlist_id":info[8], + "player_port":info[9], + "imud_tcp_port":info[10], + "imud_udp_port":info[11], + "mudlib":info[12], + "base_mudlib":info[13], + "driver":info[14], + "mud_type":info[15], + "open_status":info[16], + "protocol":protocol, + "restart_delay":-1, + ]); + trr("newinfo: "+identify(newinfo)); + switch(protocol){ + case 1: + case 2: + if(sizeof(info)!=18){ + trr("error"); + write_data(fd,({ + "error", + 5, + router_name, + 0, + info[2], + 0, + "bad-pkt", + "Bad startup_req packet", + info + })); + return; + } + newinfo["services"]=info[17]; + newinfo["admin_email"]="Unknown"; // only in protocol 3 + newinfo["other_data"]=0; // only in protocol 3 + break; + case 3: + if(sizeof(info)!=20){ + trr("error"); + + write_data(fd,({ + "error", + 5, + router_name, + 0, + info[2], + 0, + "bad-pkt", + "Bad startup_req packet", + info + })); + return; + } + newinfo["admin_email"]=info[17]; + newinfo["services"]=info[18]; + newinfo["other_data"]=info[19]; + break; + default: + trr("error"); + + write_data(fd,({ + "error", + 5, + router_name, + 0, + info[2], // mud name + 0, + "not-imp", + "unknown protocol: "+protocol, + info + })); + return; + } + // Check valid values... + if( + !stringp(newinfo["open_status"]) || + !stringp(newinfo["admin_email"]) || + !stringp(newinfo["mud_type"]) || + !stringp(newinfo["driver"]) || + !stringp(newinfo["base_mudlib"]) || + !stringp(newinfo["mudlib"]) || + !mapp(newinfo["services"]) || + !intp(newinfo["imud_udp_port"]) || + !intp(newinfo["imud_tcp_port"]) || + !intp(newinfo["player_port"]) || + !intp(newinfo["password"]) || + !intp(newinfo["old_chanlist_id"]) || + !intp(newinfo["old_mudlist_id"]) || + (!mapp(newinfo["other_data"]) && newinfo["other_data"]!=0) + ){ + write_data(fd,({ + "error", + 5, + router_name, + 0, + info[2], + 0, + "bad-pkt", + "Bad startup_req packet", + info + })); + return; + } + if(connected_muds[info[2]]){ + // if MUD is already connected + trr("mud already connected"); + write_data(fd,({ + "error", + 5, + router_name, + 0, + info[2], // mud name + 0, + "bad-proto", // doesn't seem to me like it should be bad-proto... + // see what the official one uses for this + // it might just boot the earlier MUD off? + "MUD already connected", // Error message + info + })); + return; + } + if(mudinfo[info[2]] && sizeof(mudinfo[info[2]]) && mudinfo[info[2]]["password"] != newinfo["password"]){ + // if MUD is already known, not connected, and wrong password + if(newinfo["ip"]==mudinfo[info[2]]["ip"]){ + // same IP as last time... let's just trust 'em... + trr("Wrong password, but right IP","green"); + write_data(fd,({ + "error",5,router_name,0,info[2],0, + "warning", // nothing in error summary that seems applicable? + // Change later if I find a better error code + "wrong password, but I'll allow you since it's the same IP as last time",0 + })); + } + else{ + trr("wrong password, and from a new IP","red"); + write_data(fd,({ + "error", + 5, + router_name, + 0, + info[2], // mud name + 0, + "not-allowed", // Change later! + "wrong password, and from a new IP", // Error message + info + })); + return; + } + } + //trr("Right IP.","green"); + if(!mudinfo[info[2]] || !newinfo["password"] || mudinfo[info[2]]["password"] != newinfo["password"] ){ + // if new MUD, assign it a password + newinfo["password"]=random(9999)+1; + trr("Assigning password "+newinfo["password"],"white"); + // Change this maybe... see if the password is supposed to be in a certain range + } + else trr("Right password. Known: "+mudinfo[info[2]]["password"]+", current: "+newinfo["password"],"green"); + // MUD should be okay at this point. + trr("about to update the mudinfo..."); + mudinfo[info[2]]=newinfo; // update the mudinfo + connected_muds[info[2]] = fd; // add this MUD to list of connected muds + trr("about to send the startup reply..."); + send_startup_reply(info[2]); // reply to MUD + mudinfo_update_counter++; + mudinfo_updates[info[2]]=mudinfo_update_counter; + send_mudlist_updates(info[2], newinfo["old_mudlist_id"]); + broadcast_mudlist(info[2]); + if(member_array("channel", keys(newinfo["services"])) != -1) + send_chanlist_reply(info[2], ( newinfo["old_chanlist_id"]) ? newinfo["old_chanlist_id"] : (random(1138) * 1138) ); + else { + trr("-------------------------------","blue"); + trr("It looks like "+info[2]+" doesn't have a channel service?!?","blue"); + trr("These are the services reported: "+identify(newinfo["services"]),"blue"); + trr("This is what newinfo looks like: "+identify(newinfo),"blue"); + trr("-------------------------------","blue"); + } + } diff -c -r --new-file ds1.1/lib/secure/daemon/i3router/read_callback.h ds2.0r27/lib/secure/daemon/i3router/read_callback.h *** ds1.1/lib/secure/daemon/i3router/read_callback.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/daemon/i3router/read_callback.h Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,160 ---- + // This file written completely by Tim Johnson (Tim@TimMUD) + + static void read_callback(int fd, mixed info){ + // This is called when messages come in from a MUD. + // Should reject all messages if they have not done a (successful) startup-req, + // Should check to make sure the fd matches with the mud they are claiming to be, else error. + // because all packets require an originator_mudname. + + // If target is the name of the router, then call the function in this object. + // if target is 0, then broadcast to muds. + // Do an error if target mudname is not known. + // + + // According to: http://www.intermud.org/i3/specs/formats.php3 + // Transmissions are LPC arrays with a predefined set of six initial elements: + // ({ type, ttl, originator mudname, originator username, target mudname, target username, ... }). + // info[0]=type + // info[1]=ttl + // info[2]=originator mudname + // info[3]=originator username + // info[4]=target mudname + // info[5]=target username + + string mudname; + int i; + trr("Received from fd("+fd+"), fd("+socket_address(fd)+")\n"+identify(info),((info[0] == "auth-mud-req" || info[0] == "auth-mud-reply") ? "magenta" : "green")); + // Base info in a packet is of size 6. + if(sizeof(info)<6 || + !stringp(info[0]) || + !intp(info[1]) || !stringp(info[2]) || + (!stringp(info[3]) && info[3]!=0) || + (!stringp(info[4]) && info[4]!=0) || + (!stringp(info[5]) && info[5]!=0) ) { + write_data(fd,({ + // okay, their initial data isn't fully there... + // careful about array out of bounds... + "error",5,router_name,0, + (sizeof(info)>=3 ? info[2] : 0), // mud name + (sizeof(info)>=4 ? info[3] : 0), // user name + "bad-pkt","Invalid initial data",info + })); + return; + } + if(info[4]!=0 && !connected_muds[info[4]] && info[4]!=router_name){ + // if target mud is not 0 (broadcasting), not the router name, + // and not a connected MUD + write_data(fd,({ + "error", + 5, + router_name, + 0, + info[2], + info[3], + "unk-dst", // same as I3 + "destination unknown", // same as I3 + info + })); + trr("Error [unk-dst], because target is "+info[4]+" and thus invalid."); + return; + } + if(sscanf(info[0],"startup-req-%d",i)==1){ + // special condition for startup-req... + trr("calling process_startup_req, i="+i+", fd="+fd+" which is: "+socket_address(fd)); + //call_other(this_object(),"process_startup_req",i,info,fd); + this_object()->process_startup_req(i,info,fd); + return; + } + if(!connected_muds[info[2]] || (connected_muds[info[2]]!=fd)){ + // MUD hasn't done a startup-req yet + write_data(fd,({ + "error", + 5, + router_name, + 0, // originator username + info[2], // mud name + info[3], // user name + "unk-src", // error code + "Your MUD hasn't registered as "+info[2]+" yet", // Error message + info + })); + trr("They have not done a startup-req for fd="+fd+", mudname="+info[2]); + return; + } + // at this point, I guess it has a valid origin and stuff + if(sscanf(info[0],"channel-%*s")==1){ // command has a "channel-" prefix + // special case for channel stuff + trr("calling process_channel..."); + process_channel(fd,info); + return; + } + if(info[0]=="chan-filter-reply"){ + if(!stringp(info[6]) || sizeof(info[7])<9 ){ + // avoid out-of-bounds + send_error(info[2],info[3],"bad-pkt", + "Invalid chan-filter-reply packet.",info); + } + if(channels[info[6]][1]!=info[2]){ + send_error(info[2],info[3],"not-allowed", + "You are not the owner of "+info[6],info); + return; + } + if(member_array(info[7][6],({ "channel-a", "channel-e", "channel-t"}))==-11){ + // Not a valid channel packet. + send_error(info[2],info[3],"not-allowed","*giggles*",info); + } + if(info[6]!=info[7][6]){ + // They're trying to trick me into broadcasting + // fake messages on another channel! + // That's pretty funny :P + // I'll have to remember to check if the official router falls for it. + send_error(info[2],info[3],"not-allowed","Hehe!",info); + return; + } + if(member_array(info[7][6],({ "channel-a", "channel-e", "channel-t"}))){ + + } + // Broadcast the message... + foreach(mudname in keys(connected_muds)){ + if(member_array(mudname, listening[info[6]])!=-1) + write_data(connected_muds[mudname],info[7]); + } + return; + } + + if(info[4]==0){ // if broadcasting this... + broadcast_data(connected_muds,info); + return; + } + if(info[4]==router_name) { + // Something meant for the router but not handled by now! + send_error(info[2],info[3],"not-imp","Unknown command sent to router: "+info[0],info); + trr("unhandled packet meant for router: "+info[0],"red"); + log_file("server","UNHANDLED PACKET:\n"+identify(info)+"\n"); + return; + } + // at this point, I guess you should forward it to the destination... + if(info[0]=="locate-reply"){ + // Special case for locate-reply, because protocol 3 has a larger packet... + if(sizeof(info)==8 && mudinfo[info[4]]["protocol"]>2){ + // originator mud is sending a protocol 1/2 response, + // but target understands 3, so add the extra info + write_data(connected_muds[info[4]], ({ + info[0],info[1],info[2],info[3],info[4],info[5], + info[6],info[7],0,0 + })); + return; + } + if(sizeof(info)==10 && mudinfo[info[4]]["protocol"]<=2){ + // target mud is being sent a protocol 3 response, + // but only understands 1 & 2, so strip the extra info + write_data(connected_muds[info[4]], ({ + info[0],info[1],info[2],info[3],info[4],info[5], + info[6],info[7] + })); + return; + } + } + write_data(connected_muds[info[4]], info); + return; + } diff -c -r --new-file ds1.1/lib/secure/daemon/i3router/readme.txt ds2.0r27/lib/secure/daemon/i3router/readme.txt *** ds1.1/lib/secure/daemon/i3router/readme.txt Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/daemon/i3router/readme.txt Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,23 ---- + // This I3 router code was written completely by Tim Johnson (Tim@TimMUD, + // Tim@The Eternal Fantasy) + // To use it, #include the server.h file or else just rename it to server.c + // + // If you use it yourself, I'd like you to mention in whatever appropriate + // (if your I3 network or your primary MUD has a web site or board for example) + // place that I wrote all this and you're welcome to list what you may have + // changed on it after downloading mine. I'd actually prefer there to be a + // list somewhere simply because I'm curious what kinds of ideas people add. + // If it's something good, other people would probably be curious about it as + // well. + // + // I haven't done any router-to-router communications, so don't expect this to + // hook you up to the main network. This will only be useful for private I3 + // networks. + // Also, this is LPC code and needs to be on a MUD for it to run. It works + // good on a stock TMI-2 MUD, one day I'll make a stripped-down mudlib solely + // for running my router on (without code for players to log in and such). + // Until then, just download TMI-2 and put these files on your MUD and it + // should work. + // + // -Tim (Last edited February 16, 2004) + diff -c -r --new-file ds1.1/lib/secure/daemon/i3router/remove_mud.h ds2.0r27/lib/secure/daemon/i3router/remove_mud.h *** ds1.1/lib/secure/daemon/i3router/remove_mud.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/daemon/i3router/remove_mud.h Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,13 ---- + // This file written completely by Tim Johnson (Tim@TimMUD) + + static void remove_mud(string mudname){ + if(connected_muds[mudname]){ + trr("Cannot remove mud ["+mudname+"] because it is still online right now.\n"); + return; + } + if(!mudinfo[mudname]){ + trr("Cannot remove mud ["+mudname+"] because it is not in the mudinfo list.\n"); + return; + } + map_delete(mudinfo, mudname); + } diff -c -r --new-file ds1.1/lib/secure/daemon/i3router/send_chanlist_reply.h ds2.0r27/lib/secure/daemon/i3router/send_chanlist_reply.h *** ds1.1/lib/secure/daemon/i3router/send_chanlist_reply.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/daemon/i3router/send_chanlist_reply.h Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,36 ---- + // This file written completely by Tim Johnson (Tim@TimMUD) + + static void send_chanlist_reply(string mudname, int old_chanid){ + string channame; // channel name + // string *output; // array of which channel names to tell them about + mapping out=([ ]); // mapping to send + int i; // counter + trr("send_chanlist_reply, mudname="+mudname+", old_chanid="+old_chanid); + foreach(channame in keys(channel_updates)){ + //#ifndef SEND_WHOLE_CHANLIST + // if(channel_updates[channame]>old_chanid){ // needs updating + //#endif + if(!channels[channame]){ // add to output; + out[channame] = 0; + } + else{ + out[channame] = ({ channels[channame][1], + channels[channame][0] }); // host, type + } + //#ifndef SEND_WHOLE_CHANLIST + // } + //#endif + } + trr("Chanlist: "+identify(out),"blue"); + write_data(connected_muds[mudname],({ + "chanlist-reply", + 5, + router_name, + 0, + mudname, + 0, + channel_update_counter, + out, + })); + mudinfo[mudname]["old_chanlist_id"]=channel_update_counter; + } diff -c -r --new-file ds1.1/lib/secure/daemon/i3router/send_error.h ds2.0r27/lib/secure/daemon/i3router/send_error.h *** ds1.1/lib/secure/daemon/i3router/send_error.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/daemon/i3router/send_error.h Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,21 ---- + // This file written completely by Tim Johnson (Tim@TimMUD) + + static void send_error(string mud, string user, string errcode, string errmsg, mixed *info){ + if(!connected_muds[mud]){ + trr("Can't send error to "+mud+" because they're not connected."); + return; + } + write_data(connected_muds[mud],({ + "error", + 5, + router_name, + 0, + mud, // mud name + user, // user name + 0, + errcode, + errmsg, + info + })); + return; + } diff -c -r --new-file ds1.1/lib/secure/daemon/i3router/send_mudlist_updates.h ds2.0r27/lib/secure/daemon/i3router/send_mudlist_updates.h *** ds1.1/lib/secure/daemon/i3router/send_mudlist_updates.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/daemon/i3router/send_mudlist_updates.h Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,113 ---- + // This file written completely by Tim Johnson (Tim@TimMUD) + + static void send_mudlist_updates(string updating_mudname, int old_mudlist_id){ + string mudname; // mud name + string *kys; // array of strings for keys that need to be sent + mapping out=([ ]); // mapping to send + int i; // counter + trr("old_mudlist_id: "+old_mudlist_id,"blue"); + trr("updating_mudname: "+updating_mudname,"blue"); + trr("send_mudlist_updates, updating_mudname="+updating_mudname+", old_mudlist_id="+old_mudlist_id,"blue"); + foreach(mudname in keys(mudinfo_updates)){ + #ifndef SEND_WHOLE_MUDLIST + if(mudinfo_updates[mudname]>old_mudlist_id){ // needs updating + #endif + if(!mudinfo[mudname]){ // deleted mud; + out[mudname] = 0; + } + else{ + switch(mudinfo[updating_mudname]["protocol"]){ + case 1: + case 2: + out[mudname] = ({ + connected_muds[mudname] ? -1 : 0, + // -1=up, 0=down, n=down for n secs + mudinfo[mudname]["ip"], // ip_addr + mudinfo[mudname]["player_port"], // player_port + mudinfo[mudname]["imud_tcp_port"], // imud_tcp_port + mudinfo[mudname]["imud_udp_port"], // imud_udp_port + mudinfo[mudname]["mudlib"], // mudlib + mudinfo[mudname]["base_mudlib"], // base_mudlib + mudinfo[mudname]["driver"], // driver + mudinfo[mudname]["mud_type"], // mud_type + mudinfo[mudname]["open_status"], // open_status + mudinfo[mudname]["services"], // services + }); + break; + case 3: + out[mudname] = ({ + (connected_muds[mudname] ? -1 : 0), + // -1=up, 0=down, n=down for n secs + mudinfo[mudname]["ip"], // ip_addr + mudinfo[mudname]["player_port"], // player_port + mudinfo[mudname]["imud_tcp_port"], // imud_tcp_port + mudinfo[mudname]["imud_udp_port"], // imud_udp_port + mudinfo[mudname]["mudlib"], // mudlib + mudinfo[mudname]["base_mudlib"], // base_mudlib + mudinfo[mudname]["driver"], // driver + mudinfo[mudname]["mud_type"], // mud_type + mudinfo[mudname]["open_status"], // open_status + mudinfo[mudname]["admin_email"], // admin_email + mudinfo[mudname]["services"], // services + mudinfo[mudname]["other_data"], // other_data + }); + break; + } // switch + } // else not deleted + #ifndef SEND_WHOLE_MUDLIST + } // if needs updating + #endif + } // foreach + // out now has the mapping of what to tell the mud about... + // this might be big, so later I'll make it so it sends only 10 muds at a time... + // take an idea from /cmds/std/_semote.c + kys=keys(out); + for(i=0;i<sizeof(kys)-10;i+=10){ // leave a group of size between 1 and 10 remaining + trr("sending a set of 10..."); + // send all the ones except the last one, doing 10 at a time, + // but give them their original mudlist id, in case they get + // disconnected before all the sets of 10 get finished + write_data(connected_muds[updating_mudname],({ + "mudlist", + 5, + router_name, + 0, + updating_mudname, + 0, + old_mudlist_id, + ([ kys[i]: out[kys[i]], + kys[i+1]: out[kys[i+1]], + kys[i+2]: out[kys[i+2]], + kys[i+3]: out[kys[i+3]], + kys[i+4]: out[kys[i+4]], + kys[i+5]: out[kys[i+5]], + kys[i+6]: out[kys[i+6]], + kys[i+7]: out[kys[i+7]], + kys[i+8]: out[kys[i+8]], + kys[i+9]: out[kys[i+9]], + ]), + })); + map_delete(out,kys[i]); + map_delete(out,kys[i+1]); + map_delete(out,kys[i+2]); + map_delete(out,kys[i+3]); + map_delete(out,kys[i+4]); + map_delete(out,kys[i+5]); + map_delete(out,kys[i+6]); + map_delete(out,kys[i+7]); + map_delete(out,kys[i+8]); + map_delete(out,kys[i+9]); + } + // incomplete set is left where it kicked out of the for loop + write_data(connected_muds[updating_mudname],({ + "mudlist", + 5, + router_name, + 0, + updating_mudname, + 0, + mudinfo_update_counter, + out, + })); + mudinfo[updating_mudname]["old_mudlist_id"]=mudinfo_update_counter; + } diff -c -r --new-file ds1.1/lib/secure/daemon/i3router/send_startup_reply.h ds2.0r27/lib/secure/daemon/i3router/send_startup_reply.h *** ds1.1/lib/secure/daemon/i3router/send_startup_reply.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/daemon/i3router/send_startup_reply.h Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,19 ---- + // This file written completely by Tim Johnson (Tim@TimMUD) + + static void send_startup_reply(string mudname){ + // This packet will be delivered to a mud for three conditions: + // in response to a startup-req packet, + // when the router wishes the mud to connect to a different router, + // or when the set of routers change for some reason. + if(!connected_muds[mudname]) return; // This shouldn't be needed. + write_data(connected_muds[mudname], ({ + "startup-reply", + 5, + router_name, + 0, + mudname, + 0, + router_list, + mudinfo[mudname]["password"] + }) ); + } diff -c -r --new-file ds1.1/lib/secure/daemon/i3router/server.c ds2.0r27/lib/secure/daemon/i3router/server.c *** ds1.1/lib/secure/daemon/i3router/server.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/daemon/i3router/server.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,155 ---- + // I3 server. + // This file written completely by Tim Johnson (Tim@TimMUD) + // Started by Tim on May 7, 2003. + // http://cie.imaginary.com/protocols/intermud3.html#errors + #include <lib.h> + #include <socket.h> + #include <socket_err.h> + #define DEB_IN 1 // trr-Incoming + #define DEB_OUT 2 // trr-Outgoing + #define DEB_INVALID 3 // trr-Invalid + #define DEB_OTHER 0 // trr-Other + #define MYSERVER 9000 // Port to accept connections on. + #define DEBUGGER_GUY "cratylus" // Name of who to display trrging info to. + #undef DEBUGGER_GUY + #define DEBUGGER_GUY "guest" + #define MAXIMUM_RETRIES 5 + // SEND_WHOLE_MUDLIST makes it act like the official I3 server instead of like the I3 specs + #define SEND_WHOLE_MUDLIST + // SEND_WHOLE_CHANLIST makes it act like the official I3 server instead of like the I3 specs + #define SEND_WHOLE_CHANLIST + inherit LIB_CLEAN; + + // Unsaved variables... + static private int router_socket; + // socket that the router is using + static private mapping sockets; + // physically connected sockets and their info + static private mapping connected_muds; + // muds that have successfully done a startup + // (key=mudname, value=fd) + //static private + mapping listening; + // list of muds listening to each channel + // (key=chan name, value=mud array) + + // Saved variables... + string router_name; // Name of the router. + string *router_list; // Ordered list of routers to use. + mapping mudinfo; // Info about all the muds which the router knows about. + mapping channels; // Info about all the channels the router handles. + mapping channel_updates; // Tells when a channel was last changed. + int channel_update_counter; // Counter for the most recent change. + // Why is this not a part of the channels mapping? + // Because I need to remember that some channels got deleted. + mapping mudinfo_updates; // Like channel_updates except for muds. + int mudinfo_update_counter; // Similar to channel_update_counter + + // Prototypes + void write_data(int fd, mixed data); + void close_connection(int fd); + static mapping muds_on_this_fd(int fd); + static mapping muds_not_on_this_fd(int fd); + static void broadcast_data(mapping targets, mixed data); + // Ones with their own files... + static void broadcast_chanlist(string channame); + static void broadcast_mudlist(string mudname); + static varargs void Debug(string str, int level); + static void process_channel(int fd, mixed *info); + static void process_startup_req(int protocol, mixed info, int fd); + static void read_callback(int fd, mixed info); + static void remove_mud(string mudname); + static void send_chanlist_reply(string mudname, int old_chanid); + static void send_mudlist(string mudname); + static void send_mudlist_updates(string updating_mudname, int old_mudlist_id); + static void send_startup_reply(string mudname); + static void send_error(string mud, string user, string errcode, string errmsg, mixed *info); + // core_stuff.h... + static void create(); + static void setup(); + void remove(); + // funcs.h... + static mapping muds_on_this_fd(int fd); + int value_equals(string a,int b, int c); + static mapping muds_not_on_this_fd(int fd); + int value_not_equals(string a,int b, int c); + // socket_stuff.h + static void close_callback(int fd); + static void listen_callback(int fd); + static void write_data_retry(int fd, mixed data, int counter); + static void close_connection(int fd); + static void write_data(int fd, mixed data); + static void broadcast_data(mapping targets, mixed data); + + // Code for all the stuff in the prototypes... + #include "./broadcast_chanlist.h" + #include "./broadcast_mudlist.h" + #include "./debug.h" + #include "./process_channel.h" + #include "./process_startup_req.h" + #include "./read_callback.h" + #include "./remove_mud.h" + #include "./send_chanlist_reply.h" + #include "./send_mudlist_updates.h" + #include "./send_startup_reply.h" + #include "./send_error.h" + + #include "./core_stuff.h" + #include "./funcs.h" + #include "./socket_stuff.h" + #include "./hosted_channels.h" + + // trrging stuff... + mapping query_mudinfo(){ return copy(mudinfo); } + mapping query_mud(string str){ return copy(mudinfo[str]); } + void get_info() { + write_file ("/tmp/info.txt", + "router_name: "+router_name+ + "\nrouter_list"+identify(router_list)+ + "\nchannel_update_counter: "+ channel_update_counter+ + "\nchannels:"+identify(channels)+ + "\nchannel_updates:"+identify(channel_updates)+ + "\nlistening:"+identify(listening)+ + "\nmudinfo:"+identify(mudinfo)+ + "\nmudinfo_update_counter: "+ mudinfo_update_counter+ + "\nmudinfo_updates:"+identify(mudinfo_updates)+ + "\nconnected:"+identify(connected_muds)+"\n"); + } + void clear(){ string mudname; foreach(mudname in keys(mudinfo)) remove_mud(mudname); + } + + mapping GetConnectedMuds(){ + return copy(connected_muds); + } + + string *AddBannedMud(string str){ + if( !((int)master()->valid_apply(({ "SECURE" }))) ) + error("Illegal attempt to access admintool: "+get_stack()+" "+identify(previous_object(-1))); + + banned_muds += ({ str }); + return banned_muds; + } + + string *RemoveBannedMud(string str){ + if( !((int)master()->valid_apply(({ "SECURE" }))) ) + error("Illegal attempt to access admintool: "+get_stack()+" "+identify(previous_object(-1))); + + banned_muds -= ({ str }); + return banned_muds; + } + + void clear_discs(){ + string mudname; + foreach(mudname in keys(mudinfo)) { + if(query_mud(mudname)["disconnect_time"] && + time() - query_mud(mudname)["disconnect_time"] > 60 && + time() - query_mud(mudname)["disconnect_time"] < 80){ + //trr("Removing mud: "+identify(mudname),"red"); + //remove_mud(mudname); + trr("Broadcasting updated mudlist.","white"); + broadcast_mudlist(mudname); + + } + } + } + diff -c -r --new-file ds1.1/lib/secure/daemon/i3router/socket_stuff.h ds2.0r27/lib/secure/daemon/i3router/socket_stuff.h *** ds1.1/lib/secure/daemon/i3router/socket_stuff.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/daemon/i3router/socket_stuff.h Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,77 ---- + // This file written in great part by Tim Johnson (Tim@TimMUD) + + static void close_callback(int fd){ + string mudname; + trr("close_callback: fd="+fd+"\n"); + foreach(mudname in keys(muds_on_this_fd(fd))){ + trr("Removing mud from connected_muds list: "+mudname); + mudinfo[mudname]["disconnect_time"] = time(); + map_delete(connected_muds, mudname); + broadcast_mudlist(mudname); + } + close_connection(fd); + } + + static void listen_callback(int fd){ + int fdstat; + if ((fdstat = socket_accept(fd, "read_callback", "write_callback")) < 0) { + return; + } + } + + void write_callback(int fd){ + if (sockets[fd]["write_status"] == EEALREADY) { + write_data(fd, sockets[fd]["pending"]); + map_delete(sockets[fd], "pending"); + } + else { + sockets[fd]["write_status"] = EESUCCESS; + } + } + + static void write_data_retry(int fd, mixed data, int counter){ + int rc; + if (counter == MAXIMUM_RETRIES) { + close_connection(fd); + return; + } + rc = socket_write(fd, data); + if(!sockets[fd]) sockets[fd]=([]); // Tim + sockets[fd]["write_status"] = rc; + switch (rc) { + case EESUCCESS: + break; + case EEALREADY: + sockets[fd]["pending"] = data; + break; + case EECALLBACK: + break; + case EESEND: + if (counter < MAXIMUM_RETRIES) { + trr("retry hit"); + call_out("retry_write", 2, ({fd, data, counter + 1})); + return; + } + default: + trr("write_data_retry: " + socket_error(rc)); + close_connection(fd); + break; + } + } + + static void close_connection(int fd){ + int sockerr; + map_delete(sockets, fd); + sockerr = socket_close(fd); + trr("closing sockerr:"+sockerr); + } + + static void write_data(int fd, mixed data){ + write_data_retry(fd, data, 0); + } + + static void broadcast_data(mapping targets, mixed data){ + foreach(int *arr in unique_array(values(targets), (: $1 :))){ + write_data(arr[0], data); + } + } diff -c -r --new-file ds1.1/lib/secure/daemon/imc2.c ds2.0r27/lib/secure/daemon/imc2.c *** ds1.1/lib/secure/daemon/imc2.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/daemon/imc2.c Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,1587 ---- + // Tim Johnson + // Started on May 1, 2004. + // Use this however you want. + // + // Dead Souls tweaks and fixes courtesy of Shadyman + // + + // Connection data... + #define HOSTNAME "server01.intermud.us" + #define HOSTPORT 5000 + // HostIP overrides HOSTNAME, in case the mud doesn't want to resolve addresses. + #define HOSTIP "70.85.248.74" + + // What name the network knows your mud as... + #define MUDNAME "YADSM" + + // Passwords... + #define CLIENT_PW "ClientPass" + #define SERVER_PW "ServPass" + + // File to save data to, .o will be added automatically to the end. + // This will have private stuff in it, don't put this in a directory where your wizards can read it. + #define SAVE_FILE SAVE_IMC2 + + // COMMAND_NAME is the command that people type to use this network. + #define COMMAND_NAME "imc2" + + // NETWORK_ID is what your mud calls this network. + // This is the prefix that comes up on all messages to identify the IMC2 network. + // Tells for example look like: + // NETWORK_ID- Tim@TimMUD tells you: hi + // Make it similar to the command name, so players will understand. + #define NETWORK_ID "IMC2" + + // DATA_LOG is where packets are logged to. + // Turn this off when not working on the system, as it invades privacy. + // Comment this out to turn it off. + #define DATA_LOG "imc2.data" + + // UNKNOWN_DATA_LOG is where unrecognized packets are logged to. + // I wrote handlers for all packets I know of, so this should only pick + // up tests and possibly if anyone is creating new packets. + #define UNKNOWN_DATA_LOG "IMC2_UNKNOWN" + + // Your MUD's URL is shared with other muds when building the mud list. + // This you could also put this in your who reply. + #define URL "http://qs.bounceme.net" + + // ANNOUNCE_LOG is where network announcements get logged to. + // I suggest you keep this turned on. + // These announcements seem to be about channels being created and + // deleted, but may possibly have more. + #define ANNOUNCE_LOG "IMC2_ANNOUNCEMENTS" + + // How many lines you want the backlog to be. + #define BACKLOG_SIZE 20 + + // Minimum permission number for channel to be viewable on the web. + #define BACKLOG_WEB_LEVEL 0 + + // If you use the web page with the mud list and channels and stuff, + // this'll be the URL for it, up to the point where the arguments + // are passed. + //#define HTML_LOCATION "http://www.darkwoodinc.com:3328/gateways/imc2?" + + + // WHO_STR is the code that you want a who request to display. + #define WHO_STR "/cmds/std/_who.c"->do_who()+URL+"\ntelnet://qs.bounceme.net 5500\n"+"______________________________________________________________________________" + + + #include <lib.h> + #include <save.h> + #include <network.h> + #include <socket_err.h> + #include <daemons.h> + + + #ifndef VERSION + #define VERSION "Tim's LPC IMC2 client - Jan 30, 2005" + #endif + + string tmpstr; + + // Mode decides what kind of packet is expected + #define NO_UIDS + #define MODE_CONNECTED 1 + #define MODE_WAITING_ACCEPT 2 + #define MODE_CONNECT_ERROR 3 // Not used yet, I need to see what the hub sends. + #define MODE_HUB_DOWN 4 // Not used yet either. + + + // What's the file for the channel daemon? + #ifndef CHANNEL_BOT + #define CHANNEL_BOT CHAT_D + #endif + //#ifndef CHANNEL_BOTS + //#define CHANNEL_BOTS ([ "local" : CHAT_D ]) + //#endif + #ifndef STREAM + #define STREAM 1 + #endif + #ifndef EESUCCESS + #define EESUCCESS 1 /* Call was successful */ + #endif + #ifndef THIS_PLAYER + #define THIS_PLAYER this_player() + #endif + #ifndef FIND_PLAYER + #define FIND_PLAYER(x) find_player(x) + #endif + #ifndef GET_CAP_NAME + #define GET_CAP_NAME(x) replace_string(x->GetName()," ","") + #endif + #ifndef GET_NAME + #define GET_NAME(x) convert_name(x->GetName()) + #endif + #ifndef IMC2_MSG + #define IMC2_MSG(x,y) foreach(tmpstr in explode(x,"\n")){ message("IMC2",tmpstr,y); } + #endif + #ifndef GET_GENDER + #define GET_GENDER(x) x->GetGender() + #endif + #ifndef ADMIN + #define ADMIN(x) archp(x) + #endif + + #define HTML_LOCATION "http://dead-souls.net/" + + // Other things that could be #define'd... + // INVIS(x) !visible(x) + // TELL_BOT "/u/t/timbot/imc2_invalidtells.c" + // TELL_BOTS ([ "timbot" : "/u/t/timbot/imc2_tellbot.c" ]) + // CHAN_BOT "/u/t/timbot/imc2_chans.c" + // CHAN_BOTS ([ "ichat" : "/u/t/timbot/imc2_ichat.c" ]) + // USER_EXISTS(x) user_exists(x) + + // Debugging + //#define DEB_IN 1 + //#define DEB_OUT 2 + //#define DEB_PAK 3 + //#define DEB_OTHER 0 + + int socket_num; + int mode; + mapping ping_requests; // Keeps track of who sent a ping request. + // Ping requests aren't labelled with names, so replies are destined to this MUD + // with no idea why, unless we keep track. + string buf=""; // Buffer for incoming packets (aren't always sent 1 at a time) + + // Variables + string hub_name, network_name; + string server_pass, server_version; + mapping chaninfo; + mapping localchaninfo; // (["chan": ([ "perm":1, "name":"something", "users":({ }) ]) ]) + mapping mudinfo; + mapping genders; + mapping tells; + int sequence; + + // Prototypes :) + void create(); + void remove(); + string pinkfish_to_imc2(string str); + string imc2_to_pinkfish(string str); + string escape(string str); + string unescape(string str); + mapping string_to_mapping(string str); + string main_help(); + + private void send_packet(string sender, string packet_type, string target, string destination, string data); + private void send_text(string text); + private void got_packet(string info); + private void start_logon(); + private varargs void send_is_alive(string origin); + private void channel_in(string fromname, string frommud, mapping data); + private void tell_in(string sender, string origin, string target, mapping data); + private void beep_in(string sender, string origin, string target, mapping data); + private void who_reply_in(string origin, string target, mapping data); + private void whois_in(string fromname, string frommud, string targ, mapping data); + private void whois_reply_in(string targ,string fromname,string frommud,mapping data); + private void ping_reply_in(string sender,string origin,string target,mapping data); + private void chanwho_reply_in(string origin, string target, mapping data); + private void send_keepalive_request(); + private int chan_perm_allowed(object user, string chan); + private string localize_channel(string str); + private void chan_who_in(string fromname, string frommud, mapping data); + private void send_ice_refresh(); + private void resolve_callback(string address, string resolved, int key); + + //private varargs void debug(mixed msg, int x){ + // Add stuff in here if you want to see messages. + //} + + // Functions for users to change. + int can_use(object user){ return 1; } // Is this person allowed to use IMC2 at all? This function determines if tells can be sent to the person and such. + int level(object ob){ + // Outgoing packets are marked with the user's level. + // This function figures it out. + // If you have different ways of ranking, make this function convert them to what IMC2 uses. + // IMC2 uses: Admin=5, Imp=4, Imm=3, Mort=2, or None=1 + if(ADMIN(ob)) return 5; // Admin + //TMI-2: if(wizardp(ob)) return 3; + //TMI-2: if(userp(ob)) return 2; + //Discworld: if(ob->query_creator()) return 3; + if(this_player()) return 2; + return 1; // None + } + + string chan_perm_desc(int i){ + // Given the permission level assigned locally to a channel, return a short + // string describing what the number means. The number means nothing + // outside of this MUD. Also, they are independant of each other, and + // so you can do groups without having to always do subgroups of higher + // ones or anything like 'levels'. BACKLOG_WEB_LEVEL is the only one of + // significance, as it's the only one that the web backlog thing works on. + switch(i){ + case 2: return "arch"; + case 1: return "creator"; + case 0: return "public"; + } + return "invalid"; + } + + int chan_perm_allowed(object user, string chan){ + // Using the permission level assigned locally to a channel, + // return 1 if user is allowed to use the channel, 0 if not. + switch(localchaninfo[chan]["perm"]){ + case 2: if(archp(user)) return 1; return 0; + case 1: if(creatorp(user)) return 1; return 0; + case 0: return 1; + } + } + + + // Shouldn't have to change anything beyond this point. + + void write_callback(int fd){ + #ifdef DATA_LOG + log_file(DATA_LOG,"Write_Callback on socket " + fd + "\n"); + #endif + start_logon(); + } + + + void read_callback(int socket, mixed info){ + string a,b; + int done=0; + + #ifdef DATA_LOG + log_file(DATA_LOG,"SERVER: "+info+"\n"); + #endif + + if(!sizeof(info)) return 0; + //debug(save_variable(info),DEB_IN); + buf += info; + + // The hub groups packets, unfortunately. + switch(mode){ + case MODE_WAITING_ACCEPT: // waiting for Hub to send autosetup + if(sscanf(info, "autosetup %s accept %s\n\r", + hub_name, network_name)==2){ + //debug("Connected, hub is "+hub_name+", network is "+network_name); + mode = MODE_CONNECTED; + send_is_alive("*"); + send_keepalive_request(); + send_ice_refresh(); + } else if(sscanf(info, "PW %s %s version=%d %s\n", + hub_name, server_pass, server_version, network_name)==4){ + mode = MODE_CONNECTED; + send_is_alive("*"); + send_keepalive_request(); + send_ice_refresh(); + } else{ // Failed login sends plaintext error message. + //debug("Failed to connect... "+info); + } + buf=""; // clear buffer + break; + case MODE_CONNECTED: + while(!done){ + if(sscanf(buf,"%s\n\r%s",a,b)==2){ // found a break... + got_packet(a); + buf=b; + } else { // no break... + done = 1; + } + } + break; + } + return; + } + + private void got_packet(string info){ + string str; + string a,b; + int i; + string sender, origin, route, packet_type, target, destination, strdata; + int sequence; + mapping data; + object who; + if(!sizeof(info)) return; + //debug(save_variable(info),DEB_PAK);; + #ifdef DATA_LOG + log_file(DATA_LOG,"GOT PACKET: "+info+"\n"); + #endif + + str = info; + // messages end with " \n\r" or "\n" or sometimes just a space + sscanf(str, "%s\n^", str); + sscanf(str, "%s\r^", str); + sscanf(str, "%s ^", str); + sscanf(str, "%s ^", str); + if(sscanf(str, "%s %d %s %s %s %s", + a, sequence, route, packet_type, + b, strdata)==6){ // matches + if(sscanf(b,"%s@%s",target,destination)!=2){ + // Could be MUD instead of Name@MUD or *@MUD + target="*"; destination=b; + } + if(sscanf(a,"%s@%s",sender,origin)!=2){ + sender="*"; origin=a; + } + data = string_to_mapping(strdata); + // debug("sender="+sender); + // debug("origin="+origin); + // debug("sequence="+sequence); + // debug("route="+route); + // debug("packet_type="+packet_type); + // debug("data="+save_variable(data)); + if(!mudinfo[origin]) mudinfo[origin] = ([ ]); + + switch(packet_type){ + case "is-alive": // For making a MUD list. + if(!mudinfo[origin]) mudinfo[origin] = ([ ]); + // example of info: + // versionid=\"IMC2 AntiFreeze CL-2 SWR 1.0\" url=none md5=1 + //mudinfo[origin]["version"]="blah"; + mudinfo[origin]+=data; + mudinfo[origin]["online"]=1; + //debug("handled is-alive for mud "+origin); + break; + case "close-notify": // Someone disconnected. + if(!mudinfo[data["host"]]) mudinfo[data["host"]] = ([]); + mudinfo[data["host"]]["online"]=0; + break; + case "keepalive-request": // Request for is-alive. + send_is_alive(origin); + break; + case "ice-msg-b": // Broadcast channel message. + channel_in(sender, origin, data); + break; + case "tell": // Tells or emotes. + tell_in(sender, origin, target, data); + break; + case "who-reply": + who_reply_in(origin,target,data); + break; + case "whois": // Like I3's locate + whois_in(sender,origin,target,data); + break; + case "whois-reply": + whois_reply_in(target,sender,origin,data); + break; + case "beep": + beep_in(sender, origin, target, data); + break; + case "ice-update": // Reply from ice-refresh. + chaninfo[data["channel"]]=data; + break; + case "wHo": // Drop-through + case "who": + send_packet("*","who-reply",sender,origin, + "text="+escape(pinkfish_to_imc2(WHO_STR))); + break; + case "ice-destroy": // Deleting channel. + map_delete(chaninfo,data["channel"]); + break; + case "user-cache": // User info, like I3's ucache service. + if(!genders[origin]) genders[origin]=([ ]); + genders[origin][sender]=data["gender"]; + break; + case "user-cache-reply": // Reply with user info + if(!genders[origin]) genders[origin]=([ ]); + genders[origin][data["user"]]=data["gender"]; + break; + case "user-cache-request": // Request for user info + sscanf(data["user"],"%s@%*s",str); + who = FIND_PLAYER(lower_case(str)); + if(who + #ifdef INVIS + && !INVIS(who) + #endif + ){ + switch(GET_GENDER(who)){ + case "male" : i=0; break; + case "female" : i=1; break; + default : i=2; break; + } + send_packet("*","user-cache-reply",sender, + origin,sprintf("gender=%d",i)); + } + break; + case "ping": + send_packet("*","ping-reply",sender,origin, + sprintf("path=\"%s\"",route)); + break; + case "ping-reply": + ping_reply_in(sender,origin,target,data); + break; + case "ice-msg-r": // Relayed channel message. + channel_in(sender, origin, data); + break; + case "ice-chan-whoreply": // Tell who's listening to a channel. + chanwho_reply_in(origin,target,data); + break; + case "emote": // Channel creation/destruction message... anything else? + IMC2_MSG(NETWORK_ID+" announces: "+data["text"]+"\n", + filter_array(users(), (: ADMIN($1) :))); + #ifdef ANNOUNCE_LOG + log_file(ANNOUNCE_LOG,ctime(time())+": "+data["text"]+"\n"); + #endif + break; + case "ice-chan-who": // Check who's listening to a channel. + chan_who_in(sender,origin,data); + break; + case "channel-notify": + // Don't care about this. Useful only if you care when + // people on other MUDs start/stop listening to a channel. + // example: Someone@SomeMUD 1087076772 SomeMUD channel-notify *@* channel=Hub01:ichat status=0 + break; + // The following packets shouldn't be incoming. + case "ice-cmd": // Remote channel administration + case "remote-admin": // For controlling the hub + case "ice-refresh": // Request data about channels + case "ice-msg-p": // Private channel message + //debug("This packet isn't supposed to be incoming: "+packet_type); + break; + default: + #ifdef UNKNOWN_DATA_LOG + log_file(UNKNOWN_DATA_LOG,"Unknown packet: "+escape(info)+"\n\n"); + #endif + //debug("Unlisted packet type: "+packet_type); + break; + } + } + else{ + buf += info; + //debug("Doesn't match incoming pattern, so putting on buffer: "+str); + #ifdef BAD_PACKET + log_file(BAD_PACKET,"Doesn't match incoming pattern: "+str+"\n"); + #endif + } + } + + private int close_callback(object socket){ + // Connection was closed. + #ifdef DATA_LOG + log_file(DATA_LOG,"DISCONNECTED\n"); + #endif + socket_close(socket_num); + // socket->remove(); + create(); + return 1; + } + + private void send_text(string text){ + // Send a literal string. + // Almost everything should use the send_packet function instead of this. + #ifdef DATA_LOG + log_file(DATA_LOG,"CLIENT: "+save_variable(text)+"\n"); + #endif + //debug(save_variable(text), DEB_OUT); + // debug("writing to socket: "+socket_num); + socket_write(socket_num,text); + // imc2_socket->send(text); + return; + } + + void create(){ + int temp; + + #ifndef NO_UIDS + seteuid(getuid()); + #endif + #ifdef DATA_LOG + log_file(DATA_LOG,"Creating IMC2 object at "+ctime(time())+".\n"); + #endif + if(sizeof(get_dir(SAVE_FILE+".o"))) restore_object(SAVE_FILE); + if(!mudinfo) mudinfo = ([ ]); + if(!chaninfo) chaninfo = ([ ]); + if(!localchaninfo) localchaninfo = ([ ]); + if(!genders) genders = ([ ]); + if(!tells) tells=([ ]); + ping_requests=([ ]); + mode = MODE_WAITING_ACCEPT; + #ifdef HOSTIP + // We already know the IP, go straight to the connecting, just do callback as if it found the IP. + //resolve_callback(HOSTIP,HOSTIP,1); + #else + temp = resolve(HOSTNAME, "resolve_callback"); + if(temp == 0){ + //debug("Addr_server is not running, resolve failed."); + #ifdef DATA_LOG + log_file(DATA_LOG,"Addr_server is not running, resolve failed.\n"); + #endif + remove(); + return; + } + #endif + } + + void remove(){ + // This object is getting destructed. + if(!socket_num) socket_close(socket_num); + // if(imc2_socket) imc2_socket->remove(); + #ifdef DATA_LOG + log_file(DATA_LOG,"IMC2 OBJECT REMOVED\n"); + #endif + save_object(SAVE_FILE); + destruct(this_object()); + } + + void resolve_callback( string address, string resolved, int key ) { + // Figured out what the IP is for the address. + int error; + //debug("Resolved to: "+resolved); + write_file("/tmp/imc2.log","address: "+address+"\n"); + write_file("/tmp/imc2.log","resolved: "+resolved+"\n"); + write_file("/tmp/imc2.log","key: "+key+"\n"); + + //socket_num = socket_create(STREAM, "close_callback"); + socket_num = socket_create(STREAM, "read_callback", "close_callback"); + if (socket_num < 0) { + #ifdef DATA_LOG + log_file(DATA_LOG,"socket_create: " + socket_error(socket_num) + "\n"); + #endif + //debug("socket_create: " + socket_error(socket_num) + "\n"); + return; + } + #ifdef DATA_LOG + log_file(DATA_LOG,"socket_create: Created Socket " + socket_num + "\n"); + #endif + + error = socket_connect(socket_num, resolved+" "+HOSTPORT, "read_callback", "write_callback"); + if (error != EESUCCESS) { + #ifdef DATA_LOG + log_file(DATA_LOG,"socket_connect: " + socket_error(error) + "\n"); + #endif + //debug("socket_connect, error="+error+": " + socket_error(error) + "\n"); + socket_close(socket_num); + return; + } + #ifdef DATA_LOG + log_file(DATA_LOG,"socket_connect: connected socket " + socket_num + " to " + resolved+" "+HOSTPORT + "\n"); + #endif + + //write_callback(socket_num); + } + + void start_logon(){ + //debug("Gonna try logging in, sending the PW thing..."); + #if NOT_AUTO + send_text(sprintf("PW %s %s version=%d\n", + #else + send_text(sprintf("PW %s %s version=%d autosetup %s\n", + #endif + MUDNAME, + CLIENT_PW, 2 + #ifndef NOT_AUTO + , SERVER_PW + #endif + )); + buf=""; + /* For invitation-only networks. + send_text(sprintf("PW %s %s version=%d %s\n", + MUDNAME, + CLIENT_PW, 2, "hub03" + )); + */ + sequence=time(); + } + + string escape(string str){ + str=replace_string(str,"\\","\\\\"); + str=replace_string(str,"\"","\\\""); + str=replace_string(str,"\n","\\n"); + str=replace_string(str,"\r","\\r"); + if(sizeof(explode(str," "))!=1) str = "\""+str+"\""; + return str; + } + + string unescape(string str){ + string a,b=str,output=""; + while(sscanf(b,"%s\\%s",a,b)==2){ + output += a; + if(sizeof(b)){ + switch(b[0]){ + case 34 : output += "\""; break; // '\"' makes warnings. + case '\\' : output += "\\"; break; + case 'n' : output += "\n"; break; + case 'r' : output += "\r"; break; + } + } + b=b[1..]; + } + output += b; + output = replace_string(output,"\n\r","\n"); + if((sizeof(explode(output," "))==1) && sscanf(output,"\\\"%*s\\\"") ) output = "\""+output+"\""; + return output; + } + + mapping string_to_mapping(string str){ + // Picks first element off of string and then repeats? + mapping out=([]); + int i; + string what,data,rest; + + rest = str; + + while(sizeof(rest)>0){ + sscanf(rest, "%s=%s", what, rest); + /* + write("what="+what+", rest="+rest+"\n"); + */ + // At this point, what is the key, rest is value plus rest. + if(rest[0]==34){ // value is in quotes, tons of fun! + // find first quote without a backslash in front? + /* + write("rest begings with a quote\n"); + */ + i = 1; + while(((rest[i]!=34) || (rest[i-1]==92)) && (i<sizeof(rest))){ // 34 = ", 92 = \ + // While this is not a quote, or if this is an escaped quote, keep looking. + i++; + } + // now are 1 space past quote + // write("i="+i+"\n"); + data=rest[1..(i-1)]; // skip opening and closing quotes + rest=rest[(i+2)..]; // skip past space + // write("new data="+data+"\n"); + // write("new rest="+rest+"\n"); + // Data is now what was in the quotes... now to un-escape the data... + out[what]=unescape(data); + } + else{ // value is not in quotes, tons of actual non-sarcastic fun! + // just split it at the first space + if(sscanf(rest,"%s %s",data,rest)!=2){ // break at first space + data = rest; + rest = ""; + } + if((sscanf(data,"%d",i)==1) && (sprintf("%d",i)==data)) // is just number + out[what]=i; + else // not just a number + out[what]=data; + } + } + return out; + } + + void send_packet(string sender, string packet_type, string target, string destination, string data){ + // Sends a packet in the format that IMC2 uses. + sequence++; + send_text(sprintf("%s@%s %d %s %s %s@%s %s\n", + sender, MUDNAME, sequence, MUDNAME, packet_type, + target, destination, data + )); + } + + void send_keepalive_request(){ + // Ask all the muds to tell us that they're alive. + string mud; + // Mark all the muds as offline until they respond. + foreach(mud in keys(mudinfo)){ + mudinfo[mud]["online"]=0; + } + send_packet("*","keepalive-request","*","*",""); + } + + varargs void send_is_alive(string origin){ + // Sends an is-alive packet to whoever requested it, or else broadcasts it. + send_packet("*","is-alive","*",(origin ? origin : "*"), + sprintf("versionid=\"%s\" networkname=%s url=%s", + VERSION, network_name, URL)); + } + + int chan_listening(object user, string chan){ + // Tells if a user is listening to a channel or not. + if(!localchaninfo[chan]) return 0; + if(member_array(GET_NAME(user),localchaninfo[chan]["users"])==-1) return 0; + return chan_perm_allowed(user,chan); + } + + void channel_in(string fromname, string frommud, mapping data){ + // Handles an incoming channel message. + object user, *usrs; + string msg,blmsg; + string sender; + string local; + int emote=0; + int sz; + + sender=fromname+"@"+frommud; + if(data["sender"]) sender=data["sender"]; + if(data["realfrom"]) sender=data["realfrom"]; + if(intp(data["text"])) data["text"]=sprintf("%d",data["text"]); + // the data processing function makes "1" into a number, + // which can be a problem when a person says just a number on a channel :P + local=localize_channel(data["channel"]); + if(data["emote"]) emote=data["emote"]; + #ifdef CHANNEL_BOT + // Can define CHANNEL_BOT to something with got_chan(channel,from,text,emote) + // It will be given all channel messages. Be aware of this. + CHANNEL_BOT->eventSendChannel(sender, data["channel"], data["text"], emote); + #endif + #ifdef CHANNEL_BOTS + if(CHANNEL_BOTS[local]){ + call_other(CHANNEL_BOTS[local],"got_chan",local,sender,data["text"],emote); + } + else if(CHANNEL_BOTS[data["channel"]]){ + call_other(CHANNEL_BOTS[data["channel"]],"got_chan",data["channel"],sender,data["text"],emote); + } + #endif + if(!local) return; // Channel not used locally, ignore. + usrs = ({ }); + data["text"]=imc2_to_pinkfish(data["text"]); + foreach(user in users()) + if(chan_listening(user,local)) usrs += ({ user }); + if(emote==2){ + msg=sprintf("%s- [%%^GREEN%%^%s%%^RESET%%^] %%^CYAN%%^(from %s)%%^RESET%%^ %s", + NETWORK_ID,local,sender,data["text"]); + blmsg=sprintf("%s- [%s] (from %s) %s", + NETWORK_ID,local,sender,data["text"]); + } + else if(emote){ + msg=sprintf("%s- [%%^GREEN%%^%s%%^RESET%%^] %%^CYAN%%^%s%%^RESET%%^ %s", + NETWORK_ID,local,sender,data["text"]); + blmsg=sprintf("%s- [%s] %s %s", + NETWORK_ID,local,sender,data["text"]); + } + else{ + msg=sprintf("%s- %%^CYAN%%^%s%%^RESET%%^ [%%^GREEN%%^%s%%^RESET%%^]: %s", + NETWORK_ID, sender,local,data["text"]); + blmsg=sprintf("%s- %s [%s]: %s", + NETWORK_ID, sender,local,data["text"]); + } + IMC2_MSG(msg+"\n",usrs); + localchaninfo[local]["backlog"] += ({ ctime(time())[4..18]+" "+blmsg }); + sz = sizeof(localchaninfo[local]["backlog"]); + if(sz>BACKLOG_SIZE) + localchaninfo[local]["backlog"]=localchaninfo[local]["backlog"][(sz-BACKLOG_SIZE)..sz]; + } + + private void channel_out(object user,string chan,string msg){ + // Send outgoing channel message. + send_packet(GET_CAP_NAME(user),"ice-msg-b","*","*", + sprintf("channel=%s text=%s emote=0 echo=1", + chan,escape(GET_CAP_NAME(user)+"@"+MUDNAME+" "+msg))); + } + + private varargs void tell_out(object from, string targname, string targmud, string msg, int reply, int emote){ + // Send outgoing tell. + if(!reply) reply=0; + send_packet(GET_CAP_NAME(from),"tell",targname,targmud, + sprintf("level=%d text=%s reply=%d emote=%d", level(from),escape(msg),reply,emote)); + } + + private void tell_in(string sender, string origin, string target, mapping data){ + // Incoming tell. + object who; + int sz; + string blmsg; + who=FIND_PLAYER(lower_case(target)); + target=GET_CAP_NAME(who); + data["text"]=imc2_to_pinkfish(data["text"]); + if(who + #ifdef INVIS + && VISIBLE(who) + #endif + && can_use(who) + ){ + switch(data["isreply"]){ + case 2: // emote + IMC2_MSG(sprintf("%s tell: %%^CYAN%%^%s@%s%%^RESET%%^ %s\n", + NETWORK_ID,sender,origin,data["text"]), who); + blmsg=sprintf("%s tell: %s@%s %s\n", + NETWORK_ID,sender,origin,data["text"]); + break; + case 1: // reply + IMC2_MSG(sprintf("%s %%^CYAN%%^%s@%s%%^RESET%%^ replies to you: %s\n", + NETWORK_ID,sender,origin,data["text"]), who); + blmsg=sprintf("%s %s@%s replied to you: %s\n", + NETWORK_ID,sender,origin,data["text"]); + break; + default: + IMC2_MSG(sprintf("%s %%^CYAN%%^%s@%s%%^RESET%%^ tells you: %s\n", + NETWORK_ID,sender,origin,data["text"]), who); + blmsg=sprintf("%s %s@%s told you: %s\n", + NETWORK_ID,sender,origin,data["text"]); + break; + } + if(!tells[target]) + tells[target]=([ ]); + tells[target]["reply"] = sprintf("%s@%s",sender,origin); + if(!tells[target]["backlog"] || !arrayp(tells[target]["backlog"])) + tells[target]["backlog"]=({ }); + tells[target]["backlog"] += ({ blmsg }); + sz = sizeof(tells[target]["backlog"]); + if(sz>BACKLOG_SIZE) + tells[target]["backlog"]=tells[target]["backlog"][(sz-BACKLOG_SIZE)..sz]; + } + else{ + #ifdef TELL_BOTS + // Can have a mapping of bots which can get tells. + if(TELL_BOTS[target]){ + call_other(TELL_BOTS[target],"got_tell",sender, origin, target, data["text"]); + return; + } + #endif + #ifdef TELL_BOT + // They should have got_tell(fromname, frommud, target, text) + // I'll assume bots don't care about emote/reply... tell me if you do? + // TELL_BOT will get told of all tells which don't have a valid target, and + // then the sender will be notified that it didn't get to anyone. + // This would be useful if for example you wanted all tells sent to + // offline people to be mudmailed to them or something. + call_other(TELL_BOTS[target],"got_tell",sender, origin, target, data["text"]); + #endif + send_packet("*","tell",sender,origin, + sprintf("level=-1 text=\"%s is not online on this mud.\" isreply=1",target)); + } + } + + string pinkfish_to_imc2(string str){ + // Foreground + str=replace_string(str,"%^BLACK%^","~x"); // Black + str=replace_string(str,"%^RED%^","~R"); // Red + str=replace_string(str,"%^GREEN%^","~G"); // Green + str=replace_string(str,"%^BLUE%^","~B"); // Blue + str=replace_string(str,"%^WHITE%^","~W"); // White + str=replace_string(str,"%^ORANGE%^","~y"); // Orange + str=replace_string(str,"%^CYAN%^","~c"); // Cyan + str=replace_string(str,"%^YELLOW%^","~Y"); // Yellow + str=replace_string(str,"%^MAGENTA%^","~p"); // Magenta -> purple sounds closest + str=replace_string(str,"%^GRAY%^","~w"); // Gray doesn't display on my MUD, bah :( + // Background + str=replace_string(str,"%^B_BLACK%^","^x"); + str=replace_string(str,"%^B_RED%^","^R"); // Red + str=replace_string(str,"%^B_GREEN%^","^G"); // Green + str=replace_string(str,"%^B_BLUE%^","^b"); // Blue + str=replace_string(str,"%^B_WHITE%^","^W"); // White + str=replace_string(str,"%^B_ORANGE%^","^O"); // Orange + str=replace_string(str,"%^B_CYAN%^","^c"); // Cyan + str=replace_string(str,"%^B_YELLOW%^","^Y"); // Yellow + str=replace_string(str,"%^B_MAGENTA%^","^p"); // Magenta -> purple sounds closest + // Misc. + str=replace_string(str,"%^FLASH%^","~$"); // Flash -> Blink + str=replace_string(str,"%^BOLD%^","~L"); // Bold + str=replace_string(str,"%^RESET%^","~!"); + return str; + } + + string imc2_to_pinkfish(string str){ + string output=""; + int sz; + /* + For colors explanation, refer to IMC Packet Documentation by Xorith. + Thanks very much for putting that out, by the way. :) + Found at http://hub00.muddomain.com/imc2_protocol_doc.txt + */ + sz=sizeof(str)-1; + while(sizeof(str)>1){ + switch(str[0]){ + case '~': // Foreground + switch(str[1]){ + case 'Z': break; // Random + case 'x': output += "%^BLACK%^"; break; // Black + case 'r': output += "%^RED%^"; break; // Dark Red + case 'g': output += "%^GREEN%^"; break; // Dark Green + case 'y': output += "%^ORANGE%^"; break; // Orange + case 'b': output += "%^BLUE%^"; break; // Dark Blue + case 'p': output += "%^MAGENTA%^"; break; // Purple + case 'c': output += "%^CYAN%^"; break; // Cyan + case 'w': output += "%^WHITE%^"; break; // Grey + case 'D': output += "%^BLACK%^"; break; // Dark Grey + case 'z': output += "%^BLACK%^"; break; // Same as ~D + case 'R': output += "%^RED%^"; break; // Red + case 'G': output += "%^GREEN%^"; break; // Green + case 'Y': output += "%^YELLOW%^"; break; // Yellow + case 'B': output += "%^BLUE%^"; break; // Blue + case 'P': output += "%^MAGENTA%^"; break; // Pink + case 'C': output += "%^BLUE%^"; break; // Light Blue + case 'W': output += "%^WHITE%^"; break; // White + + case 'm': output += "%^MAGENTA%^"; break; // same as p + case 'd': output += "%^WHITE%^"; break; // same as w + case 'M': output += "%^MAGENTA%^"; break; // same as P + // Misc. + case '!': output += "%^RESET%^"; break; // Reset + case 'L': output += "%^BOLD%^"; break; // Bold + case 'u': break; // Underline + case '$': output += "%^FLASH%^"; break; // Blink + case 'i': break; // Italic + case 'v': break; // Reverse + case 's': break; // Strike-thru + + case '~': output += "~"; break; // ~~ prints as ~ + default : output += "~"; // Don't skip over this + // (cheap hack is to add a character in front so the [2..] thing still works) + str = " "+str; + break; + } + str=str[2..]; + break; + case '^': // Background + switch(str[1]){ + case 'Z': break; // Random + case 'x': output += "%^B_BLACK%^"; break; // Black + case 'r': output += "%^B_RED%^"; break; // Dark Red + case 'g': output += "%^B_GREEN%^"; break; // Dark Green + case 'O': output += "%^B_ORANGE%^"; break; // Orange + case 'B': output += "%^B_BLUE%^"; break; // Dark Blue + case 'p': output += "%^B_MAGENTA%^"; break; // Purple + case 'c': output += "%^B_CYAN%^"; break; // Cyan + case 'w': output += "%^B_WHITE%^"; break; // Grey + case 'z': output += "%^B_BLACK%^"; break; // Dark Grey + case 'R': output += "%^B_RED%^"; break; // Red + case 'G': output += "%^B_GREEN%^"; break; // Green + case 'Y': output += "%^B_YELLOW%^"; break; // Yellow + case 'b': output += "%^B_BLUE%^"; break; // Blue + case 'P': output += "%^B_MAGENTA%^"; break; // Pink + case 'C': output += "%^B_BLUE%^"; break; // Light Blue + case 'W': output += "%^B_WHITE%^"; break; // White + case '^': output += "^"; break; // ^^ prints as ^ + default : output += "^"; // Don't skip over this + // (cheap hack is to add a character in front so the [2..] thing still works) + str = " "+str; + break; + } + str=str[2..]; + break; + case '`': // Blinking Foreground + switch(str[1]){ + case 'Z': output += "%^FLASH%^"; break; // Random + case 'x': output += "%^FLASH%^%^BLACK%^"; break; // Black + case 'r': output += "%^FLASH%^%^RED%^"; break; // Dark Red + case 'g': output += "%^FLASH%^%^GREEN%^"; break; // Dark Green + case 'O': output += "%^FLASH%^%^ORANGE%^"; break; // Orange + case 'b': output += "%^FLASH%^%^BLUE%^"; break; // Dark Blue + case 'p': output += "%^FLASH%^%^MAGENTA%^"; break; // Purple + case 'c': output += "%^FLASH%^%^CYAN%^"; break; // Cyan + case 'w': output += "%^FLASH%^%^WHITE%^"; break; // Grey + case 'z': output += "%^FLASH%^%^BLACK%^"; break; // Dark Grey + case 'R': output += "%^FLASH%^%^RED%^"; break; // Red + case 'G': output += "%^FLASH%^%^GREEN%^"; break; // Green + case 'Y': output += "%^FLASH%^%^YELLOW%^"; break; // Yellow + case 'B': output += "%^FLASH%^%^BLUE%^"; break; // Blue + case 'P': output += "%^FLASH%^%^MAGENTA%^"; break; // Pink + case 'C': output += "%^FLASH%^%^BLUE%^"; break; // Light Blue + case 'W': output += "%^FLASH%^%^WHITE%^"; break; // White + case '`': output += "`"; break; // `` prints as ` + default : output += "`"; // Don't skip over this + // (cheap hack is to add a character in front so the [2..] thing still works) + str = " "+str; + break; + } + str=str[2..]; + break; + default: + output += str[0..0]; + str=str[1..]; + break; + } + } + output += str; + return output; + } + + private void who_reply_in(string origin, string target, mapping data){ + string output; + object targuser; + targuser = FIND_PLAYER(lower_case(target)); + if(targuser){ + output = NETWORK_ID+" who reply from: %^CYAN%^"+origin+"%^RESET%^\n"; + output += imc2_to_pinkfish(data["text"])+"\n"; + IMC2_MSG(output,targuser); + } + } + + private void whois_in(string fromname, string frommud, string targ, mapping data){ + if(FIND_PLAYER(lower_case(targ)) + #ifdef INVIS + && !INVIS(FIND_PLAYER(lower_case(targ))) + #endif + && can_use(FIND_PLAYER(lower_case(targ))) + ){ + send_packet(targ,"whois-reply",fromname,frommud,"text=Online"); + } + #ifdef USER_EXISTS + else if(USER_EXISTS(lower_case(targ))){ + send_packet(targ,"whois-reply",fromname,frommud, + "text=\"Exists but is offline\""); + } + #endif + } + + private void whois_reply_in(string targ,string fromname,string frommud,mapping data){ + object who; + who=FIND_PLAYER(lower_case(targ)); + if(who){ + IMC2_MSG(sprintf("%s whois reply: %s@%s: %s\n", + NETWORK_ID,fromname,frommud,data["text"]),who); + } + } + + private void beep_in(string sender, string origin, string target, mapping data){ + object who; + who=FIND_PLAYER(lower_case(target)); + if(who && can_use(who) + #ifdef INVIS + && VISIBLE(who) + #endif + ){ + IMC2_MSG(sprintf("%s- %%^CYAN%%^%s@%s%%^RESET%%^ \abeeps you.\n", + NETWORK_ID,sender,origin,data["text"]), who); + } + else{ + send_packet("*","tell",sender,origin, + sprintf("level=-1 text=\"%s is not online.\" isreply=1",target)); + } + } + + private void beep_out(object from, string targname, string targmud){ + send_packet(GET_CAP_NAME(from),"beep",targname,targmud, + sprintf("level=%d ", level(from))); + } + + private void send_ice_refresh(){ send_packet("*","ice-refresh","*","*",""); } + + private void ping_reply_in(string sender,string origin,string target,mapping data){ + object who; + if((target=="*") && target=ping_requests[sender]){ + target=ping_requests[sender]; + map_delete(ping_requests,sender); + } + who=FIND_PLAYER(lower_case(target)); + if(who){ + IMC2_MSG(sprintf("%s route to %%^CYAN%%^%s%%^RESET%%^ is: %s\n", + NETWORK_ID,origin,data["path"]), who); + } + } + + private void ping_out(string from,string targmud){ send_packet(from,"ping","*",targmud,""); } + private varargs void who_out(string from,string targmud,string type){ send_packet(from,"who","*",targmud,(type ? sprintf("type=\"%s\"",type) : "type=who")); } + + private void chanwho_out(object from,string chan,string mud){ + send_packet(GET_CAP_NAME(from),"ice-chan-who","*",mud, + sprintf("level=%d channel=%s lname=%s",level(from), + localchaninfo[chan]["name"],chan)); + } + + private void chanwho_reply_in(string origin, string target, mapping data){ + string output; + object targuser; + targuser = FIND_PLAYER(lower_case(target)); + if(targuser){ + output = NETWORK_ID+" chanwho reply from "+origin+" for "+data["channel"]+"\n"; + output += imc2_to_pinkfish(data["list"]); + IMC2_MSG(output,targuser); + } + } + + private void chan_who_in(string fromname, string frommud, mapping data){ + // Handles an incoming channel who request. + object user, *usrs=({ }); + string local, lname; + string output; + local=localize_channel(data["channel"]); + if(data["lname"]) lname = data["lname"]; + else lname = local; + if(!local){ // Channel not used locally. + output = sprintf("channel=%s list=\"%s (%s) is not configured on this MUD.\n\"", + data["channel"],lname,data["channel"]); + } + else{ // Is used locally + output = "The following users are listening to "+lname+" ("+local+"):\n "; + foreach(user in users()){ + if(chan_listening(user,local) + #ifdef INVIS + && !INVIS(user) + #endif + ){ + usrs += ({ GET_CAP_NAME(user) }); + } + } // foreach + output += implode(usrs,", "); + output += "\n"; + if(!sizeof(usrs)){ + output=sprintf("channel=%s list=\"Nobody is listening to %s (%s) on this MUD.\n\"", + lname,local); + } + } + send_packet("*","ice-chan-whoreply",fromname,frommud,output); + } + + string find_mud(string str){ + // Makes case-insensitive mud name into the actual mud name, or else 0. + string mud; + if(!str) return 0; + str=lower_case(str); + foreach(mud in keys(mudinfo)){ + if(lower_case(mud)==str) return mud; + } + return 0; + } + + string localize_channel(string str){ + // Tells what the local name for a channel is, given the network name for it, or else 0. + string a; + foreach(a in keys(localchaninfo)){ + if(lower_case(localchaninfo[a]["name"])==lower_case(str)) return a; + } + return 0; + } + + int command(string str){ + // Takes the arguments given to the command which does IMC2 stuff. + string cmd, args; + string mud, *muds; + string output; + string a,b,c; + int x,y; + int emote,reply; + object usr, *usrs=({ }); + if(!str) str = "help"; + sscanf(str,"%s %s",cmd,args); + if(!cmd) cmd=str; + if(!args) args = ""; + switch(cmd){ + case "list": + muds = sort_array(keys(mudinfo),1); + if (!sizeof(mudinfo)){ + return notify_fail("There are no muds on the "+NETWORK_ID+" network!\n"); + } + else{ + x=0; y=0; + output=sprintf("[%s] %-20s %-20s %-20s\n","U/D?","Name","Network","IMC2 Version"); + foreach (mud in muds){ + if(!mudinfo[mud]) output += "Error on mud: "+mud+"\n"; + else{ + if(mudinfo[mud]["online"]) + x++; else y++; + output += sprintf("[%s] %-20s %-20s %-20s\n", + (mudinfo[mud]["online"] ? "%^GREEN%^ UP %^RESET%^" : "%^RED%^DOWN%^RESET%^"), + mud, + mudinfo[mud]["networkname"], + mudinfo[mud]["versionid"]); + } + } + output += sprintf("%d of %d MUDs are online.\n",x,x+y); + IMC2_MSG(output,THIS_PLAYER); + return 1; + } + break; + case "setup": + output=sprintf(@EndText + IMC2 NETWORK INFORMATION + ------------------------ + Status: %s + Hub address: %s + Hub port: %d + The hub calls itself: %s + The network calls itself: %s + Command to use this network: %s + The MUD calls this connection: %s + + Packet logging: %s + + The network calls the MUD: %s + The MUD's Version ID: %s + The MUD's URL: %s + EndText, + ((mode==MODE_CONNECTED) ? "Connected" : "Not connected"), + #ifdef HOSTNAME + HOSTNAME, + #else + HOSTIP, + #endif + HOSTPORT,hub_name,network_name,COMMAND_NAME,NETWORK_ID, + #ifdef DATA_LOG + "on", + #else + "off", + #endif + MUDNAME,VERSION,URL); + IMC2_MSG(output,THIS_PLAYER); + return 1; + break; + case "info": + if(!args) return notify_fail("See info for which MUD?\n"); + str=find_mud(args); + if(!str) return notify_fail("MUD isn't known on "+NETWORK_ID+".\n"); + output=("Mud info for: "+str+"\nStatus: "); + if(mudinfo[str]["online"]) + output+=("%^GREEN%^Online%^RESET%^\n"); + else + output+=("%^RED%^Offline%^RESET%^\n"); + if(mudinfo[str]["versionid"]) output+=("Version ID: "+mudinfo[str]["versionid"]+"\n"); + if(mudinfo[str]["url"]) output+=("URL: "+mudinfo[str]["url"]+"\n"); + if(mudinfo[str]["networkname"]) output+=("Network name: "+mudinfo[str]["networkname"]+"\n"); + IMC2_MSG(output,THIS_PLAYER); + return 1; + break; + case "ping": + if(!args) return notify_fail("Send ping to which MUD?\n"); + str=find_mud(args); + if(!str) return notify_fail("MUD isn't known on "+NETWORK_ID+".\n"); + if(!mudinfo[str]["online"]) return notify_fail(NETWORK_ID+"- "+b+" is offline right now.\n"); + ping_out(GET_CAP_NAME(THIS_PLAYER),str); + IMC2_MSG(NETWORK_ID+"- Sent a ping to "+str+"\n",THIS_PLAYER); + return 1; + break; + case "who": + if(!args) return notify_fail("Send who request to which MUD?\n"); + str=find_mud(args); + if(!str) return notify_fail("MUD isn't known on "+NETWORK_ID+".\n"); + if(!mudinfo[str]["online"]) return notify_fail(NETWORK_ID+"- "+str+" is offline right now.\n"); + who_out(GET_CAP_NAME(THIS_PLAYER),str); + IMC2_MSG(NETWORK_ID"- Sent a who request to "+str+"\n",THIS_PLAYER); + return 1; + break; + case "finger": + notify_fail("Send finger request to who@where?\n"); + if(!args) return 0; + if(sscanf(args,"%s@%s",a,b)!=2){ + return 0; + } + b=find_mud(b); + who_out(GET_CAP_NAME(THIS_PLAYER),b,"finger "+a); + IMC2_MSG(NETWORK_ID"- Sent a finger request to "+a+"@"+b+"\n",THIS_PLAYER); + return 1; + break; + case "mudinfo": + if(!args) return notify_fail("Send info request to which MUD?\n"); + str=find_mud(args); + if(!str) return notify_fail("MUD isn't known on "+NETWORK_ID+".\n"); + if(!mudinfo[str]["online"]) return notify_fail(NETWORK_ID+"- "+str+" is offline right now.\n"); + who_out(GET_CAP_NAME(THIS_PLAYER),str,"info"); + IMC2_MSG(NETWORK_ID"- Sent an info request to "+str+"\n",THIS_PLAYER); + return 1; + break; + case "chanwho": + if(!args) return notify_fail("What channel?\n"); + if(sscanf(args,"%s %s",a,b)!=2){ + a=args; + b=""; + } + else { + if(b!="*") b=find_mud(b); + } + if(!b) return notify_fail("MUD isn't known on "+NETWORK_ID+".\n"); + if(!localchaninfo[a]) return notify_fail("Invalid channel.\n"); + if(b==""){ // check who's on locally + c = "The following users are listening to "+a+":\n "; + foreach(usr in users()) + if(chan_listening(usr,a)){ + usrs += ({ usr }); + c += " "+GET_CAP_NAME(usr); + } + c += "\n"; + if(!usrs) c="Nobody on this mud is listening to that channel.\n"; + IMC2_MSG(c,THIS_PLAYER); + return 1; + } + if((b!="*") && (!mudinfo[b]["online"])) + return notify_fail(NETWORK_ID+"- "+b+" is offline right now.\n"); + chanwho_out(THIS_PLAYER,a,b); + IMC2_MSG(sprintf("%s- Sent a channel who request to %s for the %s channel.\n", + NETWORK_ID,b,a),THIS_PLAYER); + return 1; + break; + case "chans": + output="Local setup for "+NETWORK_ID+" channels:\n"; + output += sprintf("%-15s %-15s %-15s %-15s\n", + "Local Name","Allowed (you?)","Listening","Network Name"); + foreach(a in sort_array(keys(localchaninfo),1)){ + output += sprintf("%-15s %s%-15s%%^RESET%%^ %s%-15s%%^RESET%%^ %-15s\n", + a, + ((chan_perm_allowed(THIS_PLAYER,a) ? "%^GREEN%^" : "%^RED%^")), + chan_perm_desc(localchaninfo[a]["perm"])+" "+ + ((chan_perm_allowed(THIS_PLAYER,a) ? "(yes)" : "(no)")), + ((chan_listening(THIS_PLAYER,a) ? "%^GREEN%^" : "%^RED%^")), + ((chan_listening(THIS_PLAYER,a) ? "yes" : "no")), + localchaninfo[a]["name"]); + } + IMC2_MSG(output,THIS_PLAYER); + return 1; + break; + case "allchans": + output=NETWORK_ID+" channels:\n"; + output += sprintf("%-23s %-17s %-7s %-6s %-10s %-10s\n", + "Name","Owner","Policy","Level","Suggested","Local Name"); + foreach(a in sort_array(keys(chaninfo),1)){ + output += sprintf("%-23s %-17s %-7s %-6s %-10s %-10s\n", + a,chaninfo[a]["owner"], + chaninfo[a]["policy"], + chaninfo[a]["level"],chaninfo[a]["localname"], + (localize_channel(a) ? localize_channel(a) : "<none>")); + } + IMC2_MSG(output,THIS_PLAYER); + return 1; + break; + case "beep": + if(!args || sscanf(args,"%s@%s",a,b)!=2) + return notify_fail("Invalid syntax. "+COMMAND_NAME+" beep name@mud\n"); + b=find_mud(b); + if(!b) return notify_fail("MUD isn't known on "+NETWORK_ID+".\n"); + if(!mudinfo[b]["online"]) return notify_fail("That MUD is offline right now\n"); + IMC2_MSG(sprintf("%s- You beep %s@%s\n",NETWORK_ID,a,b),THIS_PLAYER); + beep_out(THIS_PLAYER,a,b); + return 1; + break; + case "chanemote": // Drop through + case "chatemote": // Drop through + case "chansocial": // Drop through + case "chatsocial": // Drop through + case "chat": // Drop through + case "chan": + switch(cmd){ + case "chatemote" : // Drop-through + case "chanemote" : emote=1; break; + case "chatsocial" : // Drop-through + case "chansocial" : emote=2; break; + } + if(!args || (sscanf(args,"%s %s",a,b)!=2)) + return notify_fail("Syntax: "+COMMAND_NAME+" chan channel message\n"); + if(!localchaninfo[a]) return notify_fail(a+" is not a channel.\n"); + if(!chan_perm_allowed(THIS_PLAYER,a)) + return notify_fail("You need permission to use the "+a+" channel.\n"); + if(!chan_listening(THIS_PLAYER,a)) + return notify_fail("You are not listening to the "+a+" channel.\n"); + if(emote==2){ + IMC2_MSG(sprintf("Sent to %s- [%s] %s\n",NETWORK_ID, + a,b),THIS_PLAYER); + } + else if(emote){ + IMC2_MSG(sprintf("Sent to %s- [%s] %s %s\n",NETWORK_ID, + a,GET_CAP_NAME(THIS_PLAYER),b),THIS_PLAYER); + } + else{ + IMC2_MSG(sprintf("Sent to %s- %s [%s] %s\n",NETWORK_ID, + GET_CAP_NAME(THIS_PLAYER),a,b),THIS_PLAYER); + } + send_packet(GET_CAP_NAME(THIS_PLAYER),"ice-msg-b","*","*", + sprintf("channel=%s text=%s emote=%d echo=1", + localchaninfo[a]["name"],escape(pinkfish_to_imc2(b)),emote)); + return 1; + break; + case "reply": // Drop-through + case "replyemote": // Drop-through + case "tellemote": // Drop-through + case "tell": // Drop-through + switch(cmd){ + case "reply" : cmd="reply to"; reply=1; break; + case "replyemote" : cmd="reply an emote to"; reply=1; emote=1; break; + case "tell" : break; + case "tellemote" : cmd="tell an emote to"; emote=1; break; + } + if(!args) + return notify_fail("Need a message.\n"); + if(reply){ + a=tells[GET_CAP_NAME(THIS_PLAYER)]["reply"]; + if(!a) return notify_fail("You haven't recieved an incoming tell through "+ + NETWORK_ID+" yet. Can't reply.\n"); + sscanf(a,"%s@%s",a,b); + c=args; + } + else{ + if(sscanf(args,"%s@%s %s",a,b,c)!=3) + return notify_fail("Invalid syntax. "+COMMAND_NAME+" tell name@mud message\n"); + } + if(emote) + c=GET_CAP_NAME(THIS_PLAYER)+"@"+MUDNAME+" "+c; + b=find_mud(b); + if(!b) return notify_fail("MUD isn't known on "+NETWORK_ID+".\n"); + if(!mudinfo[b]["online"]) return notify_fail(NETWORK_ID+"- "+b+" is offline right now.\n"); + IMC2_MSG(sprintf("%s- You %s %s@%s: %s\n",NETWORK_ID,cmd,a,b,c),THIS_PLAYER); + tell_out(THIS_PLAYER,a,b,c,reply,emote); + return 1; + break; + case "listen": + if(!args || !sizeof(args)){ // Listen to all + foreach(args in keys(localchaninfo)){ + if(chan_perm_allowed(THIS_PLAYER,args) && + (member_array(GET_NAME(THIS_PLAYER),localchaninfo[args]["users"])==-1)){ + localchaninfo[args]["users"] += ({ GET_NAME(THIS_PLAYER) }); + IMC2_MSG(NETWORK_ID+"- You are now listening to "+ + args+"\n",THIS_PLAYER); + } + } + IMC2_MSG("Listened to all allowed "+NETWORK_ID+" channels.\n",THIS_PLAYER); + return 1; + } + if(!localchaninfo[args]) return notify_fail("Not a locally configured channel.\n"); + if(!chan_perm_allowed(THIS_PLAYER,args)) + return notify_fail("You don't have permission to use that channel.\n"); + if(member_array(THIS_PLAYER->query("name"),localchaninfo[args]["users"])!=-1) + return notify_fail("You're already listening to that channel.\n"); + localchaninfo[args]["users"] += ({ GET_NAME(THIS_PLAYER) }); + IMC2_MSG(NETWORK_ID+"- You are now listening to "+args+"\n",THIS_PLAYER); + return 1; + break; + case "unlisten": + if(!localchaninfo[args]) return notify_fail("Not a locally configured channel.\n"); + localchaninfo[args]["users"] -= ({ GET_NAME(THIS_PLAYER) }); + IMC2_MSG(NETWORK_ID+"- You are no longer listening to "+args+"\n",THIS_PLAYER); + return 1; + break; + case "whois": + if(!args || !sizeof(args)) return notify_fail("Locate who?\n"); + send_packet(GET_CAP_NAME(THIS_PLAYER),"whois",args,"*", + sprintf("level=%d ",level(THIS_PLAYER))); + IMC2_MSG("Sent a request on "+NETWORK_ID+" looking for "+args+"\n",THIS_PLAYER); + return 1; + break; + case "backlog": + if(!localchaninfo[args]) return notify_fail("Not a locally configured channel.\n"); + if(!chan_perm_allowed(THIS_PLAYER,args)) + return notify_fail("You need permission to use the "+args+" channel.\n"); + if(!chan_listening(THIS_PLAYER,args)) + return notify_fail("You are not listening to the "+args+" channel.\n"); + IMC2_MSG(sprintf("Backlog of channel %s on %s:\n%s",args,NETWORK_ID, + implode(localchaninfo[args]["backlog"],"\n")+"\n"),THIS_PLAYER); + return 1; + break; + case "tells": + a=GET_CAP_NAME(THIS_PLAYER); + if(!tells[a] || !tells[a]["backlog"]) + return notify_fail("You have received no tells on the "+NETWORK_ID+" network yet.\n"); + IMC2_MSG(sprintf("Tell backlog on %s:\n%s",NETWORK_ID, + implode(tells[a]["backlog"],"")+"\n"),THIS_PLAYER); + return 1; + break; + case "configchan": + if(!ADMIN(THIS_PLAYER)) return notify_fail("You aren't allowed to use configchan.\n"); + if(sscanf(args,"%s %s %d",a,b,x)!=3) + return notify_fail("Syntax: "+COMMAND_NAME+" configchan local_name hub_name level_number\n"); + if(member_array(b,keys(chaninfo))==-1) + return notify_fail("The "+b+" channel isn't on the network.\n"); + c=localize_channel(b); + if(c) return notify_fail("That channel is already configured as "+c+" locally.\n"); + localchaninfo[a]=([ "perm":x, "name":b, "users":({ }), "backlog":({ }) ]); + IMC2_MSG("Added the "+a+" channel for "+chan_perm_desc(x)+ + " to use, which is "+b+" on the network.\n",THIS_PLAYER); + return 1; + break; + case "unconfigchan": + if(!ADMIN(THIS_PLAYER)) return notify_fail("You aren't allowed to use unconfigchan.\n"); + map_delete(localchaninfo,args); + IMC2_MSG("Got rid of "+args+" channel.\n",THIS_PLAYER); + return 1; + break; + case "chancmd": + if(!ADMIN(THIS_PLAYER)) return notify_fail("You aren't allowed to use chancmd.\n"); + if(!args || (sscanf(args,"%s:%s %s",a,b,c)!=3)) + return notify_fail("Syntax: "+COMMAND_NAME+" chancmd hub:channel command\n"); + if(!chaninfo[a+":"+b]) write(a+" is not listed as a channel, sending command anyway...\n"); + send_packet(GET_CAP_NAME(THIS_PLAYER),"ice-cmd","IMC",b, + sprintf("channel=%s command=\"%s\"", + a+":"+b,escape(c))); + IMC2_MSG(sprintf("%s- Sent a command for the %s channel to %s\n",NETWORK_ID, + a,GET_CAP_NAME(THIS_PLAYER),b),THIS_PLAYER); + return 1; + break; + case "chanperms": + output = MUDNAME+" will handle the following levels for channels:\n"; + output += sprintf("%-10s %-10s\n", "Number", "Description"); + for(x=2;x>0;x--){ + output = sprintf("%-10d %-10s\n", x, chan_perm_desc(x)); + } + IMC2_MSG(output,THIS_PLAYER); + return 1; + case "help": // drop through to default + default: + IMC2_MSG(main_help(),THIS_PLAYER); + return 1; + break; + } + } + + string main_help(){ + return sprintf(@EndText + IMC2 system by Tim, set up for %s. + To use this, type the command '%s' followed by one of the following: + chans - lists the channels that this MUD uses + allchans - lists all the channels on this network + chan (channel) (message) - talks on a channel + chanemote (channel) (message) - emotes on a channel + chansocial (channel) (message) - does a social on a channel + chanwho (channel) (mud) - checks who is listening to a channel + backlog (channel) - reads last %d messages on the channel + listen (channel) - listen to a channel + unlisten (channel) - stop listening to a channel + info (name) - lists information about a MUD + list - lists the MUDs on this network + beep (name)@(mud) - send a beep through the network + tell (name)@(mud) (message) - send a tell through the network + tellemote (name)@(mud) (message) - send an emote through the network + tells - shows your last %d tells + finger (name)@(mud) - send a finger request for information about name@mud + reply (message) - reply to the last incoming tell you received + replyemote (message) - reply with an emote to the last incoming tell you received + ping (mud) - pings a mud + setup - shows information about this IMC2 network + help - see this help message + Admin commands: + configchan (local_name) (remote_name) (level_number) - configures a channel locally + unconfigchan (local_name) - removes a locally configured channel + chancmd (channel) (command) - for remote channel administration + chanperms - lists the permission levels that are possible for configchan + EndText, NETWORK_ID,COMMAND_NAME,BACKLOG_SIZE,BACKLOG_SIZE); + } + + string html(string str){ + string mud, *muds; + string a,b; + int x=0,y=0; + string output=""; + if(!str) str=""; + sscanf(str,"%s_%s",a,b); + if(!a) a=str; + switch(a){ + case "list": + muds = sort_array(keys(mudinfo),1); + if (!sizeof(mudinfo)){ + return ("There are no muds on the "+NETWORK_ID+" network!\n"); + } + else{ + output="<tr><td><b>Status</b></td><td><b>Name</b></td><td><b>Network</b></td><td><b>IMC2 Version</b></td></tr>\n"; + foreach (mud in muds){ + if(mudinfo[mud]["online"]) x++; else y++; + output += sprintf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n", + (mudinfo[mud]["online"] ? "UP" : "DOWN"), + mudinfo[mud]["url"] ? "<a href=\""+ + ((mudinfo[mud]["url"][0..6]!="http://") ? "http://"+mudinfo[mud]["url"] : mudinfo[mud]["url"]) + +"\">"+mud+"</a>" : mud, + mudinfo[mud]["networkname"], + mudinfo[mud]["versionid"]); + } + } + return sprintf("<B>%d of %d MUDs are on %s.</B.\n<BR><table>%s</table>", + x,x+y,NETWORK_ID,output); + break; + case "backlog": + if(b && localchaninfo[b] && (localchaninfo[b]["perm"]==BACKLOG_WEB_LEVEL)){ + // Show backlog for channel. + return b+" channel backlog:\n"+implode(localchaninfo[b]["backlog"],"\n"); + } + // List the channels + output = NETWORK_ID+" channels on "+MUDNAME+":\n"; + foreach(b in sort_array(keys(localchaninfo),1)){ + if(localchaninfo[b]["perm"]==BACKLOG_WEB_LEVEL) // is public + output += "<a href=\""+HTML_LOCATION+"backlog_"+b+"\">"; + output += b; + output += " - "+chan_perm_desc(localchaninfo[b]["perm"]); + if(localchaninfo[b]["perm"]==BACKLOG_WEB_LEVEL) // is public + output += " - on web</a>"; + else + output += " - not on web"; + output += "\n"; + } + return output; + break; + default: + return MUDNAME+" uses Tim's LPC IMC2 system to connect to the "+ + NETWORK_ID+" network.\n"+ + "(version:"+VERSION+")\n"+ + "From here, you can look at the <a href=\""+HTML_LOCATION+"list\">list of muds</a>,\n"+ + "view the <a href=\""+HTML_LOCATION+"backlog\">public channel backlogs</a>,\n"+ + "or go to the main <a href=\""+URL+"\">"+MUDNAME+"</a> web site.\n"; + break; + } + } + + int clean_up(){ return 0; } + + + void forget_user(string str){ map_delete(tells,str); } + diff -c -r --new-file ds1.1/lib/secure/daemon/include/chat.h ds2.0r27/lib/secure/daemon/include/chat.h *** ds1.1/lib/secure/daemon/include/chat.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/daemon/include/chat.h Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,14 ---- + #ifndef __CHAT_H__ + #define __CHAT_H__ + + static void create(); + string *eventRegisterMember(string *chans); + string *eventRemoveMember(string *chans); + int cmdChannel(string verb, string str); + varargs void eventSendChannel(string who, string ch, string msg, int emote, + string target, string targmsg); + string *GetChannelList(string ch); + string GetLocalChannel(string ch); + string GetRemoteChannel(string ch); + + #endif /* __CHAT_H__ */ diff -c -r --new-file ds1.1/lib/secure/daemon/include/imc2_code.h ds2.0r27/lib/secure/daemon/include/imc2_code.h *** ds1.1/lib/secure/daemon/include/imc2_code.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/daemon/include/imc2_code.h Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,1502 ---- + // Tim Johnson + // Started on May 1, 2004. + // Use this however you want. + + #ifndef VERSION + #define VERSION "Tim's LPC IMC2 client - Jan 30, 2005" + #endif + + string tmpstr; + + // Mode decides what kind of packet is expected + #define NO_UIDS + #define MODE_CONNECTED 1 + #define MODE_WAITING_ACCEPT 2 + #define MODE_CONNECT_ERROR 3 // Not used yet, I need to see what the hub sends. + #define MODE_HUB_DOWN 4 // Not used yet either. + + #ifndef STREAM + #define STREAM 1 + #endif + #ifndef EESUCCESS + #define EESUCCESS 1 /* Call was successful */ + #endif + #ifndef THIS_PLAYER + #define THIS_PLAYER this_player() + #endif + #ifndef FIND_PLAYER + #define FIND_PLAYER(x) find_player(x) + #endif + #ifndef GET_CAP_NAME + #define GET_CAP_NAME(x) replace_string(x->GetName()," ","") + #endif + #ifndef GET_NAME + #define GET_NAME(x) convert_name(x->GetName()) + #endif + #ifndef IMC2_MSG + #define IMC2_MSG(x,y) foreach(tmpstr in explode(x,"\n")){ message("IMC2",tmpstr,y); } + #endif + #ifndef GET_GENDER + #define GET_GENDER(x) x->GetGender() + #endif + #ifndef ADMIN + #define ADMIN(x) archp(x) + #endif + + #define HTML_LOCATION "http://dead-souls.net/" + + // Other things that could be #define'd... + // INVIS(x) !visible(x) + // TELL_BOT "/u/t/timbot/imc2_invalidtells.c" + // TELL_BOTS ([ "timbot" : "/u/t/timbot/imc2_tellbot.c" ]) + // CHAN_BOT "/u/t/timbot/imc2_chans.c" + // CHAN_BOTS ([ "ichat" : "/u/t/timbot/imc2_ichat.c" ]) + // USER_EXISTS(x) user_exists(x) + + // Debugging + //#define DEB_IN 1 + //#define DEB_OUT 2 + //#define DEB_PAK 3 + //#define DEB_OTHER 0 + + int socket_num; + int mode; + mapping ping_requests; // Keeps track of who sent a ping request. + // Ping requests aren't labelled with names, so replies are destined to this MUD + // with no idea why, unless we keep track. + string buf=""; // Buffer for incoming packets (aren't always sent 1 at a time) + + // Variables + string hub_name, network_name; + string server_pass, server_version; + mapping chaninfo; + mapping localchaninfo; // (["chan": ([ "perm":1, "name":"something", "users":({ }) ]) ]) + mapping mudinfo; + mapping genders; + mapping tells; + int sequence; + + // Prototypes :) + void create(); + void remove(); + string pinkfish_to_imc2(string str); + string imc2_to_pinkfish(string str); + string escape(string str); + string unescape(string str); + mapping string_to_mapping(string str); + string main_help(); + + private void send_packet(string sender, string packet_type, string target, string destination, string data); + private void send_text(string text); + private void got_packet(string info); + private void start_logon(); + private varargs void send_is_alive(string origin); + private void channel_in(string fromname, string frommud, mapping data); + private void tell_in(string sender, string origin, string target, mapping data); + private void beep_in(string sender, string origin, string target, mapping data); + private void who_reply_in(string origin, string target, mapping data); + private void whois_in(string fromname, string frommud, string targ, mapping data); + private void whois_reply_in(string targ,string fromname,string frommud,mapping data); + private void ping_reply_in(string sender,string origin,string target,mapping data); + private void chanwho_reply_in(string origin, string target, mapping data); + private void send_keepalive_request(); + private int chan_perm_allowed(object user, string chan); + private string localize_channel(string str); + private void chan_who_in(string fromname, string frommud, mapping data); + private void send_ice_refresh(); + private void resolve_callback(string address, string resolved, int key); + + //private varargs void Debug(mixed msg, int x){ + // Add stuff in here if you want to see messages. + //} + + // Functions for users to change. + int can_use(object user){ return 1; } // Is this person allowed to use IMC2 at all? This function determines if tells can be sent to the person and such. + int level(object ob){ + // Outgoing packets are marked with the user's level. + // This function figures it out. + // If you have different ways of ranking, make this function convert them to what IMC2 uses. + // IMC2 uses: Admin=5, Imp=4, Imm=3, Mort=2, or None=1 + if(ADMIN(ob)) return 5; // Admin + //TMI-2: if(wizardp(ob)) return 3; + //TMI-2: if(userp(ob)) return 2; + //Discworld: if(ob->query_creator()) return 3; + if(this_player()) return 2; + return 1; // None + } + + string chan_perm_desc(int i){ + // Given the permission level assigned locally to a channel, return a short + // string describing what the number means. The number means nothing + // outside of this MUD. Also, they are independant of each other, and + // so you can do groups without having to always do subgroups of higher + // ones or anything like 'levels'. BACKLOG_WEB_LEVEL is the only one of + // significance, as it's the only one that the web backlog thing works on. + switch(i){ + case 2: return "arch"; + case 1: return "creator"; + case 0: return "public"; + } + return "invalid"; + } + + int chan_perm_allowed(object user, string chan){ + // Using the permission level assigned locally to a channel, + // return 1 if user is allowed to use the channel, 0 if not. + switch(localchaninfo[chan]["perm"]){ + case 2: if(archp(user)) return 1; return 0; + case 1: if(creatorp(user)) return 1; return 0; + case 0: return 1; + } + } + + + // Shouldn't have to change anything beyond this point. + + private int read_callback(object socket, string info){ + // string str, *strs; + string a,b; int done=0; + if(!sizeof(info)) return 0; + //Debug(save_variable(info),DEB_IN); + #ifdef DATA_LOG + log_file(DATA_LOG,"SERVER: "+save_variable(info)+"\n"); + #endif + buf += info; + // The hub groups packets, unfortunately. + switch(mode){ + case MODE_WAITING_ACCEPT: // waiting for Hub to send autosetup + if(sscanf(info, "autosetup %s accept %s\n\r", + hub_name, network_name)==2){ + //Debug("Connected, hub is "+hub_name+", network is "+network_name); + mode = MODE_CONNECTED; + send_is_alive("*"); + send_keepalive_request(); + send_ice_refresh(); + } + else if(sscanf(info, "PW %s %s version=%d %s\n", + hub_name, server_pass, server_version, network_name)==4){ + mode = MODE_CONNECTED; + send_is_alive("*"); + send_keepalive_request(); + send_ice_refresh(); + } + else{ // Failed login sends plaintext error message. + //Debug("Failed to connect... "+info); + } + buf=""; // clear buffer + break; + case MODE_CONNECTED: + while(!done){ + if(sscanf(buf,"%s\n\r%s",a,b)==2){ // found a break... + got_packet(a); + buf=b; + } + else{ // no break... + done = 1; + } + } + /* + strs = explode(info,"\n\r"); + foreach(str in strs){ + got_packet(str); + } + buf=""; + */ + break; + } + return 1; + } + + private void got_packet(string info){ + string str; + string a,b; + int i; + string sender, origin, route, packet_type, target, destination, strdata; + int sequence; + mapping data; + object who; + if(!sizeof(info)) return; + //Debug(save_variable(info),DEB_PAK); + + str = info; + // messages end with " \n\r" or "\n" or sometimes just a space + sscanf(str, "%s\n^", str); + sscanf(str, "%s\r^", str); + sscanf(str, "%s ^", str); + sscanf(str, "%s ^", str); + if(sscanf(str, "%s %d %s %s %s %s", + a, sequence, route, packet_type, + b, strdata)==6){ // matches + if(sscanf(b,"%s@%s",target,destination)!=2){ + // Could be MUD instead of Name@MUD or *@MUD + target="*"; destination=b; + } + if(sscanf(a,"%s@%s",sender,origin)!=2){ + sender="*"; origin=a; + } + data = string_to_mapping(strdata); + // Debug("sender="+sender); + // Debug("origin="+origin); + // Debug("sequence="+sequence); + // Debug("route="+route); + // Debug("packet_type="+packet_type); + // Debug("data="+save_variable(data)); + if(!mudinfo[origin]) mudinfo[origin] = ([ ]); + + switch(packet_type){ + case "is-alive": // For making a MUD list. + if(!mudinfo[origin]) mudinfo[origin] = ([ ]); + // example of info: + // versionid=\"IMC2 AntiFreeze CL-2 SWR 1.0\" url=none md5=1 + //mudinfo[origin]["version"]="blah"; + mudinfo[origin]+=data; + mudinfo[origin]["online"]=1; + //Debug("handled is-alive for mud "+origin); + break; + case "close-notify": // Someone disconnected. + if(!mudinfo[data["host"]]) mudinfo[data["host"]] = ([]); + mudinfo[data["host"]]["online"]=0; + break; + case "keepalive-request": // Request for is-alive. + send_is_alive(origin); + break; + case "ice-msg-b": // Broadcast channel message. + channel_in(sender, origin, data); + break; + case "tell": // Tells or emotes. + tell_in(sender, origin, target, data); + break; + case "who-reply": + who_reply_in(origin,target,data); + break; + case "whois": // Like I3's locate + whois_in(sender,origin,target,data); + break; + case "whois-reply": + whois_reply_in(target,sender,origin,data); + break; + case "beep": + beep_in(sender, origin, target, data); + break; + case "ice-update": // Reply from ice-refresh. + chaninfo[data["channel"]]=data; + break; + case "wHo": // Drop-through + case "who": + send_packet("*","who-reply",sender,origin, + "text="+escape(pinkfish_to_imc2(WHO_STR))); + break; + case "ice-destroy": // Deleting channel. + map_delete(chaninfo,data["channel"]); + break; + case "user-cache": // User info, like I3's ucache service. + if(!genders[origin]) genders[origin]=([ ]); + genders[origin][sender]=data["gender"]; + break; + case "user-cache-reply": // Reply with user info + if(!genders[origin]) genders[origin]=([ ]); + genders[origin][data["user"]]=data["gender"]; + break; + case "user-cache-request": // Request for user info + sscanf(data["user"],"%s@%*s",str); + who = FIND_PLAYER(lower_case(str)); + if(who + #ifdef INVIS + && !INVIS(who) + #endif + ){ + switch(GET_GENDER(who)){ + case "male" : i=0; break; + case "female" : i=1; break; + default : i=2; break; + } + send_packet("*","user-cache-reply",sender, + origin,sprintf("gender=%d",i)); + } + break; + case "ping": + send_packet("*","ping-reply",sender,origin, + sprintf("path=\"%s\"",route)); + break; + case "ping-reply": + ping_reply_in(sender,origin,target,data); + break; + case "ice-msg-r": // Relayed channel message. + channel_in(sender, origin, data); + break; + case "ice-chan-whoreply": // Tell who's listening to a channel. + chanwho_reply_in(origin,target,data); + break; + case "emote": // Channel creation/destruction message... anything else? + IMC2_MSG(NETWORK_ID+" announces: "+data["text"]+"\n", + filter_array(users(), (: ADMIN($1) :))); + #ifdef ANNOUNCE_LOG + log_file(ANNOUNCE_LOG,ctime(time())+": "+data["text"]+"\n"); + #endif + break; + case "ice-chan-who": // Check who's listening to a channel. + chan_who_in(sender,origin,data); + break; + case "channel-notify": + // Don't care about this. Useful only if you care when + // people on other MUDs start/stop listening to a channel. + // example: Someone@SomeMUD 1087076772 SomeMUD channel-notify *@* channel=Hub01:ichat status=0 + break; + // The following packets shouldn't be incoming. + case "ice-cmd": // Remote channel administration + case "remote-admin": // For controlling the hub + case "ice-refresh": // Request data about channels + case "ice-msg-p": // Private channel message + //Debug("This packet isn't supposed to be incoming: "+packet_type); + break; + default: + #ifdef UNKNOWN_DATA_LOG + log_file(UNKNOWN_DATA_LOG,"Unknown packet: "+escape(info)+"\n\n"); + #endif + //Debug("Unlisted packet type: "+packet_type); + break; + } + } + else{ + buf += info; + //Debug("Doesn't match incoming pattern, so putting on buffer: "+str); + #ifdef BAD_PACKET + log_file(BAD_PACKET,"Doesn't match incoming pattern: "+str+"\n"); + #endif + } + } + + private int close_callback(object socket){ + // Connection was closed. + #ifdef DATA_LOG + log_file(DATA_LOG,"DISCONNECTED\n"); + #endif + socket_close(socket_num); + // socket->remove(); + create(); + return 1; + } + + private void send_text(string text){ + // Send a literal string. + // Almost everything should use the send_packet function instead of this. + #ifdef DATA_LOG + log_file(DATA_LOG,"CLIENT: "+save_variable(text)+"\n"); + #endif + //Debug(save_variable(text), DEB_OUT); + // Debug("writing to socket: "+socket_num); + socket_write(socket_num,text); + // imc2_socket->send(text); + return; + } + + void create(){ + #ifndef NO_UIDS + seteuid(getuid()); + #endif + #ifdef DATA_LOG + log_file(DATA_LOG,"Creating IMC2 object at "+ctime(time())+".\n"); + #endif + if(sizeof(get_dir(SAVE_FILE+".o"))) restore_object(SAVE_FILE); + if(!mudinfo) mudinfo = ([ ]); + if(!chaninfo) chaninfo = ([ ]); + if(!localchaninfo) localchaninfo = ([ ]); + if(!genders) genders = ([ ]); + if(!tells) tells=([ ]); + ping_requests=([ ]); + mode = MODE_WAITING_ACCEPT; + #ifdef HOSTIP + // We already know the IP, go straight to the connecting, just do callback as if it found the IP. + resolve_callback(HOSTIP,HOSTIP,1); + #else + if(!resolve(HOSTNAME, "resolve_callback")){ + //Debug("Addr_server is not running, resolve failed."); + #ifdef DATA_LOG + log_file(DATA_LOG,"Addr_server is not running, resolve failed.\n"); + #endif + remove(); + return; + } + #endif + //Debug("creating IMC2 object"); + } + + void remove(){ + // This object is getting destructed. + if(!socket_num) socket_close(socket_num); + // if(imc2_socket) imc2_socket->remove(); + #ifdef DATA_LOG + log_file(DATA_LOG,"IMC2 OBJECT REMOVED\n"); + #endif + save_object(SAVE_FILE); + destruct(this_object()); + } + + private void resolve_callback( string address, string resolved, int key ) { + // Figured out what the IP is for the address. + int error; + //Debug("Resolved to: "+resolved); + write_file("/tmp/imc2.log","address: "+address); + write_file("/tmp/imc2.log","resolved: "+resolved); + write_file("/tmp/imc2.log","key: "+key); + + //socket_num = socket_create(STREAM, "close_callback"); + socket_num = socket_create(STREAM, "read_callback", "close_callback"); + if (socket_num < 0) { + #ifdef DATA_LOG + log_file(DATA_LOG,"socket_create: " + socket_error(socket_num) + "\n"); + #endif + tc("socket_create: " + socket_error(socket_num) + "\n"); + return; + } + //Debug("Created socket descriptor " + socket_num); + + error = socket_connect(socket_num, resolved+" "+HOSTPORT, "read_callback", "write_callback"); + if (error != EESUCCESS) { + #ifdef DATA_LOG + log_file(DATA_LOG,"socket_connect: " + socket_error(error) + "\n"); + #endif + //Debug("socket_connect, error="+error+": " + socket_error(error) + "\n"); + socket_close(socket_num); + return; + } + } + + private void write_callback(){ + start_logon(); + } + + private void start_logon(){ + //Debug("Gonna try logging in, sending the PW thing..."); + #if NOT_AUTO + send_text(sprintf("PW %s %s version=%d\n", + #else + send_text(sprintf("PW %s %s version=%d autosetup %s\n", + #endif + MUDNAME, + CLIENT_PW, 2 + #ifndef NOT_AUTO + , SERVER_PW + #endif + )); + buf=""; + /* For invitation-only networks. + send_text(sprintf("PW %s %s version=%d %s\n", + MUDNAME, + CLIENT_PW, 2, "hub03" + )); + */ + sequence=time(); + } + + string escape(string str){ + str=replace_string(str,"\\","\\\\"); + str=replace_string(str,"\"","\\\""); + str=replace_string(str,"\n","\\n"); + str=replace_string(str,"\r","\\r"); + if(sizeof(explode(str," "))!=1) str = "\""+str+"\""; + return str; + } + + string unescape(string str){ + string a,b=str,output=""; + while(sscanf(b,"%s\\%s",a,b)==2){ + output += a; + if(sizeof(b)){ + switch(b[0]){ + case 34 : output += "\""; break; // '\"' makes warnings. + case '\\' : output += "\\"; break; + case 'n' : output += "\n"; break; + case 'r' : output += "\r"; break; + } + } + b=b[1..]; + } + output += b; + output = replace_string(output,"\n\r","\n"); + if((sizeof(explode(output," "))==1) && sscanf(output,"\\\"%*s\\\"") ) output = "\""+output+"\""; + return output; + } + + mapping string_to_mapping(string str){ + // Picks first element off of string and then repeats? + mapping out=([]); + int in_quote=0; + int i, j; + string what,data,rest; + + rest = str; + + while(sizeof(rest)>0){ + sscanf(rest, "%s=%s", what, rest); + /* + write("what="+what+", rest="+rest+"\n"); + */ + // At this point, what is the key, rest is value plus rest. + if(rest[0]==34){ // value is in quotes, tons of fun! + // find first quote without a backslash in front? + /* + write("rest begings with a quote\n"); + */ + i = 1; + while(((rest[i]!=34) || (rest[i-1]==92)) && (i<sizeof(rest))){ // 34 = ", 92 = \ + // While this is not a quote, or if this is an escaped quote, keep looking. + i++; + } + // now are 1 space past quote + // write("i="+i+"\n"); + data=rest[1..(i-1)]; // skip opening and closing quotes + rest=rest[(i+2)..]; // skip past space + // write("new data="+data+"\n"); + // write("new rest="+rest+"\n"); + // Data is now what was in the quotes... now to un-escape the data... + out[what]=unescape(data); + } + else{ // value is not in quotes, tons of actual non-sarcastic fun! + // just split it at the first space + if(sscanf(rest,"%s %s",data,rest)!=2){ // break at first space + data = rest; + rest = ""; + } + if((sscanf(data,"%d",i)==1) && (sprintf("%d",i)==data)) // is just number + out[what]=i; + else // not just a number + out[what]=data; + } + } + return out; + } + + private void send_packet(string sender, string packet_type, string target, string destination, string data){ + // Sends a packet in the format that IMC2 uses. + sequence++; + send_text(sprintf("%s@%s %d %s %s %s@%s %s\n", + sender, MUDNAME, sequence, MUDNAME, packet_type, + target, destination, data + )); + } + + void send_keepalive_request(){ + // Ask all the muds to tell us that they're alive. + string mud; + // Mark all the muds as offline until they respond. + foreach(mud in keys(mudinfo)){ + mudinfo[mud]["online"]=0; + } + send_packet("*","keepalive-request","*","*",""); + } + + varargs void send_is_alive(string origin){ + // Sends an is-alive packet to whoever requested it, or else broadcasts it. + send_packet("*","is-alive","*",(origin ? origin : "*"), + sprintf("versionid=\"%s\" networkname=%s url=%s", + VERSION, network_name, URL)); + } + + private int chan_listening(object user, string chan){ + // Tells if a user is listening to a channel or not. + if(!localchaninfo[chan]) return 0; + if(member_array(GET_NAME(user),localchaninfo[chan]["users"])==-1) return 0; + return chan_perm_allowed(user,chan); + } + + void channel_in(string fromname, string frommud, mapping data){ + // Handles an incoming channel message. + object user, *usrs; + string msg,blmsg; + string sender; + string local; + int emote=0; + int sz; + + /* + tell_object(find_player("tim"),("data="+identify(data)+"\n")); + */ + + sender=fromname+"@"+frommud; + if(data["sender"]) sender=data["sender"]; + if(data["realfrom"]) sender=data["realfrom"]; + if(intp(data["text"])) data["text"]=sprintf("%d",data["text"]); + // the data processing function makes "1" into a number, + // which can be a problem when a person says just a number on a channel :P + local=localize_channel(data["channel"]); + if(data["emote"]) emote=data["emote"]; + #ifdef CHANNEL_BOT + // Can define CHANNEL_BOT to something with got_chan(channel,from,text,emote) + // It will be given all channel messages. Be aware of this. + call_other(CHANNEL_BOT,"got_chan",data["channel"],sender,data["text"],emote); + #endif + #ifdef CHANNEL_BOTS + if(CHANNEL_BOTS[local]){ + call_other(CHANNEL_BOTS[local],"got_chan",local,sender,data["text"],emote); + } + else if(CHANNEL_BOTS[data["channel"]]){ + call_other(CHANNEL_BOTS[data["channel"]],"got_chan",data["channel"],sender,data["text"],emote); + } + #endif + if(!local) return; // Channel not used locally, ignore. + usrs = ({ }); + data["text"]=imc2_to_pinkfish(data["text"]); + foreach(user in users()) + if(chan_listening(user,local)) usrs += ({ user }); + if(emote==2){ + msg=sprintf("%s- [%%^GREEN%%^%s%%^RESET%%^] %%^CYAN%%^(from %s)%%^RESET%%^ %s", + NETWORK_ID,local,sender,data["text"]); + blmsg=sprintf("%s- [%s] (from %s) %s", + NETWORK_ID,local,sender,data["text"]); + } + else if(emote){ + msg=sprintf("%s- [%%^GREEN%%^%s%%^RESET%%^] %%^CYAN%%^%s%%^RESET%%^ %s", + NETWORK_ID,local,sender,data["text"]); + blmsg=sprintf("%s- [%s] %s %s", + NETWORK_ID,local,sender,data["text"]); + } + else{ + msg=sprintf("%s- %%^CYAN%%^%s%%^RESET%%^ [%%^GREEN%%^%s%%^RESET%%^]: %s", + NETWORK_ID, sender,local,data["text"]); + blmsg=sprintf("%s- %s [%s]: %s", + NETWORK_ID, sender,local,data["text"]); + } + IMC2_MSG(msg+"\n",usrs); + localchaninfo[local]["backlog"] += ({ ctime(time())[4..18]+" "+blmsg }); + sz = sizeof(localchaninfo[local]["backlog"]); + if(sz>BACKLOG_SIZE) + localchaninfo[local]["backlog"]=localchaninfo[local]["backlog"][(sz-BACKLOG_SIZE)..sz]; + } + + private void channel_out(object user,string chan,string msg){ + // Send outgoing channel message. + send_packet(GET_CAP_NAME(user),"ice-msg-b","*","*", + sprintf("channel=%s text=%s emote=0 echo=1", + chan,escape(GET_CAP_NAME(user)+"@"+MUDNAME+" "+msg))); + } + + private varargs void tell_out(object from, string targname, string targmud, string msg, int reply, int emote){ + // Send outgoing tell. + if(!reply) reply=0; + send_packet(GET_CAP_NAME(from),"tell",targname,targmud, + sprintf("level=%d text=%s reply=%d emote=%d", level(from),escape(msg),reply,emote)); + } + + private void tell_in(string sender, string origin, string target, mapping data){ + // Incoming tell. + object who; + int sz; + string blmsg; + who=FIND_PLAYER(lower_case(target)); + target=GET_CAP_NAME(who); + data["text"]=imc2_to_pinkfish(data["text"]); + if(who + #ifdef INVIS + && VISIBLE(who) + #endif + && can_use(who) + ){ + switch(data["isreply"]){ + case 2: // emote + IMC2_MSG(sprintf("%s tell: %%^CYAN%%^%s@%s%%^RESET%%^ %s\n", + NETWORK_ID,sender,origin,data["text"]), who); + blmsg=sprintf("%s tell: %s@%s %s\n", + NETWORK_ID,sender,origin,data["text"]); + break; + case 1: // reply + IMC2_MSG(sprintf("%s %%^CYAN%%^%s@%s%%^RESET%%^ replies to you: %s\n", + NETWORK_ID,sender,origin,data["text"]), who); + blmsg=sprintf("%s %s@%s replied to you: %s\n", + NETWORK_ID,sender,origin,data["text"]); + break; + default: + IMC2_MSG(sprintf("%s %%^CYAN%%^%s@%s%%^RESET%%^ tells you: %s\n", + NETWORK_ID,sender,origin,data["text"]), who); + blmsg=sprintf("%s %s@%s told you: %s\n", + NETWORK_ID,sender,origin,data["text"]); + break; + } + if(!tells[target]) + tells[target]=([ ]); + tells[target]["reply"] = sprintf("%s@%s",sender,origin); + if(!tells[target]["backlog"] || !arrayp(tells[target]["backlog"])) + tells[target]["backlog"]=({ }); + tells[target]["backlog"] += ({ blmsg }); + sz = sizeof(tells[target]["backlog"]); + if(sz>BACKLOG_SIZE) + tells[target]["backlog"]=tells[target]["backlog"][(sz-BACKLOG_SIZE)..sz]; + } + else{ + #ifdef TELL_BOTS + // Can have a mapping of bots which can get tells. + if(TELL_BOTS[target]){ + call_other(TELL_BOTS[target],"got_tell",sender, origin, target, data["text"]); + return; + } + #endif + #ifdef TELL_BOT + // They should have got_tell(fromname, frommud, target, text) + // I'll assume bots don't care about emote/reply... tell me if you do? + // TELL_BOT will get told of all tells which don't have a valid target, and + // then the sender will be notified that it didn't get to anyone. + // This would be useful if for example you wanted all tells sent to + // offline people to be mudmailed to them or something. + call_other(TELL_BOTS[target],"got_tell",sender, origin, target, data["text"]); + #endif + send_packet("*","tell",sender,origin, + sprintf("level=-1 text=\"%s is not online on this mud.\" isreply=1",target)); + } + } + + string pinkfish_to_imc2(string str){ + // Foreground + str=replace_string(str,"%^BLACK%^","~x"); // Black + str=replace_string(str,"%^RED%^","~R"); // Red + str=replace_string(str,"%^GREEN%^","~G"); // Green + str=replace_string(str,"%^BLUE%^","~B"); // Blue + str=replace_string(str,"%^WHITE%^","~W"); // White + str=replace_string(str,"%^ORANGE%^","~y"); // Orange + str=replace_string(str,"%^CYAN%^","~c"); // Cyan + str=replace_string(str,"%^YELLOW%^","~Y"); // Yellow + str=replace_string(str,"%^MAGENTA%^","~p"); // Magenta -> purple sounds closest + str=replace_string(str,"%^GRAY%^","~w"); // Gray doesn't display on my MUD, bah :( + // Background + str=replace_string(str,"%^B_BLACK%^","^x"); + str=replace_string(str,"%^B_RED%^","^R"); // Red + str=replace_string(str,"%^B_GREEN%^","^G"); // Green + str=replace_string(str,"%^B_BLUE%^","^b"); // Blue + str=replace_string(str,"%^B_WHITE%^","^W"); // White + str=replace_string(str,"%^B_ORANGE%^","^O"); // Orange + str=replace_string(str,"%^B_CYAN%^","^c"); // Cyan + str=replace_string(str,"%^B_YELLOW%^","^Y"); // Yellow + str=replace_string(str,"%^B_MAGENTA%^","^p"); // Magenta -> purple sounds closest + // Misc. + str=replace_string(str,"%^FLASH%^","~$"); // Flash -> Blink + str=replace_string(str,"%^BOLD%^","~L"); // Bold + str=replace_string(str,"%^RESET%^","~!"); + return str; + } + + string imc2_to_pinkfish(string str){ + string output=""; + int i,sz; + /* + For colors explanation, refer to IMC Packet Documentation by Xorith. + Thanks very much for putting that out, by the way. :) + Found at http://hub00.muddomain.com/imc2_protocol_doc.txt + */ + sz=sizeof(str)-1; + while(sizeof(str)>1){ + switch(str[0]){ + case '~': // Foreground + switch(str[1]){ + case 'Z': break; // Random + case 'x': output += "%^BLACK%^"; break; // Black + case 'r': output += "%^RED%^"; break; // Dark Red + case 'g': output += "%^GREEN%^"; break; // Dark Green + case 'y': output += "%^ORANGE%^"; break; // Orange + case 'b': output += "%^BLUE%^"; break; // Dark Blue + case 'p': output += "%^MAGENTA%^"; break; // Purple + case 'c': output += "%^CYAN%^"; break; // Cyan + case 'w': output += "%^WHITE%^"; break; // Grey + case 'D': output += "%^BLACK%^"; break; // Dark Grey + case 'z': output += "%^BLACK%^"; break; // Same as ~D + case 'R': output += "%^RED%^"; break; // Red + case 'G': output += "%^GREEN%^"; break; // Green + case 'Y': output += "%^YELLOW%^"; break; // Yellow + case 'B': output += "%^BLUE%^"; break; // Blue + case 'P': output += "%^MAGENTA%^"; break; // Pink + case 'C': output += "%^BLUE%^"; break; // Light Blue + case 'W': output += "%^WHITE%^"; break; // White + + case 'm': output += "%^MAGENTA%^"; break; // same as p + case 'd': output += "%^WHITE%^"; break; // same as w + case 'M': output += "%^MAGENTA%^"; break; // same as P + // Misc. + case '!': output += "%^RESET%^"; break; // Reset + case 'L': output += "%^BOLD%^"; break; // Bold + case 'u': break; // Underline + case '$': output += "%^FLASH%^"; break; // Blink + case 'i': break; // Italic + case 'v': break; // Reverse + case 's': break; // Strike-thru + + case '~': output += "~"; break; // ~~ prints as ~ + default : output += "~"; // Don't skip over this + // (cheap hack is to add a character in front so the [2..] thing still works) + str = " "+str; + break; + } + str=str[2..]; + break; + case '^': // Background + switch(str[1]){ + case 'Z': break; // Random + case 'x': output += "%^B_BLACK%^"; break; // Black + case 'r': output += "%^B_RED%^"; break; // Dark Red + case 'g': output += "%^B_GREEN%^"; break; // Dark Green + case 'O': output += "%^B_ORANGE%^"; break; // Orange + case 'B': output += "%^B_BLUE%^"; break; // Dark Blue + case 'p': output += "%^B_MAGENTA%^"; break; // Purple + case 'c': output += "%^B_CYAN%^"; break; // Cyan + case 'w': output += "%^B_WHITE%^"; break; // Grey + case 'z': output += "%^B_BLACK%^"; break; // Dark Grey + case 'R': output += "%^B_RED%^"; break; // Red + case 'G': output += "%^B_GREEN%^"; break; // Green + case 'Y': output += "%^B_YELLOW%^"; break; // Yellow + case 'b': output += "%^B_BLUE%^"; break; // Blue + case 'P': output += "%^B_MAGENTA%^"; break; // Pink + case 'C': output += "%^B_BLUE%^"; break; // Light Blue + case 'W': output += "%^B_WHITE%^"; break; // White + case '^': output += "^"; break; // ^^ prints as ^ + default : output += "^"; // Don't skip over this + // (cheap hack is to add a character in front so the [2..] thing still works) + str = " "+str; + break; + } + str=str[2..]; + break; + case '`': // Blinking Foreground + switch(str[1]){ + case 'Z': output += "%^FLASH%^"; break; // Random + case 'x': output += "%^FLASH%^%^BLACK%^"; break; // Black + case 'r': output += "%^FLASH%^%^RED%^"; break; // Dark Red + case 'g': output += "%^FLASH%^%^GREEN%^"; break; // Dark Green + case 'O': output += "%^FLASH%^%^ORANGE%^"; break; // Orange + case 'b': output += "%^FLASH%^%^BLUE%^"; break; // Dark Blue + case 'p': output += "%^FLASH%^%^MAGENTA%^"; break; // Purple + case 'c': output += "%^FLASH%^%^CYAN%^"; break; // Cyan + case 'w': output += "%^FLASH%^%^WHITE%^"; break; // Grey + case 'z': output += "%^FLASH%^%^BLACK%^"; break; // Dark Grey + case 'R': output += "%^FLASH%^%^RED%^"; break; // Red + case 'G': output += "%^FLASH%^%^GREEN%^"; break; // Green + case 'Y': output += "%^FLASH%^%^YELLOW%^"; break; // Yellow + case 'B': output += "%^FLASH%^%^BLUE%^"; break; // Blue + case 'P': output += "%^FLASH%^%^MAGENTA%^"; break; // Pink + case 'C': output += "%^FLASH%^%^BLUE%^"; break; // Light Blue + case 'W': output += "%^FLASH%^%^WHITE%^"; break; // White + case '`': output += "`"; break; // `` prints as ` + default : output += "`"; // Don't skip over this + // (cheap hack is to add a character in front so the [2..] thing still works) + str = " "+str; + break; + } + str=str[2..]; + break; + default: + output += str[0..0]; + str=str[1..]; + break; + } + } + output += str; + return output; + } + + private void who_reply_in(string origin, string target, mapping data){ + string output; + object targuser; + targuser = FIND_PLAYER(lower_case(target)); + if(targuser){ + output = NETWORK_ID+" who reply from: %^CYAN%^"+origin+"%^RESET%^\n"; + output += imc2_to_pinkfish(data["text"])+"\n"; + IMC2_MSG(output,targuser); + } + } + + private void whois_in(string fromname, string frommud, string targ, mapping data){ + if(FIND_PLAYER(lower_case(targ)) + #ifdef INVIS + && !INVIS(FIND_PLAYER(lower_case(targ))) + #endif + && can_use(FIND_PLAYER(lower_case(targ))) + ){ + send_packet(targ,"whois-reply",fromname,frommud,"text=Online"); + } + #ifdef USER_EXISTS + else if(USER_EXISTS(lower_case(targ))){ + send_packet(targ,"whois-reply",fromname,frommud, + "text=\"Exists but is offline\""); + } + #endif + } + + private void whois_reply_in(string targ,string fromname,string frommud,mapping data){ + object who; + who=FIND_PLAYER(lower_case(targ)); + if(who){ + IMC2_MSG(sprintf("%s whois reply: %s@%s: %s\n", + NETWORK_ID,fromname,frommud,data["text"]),who); + } + } + + private void beep_in(string sender, string origin, string target, mapping data){ + object who; + who=FIND_PLAYER(lower_case(target)); + if(who && can_use(who) + #ifdef INVIS + && VISIBLE(who) + #endif + ){ + IMC2_MSG(sprintf("%s- %%^CYAN%%^%s@%s%%^RESET%%^ \abeeps you.\n", + NETWORK_ID,sender,origin,data["text"]), who); + } + else{ + send_packet("*","tell",sender,origin, + sprintf("level=-1 text=\"%s is not online.\" isreply=1",target)); + } + } + + private void beep_out(object from, string targname, string targmud){ + send_packet(GET_CAP_NAME(from),"beep",targname,targmud, + sprintf("level=%d ", level(from))); + } + + private void send_ice_refresh(){ send_packet("*","ice-refresh","*","*",""); } + + private void ping_reply_in(string sender,string origin,string target,mapping data){ + object who; + if((target=="*") && target=ping_requests[sender]){ + target=ping_requests[sender]; + map_delete(ping_requests,sender); + } + who=FIND_PLAYER(lower_case(target)); + if(who){ + IMC2_MSG(sprintf("%s route to %%^CYAN%%^%s%%^RESET%%^ is: %s\n", + NETWORK_ID,origin,data["path"]), who); + } + } + + private void ping_out(string from,string targmud){ send_packet(from,"ping","*",targmud,""); } + private varargs void who_out(string from,string targmud,string type){ send_packet(from,"who","*",targmud,(type ? sprintf("type=\"%s\"",type) : "type=who")); } + + private void chanwho_out(object from,string chan,string mud){ + send_packet(GET_CAP_NAME(from),"ice-chan-who","*",mud, + sprintf("level=%d channel=%s lname=%s",level(from), + localchaninfo[chan]["name"],chan)); + } + + private void chanwho_reply_in(string origin, string target, mapping data){ + string output; + object targuser; + targuser = FIND_PLAYER(lower_case(target)); + if(targuser){ + output = NETWORK_ID+" chanwho reply from "+origin+" for "+data["channel"]+"\n"; + output += imc2_to_pinkfish(data["list"]); + IMC2_MSG(output,targuser); + } + } + + private void chan_who_in(string fromname, string frommud, mapping data){ + // Handles an incoming channel who request. + object user, *usrs=({ }); + string local, lname; + string output; + local=localize_channel(data["channel"]); + if(data["lname"]) lname = data["lname"]; + else lname = local; + if(!local){ // Channel not used locally. + output = sprintf("channel=%s list=\"%s (%s) is not configured on this MUD.\n\"", + data["channel"],lname,data["channel"]); + } + else{ // Is used locally + output = "The following users are listening to "+lname+" ("+local+"):\n "; + foreach(user in users()){ + if(chan_listening(user,local) + #ifdef INVIS + && !INVIS(user) + #endif + ){ + usrs += ({ GET_CAP_NAME(user) }); + } + } // foreach + output += implode(usrs,", "); + output += "\n"; + if(!sizeof(usrs)){ + output=sprintf("channel=%s list=\"Nobody is listening to %s (%s) on this MUD.\n\"", + lname,local); + } + } + send_packet("*","ice-chan-whoreply",fromname,frommud,output); + } + + string find_mud(string str){ + // Makes case-insensitive mud name into the actual mud name, or else 0. + string mud; + if(!str) return 0; + str=lower_case(str); + foreach(mud in keys(mudinfo)){ + if(lower_case(mud)==str) return mud; + } + return 0; + } + + string localize_channel(string str){ + // Tells what the local name for a channel is, given the network name for it, or else 0. + string a; + foreach(a in keys(localchaninfo)){ + if(lower_case(localchaninfo[a]["name"])==lower_case(str)) return a; + } + return 0; + } + + int command(string str){ + // Takes the arguments given to the command which does IMC2 stuff. + string cmd, args; + string mud, *muds; + string output; + string a,b,c; + int x,y,z; + int emote,reply; + object usr, *usrs=({ }); + if(!str) str = "help"; + sscanf(str,"%s %s",cmd,args); + if(!cmd) cmd=str; + if(!args) args = ""; + switch(cmd){ + case "list": + muds = sort_array(keys(mudinfo),1); + if (!sizeof(mudinfo)){ + return notify_fail("There are no muds on the "+NETWORK_ID+" network!\n"); + } + else{ + x=0; y=0; + output=sprintf("[%s] %-20s %-20s %-20s\n","U/D?","Name","Network","IMC2 Version"); + foreach (mud in muds){ + if(!mudinfo[mud]) output += "Error on mud: "+mud+"\n"; + else{ + if(mudinfo[mud]["online"]) + x++; else y++; + output += sprintf("[%s] %-20s %-20s %-20s\n", + (mudinfo[mud]["online"] ? "%^GREEN%^ UP %^RESET%^" : "%^RED%^DOWN%^RESET%^"), + mud, + mudinfo[mud]["networkname"], + mudinfo[mud]["versionid"]); + } + } + output += sprintf("%d of %d MUDs are online.\n",x,x+y); + IMC2_MSG(output,THIS_PLAYER); + return 1; + } + break; + case "setup": + output=sprintf(@EndText + IMC2 NETWORK INFORMATION + ------------------------ + Status: %s + Hub address: %s + Hub port: %d + The hub calls itself: %s + The network calls itself: %s + Command to use this network: %s + The MUD calls this connection: %s + + Packet logging: %s + + The network calls the MUD: %s + The MUD's Version ID: %s + The MUD's URL: %s + EndText, + ((mode==MODE_CONNECTED) ? "Connected" : "Not connected"), + #ifdef HOSTNAME + HOSTNAME, + #else + HOSTIP, + #endif + HOSTPORT,hub_name,network_name,COMMAND_NAME,NETWORK_ID, + #ifdef DATA_LOG + "on", + #else + "off", + #endif + MUDNAME,VERSION,URL); + IMC2_MSG(output,THIS_PLAYER); + return 1; + break; + case "info": + if(!args) return notify_fail("See info for which MUD?\n"); + str=find_mud(args); + if(!str) return notify_fail("MUD isn't known on "+NETWORK_ID+".\n"); + output=("Mud info for: "+str+"\nStatus: "); + if(mudinfo[str]["online"]) + output+=("%^GREEN%^Online%^RESET%^\n"); + else + output+=("%^RED%^Offline%^RESET%^\n"); + if(mudinfo[str]["versionid"]) output+=("Version ID: "+mudinfo[str]["versionid"]+"\n"); + if(mudinfo[str]["url"]) output+=("URL: "+mudinfo[str]["url"]+"\n"); + if(mudinfo[str]["networkname"]) output+=("Network name: "+mudinfo[str]["networkname"]+"\n"); + IMC2_MSG(output,THIS_PLAYER); + return 1; + break; + case "ping": + if(!args) return notify_fail("Send ping to which MUD?\n"); + str=find_mud(args); + if(!str) return notify_fail("MUD isn't known on "+NETWORK_ID+".\n"); + if(!mudinfo[str]["online"]) return notify_fail(NETWORK_ID+"- "+b+" is offline right now.\n"); + ping_out(GET_CAP_NAME(THIS_PLAYER),str); + IMC2_MSG(NETWORK_ID+"- Sent a ping to "+str+"\n",THIS_PLAYER); + return 1; + break; + case "who": + if(!args) return notify_fail("Send who request to which MUD?\n"); + str=find_mud(args); + if(!str) return notify_fail("MUD isn't known on "+NETWORK_ID+".\n"); + if(!mudinfo[str]["online"]) return notify_fail(NETWORK_ID+"- "+str+" is offline right now.\n"); + who_out(GET_CAP_NAME(THIS_PLAYER),str); + IMC2_MSG(NETWORK_ID"- Sent a who request to "+str+"\n",THIS_PLAYER); + return 1; + break; + case "finger": + notify_fail("Send finger request to who@where?\n"); + if(!args) return 0; + if(sscanf(args,"%s@%s",a,b)!=2){ + return 0; + } + b=find_mud(b); + who_out(GET_CAP_NAME(THIS_PLAYER),b,"finger "+a); + IMC2_MSG(NETWORK_ID"- Sent a finger request to "+a+"@"+b+"\n",THIS_PLAYER); + return 1; + break; + case "mudinfo": + if(!args) return notify_fail("Send info request to which MUD?\n"); + str=find_mud(args); + if(!str) return notify_fail("MUD isn't known on "+NETWORK_ID+".\n"); + if(!mudinfo[str]["online"]) return notify_fail(NETWORK_ID+"- "+str+" is offline right now.\n"); + who_out(GET_CAP_NAME(THIS_PLAYER),str,"info"); + IMC2_MSG(NETWORK_ID"- Sent an info request to "+str+"\n",THIS_PLAYER); + return 1; + break; + case "chanwho": + if(!args) return notify_fail("What channel?\n"); + if(sscanf(args,"%s %s",a,b)!=2){ + a=args; + b=""; + } + else { + if(b!="*") b=find_mud(b); + } + if(!b) return notify_fail("MUD isn't known on "+NETWORK_ID+".\n"); + if(!localchaninfo[a]) return notify_fail("Invalid channel.\n"); + if(b==""){ // check who's on locally + c = "The following users are listening to "+a+":\n "; + foreach(usr in users()) + if(chan_listening(usr,a)){ + usrs += ({ usr }); + c += " "+GET_CAP_NAME(usr); + } + c += "\n"; + if(!usrs) c="Nobody on this mud is listening to that channel.\n"; + IMC2_MSG(c,THIS_PLAYER); + return 1; + } + if((b!="*") && (!mudinfo[b]["online"])) + return notify_fail(NETWORK_ID+"- "+b+" is offline right now.\n"); + chanwho_out(THIS_PLAYER,a,b); + IMC2_MSG(sprintf("%s- Sent a channel who request to %s for the %s channel.\n", + NETWORK_ID,b,a),THIS_PLAYER); + return 1; + break; + case "chans": + output="Local setup for "+NETWORK_ID+" channels:\n"; + output += sprintf("%-15s %-15s %-15s %-15s\n", + "Local Name","Allowed (you?)","Listening","Network Name"); + foreach(a in sort_array(keys(localchaninfo),1)){ + output += sprintf("%-15s %s%-15s%%^RESET%%^ %s%-15s%%^RESET%%^ %-15s\n", + a, + ((chan_perm_allowed(THIS_PLAYER,a) ? "%^GREEN%^" : "%^RED%^")), + chan_perm_desc(localchaninfo[a]["perm"])+" "+ + ((chan_perm_allowed(THIS_PLAYER,a) ? "(yes)" : "(no)")), + ((chan_listening(THIS_PLAYER,a) ? "%^GREEN%^" : "%^RED%^")), + ((chan_listening(THIS_PLAYER,a) ? "yes" : "no")), + localchaninfo[a]["name"]); + } + IMC2_MSG(output,THIS_PLAYER); + return 1; + break; + case "allchans": + output=NETWORK_ID+" channels:\n"; + output += sprintf("%-23s %-17s %-7s %-6s %-10s %-10s\n", + "Name","Owner","Policy","Level","Suggested","Local Name"); + foreach(a in sort_array(keys(chaninfo),1)){ + output += sprintf("%-23s %-17s %-7s %-6s %-10s %-10s\n", + a,chaninfo[a]["owner"], + chaninfo[a]["policy"], + chaninfo[a]["level"],chaninfo[a]["localname"], + (localize_channel(a) ? localize_channel(a) : "<none>")); + } + IMC2_MSG(output,THIS_PLAYER); + return 1; + break; + case "beep": + if(!args || sscanf(args,"%s@%s",a,b)!=2) + return notify_fail("Invalid syntax. "+COMMAND_NAME+" beep name@mud\n"); + b=find_mud(b); + if(!b) return notify_fail("MUD isn't known on "+NETWORK_ID+".\n"); + if(!mudinfo[b]["online"]) return notify_fail("That MUD is offline right now\n"); + IMC2_MSG(sprintf("%s- You beep %s@%s\n",NETWORK_ID,a,b),THIS_PLAYER); + beep_out(THIS_PLAYER,a,b); + return 1; + break; + case "chanemote": // Drop through + case "chatemote": // Drop through + case "chansocial": // Drop through + case "chatsocial": // Drop through + case "chat": // Drop through + case "chan": + switch(cmd){ + case "chatemote" : // Drop-through + case "chanemote" : emote=1; break; + case "chatsocial" : // Drop-through + case "chansocial" : emote=2; break; + } + if(!args || (sscanf(args,"%s %s",a,b)!=2)) + return notify_fail("Syntax: "+COMMAND_NAME+" chan channel message\n"); + if(!localchaninfo[a]) return notify_fail(a+" is not a channel.\n"); + if(!chan_perm_allowed(THIS_PLAYER,a)) + return notify_fail("You need permission to use the "+a+" channel.\n"); + if(!chan_listening(THIS_PLAYER,a)) + return notify_fail("You are not listening to the "+a+" channel.\n"); + if(emote==2){ + IMC2_MSG(sprintf("Sent to %s- [%s] %s\n",NETWORK_ID, + a,b),THIS_PLAYER); + } + else if(emote){ + IMC2_MSG(sprintf("Sent to %s- [%s] %s %s\n",NETWORK_ID, + a,GET_CAP_NAME(THIS_PLAYER),b),THIS_PLAYER); + } + else{ + IMC2_MSG(sprintf("Sent to %s- %s [%s] %s\n",NETWORK_ID, + GET_CAP_NAME(THIS_PLAYER),a,b),THIS_PLAYER); + } + send_packet(GET_CAP_NAME(THIS_PLAYER),"ice-msg-b","*","*", + sprintf("channel=%s text=%s emote=%d echo=1", + localchaninfo[a]["name"],escape(pinkfish_to_imc2(b)),emote)); + return 1; + break; + case "reply": // Drop-through + case "replyemote": // Drop-through + case "tellemote": // Drop-through + case "tell": // Drop-through + switch(cmd){ + case "reply" : cmd="reply to"; reply=1; break; + case "replyemote" : cmd="reply an emote to"; reply=1; emote=1; break; + case "tell" : break; + case "tellemote" : cmd="tell an emote to"; emote=1; break; + } + if(!args) + return notify_fail("Need a message.\n"); + if(reply){ + a=tells[GET_CAP_NAME(THIS_PLAYER)]["reply"]; + if(!a) return notify_fail("You haven't recieved an incoming tell through "+ + NETWORK_ID+" yet. Can't reply.\n"); + sscanf(a,"%s@%s",a,b); + c=args; + } + else{ + if(sscanf(args,"%s@%s %s",a,b,c)!=3) + return notify_fail("Invalid syntax. "+COMMAND_NAME+" tell name@mud message\n"); + } + if(emote) + c=GET_CAP_NAME(THIS_PLAYER)+"@"+MUDNAME+" "+c; + b=find_mud(b); + if(!b) return notify_fail("MUD isn't known on "+NETWORK_ID+".\n"); + if(!mudinfo[b]["online"]) return notify_fail(NETWORK_ID+"- "+b+" is offline right now.\n"); + IMC2_MSG(sprintf("%s- You %s %s@%s: %s\n",NETWORK_ID,cmd,a,b,c),THIS_PLAYER); + tell_out(THIS_PLAYER,a,b,c,reply,emote); + return 1; + break; + case "listen": + if(!args || !sizeof(args)){ // Listen to all + foreach(args in keys(localchaninfo)){ + if(chan_perm_allowed(THIS_PLAYER,args) && + (member_array(GET_NAME(THIS_PLAYER),localchaninfo[args]["users"])==-1)){ + localchaninfo[args]["users"] += ({ GET_NAME(THIS_PLAYER) }); + IMC2_MSG(NETWORK_ID+"- You are now listening to "+ + args+"\n",THIS_PLAYER); + } + } + IMC2_MSG("Listened to all allowed "+NETWORK_ID+" channels.\n",THIS_PLAYER); + return 1; + } + if(!localchaninfo[args]) return notify_fail("Not a locally configured channel.\n"); + if(!chan_perm_allowed(THIS_PLAYER,args)) + return notify_fail("You don't have permission to use that channel.\n"); + if(member_array(THIS_PLAYER->query("name"),localchaninfo[args]["users"])!=-1) + return notify_fail("You're already listening to that channel.\n"); + localchaninfo[args]["users"] += ({ GET_NAME(THIS_PLAYER) }); + IMC2_MSG(NETWORK_ID+"- You are now listening to "+args+"\n",THIS_PLAYER); + return 1; + break; + case "unlisten": + if(!localchaninfo[args]) return notify_fail("Not a locally configured channel.\n"); + localchaninfo[args]["users"] -= ({ GET_NAME(THIS_PLAYER) }); + IMC2_MSG(NETWORK_ID+"- You are no longer listening to "+args+"\n",THIS_PLAYER); + return 1; + break; + case "whois": + if(!args || !sizeof(args)) return notify_fail("Locate who?\n"); + send_packet(GET_CAP_NAME(THIS_PLAYER),"whois",args,"*", + sprintf("level=%d ",level(THIS_PLAYER))); + IMC2_MSG("Sent a request on "+NETWORK_ID+" looking for "+args+"\n",THIS_PLAYER); + return 1; + break; + case "backlog": + if(!localchaninfo[args]) return notify_fail("Not a locally configured channel.\n"); + if(!chan_perm_allowed(THIS_PLAYER,args)) + return notify_fail("You need permission to use the "+args+" channel.\n"); + if(!chan_listening(THIS_PLAYER,args)) + return notify_fail("You are not listening to the "+args+" channel.\n"); + IMC2_MSG(sprintf("Backlog of channel %s on %s:\n%s",args,NETWORK_ID, + implode(localchaninfo[args]["backlog"],"\n")+"\n"),THIS_PLAYER); + return 1; + break; + case "tells": + a=GET_CAP_NAME(THIS_PLAYER); + if(!tells[a] || !tells[a]["backlog"]) + return notify_fail("You have received no tells on the "+NETWORK_ID+" network yet.\n"); + IMC2_MSG(sprintf("Tell backlog on %s:\n%s",NETWORK_ID, + implode(tells[a]["backlog"],"")+"\n"),THIS_PLAYER); + return 1; + break; + case "configchan": + if(!ADMIN(THIS_PLAYER)) return notify_fail("You aren't allowed to use configchan.\n"); + if(sscanf(args,"%s %s %d",a,b,x)!=3) + return notify_fail("Syntax: "+COMMAND_NAME+" configchan local_name hub_name level_number\n"); + if(member_array(b,keys(chaninfo))==-1) + return notify_fail("The "+b+" channel isn't on the network.\n"); + c=localize_channel(b); + if(c) return notify_fail("That channel is already configured as "+c+" locally.\n"); + localchaninfo[a]=([ "perm":x, "name":b, "users":({ }), "backlog":({ }) ]); + IMC2_MSG("Added the "+a+" channel for "+chan_perm_desc(x)+ + " to use, which is "+b+" on the network.\n",THIS_PLAYER); + return 1; + break; + case "unconfigchan": + if(!ADMIN(THIS_PLAYER)) return notify_fail("You aren't allowed to use unconfigchan.\n"); + map_delete(localchaninfo,args); + IMC2_MSG("Got rid of "+args+" channel.\n",THIS_PLAYER); + return 1; + break; + case "chancmd": + if(!ADMIN(THIS_PLAYER)) return notify_fail("You aren't allowed to use chancmd.\n"); + if(!args || (sscanf(args,"%s:%s %s",a,b,c)!=3)) + return notify_fail("Syntax: "+COMMAND_NAME+" chancmd hub:channel command\n"); + if(!chaninfo[a+":"+b]) write(a+" is not listed as a channel, sending command anyway...\n"); + send_packet(GET_CAP_NAME(THIS_PLAYER),"ice-cmd","IMC",b, + sprintf("channel=%s command=\"%s\"", + a+":"+b,escape(c))); + IMC2_MSG(sprintf("%s- Sent a command for the %s channel to %s\n",NETWORK_ID, + a,GET_CAP_NAME(THIS_PLAYER),b),THIS_PLAYER); + return 1; + break; + case "chanperms": + output = MUDNAME+" will handle the following levels for channels:\n"; + output += sprintf("%-10s %-10s\n", "Number", "Description"); + for(x=2;x>0;x--){ + output = sprintf("%-10d %-10s\n", x, chan_perm_desc(x)); + } + IMC2_MSG(output,THIS_PLAYER); + return 1; + case "help": // drop through to default + default: + IMC2_MSG(main_help(),THIS_PLAYER); + return 1; + break; + } + } + + string main_help(){ + return sprintf(@EndText + IMC2 system by Tim, set up for %s. + To use this, type the command '%s' followed by one of the following: + chans - lists the channels that this MUD uses + allchans - lists all the channels on this network + chan (channel) (message) - talks on a channel + chanemote (channel) (message) - emotes on a channel + chansocial (channel) (message) - does a social on a channel + chanwho (channel) (mud) - checks who is listening to a channel + backlog (channel) - reads last %d messages on the channel + listen (channel) - listen to a channel + unlisten (channel) - stop listening to a channel + info (name) - lists information about a MUD + list - lists the MUDs on this network + beep (name)@(mud) - send a beep through the network + tell (name)@(mud) (message) - send a tell through the network + tellemote (name)@(mud) (message) - send an emote through the network + tells - shows your last %d tells + finger (name)@(mud) - send a finger request for information about name@mud + reply (message) - reply to the last incoming tell you received + replyemote (message) - reply with an emote to the last incoming tell you received + ping (mud) - pings a mud + setup - shows information about this IMC2 network + help - see this help message + Admin commands: + configchan (local_name) (remote_name) (level_number) - configures a channel locally + unconfigchan (local_name) - removes a locally configured channel + chancmd (channel) (command) - for remote channel administration + chanperms - lists the permission levels that are possible for configchan + EndText, NETWORK_ID,COMMAND_NAME,BACKLOG_SIZE,BACKLOG_SIZE); + } + + string html(string str){ + string mud, *muds; + string a,b; + int x=0,y=0; + string output=""; + if(!str) str=""; + sscanf(str,"%s_%s",a,b); + if(!a) a=str; + switch(a){ + case "list": + muds = sort_array(keys(mudinfo),1); + if (!sizeof(mudinfo)){ + return ("There are no muds on the "+NETWORK_ID+" network!\n"); + } + else{ + output="<tr><td><b>Status</b></td><td><b>Name</b></td><td><b>Network</b></td><td><b>IMC2 Version</b></td></tr>\n"; + foreach (mud in muds){ + if(mudinfo[mud]["online"]) x++; else y++; + output += sprintf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n", + (mudinfo[mud]["online"] ? "UP" : "DOWN"), + mudinfo[mud]["url"] ? "<a href=\""+ + ((mudinfo[mud]["url"][0..6]!="http://") ? "http://"+mudinfo[mud]["url"] : mudinfo[mud]["url"]) + +"\">"+mud+"</a>" : mud, + mudinfo[mud]["networkname"], + mudinfo[mud]["versionid"]); + } + } + return sprintf("<B>%d of %d MUDs are on %s.</B.\n<BR><table>%s</table>", + x,x+y,NETWORK_ID,output); + break; + case "backlog": + if(b && localchaninfo[b] && (localchaninfo[b]["perm"]==BACKLOG_WEB_LEVEL)){ + // Show backlog for channel. + return b+" channel backlog:\n"+implode(localchaninfo[b]["backlog"],"\n"); + } + // List the channels + output = NETWORK_ID+" channels on "+MUDNAME+":\n"; + foreach(b in sort_array(keys(localchaninfo),1)){ + if(localchaninfo[b]["perm"]==BACKLOG_WEB_LEVEL) // is public + output += "<a href=\""+HTML_LOCATION+"backlog_"+b+"\">"; + output += b; + output += " - "+chan_perm_desc(localchaninfo[b]["perm"]); + if(localchaninfo[b]["perm"]==BACKLOG_WEB_LEVEL) // is public + output += " - on web</a>"; + else + output += " - not on web"; + output += "\n"; + } + return output; + break; + default: + return MUDNAME+" uses Tim's LPC IMC2 system to connect to the "+ + NETWORK_ID+" network.\n"+ + "(version:"+VERSION+")\n"+ + "From here, you can look at the <a href=\""+HTML_LOCATION+"list\">list of muds</a>,\n"+ + "view the <a href=\""+HTML_LOCATION+"backlog\">public channel backlogs</a>,\n"+ + "or go to the main <a href=\""+URL+"\">"+MUDNAME+"</a> web site.\n"; + break; + } + } + + int clean_up(){ return 0; } + + + void forget_user(string str){ map_delete(tells,str); } + diff -c -r --new-file ds1.1/lib/secure/daemon/inet.c ds2.0r27/lib/secure/daemon/inet.c *** ds1.1/lib/secure/daemon/inet.c Sun Feb 1 21:30:41 1998 --- ds2.0r27/lib/secure/daemon/inet.c Wed Jul 5 00:01:05 2006 *************** *** 41,47 **** return 0; } Servers[name] = new(LIB_SERVER, query_host_port()+port_offset, type, ! socket_class); return 1; } --- 41,47 ---- return 0; } Servers[name] = new(LIB_SERVER, query_host_port()+port_offset, type, ! socket_class); return 1; } *************** *** 81,87 **** return 0; } ob = new(LIB_SERVER, query_host_port()+s->PortOffset, s->SocketType, ! s->SocketClass); if( ob ) { Servers[svc] = ob; return 1; --- 81,87 ---- return 0; } ob = new(LIB_SERVER, query_host_port()+s->PortOffset, s->SocketType, ! s->SocketClass); if( ob ) { Servers[svc] = ob; return 1; *************** *** 116,121 **** SetNoClean(1); foreach(string svc, class service s in Services) { Servers[svc] = new(LIB_SERVER, query_host_port() + s->PortOffset, ! s->SocketType, s->SocketClass); } } --- 116,121 ---- SetNoClean(1); foreach(string svc, class service s in Services) { Servers[svc] = new(LIB_SERVER, query_host_port() + s->PortOffset, ! s->SocketType, s->SocketClass); } } diff -c -r --new-file ds1.1/lib/secure/daemon/letters.c ds2.0r27/lib/secure/daemon/letters.c *** ds1.1/lib/secure/daemon/letters.c Sun Feb 1 21:30:42 1998 --- ds2.0r27/lib/secure/daemon/letters.c Wed Jul 5 00:01:05 2006 *************** *** 10,16 **** #include <daemons.h> #include <objects.h> #include "letters.h" ! inherit LIB_DAEMON; private string __Letter; --- 10,16 ---- #include <daemons.h> #include <objects.h> #include "letters.h" ! inherit LIB_DAEMON; private string __Letter; *************** *** 19,25 **** static private string __LetterId; static private mapping __LettersDir, __PostalDir; static private mixed *__LetterPtr, *__PostalPtr; ! void create() { string *tmp; int i; --- 19,25 ---- static private string __LetterId; static private mapping __LettersDir, __PostalDir; static private mixed *__LetterPtr, *__PostalPtr; ! void create() { string *tmp; int i; *************** *** 34,76 **** __LetterId = 0; __LetterPtr = ({ 0, 0}); for(i=0; i<10; i++) { ! if(unguarded((: file_size, DIR_LETTERS+"/"+i :)) == -2) ! __LettersDir[i] = unguarded((: get_dir, DIR_LETTERS+"/"+i+"/", 0 :)); } i = sizeof(tmp = unguarded((: get_dir, DIR_POSTAL+"/", 0 :))); ! __PostalPtr = ({ tmp[0], 0 }); while(i--) { ! if(unguarded((: file_size, DIR_POSTAL+"/"+tmp[i] :)) == -2) ! __PostalDir[tmp[i]] = unguarded((: get_dir, DIR_POSTAL+"/"+tmp[i]+"/", 0 :)); ! } ! } ! static private int valid_access() { switch(base_name(previous_object(0))) { ! case OBJ_POST: case LETTERS_D: case FOLDERS_D: ! case LOCALPOST_D: case REMOTEPOST_D: case OPTIONS_D: ! return 1; ! default: return 0; } } string create_letter(string str) { int tmp; string id, dir; ! if(!valid_access()) return ""; id = sprintf("%d", tmp = time()); dir = DIR_LETTERS+"/"+(tmp%10); if(unguarded((: file_size, dir+"/" :)) != -2) unguarded((: mkdir, dir :)); while(unguarded((: file_size, dir+"/"+id+__SAVE_EXTENSION__ :)) != -1) ! id = sprintf("%d", tmp += 10); __LetterId = id; __Letter = str; __Folders = ([]); save_letter(); return id; } ! static private void save_letter() { string file; int x; --- 34,76 ---- __LetterId = 0; __LetterPtr = ({ 0, 0}); for(i=0; i<10; i++) { ! if(unguarded((: file_size, DIR_LETTERS+"/"+i :)) == -2) ! __LettersDir[i] = unguarded((: get_dir, DIR_LETTERS+"/"+i+"/", 0 :)); } i = sizeof(tmp = unguarded((: get_dir, DIR_POSTAL+"/", 0 :))); ! if(i) __PostalPtr = ({ tmp[0], 0 }); while(i--) { ! if(unguarded((: file_size, DIR_POSTAL+"/"+tmp[i] :)) == -2) ! __PostalDir[tmp[i]] = unguarded((: get_dir, DIR_POSTAL+"/"+tmp[i]+"/", 0 :)); ! } ! } ! static private int valid_access() { switch(base_name(previous_object(0))) { ! case OBJ_POST: case LETTERS_D: case FOLDERS_D: ! case LOCALPOST_D: case REMOTEPOST_D: case OPTIONS_D: ! return 1; ! default: return 0; } } string create_letter(string str) { int tmp; string id, dir; ! if(!valid_access()) return ""; id = sprintf("%d", tmp = time()); dir = DIR_LETTERS+"/"+(tmp%10); if(unguarded((: file_size, dir+"/" :)) != -2) unguarded((: mkdir, dir :)); while(unguarded((: file_size, dir+"/"+id+__SAVE_EXTENSION__ :)) != -1) ! id = sprintf("%d", tmp += 10); __LetterId = id; __Letter = str; __Folders = ([]); save_letter(); return id; } ! static private void save_letter() { string file; int x; *************** *** 79,107 **** file = sprintf("%s/%s/%s", DIR_LETTERS,__LetterId[x..x],__LetterId); unguarded((: save_object, file :)); } ! static private int restore_letter(string id) { string dir; int x; ! if(id == __LetterId) return 1; x = strlen(id) - 1; dir = DIR_LETTERS+"/"+id[x..x]; if(!unguarded((: file_exists, dir+"/"+id+__SAVE_EXTENSION__ :))) { ! return 0; ! } unguarded((: restore_object, dir+"/"+id :)); __LetterId = id; if(__Undeleted) { ! x = sizeof(__Undeleted); ! __Folders = ([]); ! while(x--) __Folders[__Undeleted[x]] = ({ "new" }); ! __Undeleted = 0; ! save_letter(); } return 1; ! } ! string query_letter(string id) { string base; --- 79,107 ---- file = sprintf("%s/%s/%s", DIR_LETTERS,__LetterId[x..x],__LetterId); unguarded((: save_object, file :)); } ! static private int restore_letter(string id) { string dir; int x; ! if(id == __LetterId) return 1; x = strlen(id) - 1; dir = DIR_LETTERS+"/"+id[x..x]; if(!unguarded((: file_exists, dir+"/"+id+__SAVE_EXTENSION__ :))) { ! return 0; ! } unguarded((: restore_object, dir+"/"+id :)); __LetterId = id; if(__Undeleted) { ! x = sizeof(__Undeleted); ! __Folders = ([]); ! while(x--) __Folders[__Undeleted[x]] = ({ "new" }); ! __Undeleted = 0; ! save_letter(); } return 1; ! } ! string query_letter(string id) { string base; *************** *** 109,121 **** base != FOLDERS_D) return "Illegal access."; if(!restore_letter(id)) return "Invalid message.\n"; return __Letter; ! } ! void delete_folder(string who, string folder, string id) { string *tmp; string file; int i; ! if(!valid_access()) return; if(!restore_letter(id)) return; if(!__Folders[who]) return; --- 109,121 ---- base != FOLDERS_D) return "Illegal access."; if(!restore_letter(id)) return "Invalid message.\n"; return __Letter; ! } ! void delete_folder(string who, string folder, string id) { string *tmp; string file; int i; ! if(!valid_access()) return; if(!restore_letter(id)) return; if(!__Folders[who]) return; *************** *** 124,143 **** save_letter(); i = sizeof(tmp = keys(__Folders)); while(i--) { ! file = DIR_POSTAL+"/"+tmp[i][0..0]+"/"+tmp[i]+"/postalrc"+ ! __SAVE_EXTENSION__; ! if(!user_exists(tmp[i])) { ! FOLDERS_D->delete_user(tmp[i]); ! restore_letter(id); ! } ! else if(!unguarded((: file_exists, file :))) { ! map_delete(__Folders, tmp[i]); ! save_letter(); ! } } if(!sizeof(keys(__Folders))) { ! file = DIR_LETTERS+"/"+id[strlen(id)-1..strlen(id)-1]+"/"+id+__SAVE_EXTENSION__; ! unguarded((: rm, file :)); } } --- 124,143 ---- save_letter(); i = sizeof(tmp = keys(__Folders)); while(i--) { ! file = DIR_POSTAL+"/"+tmp[i][0..0]+"/"+tmp[i]+"/postalrc"+ ! __SAVE_EXTENSION__; ! if(!user_exists(tmp[i])) { ! FOLDERS_D->delete_user(tmp[i]); ! restore_letter(id); ! } ! else if(!unguarded((: file_exists, file :))) { ! map_delete(__Folders, tmp[i]); ! save_letter(); ! } } if(!sizeof(keys(__Folders))) { ! file = DIR_LETTERS+"/"+id[strlen(id)-1..strlen(id)-1]+"/"+id+__SAVE_EXTENSION__; ! unguarded((: rm, file :)); } } *************** *** 153,187 **** string str, ext, file; string *tmp; int x, i; ! if(!(x = sizeof(keys(__LettersDir)))) return; if(__LetterPtr[1] >= sizeof(__LettersDir[__LetterPtr[0]])) { ! if(++__LetterPtr[0] >= x) __LetterPtr = ({ 0, 0 }); ! else __LetterPtr[1] = 0; ! } ! sscanf(__LettersDir[__LetterPtr[0]][__LetterPtr[1]], "%s\.%s", str, ext); __LetterPtr[1]++; if(!restore_letter(str)) { ! return; ! } i = sizeof(tmp = keys(__Folders)); while(i--) { ! file = DIR_POSTAL+"/"+tmp[i][0..0]+"/"+tmp[i]+__SAVE_EXTENSION__; ! if(!user_exists(tmp[i])) { ! FOLDERS_D->delete_user(tmp[i]); ! restore_letter(str); ! } ! else if(!unguarded((: file_exists, file :))) { ! map_delete(__Folders, tmp[i]); ! save_letter(); ! } } if(!sizeof(keys(__Folders))) { ! file = DIR_LETTERS+"/"+str[strlen(str)-1..strlen(str)-1]+"/"+str+__SAVE_EXTENSION__; ! unguarded((: rm, file :)); } } ! static void manage_postal() { string pl, ext, file; string *tmp; --- 153,187 ---- string str, ext, file; string *tmp; int x, i; ! if(!(x = sizeof(keys(__LettersDir)))) return; if(__LetterPtr[1] >= sizeof(__LettersDir[__LetterPtr[0]])) { ! if(++__LetterPtr[0] >= x) __LetterPtr = ({ 0, 0 }); ! else __LetterPtr[1] = 0; ! } ! sscanf(__LettersDir[__LetterPtr[0]][__LetterPtr[1]], "%s.%s", str, ext); __LetterPtr[1]++; if(!restore_letter(str)) { ! return; ! } i = sizeof(tmp = keys(__Folders)); while(i--) { ! file = DIR_POSTAL+"/"+tmp[i][0..0]+"/"+tmp[i]+__SAVE_EXTENSION__; ! if(!user_exists(tmp[i])) { ! FOLDERS_D->delete_user(tmp[i]); ! restore_letter(str); ! } ! else if(!unguarded((: file_exists, file :))) { ! map_delete(__Folders, tmp[i]); ! save_letter(); ! } } if(!sizeof(keys(__Folders))) { ! file = DIR_LETTERS+"/"+str[strlen(str)-1..strlen(str)-1]+"/"+str+__SAVE_EXTENSION__; ! unguarded((: rm, file :)); } } ! static void manage_postal() { string pl, ext, file; string *tmp; *************** *** 189,209 **** if(!(x = sizeof(tmp = keys(__PostalDir)))) return; if(__PostalPtr[1] >= sizeof(__PostalDir[__PostalPtr[0]])) { ! i = member_array(__PostalPtr[0], tmp); ! if(++i == x) i = 0; ! __PostalPtr = ({ tmp[i], 0 }); ! } if(!pl) { ! __PostalPtr[1]++; ! return; } ! sscanf(__PostalDir[__PostalPtr[0]][__PostalPtr[1]], "%s\.%s", pl, ext); file = DIR_POSTAL+"/"+pl[0..0]+"/"+pl+__SAVE_EXTENSION__; if(!unguarded((: file_exists, file :))) { ! __PostalPtr[1]++; ! return; ! } if(!user_exists(pl)) FOLDERS_D->delete_user(pl); else FOLDERS_D->check_folders(pl); __PostalPtr[1]++; ! } --- 189,209 ---- if(!(x = sizeof(tmp = keys(__PostalDir)))) return; if(__PostalPtr[1] >= sizeof(__PostalDir[__PostalPtr[0]])) { ! i = member_array(__PostalPtr[0], tmp); ! if(++i == x) i = 0; ! __PostalPtr = ({ tmp[i], 0 }); ! } if(!pl) { ! __PostalPtr[1]++; ! return; } ! sscanf(__PostalDir[__PostalPtr[0]][__PostalPtr[1]], "%s.%s", pl, ext); file = DIR_POSTAL+"/"+pl[0..0]+"/"+pl+__SAVE_EXTENSION__; if(!unguarded((: file_exists, file :))) { ! __PostalPtr[1]++; ! return; ! } if(!user_exists(pl)) FOLDERS_D->delete_user(pl); else FOLDERS_D->check_folders(pl); __PostalPtr[1]++; ! } diff -c -r --new-file ds1.1/lib/secure/daemon/localpost.c ds2.0r27/lib/secure/daemon/localpost.c *** ds1.1/lib/secure/daemon/localpost.c Sun Feb 1 21:30:42 1998 --- ds2.0r27/lib/secure/daemon/localpost.c Wed Jul 5 00:01:05 2006 *************** *** 27,92 **** int i, maxi, x, j; maxi = sizeof(lines = filter(explode(read_file(CFG_ALIASES), "\n"), ! (: $1 && $1 != "" && $1[0] != '#' :))); for(i=0, tmp = ([]); i<maxi; i++) { ! if(sscanf(lines[i], "%s: %s", a, b) != 2) continue; ! if(b[0..0] == "|") { ! x = sizeof(parts = explode(b[1..strlen(b)-1], ";")); ! if(a == "include") { ! switch(sizeof(parts)) { ! case 2: ! tmp += (mapping)call_other(parts[0],parts[1]); ! break; ! case 3: ! tmp+=(mapping)call_other(parts[0],parts[1], ! parts[2]); ! break; ! default: ! tmp += (mapping)call_other(parts[0], parts[1], ! parts[2], parts[3]); ! break; ! } ! } ! else switch(sizeof(parts)) { ! case 2: ! tmp[a] = (string *)call_other(parts[0],parts[1]); ! break; ! case 3: ! tmp[a] = (string *)call_other(parts[0],parts[1], ! parts[2]); ! break; ! default: ! tmp[a] = (string *)call_other(parts[0],parts[1], ! parts[2], parts[3]); ! } ! } ! else { ! x = sizeof(parts = explode(b, " ")); ! if(a != "exclude") tmp[a] = ({}); ! for(j=0; j<x; j++) { ! if(a == "exclude" && tmp[parts[j]]) ! map_delete(tmp, parts[j]); ! else if(a == "exclude") continue; ! else if(tmp[parts[j]]) tmp[a]+=tmp[parts[j]]; ! else tmp[a] += ({ parts[j] }); ! } ! } } i = sizeof(parts = keys(tmp)); __MudGroups = ([]); while(i--) __MudGroups[lower_case(parts[i])] = tmp[parts[i]]; } ! varargs string *send_post(mapping borg, mixed who) { mapping remote_mail, grps; string *rejects, *tmp, *tmpwho, *cles; string msg, a, b, tmpstr; int i, j, x; ! if(!who) who = distinct_array(borg["to"] + borg["cc"]); tmpstr = base_name(previous_object(0)); if(tmpstr != OBJ_POST && tmpstr != REMOTEPOST_D && tmpstr != FOLDERS_D) ! return (pointerp(who) ? who : ({ who })); rejects = ({}); grps = (mapping)OPTIONS_D->query_groups(borg["from"]); borg["id"] = (string)LETTERS_D->create_letter(borg["message"]); --- 27,92 ---- int i, maxi, x, j; maxi = sizeof(lines = filter(explode(read_file(CFG_ALIASES), "\n"), ! (: $1 && $1 != "" && $1[0] != '#' :))); for(i=0, tmp = ([]); i<maxi; i++) { ! if(sscanf(lines[i], "%s: %s", a, b) != 2) continue; ! if(b[0..0] == "|") { ! x = sizeof(parts = explode(b[1..strlen(b)-1], ";")); ! if(a == "include") { ! switch(sizeof(parts)) { ! case 2: ! tmp += (mapping)call_other(parts[0],parts[1]); ! break; ! case 3: ! tmp+=(mapping)call_other(parts[0],parts[1], ! parts[2]); ! break; ! default: ! tmp += (mapping)call_other(parts[0], parts[1], ! parts[2], parts[3]); ! break; ! } ! } ! else switch(sizeof(parts)) { ! case 2: ! tmp[a] = (string *)call_other(parts[0],parts[1]); ! break; ! case 3: ! tmp[a] = (string *)call_other(parts[0],parts[1], ! parts[2]); ! break; ! default: ! tmp[a] = (string *)call_other(parts[0],parts[1], ! parts[2], parts[3]); ! } ! } ! else { ! x = sizeof(parts = explode(b, " ")); ! if(a != "exclude") tmp[a] = ({}); ! for(j=0; j<x; j++) { ! if(a == "exclude" && tmp[parts[j]]) ! map_delete(tmp, parts[j]); ! else if(a == "exclude") continue; ! else if(tmp[parts[j]]) tmp[a]+=tmp[parts[j]]; ! else tmp[a] += ({ parts[j] }); ! } ! } } i = sizeof(parts = keys(tmp)); __MudGroups = ([]); while(i--) __MudGroups[lower_case(parts[i])] = tmp[parts[i]]; } ! varargs string *send_post(mapping borg, mixed who) { mapping remote_mail, grps; string *rejects, *tmp, *tmpwho, *cles; string msg, a, b, tmpstr; int i, j, x; ! if(!who) who = distinct_array(borg["to"] + borg["cc"]); tmpstr = base_name(previous_object(0)); if(tmpstr != OBJ_POST && tmpstr != REMOTEPOST_D && tmpstr != FOLDERS_D) ! return (pointerp(who) ? who : ({ who })); rejects = ({}); grps = (mapping)OPTIONS_D->query_groups(borg["from"]); borg["id"] = (string)LETTERS_D->create_letter(borg["message"]); *************** *** 94,168 **** map_delete(borg, "message"); remote_mail = ([]); if(pointerp(who)) { ! i = sizeof(who); ! tmpwho = ({}); ! x = (int)OPTIONS_D->query_option(borg["from"], "metoo"); ! while(i--) { ! if(pointerp(who[i] = map_groups(who[i], grps, borg["from"], x))) ! tmpwho += who[i]; ! else tmpwho += ({ who[i] }); ! } ! i = sizeof(who = tmpwho); ! while(i--) { ! if(sscanf(who[i], "%s@%s", a, b) == 2) { ! if(!remote_mail[b]) remote_mail[b] = ({}); ! remote_mail[b] += ({}); ! } ! else if(!user_exists(who[i])) rejects += ({ who[i] }); ! else FOLDERS_D->add_post(who[i], "new", borg); ! } ! j = sizeof(cles = keys(remote_mail)); ! while(j--) ! if(!((int)REMOTEPOST_D->send_post(borg+(["message":msg]), cles[j]))) ! rejects += remote_mail[cles[j]]; ! return rejects; } else if(pointerp(tmp = __MudGroups[who]) && (i = sizeof(tmp))) { ! while(i--) { ! if(sscanf(tmp[i], "%s@%s", a, b) == 2) { ! if(!remote_mail[b]) remote_mail[b] = ({}); ! remote_mail[b] += ({ tmp[i] }); ! } ! else if(!user_exists(tmp[i])) rejects += ({ tmp[i] }); ! else FOLDERS_D->add_post(tmp[i], "new", borg); ! } ! i = sizeof(cles = keys(remote_mail)); ! while(i--) ! if(!((int)REMOTEPOST_D->send_post(borg+(["message":msg]), cles[i]))) ! rejects += remote_mail[cles[i]]; ! return rejects; } else if(pointerp(tmp = (string *)OPTIONS_D->query_group(who)) && (i = sizeof(tmp))) { ! while(i--) { ! if(sscanf(tmp[i], "%s@%s", a, b) == 2) { ! if(!remote_mail[b]) remote_mail[b] = ({}); ! remote_mail[b] += ({ tmp[i] }); ! } ! else if(!user_exists(tmp[i])) rejects += ({ tmp[i] }); ! else FOLDERS_D->add_post(tmp[i], "new", borg); ! } ! i = sizeof(cles = keys(remote_mail)); ! while(i--) ! if(!((int)REMOTEPOST_D->send_post(borg+(["message":msg]),cles[i]))) ! rejects += remote_mail[cles[i]]; ! return rejects; } else { ! if(sscanf(who, "%s@%s", a, b) == 2) { ! if(!((int)REMOTEPOST_D->send_post(borg+(["message":msg]),b))) ! return ({ who }); ! } ! else if(!user_exists(who)) return ({ who }); ! else FOLDERS_D->add_post(who, "new", borg); ! return ({}); } } static private mixed map_groups(string str, mapping grps, string who, int x) { if(__MudGroups[str]) return (string *)__MudGroups[str] - ({ who }); else if(grps[str] && sizeof(grps[str])) ! return (string *)grps[str] - ({ who }); else return str; } --- 94,168 ---- map_delete(borg, "message"); remote_mail = ([]); if(pointerp(who)) { ! i = sizeof(who); ! tmpwho = ({}); ! x = (int)OPTIONS_D->query_option(borg["from"], "metoo"); ! while(i--) { ! if(pointerp(who[i] = map_groups(who[i], grps, borg["from"], x))) ! tmpwho += who[i]; ! else tmpwho += ({ who[i] }); ! } ! i = sizeof(who = tmpwho); ! while(i--) { ! if(sscanf(who[i], "%s@%s", a, b) == 2) { ! if(!remote_mail[b]) remote_mail[b] = ({}); ! remote_mail[b] += ({}); ! } ! else if(!user_exists(who[i])) rejects += ({ who[i] }); ! else FOLDERS_D->add_post(who[i], "new", borg); ! } ! j = sizeof(cles = keys(remote_mail)); ! while(j--) ! if(!((int)REMOTEPOST_D->send_post(borg+(["message":msg]), cles[j]))) ! rejects += remote_mail[cles[j]]; ! return rejects; } else if(pointerp(tmp = __MudGroups[who]) && (i = sizeof(tmp))) { ! while(i--) { ! if(sscanf(tmp[i], "%s@%s", a, b) == 2) { ! if(!remote_mail[b]) remote_mail[b] = ({}); ! remote_mail[b] += ({ tmp[i] }); ! } ! else if(!user_exists(tmp[i])) rejects += ({ tmp[i] }); ! else FOLDERS_D->add_post(tmp[i], "new", borg); ! } ! i = sizeof(cles = keys(remote_mail)); ! while(i--) ! if(!((int)REMOTEPOST_D->send_post(borg+(["message":msg]), cles[i]))) ! rejects += remote_mail[cles[i]]; ! return rejects; } else if(pointerp(tmp = (string *)OPTIONS_D->query_group(who)) && (i = sizeof(tmp))) { ! while(i--) { ! if(sscanf(tmp[i], "%s@%s", a, b) == 2) { ! if(!remote_mail[b]) remote_mail[b] = ({}); ! remote_mail[b] += ({ tmp[i] }); ! } ! else if(!user_exists(tmp[i])) rejects += ({ tmp[i] }); ! else FOLDERS_D->add_post(tmp[i], "new", borg); ! } ! i = sizeof(cles = keys(remote_mail)); ! while(i--) ! if(!((int)REMOTEPOST_D->send_post(borg+(["message":msg]),cles[i]))) ! rejects += remote_mail[cles[i]]; ! return rejects; } else { ! if(sscanf(who, "%s@%s", a, b) == 2) { ! if(!((int)REMOTEPOST_D->send_post(borg+(["message":msg]),b))) ! return ({ who }); ! } ! else if(!user_exists(who)) return ({ who }); ! else FOLDERS_D->add_post(who, "new", borg); ! return ({}); } } static private mixed map_groups(string str, mapping grps, string who, int x) { if(__MudGroups[str]) return (string *)__MudGroups[str] - ({ who }); else if(grps[str] && sizeof(grps[str])) ! return (string *)grps[str] - ({ who }); else return str; } diff -c -r --new-file ds1.1/lib/secure/daemon/log.c ds2.0r27/lib/secure/daemon/log.c *** ds1.1/lib/secure/daemon/log.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/daemon/log.c Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,28 ---- + #include <lib.h> + inherit LIB_DAEMON; + + static void create() { + daemon::create(); + SetNoClean(1); + } + + int RotateLogs(){ + string *contents,*paths; + string fooname,foopath,temppath; + paths = ({"/log/chan/", "/log/","/log/errors/","/secure/log/adm/","/secure/log/"}); + foreach(string path in paths){ + contents = get_dir(path); + foreach(string substr in contents){ + temppath = path+substr; + if( file_size(temppath) > 50000) { + fooname=substr+"-"+timestamp(); + foopath=path+fooname; + rename(temppath,foopath ); + if( file_size(path+"archive") != -2 ) mkdir(path+"archive"); + cp(foopath,path+"archive/"+fooname); + rm(foopath); + } + } + } + return 1; + } diff -c -r --new-file ds1.1/lib/secure/daemon/master.c ds2.0r27/lib/secure/daemon/master.c *** ds1.1/lib/secure/daemon/master.c Sun Dec 6 18:36:42 1998 --- ds2.0r27/lib/secure/daemon/master.c Wed Jul 5 00:01:05 2006 *************** *** 24,30 **** private static int ResetNumber; private static object Unguarded; ! private static string PlayerName; private static object NewPlayer; private static mapping Groups, ReadAccess, WriteAccess; --- 24,30 ---- private static int ResetNumber; private static object Unguarded; ! private static string PlayerName, rlog; private static object NewPlayer; private static mapping Groups, ReadAccess, WriteAccess; *************** *** 71,711 **** error("Failed to find config file: "+cfg); } lines = filter(explode(file, "\n"), function(string line) { ! int i; ! ! if( !line || trim(line) == "" ) { ! return 0; ! } ! if( line[0] == '#' ) { ! return 0; ! } ! return 1; ! }); ! foreach(string line in lines) { ! string fl, ac; ! ! if( sscanf(line, "(%s) %s", fl, ac) != 2 ) { ! error("Error in loading config file " + cfg + "."); } ! ref[fl] = explode(ac, ":"); } - } ! void flag(string str) { ! string file, arg; ! object ob; ! int i, x; ! ! if(previous_object()) return; ! if(sscanf(str, "for %d", x) == 1) { ! for(i=0; i<x; i++) {} ! return; ! } ! if(sscanf(str, "call %s %s", file, arg)) { ! write("Got "+(string)call_other(file, arg)+" back.\n"); ! return; } - write("Master: unknown flag.\n"); - } ! string *epilog(int x) { ! string *lines, *files; ! string content; ! int i; ! ! if(!(content = read_file(CFG_PRELOAD))) return ({}); ! i = sizeof(lines = explode(content, "\n")); ! files = ({}); ! while(i--) { ! if(!lines[i] || lines[i] == "" || lines[i][0] == '#') continue; ! files += ({ lines[i] }); ! } ! return files; ! } ! string privs_file(string file) { ! string nom = 0; ! int ext; ! ! if( !strsrch(file, DIR_PLAYERS) ) sscanf(file, DIR_PLAYERS "/%*s/%s",nom); ! else if( !strsrch(file, DIR_CRES) ) sscanf(file, DIR_CRES "/%*s/%s",nom); ! if( nom ) { ! if( file == DIR_CRES + "/" + nom[0..0] + "/" + nom ) { ! string str, grp; ! ! str = nom; ! foreach( grp in keys(Groups) ) ! if( member_array(nom, Groups[grp]) != -1) str = str + ":" + grp; ! return str; ! } ! else if( file == DIR_PLAYERS + "/" + nom[0..0] + "/" + nom ) ! return nom; ! else return 0; } - return file_privs(file); - } ! void preload(string str) { ! string err; ! int t; ! ! if( !file_exists(str + ".c") ) return; ! t = time(); ! write("Preloading: " + str + "..."); ! if( err = catch(call_other(str, "???")) ) ! write("\nGot error "+err+" when loading "+str+".\n"); ! else { ! t = time() - t; ! write("("+(t/60)+"."+(t%60)+")\n"); } - } ! int valid_write(string file, object ob, string fun) { ! string *ok; ! if( ob == master() ) return 1; ! ok = match_path(WriteAccess, file); ! return check_access(ob, fun, file, ok, "write"); ! } ! ! int valid_read(string file, object ob, string fun) { ! string *ok; ! ! if( ob == master() ) return 1; ! ok = match_path(ReadAccess, file); ! return check_access(ob, fun, file, ok, "read"); ! } ! ! int valid_apply(string *ok) { ! return check_access(previous_object(1),0,previous_object(0), ok, "apply"); ! } ! ! int check_access(object ob, string fun, mixed file, string *ok, string oper) { ! object *stack; ! string *privs; ! string priv; ! int i; ! ! if( objectp(file) ) file = base_name(file); ! if( ok && sizeof(ok) && ok[0] == "all" ) return 1; ! if( Unguarded == ob ) { ! string tmp; ! ! if( (tmp = base_name(ob)) == LIB_PLAYER || tmp == LIB_CREATOR) { ! if( !PlayerName ) i = sizeof(stack = ({ob})+previous_object(-1)); ! else if( file == DIR_PLAYERS+"/"+PlayerName[0..0]+"/"+ ! PlayerName + __SAVE_EXTENSION__ ) ! return 1; ! else if( file == DIR_CRES+"/"+PlayerName[0..0]+"/"+ ! PlayerName + __SAVE_EXTENSION__ ) ! return 1; ! else i = sizeof(stack = ({ ob })); ! } ! else if( tmp + __SAVE_EXTENSION__ == file ) return 1; ! else i = sizeof(stack = ({ ob })); ! } ! else if(Unguarded && base_name(ob) == SEFUN) { ! if(Unguarded == previous_object(1)) ! stack = ({ previous_object(1) }); ! else stack = ({ ob }) + previous_object(-1); ! } ! else i = sizeof(stack = previous_object(-1) + ({ ob })); ! while(i--) { ! if(!stack[i] || stack[i] == this_object()) continue; ! if(file_name(stack[i]) == SEFUN) continue; ! if(!(priv = query_privs(stack[i]))) return 0; ! if(!ok && oper == "read") continue; ! privs = explode(priv, ":"); ! if(member_array(PRIV_SECURE, privs) != -1) continue; ! if(member_array(file_privs(file), privs) != -1) continue; ! if(!ok && oper == "write") { ! if(userp(stack[i]) && check_user(stack[i], fun, file, oper)) ! continue; ! else return 0; ! } ! if(sizeof(privs & ok)) continue; ! if(userp(stack[i]) && check_user(stack[i], fun, file, oper)) continue; ! if(userp(stack[i]) && check_domain(stack[i], fun, file,oper)) continue; ! return 0; } - return 1; - } - - nomask static int check_user(object ob, string fun, string file, string oper) { - string nom, tmp; - int x; - - if( !sscanf(file, REALMS_DIRS "/%s", nom) ) return 0; - if( sscanf(nom, "%s/%*s", tmp) ) nom = tmp; - nom = user_path(nom)+"adm/access"; - if(file_size(nom+".c") < 0) return 0; - catch(x = (int)call_other(nom, "check_access", ob, fun, file, oper)); - return x; - } - - nomask static int check_domain(object ob, string fun, string file, string o) { - string nom; - int x; - - if( !sscanf(file, DOMAINS_DIRS+"/%s/%*s", nom) ) return 0; - nom = DOMAINS_DIRS+"/"+nom+"/adm/access"; - if(file_size(nom+".c") < 0) return 0; - catch(x = (int)call_other(nom, "check_access", ob, fun, file, o)); - return x; - } ! object connect(int port) { ! object ob; ! string err; ! string file; ! file = LIB_CONNECT; ! if( err = catch(ob = new(file)) ) { ! write("It looks like someone is working on the user object.\n"); ! write(err); ! destruct(ob); } - return ob; - } ! object compile_object(string str) { ! string nom, tmp, where, which; ! object ob; ! ! if(sscanf(str, REALMS_DIRS+"/%s/%*s", nom)) ! tmp = sprintf("%svirtual/server", user_path(nom)); ! else if(sscanf(str, DOMAINS_DIRS+"/%s/%*s", nom)) ! tmp = sprintf("%s/%s/virtual/server", DOMAINS_DIRS, nom); ! else if(strsrch(str, ESTATES_DIRS) == 0) ! tmp = sprintf("%s/adm/server", ESTATES_DIRS); ! else if(sscanf(str, DIR_PLAYERS+"/%*s/%s", nom)) { ! if(!NewPlayer) return 0; ! if((string)NewPlayer->GetKeyName() != nom) return 0; ! PlayerName = nom; ! ob = new(LIB_PLAYER); ! if(file_size(str+__SAVE_EXTENSION__) > 0) ob->restore_player(nom); ! else if(file_size(DIR_PLAYERS) != -2) mkdir(DIR_PLAYERS); ! else if(file_size(DIR_PLAYERS+"/"+nom[0..0]) != -2) ! mkdir(DIR_PLAYERS+"/"+nom[0..0]); ! ob->SetKeyName(nom); ! PlayerName = 0; ! return ob; ! } ! else if( sscanf(str, DIR_CRES+"/%*s/%s", nom) ) { ! if(!NewPlayer) return 0; ! if((string)NewPlayer->GetKeyName() != nom) return 0; ! PlayerName = nom; ! ob = new(LIB_CREATOR); ! if(file_size(str+__SAVE_EXTENSION__) > 0) ob->restore_player(nom); ! ob->SetKeyName(nom); ! PlayerName = 0; ! return ob; ! } ! if(file_size(tmp+".c") < 0) { ! if(sscanf(str, "%s.%s", where, which) != 2) return 0; ! if(sscanf(str, REALMS_DIRS+"/%s/%*s", nom)) ! tmp = sprintf("%svirtual/%s_server", user_path(nom), which); ! else if(sscanf(str, DOMAINS_DIRS+"/%s/%*s", nom)) ! tmp = sprintf("%s/%s/virtual/%s_server", DOMAINS_DIRS, nom, which); ! if(file_size(tmp+".c") < 0) return 0; ! else return (object)call_other(tmp, "compile_object", where); } - return (object)call_other(tmp, "compile_object", str); - } ! static void crash(string err) { ! write_file(DIR_LOGS "/crashes", ! mud_name() + " crashed " + ctime(time()) + " with error " + ! err+".\n"); ! message("system", "Reality implosion!!! Everyone duck!!!", users()); ! message("system", "You are being forced to quit.", users()); ! users()->cmdQuit(); ! } ! int valid_bind(object binder, object old_owner, object new_owner) { ! if( binder == master() ) return 1; ! if( member_array(PRIV_SECURE, explode(query_privs(binder), ":")) != -1 ) ! return 1; ! return 0; ! } ! int valid_hide(object who) { ! string priv; ! if(!objectp(who)) return 0; ! if(environment(who) && hiddenp(environment(who))) return 1; ! if(!(priv = query_privs(who))) return 0; ! else return (member_array(PRIV_SECURE, explode(priv, ":")) != -1); ! } ! int valid_override(string file, string nom) { return (file == SEFUN); } ! int valid_save_binary(string str) { return 1; } ! int valid_shadow(object ob) { ! object targ = previous_object(); ! return (!virtualp(targ) && !strsrch(file_name(targ), DIR_SHADOWS)); ! } ! int valid_object(object ob) { ! string file; ! file = file_name(ob); ! if( !strsrch(file, DIR_TMP) ) return 0; ! else if( !strsrch(file, DIR_FTP) ) return 0; ! else if( !strsrch(file, DIR_LOGS) ) return 0; ! else return 1; ! } ! ! int valid_socket(object ob, string fun, mixed *info) { ! object *obs; ! object who; ! int port; ! string tmp; ! int i; ! ! if( info && sizeof(info) == 4 ) { ! ob = info[1]; ! port = info[3]; ! if( port == PORT_ADMIN && ob != find_object(ADMIN_D) ) { ! return 0; } ! if( port == PORT_RCP && ob != find_object(REMOTE_D) ) { ! return 0; } } - i = sizeof(obs = previous_object(-1)); - while(i--) { - if( !obs[i] ) continue; - if( userp(obs[i]) ) continue; - if( !(tmp = query_privs(obs[i])) ) return 0; - if( !sizeof(explode(tmp, ":") & - ({ PRIV_SECURE, PRIV_MUDLIB, PRIV_CMDS, PRIV_GENERAL })) ) return 0; - } - return 1; - } ! mixed apply_unguarded(function f) { ! object previous_unguarded; ! string base, err, tmp; ! mixed val; ! ! if(base_name(previous_object(0)) != SEFUN) { ! error("Illegal unguarded apply."); ! return 0; ! } ! previous_unguarded = Unguarded; ! Unguarded = previous_object(1); ! err = catch(val = (mixed)(*f)()); ! Unguarded = previous_unguarded; ! if(err) error(err); ! return val; ! } ! ! string error_handler(mapping mp, int caught) { ! string ret, file; ! ret = "---\n" + standard_trace(mp); ! if( caught ) write_file(file = "/log/catch", ret); ! else write_file(file = "/log/runtime", ret); ! if( this_player(1) && find_object(SEFUN) ) { ! this_player(1)->SetLastError(mp); ! if( creatorp(this_player(1)) ) { ! this_player(1)->eventPrint(ret + "Trace written to " + file, ! MSG_SYSTEM); } ! else { ! if( !strsrch(file_name(this_player(1)), LIB_CONNECT) ) { ! return "/log/login"; } - this_player()->eventPrint("A runtime error occurred, " - "use \"bug -r\" to report it.", - MSG_SYSTEM); - CHAT_D->eventSendChannel("System", "error", "A runtime error " - "occurred to " + - (string)this_player(1)->GetCapName()+"."); } } - return 0; - } ! void log_error(string file, string msg) { ! string nom, home, tmp; ! if( file[0] != '/' ) { ! file = "/" + file; } - if( sscanf(file, REALMS_DIRS+"/%s/%s", nom, tmp) != 2 && - sscanf(file, DOMAINS_DIRS+"/%s/%s", nom, tmp) != 2 ) - sscanf(file, "/%s/%s", nom, tmp); - if( !nom ) nom = "log"; - catch(write_file(DIR_ERROR_LOGS "/" + nom, msg)); - } ! varargs string standard_trace(mapping mp, int flag) { ! string obj, ret; ! mapping *trace; ! int i,n; ! ! ret = mp["error"] + "Object: " + ! trace_line(mp["object"], mp["program"], mp["file"], mp["line"]); ! ret += "\n"; ! trace = mp["trace"]; ! n = sizeof(trace); ! for (i=0; i<n; i++) { ! if( flag ) ret += sprintf("#%d: ", i); ! ret += sprintf("'%s' at %s", trace[i]["function"], ! trace_line(trace[i]["object"], trace[i]["program"], ! trace[i]["file"], trace[i]["line"])); } - return ret; - } - - string trace_line(object obj, string prog, string file, int line) { - string ret; - string objfn = obj ? file_name(obj) : "<none>"; - - ret = objfn; - if( different(objfn, prog) ) ret += sprintf(" (%s)", prog); - if( file != prog ) ret += sprintf(" at %s:%d\n", file, line); - else ret += sprintf(" at line %d\n", line); - return ret; - } ! int different(string fn, string pr) { ! int tmp; ! sscanf(fn, "%s#%d", fn, tmp); ! fn += ".c"; ! return (fn != pr) && (fn != ("/" + pr)); ! } ! void master_log_file(string file, string msg) { ! if(file_name(previous_object()) != SEFUN) return; ! if(file_size(file) > MAX_LOG_SIZE) rename(file, file+".old"); ! write_file(file, msg); ! } ! string make_path_absolute(string file) { ! return absolute_path((string)this_player(1)->query_cwd(), file); ! } ! int player_exists(string nom) { ! string str; ! if( !nom ) return 0; ! str = DIR_PLAYERS "/" + nom[0..0] + "/" + nom + __SAVE_EXTENSION__; ! if( file_size(str) > -1 ) return 1; ! str = DIR_CRES "/" + nom[0..0] + "/" + nom + __SAVE_EXTENSION__; ! return (file_size(str) > -1); ! } ! string domain_file(string str) { ! string nom, tmp; ! if(sscanf(str, DOMAINS_DIRS+"/%s/%s", nom, tmp) == 2) return nom; ! return 0; ! } ! string author_file(string str) { ! string nom, tmp; ! if(sscanf(str, REALMS_DIRS+"/%s/%s", nom, tmp) == 2) return nom; ! return 0; ! } ! static int slow_shutdown() { ! write_file(DIR_LOGS "/audit", ! "Armageddon loaded by master: "+ctime(time())+".\n"); ! EVENTS_D->eventRebootMud(2); ! return 1; ! } ! int save_ed_setup(object who, int code) { ! string file; ! if(!intp(code)) return 0; ! rm(file = user_path((string)who->GetKeyName())+".edrc"); ! return write_file(file, code+""); ! } ! int retrieve_ed_setup(object who) { ! string file; ! int x; ! file = user_path((string)who->GetKeyName())+".edrc"; ! if(!file_exists(file)) return 0; ! return to_int(read_file(file)); ! } ! string get_save_file_name(string file) { ! string str; ! str = (string)this_player(1)->GetKeyName(); ! if(file_size(user_path(str)) == -2) ! return user_path(str)+"dead.edit"; ! else return DIR_TMP+"/"+str+".dead.edit"; ! } ! int is_locked() { return MUD_IS_LOCKED; } ! string *parse_command_id_list() { return ({ "one", "thing" }); } ! string *parse_command_plural_id_list() { return ({ "ones", "things","them"}); } ! string *parse_command_adjectiv_id_list() { ! return ({ "the", "an", "a" }); ! } ! string *parse_command_prepos_list() { ! return ({ "in", "with", "without", "into", "for", "on", "under", "against", ! "out", "within", "of", "from", "between", "at", "to", "over", "near", ! "inside", "onto", "off", "through", "across", "up", "down", ! "around", "about" }); ! } ! string parse_command_all_word() { return "all"; } ! string parser_error_message(int type, object ob, mixed arg, int flag) { ! string err; ! if( ob ) err = (string)ob->GetShort(); ! else err = ""; ! switch(type) { ! case ERR_IS_NOT: ! if( flag ) err = "There is no such " + remove_article(arg) + " here."; ! else err = "There is no " + remove_article(arg) + " here."; ! break; ! ! case ERR_NOT_LIVING: ! if( flag ) ! err = "None of the " + pluralize(remove_article(arg)) +" are alive."; ! else err = "The " + remove_article(arg) + " is not alive."; ! break; ! ! case ERR_NOT_ACCESSIBLE: ! if( flag ) err = "You can't get to them."; ! else err = "You can't get to it."; ! break; ! ! case ERR_AMBIG: ! { ! mixed *obs; ! int i; ! ! obs = unique_array(arg, (: (string)$1->GetShort() :)); ! if( sizeof(obs) == 1 ) ! err = "Which of the " + ! consolidate(sizeof(arg), (string)obs[0][0]->GetShort()) + ! " do you mean?"; ! else { ! err = "Do you mean "; ! for(i = 0; i<sizeof(obs); i++) { ! if( sizeof(obs[i]) > 1 ) ! err += "one of the " + ! consolidate(sizeof(obs[i]),(string)obs[i][0]->GetShort()); ! else err += (string)obs[i][0]->GetShort(); ! if( i == (sizeof(obs)-2) ) err += " or "; ! else if( i < sizeof(obs) - 1 ) err += ", "; ! } ! err += "?"; ! } ! return err; ! } ! case ERR_ORDINAL: ! if( arg > 1 ) err = "There are only " + arg + " of them."; ! else err = "There is only one of them."; ! break; ! case ERR_ALLOCATED: ! return arg; ! case ERR_THERE_IS_NO: ! return "There is no " + remove_article(arg) + " here."; ! case ERR_BAD_MULTIPLE: ! return "You can't do that to more than one at a time."; ! } ! return err; ! } ! void create_save() { ! string str; ! if(!stringp(str = (string)previous_object()->GetKeyName())) return; ! if(file_size(DIR_PLAYERS+"/"+str[0..0]) == -2) return; ! if(str[0] < 'a' || str[0] > 'z') return; ! mkdir(DIR_PLAYERS+"/"+str[0..0]); ! } ! object player_object(string nom) { ! object ob; ! string err, tmp; ! int old_limit; ! tmp = base_name(ob = previous_object()); ! if( tmp != CMD_ENCRE && tmp != CMD_DECRE && tmp != LIB_CONNECT ) ! return 0; ! old_limit = max_eval_cost(); ! set_eval_limit(1000000000); ! NewPlayer = ob; ! if(file_size(DIR_CRES+ "/" + nom[0..0]+ "/" +nom+__SAVE_EXTENSION__) > -1) ! err = catch(ob = load_object(DIR_CRES+"/"+nom[0..0]+"/"+nom)); ! else err = catch(ob = load_object(DIR_PLAYERS+"/"+nom[0..0]+"/"+nom)); ! NewPlayer = 0; ! set_eval_limit(old_limit); ! if(err) error(err); ! return ob; ! } ! string player_save_file(string nom) { ! string tmp; ! tmp = DIR_CRES + "/" + nom[0..0] + "/" + nom; ! if( file_size(tmp + __SAVE_EXTENSION__) > -1 ) return tmp; ! else return DIR_PLAYERS + "/" + nom[0..0] + "/" + nom; ! } ! string *query_group(string grp) { return copy(Groups[grp]); } ! mapping query_groups() { return copy(Groups); } ! static void eventReset() { ! object *obs; ! object ob; ! int x, y; ! ResetNumber++; ! call_out( (: eventReset :), TIME_TO_RESET ); ! x = reclaim_objects(); ! write_file(DIR_LOGS "/reset", "Reset " + ResetNumber + " occurred at: " + ! ctime(time()) + "\n"); ! obs = objects( (: !environment($1) && (random(100) < 26) :) ); ! y = 0; ! foreach(ob in obs) { ! function f; ! ! if( !ob ) { ! y++; ! continue; ! } ! f = bind( (: call_other, ob, "clean_up" :), ob ); ! if( f ) catch(evaluate(f)); ! if( !ob ) { ! y++; ! continue; ! } ! f = bind((: call_other, ob, "reset", ResetNumber :), ob); ! if( f ) catch(evaluate(f)); ! } ! write_file(DIR_LOGS "/reset", "\t" + x + " objects reclaimed, " + ! (sizeof(obs) - y) + " objects reset, " + y + " objects " ! "cleaned.\n"); ! } ! int GetResetNumber() { return ResetNumber; } ! object *parse_command_users() { ! return filter(users(), (: creatorp($1) || (int)$1->is_living() :)); ! } --- 71,761 ---- error("Failed to find config file: "+cfg); } lines = filter(explode(file, "\n"), function(string line) { ! ! if( !line || trim(line) == "" ) { ! return 0; ! } ! if( line[0] == '#' ) { ! return 0; ! } ! return 1; ! }); ! foreach(string line in lines) { ! string fl, ac; ! ! if( sscanf(line, "(%s) %s", fl, ac) != 2 ) { ! error("Error in loading config file " + cfg + "."); ! } ! ref[fl] = explode(ac, ":"); ! } ! } ! ! void flag(string str) { ! string file, arg; ! int i, x; ! ! if(previous_object()) return; ! if(sscanf(str, "for %d", x) == 1) { ! for(i=0; i<x; i++) {} ! return; ! } ! if(sscanf(str, "call %s %s", file, arg)) { ! write("Got "+(string)call_other(file, arg)+" back.\n"); ! return; } ! write("Master: unknown flag.\n"); } ! string *epilog(int x) { ! string *lines, *files; ! string content; ! int i; ! ! if(!(content = read_file(CFG_PRELOAD))) return ({}); ! i = sizeof(lines = explode(content, "\n")); ! files = ({}); ! while(i--) { ! if(!lines[i] || lines[i] == "" || lines[i][0] == '#') continue; ! files += ({ lines[i] }); ! } ! return files; } ! string privs_file(string file) { ! string nom = 0; ! if( !strsrch(file, DIR_PLAYERS) ) sscanf(file, DIR_PLAYERS "/%*s/%s",nom); ! else if( !strsrch(file, DIR_CRES) ) sscanf(file, DIR_CRES "/%*s/%s",nom); ! if( nom ) { ! if( file == DIR_CRES + "/" + nom[0..0] + "/" + nom ) { ! string str, grp; ! ! str = nom; ! foreach( grp in keys(Groups) ) ! if( member_array(nom, Groups[grp]) != -1) str = str + ":" + grp; ! return str; ! } ! else if( file == DIR_PLAYERS + "/" + nom[0..0] + "/" + nom ) ! return nom; ! else return 0; ! } ! return file_privs(file); } ! void preload(string str) { ! string err; ! int t; ! ! if( !file_exists(str + ".c") ) return; ! t = time(); ! write("Preloading: " + str + "..."); ! if( err = catch(call_other(str, "???")) ) ! write("\nGot error "+err+" when loading "+str+".\n"); ! else { ! t = time() - t; ! write("("+(t/60)+"."+(t%60)+")\n"); ! } } ! int valid_write(string file, object ob, string fun) { ! string *ok; ! if( ob == master() ) return 1; ! ok = match_path(WriteAccess, file); ! return check_access(ob, fun, file, ok, "write"); ! } ! ! int valid_read(string file, object ob, string fun) { ! string *ok; ! ! if( ob == master() ) return 1; ! ok = match_path(ReadAccess, file); ! return check_access(ob, fun, file, ok, "read"); ! } ! ! int valid_link(string from, string to) { ! object ob = previous_object(); ! if(!interactive(ob)) ob = previous_object(1); ! if(!interactive(ob)) ob = previous_object(2); ! if(!interactive(ob)) ob = previous_object(3); ! if(!interactive(ob)) {return 0;} ! if(ob->GetForced()) { tell_player(ob,"Someone's fucking with you."); return 0;} ! if(!valid_write(from, ob, "link")) {return 0;} ! if(!valid_write(to, ob, "link")) {return 0;} ! return 1; ! } ! ! int valid_apply(string *ok) { ! return check_access(previous_object(1),0,previous_object(0), ok, "apply"); ! } ! ! int check_access(object ob, string fun, mixed file, string *ok, string oper) { ! object *stack; ! string *privs; ! string priv; ! int i, privcheck; ! ! if( objectp(file) ) file = base_name(file); ! if( ok && sizeof(ok) && ok[0] == "all" ) return 1; ! if( Unguarded == ob ) { ! string tmp; ! ! if( (tmp = base_name(ob)) == LIB_PLAYER || tmp == LIB_CREATOR) { ! if( !PlayerName ) i = sizeof(stack = ({ob})+previous_object(-1)); ! else if( file == DIR_PLAYERS+"/"+PlayerName[0..0]+"/"+ ! PlayerName + __SAVE_EXTENSION__ ) ! return 1; ! else if( file == DIR_CRES+"/"+PlayerName[0..0]+"/"+ ! PlayerName + __SAVE_EXTENSION__ ) ! return 1; ! else i = sizeof(stack = ({ ob })); ! } ! else if( tmp + __SAVE_EXTENSION__ == file ) return 1; ! else i = sizeof(stack = ({ ob })); ! } ! else if(Unguarded && base_name(ob) == "/secure/sefun/sefun") { ! if(Unguarded == previous_object(1)) ! stack = ({ previous_object(1) }); ! else stack = ({ ob }) + previous_object(-1); ! } ! else i = sizeof(stack = previous_object(-1) + ({ ob })); ! //tc("me: "+identify(this_object()), "red"); ! //tc("prevs: "+identify((previous_object(-1)+({ob}))), "red"); ! //tc("get_stack: "+get_stack(), "white"); ! //tc("oper: "+oper, "red"); ! while(i--) { ! if(!stack[i] || stack[i] == this_object()) { ! //tc("stack check true"); ! continue; ! } ! if(file_name(stack[i]) == SEFUN) { ! //tc("sefun check true"); ! continue; ! } ! if(!(priv = query_privs(stack[i]))) { ! //tc("priv check FALSE"); ! return 0; ! } ! //tc("priv: "+priv,"yellow"); ! //tc("prevs: "+identify(previous_object(-1))); ! if(!ok && oper == "read") { ! //tc("trivial read check passed"); ! continue; ! } ! privs = explode(priv, ":"); ! if(member_array(PRIV_SECURE, privs) != -1) { ! //tc("priv secure check true"); ! //tc("prevs: "+identify(previous_object(-1)),"white"); ! //tc("stack: "+get_stack(),"white"); ! continue; ! } ! if(stringp(file) && member_array(file_privs(file), privs) != -1) { ! //tc("file: "+file+", checks true"); ! continue; ! } ! //foreach(string sub_priv in privs){ ! // if(sizeof(ok) && member_array(sub_priv, ok) != -1) privcheck = 1; ! //} ! //if(ok) tc("ok: "+identify(ok)); ! //tc("current ob: "+identify(stack[i])); ! //tc("privcheck: "+privcheck+"\n\n"); ! //if(privcheck) continue; ! if(!ok && oper == "write") { ! //tc("verde","green"); ! if(userp(stack[i]) && check_user(stack[i], fun, file, oper)) ! continue; ! else return 0; ! } ! if(sizeof(privs & ok)) { ! //tc("azul","blue"); ! continue; ! } ! if(userp(stack[i]) && check_user(stack[i], fun, file, oper)) continue; ! if(userp(stack[i]) && check_domain(stack[i], fun, file,oper)) continue; ! return 0; ! } ! return 1; } ! nomask static int check_user(object ob, string fun, string file, string oper) { ! string nom, tmp; ! int x; ! ! if( !sscanf(file, REALMS_DIRS "/%s", nom) ) return 0; ! if( sscanf(nom, "%s/%*s", tmp) ) nom = tmp; ! nom = user_path(nom)+"adm/access"; ! if(file_size(nom+".c") < 0) return 0; ! catch(x = (int)call_other(nom, "check_access", ob, fun, file, oper)); ! return x; ! } ! ! nomask static int check_domain(object ob, string fun, string file, string o) { ! string nom; ! int x; ! ! if( !sscanf(file, DOMAINS_DIRS+"/%s/%*s", nom) ) return 0; ! nom = DOMAINS_DIRS+"/"+nom+"/adm/access"; ! if(file_size(nom+".c") < 0) return 0; ! catch(x = (int)call_other(nom, "check_access", ob, fun, file, o)); ! return x; ! } ! ! object connect(int port) { ! object ob; ! string err; ! string file; ! ! file = LIB_CONNECT; ! if( err = catch(ob = new(file)) ) { ! write("It looks like someone is working on the user object.\n"); ! write(err); ! destruct(ob); ! } ! return ob; ! } ! object compile_object(string str) { ! string nom, tmp, where, which; ! object ob; ! ! if(sscanf(str, REALMS_DIRS+"/%s/%*s", nom)) ! tmp = sprintf("%svirtual/server", user_path(nom)); ! else if(sscanf(str, DOMAINS_DIRS+"/%s/%*s", nom)) ! tmp = sprintf("%s/%s/virtual/server", DOMAINS_DIRS, nom); ! else if(strsrch(str, ESTATES_DIRS) == 0) ! tmp = sprintf("%s/adm/server", ESTATES_DIRS); ! else if(sscanf(str, DIR_PLAYERS+"/%*s/%s", nom)) { ! if(!NewPlayer) return 0; ! if((string)NewPlayer->GetKeyName() != nom) return 0; ! PlayerName = nom; ! ob = new(LIB_PLAYER); ! if(file_size(str+__SAVE_EXTENSION__) > 0) ob->restore_player(nom); ! else if(file_size(DIR_PLAYERS) != -2) mkdir(DIR_PLAYERS); ! else if(file_size(DIR_PLAYERS+"/"+nom[0..0]) != -2) ! mkdir(DIR_PLAYERS+"/"+nom[0..0]); ! ob->SetKeyName(nom); ! PlayerName = 0; ! return ob; ! } ! else if( sscanf(str, DIR_CRES+"/%*s/%s", nom) ) { ! if(!NewPlayer) return 0; ! if((string)NewPlayer->GetKeyName() != nom) return 0; ! PlayerName = nom; ! ob = new(LIB_CREATOR); ! if(file_size(str+__SAVE_EXTENSION__) > 0) ob->restore_player(nom); ! ob->SetKeyName(nom); ! PlayerName = 0; ! return ob; ! } ! if(file_size(tmp+".c") < 0) { ! if(sscanf(str, "%s.%s", where, which) != 2) return 0; ! if(sscanf(str, REALMS_DIRS+"/%s/%*s", nom)) ! tmp = sprintf("%svirtual/%s_server", user_path(nom), which); ! else if(sscanf(str, DOMAINS_DIRS+"/%s/%*s", nom)) ! tmp = sprintf("%s/%s/virtual/%s_server", DOMAINS_DIRS, nom, which); ! if(file_size(tmp+".c") < 0) return 0; ! else return (object)call_other(tmp, "compile_object", where); ! } ! return (object)call_other(tmp, "compile_object", str); } ! static void crash(string err) { ! write_file(DIR_LOGS "/crashes", ! mud_name() + " crashed " + ctime(time()) + " with error " + ! err+".\n"); ! message("system", "Reality implosion!!! Everyone duck!!!", users()); ! message("system", "You are being forced to quit.", users()); ! users()->cmdQuit(); ! } ! ! int valid_bind(object binder, object old_owner, object new_owner) { ! if( binder == master() ) return 1; ! if( member_array(PRIV_SECURE, explode(query_privs(binder), ":")) != -1 ) ! return 1; ! return 0; } ! int valid_hide(object who) { ! string priv; ! if(!objectp(who)) return 0; ! if(environment(who) && hiddenp(environment(who))) return 1; ! if(!(priv = query_privs(who))) return 0; ! else return (member_array(PRIV_SECURE, explode(priv, ":")) != -1); ! } ! int valid_override(string file, string nom) { return (file == SEFUN); } ! int valid_save_binary(string str) { return 1; } ! int valid_shadow(object ob) { ! object targ = previous_object(); ! return (!virtualp(targ) && !strsrch(file_name(targ), DIR_SHADOWS)); ! } ! int valid_object(object ob) { ! string file; ! file = file_name(ob); ! if( !strsrch(file, DIR_TMP) ) return 0; ! else if( !strsrch(file, DIR_FTP) ) return 0; ! else if( !strsrch(file, DIR_LOGS) ) return 0; ! else if( !strsrch(file, DIR_SECURE_SAVE) ) return 0; ! else return 1; ! } ! int valid_socket(object ob, string fun, mixed *info) { ! object *obs; ! int port; ! string tmp; ! int i; ! if( info && sizeof(info) == 4 ) { ! ob = info[1]; ! port = info[3]; ! if( port == PORT_ADMIN && ob != find_object(ADMIN_D) ) { ! return 0; ! } ! if( port == PORT_RCP && ob != find_object(REMOTE_D) ) { ! return 0; ! } } ! i = sizeof(obs = previous_object(-1)); ! while(i--) { ! if( !obs[i] ) continue; ! if( userp(obs[i]) ) continue; ! if( !(tmp = query_privs(obs[i])) ) return 0; ! if( !sizeof(explode(tmp, ":") & ! ({ PRIV_SECURE, PRIV_MUDLIB, PRIV_CMDS, PRIV_GENERAL })) ) return 0; } + return 1; } ! mixed apply_unguarded(function f) { ! object previous_unguarded; ! string err; ! mixed val; ! if(base_name(previous_object(0)) != SEFUN) { ! error("Illegal unguarded apply."); ! return 0; } ! previous_unguarded = Unguarded; ! Unguarded = previous_object(1); ! err = catch(val = evaluate(f) ); ! Unguarded = previous_unguarded; ! if(err) error(err); ! return val; ! } ! ! string error_handler(mapping mp, int caught) { ! string ret, file; ! ! ret = "---\n" + standard_trace(mp); ! if( caught ) write_file(file = "/log/catch", ret); ! else write_file(file = "/log/runtime", ret); ! if( this_player(1) && find_object(SEFUN) ) { ! this_player(1)->SetLastError(mp); ! if( creatorp(this_player(1)) ) { ! this_player(1)->eventPrint(ret + "Trace written to " + file, ! MSG_SYSTEM); ! } ! else { ! if( !strsrch(file_name(this_player(1)), LIB_CONNECT) ) { ! return "/log/login"; ! } ! this_player()->eventPrint("A runtime error occurred."); ! CHAT_D->eventSendChannel("System", "error", "A runtime error " ! "occurred to " + ! (string)this_player(1)->GetCapName()+"."); ! rlog = "-----\n" +timestamp()+ ": "+(string)this_player(1)->GetCapName()+"\n"; ! rlog += load_object("/secure/cmds/creators/dbxwhere")->cmd(this_player(1)->GetKeyName()); ! rlog += flat_map(this_player()->GetLastError())+"\n-----\n"; ! unguarded( (: write_file("/log/player_errors", rlog) :) ); } } + return 0; } ! void log_error(string file, string msg) { ! string nom, tmp; ! if( file[0] != '/' ) { ! file = "/" + file; ! } ! if( sscanf(file, REALMS_DIRS+"/%s/%s", nom, tmp) != 2 && ! sscanf(file, DOMAINS_DIRS+"/%s/%s", nom, tmp) != 2 ) ! sscanf(file, "/%s/%s", nom, tmp); ! if( !nom ) nom = "log"; ! catch(write_file(DIR_ERROR_LOGS "/" + nom, timestamp()+" "+msg)); ! if(msg && this_player(1) && creatorp(this_player(1))){ ! catch(tell_player(this_player(1),msg)); ! } } ! varargs string standard_trace(mapping mp, int flag) { ! string ret; ! mapping *trace; ! int i,n; ! ! ret = mp["error"] + "Object: " + ! trace_line(mp["object"], mp["program"], mp["file"], mp["line"]); ! ret += "\n"; ! trace = mp["trace"]; ! n = sizeof(trace); ! for (i=0; i<n; i++) { ! if( flag ) ret += sprintf("#%d: ", i); ! ret += sprintf("'%s' at %s", trace[i]["function"], ! trace_line(trace[i]["object"], trace[i]["program"], ! trace[i]["file"], trace[i]["line"])); ! } ! return ret; } ! string trace_line(object obj, string prog, string file, int line) { ! string ret; ! string objfn = obj ? file_name(obj) : "<none>"; ! ret = objfn; ! if( different(objfn, prog) ) ret += sprintf(" (%s)", prog); ! if( file != prog ) ret += sprintf(" at %s:%d\n", file, line); ! else ret += sprintf(" at line %d\n", line); ! return ret; ! } ! int different(string fn, string pr) { ! int tmp; ! sscanf(fn, "%s#%d", fn, tmp); ! fn += ".c"; ! return (fn != pr) && (fn != ("/" + pr)); ! } ! void master_log_file(string file, string msg) { ! if(file_name(previous_object()) != SEFUN) return; ! if(file_size(file) > MAX_LOG_SIZE) rename(file, file+".old"); ! write_file(file, msg); ! } ! string make_path_absolute(string file) { ! return absolute_path((string)this_player(1)->query_cwd(), file); ! } ! int player_exists(string nom) { ! string str; ! if( !nom ) return 0; ! str = DIR_PLAYERS "/" + nom[0..0] + "/" + nom + __SAVE_EXTENSION__; ! if( file_size(str) > -1 ) return 1; ! str = DIR_CRES "/" + nom[0..0] + "/" + nom + __SAVE_EXTENSION__; ! return (file_size(str) > -1); ! } ! string domain_file(string str) { ! string nom, tmp; ! if(sscanf(str, DOMAINS_DIRS+"/%s/%s", nom, tmp) == 2) return nom; ! return 0; ! } ! string author_file(string str) { ! string nom, tmp; ! if(sscanf(str, REALMS_DIRS+"/%s/%s", nom, tmp) == 2) return nom; ! return 0; ! } ! static int slow_shutdown() { ! write_file(DIR_LOGS "/audit", ! "Armageddon loaded by master: "+ctime(time())+".\n"); ! EVENTS_D->eventRebootMud(2); ! return 1; ! } ! int save_ed_setup(object who, int code) { ! string file; ! if(!intp(code)) return 0; ! rm(file = user_path((string)who->GetKeyName())+".edrc"); ! return write_file(file, code+""); ! } ! int retrieve_ed_setup(object who) { ! string file; ! file = user_path((string)who->GetKeyName())+".edrc"; ! if(!file_exists(file)) return 0; ! return to_int(read_file(file)); ! } ! string get_save_file_name(string file) { ! string str; ! str = (string)this_player(1)->GetKeyName(); ! if(file_size(user_path(str)) == -2) ! return user_path(str)+"dead.edit"; ! else return DIR_TMP+"/"+str+".dead.edit"; ! } ! int is_locked() { return MUD_IS_LOCKED; } ! string *parse_command_id_list() { return ({ "one", "thing" }); } ! string *parse_command_plural_id_list() { return ({ "ones", "things","them"}); } ! string *parse_command_adjectiv_id_list() { ! return ({ "the", "an", "a" }); ! } ! string *parse_command_prepos_list() { ! return ({ "in", "with", "without", "into", "for", "on", "under", "against", ! "out", "within", "of", "from", "between", "at", "to", "over", "near", ! "inside", "onto", "off", "through", "across", "up", "down", "every", ! "around", "about", "only", "here", "room", "exit", "enter", "-r", "-a"}); ! } ! string parse_command_all_word() { return "all"; } ! string parser_error_message(int type, object ob, mixed arg, int flag) { ! string err; ! if( ob ) err = (string)ob->GetShort(); ! else err = ""; ! switch(type) { ! case ERR_IS_NOT: ! if( flag ) err = "There is no such " + remove_article(arg) + " here."; ! else err = "There is no " + remove_article(arg) + " here."; ! break; ! case ERR_NOT_LIVING: ! if( flag ) ! err = "None of the " + pluralize(remove_article(arg)) +" are alive."; ! else err = "The " + remove_article(arg) + " is not alive."; ! break; ! case ERR_NOT_ACCESSIBLE: ! if( flag ) err = "You can't get to them."; ! else err = "You can't get to it."; ! break; ! case ERR_AMBIG: ! { ! mixed *obs; ! int i; ! obs = unique_array(arg, (: (string)$1->GetShort() :)); ! if( sizeof(obs) == 1 ) ! err = "Which of the " + ! consolidate(sizeof(arg), (string)obs[0][0]->GetShort()) + ! " do you mean?"; ! else { ! err = "Do you mean "; ! for(i = 0; i<sizeof(obs); i++) { ! if( sizeof(obs[i]) > 1 ) ! err += "one of the " + ! consolidate(sizeof(obs[i]),(string)obs[i][0]->GetShort()); ! else err += (string)obs[i][0]->GetShort(); ! if( i == (sizeof(obs)-2) ) err += " or "; ! else if( i < sizeof(obs) - 1 ) err += ", "; ! } ! err += "?"; ! } ! return err; ! } ! case ERR_ORDINAL: ! if( arg > 1 ) err = "There are only " + arg + " of them."; ! else err = "There is only one of them."; ! break; ! case ERR_ALLOCATED: ! return arg; ! case ERR_THERE_IS_NO: ! return "There is no " + remove_article(arg) + " here."; ! case ERR_BAD_MULTIPLE: ! return "You can't do that to more than one at a time."; ! } ! return err; ! } ! void create_save() { ! string str; ! if(!stringp(str = (string)previous_object()->GetKeyName())) return; ! if(file_size(DIR_PLAYERS+"/"+str[0..0]) == -2) return; ! if(str[0] < 'a' || str[0] > 'z') return; ! mkdir(DIR_PLAYERS+"/"+str[0..0]); ! } ! object player_object(string nom) { ! object ob; ! string err, tmp; ! int old_limit; ! tmp = base_name(ob = previous_object()); ! if( tmp != CMD_ENCRE && tmp != CMD_DECRE && tmp != LIB_CONNECT ) ! return 0; ! old_limit = max_eval_cost(); ! set_eval_limit(1000000000); ! NewPlayer = ob; ! if(file_size(DIR_CRES+ "/" + nom[0..0]+ "/" +nom+__SAVE_EXTENSION__) > -1) ! err = catch(ob = load_object(DIR_CRES+"/"+nom[0..0]+"/"+nom)); ! else err = catch(ob = load_object(DIR_PLAYERS+"/"+nom[0..0]+"/"+nom)); ! NewPlayer = 0; ! set_eval_limit(old_limit); ! if(err) error(err); ! return ob; ! } ! ! string player_save_file(string nom) { ! string tmp; ! ! tmp = DIR_CRES + "/" + nom[0..0] + "/" + nom; ! if( file_size(tmp + __SAVE_EXTENSION__) > -1 ) return tmp; ! else return DIR_PLAYERS + "/" + nom[0..0] + "/" + nom; ! } ! ! string *query_group(string grp) { return copy(Groups[grp]); } ! ! mapping query_groups() { return copy(Groups); } ! ! static void eventReset() { ! object *obs; ! object ob; ! int x, y; ! ! ResetNumber++; ! call_out( (: eventReset :), TIME_TO_RESET ); ! x = reclaim_objects(); ! write_file(DIR_LOGS "/reset", "Reset " + ResetNumber + " occurred at: " + ! ctime(time()) + "\n"); ! obs = objects( (: !environment($1) && (random(100) < 26) :) ); ! y = 0; ! foreach(ob in obs) { ! function f; ! ! if( !ob ) { ! y++; ! continue; ! } ! f = bind( (: call_other, ob, "clean_up" :), ob ); ! if( f ) catch(evaluate(f)); ! if( !ob ) { ! y++; ! continue; ! } ! f = bind((: call_other, ob, "reset", ResetNumber :), ob); ! if( f ) catch(evaluate(f)); ! } ! write_file(DIR_LOGS "/reset", "\t" + x + " objects reclaimed, " + ! (sizeof(obs) - y) + " objects reset, " + y + " objects " ! "cleaned.\n"); ! } ! int GetResetNumber() { return ResetNumber; } ! object *parse_command_users() { ! return filter(users(), (: creatorp($1) || (int)$1->is_living() :)); ! } diff -c -r --new-file ds1.1/lib/secure/daemon/options.c ds2.0r27/lib/secure/daemon/options.c *** ds1.1/lib/secure/daemon/options.c Sun Feb 1 21:30:42 1998 --- ds2.0r27/lib/secure/daemon/options.c Wed Jul 5 00:48:29 2006 *************** *** 20,40 **** daemon::create(); SetNoClean(1); __MyGroups = ([]); ! __Options = ([]); __Owner = 0; } static private int valid_access() { switch(base_name(previous_object(0))) { ! case OBJ_POST: case FOLDERS_D: case LETTERS_D: ! case LOCALPOST_D: case REMOTEPOST_D: case OPTIONS_D: ! return 1; ! default: return 0; } } void assure_box_exists(string who) { ! string tmp, file; if(!valid_access()) return; if(__Owner == who) return; --- 20,40 ---- daemon::create(); SetNoClean(1); __MyGroups = ([]); ! __Options = (["notify" : 1]); __Owner = 0; } static private int valid_access() { switch(base_name(previous_object(0))) { ! case OBJ_POST: case FOLDERS_D: case LETTERS_D: ! case LOCALPOST_D: case REMOTEPOST_D: case OPTIONS_D: ! return 1; ! default: return 0; } } void assure_box_exists(string who) { ! string file; if(!valid_access()) return; if(__Owner == who) return; *************** *** 45,71 **** file = DIR_POSTAL+"/"+who[0..0]+"/"+who; if(unguarded((: file_size, file :)) != -2) unguarded((: mkdir, file :)); __MyGroups = ([]); ! __Options = ([]); __Owner = who; unguarded((: save_object, file+"/postalrc" :)); } static private void load_options(string who) { string file; - if(who == __Owner) return; this_object()->assure_box_exists(who); if(__Owner == who) { ! return; ! } __Owner = who; file = DIR_POSTAL+"/"+who[0..0]+"/"+who+"/postalrc"; unguarded((: restore_object, file :)); ! } static private void save_options() { string file; - file = DIR_POSTAL+"/"+__Owner[0..0]+"/"+__Owner+"/postalrc"; unguarded((: save_object, file :)); } --- 45,69 ---- file = DIR_POSTAL+"/"+who[0..0]+"/"+who; if(unguarded((: file_size, file :)) != -2) unguarded((: mkdir, file :)); __MyGroups = ([]); ! __Options = (["notify":1]); __Owner = who; unguarded((: save_object, file+"/postalrc" :)); } static private void load_options(string who) { string file; if(who == __Owner) return; this_object()->assure_box_exists(who); if(__Owner == who) { ! return; ! } __Owner = who; file = DIR_POSTAL+"/"+who[0..0]+"/"+who+"/postalrc"; unguarded((: restore_object, file :)); ! } static private void save_options() { string file; file = DIR_POSTAL+"/"+__Owner[0..0]+"/"+__Owner+"/postalrc"; unguarded((: save_object, file :)); } *************** *** 76,82 **** __Options[option] = value; save_options(); } ! mixed query_option(string who, string option) { string tmp; --- 74,80 ---- __Options[option] = value; save_options(); } ! mixed query_option(string who, string option) { string tmp; *************** *** 101,116 **** if(!members) map_delete(__MyGroups, group); else __MyGroups[group] = members; save_options(); ! } string *query_group(string who, string group) { if(!valid_access()) return ({}); load_options(who); return copy(__MyGroups[group]); ! } mapping query_groups(string who) { if(!valid_access()) return ([]); load_options(who); return copy(__MyGroups); ! } --- 99,114 ---- if(!members) map_delete(__MyGroups, group); else __MyGroups[group] = members; save_options(); ! } string *query_group(string who, string group) { if(!valid_access()) return ({}); load_options(who); return copy(__MyGroups[group]); ! } mapping query_groups(string who) { if(!valid_access()) return ([]); load_options(who); return copy(__MyGroups); ! } diff -c -r --new-file ds1.1/lib/secure/daemon/ping.c ds2.0r27/lib/secure/daemon/ping.c *** ds1.1/lib/secure/daemon/ping.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/daemon/ping.c Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,70 ---- + #include <lib.h> + #include <config.h> + #include <rooms.h> + #include <daemons.h> + + inherit LIB_DAEMON; + + int Pinging = 0; + int OK = 0; + int Retries = 0; + + string *muds = PINGING_MUDS; + + int CheckOK(){ + Pinging = 0; + if(!OK){ + //tc("not ok"); + Retries++; + update("/daemon/intermud"); + } + else { + if(Retries > 0){ + tell_room(ROOM_ARCH,"The Arch Room loudspeaker announces: \"%^BOLD%^CYAN%^" + "Intermud connection is %^BOLD%^GREEN%^ONLINE%^BOLD%^CYAN%^.%^RESET%^\""); + load_object(ROOM_ARCH)->SetImud(1); + } + + Retries = 0; + //tc("ok"); + } + if(Retries == 2){ + tell_room(ROOM_ARCH,"The Arch Room loudspeaker announces: \"%^BOLD%^CYAN%^" + "Intermud connection is %^BOLD%^RED%^OFFLINE%^BOLD%^CYAN%^.%^RESET%^\""); + rm("/tmp/muds.txt"); + load_object(ROOM_ARCH)->SetImud(0); + } + return 1; + } + + int eventPing(){ + Pinging = 1; + OK = 0; + + if(!sizeof(muds)) { + Pinging = 0; + return 0; + } + + foreach(string mud in muds){ + INTERMUD_D->eventWrite(({ "auth-mud-req", 5, mud_name(), 0, mud, 0 })); + } + call_out( (: CheckOK :), 10); + call_out( (: eventPing :), 900); + return 1; + } + + void create() { + daemon::create(); + SetNoClean(1); + call_out( (: eventPing :), 20); + } + + int GetPinging(){ + return Pinging; + } + + int SetOK(){ + OK = 1; + load_object(ROOM_ARCH)->SetImud(1); + } diff -c -r --new-file ds1.1/lib/secure/daemon/player.c ds2.0r27/lib/secure/daemon/player.c *** ds1.1/lib/secure/daemon/player.c Sun Feb 1 21:30:42 1998 --- ds2.0r27/lib/secure/daemon/player.c Wed Dec 31 19:00:00 1969 *************** *** 1,74 **** - // /adm/daemon/player_d.c - // from the Dead Souls Mudlib - // a daemon to keep track of player progress - // created by Descartes of Borg 10 july 1993 - - #include <objects.h> - #include <save.h> - - string *monsters; - mapping *player_list; - - void create() { - monsters = ({}); - player_list = ({}); - if(unguarded((: file_exists, SAVE_PLAYER_LIST+__SAVE_EXTENSION__ :))) - unguarded((: restore_object, SAVE_PLAYER_LIST :)); - } - - mapping *query_player_list() { return player_list; } - - void add_player_info() { - int exp, x; - object ob; - int i; - - if(!(ob = previous_object()) || !userp(ob)) return; - if(creatorp(ob)) { - i = sizeof(player_list); - while(i--) - if(player_list[i]["name"] == (string)ob->GetKeyName() && creatorp(ob)) - player_list -= ({ player_list[i] }); - return; - } - x = -1; - i = sizeof(player_list); - while(i--) if(player_list[i]["name"] == (string)ob->GetKeyName()) x = i; - if((sizeof(player_list) == 20) && (x == -1) && - (((int)ob->query_exp()) < player_list[19]["experience"])) - return; - if(x > -1) player_list -= ({ player_list[x] }); - player_list += ({ ([ "name":(string)ob->GetKeyName(), "experience":(int)ob->query_exp(), - "kills":sizeof((string *)ob->query_kills()), - "deaths": sizeof((mixed *)ob->query_deaths()), - "quests": sizeof((string *)ob->query_quests()), - "major accomplishments": sizeof((mixed *)ob->query_mini_quests()), - "level": (int)ob->query_level(), - "class": (string)ob->query_class(), - "guild": (string)ob->query_guild() - ]) }); - player_list = sort_array(player_list, "sort_list", this_object()); - if(sizeof(player_list) > 20) player_list = player_list[0..19]; - unguarded((: save_object, SAVE_PLAYER_LIST :)); - } - - int sort_list(mapping alpha, mapping beta) { - if(alpha["experience"] > beta["experience"]) return -1; - else if(alpha["experience"] < beta["experience"]) return 1; - else return strcmp(alpha["name"], beta["name"]); - } - - int add_kill(string str) { - int x; - - if(!userp(previous_object(0)) || !stringp(str)) return -1; - if(!monsters) monsters = ({}); - if((x=member_array(str, monsters)) == -1) { - monsters += ({ str }); - x = member_array(str, monsters); - unguarded((: save_object, SAVE_PLAYER_LIST :)); - } - return x; - } - - string query_monster(int x) { return monsters[x]; } --- 0 ---- diff -c -r --new-file ds1.1/lib/secure/daemon/players.c ds2.0r27/lib/secure/daemon/players.c *** ds1.1/lib/secure/daemon/players.c Sun Feb 1 21:30:40 1998 --- ds2.0r27/lib/secure/daemon/players.c Wed Jul 5 00:01:05 2006 *************** *** 1,43 **** ! /* /secure/daemon/players.c ! * from the Dead Soulsr1 Object Library ! * a player management system ! * created by Descartes of Borg 950926 ! * Version: @(#) players.c 1.2@(#) ! * Last modified: 96/10/12 ! */ ! ! #include <lib.h> ! #include <privs.h> ! #include "players.h" ! ! inherit LIB_DAEMON; ! ! static void create() { } ! ! varargs int RemovePlayer(string str) { ! object who; ! ! if( !str ) { /* this is for suicide and undead death */ ! string file, backup; ! ! if( !(who = previous_object()) || creatorp(who) ) return 0; ! file = save_file((string)who->GetKeyName()) + __SAVE_EXTENSION__; ! backup = DIR_SECURE_SAVE "/backup/" + who->GetKeyName() + "." + time(); ! return unguarded( (: rename($(file), $(backup)) :) ); } - else { - string file; ! if( !user_exists(str) ) return 0; ! if( member_group(str, PRIV_SECURE) || member_group(str, PRIV_ASSIST) ) ! return 0; ! who = find_player(str); ! file = save_file(str) + __SAVE_EXTENSION__; ! if( who ) { ! message("system", "You have been removed from " + mud_name() + ".", ! who); ! who->eventDestruct(); } ! return rm(file); } } --- 1,157 ---- ! #include <objects.h> ! #include <save.h> ! #include <dirs.h> ! ! mapping PlayerDataMap = ([]); ! string *PendingEncres = ({}); ! string *PendingDecres = ({}); ! string *players = ({}); ! string *creators = ({}); ! string *user_list = ({}); ! ! string player_save_file; ! ! void create() { ! if(unguarded((: file_exists, SAVE_PLAYER_LIST+__SAVE_EXTENSION__ :))) ! unguarded((: restore_object, SAVE_PLAYER_LIST :)); ! PendingEncres = singular_array(PendingEncres); ! PendingDecres = singular_array(PendingDecres); ! players = singular_array(players); ! creators = singular_array(creators); ! user_list = singular_array(user_list); ! unguarded((: save_object, SAVE_PLAYER_LIST :)); ! ! } ! ! string *eventCre(string str){ ! str = lower_case(str); ! if(member_array(str,creators) == -1) creators += ({ str }); ! if(member_array(str,players) != -1) players -= ({ str }); ! unguarded((: save_object, SAVE_PLAYER_LIST :)); ! return creators; ! } ! ! string *eventDecre(string str){ ! str = lower_case(str); ! if(member_array(str,creators) != -1) creators -= ({ str }); ! if(member_array(str,players) == -1) players += ({ str }); ! unguarded((: save_object, SAVE_PLAYER_LIST :)); ! return players; ! } ! ! void AddPlayerInfo(mixed arg) { ! ! if(!objectp(arg) && !stringp(arg)) return ; ! ! if(objectp(arg)){ ! if(!interactive(arg)) return; ! else player_save_file = base_name(arg)+".o"; } ! else { ! arg = lower_case(arg); ! if(last(arg,2) != ".o") arg += ".o"; ! if(!grepp(arg,"/")){ ! string initial = arg[0..0]; ! player_save_file = DIR_CRES +"/"+initial+"/"+arg; ! if(!file_exists(player_save_file)) ! player_save_file = DIR_PLAYERS +"/"+initial+"/"+arg; ! if(!file_exists(player_save_file)) return; } ! else player_save_file = arg; ! if(grepp(DIR_CRES, player_save_file)) creators += ({ replace_string(last_string_element(player_save_file,"/"),".o","") }) ; ! else players += ({ replace_string(last_string_element(player_save_file,"/"),".o","") }) ; ! if(!file_exists(player_save_file)) return; } + + //tc("player_save_file: "+player_save_file); + user_list += ({ replace_string(last_string_element(player_save_file,"/"),".o","") }) ; + unguarded((: save_object, SAVE_PLAYER_LIST :)); } + + string *GetPlayerList(){ + return players; + } + + string *GetCreatorList(){ + return creators; + } + + string *GetUserList(){ + return user_list; + } + + int RemoveUser(string str){ + if(!str || str == "") return 0; + str = lower_case(str); + if(!user_exists(str)) return 0; + if(member_array(str, players) != -1) players -= ({ str }); + if(member_array(str, creators) != -1) creators -= ({ str }); + if(member_array(str, user_list) != -1) user_list -= ({ str }); + return 1; + } + + string *AddPendingEncre(string str){ + if(catch((int)master()->valid_apply()) || + !(int)master()->valid_apply(({ "SECURE", "ASSIST", "LIB_CONNECT" })) ){ + string offender = identify(previous_object(-1)); + debug("SECURITY VIOLATION: "+offender+" ",get_stack(),"red"); + log_file("security", "\n"+timestamp()+" AddPendingEncre breach: "+offender+" "+get_stack()); + return ({}); + } + if(str && str != "") PendingEncres += ({ lower_case(str) }); + unguarded((: save_object, SAVE_PLAYER_LIST :)); + return PendingEncres; + } + + string *RemovePendingEncre(string str){ + if(catch((int)master()->valid_apply()) || + !(int)master()->valid_apply(({ "SECURE", "ASSIST", "LIB_CONNECT" })) ){ + string offender = identify(previous_object(-1)); + debug("SECURITY VIOLATION: "+offender+" ",get_stack(),"red"); + log_file("security","\n"+ timestamp()+" RemovePendingEncre breach: "+offender+" "+get_stack()); + return ({}); + } + if(!str || str == "") return PendingEncres; + str = lower_case(str); + if(member_array(str, PendingEncres) != -1) PendingEncres -= ({ lower_case(str) }); + unguarded((: save_object, SAVE_PLAYER_LIST :)); + return PendingEncres; + } + + string *GetPendingEncres(){ + return PendingEncres; + } + + string *AddPendingDecre(string str){ + if(catch((int)master()->valid_apply()) || + !(int)master()->valid_apply(({ "SECURE", "ASSIST", "LIB_CONNECT" })) ){ + string offender = identify(previous_object(-1)); + debug("SECURITY VIOLATION: "+offender+" ",get_stack(),"red"); + log_file("security", "\n"+timestamp()+" AddPendingDecre breach: "+offender+" "+get_stack()); + return ({}); + } + if(str && str != "") PendingDecres += ({ lower_case(str) }); + unguarded((: save_object, SAVE_PLAYER_LIST :)); + return PendingDecres; + } + + string *RemovePendingDecre(string str){ + if(catch((int)master()->valid_apply()) || + !(int)master()->valid_apply(({ "SECURE", "ASSIST", "LIB_CONNECT" })) ){ + string offender = identify(previous_object(-1)); + debug("SECURITY VIOLATION: "+offender+" ",get_stack(),"red"); + log_file("security", "\n"+timestamp()+" RemovePendingDecre breach: "+offender+" "+get_stack()); + return ({}); + } + if(!str || str == "") return PendingDecres; + str = lower_case(str); + if(member_array(str, PendingDecres) != -1) PendingDecres -= ({ lower_case(str) }); + unguarded((: save_object, SAVE_PLAYER_LIST :)); + return PendingDecres; + } + + string *GetPendingDecres(){ + return PendingDecres; + } + diff -c -r --new-file ds1.1/lib/secure/daemon/players.h ds2.0r27/lib/secure/daemon/players.h *** ds1.1/lib/secure/daemon/players.h Sun Feb 1 21:30:42 1998 --- ds2.0r27/lib/secure/daemon/players.h Wed Dec 31 19:00:00 1969 *************** *** 1,7 **** - #ifndef l_players_h - #define l_players_h - - static void create(); - varargs int RemovePlayer(string str); - - #endif /* l_players_h */ --- 0 ---- diff -c -r --new-file ds1.1/lib/secure/daemon/remote.c ds2.0r27/lib/secure/daemon/remote.c *** ds1.1/lib/secure/daemon/remote.c Sun Feb 1 21:30:43 1998 --- ds2.0r27/lib/secure/daemon/remote.c Wed Jul 5 00:01:05 2006 *************** *** 22,36 **** static void Setup() { if( eventCreateSocket(PORT_RCP) < 0 ) { ! if( this_object() ) Destruct(); ! return; } } static void eventSocketClosed(int fd) { map_delete(Connections, fd); } ! static void eventRead(int fd, string str) { if( !str ) { eventWrite(fd, "50 Invalid command.\n", 1); --- 22,36 ---- static void Setup() { if( eventCreateSocket(PORT_RCP) < 0 ) { ! if( this_object() ) Destruct(); ! return; } } static void eventSocketClosed(int fd) { map_delete(Connections, fd); } ! static void eventRead(int fd, string str) { if( !str ) { eventWrite(fd, "50 Invalid command.\n", 1); *************** *** 56,62 **** if( !(len = strlen(Connections[fd]["buffer"])) ) return; if( len == Connections[fd]["in edit"] ) { tmp = Connections[fd]["object"]->eventWriteFile(Connections[fd]["file"], ! Connections[fd]["buffer"]); eventWrite(fd, tmp + "\n"); Connections[fd]["in edit"] = 0; Connections[fd]["file"] = ""; --- 56,62 ---- if( !(len = strlen(Connections[fd]["buffer"])) ) return; if( len == Connections[fd]["in edit"] ) { tmp = Connections[fd]["object"]->eventWriteFile(Connections[fd]["file"], ! Connections[fd]["buffer"]); eventWrite(fd, tmp + "\n"); Connections[fd]["in edit"] = 0; Connections[fd]["file"] = ""; *************** *** 65,71 **** } else if( len > Connections[fd]["in edit"] ) { string tmp1, tmp2; ! tmp1 =Connections[fd]["buffer"][0..(Connections[fd]["in edit"]-1)]; tmp2 =Connections[fd]["buffer"][Connections[fd]["in edit"]..]; Connections[fd]["buffer"] = ""; --- 65,71 ---- } else if( len > Connections[fd]["in edit"] ) { string tmp1, tmp2; ! tmp1 =Connections[fd]["buffer"][0..(Connections[fd]["in edit"]-1)]; tmp2 =Connections[fd]["buffer"][Connections[fd]["in edit"]..]; Connections[fd]["buffer"] = ""; *************** *** 80,86 **** if( (x = strsrch(Connections[fd]["buffer"], "\n")) == -1 ) return; str = Connections[fd]["buffer"][0..(x-1)]; if( x != strlen(Connections[fd]["buffer"]) - 1 ) ! Connections[fd]["buffer"] = Connections[fd]["buffer"][(x+1)..]; else Connections[fd]["buffer"] = ""; if( sscanf(str, "%s %s", cmd, arg) != 2) { cmd = replace_string(str, "\r", ""); --- 80,86 ---- if( (x = strsrch(Connections[fd]["buffer"], "\n")) == -1 ) return; str = Connections[fd]["buffer"][0..(x-1)]; if( x != strlen(Connections[fd]["buffer"]) - 1 ) ! Connections[fd]["buffer"] = Connections[fd]["buffer"][(x+1)..]; else Connections[fd]["buffer"] = ""; if( sscanf(str, "%s %s", cmd, arg) != 2) { cmd = replace_string(str, "\r", ""); *************** *** 100,122 **** map_delete(Connections, fd); return; } ! username = convert_name(username); if( !user_exists(username) ) { eventWrite(fd, "50 Login failed.\n", 1); map_delete(Connections, fd); return; } unguarded( (: restore_object, DIR_CRES "/" + username[0..0] + "/" + ! username :) ); if( Password != crypt(password, Password) ) { log_file("remote", "Failed attempt to login as " + username ! + "\n"); eventWrite(fd, "50 Login failed.\n", 1); map_delete(Connections, fd); return; } if( !(Connections[fd]["object"] = ! load_object(user_path(username) + "adm/remote")) ) { eventWrite(fd, "50 Failed to load remote object.\n", 1); map_delete(Connections, fd); return; --- 100,122 ---- map_delete(Connections, fd); return; } ! username = convert_name(username); if( !user_exists(username) ) { eventWrite(fd, "50 Login failed.\n", 1); map_delete(Connections, fd); return; } unguarded( (: restore_object, DIR_CRES "/" + username[0..0] + "/" + ! username :) ); if( Password != crypt(password, Password) ) { log_file("remote", "Failed attempt to login as " + username ! + "\n"); eventWrite(fd, "50 Login failed.\n", 1); map_delete(Connections, fd); return; } if( !(Connections[fd]["object"] = ! load_object(user_path(username) + "adm/remote")) ) { eventWrite(fd, "50 Failed to load remote object.\n", 1); map_delete(Connections, fd); return; *************** *** 127,161 **** int sz; if( sscanf(arg, "%d %s", sz, Connections[fd]["file"]) != 2 ) ! eventWrite(fd, "50 Bad file send command.\n"); else { if( !sz ) eventWrite(fd, "110 No changes sent orwritten.\n"); else Connections[fd]["in edit"] = sz; } } else switch( cmd ) { ! case "edit": ! file = (string)Connections[fd]["object"]->eventReadFile(arg); ! if( file[<1] != '\n' ) file += "\n"; ! tmp = sprintf( "%-14s\n", "100 " + strlen(file)); ! eventWrite(fd, tmp[0..15]); ! eventWrite(fd, file); ! break; ! case "ls": ! val = (string)Connections[fd]["object"]->eventCommand(cmd, arg); ! if( val ) eventWrite(fd, "500 " + val + "\n"); ! else eventWrite(fd, "50 " +cmd+ " " +arg+ ": Permission denied.\n"); ! break; ! case "update": ! val = (string)Connections[fd]["object"]->eventCommand(cmd, arg); ! if( val ) eventWrite(fd, "510 " + val + "\n"); ! else eventWrite(fd, "50 Update attempt went off into nowhere.\n"); ! break; ! default: ! val = (string)Connections[fd]["object"]->eventCommand(cmd, arg); ! if( val ) eventWrite(fd, "400 " + val + "\n"); ! else eventWrite(fd, "50 "+cmd+" "+arg+": Command not supported.\n"); ! break; } eventProcess(fd, ""); } --- 127,161 ---- int sz; if( sscanf(arg, "%d %s", sz, Connections[fd]["file"]) != 2 ) ! eventWrite(fd, "50 Bad file send command.\n"); else { if( !sz ) eventWrite(fd, "110 No changes sent orwritten.\n"); else Connections[fd]["in edit"] = sz; } } else switch( cmd ) { ! case "edit": ! file = (string)Connections[fd]["object"]->eventReadFile(arg); ! if( file[<1] != '\n' ) file += "\n"; ! tmp = sprintf( "%-14s\n", "100 " + strlen(file)); ! eventWrite(fd, tmp[0..15]); ! eventWrite(fd, file); ! break; ! case "ls": ! val = (string)Connections[fd]["object"]->eventCommand(cmd, arg); ! if( val ) eventWrite(fd, "500 " + val + "\n"); ! else eventWrite(fd, "50 " +cmd+ " " +arg+ ": Permission denied.\n"); ! break; ! case "update": ! val = (string)Connections[fd]["object"]->eventCommand(cmd, arg); ! if( val ) eventWrite(fd, "510 " + val + "\n"); ! else eventWrite(fd, "50 Update attempt went off into nowhere.\n"); ! break; ! default: ! val = (string)Connections[fd]["object"]->eventCommand(cmd, arg); ! if( val ) eventWrite(fd, "400 " + val + "\n"); ! else eventWrite(fd, "50 "+cmd+" "+arg+": Command not supported.\n"); ! break; } eventProcess(fd, ""); } diff -c -r --new-file ds1.1/lib/secure/daemon/remotepost.c ds2.0r27/lib/secure/daemon/remotepost.c *** ds1.1/lib/secure/daemon/remotepost.c Sun Feb 1 21:30:43 1998 --- ds2.0r27/lib/secure/daemon/remotepost.c Wed Jul 5 00:01:05 2006 *************** *** 9,15 **** #include <save.h> #include <daemons.h> #include "remotepost.h" ! inherit LIB_DAEMON; private mapping __MailQueue; --- 9,15 ---- #include <save.h> #include <daemons.h> #include "remotepost.h" ! inherit LIB_DAEMON; private mapping __MailQueue; *************** *** 18,146 **** void create() { string *muds; int i; ! daemon::create(); SetNoClean(1); __MailQueue = ([]); __IncomingMail = ([]); if(file_exists(sprintf("%s%s", SAVE_MAILQUEUE, __SAVE_EXTENSION__))) ! restore_mailqueue(); i = sizeof(muds = keys(__MailQueue)); while(i--) __MailQueue[muds[i]][0]["in transit"] = 0; ! } ! string postal_check(string mud) { if(file_name(previous_object()) != SERVICES_D) return 0; if(!__MailQueue[mud = replace_string(lower_case(mud), " ", ".")]) return 0; if(__MailQueue[mud][0]["in transit"]) return 0; __MailQueue[mud][0]["in transit"] = 1; return __MailQueue[mud][0]["post"][0]; ! } ! string next_post(string mud) { int x; if(file_name(previous_object(0)) != SERVICES_D) return 0; ! if(!__MailQueue[mud = replace_string(lower_case(mud), " ", ".")]) return 0; x = __MailQueue[mud][0]["in transit"]++; if(sizeof(__MailQueue[mud][0]["post"]) == x) { ! if( !sizeof(__MailQueue[mud] = __MailQueue[mud][1..]) ) ! map_delete(__MailQueue, mud); ! save_mailqueue(); ! return 0; ! } return __MailQueue[mud][0]["post"][x]; ! } ! string resend_post(string mud) { if(file_name(previous_object(0)) != SERVICES_D) return 0; if(!__MailQueue[mud = replace_string(lower_case(mud), " ", ".")]) return 0; __MailQueue[mud][0]["in transit"] = 1; return __MailQueue[mud][0]["post"][0]; ! } ! void send_post(mapping borg, string mud) { string *msg, *tmp; int i, maxi, x, y; ! borg["to"] = convert_names(borg["to"]); borg["cc"] = convert_names(borg["cc"]); borg["from"] = sprintf("%s@%s", convert_name(borg["from"]), mud_name()); tmp = ({ sprintf("||WIZTO:%s||WIZFROM:%s%s||SUBJECT:%s||DATE:%d||MSG:", ! implode(borg["to"], ","), borg["from"], ! (sizeof(borg["cc"]) ? implode(borg["cc"], ",") : ""), borg["subject"], ! time()) }); msg = explode(borg["message"], "\n"); for(i=0, maxi = sizeof(msg); i<maxi; i++) { ! if((y=strlen(tmp[x])) > 200) { ! x++; ! tmp += ({ "||MSG:" }); ! } ! tmp[x] += sprintf("%s\n", msg[i]); ! } tmp[x] += "||ENDMSG:1"; if(!__MailQueue[mud]) ! __MailQueue[mud] = ({ ([ "in transit": 0, "post": tmp ]) }); else __MailQueue[mud] += ({ ([ "in transit": 0, "post": tmp ]) }); SERVICES_D->new_mail(mud); save_mailqueue(); ! } ! int incoming_post(mapping info) { mapping borg; ! if(file_name(previous_object(0)) != SERVICES_D) return 0; info["NAME"] = replace_string(lower_case(info["NAME"]), " ", "."); if(info["WIZTO"]) __IncomingMail[info["NAME"]] = info; else { ! if(!__IncomingMail[info["NAME"]]) return 0; ! else __IncomingMail[info["NAME"]]["MSG"] += info["MSG"]; ! } borg = ([]); if(info["ENDMSG"]) { ! borg["to"] = __IncomingMail[info["NAME"]]["WIZTO"]; ! borg["cc"] = __IncomingMail[info["NAME"]]["CC"]; ! borg["from"] = __IncomingMail[info["NAME"]]["WIZFROM"]; ! borg["subject"] = __IncomingMail[info["NAME"]]["SUBJECT"]; ! borg["message"] = __IncomingMail[info["NAME"]]["MSG"]; ! borg["date"] = __IncomingMail[info["NAME"]]["DATE"]; ! LOCALPOST_D->send_post(copy(borg), ! local_targets(distinct_array(borg["to"] + borg["cc"]))); ! map_delete(__IncomingMail, info["NAME"]); ! } return 1; ! } ! static private string *local_targets(string *str) { string a, b; int i; ! i = sizeof(str); while(i--) { ! sscanf(str[i], "%s@%s", a, b); ! if(replace_string(lower_case(b), " ", ".") == ! replace_string(lower_case(mud_name()), " ", ".")) str[i] = a; } return str; ! } ! static private void save_mailqueue() { unguarded((: save_object, SAVE_MAILQUEUE :)); ! } ! static private void restore_mailqueue() { unguarded((: restore_object, SAVE_MAILQUEUE :)); ! } ! static private string *convert_names(string *noms) { string a, b; int i; i = sizeof(noms); while(i--) { ! if(sscanf(noms[i], "%s@%s", a, b) != 2) ! noms[i] = sprintf("%s@%s", noms[i], mud_name()); } return noms; } --- 18,146 ---- void create() { string *muds; int i; ! daemon::create(); SetNoClean(1); __MailQueue = ([]); __IncomingMail = ([]); if(file_exists(sprintf("%s%s", SAVE_MAILQUEUE, __SAVE_EXTENSION__))) ! restore_mailqueue(); i = sizeof(muds = keys(__MailQueue)); while(i--) __MailQueue[muds[i]][0]["in transit"] = 0; ! } ! string postal_check(string mud) { if(file_name(previous_object()) != SERVICES_D) return 0; if(!__MailQueue[mud = replace_string(lower_case(mud), " ", ".")]) return 0; if(__MailQueue[mud][0]["in transit"]) return 0; __MailQueue[mud][0]["in transit"] = 1; return __MailQueue[mud][0]["post"][0]; ! } ! string next_post(string mud) { int x; if(file_name(previous_object(0)) != SERVICES_D) return 0; ! if(!__MailQueue[mud = replace_string(lower_case(mud), " ", ".")]) return 0; x = __MailQueue[mud][0]["in transit"]++; if(sizeof(__MailQueue[mud][0]["post"]) == x) { ! if( !sizeof(__MailQueue[mud] = __MailQueue[mud][1..]) ) ! map_delete(__MailQueue, mud); ! save_mailqueue(); ! return 0; ! } return __MailQueue[mud][0]["post"][x]; ! } ! string resend_post(string mud) { if(file_name(previous_object(0)) != SERVICES_D) return 0; if(!__MailQueue[mud = replace_string(lower_case(mud), " ", ".")]) return 0; __MailQueue[mud][0]["in transit"] = 1; return __MailQueue[mud][0]["post"][0]; ! } ! void send_post(mapping borg, string mud) { string *msg, *tmp; int i, maxi, x, y; ! borg["to"] = convert_names(borg["to"]); borg["cc"] = convert_names(borg["cc"]); borg["from"] = sprintf("%s@%s", convert_name(borg["from"]), mud_name()); tmp = ({ sprintf("||WIZTO:%s||WIZFROM:%s%s||SUBJECT:%s||DATE:%d||MSG:", ! implode(borg["to"], ","), borg["from"], ! (sizeof(borg["cc"]) ? implode(borg["cc"], ",") : ""), borg["subject"], ! time()) }); msg = explode(borg["message"], "\n"); for(i=0, maxi = sizeof(msg); i<maxi; i++) { ! if((y=strlen(tmp[x])) > 200) { ! x++; ! tmp += ({ "||MSG:" }); ! } ! tmp[x] += sprintf("%s\n", msg[i]); ! } tmp[x] += "||ENDMSG:1"; if(!__MailQueue[mud]) ! __MailQueue[mud] = ({ ([ "in transit": 0, "post": tmp ]) }); else __MailQueue[mud] += ({ ([ "in transit": 0, "post": tmp ]) }); SERVICES_D->new_mail(mud); save_mailqueue(); ! } ! int incoming_post(mapping info) { mapping borg; ! if(file_name(previous_object(0)) != SERVICES_D) return 0; info["NAME"] = replace_string(lower_case(info["NAME"]), " ", "."); if(info["WIZTO"]) __IncomingMail[info["NAME"]] = info; else { ! if(!__IncomingMail[info["NAME"]]) return 0; ! else __IncomingMail[info["NAME"]]["MSG"] += info["MSG"]; ! } borg = ([]); if(info["ENDMSG"]) { ! borg["to"] = __IncomingMail[info["NAME"]]["WIZTO"]; ! borg["cc"] = __IncomingMail[info["NAME"]]["CC"]; ! borg["from"] = __IncomingMail[info["NAME"]]["WIZFROM"]; ! borg["subject"] = __IncomingMail[info["NAME"]]["SUBJECT"]; ! borg["message"] = __IncomingMail[info["NAME"]]["MSG"]; ! borg["date"] = __IncomingMail[info["NAME"]]["DATE"]; ! LOCALPOST_D->send_post(copy(borg), ! local_targets(distinct_array(borg["to"] + borg["cc"]))); ! map_delete(__IncomingMail, info["NAME"]); ! } return 1; ! } ! static private string *local_targets(string *str) { string a, b; int i; ! i = sizeof(str); while(i--) { ! sscanf(str[i], "%s@%s", a, b); ! if(replace_string(lower_case(b), " ", ".") == ! replace_string(lower_case(mud_name()), " ", ".")) str[i] = a; } return str; ! } ! static private void save_mailqueue() { unguarded((: save_object, SAVE_MAILQUEUE :)); ! } ! static private void restore_mailqueue() { unguarded((: restore_object, SAVE_MAILQUEUE :)); ! } ! static private string *convert_names(string *noms) { string a, b; int i; i = sizeof(noms); while(i--) { ! if(sscanf(noms[i], "%s@%s", a, b) != 2) ! noms[i] = sprintf("%s@%s", noms[i], mud_name()); } return noms; } diff -c -r --new-file ds1.1/lib/secure/daemon/snoop.c ds2.0r27/lib/secure/daemon/snoop.c *** ds1.1/lib/secure/daemon/snoop.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/daemon/snoop.c Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,269 ---- + #include <lib.h> + #include <privs.h> + #include <save.h> + #include <rooms.h> + #include <config.h> + + inherit LIB_DAEMON; + + int SnoopClean(); + + string *snooped = ({}); + object *snoopers = ({}); + string *monitored = ({}); + mapping Watchers = ([]); + int count = 0; + int just_loaded = 1; + object *prevusers; + + void eventLoadRogues(); + + static void create() { + daemon::create(); + debug("SNOOP_D restarted.","red"); + if( file_size( SAVE_SNOOP __SAVE_EXTENSION__ ) > 0 ) + unguarded( (: restore_object, SAVE_SNOOP, 1 :) ); + SetNoClean(1); + SnoopClean(); + set_heart_beat(1); + if(GLOBAL_MONITOR == 0 && sizeof(monitored)){ + call_out( (: eventLoadRogues :), 1); + } + snoopers = filter(objects(), (: base_name($1) == "/secure/obj/snooper" :) ); + prevusers = users(); + } + + void RegisterSnooper(){ + object registrant = previous_object(); + if(base_name(registrant) == "/secure/obj/snooper" && + member_array(registrant,snoopers) == -1) snoopers += ({ registrant }); + unguarded( (: save_object, SAVE_SNOOP, 1 :) ); + } + + void UnregisterSnooper(){ + object registrant = previous_object(); + if(base_name(registrant) == "/secure/obj/snooper" && + member_array(registrant,snoopers) != -1) snoopers -= ({ registrant }); + unguarded( (: save_object, SAVE_SNOOP, 1 :) ); + } + + void eventLoadRogues(){ + if( !((int)master()->valid_apply(({ PRIV_SECURE }))) ) return; + foreach(string rogue in monitored) this_object()->CheckBot(rogue); + snoopers = filter(objects(), (: base_name($1) == "/secure/obj/snooper" :) ); + } + + int CheckBot(string str){ + object cloan, foo; + int allset, already_watched = 0; + string *immune; + string name; + + //tc("hello."); + if(!str) str = "foo"; + str = lower_case(str); + foo = find_player(str); + if(sizeof(snoopers)){ + foreach(object snoopbox in snoopers){ + //tc("snooper: "+identify(snoopbox)); + //if(snoopbox && grepp("#",file_name(snoopbox)) ) { + if(clonep(snoopbox) ) { + //tc("snooped: "+ file_name(snoopbox)+": "+snoopbox->GetSnooped()+"\n","yellow"); + } + else snoopers -= ({snoopbox}); + if(snoopbox && snoopbox->GetSnooped() && snoopbox->GetSnooped() == str) { + already_watched = 1; + } + if(snoopbox->GetSnooped() && (!find_player(snoopbox->GetSnooped()) ||!(snoopbox->GetSnooped()))) { + } + } + } + if(!already_watched && foo && (GLOBAL_MONITOR > 0 || member_array(str, monitored) != -1 || member_array(str, snooped) != -1 )){ + if(archp(find_player(str)) && GLOBAL_MONITOR == 2) return 0; + //tc("already watched: "+already_watched); + cloan=new("/secure/obj/snooper"); + //tc("cloning : "+identify(cloan)); + cloan->eventStartSnoop(str); + } + //tc("query_snooping: "+identify(query_snooping(cloan))); + unguarded( (: save_object, SAVE_SNOOP, 1 :) ); + return 1; + } + + void CheckSnooped(){ + object *lusers = users(); + //if(!compare_array(lusers, prevusers) || just_loaded){ + just_loaded = 0; + foreach(object user in lusers){ + CheckBot(user->GetKeyName()); + } + //} + //else CheckBot("tanstaafl"); + prevusers = lusers; + } + + int SnoopClean(){ + snoopers = filter(objects(), (: base_name($1) == "/secure/obj/snooper" :) ); + if(sizeof(snoopers)){ + foreach(object snoopbox in snoopers){ + if(snoopbox && !clonep(snoopbox) ) { + snoopers -= ({snoopbox}); + } + else { + object subject; + string dude = snoopbox->GetSnooped(); + if(dude) subject = find_player(dude); + if(!dude || !subject || !query_snooping(snoopbox) || + (member_array(dude,snooped) == -1 && member_array(dude,monitored) == -1 && GLOBAL_MONITOR < 1 )){ + snoopbox->eventDestruct(); + snoopers -= ({snoopbox}); + } + } + } + } + return 1; + } + + int eventDestruct(){ + if( !((int)master()->valid_apply(({ "SECURE" }))) ) + error("Illegal attempt to destruct snoop: "+get_stack()+" "+identify(previous_object(-1))); + return ::eventDestruct(); + } + + + void heart_beat(){ + count++; + + //tc("snoop daemon heart_beat","green"); + if( !(count % 5) ) CheckSnooped(); + + if( !(count % 10)) { + foreach(object snoopbox in snoopers){ + if(!snoopbox) snoopers -= ({ snoopbox }); + } + SnoopClean(); + } + if(count > 100) count = 0; + } + + void reset(){ + //tc("Snoop daemon reset"); + if(query_heart_beat(this_object()) < 1) set_heart_beat(60); + CheckSnooped(); + } + + int GetSnoop(string target, string msg){ + if(target != "cratylus") { + } + if(base_name(previous_object()) != "/secure/obj/snooper") return 0; + else if(sizeof(Watchers[target])) { + foreach(string watcher in Watchers[target]){ + tell_player(watcher, target+"% "+msg); + } + } + else Watchers[target] = ({}); + return 1; + } + + int AddWatcher(string watcher, string target){ + if(!valid_snoop(find_player(watcher), find_player(target))) { + return 0; + } + if(Watchers[target] && member_array(watcher,Watchers[target]) != -1){ + return 0; + } + if(!Watchers[target] || !sizeof(Watchers[target])) { + Watchers[target] = ({ watcher }); + } + else { + Watchers[target] += ({ watcher }); + } + if(member_array(target,snooped) == -1) snooped += ({target}); + CheckBot(target); + unguarded( (: save_object, SAVE_SNOOP, 1 :) ); + return 1; + } + + int RemoveWatcher(string watcher, string target){ + if(!valid_snoop(find_player(watcher), find_player(target))) return 0; + if(this_player() && interactive(this_player())){ + if(this_player()->GetKeyName() != watcher && !archp(this_player())) return 0; + } + else return 0; + + if(!Watchers[target] || !sizeof(Watchers[target])) return 0; + else if(member_array(watcher, Watchers[target]) != -1) + Watchers[target] -= ({ watcher }); + if((!Watchers[target] || !sizeof(Watchers[target])) && + member_array(target, monitored) == -1) { + foreach(object snoopbox in snoopers){ + if(snoopbox->GetSnooped() == target) snoopbox->eventDestruct(); + } + } + if(!Watchers[target] || !sizeof(Watchers[target])) { + snooped -= ({target}); + if(Watchers[target]) map_delete(Watchers, target); + } + CheckBot("adsfgrertgrsgnfxmy"); + unguarded( (: save_object, SAVE_SNOOP, 1 :) ); + return 1; + } + + int AddMonitor(string requestor, string target){ + if(member_array(target, monitored) == -1) monitored += ({ target }); + unguarded( (: save_object, SAVE_SNOOP, 1 :) ); + CheckBot(target); + return 1; + } + + int RemoveMonitor(object requestor, string target){ + if(!archp(requestor)) return 0; + monitored -= ({ target }); + unguarded( (: save_object, SAVE_SNOOP, 1 :) ); + if(Watchers[target] && sizeof(Watchers[target])) return 1; + foreach(object snoopbox in snoopers){ + if(snoopbox->GetSnooped() == target) snoopbox->eventDestruct(); + } + if(Watchers[target] && !sizeof(Watchers[target])) map_delete(Watchers, target); + CheckBot("asreg54eqwhtrbsf"); + unguarded( (: save_object, SAVE_SNOOP, 1 :) ); + return 1; + } + + int ReportLinkDeath(string str){ + if(!find_player(str)){ + foreach(object snoopbox in snoopers){ + if(snoopbox->GetSnooped() == str) snoopbox->eventDestruct(); + } + map_delete(Watchers, str); + unguarded( (: save_object, SAVE_SNOOP, 1 :) ); + return 1; + } + return 0; + } + + int ReportReconnect(string str){ + if(base_name(previous_object()) == LIB_CONNECT){ + foreach(object snoopbox in snoopers){ + if(snoopbox->GetSnooped() == str) snoopbox->eventDestruct(); + } + map_delete(Watchers, str); + CheckBot(str); + unguarded( (: save_object, SAVE_SNOOP, 1 :) ); + return 1; + } + return 0; + } + + int Report(){ + if( !((int)master()->valid_apply(({ "PRIV_SECURE" }))) ){ + return 0; + } + tc("Watchers: "+identify(Watchers)); + tc("snoopers: "+identify(snoopers)); + tc("prevusers: "+identify(prevusers)); + tc("snooped: "+identify(snooped)); + tc("monitored: "+identify(monitored)); + return 1; + } + diff -c -r --new-file ds1.1/lib/secure/daemon/update.blank ds2.0r27/lib/secure/daemon/update.blank *** ds1.1/lib/secure/daemon/update.blank Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/daemon/update.blank Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,12 ---- + #include <lib.h> + + inherit LIB_DAEMON; + + static void eventUpdate() { + } + + static void create() { + daemon::create(); + call_out((: eventUpdate :), 60); + } + diff -c -r --new-file ds1.1/lib/secure/daemon/update.c ds2.0r27/lib/secure/daemon/update.c *** ds1.1/lib/secure/daemon/update.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/daemon/update.c Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,12 ---- + #include <lib.h> + + inherit LIB_DAEMON; + + static void eventUpdate() { + } + + static void create() { + daemon::create(); + call_out((: eventUpdate :), 60); + } + diff -c -r --new-file ds1.1/lib/secure/daemon/update.new ds2.0r27/lib/secure/daemon/update.new *** ds1.1/lib/secure/daemon/update.new Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/daemon/update.new Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,17 ---- + #include <lib.h> + + inherit LIB_DAEMON; + + string *deleta; + + static void eventUpdate() { + mkdir("/secure/log/bak"); + rename("/secure/daemon/update.blank","/secure/daemon/update.c"); + destruct(); + } + + static void create() { + daemon::create(); + call_out((: eventUpdate :), 60); + } + diff -c -r --new-file ds1.1/lib/secure/daemon/voting.c ds2.0r27/lib/secure/daemon/voting.c *** ds1.1/lib/secure/daemon/voting.c Sun Feb 1 21:30:41 1998 --- ds2.0r27/lib/secure/daemon/voting.c Wed Jul 5 00:01:05 2006 *************** *** 21,44 **** daemon::create(); SetNoClean(1); if( file_exists( SAVE_VOTES __SAVE_EXTENSION__ ) ) { ! unguarded( (: restore_object, SAVE_VOTES :) ); ! if( mapVoting["status"] == VOTE_RUNNING ) ! call_out( (: eventNextDay :), DAY ); } if( ! mapVoting ) { ! mapVoting = ([]); ! mapVoting["candidates"] = ([]); ! mapVoting["votes"] = ([]); ! mapVoting["voted"] = ({}); ! foreach( string sClass in CLASSES_D->GetClasses() ) { ! mapVoting["candidates"][sClass] = ({}); ! mapVoting["votes"][sClass] = ([]); ! } ! mapVoting["status"] = VOTE_NOT_RUNNING; } if( ! mapCouncil ) ! mapCouncil = ([]); eventSave(); } --- 21,44 ---- daemon::create(); SetNoClean(1); if( file_exists( SAVE_VOTES __SAVE_EXTENSION__ ) ) { ! unguarded( (: restore_object, SAVE_VOTES :) ); ! if( mapVoting["status"] == VOTE_RUNNING ) ! call_out( (: eventNextDay :), DAY ); } if( ! mapVoting ) { ! mapVoting = ([]); ! mapVoting["candidates"] = ([]); ! mapVoting["votes"] = ([]); ! mapVoting["voted"] = ({}); ! foreach( string sClass in CLASSES_D->GetClasses() ) { ! mapVoting["candidates"][sClass] = ({}); ! mapVoting["votes"][sClass] = ([]); ! } ! mapVoting["status"] = VOTE_NOT_RUNNING; } if( ! mapCouncil ) ! mapCouncil = ([]); eventSave(); } *************** *** 50,65 **** mixed eventStartVoting() { if( GetStatus() == VOTE_RUNNING ) ! return VOTE_ALREADY_RUNNING; mapVoting["candidates"] = ([]); mapVoting["votes"] = ([]); mapVoting["voted"] = ({}); foreach( string sClass in CLASSES_D->GetClasses() ) { ! mapVoting["candidates"][sClass] = ({}); ! mapVoting["votes"][sClass] = ([]); } ! mapVoting["status"] = VOTE_RUNNING; mapVoting["mode"] = VOTE_MODE_CANDIDATES; mapVoting["daycount"] = VOTE_DAY_COUNT; --- 50,65 ---- mixed eventStartVoting() { if( GetStatus() == VOTE_RUNNING ) ! return VOTE_ALREADY_RUNNING; mapVoting["candidates"] = ([]); mapVoting["votes"] = ([]); mapVoting["voted"] = ({}); foreach( string sClass in CLASSES_D->GetClasses() ) { ! mapVoting["candidates"][sClass] = ({}); ! mapVoting["votes"][sClass] = ([]); } ! mapVoting["status"] = VOTE_RUNNING; mapVoting["mode"] = VOTE_MODE_CANDIDATES; mapVoting["daycount"] = VOTE_DAY_COUNT; *************** *** 74,101 **** mixed eventEndVoting() { mapVoting["status"] = VOTE_NOT_RUNNING; eventTallyVotes(); ! eventSave(); } mixed eventAddCandidate( string sClass, string sWho ) { object ob; ! string sOldClass; ! sWho = convert_name( sWho ); ob = find_player( sWho ); if( GetStatus() == VOTE_NOT_RUNNING ) ! return VOTE_NOT_RUNNING; if( mapVoting["mode"] != VOTE_MODE_CANDIDATES ) ! return VOTE_MODE_VOTING; if( ! ob ) return VOTE_ERROR; if( ! ob->ClassMember(sClass) ) ! return VOTE_NOT_CLASS_MEMBER; ! foreach( string cls in CLASSES_D->GetClasses() ) ! if( member_array( sWho, mapVoting["candidates"][cls] ) != -1 ) ! return VOTE_ALREADY_RUNNING; ! mapVoting["candidates"][sClass] += ({ sWho }); mapVoting["votes"][sClass][sWho] = 0; message("shout", "%^YELLOW%^Election announcement:%^RESET%^ " + --- 74,101 ---- mixed eventEndVoting() { mapVoting["status"] = VOTE_NOT_RUNNING; eventTallyVotes(); ! return eventSave(); ! } mixed eventAddCandidate( string sClass, string sWho ) { object ob; ! sWho = convert_name( sWho ); ob = find_player( sWho ); if( GetStatus() == VOTE_NOT_RUNNING ) ! return VOTE_NOT_RUNNING; if( mapVoting["mode"] != VOTE_MODE_CANDIDATES ) ! return VOTE_MODE_VOTING; if( ! ob ) return VOTE_ERROR; if( ! ob->ClassMember(sClass) ) ! return VOTE_NOT_CLASS_MEMBER; ! foreach( string cls in CLASSES_D->GetClasses() ) ! if( member_array( sWho, mapVoting["candidates"][cls] ) != -1 ) ! return VOTE_ALREADY_RUNNING; ! mapVoting["candidates"][sClass] += ({ sWho }); mapVoting["votes"][sClass][sWho] = 0; message("shout", "%^YELLOW%^Election announcement:%^RESET%^ " + *************** *** 107,120 **** mixed eventRemoveCandidate( string sClass, string sWho ) { sWho = convert_name( sWho ); ! if( GetStatus() == VOTE_NOT_RUNNING ) ! return VOTE_NOT_RUNNING; if( mapVoting["mode"] != VOTE_MODE_CANDIDATES ) ! return VOTE_MODE_VOTING; if( member_array( sWho, mapVoting["candidates"][sClass] ) == -1 ) ! return VOTE_NOT_CANDIDATE; ! mapVoting["candidates"][sClass] -= ({ sWho }); map_delete( mapVoting["votes"][sClass], sWho ); message("shout", "%^YELLOW%^Election announcement:%^RESET%^ " + --- 107,120 ---- mixed eventRemoveCandidate( string sClass, string sWho ) { sWho = convert_name( sWho ); ! if( GetStatus() == VOTE_NOT_RUNNING ) ! return VOTE_NOT_RUNNING; if( mapVoting["mode"] != VOTE_MODE_CANDIDATES ) ! return VOTE_MODE_VOTING; if( member_array( sWho, mapVoting["candidates"][sClass] ) == -1 ) ! return VOTE_NOT_CANDIDATE; ! mapVoting["candidates"][sClass] -= ({ sWho }); map_delete( mapVoting["votes"][sClass], sWho ); message("shout", "%^YELLOW%^Election announcement:%^RESET%^ " + *************** *** 126,182 **** mixed eventCastVote( string sClass, string sVoter, string sVotee ) { mapping mapChar; ! sVoter = convert_name( sVoter ); sVotee = convert_name( sVotee ); ! if( GetStatus() == VOTE_NOT_RUNNING ) ! return VOTE_NOT_RUNNING; ! if( mapVoting["mode"] != VOTE_MODE_VOTING ) ! return VOTE_MODE_CANDIDATES; ! mapChar = CHARACTER_D->GetLink( sVoter ); ! if( mapChar ) ! if( mapChar["primary"] != sVoter ) ! return VOTE_NOT_PRIMARY; ! if( member_array( sVotee, mapVoting["candidates"][sClass] ) == -1 ) ! return VOTE_NOT_CLASS_MEMBER; if( member_array( sVoter, mapVoting["voted"] ) != -1 ) ! return VOTE_ALREADY_VOTED; ! mapVoting["voted"] += ({ sVoter }); mapVoting["votes"][sClass][sVotee]++; eventSave(); return VOTE_SUCCESS; } ! mixed eventNextDay() { mapVoting["daycount"]--; ! ! if( ! mapVoting["daycount"] ) { ! if( mapVoting["mode"] == VOTE_MODE_CANDIDATES ) { ! mapVoting["mode"] = VOTE_MODE_VOTING; ! mapVoting["daycount"] = VOTE_DAY_COUNT; ! call_out( (: eventNextDay :), DAY ); ! message("shout", "%^YELLOW%^Election announcement:%^RESET%^ " + ! "Nominations are closed, go vote for the candidates!!", users() ); ! eventSave(); ! return VOTE_SUCCESS; ! } ! ! eventEndVoting(); ! return VOTE_SUCCESS; } ! message("shout", "%^YELLOW%^Election announcement:%^RESET%^ " + ! "Only " + mapVoting["daycount"] + " " + ! ( (int) mapVoting["daycount"] > 1 ) ? "days" : "day" + " left to " + ! ( (int) mapVoting["mode"] == VOTE_MODE_VOTING ) ! ? "vote for the candidates." : "nominate candidates.", users()); call_out( (: eventNextDay :), DAY ); eventSave(); return VOTE_SUCCESS; --- 126,182 ---- mixed eventCastVote( string sClass, string sVoter, string sVotee ) { mapping mapChar; ! sVoter = convert_name( sVoter ); sVotee = convert_name( sVotee ); ! if( GetStatus() == VOTE_NOT_RUNNING ) ! return VOTE_NOT_RUNNING; ! if( mapVoting["mode"] != VOTE_MODE_VOTING ) ! return VOTE_MODE_CANDIDATES; ! mapChar = CHARACTER_D->GetLink( sVoter ); ! if( mapChar ) ! if( mapChar["primary"] != sVoter ) ! return VOTE_NOT_PRIMARY; ! if( member_array( sVotee, mapVoting["candidates"][sClass] ) == -1 ) ! return VOTE_NOT_CLASS_MEMBER; if( member_array( sVoter, mapVoting["voted"] ) != -1 ) ! return VOTE_ALREADY_VOTED; ! mapVoting["voted"] += ({ sVoter }); mapVoting["votes"][sClass][sVotee]++; eventSave(); return VOTE_SUCCESS; } ! mixed eventNextDay() { mapVoting["daycount"]--; ! ! if( !mapVoting["daycount"] ) { ! if( mapVoting["mode"] == VOTE_MODE_CANDIDATES ) { ! mapVoting["mode"] = VOTE_MODE_VOTING; ! mapVoting["daycount"] = VOTE_DAY_COUNT; ! call_out( (: eventNextDay :), DAY ); ! message("shout", "%^YELLOW%^Election announcement:%^RESET%^ " + ! "Nominations are closed, go vote for the candidates!!", users() ); ! eventSave(); ! return VOTE_SUCCESS; ! } ! //tc("mapVoting[\"daycount\"]: "+mapVoting["daycount"]); ! eventEndVoting(); ! return VOTE_SUCCESS; } ! //message("shout", "%^YELLOW%^Election announcement:%^RESET%^ " + ! // "Only " + mapVoting["daycount"] + " " + ! //( (int)mapVoting["daycount"] > 1 ) ? "days" : "day" + " left to " + ! //( (int)mapVoting["mode"] == VOTE_MODE_VOTING ) ! //? "vote for the candidates." : "nominate candidates.", users()); call_out( (: eventNextDay :), DAY ); eventSave(); return VOTE_SUCCESS; *************** *** 187,211 **** string *asWho; mapCouncil = ([]); ! foreach( string sClass in CLASSES_D->GetClasses() ) { ! mapWho = mapVoting["votes"][lower_case(sClass)]; ! if( ! ( sizeof( asWho = keys( mapWho ) ) ) ) ! return VOTE_SUCCESS; ! ! while( sizeof( asWho ) >= 2 ) { ! string player1, player2; ! ! player1 = asWho[0]; ! player2 = asWho[1]; ! ! if( mapWho[player1] > mapWho[player2] ) ! asWho -= ({ player2 }); ! else ! asWho -= ({ player1 }); ! } ! ! mapCouncil[lower_case(sClass)] = asWho[0]; } eventSave(); --- 187,219 ---- string *asWho; mapCouncil = ([]); ! foreach( string sClass in CLASSES_D->GetClasses() ) { ! //tc("sClass: "+sClass); ! mapWho = mapVoting["votes"][lower_case(sClass)]; ! //tc("mapVoting: "+identify(mapVoting),"red"); ! //tc("mapWho: "+identify(mapWho)); ! if( ! ( sizeof( asWho = keys( mapWho ) ) ) ){ ! //tc("?"); ! //return VOTE_SUCCESS; ! } ! //tc("asWho: "+identify(asWho)); ! ! while( sizeof( asWho ) >= 2 ) { ! string player1, player2; ! ! player1 = asWho[0]; ! player2 = asWho[1]; ! ! if( mapWho[player1] > mapWho[player2] ) ! asWho -= ({ player2 }); ! else ! asWho -= ({ player1 }); ! } ! //tc("asWho: "+identify(asWho)); ! ! if(asWho && sizeof(asWho)) mapCouncil[lower_case(sClass)] = asWho[0]; ! //tc("mapCouncil["+lower_case(sClass)+"]: "+identify(mapCouncil[lower_case(sClass)])); } eventSave(); *************** *** 221,236 **** string *GetCouncil() { string *asWho; ! asWho = ({}); foreach( string sClass in CLASSES_D->GetClasses() ) ! asWho += ({ mapCouncil[sClass] }); ! return asWho; } ! string GetCouncilMember( string sClass ) { return mapCouncil[sClass]; } int GetVoteStatus( object ob ) { string sVoter; --- 229,258 ---- string *GetCouncil() { string *asWho; ! asWho = ({}); foreach( string sClass in CLASSES_D->GetClasses() ) ! asWho += ({ mapCouncil[sClass] }); ! return asWho; } ! string GetCouncilMember( string sClass ) { ! if(mapCouncil[sClass]) return mapCouncil[sClass]; ! else return ""; ! } ! ! string GetCurrentCouncil(){ ! string ret = "Current council:\n"; ! foreach( string sClass in CLASSES_D->GetClasses() ){ ! string councillor; ! if(mapCouncil[sClass]) councillor = mapCouncil[sClass]; ! else councillor = "NONE"; ! ret += capitalize(sClass)+": "+capitalize(councillor)+"\n"; ! } ! return ret; ! } int GetVoteStatus( object ob ) { string sVoter; *************** *** 239,256 **** sVoter = convert_name( ob->GetName() ); if( mapVoting["status"] == VOTE_NOT_RUNNING ) ! return VOTE_ALREADY_VOTED; if( mapVoting["mode"] == VOTE_MODE_CANDIDATES ) ! return VOTE_ALREADY_VOTED; if( member_array( sVoter, mapVoting["voted"] ) != -1 ) ! return VOTE_ALREADY_VOTED; if( ! ob->GetClass() ) ! return VOTE_ALREADY_VOTED; mapChar = CHARACTER_D->GetLink( sVoter ); if( mapChar ) ! if( mapChar["primary"] != sVoter ) ! return VOTE_ALREADY_VOTED; return VOTE_SUCCESS; } --- 261,278 ---- sVoter = convert_name( ob->GetName() ); if( mapVoting["status"] == VOTE_NOT_RUNNING ) ! return VOTE_ALREADY_VOTED; if( mapVoting["mode"] == VOTE_MODE_CANDIDATES ) ! return VOTE_ALREADY_VOTED; if( member_array( sVoter, mapVoting["voted"] ) != -1 ) ! return VOTE_ALREADY_VOTED; if( ! ob->GetClass() ) ! return VOTE_ALREADY_VOTED; mapChar = CHARACTER_D->GetLink( sVoter ); if( mapChar ) ! if( mapChar["primary"] != sVoter ) ! return VOTE_ALREADY_VOTED; return VOTE_SUCCESS; } *************** *** 259,272 **** int IsCouncilMember( object ob ) { foreach( string sClass in CLASSES_D->GetClasses() ) ! if( mapCouncil[sClass] == convert_name(ob->GetName()) ) ! return 1; return 0; } mixed GetTest() { foreach( string sClass in CLASSES_D->GetClasses() ) ! this_player()->eventPrint( sClass + " : " + mapCouncil[sClass] ); return 1; } --- 281,294 ---- int IsCouncilMember( object ob ) { foreach( string sClass in CLASSES_D->GetClasses() ) ! if( mapCouncil[sClass] == convert_name(ob->GetName()) ) ! return 1; return 0; } mixed GetTest() { foreach( string sClass in CLASSES_D->GetClasses() ) ! this_player()->eventPrint( sClass + " : " + mapCouncil[sClass] ); return 1; } diff -c -r --new-file ds1.1/lib/secure/include/bboard.h ds2.0r27/lib/secure/include/bboard.h *** ds1.1/lib/secure/include/bboard.h Sun Feb 1 21:30:43 1998 --- ds2.0r27/lib/secure/include/bboard.h Wed Jul 5 00:48:29 2006 *************** *** 1,5 **** ! #define BBOARD_DIR "/adm/save/boards/" ! #define BBOARD_EDIT "/tmp/bb/" #define BBOARD_OK 0 #define BAD_DATA 1 --- 1,5 ---- ! #define BBOARD_DIR "/save/boards/" ! #define BBOARD_EDIT "/tmp/" #define BBOARD_OK 0 #define BAD_DATA 1 diff -c -r --new-file ds1.1/lib/secure/include/cfg.h ds2.0r27/lib/secure/include/cfg.h *** ds1.1/lib/secure/include/cfg.h Sun Feb 1 21:30:43 1998 --- ds2.0r27/lib/secure/include/cfg.h Wed Jul 5 00:01:05 2006 *************** *** 14,18 **** --- 14,20 ---- #define CFG_TIME DIR_CFG "/time.cfg" #define CFG_WHERE DIR_CFG "/where.cfg" #define CFG_WRITE DIR_SECURE_CFG "/write.cfg" + #define CFG_RACES DIR_SECURE_CFG "/races" + #define CFG_CLASSES DIR_SECURE_CFG "/classes" #endif /* __CFG_H__ */ diff -c -r --new-file ds1.1/lib/secure/include/commands.h ds2.0r27/lib/secure/include/commands.h *** ds1.1/lib/secure/include/commands.h Sun Feb 1 21:30:43 1998 --- ds2.0r27/lib/secure/include/commands.h Wed Jul 5 00:01:05 2006 *************** *** 3,16 **** #include <dirs.h> ! #define CMD_CALL ("/secure/cmds/creator/call") #define CMD_ENCRE (DIR_SECURE_ADMIN_CMDS "/encre") #define CMD_END (DIR_ADMIN_CMDS+"/end") #define CMD_DECRE (DIR_SECURE_ADMIN_CMDS "/decre") #define CMD_SAY (DIR_PLAYER_CMDS "/say") #define CMD_SETREBOOT (DIR_SECURE_ADMIN_CMDS+"/setreboot") #define CMD_SUICIDE (DIR_MORTAL_CMDS+"/suicide") #define CD "/cmds/dev/cd" ! #define SU "/cmds/user/su" #endif /* __COMMANDS_H */ --- 3,17 ---- #include <dirs.h> ! #define CMD_CALL ("/secure/cmds/creators/call") #define CMD_ENCRE (DIR_SECURE_ADMIN_CMDS "/encre") #define CMD_END (DIR_ADMIN_CMDS+"/end") #define CMD_DECRE (DIR_SECURE_ADMIN_CMDS "/decre") #define CMD_SAY (DIR_PLAYER_CMDS "/say") #define CMD_SETREBOOT (DIR_SECURE_ADMIN_CMDS+"/setreboot") #define CMD_SUICIDE (DIR_MORTAL_CMDS+"/suicide") + #define CMD_UPDATE ("/secure/cmds/creators/update") #define CD "/cmds/dev/cd" ! #define SU "/secure/cmds/creators/su" #endif /* __COMMANDS_H */ diff -c -r --new-file ds1.1/lib/secure/include/comp.h ds2.0r27/lib/secure/include/comp.h *** ds1.1/lib/secure/include/comp.h Sun Feb 1 21:30:46 1998 --- ds2.0r27/lib/secure/include/comp.h Wed Jul 5 00:01:05 2006 *************** *** 8,12 **** --- 8,13 ---- #define LIB_OBJECT DIR_COMP "/object" #define LIB_SEAL DIR_COMP "/seal" #define LIB_WEAPON DIR_COMP "/weapon" + #define LIB_SURFACE DIR_COMP "/surface" #endif /* s_comp_h */ diff -c -r --new-file ds1.1/lib/secure/include/compat.h ds2.0r27/lib/secure/include/compat.h *** ds1.1/lib/secure/include/compat.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/include/compat.h Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,62 ---- + #ifndef s_lpu_h + #define s_lpu_h + + #define ROOM "/lib/std/room" + #define OBJECT "/lib/std/item" + #define OB_SIMUL_EFUN "/secure/sefun/sefun" + #define __DIR__ "/domains/lpuni/" + + #define set_light SetAmbientLight + #define set_short SetShort + #define set_long SetLong + #define set_items SetItems + #define set_exits SetExits + #define query_exit GetExit + #define set_property SetProperty + #define set_name SetKeyName + #define set_id SetId + #define set_no_clean SetNoClean + #define set_smell_string SetSmell + #define set_smell SetSmell + #define set_properties SetProperties + #define set_door SetDoor + #define set_race SetRace + #define set_gender SetGender + #define set_level SetLevel + #define set_body_type SetProperty + #define set_hp SetHealthPoints + #define set_class SetClass + #define set_spell_chance SetSpellChance + #define set_spell SetSpell + #define set_skills SetSkills + #define set_skill SetSkill + #define set_spell_chance SetSpellChance + #define set_emotes SetActions + #define set_wielding_limbs SetWieldingLimbs + #define set_wc SetClass + #define set_type SetWeaponType + #define set_mass SetMass + #define set_value SetValue + #define set_listen_string SetListen + #define set_listen SetListen + #define set_edit_ok valid_edit + #define POLITICS_D "/secure/daemon/politics" + #define set_search SetSearch + #define set_paralyzed SetParalyzed + #define set_pre_exit_functions SetProperty + #define MONSTER LIB_SENTIENT + #define monster sentient + #define set_money SetCurrency + #define add_exit AddExit + #define set_read SetRead + #define set_prevent_get SetPreventGet + #define VAULT LIB_ROOM + #define set_day_long SetDayLong + #define set_night_long SetNightLong + #define set_open SetOpen + #define query_open GetOpen + #define remove_item_description RemoveItem + #define remove_exit RemoveExit + #define add_item_description AddItem + + #endif /* s_lpu_h */ diff -c -r --new-file ds1.1/lib/secure/include/config.h ds2.0r27/lib/secure/include/config.h *** ds1.1/lib/secure/include/config.h Sun Feb 1 21:45:51 1998 --- ds2.0r27/lib/secure/include/config.h Wed Jul 5 00:01:05 2006 *************** *** 3,14 **** #define DEFAULT_PROMPT "> " #define MUD_STATUS "mudlib development" ! #define ADMIN_EMAIL "USER@host" #define LOCAL_NEWS_PREFIX "nm" #define MUD_IS_LOCKED 0 #define MINUTES_REBOOT_WARNING 20 ! #define TIME_TO_RESET 1000 #define GMT_OFFSET -32000 #define MAX_LOG_SIZE 150000 --- 3,18 ---- #define DEFAULT_PROMPT "> " #define MUD_STATUS "mudlib development" ! #define ADMIN_EMAIL "admin@here" ! #define DEBUGGER "DEBUG_NAME" #define LOCAL_NEWS_PREFIX "nm" #define MUD_IS_LOCKED 0 + #define AUTO_WIZ 0 + #define RESTRICTED_INTERMUD 0 + #define DISABLE_INTERMUD 0 #define MINUTES_REBOOT_WARNING 20 ! #define TIME_TO_RESET 20000 #define GMT_OFFSET -32000 #define MAX_LOG_SIZE 150000 *************** *** 17,38 **** #define MAX_HISTORY_SIZE 30 #define LOGON_TIMEOUT 360 #define LINK_WAIT_PERIOD 1800 #define MAX_PASSWORD_TRIES 3 #define MIN_USER_NAME_LENGTH 2 #define MAX_USER_NAME_LENGTH 15 #define MAX_USER_CAP_NAME_LENGTH 20 ! #define LOCKED_ACCESS_ALLOWED ({ "SECURE", "ASSIST" }) #define SUPPORTED_CLIENTS ({ "amcp", "amcp/1.1" }) #define HOUR_LENGTH 1200 #define DAY_LENGTH 20 ! #define MAX_NEWBIE_LEVEL 5 #define AUTOSAVE_TIME 450 #define MORTAL_POSITIONS ({ "player", "high mortal", "ambassador" }) #define DEFAULT_GRAVITY 1.0 #define DEFAULT_ITEM_MESSAGE "You do not see that here." #endif /* s_config_h */ --- 21,52 ---- #define MAX_HISTORY_SIZE 30 #define LOGON_TIMEOUT 360 + #define IDLE_TIMEOUT 3600 #define LINK_WAIT_PERIOD 1800 #define MAX_PASSWORD_TRIES 3 #define MIN_USER_NAME_LENGTH 2 #define MAX_USER_NAME_LENGTH 15 #define MAX_USER_CAP_NAME_LENGTH 20 ! #define LOCKED_ACCESS_ALLOWED ({ "SECURE", "ASSIST", "ELDER", "TEST" }) #define SUPPORTED_CLIENTS ({ "amcp", "amcp/1.1" }) #define HOUR_LENGTH 1200 #define DAY_LENGTH 20 ! #define MAX_NEWBIE_LEVEL 3 #define AUTOSAVE_TIME 450 #define MORTAL_POSITIONS ({ "player", "high mortal", "ambassador" }) #define DEFAULT_GRAVITY 1.0 #define DEFAULT_ITEM_MESSAGE "You do not see that here." + #define EXTRA_TIME_OFFSET 0 + #define RESET_INTERMUD 0 + #define ENGLISH_ONLY 0 + #define HUMANS_ONLY 0 + #define PINGING_MUDS ({"Frontiers","Dead Souls"}) + #define ENABLE_ENCUMBRANCE 1 + #define GLOBAL_MONITOR 0 + #define PLAYER_KILL 0 + #endif /* s_config_h */ diff -c -r --new-file ds1.1/lib/secure/include/council.h ds2.0r27/lib/secure/include/council.h *** ds1.1/lib/secure/include/council.h Sun Feb 1 21:30:43 1998 --- ds2.0r27/lib/secure/include/council.h Wed Jul 5 00:01:05 2006 *************** *** 7,25 **** #define POLICECOM ({ "sluggo" }) #define SECRETARY ({ "brunoer" }) ! #define COUNCIL ({ "bess", "moonstar", "sluggo", "turk", "katana", "mina",\ "yildor", "pianoman", "topknot", "niteraven", "brunoer",\ "hades", "annie" }) ! #define MAGE_COUNCIL ({ "moonstar" }) ! #define MONK_COUNCIL ({ "bess" }) ! #define ROGUE_COUNCIL ({ "turk" }) ! #define CLERIC_COUNCIL ({ "katana" }) ! #define FIGHTER_COUNCIL ({ "sluggo" }) ! #define KATAAN_COUNCIL ({ "mina" }) --- 7,25 ---- #define POLICECOM ({ "sluggo" }) #define SECRETARY ({ "brunoer" }) ! #define COUNCIL ({ "bess", "moonstar", "sluggo", "turk", "katana", "mina",\ "yildor", "pianoman", "topknot", "niteraven", "brunoer",\ "hades", "annie" }) ! #define MAGE_COUNCIL ({ "moonstar" }) ! #define MONK_COUNCIL ({ "bess" }) ! #define ROGUE_COUNCIL ({ "turk" }) ! #define CLERIC_COUNCIL ({ "katana" }) ! #define FIGHTER_COUNCIL ({ "sluggo" }) ! #define KATAAN_COUNCIL ({ "mina" }) diff -c -r --new-file ds1.1/lib/secure/include/daemons.h ds2.0r27/lib/secure/include/daemons.h *** ds1.1/lib/secure/include/daemons.h Sun Feb 1 21:30:43 1998 --- ds2.0r27/lib/secure/include/daemons.h Wed Jul 5 00:01:05 2006 *************** *** 4,18 **** #include <dirs.h> #define ADMIN_D DIR_SECURE_DAEMONS "/admin" #define ADVERBS_D DIR_DAEMONS "/adverbs" #define BANISH_D DIR_DAEMONS "/banish" #define BBOARD_D DIR_SECURE_DAEMONS "/bboard" #define BUGS_D DIR_DAEMONS "/bugs" #define CHARACTER_D DIR_SECURE_DAEMONS "/character" ! #define CHAT_D DIR_DAEMONS "/chat" #define CLASSES_D DIR_DAEMONS "/classes" #define CMD_D DIR_DAEMONS "/command" ! #define ECONOMY_D DIR_DAEMONS "/economy" #define EVENTS_D DIR_SECURE_DAEMONS "/events" #define FINGER_D DIR_SECURE_DAEMONS "/finger" #define FOLDERS_D DIR_SECURE_DAEMONS "/folders" --- 4,22 ---- #include <dirs.h> #define ADMIN_D DIR_SECURE_DAEMONS "/admin" + #define ADVANCE_D DIR_SECURE_DAEMONS "/advance" #define ADVERBS_D DIR_DAEMONS "/adverbs" + #define AUTOEXEC_D DIR_SECURE_DAEMONS "/autoexec" #define BANISH_D DIR_DAEMONS "/banish" #define BBOARD_D DIR_SECURE_DAEMONS "/bboard" #define BUGS_D DIR_DAEMONS "/bugs" #define CHARACTER_D DIR_SECURE_DAEMONS "/character" ! #define CHAT_D DIR_SECURE_DAEMONS "/chat" #define CLASSES_D DIR_DAEMONS "/classes" #define CMD_D DIR_DAEMONS "/command" ! #define DECAY_D DIR_DAEMONS "/decay" ! #define CREATE_D DIR_SECURE_DAEMONS "/modules/create" ! #define ECONOMY_D DIR_SECURE_DAEMONS "/economy" #define EVENTS_D DIR_SECURE_DAEMONS "/events" #define FINGER_D DIR_SECURE_DAEMONS "/finger" #define FOLDERS_D DIR_SECURE_DAEMONS "/folders" *************** *** 26,49 **** #define NOTIFY_D DIR_DAEMONS "/notify" #define OPTIONS_D DIR_SECURE_DAEMONS "/options" #define PARTY_D DIR_DAEMONS "/party" #define PLAYERS_D DIR_SECURE_DAEMONS "/players" #define RACES_D DIR_DAEMONS "/races" #define REMOTE_D DIR_SECURE_DAEMONS "/remote" #define REMOTEPOST_D DIR_SECURE_DAEMONS "/remotepost" #define SEASONS_D DIR_DAEMONS "/seasons" #define SERVICES_D DIR_DAEMONS "/services" #define SOUL_D DIR_DAEMONS "/soul" ! #define SPELLS_D DIR_DAEMONS "/spells" #define STATISTICS_D DIR_DAEMONS "/statistics" #define TERMINAL_D DIR_DAEMONS "/terminal" #define TIME_D DIR_DAEMONS "/time" - #ifdef Dead SoulsLPMud #define UNDERWORLD_D DIR_DAEMONS "/underworld" - #endif #define UNIQUE_D DIR_DAEMONS "/unique" #define USERS_D DIR_SECURE_DAEMONS "/users" #define VERBS_D DIR_DAEMONS "/verbs" #define VIRTUAL_D DIR_DAEMONS "/virtual" #define VOTING_D DIR_SECURE_DAEMONS "/voting" #endif /* s_daemons_h */ --- 30,59 ---- #define NOTIFY_D DIR_DAEMONS "/notify" #define OPTIONS_D DIR_SECURE_DAEMONS "/options" #define PARTY_D DIR_DAEMONS "/party" + #define PING_D DIR_SECURE_DAEMONS "/ping" #define PLAYERS_D DIR_SECURE_DAEMONS "/players" + #define POLITICS_D DIR_SECURE_DAEMONS "/politics" #define RACES_D DIR_DAEMONS "/races" + #define REAPER_D DIR_DAEMONS "/reaper" #define REMOTE_D DIR_SECURE_DAEMONS "/remote" #define REMOTEPOST_D DIR_SECURE_DAEMONS "/remotepost" + #define ROUTER_D DIR_SECURE_DAEMONS "/i3router/server" #define SEASONS_D DIR_DAEMONS "/seasons" #define SERVICES_D DIR_DAEMONS "/services" + #define SNOOP_D DIR_SECURE_DAEMONS "/snoop" #define SOUL_D DIR_DAEMONS "/soul" ! #define SPELLS_D DIR_DAEMONS "/spells" #define STATISTICS_D DIR_DAEMONS "/statistics" + #define STARGATE_D DIR_DAEMONS "/stargate" #define TERMINAL_D DIR_DAEMONS "/terminal" #define TIME_D DIR_DAEMONS "/time" #define UNDERWORLD_D DIR_DAEMONS "/underworld" #define UNIQUE_D DIR_DAEMONS "/unique" #define USERS_D DIR_SECURE_DAEMONS "/users" #define VERBS_D DIR_DAEMONS "/verbs" #define VIRTUAL_D DIR_DAEMONS "/virtual" #define VOTING_D DIR_SECURE_DAEMONS "/voting" + #define MASTER_D DIR_SECURE_DAEMONS "/master" + #define FTP_PORT_TRACKER_D DIR_DAEMONS "/ftp_port_tracker" #endif /* s_daemons_h */ diff -c -r --new-file ds1.1/lib/secure/include/dirs.h ds2.0r27/lib/secure/include/dirs.h *** ds1.1/lib/secure/include/dirs.h Wed Mar 10 21:56:07 1999 --- ds2.0r27/lib/secure/include/dirs.h Wed Jul 5 00:01:05 2006 *************** *** 80,86 **** #define DIR_SECURE_COMMON_CMDS DIR_SECURE_CMDS "/common" #define DIR_CREATOR_CMDS DIR_CMDS "/creators" #define DIR_SECURE_CREATOR_CMDS DIR_SECURE_CMDS "/creators" ! #define DIR_GUILD_CMDS DIR_CMDS "/guild" #define DIR_HM_CMDS DIR_CMDS "/hm" #define DIR_PLAYER_CMDS DIR_CMDS "/players" #define DIR_SECURE_PLAYER_CMDS DIR_SECURE_CMDS "/players" --- 80,86 ---- #define DIR_SECURE_COMMON_CMDS DIR_SECURE_CMDS "/common" #define DIR_CREATOR_CMDS DIR_CMDS "/creators" #define DIR_SECURE_CREATOR_CMDS DIR_SECURE_CMDS "/creators" ! #define DIR_CLAN_CMDS DIR_CMDS "/clan" #define DIR_HM_CMDS DIR_CMDS "/hm" #define DIR_PLAYER_CMDS DIR_CMDS "/players" #define DIR_SECURE_PLAYER_CMDS DIR_SECURE_CMDS "/players" *************** *** 99,106 **** #define REALMS_DIRS "/realms" #define DOMAINS_DIRS "/domains" ! #define DIR_STANDARD_DOMAIN DOMAINS_DIRS "/Ylsrim" ! #define DIR_UNDERWORLD_DOMAIN DOMAINS_DIRS "/Underworld" #define ESTATES_DIRS "/estates" --- 99,105 ---- #define REALMS_DIRS "/realms" #define DOMAINS_DIRS "/domains" ! #define DIR_STANDARD_DOMAIN DOMAINS_DIRS "/default" #define ESTATES_DIRS "/estates" diff -c -r --new-file ds1.1/lib/secure/include/events.h ds2.0r27/lib/secure/include/events.h *** ds1.1/lib/secure/include/events.h Sun Feb 1 21:30:46 1998 --- ds2.0r27/lib/secure/include/events.h Wed Jul 5 00:01:05 2006 *************** *** 23,28 **** --- 23,29 ---- #define LIB_LOOK_IN DIR_EVENTS "/look_in" #define LIB_POISON DIR_EVENTS "/poison" #define LIB_PRESS DIR_EVENTS "/press" + #define LIB_PULL DIR_EVENTS "/pull" #define LIB_PUT DIR_EVENTS "/put" #define LIB_READ DIR_EVENTS "/read" #define LIB_SEARCH DIR_EVENTS "/search" *************** *** 32,36 **** --- 33,44 ---- #define LIB_TOUCH DIR_EVENTS "/touch" #define LIB_WEAR DIR_EVENTS "/wear" #define LIB_WIELD DIR_EVENTS "/wield" + #define LIB_SHOOT DIR_EVENTS "/shoot" + #define LIB_TURN DIR_EVENTS "/turn" + #define LIB_MANIPULATE DIR_EVENTS "/manipulate" + #define LIB_CRAWL DIR_EVENTS "/crawl" + #define LIB_LIE DIR_EVENTS "/lie" + #define LIB_FLY DIR_EVENTS "/fly" + #endif /* s_events_h */ diff -c -r --new-file ds1.1/lib/secure/include/global.h ds2.0r27/lib/secure/include/global.h *** ds1.1/lib/secure/include/global.h Sun Feb 1 21:30:44 1998 --- ds2.0r27/lib/secure/include/global.h Wed Jul 5 00:01:05 2006 *************** *** 1,9 **** #ifndef __GLOBAL_H #define __GLOBAL_H ! #define __nightmare__ 4.5 ! #define __nightmare5__ ! #define Dead SoulsLPMud #define DAY_ONE 720550800 --- 1,11 ---- #ifndef __GLOBAL_H #define __GLOBAL_H ! #include <config.h> ! ! #if COMPAT_MODE ! #include <compat.h> ! #endif #define DAY_ONE 720550800 *************** *** 15,22 **** #undef debug #endif /* debug */ ! #ifdef DEBUG ! #define debug(x, y) (find_player(x) || master())->eventPrint(x) ! #endif /* DEBUG */ #endif /* GLOBAL_H */ --- 17,24 ---- #undef debug #endif /* debug */ ! //#ifdef DEBUG ! //#define debug(x, y) (find_player(x) || master())->eventPrint(x) ! //#endif /* DEBUG */ #endif /* GLOBAL_H */ diff -c -r --new-file ds1.1/lib/secure/include/iips.h ds2.0r27/lib/secure/include/iips.h *** ds1.1/lib/secure/include/iips.h Sun Feb 1 21:30:44 1998 --- ds2.0r27/lib/secure/include/iips.h Wed Jul 5 00:01:05 2006 *************** *** 1,8 **** #ifndef __IIPS_H #define __IIPS_H ! #include <dirs.h> ! #define POSTAL_ID "imaginary mailer" ! #endif /* __IIPS_H */ --- 1,8 ---- #ifndef __IIPS_H #define __IIPS_H ! #include <dirs.h> ! #define POSTAL_ID "imaginary mailer" ! #endif /* __IIPS_H */ diff -c -r --new-file ds1.1/lib/secure/include/lib.h ds2.0r27/lib/secure/include/lib.h *** ds1.1/lib/secure/include/lib.h Sun Feb 1 21:30:43 1998 --- ds2.0r27/lib/secure/include/lib.h Wed Jul 5 00:48:30 2006 *************** *** 1,6 **** --- 1,7 ---- #ifndef s_lib_h #define s_lib_h + //#include <lpuni.h> #include <dirs.h> #include <comp.h> *************** *** 10,23 **** --- 11,32 ---- #include <std.h> #include <user.h> + #define LIB_AUTH DIR_SECURE_LIB "/auth" + #define LIB_BATTERY DIR_LIB "/battery" + #define LIB_BLANK_PILE DIR_LIB "/blank_pile" + #define LIB_BOARD DIR_LIB "/bboard" #define LIB_BODY DIR_LIB "/body" + #define LIB_BOT DIR_LIB "/bot" #define LIB_BURN DIR_LIB "/burn" #define LIB_CAPTURE DIR_LIB "/capture" #define LIB_CHAPEL DIR_LIB "/chapel" #define LIB_CHAT DIR_LIB "/chat" #define LIB_CLASSES DIR_LIB "/classes" + #define LIB_CLAY DIR_LIB "/clay" + #define LIB_CLERK DIR_LIB "/clerk" #define LIB_CLIENT DIR_SECURE_LIB "/net/client" + #define LIB_CLIP DIR_LIB "/clip" #define LIB_COMBAT DIR_LIB "/combat" #define LIB_COMBATMSG DIR_LIB "/combatmsg" #define LIB_COMMAND DIR_LIB "/command" *************** *** 36,60 **** #define LIB_FILES DIR_LIB "/files" #define LIB_FISH DIR_LIB "/fish" #define LIB_FISHING DIR_LIB "/fishing" #define LIB_FOLLOW DIR_LIB "/follow" #define LIB_FUEL DIR_LIB "/fuel" #define LIB_GENETICS DIR_LIB "/genetics" ! #define LIB_GUILD DIR_LIB "/guild" #define LIB_HELP DIR_LIB "/help" #define LIB_HISTORY DIR_LIB "/history" ! #define LIB_INTERACTIVE DIR_LIB "/interactive" ! #define LIB_INTERFACE DIR_LIB "/interface" ! #define LIB_LAMP DIR_LIB "/lamp" ! #define LIB_LANGUAGE DIR_LIB "/language" ! #define LIB_LEAD DIR_LIB "/lead" ! #define LIB_LEADER DIR_LIB "/leader" ! #define LIB_LIGHT DIR_LIB "/light" ! #define LIB_LIMB DIR_LIB "/limb" ! #define LIB_LIVING DIR_LIB "/living" #define LIB_LOGIN DIR_SECURE_LIB "/login" #define LIB_MAGIC DIR_LIB "/magic" #define LIB_MATCH DIR_LIB "/match" #define LIB_MEAL DIR_LIB "/meal" #define LIB_MESSAGES DIR_LIB "/messages" #define LIB_MONEY DIR_LIB "/money" #define LIB_NMSH DIR_LIB "/nmsh" --- 45,74 ---- #define LIB_FILES DIR_LIB "/files" #define LIB_FISH DIR_LIB "/fish" #define LIB_FISHING DIR_LIB "/fishing" + #define LIB_FLASHLIGHT DIR_LIB "/flashlight" #define LIB_FOLLOW DIR_LIB "/follow" + #define LIB_FTP_DATA_CONN DIR_SECURE_LIB "/net/ftp_data_connection" #define LIB_FUEL DIR_LIB "/fuel" #define LIB_GENETICS DIR_LIB "/genetics" ! #define LIB_GUN DIR_LIB "/gun" ! #define LIB_CLAN DIR_LIB "/clan" #define LIB_HELP DIR_LIB "/help" #define LIB_HISTORY DIR_LIB "/history" ! #define LIB_INTERACTIVE DIR_LIB "/interactive" ! #define LIB_INTERFACE DIR_LIB "/interface" ! #define LIB_LAMP DIR_LIB "/lamp" ! #define LIB_LANGUAGE DIR_LIB "/language" ! #define LIB_LEAD DIR_LIB "/lead" ! #define LIB_LEADER DIR_LIB "/leader" ! #define LIB_LIGHT DIR_LIB "/light" ! #define LIB_LIVING DIR_LIB "/living" #define LIB_LOGIN DIR_SECURE_LIB "/login" #define LIB_MAGIC DIR_LIB "/magic" + #define LIB_MANYCOINS DIR_LIB "/manycoins" #define LIB_MATCH DIR_LIB "/match" + #define LIB_MAYOR DIR_LIB "/mayor" #define LIB_MEAL DIR_LIB "/meal" + #define LIB_MEAL_POISON DIR_LIB "/poison" #define LIB_MESSAGES DIR_LIB "/messages" #define LIB_MONEY DIR_LIB "/money" #define LIB_NMSH DIR_LIB "/nmsh" *************** *** 62,85 **** #define LIB_PAGER DIR_LIB "/pager" #define LIB_PERSIST DIR_LIB "/persist" #define LIB_PILE DIR_LIB "/pile" #define LIB_PLAYER DIR_LIB "/player" #define LIB_POLE DIR_LIB "/pole" #define LIB_POST_OFFICE DIR_LIB "/post_office" #define LIB_RACE DIR_LIB "/race" #define LIB_REMOTE DIR_LIB "/remote" #define LIB_SCROLL DIR_LIB "/scroll" #define LIB_SENTIENT DIR_LIB "/sentient" #define LIB_SERVER DIR_SECURE_LIB "/net/server" #define LIB_SOCKET DIR_SECURE_LIB "/net/socket" #define LIB_SPELL DIR_LIB "/spell" #define LIB_STEAL DIR_LIB "/steal" #define LIB_TALK DIR_LIB "/talk" #define LIB_TELLER DIR_LIB "/teller" #define LIB_TORCH DIR_LIB "/torch" #define LIB_TRAINER DIR_LIB "/trainer" - #ifdef Dead SoulsLPMud #define LIB_UNDEAD DIR_LIB "/undead" - #endif #define LIB_VEHICLE DIR_LIB "/vehicle" #define LIB_VERB DIR_LIB "/verb" #define LIB_VIRTUAL DIR_LIB "/virtual" --- 76,107 ---- #define LIB_PAGER DIR_LIB "/pager" #define LIB_PERSIST DIR_LIB "/persist" #define LIB_PILE DIR_LIB "/pile" + #define LIB_PISTOL DIR_LIB "/pistol" #define LIB_PLAYER DIR_LIB "/player" + #define LIB_PLAYERS DIR_LIB "/player" #define LIB_POLE DIR_LIB "/pole" #define LIB_POST_OFFICE DIR_LIB "/post_office" #define LIB_RACE DIR_LIB "/race" #define LIB_REMOTE DIR_LIB "/remote" + #define LIB_RIFLE DIR_LIB "/rifle" + #define LIB_ROUND DIR_LIB "/round" #define LIB_SCROLL DIR_LIB "/scroll" + #define LIB_SECURE_BOARD DIR_SECURE_LIB "/bboard" #define LIB_SENTIENT DIR_LIB "/sentient" #define LIB_SERVER DIR_SECURE_LIB "/net/server" + #define LIB_SHADOW DIR_LIB "/shadow" + #define LIB_SHELL DIR_LIB "/shell" + #define LIB_SHOP DIR_LIB "/shop" #define LIB_SOCKET DIR_SECURE_LIB "/net/socket" #define LIB_SPELL DIR_LIB "/spell" + #define LIB_STARGATE DIR_LIB "/stargate" #define LIB_STEAL DIR_LIB "/steal" #define LIB_TALK DIR_LIB "/talk" + #define LIB_TEACHER DIR_LIB "/teacher" #define LIB_TELLER DIR_LIB "/teller" #define LIB_TORCH DIR_LIB "/torch" #define LIB_TRAINER DIR_LIB "/trainer" #define LIB_UNDEAD DIR_LIB "/undead" #define LIB_VEHICLE DIR_LIB "/vehicle" #define LIB_VERB DIR_LIB "/verb" #define LIB_VIRTUAL DIR_LIB "/virtual" diff -c -r --new-file ds1.1/lib/secure/include/modules.h ds2.0r27/lib/secure/include/modules.h *** ds1.1/lib/secure/include/modules.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/include/modules.h Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,12 ---- + #define MODULES_FILE "/secure/modules/file" + #define MODULES_MONEY "/secure/modules/money" + #define MODULES_READ "/secure/modules/read" + #define MODULES_ROOM "/secure/modules/room" + #define MODULES_MAPPING "/secure/modules/mapping" + #define MODULES_ITEM "/secure/modules/item" + #define MODULES_ARMOR "/secure/modules/armor" + #define MODULES_WEAPON "/secure/modules/weapon" + #define MODULES_MEAL "/secure/modules/meal" + #define MODULES_DOOR "/secure/modules/door" + #define MODULES_GENERIC "/secure/modules/generic" + #define MODULES_CREATE "/secure/modules/create" diff -c -r --new-file ds1.1/lib/secure/include/network.h ds2.0r27/lib/secure/include/network.h *** ds1.1/lib/secure/include/network.h Sun Feb 1 21:30:44 1998 --- ds2.0r27/lib/secure/include/network.h Wed Jul 5 00:01:05 2006 *************** *** 1,20 **** #ifndef __NETWORK_H #define __NETWORK_H ! #include <socket.h> ! #include <config.h> ! #define MUD 0 #define STREAM 1 #define DATAGRAM 2 #define STREAM_BINARY 3 #define DATAGRAM_BINARY 4 ! #define PORT_ADMIN 17010 #define PORT_FTP (query_host_port() - 1) #define PORT_HTTP (query_host_port() - 5) #define PORT_OOB (query_host_port() + 5) #define PORT_RCP (query_host_port() - 10) #define PORT_UDP (query_host_port() + 8) ! #endif /* __NETWORK_H */ --- 1,20 ---- #ifndef __NETWORK_H #define __NETWORK_H ! #include <socket.h> ! //#include <config.h> ! #define MUD 0 #define STREAM 1 #define DATAGRAM 2 #define STREAM_BINARY 3 #define DATAGRAM_BINARY 4 ! #define PORT_ADMIN 17010 #define PORT_FTP (query_host_port() - 1) #define PORT_HTTP (query_host_port() - 5) #define PORT_OOB (query_host_port() + 5) #define PORT_RCP (query_host_port() - 10) #define PORT_UDP (query_host_port() + 8) ! #endif /* __NETWORK_H */ diff -c -r --new-file ds1.1/lib/secure/include/news.h ds2.0r27/lib/secure/include/news.h *** ds1.1/lib/secure/include/news.h Sun Feb 1 21:30:44 1998 --- ds2.0r27/lib/secure/include/news.h Wed Jul 5 00:01:05 2006 *************** *** 13,17 **** --- 13,18 ---- #define NEWS_NEWBIE DIR_NEWS "/newbie" #define NEWS_REGISTER DIR_NEWS "/register" #define NEWS_WELCOME DIR_NEWS "/welcome" + #define DS_WELCOME DIR_NEWS "/deadsouls" #endif /* s_news_h */ diff -c -r --new-file ds1.1/lib/secure/include/post.h ds2.0r27/lib/secure/include/post.h *** ds1.1/lib/secure/include/post.h Sun Feb 1 21:30:45 1998 --- ds2.0r27/lib/secure/include/post.h Wed Jul 5 00:01:05 2006 *************** *** 1,11 **** #ifndef __POST_H #define __POST_H ! #include <dirs.h> ! #define POSTAL_ID "imaginary mailer" #define POSTAL_PROMPT "% " #define POSTAL_USER_HELP DIR_USER_HELP+"/postal" #define POSTAL_CREATOR_HELP DIR_CREATOR_HELP+"/postal" ! #endif /* __POST_H */ --- 1,11 ---- #ifndef __POST_H #define __POST_H ! #include <dirs.h> ! #define POSTAL_ID "imaginary mailer" #define POSTAL_PROMPT "% " #define POSTAL_USER_HELP DIR_USER_HELP+"/postal" #define POSTAL_CREATOR_HELP DIR_CREATOR_HELP+"/postal" ! #endif /* __POST_H */ diff -c -r --new-file ds1.1/lib/secure/include/privs.h ds2.0r27/lib/secure/include/privs.h *** ds1.1/lib/secure/include/privs.h Sun Feb 1 21:30:45 1998 --- ds2.0r27/lib/secure/include/privs.h Wed Jul 5 00:01:05 2006 *************** *** 8,12 **** --- 8,14 ---- #define PRIV_MUDLIB "MUDLIBPRIV" #define PRIV_PLAYER "PLAYER" #define PRIV_SECURE "SECURE" + #define PRIV_ELDER "ELDER" + #define PRIV_INTERMUD "INTERMUD" #endif /* __PRIVS_H */ diff -c -r --new-file ds1.1/lib/secure/include/props.h ds2.0r27/lib/secure/include/props.h *** ds1.1/lib/secure/include/props.h Sun Feb 1 21:30:46 1998 --- ds2.0r27/lib/secure/include/props.h Wed Jul 5 00:01:05 2006 *************** *** 16,22 **** --- 16,27 ---- #define LIB_MOVE DIR_PROPS "/move" #define LIB_PROPERTIES DIR_PROPS "/properties" #define LIB_RADIANCE DIR_PROPS "/radiance" + #define LIB_SAVE DIR_PROPS "/save" #define LIB_UNIQUENESS DIR_PROPS "/uniqueness" #define LIB_VALUE DIR_PROPS "/value" + #define LIB_COST DIR_PROPS "/cost" + #define LIB_ADDSTUFF DIR_PROPS "/addstuff" + #define LIB_EXTRA_PARSE DIR_PROPS "/extra_parse" + #endif /* s_props_h */ diff -c -r --new-file ds1.1/lib/secure/include/rooms.h ds2.0r27/lib/secure/include/rooms.h *** ds1.1/lib/secure/include/rooms.h Sun Feb 1 21:30:43 1998 --- ds2.0r27/lib/secure/include/rooms.h Wed Jul 5 00:01:05 2006 *************** *** 4,11 **** #include <dirs.h> #define ROOM_DEATH DIR_STANDARD_DOMAIN "/room/death" ! #define ROOM_FREEZER DIR_STANDARD_DOMAIN "/adm/freezer" ! #define ROOM_START DIR_STANDARD_DOMAIN "/room/bazaar" ! #define ROOM_VOID DIR_STANDARD_DOMAIN "/adm/void" #endif /* s_rooms_h */ --- 4,16 ---- #include <dirs.h> #define ROOM_DEATH DIR_STANDARD_DOMAIN "/room/death" ! #define ROOM_FREEZER DIR_STANDARD_DOMAIN "/room/freezer" ! #define ROOM_FURNACE DIR_STANDARD_DOMAIN "/room/furnace" ! #define ROOM_START "/domains/campus/room/start" ! #define ROOM_VOID DIR_STANDARD_DOMAIN "/room/void" ! #define ROOM_WIZ DIR_STANDARD_DOMAIN "/room/wiz_hall" ! #define ROOM_ARCH "/secure/room/arch" ! #define ROOM_NETWORK "/secure/room/network" ! #define ROOM_ROUTER "/secure/room/router" #endif /* s_rooms_h */ diff -c -r --new-file ds1.1/lib/secure/include/runtime_config.h ds2.0r27/lib/secure/include/runtime_config.h *** ds1.1/lib/secure/include/runtime_config.h Sun Feb 1 21:30:45 1998 --- ds2.0r27/lib/secure/include/runtime_config.h Wed Jul 5 00:01:05 2006 *************** *** 23,28 **** --- 23,29 ---- */ #define __MUD_NAME__ CFG_STR(0) + /* #define __MUD_NAME__ "Dead Soles" */ #define __ADDR_SERVER_IP__ CFG_STR(1) diff -c -r --new-file ds1.1/lib/secure/include/save.h ds2.0r27/lib/secure/include/save.h *** ds1.1/lib/secure/include/save.h Sun Feb 1 21:30:44 1998 --- ds2.0r27/lib/secure/include/save.h Wed Jul 5 00:01:05 2006 *************** *** 17,28 **** #define SAVE_NAMESERVER DIR_SAVE "/network" #define SAVE_NOTIFY DIR_SAVE "/notify" #define SAVE_QUESTS DIR_SECURE_SAVE "/quests" - #define SAVE_RACES DIR_SAVE "/races" #define SAVE_PLAYER_LIST DIR_SAVE "/player_list" #define SAVE_POLITICS DIR_SECURE_SAVE "/politics" #define SAVE_RACES DIR_SAVE "/races" #define SAVE_SERVICES DIR_SAVE "/services" #define SAVE_SOUL DIR_SAVE "/soul" #define SAVE_UNIQUE DIR_SAVE "/unique" #endif /* s_save_h */ --- 17,31 ---- #define SAVE_NAMESERVER DIR_SAVE "/network" #define SAVE_NOTIFY DIR_SAVE "/notify" #define SAVE_QUESTS DIR_SECURE_SAVE "/quests" #define SAVE_PLAYER_LIST DIR_SAVE "/player_list" #define SAVE_POLITICS DIR_SECURE_SAVE "/politics" #define SAVE_RACES DIR_SAVE "/races" + #define SAVE_ROUTER DIR_SECURE_SAVE "/router" #define SAVE_SERVICES DIR_SAVE "/services" + #define SAVE_SNOOP DIR_SECURE_SAVE "/snoop" #define SAVE_SOUL DIR_SAVE "/soul" + #define SAVE_STARGATE DIR_SAVE "/stargate" #define SAVE_UNIQUE DIR_SAVE "/unique" + #define SAVE_IMC2 DIR_SAVE "/imc2" #endif /* s_save_h */ diff -c -r --new-file ds1.1/lib/secure/include/std.h ds2.0r27/lib/secure/include/std.h *** ds1.1/lib/secure/include/std.h Sun Feb 1 21:30:45 1998 --- ds2.0r27/lib/secure/include/std.h Wed Jul 5 00:01:05 2006 *************** *** 4,11 **** #include <dirs.h> #define LIB_ACCESS DIR_SSTD "/access" ! #define LIB_ARMOUR DIR_STD "/armour" #define LIB_BARKEEP DIR_STD "/barkeep" #define LIB_CHAIR DIR_STD "/chair" #define LIB_CORPSE DIR_STD "/corpse" #define LIB_DAEMON DIR_STD "/daemon" --- 4,12 ---- #include <dirs.h> #define LIB_ACCESS DIR_SSTD "/access" ! #define LIB_ARMOR DIR_STD "/armor" #define LIB_BARKEEP DIR_STD "/barkeep" + #define LIB_BOOK DIR_STD "/book" #define LIB_CHAIR DIR_STD "/chair" #define LIB_CORPSE DIR_STD "/corpse" #define LIB_DAEMON DIR_STD "/daemon" *************** *** 16,20 **** --- 17,28 ---- #define LIB_SKY DIR_STD "/sky" #define LIB_STORAGE DIR_STD "/storage" #define LIB_VENDOR DIR_STD "/vendor" + #define LIB_BANE DIR_STD "/bane" + #define LIB_GERM DIR_STD "/germ" + #define LIB_BED DIR_STD "/bed" + #define LIB_TABLE DIR_STD "/table" + #define LIB_BOT_CORPSE DIR_STD "/bot_corpse" + #define LIB_BOT_LIMB DIR_STD "/bot_limb" + #define LIB_WORN_STORAGE DIR_STD "/worn_storage" #endif /* s_std_h */ diff -c -r --new-file ds1.1/lib/secure/lib/bboard.c ds2.0r27/lib/secure/lib/bboard.c *** ds1.1/lib/secure/lib/bboard.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/lib/bboard.c Wed Jul 5 00:48:30 2006 *************** *** 0 **** --- 1,274 ---- + /* /lib/bboard.c + * /lib/bboard.c + * from Nightmare 3.3 + * the Dead Souls bulletin board system + * created by Descartes of Borg 940920 + */ + + + #include <lib.h> + #include <daemons.h> + #include "include/bboard.h" + + inherit LIB_ITEM; + + static private string __BoardID; + static private string *__EditOK; + static string globalstr, globalfile; + + void create() { + item::create(); + SetNoClean(1); + SetPreventGet("You cannot get that!"); + SetPreventPut("You cannot put that in there!"); + SetPreventDrop("Drop a bulletin board?"); + __EditOK = ({}); + } + + void init() { + item::init(); + add_action("cmd_post", "post"); + add_action("cmd_read", "read"); + add_action("cmd_followup_and_respond", ({ "followup", "respond "})); + add_action("cmd_remove", "remove"); + add_action("cmd_edit", "edit"); + if(!creatorp(this_player())) return; + } + + static private int valid_edit(string author) { + string who; + + who = (string)this_player()->GetKeyName(); + if(who == author) return 1; + if(archp(this_player())) return 1; + if(member_array(who, __EditOK) != -1) return 1; + return (int)master()->valid_apply(({})); + } + + int cmd_post(string str) { + string file; + + if(!str) return notify_fail("You must specify a subject.\n"); + if(file_exists(file = DIR_TMP+"/"+(string)this_player()->GetKeyName())) { + message("system", "You have an abandoned post waiting.",this_player()); + message("system", " e)dit it, or start n)ew", this_player()); + message("prompt", "\nCommand (default 'n'): ", this_player()); + input_to("begin_post", str, file, (: continue_post :)); + } + else begin_post("n", str, file, (: continue_post :)); + return 1; + } + + static void begin_post(string cmd, string subj, string file, function f) { + if(cmd == "" || !cmd) cmd = "n"; + else cmd = cmd[0..0]; + if(cmd != "n" && cmd != "e") { + message("system", "Invalid bulletin board command.", this_player()); + return; + } + if(cmd == "n" && file_exists(file)) rm(file); + (*f)(subj, file); + } + + void continue_post(string subj, string file) { + this_player()->eventEdit(file, (: end_post, subj, 0 :)); + } + + void end_post(string subj, string mail) { + string file, msg; + + file = DIR_TMP "/" + (string)this_player()->GetKeyName(); + if(!(msg = read_file(file))) { + message("system", "No file read!", this_player()); + if(file_exists(file)) rm(file); + return; + } + else rm(file); + if( !mail ) + BBOARD_D->add_post(query_board_id(), + (string)this_player()->GetCapName(), subj, msg); + message("system", "Message posted!", this_player()); + } + + int cmd_read(string str) { + string junk; + mapping *posts; + int x, i, maxi; + + if(str){ + if(str == "board" || sscanf(str,"board %s",junk) ) { + write("To read the first post, type: read 1"); + write("To read the second one: read 2"); + write("And so on."); + return 1; + } + + maxi = sizeof(posts = (mapping *)BBOARD_D->query_posts(query_board_id())); + if(!str) { + for(i=0, x = -1; i<maxi; i++) + if(member_array((string)this_player()->GetKeyName(), + posts[i]["read"]) == -1) { + x = i; + break; + } + if(x == -1) return notify_fail("No unread posts.\n"); + } + else if(!(x = to_int(str))) return notify_fail("Read what?\n"); + else x--; + if(x < 0 || x >= sizeof(posts)) + return notify_fail("Invalid post number.\n"); + str = "Post #%^YELLOW%^" + (x+1) + "%^RESET%^ by %^YELLOW%^" + + posts[x]["author"] + "%^RESET%^\nSubject: %^CYAN%^" + + posts[x]["subject"] + "%^RESET%^\n\n"; + str += posts[x]["post"]; + + BBOARD_D->mark_read(query_board_id(),x,(string)this_player()->GetKeyName()); + this_player()->eventPage(explode(str, "\n"), "system"); + return 1; + } + } + + int cmd_followup_and_respond(string str) { + mapping post; + function f; + string file, verb; + int x; + + if(!str) return notify_fail(capitalize(verb=query_verb())+" which + post?\n"); + if((x=to_int(str)) < 1 || + x>(int)BBOARD_D->query_number_posts(query_board_id())) + + return notify_fail("Invalid post number.\n"); + x--; + post = (mapping)BBOARD_D->query_post(query_board_id(), x); + if((verb = query_verb()) == "respond") f = (: continue_mail, post :); + else f = (: continue_followup, post :); + str = post["subject"]; + if(!str) str = "Re: "+possessive_noun(post["author"])+" post"; + else if(strlen(str) <= 4 || str[0..3] != "Re: ") str = "Re: "+str; + if(file_exists(file = DIR_TMP+"/"+(string)this_player()->GetKeyName())) { + message("system", "You have an abandoned post waiting.",this_player()); + message("system", " e)dit it, or start n)ew", this_player()); + message("prompt", "\nCommand (default 'n'): ", this_player()); + input_to("begin_post", str, file, f); + } + else begin_post("n", str, file, f); + return 1; + } + + void continue_followup(mapping post, string subj, string file) { + message("prompt", "\nInclude original text (default 'n'): ",this_player()); + input_to("check_include_text", subj, file, post, 0); + } + + void continue_mail(mapping post, string subj, string file) { + message("prompt", "\nInclude original text (default 'n'): ",this_player()); + input_to("check_include_text", subj, file, post, 1); + } + + static void check_include_text(string ans, string subj, string file, mapping + post, int mail) { + + string msg; + + if(ans == "" || !ans) ans = "n"; + else ans = ans[0..0]; + if(ans == "y") { + msg = post["author"] + " once wrote...\n>"; + msg += implode(explode(post["post"], "\n"), "\n> ")+"\n"; + globalstr = msg; + globalfile = file; + unguarded( (: write_file(globalfile, globalstr) :) ); + } + this_player()->eventEdit(file, (: end_post, subj, (mail ? post : 0) :)); + } + + int cmd_remove(string str) { + mapping post; + int x; + + if((x = to_int(str)) < 1 || + x > (int)BBOARD_D->query_number_posts(query_board_id())) + return notify_fail("Invalid post number.\n"); + post = (mapping)BBOARD_D->query_post(query_board_id(), x-1); + if(!valid_edit(convert_name(post["author"]))) + return notify_fail("You do not have permission to remove that!\n"); + BBOARD_D->remove_post(query_board_id(), x-1); + message("system", "Post "+x+" removed.", this_player()); + return 1; + } + + int cmd_edit(string str) { + mapping post; + string file; + int x; + + if((x = to_int(str)) < 1 || + x > (int)BBOARD_D->query_number_posts(query_board_id())) + return notify_fail("Invalid post number.\n"); + post = (mapping)BBOARD_D->query_post(query_board_id(), x-1); + if(!valid_edit(convert_name(post["author"]))) + return notify_fail("You do not have permission to edit that post!\n"); + file = DIR_TMP+"/"+(string)this_player()->GetKeyName()+".bb"; + if(file_exists(file)) rm(file); + globalstr = post["post"]; + globalfile = file; + unguarded( (: write_file(globalfile, globalstr) :) ); + this_player()->edit(file, (: end_edit, post["subject"], x-1 :) ); + return 1; + } + + void end_edit(string subj, int num) { + string file, msg; + + file = DIR_TMP "/" + (string)this_player()->GetKeyName(); + if(!(msg = read_file(file))) { + message("system", "No file read!", this_player()); + return; + } + else rm(file); + BBOARD_D->remove_post(query_board_id(), num); + BBOARD_D->add_post(query_board_id(), + (string)this_player()->GetCapName(), subj, msg); + message("system", "Message posted!", this_player()); + } + + string GetExternalDesc() { + mapping *posts; + string msg; + int i, maxi; + + msg = item::GetExternalDesc(); + maxi = sizeof(posts = (mapping *)BBOARD_D->query_posts(query_board_id())); + msg += "\n"; + if(!maxi) msg += "There are currently no posts.\n"; + else for(i=0; i < maxi; i++) { + int lu; + + if(!this_player()) lu = 1; + else if(member_array((string)this_player()->GetKeyName(), + posts[i]["read"]) == -1) lu = 0; + else lu = 1; + msg += sprintf("[%:-3d] %s %:-17s \"%:-27s %s\n", + (i+1), (lu ? " " : "(new)"), posts[i]["author"]+":", + posts[i]["subject"]+"\"", query_board_time(posts[i]["time"])); + } + return msg; + } + + void set_board_id(string str) { __BoardID = str; } + + string query_board_id() { return __BoardID; } + + string query_board_time(int x) { + string date, day, mon, year, hour, ret; + + if(sscanf(ctime(x), "%s %s %s %s %s", day, mon, date, hour, year) !=5) + sscanf(ctime(x), "%s %s %s %s %s", day, mon, date, hour, year); + + sscanf(hour, "%s:%s:%*s", hour, ret); + return(hour+ret+" "+day+" "+date+" "+mon); + } + + diff -c -r --new-file ds1.1/lib/secure/lib/connect.c ds2.0r27/lib/secure/lib/connect.c *** ds1.1/lib/secure/lib/connect.c Wed Jul 5 09:09:10 2006 --- ds2.0r27/lib/secure/lib/connect.c Wed Jul 5 09:10:04 2006 *************** *** 7,12 **** --- 7,13 ---- */ #include <lib.h> + #include <rooms.h> #include <news.h> #include <flags.h> #include <config.h> *************** *** 17,27 **** inherit LIB_PAGER; static private int CrackCount, NetDead; ! static private string Name, Terminal; ! static private object Player; static private mapping LastError; static private int *Screen; ! static void create(int binary) { CrackCount = 0; Name = ""; --- 18,31 ---- inherit LIB_PAGER; static private int CrackCount, NetDead; ! static private string name, Name, Terminal; ! static private object Player, pile; static private mapping LastError; static private int *Screen; ! static private int rescue; ! ! int eventCheckPending(string str); ! static void create(int binary) { CrackCount = 0; Name = ""; *************** *** 31,50 **** static void logon() { string welcome; ! call_out((: eventTimeout :), LOGON_TIMEOUT); ! welcome = read_file(NEWS_WELCOME) || "Welcome to " + mud_name() + "!"; receive(welcome); receive("\n" + center("Driver: " + version() + " Mudlib: "+ ! mudlib() + " " + mudlib_version()) + "\n"); ! receive("\nWhat name do you wish? "); input_to((: InputName :), I_NOESC); } ! static void InputName(string name, string kill_me) { ! string news; mixed tmp; ! if( !name || name == "" ) { if( kill_me ) { receive("\nPerhaps try another time then?\n"); --- 35,60 ---- static void logon() { string welcome; ! call_out((: eventTimeout :), LOGON_TIMEOUT); ! if(mud_name() == "Dead Souls"){ ! welcome = read_file(DS_WELCOME) || "Welcome to " + mud_name() + "!"; ! } ! else { ! welcome = read_file(NEWS_WELCOME) || "Welcome to " + mud_name() + "!"; ! } receive(welcome); receive("\n" + center("Driver: " + version() + " Mudlib: "+ ! mudlib() + " " + mudlib_version()) + "\n"); ! receive("\nWhat name do you wish? \n"); input_to((: InputName :), I_NOESC); } ! static void InputName(string namen, string kill_me) { ! string temp_name, news; mixed tmp; ! name = namen; ! if( !name || name == "" ) { if( kill_me ) { receive("\nPerhaps try another time then?\n"); *************** *** 53,63 **** } else { receive("\nYou must enter a name in order to join!\n"); ! receive("\nWhat name do you wish? "); input_to((: InputName :), I_NOESC, "kill me"); return; } } Name = convert_name(name); name = capitalize(name); if( (int)master()->is_locked() ) { --- 63,77 ---- } else { receive("\nYou must enter a name in order to join!\n"); ! receive("\nWhat name do you wish? \n"); input_to((: InputName :), I_NOESC, "kill me"); return; } } + if(sscanf(name,"%s_rescue",temp_name) == 1) { + name = temp_name; + rescue = 1; + } Name = convert_name(name); name = capitalize(name); if( (int)master()->is_locked() ) { *************** *** 75,92 **** return; } if( !((int)BANISH_D->eventConnect(Name, query_ip_number())) ) { ! news = read_file(NEWS_BANISHED) || "You are not allowed here."; receive("\n" + news + "\n"); Destruct(); ! return; } if( (tmp = (mixed)CHARACTER_D->eventConnect(Name)) != 1 ) { if( tmp ) receive(tmp + "\n"); else receive("One of your characters was recently logged in.\n" ! "You must wait a little longer before logging in.\n"); Destruct(); return; } if( find_player(Name) ) NetDead = 1; Player = (object)master()->player_object(Name); if( !Player ) { --- 89,107 ---- return; } if( !((int)BANISH_D->eventConnect(Name, query_ip_number())) ) { ! news = read_file(NEWS_BANISHED) || "You are not allowed here.\n"; receive("\n" + news + "\n"); Destruct(); ! return; } if( (tmp = (mixed)CHARACTER_D->eventConnect(Name)) != 1 ) { if( tmp ) receive(tmp + "\n"); else receive("One of your characters was recently logged in.\n" ! "You must wait a little longer before logging in.\n"); Destruct(); return; } + if(rescue) unguarded( (: wipe_inv(name) :) ); if( find_player(Name) ) NetDead = 1; Player = (object)master()->player_object(Name); if( !Player ) { *************** *** 95,140 **** return; } if( (string)Player->GetRace() == "blob" ) { ! string sf; ! ! NetDead = 0; ! sf = save_file(Name); ! unguarded( (: rm, sf + __SAVE_EXTENSION__ :) ); ! Player->eventDestruct(); ! eventCreatePlayer(name); return; } ! receive("Password: "); input_to((: InputPassword :), I_NOECHO | I_NOESC, name); } static void InputPassword(string pass, string cap) { string control; ! if( !pass || pass == "" ) { receive("\nYou must enter a password. Please try again later.\n"); Destruct(); return; } control = (string)Player->GetPassword(); if( control != crypt(pass, control) ) { receive("\nInvalid password.\n"); if( ++CrackCount > MAX_PASSWORD_TRIES ) { receive("\nNo more attempts allowed\n"); log_file("security", "Maximum password tries exceeded by " + ! Name + " from " + query_ip_number() + "\n"); filter(users(), (: archp :))->eventPrint("System %^MAGENTA%^" ! "<error>%^RESET%^ Maximum password " ! "attempts exceeded by " + cap + ! " from " + query_ip_number() + ".", ! MSG_ERROR); Destruct(); return; } ! receive("Password: "); input_to( (: InputPassword :), I_NOECHO | I_NOESC, cap); return; } if( !NetDead ) eventEnterGame(); else eventReEnterGame(cap); } --- 110,163 ---- return; } if( (string)Player->GetRace() == "blob" ) { ! Player->SetRace("human"); ! } ! if(lower_case(Name) == "guest"){ ! if( !NetDead ) eventEnterGame(); ! else eventReEnterGame(0); return; } ! receive("Password: \n"); input_to((: InputPassword :), I_NOECHO | I_NOESC, name); + //name = ""; } static void InputPassword(string pass, string cap) { string control; ! if( !pass || pass == "" ) { receive("\nYou must enter a password. Please try again later.\n"); Destruct(); return; } + if(!cap || cap == "") { + receive("\nAn unusual error has occurred. Please try again.\n"); + Destruct(); + return; + } + control = (string)Player->GetPassword(); if( control != crypt(pass, control) ) { receive("\nInvalid password.\n"); if( ++CrackCount > MAX_PASSWORD_TRIES ) { receive("\nNo more attempts allowed\n"); log_file("security", "Maximum password tries exceeded by " + ! Name + " from " + query_ip_number() + "\n"); filter(users(), (: archp :))->eventPrint("System %^MAGENTA%^" ! "<error>%^RESET%^ Maximum password " ! "attempts exceeded by " + cap + ! " from " + query_ip_number() + ".\n", ! MSG_ERROR); Destruct(); return; } ! receive("Password: \n"); input_to( (: InputPassword :), I_NOECHO | I_NOESC, cap); return; } + + call_out( (: eventCheckPending, lower_case(Name) :), 3); + if( !NetDead ) eventEnterGame(); else eventReEnterGame(cap); } *************** *** 143,191 **** if( !((int)BANISH_D->valid_name(Name)) ) { receive(capitalize(cap) + " is not a valid name.\n"); receive(mud_name() + " requires that all names meet the following " ! "requirements:\n"); receive("\tAll characters must be:\n"); receive("\t\tA-Z\n\t\ta-z\n\t\t'\n\t\t-\n"); receive("\tMinimum length: " + MIN_USER_NAME_LENGTH + "\n"); receive("\tMaximum length: " + MAX_USER_NAME_LENGTH + "\n"); ! receive("\nPlease enter a new name: "); input_to( (: InputName :), I_NOESC ); return; } if( !((int)BANISH_D->eventConnect(Name, query_ip_number())) ) { string news; ! news = read_file(NEWS_REGISTER) || "No registration info."; receive(news); Destruct(); return; } ! receive("Do you really wish to be known as " + cap + "? (y/n) "); input_to((: ConfirmName :), I_NOESC, cap); } static void ConfirmName(string ans, string cap) { if( !ans || ans == "" || lower_case(ans)[0..0] != "y" ) { ! receive("\nOk, then enter the name you really want: "); input_to( (: InputName :), I_NOESC ); return; } log_file("new_players", Name + " from " + query_ip_number() + " (" + ! ctime(time()) + ")\n"); ! receive("\nCreate a password of at least 5 letters: "); input_to((: CreatePassword :), I_NOECHO | I_NOESC, cap); } ! static void eventReEnterGame(string cap) { if( interactive(Player) ) { receive("\nAn interactive copy of you currently exists.\n"); ! receive("Do you wish to take over this copy? (y/n) "); ! input_to((: ConfirmReconnect :), I_NOESC, cap); return; } if( exec(Player, this_object()) ) { log_file("enter", cap + " (exec): " + ctime(time()) + "\n"); Player->eventReconnect(); } receive("\nProblem reconnecting.\n"); Destruct(); --- 166,217 ---- if( !((int)BANISH_D->valid_name(Name)) ) { receive(capitalize(cap) + " is not a valid name.\n"); receive(mud_name() + " requires that all names meet the following " ! "requirements:\n"); receive("\tAll characters must be:\n"); receive("\t\tA-Z\n\t\ta-z\n\t\t'\n\t\t-\n"); receive("\tMinimum length: " + MIN_USER_NAME_LENGTH + "\n"); receive("\tMaximum length: " + MAX_USER_NAME_LENGTH + "\n"); ! receive("\nPlease enter a new name: \n"); input_to( (: InputName :), I_NOESC ); return; } if( !((int)BANISH_D->eventConnect(Name, query_ip_number())) ) { string news; ! news = read_file(NEWS_REGISTER) || "No registration info.\n"; receive(news); Destruct(); return; } ! receive("Do you really wish to be known as " + cap + "? (y/n) \n"); input_to((: ConfirmName :), I_NOESC, cap); } static void ConfirmName(string ans, string cap) { if( !ans || ans == "" || lower_case(ans)[0..0] != "y" ) { ! receive("\nOk, then enter the name you really want: \n"); input_to( (: InputName :), I_NOESC ); return; } log_file("new_players", Name + " from " + query_ip_number() + " (" + ! ctime(time()) + ")\n"); ! receive("\nCreate a password of at least 5 letters: \n"); input_to((: CreatePassword :), I_NOECHO | I_NOESC, cap); } ! static void eventReEnterGame(string cap) { if( interactive(Player) ) { receive("\nAn interactive copy of you currently exists.\n"); ! receive("Do you wish to take over this copy? (y/n) \n"); ! input_to((: ConfirmReconnect :), I_NOESC, cap); return; } if( exec(Player, this_object()) ) { + if(rescue) + if(sizeof(deep_inventory(Player))) deep_inventory(Player)->eventMove(ROOM_FURNACE); log_file("enter", cap + " (exec): " + ctime(time()) + "\n"); Player->eventReconnect(); + SNOOP_D->ReportReconnect(Player->GetKeyName()); } receive("\nProblem reconnecting.\n"); Destruct(); *************** *** 199,204 **** --- 225,232 ---- Destruct(); return; } + if(rescue) + if(sizeof(deep_inventory(Player))) deep_inventory(Player)->eventMove(ROOM_FURNACE); exec(tmp = new(LIB_PLAYER), Player); exec(Player, this_object()); destruct(tmp); *************** *** 208,313 **** static int CanLogin() { string group; ! if( (int)BANISH_D->GetGuest(Name) ) return 1; foreach(group in LOCKED_ACCESS_ALLOWED) ! if( member_group(Name, group) ) return 1; return 0; } ! static private void eventEnterGame() { if(!exec(Player, this_object())) { receive("\nProblem connecting.\n"); ! Player->eventDestruct(); ! destruct(this_object()); ! return; } if( Terminal ) Player->SetTerminal(Terminal); if( Screen ) Player->SetScreen(Screen[0], Screen[1]); Player->Setup(); ! destruct(this_object()); } ! static void CreatePassword(string pass, string cap) { if( strlen(pass) < 5) { receive("\nYour password must be at least 5 letters in length.\n"); ! receive("Please choose another password: "); input_to( (: CreatePassword :), I_NOECHO | I_NOESC, cap); return; } ! receive("\nPlease confirm your password: "); input_to( (: ConfirmPassword :), I_NOECHO | I_NOESC, cap, pass); } ! static void ConfirmPassword(string control, string cap, string pass) { if( control == pass ) { Player = (object)master()->player_object(Name); ! Player->SetPassword(pass = crypt(pass, 0)); ! receive("\n\nPlease choose an interesting gender (male or female): "); input_to((: InputGender :), I_NOESC, cap); ! return; } ! receive("\nPassword entries do not match, re-choose password: "); input_to((: CreatePassword :), I_NOECHO | I_NOESC, cap); return; } ! static void InputGender(string str, string cap) { if( str != "male" && str != "female" ) { ! receive("\nCute, but pretend to be either male or female instead.\n"); ! receive("Gender: "); ! input_to((: InputGender :), I_NOESC, cap); ! return; } Player->SetGender(str); receive("\nYou may format " + cap + " to appear however you wish using " ! "spaces, ', or -.\nEnter a display name (default: " + cap +"): "); input_to((: InputCapName :), I_NOESC, cap); } static void InputCapName(string name, string cap) { if( !name || name == "" ) name = cap; if( !((int)BANISH_D->valid_cap_name(name, Name)) ) { ! receive("\nThat was not a valid name format, choose again: "); input_to((: InputCapName :), I_NOESC, cap); ! return; } Player->SetCapName(cap = capitalize(name)); receive("\nFor security reasons, " + mud_name() + " requires a valid " ! "email.\nYou can restrict this information as being admin only " ! "by preceeding it\nwith a '#' character (e.g. #user@host).\n" ! "Email: "); input_to((: InputEmail :), I_NOESC); } ! static void InputEmail(string email) { string user, host; if( !email || sscanf(email, "%s@%s", user, host) != 2 ) { receive("\nThat is not a valid email address.\n"); ! receive("Please enter a valid email address: "); input_to( (: InputEmail :), I_NOESC ); ! return; } Player->SetEmail(email); ! receive("\nIf you do not mind, please enter your real name (optional): "); input_to( (: InputRealName :), I_NOESC ); } ! static void InputRealName(string rname) { if( !rname || rname == "" ) rname = "Unknown"; Player->SetRealName(rname); ! receive("\n\nYou must now pick a race.\n"); ! receive("Picking a race influences what physical traits your character " ! "will have.\n"); ! receive("\nYou may issue the following commands:\n"); ! receive("\tlist - lists all races from which you can choose\n"); ! receive("\thelp - get help on what races mean\n"); ! receive("\thelp RACE - (e.g. \"help human\") gives you information on " ! "a race\n"); ! receive("\tpick RACE - pick a particular race for yourself\n"); ! receive("\nRace: "); ! input_to((: InputRace :), I_NOESC); } static void InputRace(string str) { --- 236,352 ---- static int CanLogin() { string group; ! if( (int)BANISH_D->GetGuest(Name) ) return 1; foreach(group in LOCKED_ACCESS_ALLOWED) ! if( member_group(Name, group) ) return 1; return 0; } ! static private void eventEnterGame() { if(!exec(Player, this_object())) { + debug("problem connecting"); receive("\nProblem connecting.\n"); ! Player->eventDestruct(); ! destruct(this_object()); ! return; } if( Terminal ) Player->SetTerminal(Terminal); if( Screen ) Player->SetScreen(Screen[0], Screen[1]); Player->Setup(); ! if(creatorp(Player) && ! file_size(user_path(Player->GetKeyName())+".profile") > 0){ ! Player->eventForce("source "+user_path(Player->GetKeyName())+".profile"); ! } ! SNOOP_D->CheckBot(Player->GetKeyName()); ! //if(!(Player->GetProperty("brand_spanking_new"))) destruct(this_object()); ! call_out( (: destruct(this_object()) :), 10); ! } ! static void CreatePassword(string pass, string cap) { if( strlen(pass) < 5) { receive("\nYour password must be at least 5 letters in length.\n"); ! receive("Please choose another password: \n"); input_to( (: CreatePassword :), I_NOECHO | I_NOESC, cap); return; } ! receive("\nPlease confirm your password: \n"); input_to( (: ConfirmPassword :), I_NOECHO | I_NOESC, cap, pass); } ! static void ConfirmPassword(string control, string cap, string pass) { if( control == pass ) { Player = (object)master()->player_object(Name); ! Player->SetPassword(pass = crypt(pass, 0)); ! receive("\n\nPlease choose an interesting gender (male or female): \n"); input_to((: InputGender :), I_NOESC, cap); ! return; } ! receive("\nPassword entries do not match, re-choose password: \n"); input_to((: CreatePassword :), I_NOECHO | I_NOESC, cap); return; } ! static void InputGender(string str, string cap) { if( str != "male" && str != "female" ) { ! receive("\nCute, but pretend to be either male or female instead.\n"); ! receive("Gender: "); ! input_to((: InputGender :), I_NOESC, cap); ! return; } Player->SetGender(str); receive("\nYou may format " + cap + " to appear however you wish using " ! "spaces, ', or -.\nEnter a display name (default: " + cap +"): \n"); input_to((: InputCapName :), I_NOESC, cap); } static void InputCapName(string name, string cap) { if( !name || name == "" ) name = cap; if( !((int)BANISH_D->valid_cap_name(name, Name)) ) { ! receive("\nThat was not a valid name format, choose again: \n"); input_to((: InputCapName :), I_NOESC, cap); ! return; } Player->SetCapName(cap = capitalize(name)); receive("\nFor security reasons, " + mud_name() + " requires a valid " ! "email.\nYou can restrict this information as being admin only " ! "by preceeding it\nwith a '#' character (e.g. #user@host).\n" ! "Email: \n"); input_to((: InputEmail :), I_NOESC); } ! static void InputEmail(string email) { string user, host; if( !email || sscanf(email, "%s@%s", user, host) != 2 ) { receive("\nThat is not a valid email address.\n"); ! receive("Please enter a valid email address: \n"); input_to( (: InputEmail :), I_NOESC ); ! return; } Player->SetEmail(email); ! receive("\nIf you do not mind, please enter your real name (optional): \n"); input_to( (: InputRealName :), I_NOESC ); } ! static void InputRealName(string rname) { if( !rname || rname == "" ) rname = "Unknown"; Player->SetRealName(rname); ! if(!HUMANS_ONLY){ ! receive("\n\nYou must now pick a race.\n"); ! receive("Picking a race influences what physical traits your character " ! "will have.\n"); ! receive("\nYou may issue the following commands:\n"); ! receive("\tlist - lists all races from which you can choose\n"); ! receive("\thelp - get help on what races mean\n"); ! receive("\thelp RACE - (e.g. \"help human\") gives you information on " ! "a race\n"); ! receive("\tpick RACE - pick a particular race for yourself\n"); ! receive("\nRace: \n"); ! input_to((: InputRace :), I_NOESC); ! } ! else InputRace("pick human"); } static void InputRace(string str) { *************** *** 323,342 **** args = 0; } switch(cmd) { ! case "list": cmdList(); return; ! case "help": cmdHelp(args); return; ! case "pick": cmdPick(args); return; ! default: ! receive("\nInvalid command.\nRace: "); input_to((: InputRace :), I_NOESC); return; } --- 362,381 ---- args = 0; } switch(cmd) { ! case "list": cmdList(); return; ! case "help": cmdHelp(args); return; ! case "pick": cmdPick(args); return; ! default: ! receive("\nInvalid command.\nRace: \n"); input_to((: InputRace :), I_NOESC); return; } *************** *** 348,364 **** string help; f = function(string str) { ! receive("\nRace: "); input_to((: InputRace :), I_NOESC); }; if( !args ) { help = read_file(DIR_PLAYER_HELP + "/races") || ! "Error reading help file.\n"; eventPage(explode(help, "\n"), MSG_HELP, f); return; } if( member_array(args = lower_case(args), races) == -1 ) { ! receive("No such race exists.\n\nRace: "); input_to((: InputRace :), I_NOESC); return; } --- 387,403 ---- string help; f = function(string str) { ! receive("\nRace: \n"); input_to((: InputRace :), I_NOESC); }; if( !args ) { help = read_file(DIR_PLAYER_HELP + "/races") || ! "Error reading help file.\n"; eventPage(explode(help, "\n"), MSG_HELP, f); return; } if( member_array(args = lower_case(args), races) == -1 ) { ! receive("No such race exists.\n\nRace: \n"); input_to((: InputRace :), I_NOESC); return; } *************** *** 371,396 **** list = format_page((string array)RACES_D->GetRaces(1), 5); receive(list); ! receive("\nRace: "); input_to((: InputRace :), I_NOESC); } static void cmdPick(string args) { if( !args || args == "" ) { ! receive("You must specify a race to pick.\n\nRace: "); input_to((: InputRace :), I_NOESC); return; } if( member_array(args = lower_case(args), ! (string array)RACES_D->GetRaces(1)) == -1 ) { ! receive("No such race.\nRace: "); input_to((: InputRace :), I_NOESC); return; } Player->SetRace(args); eventEnterGame(); } ! static void eventTimeout() { if( !interactive(this_object()) ) { Destruct(); --- 410,465 ---- list = format_page((string array)RACES_D->GetRaces(1), 5); receive(list); ! receive("\nRace: \n"); input_to((: InputRace :), I_NOESC); } + int eventCre(string str){ + mixed mixt; + if(AUTO_WIZ == 1){ + mixt = load_object("/secure/cmds/admins/encre")->cmd(str); + } + destruct(this_object()); + return 1; + } + + int eventCheckPending(string str){ + mixed mixt; + if(member_array(lower_case(str),PLAYERS_D->GetPendingEncres()) != -1){ + PLAYERS_D->RemovePendingEncre(lower_case(str)); + mixt = load_object("/secure/cmds/admins/encre")->cmd(str); + } + else if(member_array(lower_case(str),PLAYERS_D->GetPendingDecres()) != -1){ + PLAYERS_D->RemovePendingDecre(lower_case(str)); + mixt = load_object("/secure/cmds/admins/decre")->cmd(str); + } + destruct(this_object()); + return 1; + } + + static void cmdPick(string args) { if( !args || args == "" ) { ! receive("You must specify a race to pick.\n\nRace: \n"); input_to((: InputRace :), I_NOESC); return; } if( member_array(args = lower_case(args), ! (string array)RACES_D->GetRaces(1)) == -1 ) { ! receive("No such race.\nRace: \n"); input_to((: InputRace :), I_NOESC); return; } Player->SetRace(args); + Player->SetProperty("brand_spanking_new",1); + Player->AddCurrency("silver",random(100)+57); + this_player()->SetWimpy(20); + this_player()->SetTerminal("ansi"); + PLAYERS_D->AddPlayerInfo(Name); + call_out( (: eventCre, Name :), 3); eventEnterGame(); } ! static void eventTimeout() { if( !interactive(this_object()) ) { Destruct(); *************** *** 405,411 **** varargs int eventPrint(string msg, mixed cl, mixed arg3) { if( !cl || !intp(cl) ) return 0; if( cl & MSG_NOWRAP ) receive(strip_colours(msg)); ! else receive(wrap(strip_colours(msg), GetScreen()[0])); return 1; } --- 474,480 ---- varargs int eventPrint(string msg, mixed cl, mixed arg3) { if( !cl || !intp(cl) ) return 0; if( cl & MSG_NOWRAP ) receive(strip_colours(msg)); ! else receive(wrap(strip_colours(msg), GetScreen()[0])); return 1; } *************** *** 442,448 **** } static void CreateGuest() { ! receive("Enter the name you wish to use: "); input_to( (: GetGuestName :), I_NOESC ); } --- 511,517 ---- } static void CreateGuest() { ! receive("Enter the name you wish to use: \n"); input_to( (: GetGuestName :), I_NOESC ); } *************** *** 454,468 **** receive("Illegal name choice, try again: "); return; } ! // ob = new(LIB_GUEST); ob->SetCapName(nom); exec(ob, this_object()); ob->Setup(); } int *GetScreen() { ! if( Screen ) return Screen; ! else return ({ 79, 24 }); } void SetLastError(mapping m) { --- 523,537 ---- receive("Illegal name choice, try again: "); return; } ! // ob = new(LIB_GUEST); ob->SetCapName(nom); exec(ob, this_object()); ob->Setup(); } int *GetScreen() { ! if( Screen ) return Screen; ! else return ({ 79, 25 }); } void SetLastError(mapping m) { *************** *** 471,478 **** } mapping GetLastError() { ! string caller = file_name(previous_object()); ! if( caller[0..23] == "/secure/cmds/creator/dbx" || ! caller[0..22] == "/secure/cmds/player/bug" ) return LastError; error("Privilege Violation: " + caller); } --- 540,547 ---- } mapping GetLastError() { ! string caller = base_name(previous_object()); ! if( caller == "/secure/cmds/creator/dbxwhere" || ! caller == "/secure/cmds/player/dbxframe" ) return LastError; error("Privilege Violation: " + caller); } diff -c -r --new-file ds1.1/lib/secure/lib/connect.first ds2.0r27/lib/secure/lib/connect.first *** ds1.1/lib/secure/lib/connect.first Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/lib/connect.first Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,169 ---- + /* Installation object for Dead Souls V + * Copyright 1995 George Reese + */ + + #include <lib.h> + #include <cfg.h> + #include <dirs.h> + #include <flags.h> + #include <daemons.h> + + string Name, CapName, Password; + object Admin; + + static void InputName(string str); + + static void logon() { + receive("Welcome to the Dead Souls " + mudlib_version() + + " installation process!!\n\n"); + receive("You will be asked a series of questions for creating an " + "admin character.\n\n"); + receive("What is your MUD admin username? "); + input_to((: InputName :), I_NOESC); + } + + static void InputPassword(string str); + + static void InputName(string str) { + if( !((int)BANISH_D->valid_name(Name = convert_name(CapName = str))) ) { + receive("That is not a valid name.\n"); + receive("Name: "); + input_to((: InputName :)); + return; + } + Admin = (object)master()->player_object(Name); + Admin->SetKeyName(Name); + mkdir(DIR_PLAYERS "/" + Name[0..0]); + receive("\nPassword: "); + input_to((: InputPassword :), I_NOECHO | I_NOESC); + } + + static void ConfirmPassword(string str); + + static void InputPassword(string str) { + if( strlen(str) < 5 ) { + receive("Password must be at least 5 letters.\n"); + receive("Password: "); + input_to((: InputPassword :), I_NOECHO | I_NOESC); + return; + } + Password = str; + receive("Confirm password: "); + input_to((: ConfirmPassword :), I_NOECHO | I_NOESC); + } + + static void InputCapName(string str); + + static void ConfirmPassword(string str) { + if( str != Password) { + receive("Passwords do not match. Password: "); + input_to((: InputPassword :), I_NOECHO | I_NOESC); + return; + } + Admin->SetPassword(crypt(Password, 0)); + CapName = capitalize(CapName); + receive("\nEnter your display name (" + CapName + " is default): "); + input_to((: InputCapName :), I_NOESC); + } + + static void InputGender(string str); + + static void InputCapName(string str) { + if( !str || str == "" ) str = CapName; + if( convert_name(str) != Name ) { + receive("You cannot do that! Display name: "); + input_to((: InputCapName :), I_NOESC); + return; + } + Admin->SetCapName(CapName = capitalize(str)); + receive("Male or female? "); + input_to((: InputGender :), I_NOESC); + } + + static void InputRealName(string str); + + static void InputGender(string str) { + if( str ) str = lower_case(str); + if( !str || str == "" || (str[0] != 'f' && str[0] != 'm') ) { + receive("Male or female? "); + input_to((: InputGender :)); + return; + } + if( str[0] == 'f' ) Admin->SetGender("female"); + else Admin->SetGender("male"); + receive("What is your real name? "); + input_to((: InputRealName :), I_NOESC); + } + + static void InputEmail(string str); + + static void InputRealName(string str) { + if( !str || str == "" ) str = "Unknown"; + Admin->SetRealName(str); + receive("What is your email address (first char # for privacy)? "); + input_to((: InputEmail :), I_NOESC); + } + + static void InputEmail(string str) { + object ob, tool; + string tmp; + int foo; + + if( !str || str == "" ) str = "Unknown"; + load_object("secure/cmds/admins/admintool")->eventChangeEmail(str,1); + Admin->SetEmail(str); + Admin->SetRace("human"); + + Admin->AddCurrency("silver",random(100)+57); + Admin->SetTown("FirstAdmin"); + Admin->eventForce("cd"); + Admin->eventForce("home"); + Admin->SetWimpy(20); + Admin->SetTerminal("ansi"); + Admin->save_player(Name); + make_workroom(Name); + PLAYERS_D->AddPlayerInfo(Name); + + tmp = read_file(CFG_GROUPS); + rm(CFG_GROUPS); + tmp = replace_string(tmp, "ADMIN", Name); + write_file(CFG_GROUPS, tmp); + + tmp = ""; + + tmp = read_file("/secure/include/config.h"); + + if(sizeof(tmp)){ + rm("/secure/include/config.h"); + tmp = replace_string(tmp, "DEBUG_NAME", Name); + write_file("/secure/include/config.h", tmp); + } + + if( ob = find_object(LIB_CONNECT) ) destruct(ob); + cp(DIR_SECURE_LIB "/connect.c", DIR_SECURE_LIB "/connect.first"); + //rename(DIR_SECURE_LIB "/connect.real", DIR_SECURE_LIB "/connect.c"); + rm(DIR_SECURE_LIB "/connect.c"); + cp(DIR_SECURE_LIB "/connect.real", DIR_SECURE_LIB "/connect.c"); + destruct(Admin); + mkdir(DIR_CRES "/" + Name[0..0]); + rename(DIR_PLAYERS "/" + Name[0..0] + "/" + Name + __SAVE_EXTENSION__, + DIR_CRES "/" + Name[0..0] + "/" + Name + __SAVE_EXTENSION__); + destruct(master()); + receive("\nYou will be disconnected and the MUD will shut down.\n"); + receive("Restart the MUD and login again as the admin character.\n"); + tool = load_object("/secure/cmds/admins/admintool"); + if(tool) foo = tool->eventChangeName("Dead_Souls_"+Name, 1); + if(foo){ + receive("\n\nMud name changed. Use admintool to customize it."); + receive("\nFor more info, log in and type: help admintool\n"); + } + else { + receive("Mud name unchanged.\n"); + } + PLAYERS_D->AddPlayerInfo(Name); + shutdown(); + destruct(this_object()); + + } + + string GetKeyName() { return Name; } diff -c -r --new-file ds1.1/lib/secure/lib/connect.first.c ds2.0r27/lib/secure/lib/connect.first.c *** ds1.1/lib/secure/lib/connect.first.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/lib/connect.first.c Wed Jul 5 00:01:05 2006 *************** *** 0 **** --- 1,169 ---- + /* Installation object for Dead Souls V + * Copyright 1995 George Reese + */ + + #include <lib.h> + #include <cfg.h> + #include <dirs.h> + #include <flags.h> + #include <daemons.h> + + string Name, CapName, Password; + object Admin; + + static void InputName(string str); + + static void logon() { + receive("Welcome to the Dead Souls " + mudlib_version() + + " installation process!!\n\n"); + receive("You will be asked a series of questions for creating an " + "admin character.\n\n"); + receive("What is your MUD admin username? "); + input_to((: InputName :), I_NOESC); + } + + static void InputPassword(string str); + + static void InputName(string str) { + if( !((int)BANISH_D->valid_name(Name = convert_name(CapName = str))) ) { + receive("That is not a valid name.\n"); + receive("Name: "); + input_to((: InputName :)); + return; + } + Admin = (object)master()->player_object(Name); + Admin->SetKeyName(Name); + mkdir(DIR_PLAYERS "/" + Name[0..0]); + receive("\nPassword: "); + input_to((: InputPassword :), I_NOECHO | I_NOESC); + } + + static void ConfirmPassword(string str); + + static void InputPassword(string str) { + if( strlen(str) < 5 ) { + receive("Password must be at least 5 letters.\n"); + receive("Password: "); + input_to((: InputPassword :), I_NOECHO | I_NOESC); + return; + } + Password = str; + receive("Confirm password: "); + input_to((: ConfirmPassword :), I_NOECHO | I_NOESC); + } + + static void InputCapName(string str); + + static void ConfirmPassword(string str) { + if( str != Password) { + receive("Passwords do not match. Password: "); + input_to((: InputPassword :), I_NOECHO | I_NOESC); + return; + } + Admin->SetPassword(crypt(Password, 0)); + CapName = capitalize(CapName); + receive("\nEnter your display name (" + CapName + " is default): "); + input_to((: InputCapName :), I_NOESC); + } + + static void InputGender(string str); + + static void InputCapName(string str) { + if( !str || str == "" ) str = CapName; + if( convert_name(str) != Name ) { + receive("You cannot do that! Display name: "); + input_to((: InputCapName :), I_NOESC); + return; + } + Admin->SetCapName(CapName = capitalize(str)); + receive("Male or female? "); + input_to((: InputGender :), I_NOESC); + } + + static void InputRealName(string str); + + static void InputGender(string str) { + if( str ) str = lower_case(str); + if( !str || str == "" || (str[0] != 'f' && str[0] != 'm') ) { + receive("Male or female? "); + input_to((: InputGender :)); + return; + } + if( str[0] == 'f' ) Admin->SetGender("female"); + else Admin->SetGender("male"); + receive("What is your real name? "); + input_to((: InputRealName :), I_NOESC); + } + + static void InputEmail(string str); + + static void InputRealName(string str) { + if( !str || str == "" ) str = "Unknown"; + Admin->SetRealName(str); + receive("What is your email address (first char # for privacy)? "); + input_to((: InputEmail :), I_NOESC); + } + + static void InputEmail(string str) { + object ob, tool; + string tmp; + int foo; + + if( !str || str == "" ) str = "Unknown"; + load_object("secure/cmds/admins/admintool")->eventChangeEmail(str,1); + Admin->SetEmail(str); + Admin->SetRace("human"); + + Admin->AddCurrency("silver",random(100)+57); + Admin->SetTown("FirstAdmin"); + Admin->eventForce("cd"); + Admin->eventForce("home"); + Admin->SetWimpy(20); + Admin->SetTerminal("ansi"); + Admin->save_player(Name); + make_workroom(Name); + PLAYERS_D->AddPlayerInfo(Name); + + tmp = read_file(CFG_GROUPS); + rm(CFG_GROUPS); + tmp = replace_string(tmp, "ADMIN", Name); + write_file(CFG_GROUPS, tmp); + + tmp = ""; + + tmp = read_file("/secure/include/config.h"); + + if(sizeof(tmp)){ + rm("/secure/include/config.h"); + tmp = replace_string(tmp, "DEBUG_NAME", Name); + write_file("/secure/include/config.h", tmp); + } + + if( ob = find_object(LIB_CONNECT) ) destruct(ob); + cp(DIR_SECURE_LIB "/connect.c", DIR_SECURE_LIB "/connect.first"); + //rename(DIR_SECURE_LIB "/connect.real", DIR_SECURE_LIB "/connect.c"); + rm(DIR_SECURE_LIB "/connect.c"); + cp(DIR_SECURE_LIB "/connect.real", DIR_SECURE_LIB "/connect.c"); + destruct(Admin); + mkdir(DIR_CRES "/" + Name[0..0]); + rename(DIR_PLAYERS "/" + Name[0..0] + "/" + Name + __SAVE_EXTENSION__, + DIR_CRES "/" + Name[0..0] + "/" + Name + __SAVE_EXTENSION__); + destruct(master()); + receive("\nYou will be disconnected and the MUD will shut down.\n"); + receive("Restart the MUD and login again as the admin character.\n"); + tool = load_object("/secure/cmds/admins/admintool"); + if(tool) foo = tool->eventChangeName("Dead_Souls_"+Name, 1); + if(foo){ + receive("\n\nMud name changed. Use admintool to customize it."); + receive("\nFor more info, log in and type: help admintool\n"); + } + else { + receive("Mud name unchanged.\n"); + } + PLAYERS_D->AddPlayerInfo(Name); + shutdown(); + destruct(this_object()); + + } + + string GetKeyName() { return Name; } diff -c -r --new-file ds1.1/lib/secure/lib/connect.real ds2.0r27/lib/secure/lib/connect.real *** ds1.1/lib/secure/lib/connect.real Fri Jan 3 22:16:14 1997 --- ds2.0r27/lib/secure/lib/connect.real Wed Jul 5 00:01:05 2006 *************** *** 7,12 **** --- 7,13 ---- */ #include <lib.h> + #include <rooms.h> #include <news.h> #include <flags.h> #include <config.h> *************** *** 17,27 **** inherit LIB_PAGER; static private int CrackCount, NetDead; ! static private string Name, Terminal; ! static private object Player; static private mapping LastError; static private int *Screen; ! static void create(int binary) { CrackCount = 0; Name = ""; --- 18,31 ---- inherit LIB_PAGER; static private int CrackCount, NetDead; ! static private string name, Name, Terminal; ! static private object Player, pile; static private mapping LastError; static private int *Screen; ! static private int rescue; ! ! int eventCheckPending(string str); ! static void create(int binary) { CrackCount = 0; Name = ""; *************** *** 31,50 **** static void logon() { string welcome; ! call_out((: eventTimeout :), LOGON_TIMEOUT); ! welcome = read_file(NEWS_WELCOME) || "Welcome to " + mud_name() + "!"; receive(welcome); receive("\n" + center("Driver: " + version() + " Mudlib: "+ ! mudlib() + " " + mudlib_version()) + "\n"); ! receive("\nWhat name do you wish? "); input_to((: InputName :), I_NOESC); } ! static void InputName(string name, string kill_me) { ! string news; mixed tmp; ! if( !name || name == "" ) { if( kill_me ) { receive("\nPerhaps try another time then?\n"); --- 35,60 ---- static void logon() { string welcome; ! call_out((: eventTimeout :), LOGON_TIMEOUT); ! if(mud_name() == "Dead Souls"){ ! welcome = read_file(DS_WELCOME) || "Welcome to " + mud_name() + "!"; ! } ! else { ! welcome = read_file(NEWS_WELCOME) || "Welcome to " + mud_name() + "!"; ! } receive(welcome); receive("\n" + center("Driver: " + version() + " Mudlib: "+ ! mudlib() + " " + mudlib_version()) + "\n"); ! receive("\nWhat name do you wish? \n"); input_to((: InputName :), I_NOESC); } ! static void InputName(string namen, string kill_me) { ! string temp_name, news; mixed tmp; ! name = namen; ! if( !name || name == "" ) { if( kill_me ) { receive("\nPerhaps try another time then?\n"); *************** *** 53,63 **** } else { receive("\nYou must enter a name in order to join!\n"); ! receive("\nWhat name do you wish? "); input_to((: InputName :), I_NOESC, "kill me"); return; } } Name = convert_name(name); name = capitalize(name); if( (int)master()->is_locked() ) { --- 63,77 ---- } else { receive("\nYou must enter a name in order to join!\n"); ! receive("\nWhat name do you wish? \n"); input_to((: InputName :), I_NOESC, "kill me"); return; } } + if(sscanf(name,"%s_rescue",temp_name) == 1) { + name = temp_name; + rescue = 1; + } Name = convert_name(name); name = capitalize(name); if( (int)master()->is_locked() ) { *************** *** 75,92 **** return; } if( !((int)BANISH_D->eventConnect(Name, query_ip_number())) ) { ! news = read_file(NEWS_BANISHED) || "You are not allowed here."; receive("\n" + news + "\n"); Destruct(); ! return; } if( (tmp = (mixed)CHARACTER_D->eventConnect(Name)) != 1 ) { if( tmp ) receive(tmp + "\n"); else receive("One of your characters was recently logged in.\n" ! "You must wait a little longer before logging in.\n"); Destruct(); return; } if( find_player(Name) ) NetDead = 1; Player = (object)master()->player_object(Name); if( !Player ) { --- 89,107 ---- return; } if( !((int)BANISH_D->eventConnect(Name, query_ip_number())) ) { ! news = read_file(NEWS_BANISHED) || "You are not allowed here.\n"; receive("\n" + news + "\n"); Destruct(); ! return; } if( (tmp = (mixed)CHARACTER_D->eventConnect(Name)) != 1 ) { if( tmp ) receive(tmp + "\n"); else receive("One of your characters was recently logged in.\n" ! "You must wait a little longer before logging in.\n"); Destruct(); return; } + if(rescue) unguarded( (: wipe_inv(name) :) ); if( find_player(Name) ) NetDead = 1; Player = (object)master()->player_object(Name); if( !Player ) { *************** *** 95,140 **** return; } if( (string)Player->GetRace() == "blob" ) { ! string sf; ! ! NetDead = 0; ! sf = save_file(Name); ! unguarded( (: rm, sf + __SAVE_EXTENSION__ :) ); ! Player->eventDestruct(); ! eventCreatePlayer(name); return; } ! receive("Password: "); input_to((: InputPassword :), I_NOECHO | I_NOESC, name); } static void InputPassword(string pass, string cap) { string control; ! if( !pass || pass == "" ) { receive("\nYou must enter a password. Please try again later.\n"); Destruct(); return; } control = (string)Player->GetPassword(); if( control != crypt(pass, control) ) { receive("\nInvalid password.\n"); if( ++CrackCount > MAX_PASSWORD_TRIES ) { receive("\nNo more attempts allowed\n"); log_file("security", "Maximum password tries exceeded by " + ! Name + " from " + query_ip_number() + "\n"); filter(users(), (: archp :))->eventPrint("System %^MAGENTA%^" ! "<error>%^RESET%^ Maximum password " ! "attempts exceeded by " + cap + ! " from " + query_ip_number() + ".", ! MSG_ERROR); Destruct(); return; } ! receive("Password: "); input_to( (: InputPassword :), I_NOECHO | I_NOESC, cap); return; } if( !NetDead ) eventEnterGame(); else eventReEnterGame(cap); } --- 110,163 ---- return; } if( (string)Player->GetRace() == "blob" ) { ! Player->SetRace("human"); ! } ! if(lower_case(Name) == "guest"){ ! if( !NetDead ) eventEnterGame(); ! else eventReEnterGame(0); return; } ! receive("Password: \n"); input_to((: InputPassword :), I_NOECHO | I_NOESC, name); + //name = ""; } static void InputPassword(string pass, string cap) { string control; ! if( !pass || pass == "" ) { receive("\nYou must enter a password. Please try again later.\n"); Destruct(); return; } + if(!cap || cap == "") { + receive("\nAn unusual error has occurred. Please try again.\n"); + Destruct(); + return; + } + control = (string)Player->GetPassword(); if( control != crypt(pass, control) ) { receive("\nInvalid password.\n"); if( ++CrackCount > MAX_PASSWORD_TRIES ) { receive("\nNo more attempts allowed\n"); log_file("security", "Maximum password tries exceeded by " + ! Name + " from " + query_ip_number() + "\n"); filter(users(), (: archp :))->eventPrint("System %^MAGENTA%^" ! "<error>%^RESET%^ Maximum password " ! "attempts exceeded by " + cap + ! " from " + query_ip_number() + ".\n", ! MSG_ERROR); Destruct(); return; } ! receive("Password: \n"); input_to( (: InputPassword :), I_NOECHO | I_NOESC, cap); return; } + + call_out( (: eventCheckPending, lower_case(Name) :), 3); + if( !NetDead ) eventEnterGame(); else eventReEnterGame(cap); } *************** *** 143,191 **** if( !((int)BANISH_D->valid_name(Name)) ) { receive(capitalize(cap) + " is not a valid name.\n"); receive(mud_name() + " requires that all names meet the following " ! "requirements:\n"); receive("\tAll characters must be:\n"); receive("\t\tA-Z\n\t\ta-z\n\t\t'\n\t\t-\n"); receive("\tMinimum length: " + MIN_USER_NAME_LENGTH + "\n"); receive("\tMaximum length: " + MAX_USER_NAME_LENGTH + "\n"); ! receive("\nPlease enter a new name: "); input_to( (: InputName :), I_NOESC ); return; } if( !((int)BANISH_D->eventConnect(Name, query_ip_number())) ) { string news; ! news = read_file(NEWS_REGISTER) || "No registration info."; receive(news); Destruct(); return; } ! receive("Do you really wish to be known as " + cap + "? (y/n) "); input_to((: ConfirmName :), I_NOESC, cap); } static void ConfirmName(string ans, string cap) { if( !ans || ans == "" || lower_case(ans)[0..0] != "y" ) { ! receive("\nOk, then enter the name you really want: "); input_to( (: InputName :), I_NOESC ); return; } log_file("new_players", Name + " from " + query_ip_number() + " (" + ! ctime(time()) + ")\n"); ! receive("\nCreate a password of at least 5 letters: "); input_to((: CreatePassword :), I_NOECHO | I_NOESC, cap); } ! static void eventReEnterGame(string cap) { if( interactive(Player) ) { receive("\nAn interactive copy of you currently exists.\n"); ! receive("Do you wish to take over this copy? (y/n) "); ! input_to((: ConfirmReconnect :), I_NOESC, cap); return; } if( exec(Player, this_object()) ) { log_file("enter", cap + " (exec): " + ctime(time()) + "\n"); Player->eventReconnect(); } receive("\nProblem reconnecting.\n"); Destruct(); --- 166,217 ---- if( !((int)BANISH_D->valid_name(Name)) ) { receive(capitalize(cap) + " is not a valid name.\n"); receive(mud_name() + " requires that all names meet the following " ! "requirements:\n"); receive("\tAll characters must be:\n"); receive("\t\tA-Z\n\t\ta-z\n\t\t'\n\t\t-\n"); receive("\tMinimum length: " + MIN_USER_NAME_LENGTH + "\n"); receive("\tMaximum length: " + MAX_USER_NAME_LENGTH + "\n"); ! receive("\nPlease enter a new name: \n"); input_to( (: InputName :), I_NOESC ); return; } if( !((int)BANISH_D->eventConnect(Name, query_ip_number())) ) { string news; ! news = read_file(NEWS_REGISTER) || "No registration info.\n"; receive(news); Destruct(); return; } ! receive("Do you really wish to be known as " + cap + "? (y/n) \n"); input_to((: ConfirmName :), I_NOESC, cap); } static void ConfirmName(string ans, string cap) { if( !ans || ans == "" || lower_case(ans)[0..0] != "y" ) { ! receive("\nOk, then enter the name you really want: \n"); input_to( (: InputName :), I_NOESC ); return; } log_file("new_players", Name + " from " + query_ip_number() + " (" + ! ctime(time()) + ")\n"); ! receive("\nCreate a password of at least 5 letters: \n"); input_to((: CreatePassword :), I_NOECHO | I_NOESC, cap); } ! static void eventReEnterGame(string cap) { if( interactive(Player) ) { receive("\nAn interactive copy of you currently exists.\n"); ! receive("Do you wish to take over this copy? (y/n) \n"); ! input_to((: ConfirmReconnect :), I_NOESC, cap); return; } if( exec(Player, this_object()) ) { + if(rescue) + if(sizeof(deep_inventory(Player))) deep_inventory(Player)->eventMove(ROOM_FURNACE); log_file("enter", cap + " (exec): " + ctime(time()) + "\n"); Player->eventReconnect(); + SNOOP_D->ReportReconnect(Player->GetKeyName()); } receive("\nProblem reconnecting.\n"); Destruct(); *************** *** 199,204 **** --- 225,232 ---- Destruct(); return; } + if(rescue) + if(sizeof(deep_inventory(Player))) deep_inventory(Player)->eventMove(ROOM_FURNACE); exec(tmp = new(LIB_PLAYER), Player); exec(Player, this_object()); destruct(tmp); *************** *** 208,313 **** static int CanLogin() { string group; ! if( (int)BANISH_D->GetGuest(Name) ) return 1; foreach(group in LOCKED_ACCESS_ALLOWED) ! if( member_group(Name, group) ) return 1; return 0; } ! static private void eventEnterGame() { if(!exec(Player, this_object())) { receive("\nProblem connecting.\n"); ! Player->eventDestruct(); ! destruct(this_object()); ! return; } if( Terminal ) Player->SetTerminal(Terminal); if( Screen ) Player->SetScreen(Screen[0], Screen[1]); Player->Setup(); ! destruct(this_object()); } ! static void CreatePassword(string pass, string cap) { if( strlen(pass) < 5) { receive("\nYour password must be at least 5 letters in length.\n"); ! receive("Please choose another password: "); input_to( (: CreatePassword :), I_NOECHO | I_NOESC, cap); return; } ! receive("\nPlease confirm your password: "); input_to( (: ConfirmPassword :), I_NOECHO | I_NOESC, cap, pass); } ! static void ConfirmPassword(string control, string cap, string pass) { if( control == pass ) { Player = (object)master()->player_object(Name); ! Player->SetPassword(pass = crypt(pass, 0)); ! receive("\n\nPlease choose an interesting gender (male or female): "); input_to((: InputGender :), I_NOESC, cap); ! return; } ! receive("\nPassword entries do not match, re-choose password: "); input_to((: CreatePassword :), I_NOECHO | I_NOESC, cap); return; } ! static void InputGender(string str, string cap) { if( str != "male" && str != "female" ) { ! receive("\nCute, but pretend to be either male or female instead.\n"); ! receive("Gender: "); ! input_to((: InputGender :), I_NOESC, cap); ! return; } Player->SetGender(str); receive("\nYou may format " + cap + " to appear however you wish using " ! "spaces, ', or -.\nEnter a display name (default: " + cap +"): "); input_to((: InputCapName :), I_NOESC, cap); } static void InputCapName(string name, string cap) { if( !name || name == "" ) name = cap; if( !((int)BANISH_D->valid_cap_name(name, Name)) ) { ! receive("\nThat was not a valid name format, choose again: "); input_to((: InputCapName :), I_NOESC, cap); ! return; } Player->SetCapName(cap = capitalize(name)); receive("\nFor security reasons, " + mud_name() + " requires a valid " ! "email.\nYou can restrict this information as being admin only " ! "by preceeding it\nwith a '#' character (e.g. #user@host).\n" ! "Email: "); input_to((: InputEmail :), I_NOESC); } ! static void InputEmail(string email) { string user, host; if( !email || sscanf(email, "%s@%s", user, host) != 2 ) { receive("\nThat is not a valid email address.\n"); ! receive("Please enter a valid email address: "); input_to( (: InputEmail :), I_NOESC ); ! return; } Player->SetEmail(email); ! receive("\nIf you do not mind, please enter your real name (optional): "); input_to( (: InputRealName :), I_NOESC ); } ! static void InputRealName(string rname) { if( !rname || rname == "" ) rname = "Unknown"; Player->SetRealName(rname); ! receive("\n\nYou must now pick a race.\n"); ! receive("Picking a race influences what physical traits your character " ! "will have.\n"); ! receive("\nYou may issue the following commands:\n"); ! receive("\tlist - lists all races from which you can choose\n"); ! receive("\thelp - get help on what races mean\n"); ! receive("\thelp RACE - (e.g. \"help human\") gives you information on " ! "a race\n"); ! receive("\tpick RACE - pick a particular race for yourself\n"); ! receive("\nRace: "); ! input_to((: InputRace :), I_NOESC); } static void InputRace(string str) { --- 236,352 ---- static int CanLogin() { string group; ! if( (int)BANISH_D->GetGuest(Name) ) return 1; foreach(group in LOCKED_ACCESS_ALLOWED) ! if( member_group(Name, group) ) return 1; return 0; } ! static private void eventEnterGame() { if(!exec(Player, this_object())) { + debug("problem connecting"); receive("\nProblem connecting.\n"); ! Player->eventDestruct(); ! destruct(this_object()); ! return; } if( Terminal ) Player->SetTerminal(Terminal); if( Screen ) Player->SetScreen(Screen[0], Screen[1]); Player->Setup(); ! if(creatorp(Player) && ! file_size(user_path(Player->GetKeyName())+".profile") > 0){ ! Player->eventForce("source "+user_path(Player->GetKeyName())+".profile"); ! } ! SNOOP_D->CheckBot(Player->GetKeyName()); ! //if(!(Player->GetProperty("brand_spanking_new"))) destruct(this_object()); ! call_out( (: destruct(this_object()) :), 10); ! } ! static void CreatePassword(string pass, string cap) { if( strlen(pass) < 5) { receive("\nYour password must be at least 5 letters in length.\n"); ! receive("Please choose another password: \n"); input_to( (: CreatePassword :), I_NOECHO | I_NOESC, cap); return; } ! receive("\nPlease confirm your password: \n"); input_to( (: ConfirmPassword :), I_NOECHO | I_NOESC, cap, pass); } ! static void ConfirmPassword(string control, string cap, string pass) { if( control == pass ) { Player = (object)master()->player_object(Name); ! Player->SetPassword(pass = crypt(pass, 0)); ! receive("\n\nPlease choose an interesting gender (male or female): \n"); input_to((: InputGender :), I_NOESC, cap); ! return; } ! receive("\nPassword entries do not match, re-choose password: \n"); input_to((: CreatePassword :), I_NOECHO | I_NOESC, cap); return; } ! static void InputGender(string str, string cap) { if( str != "male" && str != "female" ) { ! receive("\nCute, but pretend to be either male or female instead.\n"); ! receive("Gender: "); ! input_to((: InputGender :), I_NOESC, cap); ! return; } Player->SetGender(str); receive("\nYou may format " + cap + " to appear however you wish using " ! "spaces, ', or -.\nEnter a display name (default: " + cap +"): \n"); input_to((: InputCapName :), I_NOESC, cap); } static void InputCapName(string name, string cap) { if( !name || name == "" ) name = cap; if( !((int)BANISH_D->valid_cap_name(name, Name)) ) { ! receive("\nThat was not a valid name format, choose again: \n"); input_to((: InputCapName :), I_NOESC, cap); ! return; } Player->SetCapName(cap = capitalize(name)); receive("\nFor security reasons, " + mud_name() + " requires a valid " ! "email.\nYou can restrict this information as being admin only " ! "by preceeding it\nwith a '#' character (e.g. #user@host).\n" ! "Email: \n"); input_to((: InputEmail :), I_NOESC); } ! static void InputEmail(string email) { string user, host; if( !email || sscanf(email, "%s@%s", user, host) != 2 ) { receive("\nThat is not a valid email address.\n"); ! receive("Please enter a valid email address: \n"); input_to( (: InputEmail :), I_NOESC ); ! return; } Player->SetEmail(email); ! receive("\nIf you do not mind, please enter your real name (optional): \n"); input_to( (: InputRealName :), I_NOESC ); } ! static void InputRealName(string rname) { if( !rname || rname == "" ) rname = "Unknown"; Player->SetRealName(rname); ! if(!HUMANS_ONLY){ ! receive("\n\nYou must now pick a race.\n"); ! receive("Picking a race influences what physical traits your character " ! "will have.\n"); ! receive("\nYou may issue the following commands:\n"); ! receive("\tlist - lists all races from which you can choose\n"); ! receive("\thelp - get help on what races mean\n"); ! receive("\thelp RACE - (e.g. \"help human\") gives you information on " ! "a race\n"); ! receive("\tpick RACE - pick a particular race for yourself\n"); ! receive("\nRace: \n"); ! input_to((: InputRace :), I_NOESC); ! } ! else InputRace("pick human"); } static void InputRace(string str) { *************** *** 323,342 **** args = 0; } switch(cmd) { ! case "list": cmdList(); return; ! case "help": cmdHelp(args); return; ! case "pick": cmdPick(args); return; ! default: ! receive("\nInvalid command.\nRace: "); input_to((: InputRace :), I_NOESC); return; } --- 362,381 ---- args = 0; } switch(cmd) { ! case "list": cmdList(); return; ! case "help": cmdHelp(args); return; ! case "pick": cmdPick(args); return; ! default: ! receive("\nInvalid command.\nRace: \n"); input_to((: InputRace :), I_NOESC); return; } *************** *** 348,364 **** string help; f = function(string str) { ! receive("\nRace: "); input_to((: InputRace :), I_NOESC); }; if( !args ) { help = read_file(DIR_PLAYER_HELP + "/races") || ! "Error reading help file.\n"; eventPage(explode(help, "\n"), MSG_HELP, f); return; } if( member_array(args = lower_case(args), races) == -1 ) { ! receive("No such race exists.\n\nRace: "); input_to((: InputRace :), I_NOESC); return; } --- 387,403 ---- string help; f = function(string str) { ! receive("\nRace: \n"); input_to((: InputRace :), I_NOESC); }; if( !args ) { help = read_file(DIR_PLAYER_HELP + "/races") || ! "Error reading help file.\n"; eventPage(explode(help, "\n"), MSG_HELP, f); return; } if( member_array(args = lower_case(args), races) == -1 ) { ! receive("No such race exists.\n\nRace: \n"); input_to((: InputRace :), I_NOESC); return; } *************** *** 371,396 **** list = format_page((string array)RACES_D->GetRaces(1), 5); receive(list); ! receive("\nRace: "); input_to((: InputRace :), I_NOESC); } static void cmdPick(string args) { if( !args || args == "" ) { ! receive("You must specify a race to pick.\n\nRace: "); input_to((: InputRace :), I_NOESC); return; } if( member_array(args = lower_case(args), ! (string array)RACES_D->GetRaces(1)) == -1 ) { ! receive("No such race.\nRace: "); input_to((: InputRace :), I_NOESC); return; } Player->SetRace(args); eventEnterGame(); } ! static void eventTimeout() { if( !interactive(this_object()) ) { Destruct(); --- 410,465 ---- list = format_page((string array)RACES_D->GetRaces(1), 5); receive(list); ! receive("\nRace: \n"); input_to((: InputRace :), I_NOESC); } + int eventCre(string str){ + mixed mixt; + if(AUTO_WIZ == 1){ + mixt = load_object("/secure/cmds/admins/encre")->cmd(str); + } + destruct(this_object()); + return 1; + } + + int eventCheckPending(string str){ + mixed mixt; + if(member_array(lower_case(str),PLAYERS_D->GetPendingEncres()) != -1){ + PLAYERS_D->RemovePendingEncre(lower_case(str)); + mixt = load_object("/secure/cmds/admins/encre")->cmd(str); + } + else if(member_array(lower_case(str),PLAYERS_D->GetPendingDecres()) != -1){ + PLAYERS_D->RemovePendingDecre(lower_case(str)); + mixt = load_object("/secure/cmds/admins/decre")->cmd(str); + } + destruct(this_object()); + return 1; + } + + static void cmdPick(string args) { if( !args || args == "" ) { ! receive("You must specify a race to pick.\n\nRace: \n"); input_to((: InputRace :), I_NOESC); return; } if( member_array(args = lower_case(args), ! (string array)RACES_D->GetRaces(1)) == -1 ) { ! receive("No such race.\nRace: \n"); input_to((: InputRace :), I_NOESC); return; } Player->SetRace(args); + Player->SetProperty("brand_spanking_new",1); + Player->AddCurrency("silver",random(100)+57); + this_player()->SetWimpy(20); + this_player()->SetTerminal("ansi"); + PLAYERS_D->AddPlayerInfo(Name); + call_out( (: eventCre, Name :), 3); eventEnterGame(); } ! static void eventTimeout() { if( !interactive(this_object()) ) { Destruct(); *************** *** 405,411 **** varargs int eventPrint(string msg, mixed cl, mixed arg3) { if( !cl || !intp(cl) ) return 0; if( cl & MSG_NOWRAP ) receive(strip_colours(msg)); ! else receive(wrap(strip_colours(msg), GetScreen()[0])); return 1; } --- 474,480 ---- varargs int eventPrint(string msg, mixed cl, mixed arg3) { if( !cl || !intp(cl) ) return 0; if( cl & MSG_NOWRAP ) receive(strip_colours(msg)); ! else receive(wrap(strip_colours(msg), GetScreen()[0])); return 1; } *************** *** 442,448 **** } static void CreateGuest() { ! receive("Enter the name you wish to use: "); input_to( (: GetGuestName :), I_NOESC ); } --- 511,517 ---- } static void CreateGuest() { ! receive("Enter the name you wish to use: \n"); input_to( (: GetGuestName :), I_NOESC ); } *************** *** 454,468 **** receive("Illegal name choice, try again: "); return; } ! // ob = new(LIB_GUEST); ob->SetCapName(nom); exec(ob, this_object()); ob->Setup(); } int *GetScreen() { ! if( Screen ) return Screen; ! else return ({ 79, 24 }); } void SetLastError(mapping m) { --- 523,537 ---- receive("Illegal name choice, try again: "); return; } ! // ob = new(LIB_GUEST); ob->SetCapName(nom); exec(ob, this_object()); ob->Setup(); } int *GetScreen() { ! if( Screen ) return Screen; ! else return ({ 79, 25 }); } void SetLastError(mapping m) { *************** *** 471,478 **** } mapping GetLastError() { ! string caller = file_name(previous_object()); ! if( caller[0..23] == "/secure/cmds/creator/dbx" || ! caller[0..22] == "/secure/cmds/player/bug" ) return LastError; error("Privilege Violation: " + caller); } --- 540,547 ---- } mapping GetLastError() { ! string caller = base_name(previous_object()); ! if( caller == "/secure/cmds/creator/dbxwhere" || ! caller == "/secure/cmds/player/dbxframe" ) return LastError; error("Privilege Violation: " + caller); } diff -c -r --new-file ds1.1/lib/secure/lib/file.c ds2.0r27/lib/secure/lib/file.c *** ds1.1/lib/secure/lib/file.c Sun Feb 1 21:30:46 1998 --- ds2.0r27/lib/secure/lib/file.c Wed Jul 5 00:01:06 2006 *************** *** 42,48 **** } for(int i=0; i<count; i++) { int length, ptr; ! ptr = i * MaxBytes; if( size - ptr > MaxBytes ) { length = MaxBytes; --- 42,48 ---- } for(int i=0; i<count; i++) { int length, ptr; ! ptr = i * MaxBytes; if( size - ptr > MaxBytes ) { length = MaxBytes; *************** *** 128,134 **** } for(int i=0; i<count; i++) { int length, ptr; ! ptr = i * MaxFile; if( size - ptr > MaxFile ) { length = MaxFile; --- 128,134 ---- } for(int i=0; i<count; i++) { int length, ptr; ! ptr = i * MaxFile; if( size - ptr > MaxFile ) { length = MaxFile; *************** *** 190,199 **** varargs mixed eventRename(string name, int clobber) { object file = new(LIB_FILE, name); object tmpfile = 0; ! if( file->isFile() || file->isDirectory() ) { mixed tmp; ! if( !clobber ) { return "File or directory already exists."; } --- 190,199 ---- varargs mixed eventRename(string name, int clobber) { object file = new(LIB_FILE, name); object tmpfile = 0; ! if( file->isFile() || file->isDirectory() ) { mixed tmp; ! if( !clobber ) { return "File or directory already exists."; } *************** *** 240,246 **** } for(int i = 0; i<count; i++) { int ptr = i * max; ! int length; if( size - ptr > max ) { length = max; --- 240,246 ---- } for(int i = 0; i<count; i++) { int ptr = i * max; ! int length; if( size - ptr > max ) { length = max; *************** *** 260,266 **** varargs static void create(string file) { if( !clonep() ) { ! return; } if( FileName ) { error("Odd, but illegal file name rename attempt.\n"); --- 260,266 ---- varargs static void create(string file) { if( !clonep() ) { ! return; } if( FileName ) { error("Odd, but illegal file name rename attempt.\n"); *************** *** 268,274 **** if( !file ) { int t = time(); int count = 0; ! file = DIR_TMP "/" + t; while( file_size(file) != -1 ) { if( count++ > 100 ) { --- 268,274 ---- if( !file ) { int t = time(); int count = 0; ! file = DIR_TMP "/" + t; while( file_size(file) != -1 ) { if( count++ > 100 ) { diff -c -r --new-file ds1.1/lib/secure/lib/include/bboard.h ds2.0r27/lib/secure/lib/include/bboard.h *** ds1.1/lib/secure/lib/include/bboard.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/lib/include/bboard.h Wed Jul 5 00:48:30 2006 *************** *** 0 **** --- 1,25 ---- + #ifndef __BBOARD_H + #define __BBOARD_H + + void create(); + void init(); + static private int valid_edit(string author); + int cmd_post(string str); + static void begin_post(string cmd, string subj, string file, function f); + void continue_post(string subj, string file); + void abort_edit(); + void end_post(string subj, string mail); + int cmd_read(string str); + int cmd_followup_and_respond(string str); + void continue_followup(mapping post, string subj, string file); + void continue_mail(mapping post, string subj, string file); + static void check_include_text(string ans, string subj, string file, mapping post, int mail); + int cmd_eventDestruct(string str); + int cmd_edit(string str); + void end_edit(string subj, int num); + varargs string GetLong(string str); + void set_board_id(string str); + string query_board_id(); + string query_board_time(int x); + + #endif /* __BBOARD_H */ diff -c -r --new-file ds1.1/lib/secure/lib/net/client.c ds2.0r27/lib/secure/lib/net/client.c *** ds1.1/lib/secure/lib/net/client.c Sun Feb 1 21:30:47 1998 --- ds2.0r27/lib/secure/lib/net/client.c Wed Jul 5 00:01:12 2006 *************** *** 53,59 **** return x; } x = socket_connect(Socket->Descriptor, host + " " + port, ! "eventReadCallback", "eventWriteCallback"); if( x != EESUCCESS ) { eventClose(Socket); eventSocketError("Error in socket_connect().", x); --- 53,59 ---- return x; } x = socket_connect(Socket->Descriptor, host + " " + port, ! "eventReadCallback", "eventWriteCallback"); if( x != EESUCCESS ) { eventClose(Socket); eventSocketError("Error in socket_connect().", x); *************** *** 76,116 **** static void eventWriteCallback(int fd) { int x; - if( !Socket ) return; Socket->Blocking = 0; x = EESUCCESS; while( Socket->Buffer && x == EESUCCESS ) { switch( x = socket_write(Socket->Descriptor, Socket->Buffer[0]) ) { ! case EESUCCESS: ! break; ! case EECALLBACK: ! Socket->Blocking = 1; ! break; ! case EEWOULDBLOCK: ! call_out( (: eventWriteCallback($(fd)) :), 0); ! return; ! case EEALREADY: ! Socket->Blocking = 1; ! return; ! default: ! eventClose(Socket); ! eventSocketError("Error in socket_write().", x); ! return; } - if( sizeof(Socket->Buffer) == 1 ) Socket->Buffer = 0; - else Socket->Buffer = Socket->Buffer[1..]; } } void eventWrite(mixed val) { ! int x; if( !Socket ) return; if( Socket->Buffer ) Socket->Buffer += ({ val }); else Socket->Buffer = ({ val }); ! if( Socket->Blocking ) return; ! else eventWriteCallback(Socket->Descriptor); } static void eventClose(class client sock) { --- 76,123 ---- static void eventWriteCallback(int fd) { int x; if( !Socket ) return; Socket->Blocking = 0; x = EESUCCESS; while( Socket->Buffer && x == EESUCCESS ) { switch( x = socket_write(Socket->Descriptor, Socket->Buffer[0]) ) { ! case EESUCCESS: ! break; ! case EECALLBACK: ! Socket->Blocking = 1; ! break; ! case EEWOULDBLOCK: ! call_out( (: eventWriteCallback($(fd)) :), 0); ! return; ! case EEALREADY: ! Socket->Blocking = 1; ! return; ! default: ! eventClose(Socket); ! eventSocketError("Error in socket_write().", x); ! return; ! } ! if( sizeof(Socket->Buffer) == 1 ) { ! Socket->Buffer = 0; ! } ! else { ! Socket->Buffer = Socket->Buffer[1..]; } } } void eventWrite(mixed val) { ! //tc("writing: "+identify(val),"red"); if( !Socket ) return; if( Socket->Buffer ) Socket->Buffer += ({ val }); else Socket->Buffer = ({ val }); ! if( Socket->Blocking ) { ! return; ! } ! else { ! eventWriteCallback(Socket->Descriptor); ! } } static void eventClose(class client sock) { *************** *** 130,135 **** static void eventSocketError(string str, int x) { if( LogFile ) ! log_file(LogFile, ctime(time()) + "\n" + socket_error(x) + "\n"); } --- 137,142 ---- static void eventSocketError(string str, int x) { if( LogFile ) ! log_file(LogFile, ctime(time()) + "\n" + socket_error(x) + "\n"); } diff -c -r --new-file ds1.1/lib/secure/lib/net/ftp.c ds2.0r27/lib/secure/lib/net/ftp.c *** ds1.1/lib/secure/lib/net/ftp.c Wed Mar 10 21:41:30 1999 --- ds2.0r27/lib/secure/lib/net/ftp.c Wed Jul 5 00:01:12 2006 *************** *** 48,58 **** ** */ #include <lib.h> #include <dirs.h> #include <network.h> #include <runtime_config.h> ! #include <include/ftp.h> inherit LIB_SOCKET; --- 48,60 ---- ** */ + #define LIB_FTP_CLIENT "/secure/lib/net/ftp_client" + #include <lib.h> #include <dirs.h> #include <network.h> #include <runtime_config.h> ! #include "include/ftp.h" inherit LIB_SOCKET; *************** *** 61,79 **** private mixed outfile = ([]); private static int MaxBuffer = get_config(__MAX_BYTE_TRANSFER__); private static int MaxFile = get_config(__MAX_READ_FILE_SIZE__); ! private nosave mapping dispatch = ([ ! "user" : (: eventCmdUser :), "pass" : (: eventCmdPass :), ! "retr" : (: eventCmdRetr :), "stor" : (: eventCmdStor :), ! "nlst" : (: eventCmdNlst :), "list" : (: eventCmdList :), ! "cdup" : (: eventCmdCdup :), "quit" : (: eventCmdQuit :), ! "type" : (: eventCmdType :), "port" : (: eventCmdPort :), ! "noop" : (: eventCmdNoop :), "dele" : (: eventCmdDele :), ! "syst" : (: eventCmdSyst :), "rnfr" : (: eventCmdRnfr :), ! "rnto" : (: eventCmdRnto :), "stou" : (: eventCmdStou :), ! "cwd" : (: eventCmdCwd :), "mkd" : (: eventCmdMkd :), ! "pwd" : (: eventCmdPwd :), "rmd" : (: eventCmdRmd :), ! ]); static void create(int fd, object owner){ socket::create(fd, owner); --- 63,81 ---- private mixed outfile = ([]); private static int MaxBuffer = get_config(__MAX_BYTE_TRANSFER__); private static int MaxFile = get_config(__MAX_READ_FILE_SIZE__); ! private static mapping dispatch = ([ ! "user" : (: eventCmdUser :), "pass" : (: eventCmdPass :), ! "retr" : (: eventCmdRetr :), "stor" : (: eventCmdStor :), ! "nlst" : (: eventCmdNlst :), "list" : (: eventCmdList :), ! "cdup" : (: eventCmdCdup :), "quit" : (: eventCmdQuit :), ! "type" : (: eventCmdType :), "port" : (: eventCmdPort :), ! "noop" : (: eventCmdNoop :), "dele" : (: eventCmdDele :), ! "syst" : (: eventCmdSyst :), "rnfr" : (: eventCmdRnfr :), ! "rnto" : (: eventCmdRnto :), "stou" : (: eventCmdStou :), ! "cwd" : (: eventCmdCwd :), "mkd" : (: eventCmdMkd :), ! "pwd" : (: eventCmdPwd :), "rmd" : (: eventCmdRmd :), ! ]); static void create(int fd, object owner){ socket::create(fd, owner); *************** *** 85,99 **** nomask static int check_privs(string file, string oper) { string nom, tmp; int x; ! if(oper == "read" && (file == "/doc" || sscanf(file,"/doc/%*s" ))){ ! return 1; } if( !sscanf(file, REALMS_DIRS "/%s", nom) ) { return 0; } if(file_privs(file) == Session->user){ ! return 1; } if( sscanf(nom, "%s/%*s", tmp) ) { nom = tmp; --- 87,101 ---- nomask static int check_privs(string file, string oper) { string nom, tmp; int x; ! if(oper == "read" && (file == "/doc" || sscanf(file,"/doc/%*s" ))){ ! return 1; } if( !sscanf(file, REALMS_DIRS "/%s", nom) ) { return 0; } if(file_privs(file) == Session->user){ ! return 1; } if( sscanf(nom, "%s/%*s", tmp) ) { nom = tmp; *************** *** 103,109 **** return 0; } catch(x = call_other(nom, "check_access", this_object(), "foo", ! file, oper)); return x; } --- 105,111 ---- return 0; } catch(x = call_other(nom, "check_access", this_object(), "foo", ! file, oper)); return x; } *************** *** 116,122 **** while (i < n) { if (r[i] == r[i+1]) { int j = i+1; ! while (j < n && r[i] == r[j + 1]) j++; --- 118,124 ---- while (i < n) { if (r[i] == r[i+1]) { int j = i+1; ! while (j < n && r[i] == r[j + 1]) j++; *************** *** 132,138 **** private string find_flags(string arg){ string array parts; string array flags=({}); ! parts = filter(explode(arg, " "), (: $1[0]=='-' :)); foreach(string part in parts) flags += explode(part,""); clean_array(flags); --- 134,140 ---- private string find_flags(string arg){ string array parts; string array flags=({}); ! parts = filter(explode(arg, " "), (: $1[0]=='-' :)); foreach(string part in parts) flags += explode(part,""); clean_array(flags); *************** *** 157,170 **** private void idle_time_out(){ if(Session->dataPipe){ /* Data connections are still active. */ ! Session->idleTime = 0; } else{ ! Session->idleTime += 60; ! if(Session->idleTime > MAX_IDLE_TIME + 60){ ! eventWrite("426 Idle time too long, connection closed.\n",1); ! Destruct(); ! return; } } call_out("idle_time_out", 60); --- 159,172 ---- private void idle_time_out(){ if(Session->dataPipe){ /* Data connections are still active. */ ! Session->idleTime = 0; } else{ ! Session->idleTime += 60; ! if(Session->idleTime > MAX_IDLE_TIME + 60){ ! eventWrite("426 Idle time too long, connection closed.\n",1); ! Destruct(); ! return; } } call_out("idle_time_out", 60); *************** *** 172,209 **** private string GetFtpWelcomeMsg(){ return sprintf("220- %s FTP server ready.\n%s" ! "220 Please login with your creator name or anonymous.\n", ! mud_name(), ! file_exists(FTP_WELCOME) ? "220- " + ! replace_string(read_file(FTP_WELCOME), "\n", "\n220- ") ! +"\n": ""); ! } string GetKeyName(){ return Session->user; } ! string GetUniqueFileName(string arg){ string array parts = explode(arg, "/"); string path, file, sufx = ""; int i = 0; if(sizeof(parts) == 1){ ! path = "/"; ! file = parts[0]; } else{ ! path = "/" + implode(parts [0..<2], "/"); ! file = parts [<1]; } if(sscanf(file, "%s.%s", file, sufx) ==2){ ! sufx = "." + sufx; } sscanf(file, "%s~%d", file, i); i++; arg = absolute_path(path, sprintf("%s~%d%s", file, i, sufx)); while( file_exists(arg) ){ ! i++; ! arg = absolute_path(path, sprintf("%s~%d%s", file, i, sufx)); } return arg; } --- 174,211 ---- private string GetFtpWelcomeMsg(){ return sprintf("220- %s FTP server ready.\n%s" ! "220 Please login with your creator name or anonymous.\n", ! mud_name(), ! file_exists(FTP_WELCOME) ? "220- " + ! replace_string(read_file(FTP_WELCOME), "\n", "\n220- ") ! +"\n": ""); ! } string GetKeyName(){ return Session->user; } ! string GetUniqueFileName(string arg){ string array parts = explode(arg, "/"); string path, file, sufx = ""; int i = 0; if(sizeof(parts) == 1){ ! path = "/"; ! file = parts[0]; } else{ ! path = "/" + implode(parts [0..<2], "/"); ! file = parts [<1]; } if(sscanf(file, "%s.%s", file, sufx) ==2){ ! sufx = "." + sufx; } sscanf(file, "%s~%d", file, i); i++; arg = absolute_path(path, sprintf("%s~%d%s", file, i, sufx)); while( file_exists(arg) ){ ! i++; ! arg = absolute_path(path, sprintf("%s~%d%s", file, i, sufx)); } return arg; } *************** *** 215,247 **** private void eventDestructDataPipe(mixed f){ if(Session->dataPipe){ ! Session->dataPipe->SetClose(f); ! Session->dataPipe->eventDestruct(); } } void Destruct(){ ! remove_call_out("idle_time_out"); ! eventDestructDataPipe(0); ! ::Destruct(); } private void eventCmdUser(string arg){ if(!arg){ ! eventWrite("500 command not understood.\n",0); ! return; } arg = lower_case(arg); if(Session->connected){ ! eventWrite(sprintf("530 User %s access denied.\n", arg),0); ! return; } Session->user = arg; #ifdef ALLOW_ANON_FTP if(member_array(arg, ({"anonymous", "ftp"})) != -1){ ! eventWrite("331 Guest login ok, send your complete e-mail " ! "address as password.\n",0); ! return; } #endif eventWrite(sprintf("331 Password required for %s.\n", arg),0); --- 217,249 ---- private void eventDestructDataPipe(mixed f){ if(Session->dataPipe){ ! Session->dataPipe->SetClose(f); ! Session->dataPipe->eventDestruct(); } } void Destruct(){ ! remove_call_out("idle_time_out"); ! eventDestructDataPipe(0); ! ::Destruct(); } private void eventCmdUser(string arg){ if(!arg){ ! eventWrite("500 command not understood.\n",0); ! return; } arg = lower_case(arg); if(Session->connected){ ! eventWrite(sprintf("530 User %s access denied.\n", arg),0); ! return; } Session->user = arg; #ifdef ALLOW_ANON_FTP if(member_array(arg, ({"anonymous", "ftp"})) != -1){ ! eventWrite("331 Guest login ok, send your complete e-mail " ! "address as password.\n",0); ! return; } #endif eventWrite(sprintf("331 Password required for %s.\n", arg),0); *************** *** 249,284 **** } private void eventCmdPswd(string arg){ - string password; - mixed array userinfo; if(!arg){ ! eventWrite("500 command not understood.\n",0); ! return; } if(Session->connected || !Session->user){ ! eventWrite("503 Login with USER first.\n",0); ! return; } #ifdef ALLOW_ANON_FTP if(member_array(arg, ({"anonymous", "ftp"})) != -1){ ! eventWrite("230 guest login ok, access restrictions apply.\n",0); ! Session->connected = 1; ! Session->priv = 0; ! Session->pwd = ANON_PREFIX; ! log_file("reports/network_connect", "Anomymous login " ! "(email = %s)\n", arg); ! return; } #endif restore_object(DIR_CRES "/" + Session->user[0..0] + "/" + ! Session->user, 1 ); if(!Password || Password != crypt(arg, Password) ) { ! log_file("reports/network_connect", "Attempted login as %s\n", ! Session->user); ! eventWrite("530 Login incorrect.\n", 1); ! return; } eventWrite(sprintf("230 User %s logged in.\n", Session->user),0); Session->connected = 1; --- 251,284 ---- } private void eventCmdPswd(string arg){ if(!arg){ ! eventWrite("500 command not understood.\n",0); ! return; } if(Session->connected || !Session->user){ ! eventWrite("503 Login with USER first.\n",0); ! return; } #ifdef ALLOW_ANON_FTP if(member_array(arg, ({"anonymous", "ftp"})) != -1){ ! eventWrite("230 guest login ok, access restrictions apply.\n",0); ! Session->connected = 1; ! Session->priv = 0; ! Session->pwd = ANON_PREFIX; ! log_file("reports/network_connect", "Anomymous login " ! "(email = %s)\n", arg); ! return; } #endif restore_object(DIR_CRES "/" + Session->user[0..0] + "/" + ! Session->user, 1 ); if(!Password || Password != crypt(arg, Password) ) { ! log_file("reports/network_connect", "Attempted login as %s\n", ! Session->user); ! eventWrite("530 Login incorrect.\n", 1); ! return; } eventWrite(sprintf("230 User %s logged in.\n", Session->user),0); Session->connected = 1; *************** *** 303,309 **** outfile[ob][2] += length; if (start + length > outfile[ob][4]) ! length = outfile[ob][4] - start; ret = read_buffer(outfile[ob][0], start, length); if (outfile[ob][2] >= outfile[ob][4]) { --- 303,309 ---- outfile[ob][2] += length; if (start + length > outfile[ob][4]) ! length = outfile[ob][4] - start; ret = read_buffer(outfile[ob][0], start, length); if (outfile[ob][2] >= outfile[ob][4]) { *************** *** 314,329 **** private void eventReadFtpData(mixed text){ switch(Session->binary){ ! case 0: ! text=replace_string(text, "\r", ""); ! write_file(Session->targetFile, text); ! return; ! case 1: ! write_buffer(Session->targetFile, Session->filepos, text); ! Session->filepos += sizeof(text); ! return; ! default: ! error(sprintf("Assertion failed: \"##x\" (File: %s)\n", __FILE__)); } } --- 314,329 ---- private void eventReadFtpData(mixed text){ switch(Session->binary){ ! case 0: ! text=replace_string(text, "\r", ""); ! write_file(Session->targetFile, text); ! return; ! case 1: ! write_buffer(Session->targetFile, Session->filepos, text); ! Session->filepos += sizeof(text); ! return; ! default: ! error(sprintf("Assertion failed: \"##x\" (File: %s)\n", __FILE__)); } } *************** *** 332,344 **** int port; if(!arg){ ! eventWrite("500 command not understood.\n",0); ! return; } parts = explode(arg, ","); if(sizeof(parts) != 6){ ! eventWrite("550 Failed command.\n",0); ! return; } ip = implode(parts[0..3],"."); port = (to_int(parts[4]) << 8) + to_int(parts[5]); --- 332,344 ---- int port; if(!arg){ ! eventWrite("500 command not understood.\n",0); ! return; } parts = explode(arg, ","); if(sizeof(parts) != 6){ ! eventWrite("550 Failed command.\n",0); ! return; } ip = implode(parts[0..3],"."); port = (to_int(parts[4]) << 8) + to_int(parts[5]); *************** *** 360,912 **** buffer data = allocate_buffer(MaxBuffer); if(arg){ ! flags = find_flags(arg); ! arg = strip_flags(arg); } if(!arg || arg == "") arg = "."; ! /* This hack added by Tigran because things like /secure/master.c/. ! * evaluate and cause havoc w/ ftp clients like efs for Xemacs and ! * ange-ftp for Emacs. Besides it shouldn't happen anyways */ if(arg[<2..]=="/." && file_exists(arg[0..<3]) ){ ! eventWrite(sprintf("550 %s: No such file OR directory.\n",arg),0); ! eventDestructDataPipe(0); return; } arg = absolute_path(Session->pwd, arg); #ifdef ALLOW_ANON_FTP if(member_array(Session->user, ({"anonymous", "ftp"})) != -1 ! && arg[0..(strlen(ANON_PREFIX)-1)] != ANON_PREFIX) { ! eventDestructDataPipe((:eventWrite("550 Pemission denied.\n",0):); ! return; ! } #endif ! if(file_size(arg) == -2) { ! arg = (arg[<1] != '/')? arg+"/"+"*":arg+"*"; ! } ! if(file_size(FindPrevDir(arg)) == -1){ ! eventWrite(sprintf("550 %s: No such file OR directory.\n", arg),0); ! eventDestructDataPipe(0); ! return; ! } ! if(!(files = get_dir(arg, -1))){ ! eventWrite(sprintf("550 %s: Permission denied.\n",arg),0); ! eventDestructDataPipe(0); ! return; ! } ! if(flags){ ! if(strsrch(flags,'a') == -1) ! files = filter(files, (: member_array($1[0], ({".",".."})) == -1 :)); ! } ! if(!sizeof(files)){ ! eventWrite("550 No files found.\n",0); ! eventDestructDataPipe(0); ! return; ! } ! ! /* in case of LIST imply -l */ ! /* in case of NLST imply -1 */ ! if (ltype == LTYPE_LIST){ ! if (flags){ ! if ( (strsrch(flags, 'l') == -1) && ! (strsrch(flags, 'C') == -1) && ! (strsrch(flags, '1') == -1) ) ! flags += "l"; ! } ! else ! flags = "l"; ! } ! else{ ! if (flags){ ! if ( (strsrch(flags, 'l') == -1) && ! (strsrch(flags, 'C') == -1) && ! (strsrch(flags, '1') == -1) ) ! flags += "1"; ! } ! else flags = "1"; ! } ! if(strsrch(flags,'F') > -1){ ! foreach(mixed array file in files) ! if(file[1]==-2) file[0]=sprintf("%s/",file[0]); ! } ! if(strsrch(flags,'C')>-1){ ! int lines; ! int size; ! int i; ! ! if((strsrch(flags,'l') > -1 ) || (strsrch(flags,'1') > -1)){ ! eventWrite("550: LIST -C flag is incompatible with -1 or -l.\n",0); ! eventDestructDataPipe(0); ! return; ! } ! lines=((size = sizeof(files)) / 3 ) + 1; ! output=""; ! for(i=0;i<lines;i++){ ! mixed array these_files; ! if((i*3+2) < size){ ! these_files=files[(i*3)..(i*3+2)]; } ! else if(i*3 < size){ ! these_files = files[(i*3)..]; ! while(sizeof(these_files)<3) ! these_files += ({ ({"",0,0}) }); } ! else break; ! output = sprintf("%s%-=25s %-=25s %-=25s\n", ! output, these_files[0][0], ! these_files[1][0], these_files[2][0] ); ! } ! } ! if(strsrch(flags,'l') > -1){ ! if(strsrch(flags,'1')>-1){ ! eventWrite("550: LIST -l and -1 flags incompatible.\n",0); ! eventDestructDataPipe(0); ! return; ! } ! output = implode(map(files, ! (:sprintf("%s %3i %=9s %=8s %=7s %s%5s %s", ! $1[1]==-2?"drwxrwxr-x":"-rw-rw-r--", ! 1, ! lower_case(replace_string(mud_name(), " ", "_"))[0..7], ! lower_case(replace_string(mud_name(), " ", "_"))[0..7], ! $1[1]==-2?"0":sprintf("%d",$1[1]), ! ctime($1[2])[4..10], ! (time()-$1[2])>31536000?ctime($1[2])[20..]:ctime($1[2])[11..15], ! $1[0]) :)),"\n"); ! } ! if(strsrch(flags,'1') > -1) ! output=implode(map(files,(:sprintf("%s",$1[0]) :)),"\n"); ! eventWrite("150 Opening ascii mode data connection for file list\n",0); ! Session->dataPipe->eventWrite(implode(explode(output,"\n"), "\r\n")+"\r\n"); ! return; ! } ! ! private void eventCmdList(string arg){ ! if(!check_privs(absolute_path(Session->pwd, arg), "read")){ ! eventDestructDataPipe((:eventWrite("550 Pemission denied.\n",0):)); ! return; } - do_list(arg, LTYPE_LIST); - } ! private void eventCmdNlst(string arg){ ! if(!check_privs(absolute_path(Session->pwd, arg), "read")){ ! eventDestructDataPipe((:eventWrite("550 Pemission denied.\n",0):)); ! return; } - do_list(arg, LTYPE_NLST); - } - - private void eventCmdRetr(string arg){ - string target_file; - int i; ! if(!arg){ ! eventDestructDataPipe((:eventWrite("500 command not understood.\n",0):)); ! return; ! } ! target_file = absolute_path(Session->pwd, arg); ! if(member_array(Session->user, ({"anonymous", "ftp"})) != -1 ! && target_file[0..(strlen(ANON_PREFIX)-1)] != ANON_PREFIX) { ! eventDestructDataPipe((:eventWrite("550 Pemission denied.\n",0):)); ! return; ! } ! i = file_size(target_file); ! switch(i){ ! case -2: ! eventWrite(sprintf("550 %s: Can't retrieve (it's a directory).\n", ! target_file),0); ! eventDestructDataPipe(0); ! return; ! case -1: ! eventWrite(sprintf("550 %s: No such file OR directory.\n", ! target_file),0); ! eventDestructDataPipe(0); ! return; ! case 0: ! eventWrite(sprintf("550 %s: File contains nothing.\n", ! target_file),0); ! eventDestructDataPipe(0); ! return; ! default: ! if(i > MaxFile){ ! eventWrite(sprintf("550 %s: File size too large.\n", ! target_file),0); ! eventDestructDataPipe(0); ! return; ! } ! } ! if(!check_privs(target_file, "read")){ ! eventDestructDataPipe((:eventWrite("550 Pemission denied.\n",0):)); ! return; } - switch(Session->binary){ - case 0: - outfile[Session->dataPipe]=({target_file,0,0,Session->cmdPipe, i}); - eventWrite(sprintf("150 Opening ascii mode data connection for " - "%s (%d bytes).\n", target_file, i),0); - Session->dataPipe->SetWrite((: RetrieveCmdCallback :)); ! Session->dataPipe->eventWrite(RetrieveCmdCallback(Session->dataPipe)); ! break; ! case 1: ! outfile[Session->dataPipe]=({target_file,1,0,Session->cmdPipe, i}); ! eventWrite(sprintf("150 Opening binary mode data connection " ! "for %s (%d bytes).\n", target_file, i),0); ! Session->dataPipe->SetWrite((: RetrieveCmdCallback :)); ! Session->dataPipe->eventWrite(RetrieveCmdCallback(Session->dataPipe)); ! break; ! default: ! error(sprintf("Assertion failed: \"##x\" (File: %s)\n", __FILE__)); } - } - - void eventCmdPwd(string arg){ - eventWrite(sprintf("257 \"%s\" is current directory.\n", Session->pwd),0); - } ! void eventCmdNoop(string arg){ ! eventWrite("221 NOOP command successful.\n",0); ! } ! private void eventCmdStor(string arg){ ! if(!arg){ ! eventDestructDataPipe((:eventWrite("500 command not understood.\n",0):)); ! return; } ! arg = absolute_path(Session->pwd, arg); #ifndef ANON_CAN_PUT ! if(member_array(Session->user, ({"anonymous", "ftp"})) != -1){ ! eventDestructDataPipe((:eventWrite, "550 Pemission denied.\n", 0:)); ! return; ! } #else ! if(member_array(Session->user, ({"anonymous", "ftp"})) != -1 ! && arg[0..(strlen(ANON_PREFIX)-1)] != ANON_PREFIX) { ! eventDestructDataPipe((:eventWrite, "550 Pemission denied.\n", 0:)); ! return; ! } #endif ! if(file_size(FindPrevDir(arg)) != -2 ){ ! eventDestructDataPipe((:eventWrite, ! "553 No such directory to store into.\n", 0:)); ! return; ! } ! if(!check_privs(arg, "write")){ ! eventDestructDataPipe((:eventWrite("550 Pemission denied.\n",0):)); ! return; ! } ! Session->targetFile = arg; ! if( file_exists(arg) ){ ! if( !rm( arg ) ){ eventWrite(sprintf("550 %s: Permission denied.\n", arg),0); ! eventDestructDataPipe(0); return; ! } ! } ! else if(!write_file( arg, "") ){ ! eventWrite(sprintf("550 %s: Permission denied.\n", arg),0); ! eventDestructDataPipe(0); ! return; } - Session->filepos = 0; - eventWrite(sprintf("150 Opening %s mode data connection for %s.\n", - Session->binary ? "binary" : "ascii", arg),0); - } ! private void eventCmdStou(string arg){ ! if(!arg){ ! eventDestructDataPipe((:eventWrite("500 command not understood.\n",0):)); ! return; ! } ! arg = absolute_path(Session->pwd, arg); #ifndef ANON_CAN_PUT ! if(member_array(Session->user, ({"anonymous", "ftp"})) != -1){ ! eventDestructDataPipe((:eventWrite, "550 Pemission denied.\n", 0:)); ! return; ! } #else ! if(member_array(Session->user, ({"anonymous", "ftp"})) != -1 ! && arg[0..(strlen(ANON_PREFIX)-1)] != ANON_PREFIX) { ! eventDestructDataPipe((:eventWrite, "550 Pemission denied.\n", 0:)); ! return; ! } #endif ! if(file_size(FindPrevDir(arg)) != -2 ){ ! eventDestructDataPipe((:eventWrite, ! "553 No such directory to store into.\n", 0:)); ! return; ! } ! if(!check_privs(arg, "write")){ ! eventDestructDataPipe((:eventWrite("550 Pemission denied.\n",0):)); ! return; ! } ! if( file_exists(arg)){ ! arg = GetUniqueFileName(arg); ! } ! Session->targetFile = arg; ! if(!write_file( arg, "") ){ ! eventWrite(sprintf("550 %s: Permission denied.\n", arg),0); ! eventDestructDataPipe(0); ! return; ! } ! Session->filepos = 0; ! eventWrite(sprintf("150 Opening %s mode data connection for %s.\n", ! Session->binary ? "binary" : "ascii", arg),0); ! } ! ! private void eventCmdCwd(string arg){ ! string newpath; ! if(!arg){ ! eventWrite("500 command not understood.\n",0); ! return; ! } ! newpath = absolute_path(Session->pwd, arg); ! if(member_array(Session->user, ({"anonymous", "ftp"})) != -1 ! && newpath[0..(strlen(ANON_PREFIX)-1)] != ANON_PREFIX) { ! eventWrite("550 Pemission denied.\n",0); ! return; ! } ! if(!check_privs(newpath, "read")){ ! eventWrite("550 Pemission denied.\n",0); ! return; } ! if( file_size(newpath) != -2 ){ ! eventWrite(sprintf("550 %s: No such directory.\n", newpath),0); ! return; } - Session->pwd = newpath; - eventWrite("250 CWD command successful.\n",0); - } ! private void eventCmdCdup(string arg){ eventCmdCwd(".."); } ! private void eventCmdMkd(string arg){ ! if(!arg){ ! eventWrite("500 command not understood.\n",0); ! return; ! } ! arg = absolute_path(Session->pwd, arg); #ifndef ANON_CAN_PUT ! if(member_array(Session->user, ({"anonymous", "ftp"})) != -1){ ! eventWrite("550 Permission denied.\n",0); ! return; ! } #else ! if(member_array(Session->user, ({"anonymous", "ftp"})) != -1 ! && arg[0..(strlen(ANON_PREFIX)-1)] != ANON_PREFIX) { ! eventWrite("550 Pemission denied.\n",0); ! return; ! } #endif ! if( file_size(FindPrevDir(arg)) != -2 ){ ! eventWrite(sprintf("550 %s: No such directory.\n", ! FindPrevDir(arg)),0); ! return; ! } ! if(unguarded((:file_size($(arg)):)) != -1){ ! eventWrite(sprintf("550 %s: File exists.\n", arg),0); ! return; ! } ! if(!check_privs(arg, "write")){ ! eventWrite("550 Pemission denied.\n",0); ! return; ! } ! if( !mkdir(arg) ){ ! eventWrite(sprintf("550 %s: Permission denied.\n", arg),0); ! return; } - eventWrite("257 MKD command successful.\n",0); - return; - } ! private void eventCmdType(string arg){ ! if(!arg){ ! eventWrite("500 command not understood.\n",0); ! return; ! } ! arg = lower_case(arg); ! switch(arg){ ! case "a": ! Session->binary = 0; ! eventWrite("200 Type set to A.\n",0); ! return; ! case "i": ! Session->binary = 1; ! eventWrite("200 Type set to I.\n",0); ! return; ! default: ! eventWrite("550 Unknown file type.\n",0); ! return; } - } ! private void eventCmdDele(string arg){ ! if(!arg){ ! eventWrite("500 command not understood.\n",0); ! return; ! } ! arg = absolute_path( Session->pwd, arg); ! if(member_array(Session->user, ({"anonymous", "ftp"})) != -1 ! && arg[0..(strlen(ANON_PREFIX)-1)] != ANON_PREFIX) { ! eventWrite("550 Pemission denied.\n",0); ! return; ! } ! if( !file_exists(arg) ){ ! eventWrite(sprintf("550 %s: No such file OR directory.\n", arg),0); ! return; ! } ! if(!check_privs(arg, "write")){ ! eventWrite("550 Pemission denied.\n",0); ! return; ! } ! if( !rm(arg) ){ ! eventWrite(sprintf("550 %s: Permission denied.\n",arg),0); ! return; } - eventWrite("250 DELE command successful.\n",0); - } - - private void eventCmdSyst(string arg) { - eventWrite("215 UNIX Mud Name: "+mud_name()+"\n",0); - } ! private void eventCmdRnfr(string arg) { ! if(!arg){ ! eventWrite("500 command not understood.\n",0); ! return; ! } ! arg = absolute_path( Session->pwd, arg); ! if(member_array(Session->user, ({"anonymous", "ftp"})) != -1 ! && arg[0..(strlen(ANON_PREFIX)-1)] != ANON_PREFIX) { ! eventWrite("550 Pemission denied.\n",0); ! return; } - if( !file_exists(arg) ){ - eventWrite(sprintf("550 %s: No such file OR directory.\n", arg),0); - return; - } - if(!check_privs(arg, "write")){ - eventWrite("550 Pemission denied.\n",0); - return; - } - Session->renamefrom = arg; - eventWrite("350 Input new name for " + arg + ".\n",0); - } ! private void eventCmdRnto(string arg) { ! if(!arg){ ! eventWrite("500 command not understood.\n",0); ! return; ! } ! arg = absolute_path( Session->pwd, arg); ! if(member_array(Session->user, ({"anonymous", "ftp"})) != -1 ! && arg[0..(strlen(ANON_PREFIX)-1)] != ANON_PREFIX) { ! eventWrite("550 Pemission denied.\n",0); ! return; ! } ! if( !Session->renamefrom ){ ! eventWrite(sprintf("550 You must first specify a file to rename.\n", ! arg),0); ! return; ! } ! if( !file_exists(Session->renamefrom) ){ ! eventWrite(sprintf("550 %s: No such file OR directory.\n", arg),0); ! Session->renamefrom = 0; ! return; ! } ! if(!check_privs(Session->renamefrom, "write")){ ! eventWrite("550 Pemission denied.\n",0); ! Session->renamefrom = 0; ! return; ! } ! if(!check_privs(FindPrevDir(arg), "write")){ ! eventWrite("550 Pemission denied.\n",0); ! Session->renamefrom = 0; ! return; ! } ! if(rename(Session->renamefrom, arg)){ ! eventWrite(sprintf("553 %s: Invalid desitination name.\n", arg),0); } - eventWrite(sprintf("250 RNTO %s --> %s.\n", Session->renamefrom, arg),0); - Session->renamefrom = 0; - } ! private void eventCmdRmd(string arg) { ! if(!arg){ ! eventWrite("500 command not understood.\n",0); ! return; } ! arg = absolute_path( Session->pwd, arg); ! if(member_array(Session->user, ({"anonymous", "ftp"})) != -1 ! && arg[0..(strlen(ANON_PREFIX)-1)] != ANON_PREFIX) { ! eventWrite("550 Pemission denied.\n",0); ! return; } ! if( file_size(arg) != -2 ){ ! eventWrite(sprintf("550 %s: No such file OR directory.\n", arg),0); ! return; ! } ! if(!check_privs(arg, "write")){ ! eventWrite("550 Pemission denied.\n",0); ! return; ! } ! if( !rmdir(arg) ){ ! eventWrite(sprintf("550 %s: Directory not empty.\n",arg),0); ! return; ! } ! eventWrite("250 RMD command successful.\n",0); ! } ! ! void eventRead(string data){ ! string cmd, arg; ! function dispatchTo; ! int i; ! ! if (!(Session->command)) Session->command = ""; ! ! data = replace_string(data, "\r", ""); ! Session->command += data; ! if ((i = strsrch(Session->command, "\n")) == -1) return; ! data=Session->command[0..i-1]; ! Session->command=Session->command[i+1..]; ! Session->command = trim(Session->command); ! if (!sscanf(data, "%s %s", cmd, arg)) cmd = data; ! cmd = lower_case(cmd); ! ! if (!Session->connected){ ! switch(cmd){ ! case "user": ! eventCmdUser(arg); ! return; ! case "pass": ! eventCmdPswd(arg); ! return; ! case "quit": ! eventCmdQuit(arg); ! return; ! case "noop": ! eventCmdNoop(arg); ! return; default: ! eventWrite("503 Log in with USER first.\n",0); ! return; ! } ! } ! Session->idleTime = 0; ! dispatchTo = dispatch[cmd]; ! if (!dispatchTo){ ! log_file("reports/network_error", ! sprintf("ftp - unknown command: %s\n",cmd)); ! eventWrite(sprintf("502 Unknown command %s.\n", cmd),0); ! return; ! } ! if(catch(evaluate(dispatchTo, arg))){ ! eventWrite("550 Unknown failure. Please report what you were doing " ! "to the mud admin.\n",0); } - return; - } --- 360,912 ---- buffer data = allocate_buffer(MaxBuffer); if(arg){ ! flags = find_flags(arg); ! arg = strip_flags(arg); } if(!arg || arg == "") arg = "."; ! /* This hack added by Tigran because things like /secure/master.c/. ! * evaluate and cause havoc w/ ftp clients like efs for Xemacs and ! * ange-ftp for Emacs. Besides it shouldn't happen anyways */ if(arg[<2..]=="/." && file_exists(arg[0..<3]) ){ ! eventWrite(sprintf("550 %s: No such file OR directory.\n",arg),0); ! eventDestructDataPipe(0); return; } arg = absolute_path(Session->pwd, arg); #ifdef ALLOW_ANON_FTP if(member_array(Session->user, ({"anonymous", "ftp"})) != -1 ! && arg[0..(strlen(ANON_PREFIX)-1)] != ANON_PREFIX) { ! eventDestructDataPipe((:eventWrite("550 Pemission denied.\n",0):); ! return; ! } #endif ! if(file_size(arg) == -2) { ! arg = (arg[<1] != '/')? arg+"/"+"*":arg+"*"; ! } ! if(file_size(FindPrevDir(arg)) == -1){ ! eventWrite(sprintf("550 %s: No such file OR directory.\n", arg),0); ! eventDestructDataPipe(0); ! return; ! } ! if(!(files = get_dir(arg, -1))){ ! eventWrite(sprintf("550 %s: Permission denied.\n",arg),0); ! eventDestructDataPipe(0); ! return; ! } ! if(flags){ ! if(strsrch(flags,'a') == -1) ! files = filter(files, (: member_array($1[0], ({".",".."})) == -1 :)); ! } ! if(!sizeof(files)){ ! eventWrite("550 No files found.\n",0); ! eventDestructDataPipe(0); ! return; ! } ! /* in case of LIST imply -l */ ! /* in case of NLST imply -1 */ ! if (ltype == LTYPE_LIST){ ! if (flags){ ! if ( (strsrch(flags, 'l') == -1) && ! (strsrch(flags, 'C') == -1) && ! (strsrch(flags, '1') == -1) ) ! flags += "l"; } ! else ! flags = "l"; ! } ! else{ ! if (flags){ ! if ( (strsrch(flags, 'l') == -1) && ! (strsrch(flags, 'C') == -1) && ! (strsrch(flags, '1') == -1) ) ! flags += "1"; } ! else flags = "1"; ! } ! if(strsrch(flags,'F') > -1){ ! foreach(mixed array file in files) ! if(file[1]==-2) file[0]=sprintf("%s/",file[0]); ! } ! if(strsrch(flags,'C')>-1){ ! int lines; ! int size; ! int i; ! ! if((strsrch(flags,'l') > -1 ) || (strsrch(flags,'1') > -1)){ ! eventWrite("550: LIST -C flag is incompatible with -1 or -l.\n",0); ! eventDestructDataPipe(0); ! return; ! } ! lines=((size = sizeof(files)) / 3 ) + 1; ! output=""; ! for(i=0;i<lines;i++){ ! mixed array these_files; ! ! if((i*3+2) < size){ ! these_files=files[(i*3)..(i*3+2)]; ! } ! else if(i*3 < size){ ! these_files = files[(i*3)..]; ! while(sizeof(these_files)<3) ! these_files += ({ ({"",0,0}) }); ! } ! else break; ! output = sprintf("%s%-=25s %-=25s %-=25s\n", ! output, these_files[0][0], ! these_files[1][0], these_files[2][0] ); ! } ! } ! if(strsrch(flags,'l') > -1){ ! if(strsrch(flags,'1')>-1){ ! eventWrite("550: LIST -l and -1 flags incompatible.\n",0); ! eventDestructDataPipe(0); ! return; ! } ! output = implode(map(files, ! (:sprintf("%s %3i %=9s %=8s %=7s %s%5s %s", ! $1[1]==-2?"drwxrwxr-x":"-rw-rw-r--", ! 1, ! lower_case(replace_string(mud_name(), " ", "_"))[0..7], ! lower_case(replace_string(mud_name(), " ", "_"))[0..7], ! $1[1]==-2?"0":sprintf("%d",$1[1]), ! ctime($1[2])[4..10], ! (time()-$1[2])>31536000?ctime($1[2])[20..]:ctime($1[2])[11..15], ! $1[0]) :)),"\n"); ! } ! if(strsrch(flags,'1') > -1) ! output=implode(map(files,(:sprintf("%s",$1[0]) :)),"\n"); ! eventWrite("150 Opening ASCII mode data connection for file list.\r\n",0); ! Session->dataPipe->eventWrite(implode(explode(output,"\n"), "\r\n")+"\r\n"); ! return; } ! private void eventCmdList(string arg){ ! if(!check_privs(absolute_path(Session->pwd, arg), "read")){ ! eventDestructDataPipe((:eventWrite("550 Pemission denied.\n",0):)); ! return; ! } ! do_list(arg, LTYPE_LIST); } ! private void eventCmdNlst(string arg){ ! if(!check_privs(absolute_path(Session->pwd, arg), "read")){ ! eventDestructDataPipe((:eventWrite("550 Pemission denied.\n",0):)); ! return; ! } ! do_list(arg, LTYPE_NLST); } ! private void eventCmdRetr(string arg){ ! string target_file; ! int i; ! if(!arg){ ! eventDestructDataPipe((:eventWrite("500 command not understood.\n",0):)); ! return; ! } ! target_file = absolute_path(Session->pwd, arg); ! if(member_array(Session->user, ({"anonymous", "ftp"})) != -1 ! && target_file[0..(strlen(ANON_PREFIX)-1)] != ANON_PREFIX) { ! eventDestructDataPipe((:eventWrite("550 Pemission denied.\n",0):)); ! return; ! } ! i = file_size(target_file); ! switch(i){ ! case -2: ! eventWrite(sprintf("550 %s: Can't retrieve (it's a directory).\n", ! target_file),0); ! eventDestructDataPipe(0); ! return; ! case -1: ! eventWrite(sprintf("550 %s: No such file OR directory.\n", ! target_file),0); ! eventDestructDataPipe(0); ! return; ! case 0: ! eventWrite(sprintf("550 %s: File contains nothing.\n", ! target_file),0); ! eventDestructDataPipe(0); ! return; ! default: ! if(i > MaxFile){ ! eventWrite(sprintf("550 %s: File size too large.\n", ! target_file),0); ! eventDestructDataPipe(0); ! return; ! } ! } ! if(!check_privs(target_file, "read")){ ! eventDestructDataPipe((:eventWrite("550 Pemission denied.\n",0):)); ! return; ! } ! switch(Session->binary){ ! case 0: ! outfile[Session->dataPipe]=({target_file,0,0,Session->cmdPipe, i}); ! eventWrite(sprintf("150 Opening ascii mode data connection for " ! "%s (%d bytes).\n", target_file, i),0); ! Session->dataPipe->SetWrite((: RetrieveCmdCallback :)); ! ! Session->dataPipe->eventWrite(RetrieveCmdCallback(Session->dataPipe)); ! break; ! case 1: ! outfile[Session->dataPipe]=({target_file,1,0,Session->cmdPipe, i}); ! eventWrite(sprintf("150 Opening binary mode data connection " ! "for %s (%d bytes).\n", target_file, i),0); ! Session->dataPipe->SetWrite((: RetrieveCmdCallback :)); ! ! Session->dataPipe->eventWrite(RetrieveCmdCallback(Session->dataPipe)); ! break; ! default: ! error(sprintf("Assertion failed: \"##x\" (File: %s)\n", __FILE__)); ! } } ! void eventCmdPwd(string arg){ ! eventWrite(sprintf("257 \"%s\" is current directory.\n", Session->pwd),0); ! } ! void eventCmdNoop(string arg){ ! eventWrite("221 NOOP command successful.\n",0); } ! ! private void eventCmdStor(string arg){ ! if(!arg){ ! eventDestructDataPipe((:eventWrite("500 command not understood.\n",0):)); ! return; ! } ! arg = absolute_path(Session->pwd, arg); #ifndef ANON_CAN_PUT ! if(member_array(Session->user, ({"anonymous", "ftp"})) != -1){ ! eventDestructDataPipe((:eventWrite, "550 Pemission denied.\n", 0:)); ! return; ! } #else ! if(member_array(Session->user, ({"anonymous", "ftp"})) != -1 ! && arg[0..(strlen(ANON_PREFIX)-1)] != ANON_PREFIX) { ! eventDestructDataPipe((:eventWrite, "550 Pemission denied.\n", 0:)); ! return; ! } #endif ! if(file_size(FindPrevDir(arg)) != -2 ){ ! eventDestructDataPipe((:eventWrite, ! "553 No such directory to store into.\n", 0:)); ! return; ! } ! if(!check_privs(arg, "write")){ ! eventDestructDataPipe((:eventWrite("550 Pemission denied.\n",0):)); ! return; ! } ! Session->targetFile = arg; ! if( file_exists(arg) ){ ! if( !rm( arg ) ){ ! eventWrite(sprintf("550 %s: Permission denied.\n", arg),0); ! eventDestructDataPipe(0); ! return; ! } ! } ! else if(!write_file( arg, "") ){ eventWrite(sprintf("550 %s: Permission denied.\n", arg),0); ! eventDestructDataPipe(0); return; ! } ! Session->filepos = 0; ! eventWrite(sprintf("150 Opening %s mode data connection for %s.\n", ! Session->binary ? "binary" : "ascii", arg),0); } ! private void eventCmdStou(string arg){ ! if(!arg){ ! eventDestructDataPipe((:eventWrite("500 command not understood.\n",0):)); ! return; ! } ! arg = absolute_path(Session->pwd, arg); #ifndef ANON_CAN_PUT ! if(member_array(Session->user, ({"anonymous", "ftp"})) != -1){ ! eventDestructDataPipe((:eventWrite, "550 Pemission denied.\n", 0:)); ! return; ! } #else ! if(member_array(Session->user, ({"anonymous", "ftp"})) != -1 ! && arg[0..(strlen(ANON_PREFIX)-1)] != ANON_PREFIX) { ! eventDestructDataPipe((:eventWrite, "550 Pemission denied.\n", 0:)); ! return; ! } #endif ! if(file_size(FindPrevDir(arg)) != -2 ){ ! eventDestructDataPipe((:eventWrite, ! "553 No such directory to store into.\n", 0:)); ! return; ! } ! if(!check_privs(arg, "write")){ ! eventDestructDataPipe((:eventWrite("550 Pemission denied.\n",0):)); ! return; ! } ! if( file_exists(arg)){ ! arg = GetUniqueFileName(arg); ! } ! Session->targetFile = arg; ! if(!write_file( arg, "") ){ ! eventWrite(sprintf("550 %s: Permission denied.\n", arg),0); ! eventDestructDataPipe(0); ! return; ! } ! Session->filepos = 0; ! eventWrite(sprintf("150 Opening %s mode data connection for %s.\n", ! Session->binary ? "binary" : "ascii", arg),0); } ! ! private void eventCmdCwd(string arg){ ! string newpath; ! if(!arg){ ! eventWrite("500 command not understood.\n",0); ! return; ! } ! newpath = absolute_path(Session->pwd, arg); ! if(member_array(Session->user, ({"anonymous", "ftp"})) != -1 ! && newpath[0..(strlen(ANON_PREFIX)-1)] != ANON_PREFIX) { ! eventWrite("550 Pemission denied.\n",0); ! return; ! } ! if(!check_privs(newpath, "read")){ ! eventWrite("550 Pemission denied.\n",0); ! return; ! } ! if( file_size(newpath) != -2 ){ ! eventWrite(sprintf("550 %s: No such directory.\n", newpath),0); ! return; ! } ! Session->pwd = newpath; ! eventWrite("250 CWD command successful.\n",0); } ! private void eventCmdCdup(string arg){ eventCmdCwd(".."); } ! private void eventCmdMkd(string arg){ ! if(!arg){ ! eventWrite("500 command not understood.\n",0); ! return; ! } ! arg = absolute_path(Session->pwd, arg); #ifndef ANON_CAN_PUT ! if(member_array(Session->user, ({"anonymous", "ftp"})) != -1){ ! eventWrite("550 Permission denied.\n",0); ! return; ! } #else ! if(member_array(Session->user, ({"anonymous", "ftp"})) != -1 ! && arg[0..(strlen(ANON_PREFIX)-1)] != ANON_PREFIX) { ! eventWrite("550 Pemission denied.\n",0); ! return; ! } #endif ! if( file_size(FindPrevDir(arg)) != -2 ){ ! eventWrite(sprintf("550 %s: No such directory.\n", ! FindPrevDir(arg)),0); ! return; ! } ! if(unguarded((:file_size($(arg)):)) != -1){ ! eventWrite(sprintf("550 %s: File exists.\n", arg),0); ! return; ! } ! if(!check_privs(arg, "write")){ ! eventWrite("550 Pemission denied.\n",0); ! return; ! } ! if( !mkdir(arg) ){ ! eventWrite(sprintf("550 %s: Permission denied.\n", arg),0); ! return; ! } ! eventWrite("257 MKD command successful.\n",0); ! return; } ! private void eventCmdType(string arg){ ! if(!arg){ ! eventWrite("500 command not understood.\n",0); ! return; ! } ! arg = lower_case(arg); ! switch(arg){ ! case "a": ! Session->binary = 0; ! eventWrite("200 Type set to A.\n",0); ! return; ! case "i": ! Session->binary = 1; ! eventWrite("200 Type set to I.\n",0); ! return; ! default: ! eventWrite("550 Unknown file type.\n",0); ! return; ! } } ! private void eventCmdDele(string arg){ ! if(!arg){ ! eventWrite("500 command not understood.\n",0); ! return; ! } ! arg = absolute_path( Session->pwd, arg); ! if(member_array(Session->user, ({"anonymous", "ftp"})) != -1 ! && arg[0..(strlen(ANON_PREFIX)-1)] != ANON_PREFIX) { ! eventWrite("550 Pemission denied.\n",0); ! return; ! } ! if( !file_exists(arg) ){ ! eventWrite(sprintf("550 %s: No such file OR directory.\n", arg),0); ! return; ! } ! if(!check_privs(arg, "write")){ ! eventWrite("550 Pemission denied.\n",0); ! return; ! } ! if( !rm(arg) ){ ! eventWrite(sprintf("550 %s: Permission denied.\n",arg),0); ! return; ! } ! eventWrite("250 DELE command successful.\n",0); } ! private void eventCmdSyst(string arg) { ! eventWrite("215 UNIX Mud Name: "+mud_name()+"\n",0); } ! private void eventCmdRnfr(string arg) { ! if(!arg){ ! eventWrite("500 command not understood.\n",0); ! return; ! } ! arg = absolute_path( Session->pwd, arg); ! if(member_array(Session->user, ({"anonymous", "ftp"})) != -1 ! && arg[0..(strlen(ANON_PREFIX)-1)] != ANON_PREFIX) { ! eventWrite("550 Pemission denied.\n",0); ! return; ! } ! if( !file_exists(arg) ){ ! eventWrite(sprintf("550 %s: No such file OR directory.\n", arg),0); ! return; ! } ! if(!check_privs(arg, "write")){ ! eventWrite("550 Pemission denied.\n",0); ! return; ! } ! Session->renamefrom = arg; ! eventWrite("350 Input new name for " + arg + ".\n",0); } ! private void eventCmdRnto(string arg) { ! if(!arg){ ! eventWrite("500 command not understood.\n",0); ! return; ! } ! arg = absolute_path( Session->pwd, arg); ! if(member_array(Session->user, ({"anonymous", "ftp"})) != -1 ! && arg[0..(strlen(ANON_PREFIX)-1)] != ANON_PREFIX) { ! eventWrite("550 Pemission denied.\n",0); ! return; ! } ! if( !Session->renamefrom ){ ! eventWrite(sprintf("550 You must first specify a file to rename.\n", ! arg),0); ! return; ! } ! if( !file_exists(Session->renamefrom) ){ ! eventWrite(sprintf("550 %s: No such file OR directory.\n", arg),0); ! Session->renamefrom = 0; ! return; ! } ! if(!check_privs(Session->renamefrom, "write")){ ! eventWrite("550 Pemission denied.\n",0); ! Session->renamefrom = 0; ! return; ! } ! if(!check_privs(FindPrevDir(arg), "write")){ ! eventWrite("550 Pemission denied.\n",0); ! Session->renamefrom = 0; ! return; ! } ! if(rename(Session->renamefrom, arg)){ ! eventWrite(sprintf("553 %s: Invalid desitination name.\n", arg),0); ! } ! eventWrite(sprintf("250 RNTO %s --> %s.\n", Session->renamefrom, arg),0); ! Session->renamefrom = 0; } ! ! private void eventCmdRmd(string arg) { ! if(!arg){ ! eventWrite("500 command not understood.\n",0); ! return; ! } ! arg = absolute_path( Session->pwd, arg); ! if(member_array(Session->user, ({"anonymous", "ftp"})) != -1 ! && arg[0..(strlen(ANON_PREFIX)-1)] != ANON_PREFIX) { ! eventWrite("550 Pemission denied.\n",0); ! return; ! } ! if( file_size(arg) != -2 ){ ! eventWrite(sprintf("550 %s: No such file OR directory.\n", arg),0); ! return; ! } ! if(!check_privs(arg, "write")){ ! eventWrite("550 Pemission denied.\n",0); ! return; ! } ! if( !rmdir(arg) ){ ! eventWrite(sprintf("550 %s: Directory not empty.\n",arg),0); ! return; ! } ! eventWrite("250 RMD command successful.\n",0); } ! ! void eventRead(string data){ ! string cmd, arg; ! function dispatchTo; ! int i; ! ! if (!(Session->command)) Session->command = ""; ! ! data = replace_string(data, "\r", ""); ! Session->command += data; ! if ((i = strsrch(Session->command, "\n")) == -1) return; ! data=Session->command[0..i-1]; ! Session->command=Session->command[i+1..]; ! Session->command = trim(Session->command); ! if (!sscanf(data, "%s %s", cmd, arg)) cmd = data; ! cmd = lower_case(cmd); ! ! if (!Session->connected){ ! switch(cmd){ ! case "user": ! eventCmdUser(arg); ! return; ! case "pass": ! eventCmdPswd(arg); ! return; ! case "quit": ! eventCmdQuit(arg); ! return; ! case "noop": ! eventCmdNoop(arg); ! return; default: ! eventWrite("503 Log in with USER first.\n",0); ! return; ! } ! } ! Session->idleTime = 0; ! dispatchTo = dispatch[cmd]; ! if (!dispatchTo){ ! log_file("reports/network_error", ! sprintf("ftp - unknown command: %s\n",cmd)); ! eventWrite(sprintf("502 Unknown command %s.\n", cmd),0); ! return; ! } ! if(catch(evaluate(dispatchTo, arg))){ ! eventWrite("550 Unknown failure. Please report what you were doing " ! "to the mud admin.\n",0); ! } ! return; } diff -c -r --new-file ds1.1/lib/secure/lib/net/ftp_client.c ds2.0r27/lib/secure/lib/net/ftp_client.c *** ds1.1/lib/secure/lib/net/ftp_client.c Wed Mar 10 21:41:30 1999 --- ds2.0r27/lib/secure/lib/net/ftp_client.c Wed Jul 5 00:01:12 2006 *************** *** 1,5 **** /* /secure/lib/ftp_client.c ! * From the Nightmare V Object Library * a TCP client object * Created by Descartes of Borg 950428 * Modified by Dvarsk to add read,write and close settable functions. --- 1,5 ---- /* /secure/lib/ftp_client.c ! * From the Dead Souls Object Library * a TCP client object * Created by Descartes of Borg 950428 * Modified by Dvarsk to add read,write and close settable functions. *************** *** 26,32 **** private static function Close; private static class client Socket; ! varargs static void eventClose(class client sock, int aboted); static void eventRead(mixed val); static void eventSocketClose(); static void eventSocketError(string str, int x); --- 26,32 ---- private static function Close; private static class client Socket; ! varargs static int eventClose(class client sock, int aborted); static void eventRead(mixed val); static void eventSocketClose(); static void eventSocketError(string str, int x); *************** *** 61,67 **** return x; } x = socket_connect(Socket->Descriptor, host + " " + port, ! "eventReadCallback", "eventWriteCallback"); if( x != EESUCCESS ) { eventClose(Socket); eventSocketError("Error in socket_connect().", x); --- 61,67 ---- return x; } x = socket_connect(Socket->Descriptor, host + " " + port, ! "eventReadCallback", "eventWriteCallback"); if( x != EESUCCESS ) { eventClose(Socket); eventSocketError("Error in socket_connect().", x); *************** *** 86,96 **** int x; if( !Socket ){ ! eventDestruct(); ! return; } if ( !sizeof(Socket->Buffer) && Write && Socket->Blocking ){ ! Socket->Buffer = ({ evaluate(Write, this_object()) }); } Socket->Blocking = 0; --- 86,96 ---- int x; if( !Socket ){ ! eventDestruct(); ! return; } if ( !sizeof(Socket->Buffer) && Write && Socket->Blocking ){ ! Socket->Buffer = ({ evaluate(Write, this_object()) }); } Socket->Blocking = 0; *************** *** 98,131 **** x = EESUCCESS; while( Socket->Buffer && x == EESUCCESS ) { switch( x = socket_write(Socket->Descriptor, Socket->Buffer[0]) ) { ! case EESUCCESS: ! if (Write ){ ! mixed tmp; ! ! tmp = evaluate(Write, this_object()); ! if ( sizeof(tmp) ){ ! Socket->Buffer += ({ tmp }); ! } ! } ! Socket->NoDestruct = 0; ! break; ! case EECALLBACK: ! Socket->Blocking = 1; ! Socket->NoDestruct = 1; ! break; ! case EEWOULDBLOCK: ! call_out( (: eventWriteCallback($(fd)) :), 0); ! Socket->NoDestruct = 1; ! return; ! case EEALREADY: ! Socket->Blocking = 1; ! eventDestruct(); ! return; ! default: ! eventClose(Socket); ! eventSocketError("Error in socket_write().", x); ! eventDestruct(); ! return ; } if( sizeof(Socket->Buffer) == 1 ) Socket->Buffer = 0; else Socket->Buffer = Socket->Buffer[1..]; --- 98,131 ---- x = EESUCCESS; while( Socket->Buffer && x == EESUCCESS ) { switch( x = socket_write(Socket->Descriptor, Socket->Buffer[0]) ) { ! case EESUCCESS: ! if (Write ){ ! mixed tmp; ! ! tmp = evaluate(Write, this_object()); ! if ( sizeof(tmp) ){ ! Socket->Buffer += ({ tmp }); ! } ! } ! Socket->NoDestruct = 0; ! break; ! case EECALLBACK: ! Socket->Blocking = 1; ! Socket->NoDestruct = 1; ! break; ! case EEWOULDBLOCK: ! call_out( (: eventWriteCallback($(fd)) :), 0); ! Socket->NoDestruct = 1; ! return; ! case EEALREADY: ! Socket->Blocking = 1; ! eventDestruct(); ! return; ! default: ! eventClose(Socket); ! eventSocketError("Error in socket_write().", x); ! eventDestruct(); ! return ; } if( sizeof(Socket->Buffer) == 1 ) Socket->Buffer = 0; else Socket->Buffer = Socket->Buffer[1..]; *************** *** 135,142 **** } void eventWrite(mixed val) { - int x; - if( !Socket ) return; if( Socket->Buffer ) Socket->Buffer += ({ val }); else Socket->Buffer = ({ val }); --- 135,140 ---- *************** *** 147,153 **** varargs static int eventClose(class client sock, int aborted) { if( !sock ) return 0; if( !aborted && socket_close(sock->Descriptor) != EESUCCESS ) { ! return 0; } sock = 0; if( functionp(Close) ) evaluate(Close); --- 145,151 ---- varargs static int eventClose(class client sock, int aborted) { if( !sock ) return 0; if( !aborted && socket_close(sock->Descriptor) != EESUCCESS ) { ! return 0; } sock = 0; if( functionp(Close) ) evaluate(Close); *************** *** 170,175 **** static void eventSocketError(string str, int x) { if( LogFile ) ! log_file(LogFile, ctime(time()) + "\n" + socket_error(x) + "\n"); } --- 168,173 ---- static void eventSocketError(string str, int x) { if( LogFile ) ! log_file(LogFile, ctime(time()) + "\n" + socket_error(x) + "\n"); } diff -c -r --new-file ds1.1/lib/secure/lib/net/http.c ds2.0r27/lib/secure/lib/net/http.c *** ds1.1/lib/secure/lib/net/http.c Sun Feb 1 21:30:47 1998 --- ds2.0r27/lib/secure/lib/net/http.c Wed Jul 5 00:01:12 2006 *************** *** 24,30 **** private static mixed eventGetFile(string name) { string array parts; object file; ! name = explode(name, " ")[0]; if( name[0] != '/' ) { name = "/" + name; --- 24,30 ---- private static mixed eventGetFile(string name) { string array parts; object file; ! name = explode(name, " ")[0]; if( name[0] != '/' ) { name = "/" + name; *************** *** 47,53 **** if( !strsrch(name, DIR_WWW_GATEWAYS) ) { string id, args, str; buffer b; ! if( sscanf(name, DIR_WWW_GATEWAYS "/%s?%s", id, args) != 2 ) { args = 0; sscanf(name, DIR_WWW_GATEWAYS "/%s", id); --- 47,53 ---- if( !strsrch(name, DIR_WWW_GATEWAYS) ) { string id, args, str; buffer b; ! if( sscanf(name, DIR_WWW_GATEWAYS "/%s?%s", id, args) != 2 ) { args = 0; sscanf(name, DIR_WWW_GATEWAYS "/%s", id); *************** *** 76,82 **** int eventRead(buffer data) { string cmd, args; string str = read_buffer(data); ! if( !socket::eventRead(str) ) { return 0; } --- 76,82 ---- int eventRead(buffer data) { string cmd, args; string str = read_buffer(data); ! if( !socket::eventRead(str) ) { return 0; } *************** *** 87,98 **** args = explode(replace_string(str, "\r", ""), "\n")[0]; sscanf(args, "%s %s", cmd, args); switch(lower_case(cmd)) { ! case "get": ! eventGetFile(args); ! return 1; ! ! default: ! eventError(FILE_BAD_CMD); ! return 1; } } --- 87,98 ---- args = explode(replace_string(str, "\r", ""), "\n")[0]; sscanf(args, "%s %s", cmd, args); switch(lower_case(cmd)) { ! case "get": ! eventGetFile(args); ! return 1; ! ! default: ! eventError(FILE_BAD_CMD); ! return 1; } } diff -c -r --new-file ds1.1/lib/secure/lib/net/include/ftp.h ds2.0r27/lib/secure/lib/net/include/ftp.h *** ds1.1/lib/secure/lib/net/include/ftp.h Wed Mar 10 21:42:01 1999 --- ds2.0r27/lib/secure/lib/net/include/ftp.h Wed Jul 5 00:01:15 2006 *************** *** 24,41 **** private void eventCmdRmd(string arg); class ftp_session { ! int connected; ! string user; ! mixed priv; ! string pwd; ! object dataPipe; ! object cmdPipe; ! int idleTime; ! int binary; ! string targetFile; ! string command; ! int filepos; ! string renamefrom; } #define LTYPE_LIST 0 --- 24,41 ---- private void eventCmdRmd(string arg); class ftp_session { ! int connected; ! string user; ! mixed priv; ! string pwd; ! object dataPipe; ! object cmdPipe; ! int idleTime; ! int binary; ! string targetFile; ! string command; ! int filepos; ! string renamefrom; } #define LTYPE_LIST 0 diff -c -r --new-file ds1.1/lib/secure/lib/net/server.c ds2.0r27/lib/secure/lib/net/server.c *** ds1.1/lib/secure/lib/net/server.c Sun Feb 1 21:30:46 1998 --- ds2.0r27/lib/secure/lib/net/server.c Wed Jul 5 00:01:12 2006 *************** *** 82,93 **** int eventCreateSocket(int port) { int x; - Listen = new(class server); Listen->Blocking = 0; /* servers are not blocking to start */ x = socket_create(SocketType, ! "eventServerReadCallback", ! "eventServerAbortCallback"); if( x < 0 ) { eventSocketError("Error in socket_create().", x); return x; --- 82,92 ---- int eventCreateSocket(int port) { int x; Listen = new(class server); Listen->Blocking = 0; /* servers are not blocking to start */ x = socket_create(SocketType, ! "eventServerReadCallback", ! "eventServerAbortCallback"); if( x < 0 ) { eventSocketError("Error in socket_create().", x); return x; *************** *** 110,115 **** --- 109,115 ---- static int Destruct() { if( daemon::Destruct() ) { foreach(int fd, class server socket in Sockets) { + trr("server:Destruct: fd: "+fd+", "+socket_address(fd),"green"); socket->Owner->evenShutdown(); } eventClose(Listen); *************** *** 129,142 **** static void eventNewConnection(object socket) { class server s = new(class server); - s->Descriptor = socket->GetDescriptor(); s->Blocking = 0; s->Owner = socket; Sockets[s->Descriptor] = s; } static void eventServerAbortCallback(int fd) { eventClose(fd); } --- 129,143 ---- static void eventNewConnection(object socket) { class server s = new(class server); s->Descriptor = socket->GetDescriptor(); s->Blocking = 0; s->Owner = socket; Sockets[s->Descriptor] = s; + socket->StartService(); // added for welcome } static void eventServerAbortCallback(int fd) { + trr("server:eventServerAbortCallback: fd: "+fd+", "+socket_address(fd),"green"); eventClose(fd); } *************** *** 151,159 **** static void eventServerListenCallback(int fd) { int x; x = socket_accept(fd, ! "eventServerReadCallback", ! "eventServerWriteCallback"); if( x < 0 ) { eventSocketError("Error in socket_accept().", x); return; --- 152,161 ---- static void eventServerListenCallback(int fd) { int x; + trr("server:eventServerListenCallback: fd: "+fd+", "+socket_address(fd),"green"); x = socket_accept(fd, ! "eventServerReadCallback", ! "eventServerWriteCallback"); if( x < 0 ) { eventSocketError("Error in socket_accept().", x); return; *************** *** 167,172 **** --- 169,175 ---- static void eventServerReadCallback(int fd, mixed val) { class server s = Sockets[fd]; + trr("server:eventServerReadCallback: fd: "+fd+", "+socket_address(fd),"green"); if( !s || !s->Owner ) { eventClose(fd); return; *************** *** 180,185 **** --- 183,189 ---- class server sock; int x; + trr("server:eventServerWriteCallback: fd: "+fd+", "+socket_address(fd),"green"); if( Listen && Listen->Descriptor == fd ) { sock = Listen; } *************** *** 197,217 **** x = EESUCCESS; while( sock->Buffer && x == EESUCCESS ) { switch( x = socket_write(sock->Descriptor, sock->Buffer[0]) ) { ! case EESUCCESS: ! break; ! case EECALLBACK: ! sock->Blocking = 1; ! break; ! case EEWOULDBLOCK: ! call_out( (: eventServerWriteCallback :), 0, fd); ! return; ! case EEALREADY: ! sock->Blocking = 1; ! return; ! default: ! eventClose(sock); ! eventSocketError("Error in socket_write().", x); ! return; } if( sizeof(sock->Buffer) == 1 ) { sock->Buffer = 0; --- 201,221 ---- x = EESUCCESS; while( sock->Buffer && x == EESUCCESS ) { switch( x = socket_write(sock->Descriptor, sock->Buffer[0]) ) { ! case EESUCCESS: ! break; ! case EECALLBACK: ! sock->Blocking = 1; ! break; ! case EEWOULDBLOCK: ! call_out( (: eventServerWriteCallback :), 0, fd); ! return; ! case EEALREADY: ! sock->Blocking = 1; ! return; ! default: ! eventClose(sock); ! eventSocketError("Error in socket_write().", x); ! return; } if( sizeof(sock->Buffer) == 1 ) { sock->Buffer = 0; *************** *** 233,238 **** --- 237,244 ---- class server sock; int fd = owner->GetDescriptor(); + trr("server:eventWrite: fd: "+fd+", "+socket_address(fd),"green"); + if( Listen && Listen->Descriptor == fd ) { sock = Listen; } *************** *** 245,251 **** if( owner != sock->Owner ) { return 0; } ! if( SocketType != STREAM ) { if( sock->Buffer ) { sock->Buffer += ({ val }); } --- 251,257 ---- if( owner != sock->Owner ) { return 0; } ! if( SocketType != STREAM || stringp(val)) { if( sock->Buffer ) { sock->Buffer += ({ val }); } *************** *** 257,270 **** buffer data = val; int size = sizeof(data); int count = (size/MaxBytes) + 1; ! if( !sock->Buffer ) { sock->Buffer = ({}); } for(int i=0; i<count; i++) { int length, ptr; buffer b; ! ptr = count * MaxBytes; if( size - ptr > MaxBytes ) { length = MaxBytes; --- 263,276 ---- buffer data = val; int size = sizeof(data); int count = (size/MaxBytes) + 1; ! if( !sock->Buffer ) { sock->Buffer = ({}); } for(int i=0; i<count; i++) { int length, ptr; buffer b; ! ptr = count * MaxBytes; if( size - ptr > MaxBytes ) { length = MaxBytes; *************** *** 276,281 **** --- 282,288 ---- sock->Buffer = ({ sock->Buffer..., b }); } } + sock->Closing = close; if( !sock->Blocking ) { eventServerWriteCallback(sock->Descriptor); *************** *** 287,292 **** --- 294,300 ---- varargs static void create(int port, int type, string socket_obj) { daemon::create(); SetNoClean(1); + if( socket_obj ) { SocketObject = socket_obj; } diff -c -r --new-file ds1.1/lib/secure/lib/net/socket.c ds2.0r27/lib/secure/lib/net/socket.c *** ds1.1/lib/secure/lib/net/socket.c Sun Feb 1 21:30:46 1998 --- ds2.0r27/lib/secure/lib/net/socket.c Wed Jul 5 00:01:12 2006 *************** *** 1,5 **** /* /lib/net/socket.c ! * From the Dead Souls V Object Library * Handles individual socket I/O * Created by Descartes of Borg 961218 * Version: @(#) socket.c 1.1@(#) --- 1,5 ---- /* /lib/net/socket.c ! * From the Dead Souls Object Library * Handles individual socket I/O * Created by Descartes of Borg 961218 * Version: @(#) socket.c 1.1@(#) *************** *** 14,19 **** --- 14,23 ---- private static object Owner = 0; /* *********************** socket.c attributes ********************* */ + string GetAddress() { + return socket_address(Descriptor); + } + int GetDescriptor() { return Descriptor; } *************** *** 38,44 **** return 1; } ! static int eventWrite(mixed data, int close) { return Owner->eventWrite(this_object(), data, close); } --- 42,48 ---- return 1; } ! varargs static int eventWrite(mixed data, int close) { return Owner->eventWrite(this_object(), data, close); } diff -c -r --new-file ds1.1/lib/secure/lib/net/telnet_client.c ds2.0r27/lib/secure/lib/net/telnet_client.c *** ds1.1/lib/secure/lib/net/telnet_client.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/lib/net/telnet_client.c Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,217 ---- + #include <lib.h> + #include <network.h> + #include <socket_err.h> + inherit LIB_ITEM; + + int attempting, connected, socket ; + object person ; + object player; + + static void create() + { + item::create(); + SetKeyName( "client" ) ; + SetShort( "a telnet client" ) ; + SetId(({ "telnet","terminal" })) ; + SetLong( "It's a small pocket sized telnet terminal.\n" + "Use 'telnet' or 'connect' to begin.\n\nCommands:\n" + "[connect|telnet] : start telnet session.\nreset [client]" + " : reset the telnet client.\nreconnect : reconnect to session" + " (if you go netdead)\n"); + SetMass( 5 ) ; + attempting = 0 ; + connected = 0 ; + socket = 0 ; + person = 0 ; + } + + void init() + { + add_action( "do_connect", ({ "connect", "telnet" }) ) ; + add_action( "do_reset", "reset" ) ; + add_action( "do_reconnect", "reconnect" ) ; + } + + int do_reconnect() + { + if( !connected ) + { + notify_fail( "The telnet client is not connected!\n" ) ; + return 0 ; + } + write("Reconnecting into telnet session.\n"); + person = this_player() ; + input_to( "parse_comm", 0 ) ; + return 1 ; + } + + int do_reset( string args ) + { + notify_fail( "Usage: reset client\n" ) ; + if( !args || args == "" ) + { + return 0 ; + } + if( args != "client" ) + { + return 0 ; + } + write("Resetting telnet client ...\n"); + if( connected ) + { + if( socket ) + { + socket_close( socket ) ; + } + } + attempting = 0 ; + connected = 0 ; + socket = 0 ; + person = 0 ; + write("Done!\n"); + return 1 ; + } + + string help() + { + return "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n" + " Usage : connect [ip_address] [port]\n" + "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n" + "Note: use telnet port number 23 if you \n" + " are connecting to a normal site. \n" + "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n" ; + } + + int do_connect(string args) + { + int new_socket, sc_result, port ; + string error, ip_address ; + + if( !args || args == "" ) + { + notify_fail( help() ) ; + return 0 ; + } + if( sscanf( args, "%s %d", ip_address, port ) != 2 ) + { + notify_fail( help() ) ; + return 0 ; + } + if( attempting ) + { + notify_fail( "Telnet connection attempt already in progress.\n" ) ; + return 0 ; + } + if( connected ) + { + notify_fail( "Already connected...\n" ) ; + return 0 ; + } + new_socket = socket_create( STREAM, "read_callback", "close_callback" ) ; + if( new_socket < 0 ) + { + switch( new_socket ) + { + case EEMODENOTSUPP : + error = "Socket mode not supported.\n" ; + break ; + case EESOCKET : + error = "Problem creating socket.\n" ; + break ; + case EESETSOCKOPT : + error = "Problem with setsockopt.\n" ; + break ; + case EENONBLOCK : + error = "Problem with setting non-blocking mode.\n" ; + break ; + case EENOSOCKS : + error = "No more available efun sockets.\n" ; + break ; + case EESECURITY : + error = "Security violation attempted.\n" ; + break ; + default : + error = "Unknown error code: " + new_socket + ".\n" ; + break ; + } + notify_fail( "Unable to connect, problem with socket_create.\n" + "Reason: " + error ) ; + return 0 ; + } + sc_result = socket_connect( new_socket, ip_address + " " + port, + "read_callback", "write_callback" ) ; + if( sc_result != EESUCCESS ) + { + notify_fail( "Failed to connect.\n" ) ; + return 0 ; + } + attempting = 1 ; + socket = new_socket ; + person = (object)previous_object() ; + player=this_player(); + write("Telnet Client Version 1.2\n"); + write("Attempting connection to: " + ip_address + " " + port + "...\nEnter 'dcon' at any time to abort.\n"); + input_to( "parse_comm", 0 ) ; + return 1 ; + } + + void read_callback( int fd, mixed message ) + { + player->eventPrint(message); + } + + void close_callback( int fd ) + { + if( connected ) + { + write("Connection closed by foreign host.\n"); + } + if( attempting ) + { + write("Attempt failed.\n"); + } + write("Type 'dcon' to finalize exit.\n"); + socket_close( fd ) ; + attempting = 0 ; + connected = 0 ; + socket = 0 ; + } + + void write_callback( int fd ) + { + write("Connected...\n"); + attempting = 0 ; + connected = 1 ; + } + + int parse_comm( string str ) + { + if( str == "dcon" ) + { + write("Disconnecting...\n"); + socket_close( socket ) ; + attempting = 0 ; + connected = 0 ; + socket = 0 ; + person = 0 ; + return 1 ; + } else { + if( !connected ) + { + write("You are not connected. Type \"dcon\" to stop using the client.\n"); + input_to( "parse_comm", 0 ) ; + return 1 ; + } + if( attempting ) + { + write("Please wait, still attempting connection, " + "type 'dcon' to exit.\n"); + input_to( "parse_comm", 0 ) ; + return 1 ; + } + socket_write( socket, str + "\n" ) ; + input_to( "parse_comm", 0 ) ; + return 1 ; + } + } + diff -c -r --new-file ds1.1/lib/secure/lib/std/access.c ds2.0r27/lib/secure/lib/std/access.c *** ds1.1/lib/secure/lib/std/access.c Sun Feb 1 21:30:47 1998 --- ds2.0r27/lib/secure/lib/std/access.c Wed Jul 5 00:01:12 2006 *************** *** 41,50 **** nomask int check_access(object ob, string fun, string file, string oper) { string array who; mapping access; - int x; if( oper == "read" ) { ! if( functionp(ReadFunction) ) { if( !(functionp(ReadFunction) & FP_OWNER_DESTED) ) { if( evaluate(ReadFunction, ob, fun, file) ) { return 1; --- 41,49 ---- nomask int check_access(object ob, string fun, string file, string oper) { string array who; mapping access; if( oper == "read" ) { ! if( functionp(ReadFunction) ) { if( !(functionp(ReadFunction) & FP_OWNER_DESTED) ) { if( evaluate(ReadFunction, ob, fun, file) ) { return 1; *************** *** 54,67 **** access = ReadAccess; } else { ! if( functionp(WriteFunction) ) { if( !(functionp(WriteFunction) & FP_OWNER_DESTED) ) { if( evaluate(WriteFunction, ob, fun, file) ) { return 1; } } } ! access = WriteAccess; } if( !arrayp(who = match_path(access, file)) ) { return 0; --- 53,66 ---- access = ReadAccess; } else { ! if( functionp(WriteFunction) ) { if( !(functionp(WriteFunction) & FP_OWNER_DESTED) ) { if( evaluate(WriteFunction, ob, fun, file) ) { return 1; } } } ! access = WriteAccess; } if( !arrayp(who = match_path(access, file)) ) { return 0; *************** *** 71,87 **** nomask int grant_access(string type, string file, string who) { if( type == "read" ) { ! if( ReadAccess[file] ) { ReadAccess[file] = distinct_array(ReadAccess[file] + ({ who })); } ! else { ReadAccess[file] = ({ who }); } if( !eventSave() ) { Destruct(); return 0; } ! return 1; } else if( type != "write" ) { return 0; --- 70,86 ---- nomask int grant_access(string type, string file, string who) { if( type == "read" ) { ! if( ReadAccess[file] ) { ReadAccess[file] = distinct_array(ReadAccess[file] + ({ who })); } ! else { ReadAccess[file] = ({ who }); } if( !eventSave() ) { Destruct(); return 0; } ! return 1; } else if( type != "write" ) { return 0; *************** *** 101,117 **** nomask int remove_access(string type, string file, string who) { if( type == "read" ) { ! if( !ReadAccess[file] ) { return 0; } ! else { ReadAccess[file] -= ({ who }); } if( !eventSave() ) { Destruct(); return 0; } ! return 1; } else if( type != "write" ) { return 0; --- 100,116 ---- nomask int remove_access(string type, string file, string who) { if( type == "read" ) { ! if( !ReadAccess[file] ) { return 0; } ! else { ReadAccess[file] -= ({ who }); } if( !eventSave() ) { Destruct(); return 0; } ! return 1; } else if( type != "write" ) { return 0; diff -c -r --new-file ds1.1/lib/secure/modules/armor.c ds2.0r27/lib/secure/modules/armor.c *** ds1.1/lib/secure/modules/armor.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/modules/armor.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,199 ---- + #include <lib.h> + #include <modules.h> + #include <daemons.h> + #include <commands.h> + #include <rooms.h> + #include <armor_types.h> + #include <damage_types.h> + + + int GetProts(string str); + int eventProcessValues(); + int eventStartQuery(string str); + int eventReceiveValue(string str); + mixed eventReadProtectionSettings(string str); + varargs int eventModifyProtections(mapping Protecciones, string filename, object ob); + + string globaltmp, globalstr, protections, current; + object armor_item; + string *prot_array = ({}); + mapping ProtectionsMap = ([]); + + string array Protections = ({ "BLUNT" ,"BLADE", "KNIFE", "WATER", "SHOCK", "COLD", "HEAT", "GAS", "ACID", "MAGIC", "POISON", "DISEASE", "TRAUMA" }); + + + varargs int eventStartArmorQuestions(string what, object ob){ + string filename; + mixed tempvar; + + armor_item = ob; + filename = base_name(ob)+".c"; + + if(file_exists(filename)) tempvar = eventReadProtectionSettings(filename); + if(tempvar && mapp(tempvar)) ProtectionsMap = tempvar; + else ProtectionsMap = ([]); + + protections = ""; + prot_array = ({}); + if(what && what != "") prot_array = ({ what }); + foreach(string prot in Protections) { + protections += lower_case(prot)+", "; + } + + truncate(protections,2); + protections += "."; + + write("Your armor can protect against one or more of the following types of damage: "); + write(protections+"."); + write("\nPlease enter which ones your armor should protect from, one at a time. "); + write("When you are done, please type a dot on a blank line."); + if(sizeof(prot_array)) write("So far, we have: "+identify(prot_array)); + + input_to( (: GetProts :) ); + return 1; + } + + int GetProts(string str){ + string *temp_array; + if(!str || str == "" || str == "."){ + prot_array -= ({0}); + if(sizeof(prot_array)) foreach(string element in prot_array){ + if(member_array(upper_case(element),Protections) == -1) prot_array -= ({ element }); + } + + if(!sizeof(prot_array)){ + write("Modification cancelled."); + return 1; + } + + else { + write("Protections list complete."); + eventProcessValues(); + return 1; + } + } + + if(grepp(str," ")){ + temp_array = explode(str," "); + prot_array += temp_array; + } + else prot_array += ({ str }); + + if(sizeof(prot_array)) write("You may now enter the next value. So far, we have: "+identify(prot_array)); + else write("You may now enter the next value. So far, it is blank."); + write("If you're done entering values, enter a dot on a blank line."); + + input_to( (: GetProts :) ); + return 1; + } + + int eventProcessValues(){ + if(sizeof(prot_array)){ + current = upper_case(prot_array[0]); + prot_array -= ({ prot_array[0] }); + eventStartQuery(current); + return 1; + } + eventModifyProtections(ProtectionsMap, base_name(armor_item)+".c", armor_item); + return 1; + } + + int eventStartQuery(string str){ + write("Please enter the protection value for: "+str); + input_to( (: eventReceiveValue :) ); + return 1; + } + + int eventReceiveValue(string str){ + int val; + if(!sscanf(str,"%d",val)) { + write("Please enter an integer value."); + eventStartQuery(current); + return 1; + } + + else { + ProtectionsMap[current] = val; + eventProcessValues(); + return 1; + } + } + + mixed eventReadProtectionSettings(string str){ + string prot, num, s1, junk; + int val; + string *temp_array = ({}); + string *fun_array = ({}); + string tmp_str = ""; + if(file_exists(str+".c")) str += ".c"; + if(file_exists(str)) { + if(!check_privs(this_player(),str)) { + write("You lack sufficient privileges for this."); + return 1; + } + else { + globalstr = str; + unguarded( (: globalstr = read_file(globalstr) :) ); + } + if(globalstr && globalstr != ""){ + str = globalstr; + globalstr = ""; + } + } + + fun_array = this_object()->eventReadFunctions(str); + if(!sizeof(fun_array)) { + write("Unknown error."); + return 1; + } + foreach(string element in fun_array){ + if(grepp(element,"SetProtection(")) tmp_str += element ; + } + + temp_array = explode(tmp_str,"\n"); + //tc("temp_array: "+identify(temp_array)); + if(!sizeof(temp_array)){ + return ([]); + } + else { + foreach(string element in temp_array){ + if(sscanf(element,"SetProtection(%s)%s",s1,junk) == 2){ + sscanf(s1,"%s,%s",prot,num); + num = trim(num); + prot = trim(prot); + sscanf(num,"%d",val); + ProtectionsMap[prot] = val; + } + } + } + + return ProtectionsMap; + } + + varargs int eventModifyProtections(mapping Protecciones, string filename, object ob){ + string new_lines; + + if(!check_privs(this_player(),filename)){ + write("You do not have sufficient privileges to perform this action."); + return 1; + } + globaltmp = filename; + unguarded( (: globalstr = read_file(globaltmp) :) ); + + globalstr = remove_matching_line(globalstr, "SetProtection" , 1); + globaltmp = generate_tmp(); + new_lines = "\n"; + foreach(string key, string val in ProtectionsMap){ + new_lines += "SetProtection("+key+", "+val+");\n"; + } + globalstr = this_object()->eventAppend(globalstr,({"SetArmorType","SetRestrictLimbs","SetLong"}),new_lines); + unguarded( (: write_file(globaltmp, globalstr,1) :) ); + this_object()->eventGeneralStuff(globaltmp); + globalstr = filename; + unguarded( (: cp(globaltmp, globalstr) :) ); + rm(globaltmp); + if(ob && grepp(filename,base_name(ob))){ + reload(ob); + } + return 1; + } diff -c -r --new-file ds1.1/lib/secure/modules/create.c ds2.0r27/lib/secure/modules/create.c *** ds1.1/lib/secure/modules/create.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/modules/create.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,766 ---- + /* /daemon/create.c + * From Dead Souls LPMud + * Mediates requests to create and modify objects + */ + + #include <lib.h> + #include <dirs.h> + #include <daemons.h> + #include <modules.h> + #include <commands.h> + #include <rooms.h> + + + int eventDelete(object ob, string value); + string global1, global2, globaltmp, globalvalue; + + string *base_arr = ({"set_heart_beat", "SetUnique", "SetNoClean","SetNoModify","SetProperties","SetLong","SetShort","SetItems","SetListen","SetSmell"}); + string *item_arr = base_arr + ({"SetLanguage","SetRead","SetDefaultRead","SetDisableChance", "SetDamagePoints", "SetVendorType","SetNoCondition","SetMoney","SetKeyName", "SetId", "SetMass","SetCost","SetValue","SetAdjectives","SetDamagePoints","SetBaseCost" }); + string *meal_arr = item_arr + ({ "SetMealType", "SetStrength"}) -({"SetDamagePoints"}); + string *storage_arr = item_arr + ({"SetOpacity", "SetMaxCarry","SetInventory", "SetCanClose", "SetCanLock","SetMaxRecurse","SetLocked","SetClosed","SetKey"}); + string *room_arr = base_arr - ({"SetUnique"}) + ({"SetLanguage", "SetRead", "SetDefaultRead", "SetNoObviousExits","SetDefaultExits","SetTown","SetNightLong","SetDayLong","SetClimate","SetAmbientLight","SetNightLight","SetDayLight","SetObviousExits", "SetInventory", "SetEnters"}); + string *npc_arr = base_arr - ({"SetItems"}) + ({"SetNativeLanguage","SetCustomXP", "SetSpellBook", "SetCanBite", "SetWimpy","SetWimpyCommand","SetPacifist", "SetBodyComposition", "SetSleeping","SetPermitLoad", "SetAutoStand","SetCurrency","SetSkills","SetStats","SetKeyName", "SetId", "SetLevel", "SetRace", "SetClass","SetGender", "SetInventory", "SetHealthPoints","SetMaxHealthPoints", "SetAdjectives", "SetMelee", "SetPosition", "SetWanderSpeed", "SetEncounter", "SetMorality", "SetHeartBeat"}); + string *barkeep_arr = npc_arr + ({"SetLocalCurrency","SetMenuItems"}); + string *trainer_arr = npc_arr + ({"SetNoSpells", "AddTrainingSkills"}); + string *vendor_arr = npc_arr + ({"SetLocalCurrency","SetStorageRoom","SetMaxItems","SetVendorType"}); + string *armor_arr = item_arr +({"SetRestrictLimbs","SetProtection","SetArmorType"}); + string *weapon_arr = item_arr + ({"SetClass","SetWeaponType","SetDamageType","SetHands"}); + string *chair_arr = item_arr + ({"SetMaxSitters","SetMaxCarry","SetInventory"}); + string *bed_arr = chair_arr + ({"SetMaxLiers"}); + string *table_arr = storage_arr + bed_arr; + string *door_arr = ({"SetHiddenDoor", "SetLong","SetShort","SetLocked","SetClosed","SetCanLock","SetKey","SetId"}); + string *book_arr = item_arr + ({"SetTitle","SetSource"}); + string *worn_storage_arr = armor_arr + storage_arr; + + string *all_arr = storage_arr + door_arr + room_arr + barkeep_arr + armor_arr + weapon_arr + bed_arr +meal_arr + vendor_arr +trainer_arr; + + + string GetSettings(string str){ + string ret; + string *name = ({}); + ret = ""; + switch(str){ + case "room" : name = room_arr; break; + case "npc" : name = npc_arr; break; + case "mob" : name = npc_arr; break; + case "barkeep" : name = barkeep_arr; break; + case "vendor" : name = vendor_arr; break; + case "trainer" : name = trainer_arr; break; + case "armor" : name = armor_arr; break; + case "armour" : name = armor_arr; break; + case "weapon" : name = weapon_arr; break; + case "item" : name = item_arr; break; + case "door" : name = door_arr; break; + case "meal" : name = meal_arr; break; + case "storage" : name = storage_arr; break; + case "table" : name = table_arr; break; + case "bed" : name = bed_arr; break; + case "chair" : name = chair_arr; break; + case "book" : name = book_arr; break; + case "worn storage" : name = worn_storage_arr; break; + case "wornstorage" : name = worn_storage_arr; break; + case "worn_storage" : name = worn_storage_arr; break; + default : name = room_arr; + } + foreach(string thing in name){ + ret += thing+", "; + } + ret = truncate(ret,2)+"."; + return ret; + } + + mapping QueryMap(string str,object ob){ + switch(str){ + case "SetItems" : return ob->GetItemsMap();break; + case "SetSmell" : return ob->GetSmellMap();break; + case "SetListen" : return ob->GetListenMap();break; + case "SetInventory" : return ob->GetInventory();break; + case "SetEnters" : return ob->GetEnterMap();break; + case "SetMenuItems" : return ob->GetMenuItems();break; + case "SetSpellBook" : return ob->GetSpellBook();break; + default : return ([]); + } + + } + + mixed eventModify(object ob, string str){ + string inheritance, out, tmpfile, filename, mode, metamode; + mixed value, mixed_tmp; + int invalid, setmap; + mapping temp_map; + string *p_array, *array_props, *special_map_array;; + + invalid = 1; + + inheritance = ""; + + if(ob->GetDoor() && sizeof(ob->GetDoor())) { + inheritance = "door"; + ob = load_object(ob->GetDoor()); + } + + filename = base_name(ob)+".c"; + tmpfile = generate_tmp(ob); + special_map_array = ({ "SetProperties", "SetStats", "SetSkills"}); + + if(!check_privs(this_player(),filename)){ + write("You do not appear to have access to this file. Modification aborted."); + return 1; + } + + if(!check_privs(this_player(),tmpfile)){ + write("You do not appear to have access to this file. Modification aborted."); + return 1; + } + + global1 = filename; + global2 = filename; + + unguarded( (: global1 = replace_line(read_file(global1) ,({"customdefs.h"}), "#include \""+homedir(this_player())+"/customdefs.h\"") :) ); + global1 = replace_string(global1,"//extras",""); + global1 = replace_string(global1,"\n\n\n","\n\n"); + unguarded( (: write_file(global2, global1, 1) :) ); + global1 = filename; + global2 = tmpfile; + unguarded( (: cp(global1,global2) :) ); + + if(inherits(LIB_ROOM,ob)) inheritance += " room"; + if(inherits(LIB_NPC,ob)) inheritance += " npc"; + if(inherits(LIB_SENTIENT,ob)) inheritance += " npc"; + if(inherits(LIB_BARKEEP,ob)) inheritance += " barkeep"; + if(inherits(LIB_VENDOR,ob)) inheritance += " vendor"; + if(inherits(LIB_TRAINER,ob)) inheritance += " trainer"; + if(inherits(LIB_WEAPON,ob)) inheritance += " weapon"; + if(inherits(LIB_ARMOR,ob)) inheritance += " armor"; + if(inherits(LIB_ITEM,ob)) inheritance += " item"; + if(inherits(LIB_STORAGE,ob)) inheritance += " storage"; + if(inherits(LIB_CHAIR,ob)) inheritance += " chair"; + if(inherits(LIB_BED,ob)) inheritance += " bed"; + if(inherits(LIB_TABLE,ob)) inheritance += " table"; + if(inherits(LIB_MEAL,ob)) inheritance += " meal"; + if(inherits(LIB_BOOK,ob)) inheritance += " book"; + if(inherits(LIB_DOOR,ob)) inheritance += " door"; + if(inherits(LIB_WORN_STORAGE,ob)) inheritance += " worn_storage"; + + if(!inheritance || inheritance == ""){ + write("The object you want to modify lacks an init() function."); + write("Please correct this by issuing the initfix command, then try again."); + write("\nIf you are certain the object has a working init(), then"); + write("This error indicates that its library object type is not"); + write("currently supported by the Quick Creation System."); + return 1; + } + + if(sscanf(str,"%s %s %d",mode, metamode, value) != 3) sscanf(str,"%s %s %s",mode, metamode, value); + if(member_array(mode,special_map_array) == -1){ + if(sscanf(str,"%s %d",mode, value) != 2) sscanf(str,"%s %s",mode, value); + } + if(!value) { + value = 0; + if(!mode) mode = str; + } + + if(mode == "delete") { + if(value) mode = value; + value = "delete"; + } + + setmap = 0; + switch(lower_case(mode)){ + case "short" : out = "SetShort";break; + case "setshort" : out = "SetShort";break; + case "long" : out = "SetLong";break; + case "setlong" : out = "SetLong";break; + case "setnightlong" : out = "SetNightLong";break; + case "nightlong" : out = "SetNightLong";break; + case "daylong" : out = "SetDayLong";break; + case "setdaylong" : out = "SetDayLong";break; + case "climate" : out = "SetClimate";break; + case "setclimate" : out = "SetClimate";break; + case "light" : out = "SetAmbientLight";break; + case "ambientlight" : out = "SetAmbientLight";break; + case "setlight" : out = "SetAmbientLight";break; + case "nightlight" : out = "SetNightLight";break; + case "setnightlight" : out = "SetNightLight";break; + case "daylight" : out = "SetDayLight";break; + case "setdaylight" : out = "SetDayLight";break; + case "obvious" : out = "SetObviousExits";break; + case "setobvious" : out = "SetObviousExits";break; + case "obviousexits" : out = "SetObviousExits";break; + case "setobviousexits" : out = "SetObviousExits";break; + case "town" : out = "SetTown";break; + case "settown" : out = "SetTown";break; + case "keyname" : out = "SetKeyName";break; + case "setkeyname" : out = "SetKeyName";break; + case "name" : out = "SetKeyName";break; + case "setname" : out = "SetKeyName";break; + case "id" : out = "SetId";break; + case "setid" : out = "SetId";break; + case "class" : out = "SetClass";break; + case "setclass" : out = "SetClass";break; + case "maxhealth" : out = "SetMaxHealthPoints";break; + case "maxhealthpoints" : out = "SetMaxHealthPoints";break; + case "setmaxhealth" : out = "SetMaxHealthPoints";break; + case "setmaxhealthpoints" : out = "SetMaxHealthPoints";break; + case "level" : out = "SetLevel";break; + case "setlevel" : out = "SetLevel";break; + case "race" : out = "SetRace";break; + case "setrace" : out = "SetRace";break; + case "health" : out = "SetHealthPoints";break; + case "healthpoints" : out = "SetHealthPoints";break; + case "sethealth" : out = "SetHealthPoints";break; + case "sethealthpoints" : out = "SetHealthPoints";break; + case "gender" : out = "SetGender";break; + case "setgender" : out = "SetGender";break; + case "mass" : out = "SetMass";break; + case "setmass" : out = "SetMass";break; + case "weight" : out = "SetMass";break; + case "setweight" : out = "SetMass";break; + case "cost" : out = "SetCost";break; + case "setcost" : out = "SetCost";break; + case "value" : out = "SetValue";break; + case "setvalue" : out = "SetValue";break; + case "dollarcost" : out = "SetDollarCost";break; + case "setdollarcost" : out = "SetDollarCost";break; + case "adjectives" : out = "SetAdjectives";break; + case "setadjectives" : out = "SetAdjectives";break; + case "adj" : out = "SetAdjectives";break; + case "setadj" : out = "SetAdjectives";break; + case "adjs" : out = "SetAdjectives";break; + case "setadjs" : out = "SetAdjectives";break; + case "damage" : out = "SetDamagePoints";break; + case "setdamage" : out = "SetDamagePoints";break; + case "damagepoints" : out = "SetDamagePoints";break; + case "setdamagepoints" : out = "SetDamagePoints";break; + case "restrictlimbs" : out = "SetRestrictLimbs";break; + case "setrestrictlimbs" : out = "SetRestrictLimbs";break; + case "protection" : out = "SetProtection";break; + case "setprotection" : out = "SetProtection";break; + case "setprotections" : out = "SetProtection";break; + case "protections" : out = "SetProtection";break; + case "armortype" : out = "SetArmorType";break; + case "setarmortype" : out = "SetArmorType";break; + case "weapontype" : out = "SetWeaponType";break; + case "setweapontype" : out = "SetWeaponType";break; + case "damagetype" : out = "SetDamageType";break; + case "setdamagetype" : out = "SetDamageType";break; + case "hands" : out = "SetHands";break; + case "sethands" : out = "SetHands";break; + case "carry" : out = "SetMaxCarry";break; + case "maxcarry" : out = "SetMaxCarry";break; + case "setmaxcarry" : out = "SetMaxCarry";break; + case "closed" : out = "SetClosed";break; + case "setclosed" : out = "SetClosed";break; + case "locked" : out = "SetLocked";break; + case "setlocked" : out = "SetLocked";break; + case "canclose" : out = "SetCanClose";break; + case "setcanclose" : out = "SetCanClose";break; + case "canlock" : out = "SetCanLock";break; + case "setcanlock" : out = "SetCanLock";break; + case "key" : out = "SetKey";break; + case "setkey" : out = "SetKey";break; + case "recurse" : out = "SetMaxRecurse";break; + case "maxrecurse" : out = "SetMaxRecurse";break; + case "setmaxrecurse" : out = "SetMaxRecurse";break; + case "sitters" : out = "SetMaxSitters";break; + case "maxsitters" : out = "SetMaxSitters";break; + case "setmaxsitters" : out = "SetMaxSitters";break; + case "liers" : out = "SetMaxLiers";break; + case "maxliers" : out = "SetMaxLiers";break; + case "setmaxliers" : out = "SetMaxLiers";break; + case "item" : out = "SetItems";setmap = 1;break; + case "setitem" : out = "SetItems";setmap = 1;break; + case "items" : out = "SetItems";setmap = 1;break; + case "setitems" : out = "SetItems";setmap = 1;break; + case "inventory" : out = "SetInventory";setmap = 1;break; + case "inv" : out = "SetInventory";setmap = 1;break; + case "setinv" : out = "SetInventory";setmap = 1;break; + case "setinventory" : out = "SetInventory";setmap = 1;break; + case "smell" : out = "SetSmell";setmap = 1;break; + case "setsmell" : out = "SetSmell";setmap = 1;break; + case "listen" : out = "SetListen";setmap = 1;break; + case "setlisten" : out = "SetListen";setmap = 1;break; + case "enter" : out = "SetEnters";setmap = 1;break; + case "enters" : out = "SetEnters";setmap = 1;break; + case "setenters" : out = "SetEnters";setmap = 1;break; + case "setenter" : out = "SetEnters";setmap = 1;break; + case "exit" : out = "SetExits";setmap = 1;break; + case "exits" : out = "SetExits";setmap = 1;break; + case "setexits" : out = "SetExits";setmap = 1;break; + case "setexit" : out = "SetExits";setmap = 1;break; + case "setproperty" : out = "SetProperties";break; + case "property" : out = "SetProperties";break; + case "setproperties" : out = "SetProperties";break; + case "properties" : out = "SetProperties";break; + case "props" : out = "SetProperties";break; + case "setprops" : out = "SetProperties";break; + case "setskill" : out = "SetSkills";break; + case "skill" : out = "SetSkills";break; + case "skills" : out = "SetSkills";break; + case "setskills" : out = "SetSkills";break; + case "setstats" : out = "SetStats";break; + case "stats" : out = "SetStats";break; + case "stat" : out = "SetStats";break; + case "setstat" : out = "SetStats";break; + case "value" : out = "SetBaseCost";break; + case "setvalue" : out = "SetBaseCost";break; + case "val" : out = "SetBaseCost";break; + case "setval" : out = "SetBaseCost";break; + case "cost" : out = "SetBaseCost";break; + case "setcost" : out = "SetBaseCost";break; + case "basecost" : out = "SetBaseCost";break; + case "setbasecost" : out = "SetBaseCost";break; + case "setcurrency" : out = "SetCurrency";break; + case "currency" : out = "SetCurrency";break; + case "setcurr" : out = "SetCurrency";break; + case "curr" : out = "SetCurrency";break; + case "setmoney" : out = "SetMoney";break; + case "money" : out = "SetMoney";break; + case "setnocondition" : out = "SetNoCondition";break; + case "nocondition" : out = "SetNoCondition";break; + case "mealtype" : out = "SetMealType";break; + case "setmealtype" : out = "SetMealType";break; + case "strength" : out = "SetStrength";break; + case "setstrength" : out = "SetStrength";break; + case "setmealstrength" : out = "SetStrength";break; + case "mealstrength" : out = "SetStrength";break; + case "vendor" : out = "SetVendorType";break; + case "setvendor" : out = "SetVendorType";break; + case "setvendortype" : out = "SetVendorType";break; + case "vendortype" : out = "SetVendorType";break; + case "settitle" : out = "SetTitle";break; + case "title" : out = "SetTitle";break; + case "source" : out = "SetSource";break; + case "setsource" : out = "SetSource";break; + case "melee" : out = "SetMelee";break; + case "setmelee" : out = "SetMelee";break; + } + + if(!out){ + switch(mode){ + case "position" : out = "SetPosition";break; + case "setposition" : out = "SetPosition";break; + case "autostand" : out = "SetAutoStand";break; + case "setautostand" : out = "SetAutoStand";break; + case "damagepoints" : out = "SetDamagePoints";break; + case "setdamagepoints" : out = "SetDamagePoints";break; + case "wanderspeed" : out = "SetWanderSpeed";break; + case "setwanderspeed" : out = "SetWanderSpeed";break; + case "encounter" : out = "SetEncounter";break; + case "setencounter" : out = "SetEncounter";break; + case "sethostile" : out = "SetEncounter";break; + case "hostile" : out = "SetEncounter";break; + case "aggressive" : out = "SetEncounter";break; + case "setaggressive" : out = "SetEncounter";break; + case "morality" : out = "SetMorality";break; + case "setmorality" : out = "SetMorality";break; + case "setheartbeat" : out = "SetHeartBeat";break; + case "heartbeat" : out = "SetHeartBeat";break; + case "include" : out = "include";break; + case "inherit" : out = "inherit";break; + case "load" : out = "SetPermitLoad";break; + case "permitload" : out = "SetPermitLoad";break; + case "setpermitload" : out = "SetPermitLoad";break; + case "modify" : if(value && intp(value)) value = bool_reverse(value);out = "SetNoModify";break; + case "setmodify" : if(value && intp(value)) value = bool_reverse(value); out = "SetNoModify";break; + case "setnomodify" : out = "SetNoModify";break; + case "nomodify" : out = "SetNoModify";break; + case "open" : if(value && intp(value)) value = bool_reverse(value);out = "SetClosed";break; + case "setopen" : if(value && intp(value)) value = bool_reverse(value);out = "SetClosed";break; + case "sleep" : out = "SetSleeping";break; + case "setsleep" : out = "SetSleeping";break; + case "sleeping" : out = "SetSleeping";break; + case "setsleeping" : out = "SetSleeping";break; + case "disable" : out = "SetDisableChance";break; + case "disablechance" : out = "SetDisableChance";break; + case "setdisable" : out = "SetDisableChance";break; + case "setdisablechance" : out = "SetDisableChance";break; + case "noclean" : out = "SetNoClean";break; + case "setnoclean" : out = "SetNoClean";break; + case "bodycomp" : out = "SetBodyComposition";break; + case "bodycomposition" : out = "SetBodyComposition";break; + case "setbodycomposition" : out = "SetBodyComposition";break; + case "setpacifist" : out = "SetPacifist";break; + case "pacifist" : out = "SetPacifist";break; + case "unique" : out = "SetUnique";break; + case "setunique" : out = "SetUnique";break; + case "setwimpy" : out = "SetWimpy";break; + case "wimpy" : out = "SetWimpy";break; + case "wimpycommand" : out = "SetWimpyCommand";break; + case "setwimpycommand" : out = "SetWimpyCommand";break; + case "setcanbite" : out = "SetCanBite";break; + case "canbite" : out = "SetCanBite";break; + case "localcurrency" : out = "SetLocalCurrency";break; + case "setlocalcurrency" : out = "SetLocalCurrency";break; + case "menuitems" : out = "SetMenuItems";setmap = 1;break; + case "setmenuitems" : out = "SetMenuItems";setmap = 1;break; + case "menu" : out = "SetMenuItems";setmap = 1;break; + case "maxitems" : out = "SetMaxItems";break; + case "setmaxitems" : out = "SetMaxItems";break; + case "setstorageroom" : out = "SetStorageRoom";break; + case "storageroom" : out = "SetStorageRoom";break; + case "defaultread" : out = "SetDefaultRead";break; + case "setdefaultread" : out = "SetDefaultRead";break; + case "setread" : out = "SetRead";setmap = 1;break; + case "read" : out = "SetRead";setmap = 1;break; + case "language" : out = "SetLanguage";break; + case "lang" : out = "SetLanguage";break; + case "setlang" : out = "SetLanguage";break; + case "setlanguage" : out = "SetLanguage";break; + case "setspellbook" : out = "SetSpellBook";break; + case "spellbook" : out = "SetSpellBook";break; + case "spells" : out = "SetSpellBook";break; + case "addtrainingskills" : out = "AddTrainingSkills";break; + case "settrainingskills" : out = "AddTrainingSkills";break; + case "trainingskills" : out = "AddTrainingSkills";break; + case "training" : out = "AddTrainingSkills";break; + case "nospells" : out = "SetNoSpells";break; + case "setnospells" : out = "SetNoSpells";break; + case "defaultexits" : out = "SetDefaultExits";break; + case "setdefaultexits" : out = "SetDefaultExits";break; + case "setnoobviousexits" : out = "SetNoObviousExits";break; + case "noobviousexits" : out = "SetNoObviousExits";break; + case "xp" : out = "SetCustomXP";break; + case "setxp" : out = "SetCustomXP";break; + case "setcustomxp" : out = "SetCustomXP";break; + case "customxp" : out = "SetCustomXP";break; + case "nativelanguage" : out = "SetNativeLanguage";break; + case "setnativelanguage" : out = "SetNativeLanguage";break; + case "heartbeat" : out = "set_heart_beat";break; + case "setheartbeat" : out = "set_heart_beat";break; + case "set_heart_beat" : out = "set_heart_beat";break; + case "heart_beat" : out = "set_heart_beat";break; + case "hiddendoor" : out = "SetHiddenDoor";break; + case "sethiddendoor" : out = "SetHiddenDoor";break; + case "opacity" : out = "SetOpacity";break; + case "setopacity" : out = "SetOpacity";break; + default : out = mode; + } + } + if(!value) value = 0; + + if(value == "delete") { + eventDelete(ob, out); + unguarded( (: rm(global2) :) ); + return 1; + } + + if(out == "SetExits") { + write("SetExits is a special setting, which isn't modified like others."); + write("To make an exit to a room, or to create a new room, type:\n"); + write("create room DIRECTION FILE"); + write("For example : create room east test_room1"); + write("To get rid of an exit, it's: delete exit DIRECTION"); + write("For example: delete exit east"); + return 1; + } + + if(out == "SetEnters") { + write("SetExits is a special setting, which isn't modified like others."); + write("To make an Enter, first identify an item that already exists "); + write("in SetItems. For example, if SetItems contains a pub:\n"); + write("create enter pub test_pub1\n"); + write("To get rid of that enter: delete enter pub"); + write("Please note that if the \"thing to be entered\" isn't already "); + write("in SetItems, things won't work right."); + return 1; + } + + if(out == "SetInventory"){ + write("SetInventory is a special setting, which isn't modified like others."); + write("To add something to something else's inventory, the \"thing "); + write("to be added\" has to be in your environment, or carried by you."); + write("So if you want to add a chair to your sample room:\n"); + write("home"); + write("go east"); + write("cd /domains/town/obj"); + write("clone chair"); + write("add chair to room"); + write("1\n"); + write("If you want to add a sword to your fighter: \n"); + write("clone sword"); + write("add sword to fighter"); + write("wield sword\n"); + write("To remove items from a thing's permanent inventory:"); + write("delete chair"); + write("delete sword from fighter"); + return 1; + } + + if(out == "include" || out == "inherit"){ + this_object()->eventModHeader(ob, out,value); + return 1; + } + + + if(grepp(inheritance,"room") && member_array(out,room_arr) != -1) invalid = 0; + if(grepp(inheritance,"barkeep") && member_array(out,barkeep_arr) != -1) invalid = 0; + if(grepp(inheritance,"vendor") && member_array(out,vendor_arr) != -1) invalid = 0; + if(grepp(inheritance,"trainer") && member_array(out,trainer_arr) != -1) invalid = 0; + if(grepp(inheritance,"npc") && member_array(out,npc_arr) != -1) invalid = 0; + if(grepp(inheritance,"weapon") && member_array(out,weapon_arr) != -1) invalid = 0; + if(grepp(inheritance,"armor") && member_array(out,armor_arr) != -1) invalid = 0; + if(grepp(inheritance,"storage") && member_array(out,storage_arr) != -1) invalid = 0; + if(grepp(inheritance,"chair") && member_array(out,chair_arr) != -1) invalid = 0; + if(grepp(inheritance,"bed") && member_array(out,bed_arr) != -1) invalid = 0; + if(grepp(inheritance,"table") && member_array(out,table_arr) != -1) invalid = 0; + if(grepp(inheritance,"meal") && member_array(out,meal_arr) != -1) invalid = 0; + if(grepp(inheritance,"door") && member_array(out,door_arr) != -1) invalid = 0; + if(grepp(inheritance,"book") && member_array(out,book_arr) != -1) invalid = 0; + if(grepp(inheritance,"worn_storage") && member_array(out,worn_storage_arr) != -1) invalid = 0; + else if(grepp(inheritance,"item") && member_array(out,item_arr) != -1) invalid = 0; + + if(invalid) { + write("Invalid Property."); + return 1; + } + if(out == "SetProtection"){ + this_object()->eventStartArmorQuestions(value,ob); + return 1; + } + + if(out == "SetBaseCost"){ + this_object()->eventModCost(ob, metamode, value); + return 1; + } + + if(member_array(out,special_map_array) != -1) { + this_object()->eventSpecialMapHandler(ob,out,metamode,value); + return 1; + } + + if(out == "SetMoney" || out == "SetCurrency"){ + this_object()->eventModMoney(ob, metamode, value); + return 1; + } + + if(setmap == 1) { + temp_map = QueryMap(out, ob); + temp_map = this_object()->eventStartMappingQuestions(temp_map, ob, tmpfile, out); + return 1; + } + + array_props = ({"AddTrainingSkills", "SetId","SetAdjectives","SetRestrictLimbs"}); + if(member_array(out,array_props) != -1){ + this_object()->eventStartGenericQuestions(ob, tmpfile, ({value}), out); + return 1; + } + + if(grepp(inheritance,"door") && out != "SetHiddenDoor" ){ + string cote = this_object()->eventEvaluateDoorSide(ob); + if(cote) this_object()->eventProcessDoor(ob, out, value, cote); + else this_object()->eventProcessDoor(ob, out, value); + return 1; + } + + else { + //if(!value || value == "" ) { + // write("This setting requires a value."); + // return 1; + // } + switch(out){ + case "SetLong" : p_array = ({"SetShort","SetAmbientLight","SetDayLight","SetNightLight","create()","create ()","create"}); break; + case "SetDayLong" : p_array = ({"SetShort","SetAmbientLight","SetDayLight","SetNightLight","SetNightLong","SetLong","create()","create ()","create"}); break; + case "SetNightLong" : p_array = ({"SetShort","SetAmbientLight","SetDayLight","SetNightLight","SetDayLong","SetLong","create()","create ()","create"}); break; + case "SetShort" : p_array = ({"SetAmbientLight","SetDayLight","SetNightLight","create()","create ()","create"}); break; + case "SetHealthPoints" : p_array = ({"SetInventory","SetMaxHealhPoints","SetClass","SetRace","SetLong"});break; + case "SetMaxHealthPoints" : p_array = ({"SetInventory","SetHealhPoints","SetClass","SetRace","SetLong"});break; + case "SetNativeLanguage" : p_array = ({"SetRace"});break; + case "SetSmell" : p_array = ({"SetItems","SetInventory","SetListen","SetLong","SetDayLong","SetNightLong","SetShort"});break; + case "SetListen" : p_array = ({"SetItems","SetInventory","SetSmell","SetLong","SetDayLong","SetNightLong","SetShort"});break; + case "SetItems" : p_array = ({"SetAmbientLight","SetDayLight","SetNightLight","create()","create ()","SetShort","SetLong","SetDayLong","SetNightLong"});break; + case "SetAmbientLight" : p_array = ({"SetDayLight","SetNightLight","create()","create ()","SetShort","SetLong","SetDayLong","SetNightLong"});break; + case "SetDayLight" : p_array = ({"SetAmbientLight","SetNightLight","create()","create ()","SetShort","SetLong","SetDayLong","SetNightLong"});break; + case "SetNightLight" : p_array = ({"SetAmbientLight","SetDayLight","create()","create ()","SetShort","SetLong","SetDayLong","SetNightLong"});break; + case "SetHiddenDoor" : p_array = ({ "SetClosed", "SetLocked" }); break; + default : p_array = ({"SetItems","SetLong","SetDayLong","SetNightLong","SetShort"}); + } + + this_object()->eventModString(tmpfile, out, value, p_array); + } + mixed_tmp = reload(tmpfile); + if(!mixed_tmp || !intp(mixed_tmp)) { + write("This would screw up your file. Aborting modification."); + return 1; + } + this_object()->eventGeneralStuff(tmpfile); + global1 = tmpfile; + global2 = filename; + unguarded( (: cp(global1,global2) :) ); + reload(ob); + + rm(tmpfile); + return MODULES_CREATE+" Done."; + } + + int eventDelete(object ob, string value){ + string tmpfile, filename; + mixed mixed_tmp; + + filename = base_name(ob)+".c"; + tmpfile = generate_tmp(ob); + + + //tc("stack: "+get_stack()); + if(!check_privs(this_player(),filename)){ + + write("You do not appear to have access to this file. Modification aborted."); + return 1; + } + + if(!check_privs(this_player(),tmpfile)){ + write("You do not appear to have access to this file. Modification aborted."); + return 1; + } + + global1 = filename; + global2 = tmpfile; + unguarded( (: cp(global1,global2) :) ); + mixed_tmp = reload(tmpfile); + if(!mixed_tmp || !intp(mixed_tmp)) { + write("Target file is screwed up. Aborting delete."); + return 1; + } + globalvalue = value; + unguarded( (: globaltmp = remove_matching_line(read_file(global2),globalvalue,1) :) ); + unguarded( (: write_file(global2,globaltmp,1) :) ); + mixed_tmp = reload(tmpfile); + if(!mixed_tmp || !intp(mixed_tmp)) { + write("This change would screw up your file. Aborting delete."); + return 1; + } + else unguarded( (: cp(global2, global1) :) ); + reload(ob); + unguarded( (: rm(global2) :) ); + write("Setting deleted."); + return 1; + } + + int eventResumeArrayMod(object target, string tmpfile, string *NewArr, string func){ + string filename, ret, array_string; + string *p_array; + mixed mx; + filename = base_name(target)+".c"; + + //tc("stack: "+get_stack()); + if(!check_privs(this_player(),filename)){ + write("You do not appear to have access to this file. Modification aborted."); + return 1; + } + global2 = tmpfile; + global1 = filename; + unguarded( (: cp(global1, global2) :) ); + array_string = func + "( ({"; + foreach(string foo in NewArr){ + array_string += "\""+foo+"\", "; + } + array_string = truncate(array_string, 2); + array_string += "}) );"; + switch(func){ + case "SetId" : p_array = ({"SetName","SetKeyName","create()","create ()","SetAdjectives"});break; + case "SetAdjectives" : p_array = ({"SetName","SetKeyName","create()","create ()","SetId"});break; + case "SetRestrictLimbs" : p_array = ({ "SetArmorType","SetDamagePoints","SetMass"});break; + default : p_array = ({"SetLong","SetShort","SetDayLong","SetNightLong"}); + } + ret = remove_matching_line(read_file(tmpfile),func); + //tc("ret: "+ret,"red"); + ret = this_object()->eventAppend(ret,p_array,"\n"+array_string+"\n"); + //tc("ret: "+ret,"green"); + globaltmp = ret; + unguarded( (: write_file(global2,globaltmp,1) :) ); + this_object()->eventGeneralStuff(tmpfile); + mx = reload(tmpfile); + if(!mx || !intp(mx)){ + write("This change would screw up the object. Aborting."); + return 1; + } + global1 = tmpfile; + global2 = filename; + unguarded( (: cp(global1, global2) :) ); + reload(target); + write(func+" modification complete."); + unguarded( (: rm(global1) :) ); + return 1; + } + + int eventResumeMappingChange(object target, string tmpfile, mapping NewMap, string func){ + string map_string, filename, ret; + mixed mx; + string *p_array; + map_string = this_object()->eventStringifyMap(NewMap); + map_string = func+"("+map_string+");"; + filename = base_name(target)+".c"; + + //tc("stack: "+get_stack()); + + if(!check_privs(this_player(),filename)){ + write("You do not appear to have access to this file. Modification aborted."); + return 1; + } + + global2 = tmpfile; + global1 = filename; + unguarded( (: cp(global1, global2) :) ); + + ret = remove_matching_line(read_file(tmpfile),func); + switch(func){ + case "SetHealthPoints" : p_array = ({"SetInventory","SetMaxHealhPoints","SetClass","SetRace","SetLong"});break; + case "SetMaxHealthPoints" : p_array = ({"SetClass","SetRace","SetHealthPoints","SetLong"});break; + case "SetSmell" : p_array = ({"SetItems","SetInventory","SetListen","SetLong","SetDayLong","SetNightLong","SetShort"});break; + case "SetListen" : p_array = ({"SetItems","SetInventory","SetSmell","SetLong","SetDayLong","SetNightLong","SetShort"});break; + default : p_array = ({"SetItems","SetLong","SetDayLong","SetNightLong","SetShort"}); + } + ret = this_object()->eventAppend(ret,p_array,"\n"+map_string+"\n"); + global1 = tmpfile; + global2 = ret; + unguarded( (: write_file(global1,global2,1) :) ); + mx = reload(tmpfile); + if(!mx || !intp(mx)){ + write("This change would screw up the object. Aborting."); + return 1; + } + this_object()->eventGeneralStuff(tmpfile); + global1 = tmpfile; + global2 = filename; + unguarded( (: cp(global1, global2) :) ); + if(target) reload(target); + write(func+" modification complete."); + unguarded( (: rm(global1) :) ); + return 1; + } + + int eventAddSettings(object ob, string tmp, mapping NewMap, string func){ + string filename, new_lines; + //tc("stack: "+get_stack()); + filename = base_name(ob)+".c"; + + if(!check_privs(this_player(),filename)){ + write("You do not have sufficient privileges to perform this action."); + return 1; + } + global2 = filename; + unguarded( (: global1 = read_file(global2) :) ); + + global1 = remove_matching_line(global1, func , 1); + global2 = tmp; + new_lines = "\n"; + foreach(string key, mixed val in NewMap){ + //if(func != "SetSkill"){ + if(intp(val)) new_lines += func+"(\""+key+"\", "+val+");\n"; + else new_lines += func+"(\""+key+"\", \""+val+"\");\n"; + //} + //else { + // if(intp(val)) new_lines += func+"(\""+key+"\", 0, "+val+");\n"; + //else new_lines += func+"(\""+key+"\", 0, \""+val+"\");\n"; + //} + } + global1 = this_object()->eventAppend(global1,({func,"SetClass","SetRace","SetLevel","SetItems","SetInventory","SetLong", "SetClosed"}),new_lines); + unguarded( (: write_file(global2, global1,1) :) ); + this_object()->eventGeneralStuff(global2); + global1 = filename; + unguarded( (: cp(global2, global1) :) ); + unguarded( (: rm(global2) :) ); + reload(ob); + return 1; + } + diff -c -r --new-file ds1.1/lib/secure/modules/door.c ds2.0r27/lib/secure/modules/door.c *** ds1.1/lib/secure/modules/door.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/modules/door.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,273 ---- + #include <lib.h> + #include <modules.h> + #include <commands.h> + + string tmpfile, contents, globalstr, globalstr1, globalstr2, globalstr3; + string my_room_file, other_room_file, tmpfile; + string my_room_contents, other_room_contents; + string *global_array; + + varargs int eventReceiveId(object door, string *id, string cote){ + string ret_id = implode(id,":"); + if(!cote) cote = this_object()->eventEvaluateDoorSide(door); + this_object()->eventProcessDoor(door, "SetId", ret_id, cote); + return 1; + } + + mapping GetDoorKeys(string str){ + string dir, junk1, junk2; + string *lines; + mapping KeyMap = ([]); + + globalstr = str; + unguarded( (: global_array = this_object()->eventReadLines(read_file(globalstr)) :) ); + lines = global_array; + if(!sizeof(lines)) return ([]); + foreach(string line in lines){ + if(grepp(line, "SetKeys")){ + sscanf(line,"%sKeys(%s,%s",junk1, dir, junk2); + dir = this_object()->eventCleanString(dir); + KeyMap[dir] = line; + } + } + + return copy(KeyMap); + } + + varargs mixed eventChangeDoor(mixed door, string property, mixed value, string cote){ + object porte; + string *sides, *props; + string map_string = ""; + int lockable; + mapping KeyMap = this_object()->GetDoorKeys(door); + + if(stringp(door)) porte = load_object(door); + else if(objectp(door)) porte = door; + + if(!porte) return 0; + + sides = porte->GetSides(); + + foreach(string side in sides){ + mapping TmpMap1 = ([]); + TmpMap1 = porte->GetSide(side); + props = keys(TmpMap1); + + switch(property){ + case "SetId" : property = "id";break; + case "SetLong" : property = "long";break; + case "SetShort" : property = "short";break; + case "SetCanLock" : property = "lockable";break; + case "SetKey" : property = "key";break; + } + if(member_array(property, props) != -1 ){ + if(!cote) TmpMap1[property] = value; + else if(cote && cote == side && property == "id") + TmpMap1[property] = explode(value,":"); + else if(cote && cote == side) TmpMap1[property] = value; + } + + if(!TmpMap1["lockable"]) lockable = 0; + else lockable = TmpMap1["lockable"]; + map_string += "SetSide(\""+side+"\", ([\"id\" : "+identify(TmpMap1["id"])+",\n"; + map_string += "\"short\" : \""+TmpMap1["short"]+"\",\n"; + map_string += "\"long\" : \""+TmpMap1["long"]+"\",\n"; + map_string +="\"lockable\" : "+lockable+" ]) );\n"; + if(property == "key") { + if(!cote || cote == side) map_string += "SetKeys(\""+side+"\", ({\""+value+"\"}) );\n\n"; + else if(KeyMap[side]) map_string += KeyMap[side] + "\n\n"; + } + if(property != "key" && KeyMap[side]){ + map_string += KeyMap[side] + "\n\n"; + } + } + + return map_string; + } + + varargs int eventProcessDoor(mixed door, string property, mixed value, string cote){ + object porte; + int closed, locked; + string other_room; + + if(!door || ! property ){ + write("Wrong number of arguments to evenProcessDoor"); + return 0; + } + + if(!value) value = 0; + + if(objectp(door)) door = base_name(door); + if(last(door,2) != ".c") door += ".c"; + if(!file_exists(door)){ + write("No such door file."); + return 0; + } + + porte = load_object(door); + tmpfile = generate_tmp(porte); + + if(property == "closed" || property == "SetClosed") closed = value; + else closed = this_object()->eventReadValue(door, "SetClosed"); + if(property == "locked" || property == "SetLocked") locked = value; + else locked = this_object()->eventReadValue(door, "SetLocked");; + + contents = "#include <lib.h>\n\n"; + contents += "inherit LIB_DOOR;\n\n"; + contents += "static void create() {\n"; + contents += "door::create();\n\n"; + if(cote) contents += this_object()->eventChangeDoor(door, property, value, cote)+"\n"; + else contents += this_object()->eventChangeDoor(door, property, value)+"\n"; + contents += "SetClosed("+closed+");\n"; + contents += "SetLocked("+locked+");\n"; + contents += "}\n"; + unguarded( (: write_file(tmpfile,contents,1) :) ); + this_object()->eventGeneralStuff(tmpfile); + globalstr2 = door; + unguarded( (: cp(tmpfile, globalstr2) :) ); + unguarded( (: rm(tmpfile) :) ); + reload(door); + reload(environment(this_player())); + other_room = this_object()->GetOtherRoom(door); + if(other_room) reload(other_room); + return 1; + } + + int eventDeleteDoor(string door){ + string this_room, other_room; + this_room = base_name(environment(this_player()))+".c"; + other_room = this_object()->GetOtherRoom(door)+".c"; + foreach( string room in ({this_room, other_room}) ){ + globalstr = room; + unguarded( (: globalstr2 = read_file(globalstr) :) ); + globalstr2 = remove_matching_line(globalstr2, door); + globalstr3 = generate_tmp(load_object(door)); + unguarded( (: write_file(globalstr3, globalstr2, 1) :) ); + unguarded( (: cp(globalstr3, globalstr) :) ); + unguarded( (: rm(globalstr3) :) ); + reload(room); + } + return 1; + } + + string GetOtherRoom(string door){ + string other_room, dir_str; + foreach(string dir in environment(this_player())->GetDoors()){ + if(grepp(environment(this_player())->GetDoor(dir), door)) dir_str = + dir; + } + other_room = environment(this_player())->GetExit(dir_str); + if(other_room) return other_room; + else return ""; + } + + string eventEvaluateDoorSide(object door){ + string *door_array, *door_sides; + string dir_str, ret_str; + + door_array = environment(this_player())->GetDoors(); + door_sides = door->GetSides(); + + foreach(string dir in door_array){ + if(load_object(environment(this_player())->GetDoor(dir)) == door) dir_str = dir; + } + + if(!dir_str) return ""; + + foreach(string side in door_sides){ + if(side == dir_str) ret_str = side; + } + + return ret_str; + } + + int eventCreateDoor(string dir, string filename){ + object my_room, other_room; + object *everyone_here, *everyone_there; + string *temp_array = ({}); + string contents, rep_str, opp_dir, new_line; + + tmpfile = generate_tmp(filename); + + my_room = environment(this_player()); + my_room_file = base_name(my_room)+".c"; + other_room_file = my_room->GetExit(dir)+".c"; + if(!file_exists(other_room_file)) { + tell_room(my_room,"The new door fades away and disapears."); + return 0; + } + unguarded( (: my_room_contents = read_file(my_room_file) :) ); + unguarded( (: other_room_contents = read_file(other_room_file) :) ); + other_room = load_object(other_room_file); + everyone_here = get_livings(my_room,1); + everyone_there = get_livings(other_room,1); + + contents = read_file("/obj/door.c"); + + if(grepp(contents,"DIR_X")) rep_str = "X"; + else rep_str = "Y"; + + contents = replace_string(contents, "DIR_"+rep_str, dir); + contents = replace_string(contents, rep_str+"_SIDE", dir); + + opp_dir = opposite_dir(dir); + if(opp_dir && opp_dir != "" && grepp(contents,"DIR_Y")){ + rep_str = "Y"; + contents = replace_string(contents, "DIR_"+rep_str, opp_dir); + contents = replace_string(contents, rep_str+"_SIDE", opp_dir); + } + + temp_array = explode(my_room_contents,"\n"); + foreach(string line in temp_array) { + if(grepp(line,"SetDoor")){ + if(grepp(line,truncate(filename,2)) || grepp(line,"\""+dir+"\"")){ + my_room_contents = remove_matching_line(my_room_contents, line); + } + } + } + + new_line = "SetDoor(\""+dir+"\", \""+filename+"\");"; + my_room_contents = this_object()->eventAppendLast(my_room_contents,"create", "\n"+new_line+"\n"); + + temp_array = explode(other_room_contents,"\n"); + foreach(string line in temp_array) { + if(grepp(line,"SetDoor")){ + if(grepp(line,truncate(filename,2)) || grepp(line,"\""+opp_dir+"\"")){ + other_room_contents = remove_matching_line(other_room_contents, line); + } + } + } + + new_line = "SetDoor(\""+opp_dir+"\", \""+filename+"\");"; + other_room_contents = this_object()->eventAppendLast(other_room_contents,"create","\n"+new_line+"\n"); + + globalstr2 = filename; + globalstr3 = contents; + + unguarded( (: write_file( tmpfile, globalstr3,1 ) :) ); + this_object()->eventGeneralStuff(tmpfile); + unguarded( (: cp(tmpfile, globalstr2) :) ); + + globalstr3 = my_room_contents; + unguarded( (: write_file( tmpfile, globalstr3,1 ) :) ); + this_object()->eventGeneralStuff(tmpfile); + unguarded( (: cp(tmpfile, my_room_file) :) ); + + globalstr3 = other_room_contents; + unguarded( (: write_file( tmpfile, globalstr3,1 ) :) ); + this_object()->eventGeneralStuff(tmpfile); + unguarded( (: cp(tmpfile, other_room_file) :) ); + + reload(filename); + reload(my_room_file); + reload(other_room_file); + + unguarded( (: rm(tmpfile) :) ); + + return 1; + + + } + + + diff -c -r --new-file ds1.1/lib/secure/modules/file.c ds2.0r27/lib/secure/modules/file.c *** ds1.1/lib/secure/modules/file.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/modules/file.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,460 ---- + #include <lib.h> + #include <modules.h> + + string array eventReadFunctions(string source); + int eventModString(string file, string param, string replace); + + string first_arg, globalstr, globalstr2, globalstr3; + string *global_array; + mixed globalmixed; + + string eventAppendLast(string file, string fun, string addendum){ + int done; + string *source; + string junk1, junk2, junk3, junk4, junk5; + string ret = ""; + globalstr = file; + + if(unguarded( (: file_exists(globalstr):) ) && !check_privs(this_player(),globalstr)){ + write("You do not appear to have access to this file. Modification aborted."); + return ""; + } + if(unguarded( (: file_exists(globalstr):) )) { + file = unguarded( (: read_file(globalstr) :) ); + } + + unguarded( (: global_array = this_object()->eventReadFunctions(globalstr) :) ); + source = global_array; + foreach(string func in source){ + if(sscanf(func,"%s"+fun+"%s(%s)%s\n%s",junk1, junk2, junk3, junk4, junk5) == 5 && !done){ + func = reverse_string(func); + func = replace_string(func,"}","SIHT_ECALPER",1); + func = reverse_string(func); + func = replace_string(func,"REPLACE_THIS",addendum+"\n}"); + done = 1; + } + ret += func + "\n"; + } + return ret; + } + + string eventAppend(string file, string *params, string addendum){ + int found, count, primary_line, secondary_line; + string *file_arr; + string *top_array; + string *bottom_array; + string search_str, new_string; + + globalstr = file; + + if(unguarded( (: file_exists(globalstr):) ) && !check_privs(this_player(),globalstr)){ + write("You do not appear to have access to this file. Modification aborted."); + return ""; + } + if(unguarded( (: file_exists(globalstr):) )) { + file = unguarded( (: read_file(globalstr) :) ); + } + foreach(string param in params){ + if(!found && param && sizeof(param) && param != "" && stringp(param)){ + if(strsrch(file,param) != -1){ + search_str = param; + found = 1; + } + } + } + + if(!found || !search_str || search_str == ""){ + + return file; + } + + file_arr = explode(file,"\n"); + + foreach(string line in file_arr){ + if(line && line != "" && strsrch(line, search_str) != -1) { + primary_line = member_array(line, file_arr); + count = primary_line; + } + if(primary_line){ + count++; + if(last(line,1,1) == ";" ) { + secondary_line = count; + } + } + if(secondary_line) break; + } + + top_array = file_arr[0..secondary_line-1]; + bottom_array = file_arr[secondary_line..sizeof(file_arr)-1]; + + new_string = implode(top_array,"\n"); + new_string += addendum; + new_string += implode(bottom_array,"\n"); + + return new_string; + } + + varargs mapping eventReadMapping(string file, string *params, int destructive){ + int numero, count, found, primary_line, secondary_line; + string *file_arr; + string *mapping_array; + string filename, new_string, search_str, mapping_string, junk1, junk2; + mapping new_mapping = ([]); + mixed mixed_var; + + if(file_exists(file) && !check_privs(this_player(),file)){ + write("You do not appear to have access to this file. Modification aborted."); + return ([]); + } + + if(file_exists(file)) { + first_arg = file; + file = read_file(file); + } + + foreach(string param in params){ + if(!found){ + if(strsrch(file,param) != -1) + search_str = param; + found = 1; + } + } + + if(!found){ + return ([]); + } + + file_arr = explode(file,"\n"); + + foreach(string line in file_arr){ + if(strsrch(line, search_str) != -1) { + primary_line = member_array(line, file_arr); + count = primary_line - 1; + } + if(primary_line){ + count++; + if(last(line,1,1 ) == ";") { + secondary_line = count; + } + } + if(secondary_line) break; + } + + + if(primary_line != secondary_line ) + mapping_array = file_arr[primary_line..secondary_line]; + else mapping_array = ({ file_arr[primary_line] }); + + mapping_array = file_arr[primary_line..secondary_line]; + + new_string = implode(mapping_array," "); + if(!new_string) write("Problem here."); + if(sscanf(new_string,"%s([%s])%s",junk1,mapping_string, junk2) < 3){ + write("It's a null mapping"); + return ([]); + } + mapping_array = explode(mapping_string,","); + foreach(string foo in mapping_array){ + string *sub_array; + if(!foo) break; + if(strsrch(foo,":") == -1) break; + sub_array = explode(foo,":"); + if(sub_array[0] && sub_array[1]) { + sub_array[0] = trim(replace_string(replace_string(sub_array[0]," \t",""),"\"","")); + sub_array[1] = trim(replace_string(replace_string(sub_array[1]," \t",""),"\"","")); + if(sscanf(sub_array[1],"%d",numero) == 1) mixed_var = numero; + else mixed_var = sub_array[1]; + new_mapping[sub_array[0]] = mixed_var; + } + } + + if(!first_arg) first_arg = "NULL"; + + found = 0; + + globalstr3 = search_str; + unguarded( (: globalstr = remove_matching_line(read_file(first_arg),globalstr3,1) :) ); + globalstr2 = generate_tmp(file); + //write("globalstr2: "+globalstr2); + if(destructive) { + //write("first arg: "+first_arg); + //unguarded( (: write_file("/realms/"+this_player()->GetKeyName()+"/tmp/mapping_destructive."+this_player()->GetKeyName(),globalstr,1) :) ); + //unguarded( (: cp("/realms/"+this_player()->GetKeyName()+"/tmp/mapping_destructive."+this_player()->GetKeyName(),first_arg) :) ); + unguarded( (: write_file(globalstr2, globalstr,1) :) ); + unguarded( (: cp(globalstr2, first_arg) :) ); + } + if(sizeof(new_mapping)) return copy(new_mapping); + else return ([]); + } + + string array eventReadLines(string source){ + if(file_exists(source) && !check_privs(this_player(),source)){ + write("You do not appear to have access to this file. Modification aborted."); + return ({}); + } + globalstr = source; + unguarded( (: global_array = explode(globalstr,"\n") :) ); + return global_array; + } + + string array eventReadFunctions(string source){ + string tmpsource, headers; + string *ret, *types, *primitives, *beginners, *fun_arr; + int i, element, infunc; + mixed line; + element = -1; + headers = ""; + line = ""; + fun_arr = allocate(999); + primitives = ({"private","static","nomask","varargs"}); + types = ({"int","void","buffer","mapping","mixed","string","array","float"}); + beginners = primitives + types; + + if(!file_exists(source)) { + globalstr2 = source; + globalstr = generate_tmp(this_player()); + unguarded( (: write_file(globalstr, globalstr2,1) :) ); + source = globalstr; + } + + tmpsource = generate_tmp(source); + + if(file_exists(source) && !check_privs(this_player(),source)){ + write("You do not appear to have access to this file. Modification aborted."); + return ({}); + } + + if(file_exists(tmpsource) && !check_privs(this_player(),tmpsource)){ + write("You do not appear to have access to this file. Modification aborted."); + return ({}); + } + globalstr3 = tmpsource; + globalstr = source; + unguarded( (: cp(globalstr, globalstr3) :) ); + if(!file_exists(source)) return ({"Source read failed."}); + if(!file_exists(tmpsource)) return ({"Read failed."}); + + + for(i=1; line; i++){ + if(!line = read_file(source, i, 1)) break; + if(!line || !stringp(line) || line == "") break; + + + if(line && !infunc && !starts_with_arr(line, beginners)) headers += line; + + + + else if(line && !infunc && starts_with_arr(line, beginners) ){ + + element++; + infunc = 1; + if(!sizeof(fun_arr[element])) fun_arr[element] = line; + else fun_arr[element] += line; + } + + else if(line && infunc && !starts_with_arr(line, beginners) ){ + + fun_arr[element] += line; + } + + else if(line && infunc && starts_with_arr(line, beginners) && !grepp(line,"(")){ + fun_arr[element] += line; + } + + + else if(line && infunc && starts_with_arr(line, beginners) && grepp(line,"(")){ + infunc = 0; + i--; + } + } + + ret = ({headers}); + foreach(string item in fun_arr){ + if(item && sizeof(item)) ret += ({newline_trim(item)}); + } + rm(tmpsource); + return ret; + } + + int eventAddInit(string file){ + string *contents, *temparray, *temparray2, *beginners; + string tmpfile; + int done, add, memnum; + + globalstr = tmpfile; + globalstr2 = file; + + //if(file == "/lib/std/dummy.c" || file == LIB_DUMMY || (load_object(file) && inherits(LIB_DUMMY, load_object(file))) ) return 0; + //if(file == "/lib/std/dummy.c" ) return 0; + + if(file_exists(file) && !check_privs(this_player(),file)){ + write("You do not appear to have access to this file. Modification aborted."); + return 1; + } + + tmpfile = generate_tmp(file); + temparray = ({}); + temparray2 = ({}); + contents = unguarded( (: eventReadFunctions(globalstr2) :) ); + beginners = ({"private","static","nomask","varargs"}); + beginners += ({"int","void","buffer","mapping","mixed","string","array","float"}); + + foreach(string func in contents){ + if(member_array(func,contents) != 0 && grepp(func,"void init")) memnum = member_array(func,contents); + } + + if(memnum && memnum != -1){ + if(!grepp(contents[memnum],"::init()")){ + temparray = explode(contents[memnum],"\n"); + foreach(string line in temparray){ + if(line && !starts_with_arr(line, beginners)) add = 1; + if(add && !done) { + temparray2 += ({"::init();"}); + temparray2 += ({line}); + done = 1; + } + else { + temparray2 += ({line}); + } + } + contents[memnum] = implode(temparray2,"\n"); + global_array = contents; + globalstr3 = tmpfile; + unguarded( (: write_file(globalstr3,implode(global_array,"\n"),1) :) ); + //write_file(tmpfile,implode(contents,"")); + } + + else { + //write("File already contains a working init function."); + return 2; + } + } + + else { + contents += ({ "void init(){\n::init();\n}" }); + global_array = contents; + globalstr3 = tmpfile; + unguarded( (: write_file(globalstr3,implode(global_array,"\n"),1) :) ); + } + globalstr = tmpfile; + globalstr2 = file; + done = unguarded( (: cp(globalstr, globalstr2) :) ); + unguarded( (: rm(globalstr) :) ); + return done; + } + + varargs int eventModString(string file, string param, mixed replace, string *params){ + string check_include, ret, tmpfile; + string *where_append; + if(file_exists(file) && !check_privs(this_player(),file)){ + write("You do not appear to have access to this file. Modification aborted."); + return 1; + } + if(!params) where_append = ({"SetLong","SetShort"}); + if(params && !sizeof(params)) where_append = ({"SetLong","SetShort"}); + else where_append = params; + + tmpfile = generate_tmp(file); + globalstr = file; + globalstr2 = tmpfile; + globalstr3 = param; + globalmixed = replace; + + if(stringp(replace)) { + if(globalstr3 == "SetArmorType" || globalstr3 == "SetMealType" || + globalstr3 == "SetPosition" || + globalstr3 == "SetVendorType" || globalstr3 == "SetDamageType"){ + replace = upper_case(replace); + if(globalstr3 == "SetArmorType") check_include = "/include/armor_types.h"; + if(globalstr3 == "SetVendorType") check_include = "/include/vendor_types.h"; + if(globalstr3 == "SetDamageType") check_include = "/include/damage_types.h"; + if(globalstr3 == "SetMealType") check_include = "/include/meal_types.h"; + if(globalstr3 == "SetPosition") check_include = "/include/position.h"; + if(globalstr3 == "SetVendorType" && !grepp(replace,"VT_")) replace = "VT_"+replace; + if(globalstr3 == "SetArmorType" && !grepp(replace,"A_")) replace = "A_"+replace; + if(globalstr3 == "SetMealType" && !grepp(replace,"MEAL_")) replace = "MEAL_"+replace; + if(globalstr3 == "SetPosition" && !grepp(replace,"POSITION_")) replace = "POSITION_"+replace; + if(!grepp(read_file(check_include),replace)) { + write("Invalid type. Please review "+check_include+" for valid types."); + return 1; + } + if(grepp(replace,"MEAL_ALCOHOL")) replace = "MEAL_DRINK | MEAL_ALCOHOL"; + if(grepp(replace,"MEAL_CAFFEINE")) replace = "MEAL_DRINK | MEAL_CAFFEINE"; + + globalmixed = replace; + } + else globalmixed = "\""+replace+"\""; + } + if(unguarded( (: grepp(read_file(globalstr),globalstr3):) )) + ret = unguarded( (: replace_matching_line(read_file(globalstr), globalstr3, globalstr3+"("+globalmixed+");") :) ); + else ret = eventAppend(file,where_append,"\n"+globalstr3+"("+globalmixed+");\n"); + ret = replace_line(ret,({"customdefs.h"}), "#include \""+homedir(this_player())+"/customdefs.h\""); + globalstr3 = ret; + unguarded( (: write_file(globalstr2, globalstr3, 1) :) ); + unguarded( (: cp(globalstr2, globalstr) :) ); + unguarded( (: rm(globalstr2) :) ); + return 1; + } + + int eventModHeader(object ob, string what, string value){ + string newcontents, newline; + string tmpfile = generate_tmp(ob); + globalstr = tmpfile; + globalstr2 = base_name(ob)+".c"; + + unguarded( (: cp(globalstr2, globalstr) :) ); + unguarded( (: globalstr3 = read_file(globalstr) :) ); + + if(what == "include") { + what = "#include <"; + if(!grepp(value,".h")) value += ".h>"; + else value += ">"; + newline = "\n"+what + value+"\n"; + } + + if(what == "inherit") { + value = upper_case(value); + if(!grepp(value,"LIB_")) value = "LIB_"+value; + newline = "\n"+what +" "+value+";\n"; + } + + if(grepp(globalstr3,value)) { + write("That object already contains that line."); + return 1; + } + if(what == "inherit"){ + globalstr3 = this_object()->eventAppend(tmpfile,({"inherit "}),newline); + } + + else { + if(grepp(globalstr3,what)){ + globalstr3 = replace_string(globalstr3,".h>\n",".h>;\n"); + globalstr3 = replace_string(globalstr3,".h\"\n",".h\";\n"); + unguarded( (: write_file(globalstr,globalstr3,1) :) ); + + globalstr3 = this_object()->eventAppend(tmpfile,({"#include "}),newline); + globalstr3 = replace_string(globalstr3,".h>;\n",".h>\n"); + globalstr3 = replace_string(globalstr3,".h\";\n",".h\"\n"); + + } + else { + globalstr3 = this_object()->eventAppend(tmpfile,({"inherit "}),newline); + } + } + + unguarded( (: write_file(globalstr,globalstr3,1) :) ); + + if( catch(load_object(globalstr))){ + write("This change would hose up the object. Modification aborted."); + return 1; + } + unguarded( (: cp(globalstr, globalstr2) :) ); + reload(ob); + rm(tmpfile); + return 1; + } + + + + + diff -c -r --new-file ds1.1/lib/secure/modules/generic.c ds2.0r27/lib/secure/modules/generic.c *** ds1.1/lib/secure/modules/generic.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/modules/generic.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,243 ---- + #include <lib.h> + #include <modules.h> + #include <daemons.h> + #include <rooms.h> + + int eventGetArray(string str); + int eventDoAddition(string str); + + string globalstr, globalstr2, temporary, func, v2; + object target; + string *NewArr = ({}); + string *array_val = ({}); + mapping InvMap = ([]); + + mixed gmake(string str) { + string thingy, filename, val, dir, area_dir; + string creation; + string *legal_dirs; + object template; + + if(sscanf(str, "%s %s %s",thingy, val, filename) == 3) true(); + else if(sscanf(str,"%s %s",thingy, filename) !=2) thingy = str; + switch(thingy){ + case "item" : creation = "thing"; dir = "obj";break; + case "book" : creation = "book"; dir = "obj";break; + case "thing" : creation = "thing"; dir = "obj";break; + case "weap" : creation = "weapon"; dir = "weap";break; + case "weapon" : creation = "weapon"; dir = "weap";break; + case "armor" : creation = "armor"; dir = "armor";break; + case "arm" : creation = "armor"; dir = "armor";break; + case "chair" : creation = "chair"; dir = "obj";break; + case "bed" : creation = "bed"; dir = "obj";break; + case "storage" : creation = "container"; dir = "obj";break; + case "container" : creation = "container"; dir = "obj";break; + case "table" : creation = "table"; dir = "obj";break; + case "door" : creation = "door"; dir = "doors";break; + case "barkeep" : creation = "barkeep"; dir = "npc";break; + case "vendor" : creation = "vendor"; dir = "npc";break; + case "trainer" : creation = "trainer"; dir = "npc";break; + case "npc" : creation = "npc"; dir = "npc";break; + case "mob" : creation = "npc"; dir = "npc";break; + case "mon" : creation = "npc"; dir = "npc";break; + case "monst" : creation = "npc"; dir = "npc";break; + case "monster" : creation = "npc"; dir = "npc";break; + case "meal" : creation = "meal"; dir = "meals";break; + case "food" : creation = "meal"; dir = "meals";break; + case "drink" : creation = "drink"; dir = "meals";break; + case "worn" : creation = "worn_storage"; dir = "armor";break; + case "wornstorage" : creation = "worn_storage"; dir = "armor";break; + case "worn_storage" : creation = "worn_storage"; dir = "armor";break; + default : true(); + } + + legal_dirs = ({"meals","doors", "obj","armor","weap","npc"}); + if(member_array(dir, legal_dirs) == -1) { + write("That is not a valid argument. You may create the following: room, npc, "+ + "door, weapon, armor, container, item, table, chair, bed, meal, worn_storage."); + return 1; + } + + else if(!filename || filename == ""){ + write("You must specify a filename. For example: create "+creation+ + " "+thingy+"_14.c"); + write("or: create "+thingy+" /realms/my_name/area/"+dir+"/my_first_"+creation+".c"); + return 1; + } + + if(last(filename,2) != ".c") filename += ".c"; + //tc("thing: "+last_string_element(this_player()->query_cwd(),"/"), "red"); + //tc("filename: "+filename); + //tc("check_privs: "+check_privs(this_player(), filename)); + + if(!this_player()->query_cwd()){ + write("You have no current working directory. Please type: cd\nthen try again."); + return 1; + } + + if(grepp(filename,"/") && directory_exists(path_prefix(filename)) && + check_privs(this_player(), filename)){ + write("Ok, using yer filename: "+filename); + } + else if(last_string_element(this_player()->query_cwd(),"/") == dir && + check_privs(this_player(), this_player()->query_cwd())){ + write("Using your cwd: "+this_player()->query_cwd()+"/"+filename); + filename = this_player()->query_cwd()+"/"+filename; + } + else if(this_player()->query_cwd() != "/" && + member_array(dir,get_dir(this_player()->query_cwd()+"/")) != -1 && + check_privs(this_player(), this_player()->query_cwd()+"/"+dir)){ + write("Using your cwd plus "+dir+": "+this_player()->query_cwd()+"/"+dir+"/"+filename); + filename = this_player()->query_cwd()+"/"+dir+"/"+filename; + } + else if(member_array(dir,get_dir(path_prefix(this_player()->query_cwd())+"/")) != -1 && + check_privs(this_player(), path_prefix(this_player()->query_cwd())+"/"+dir)){ + write("Using your cwd plus ../"+dir+": "+path_prefix(this_player()->query_cwd())+"/"+dir+"/"+filename); + filename = path_prefix(this_player()->query_cwd())+"/"+dir+"/"+filename; + } + else { + area_dir = homedir(this_player())+"/area"; + write("I'm going to go with the appropriate area directory: "+area_dir+"/"+dir+"/"+ + replace_string(filename,"/","")); + filename = area_dir+"/"+dir+"/"+replace_string(filename,"/",""); + + } + + creation = "/obj/"+creation+".c"; + if(file_exists(creation) && cp(creation,filename)) true(); + else { + //write("Whoops! The template object /obj/"+creation+".c doesn't exist."); + write("Creation failed."); + return 1; + } + + if(thingy != "door") { + template = new(filename); + template->eventMove(environment(this_player())); + write("You wave your hand mysteriously and "+template->GetShort()+" materializes!"); + say(this_player()->GetCapName()+" waves "+possessive(this_player())+" hand mysteriously and "+template->GetShort()+" materializes!"); + } + + else { + write("You wave your hand mysteriously and a new door begins to materialize."); + say(this_player()->GetCapName()+" waves "+possessive(this_player())+" hand mysteriously and a new door begins to materialize."); + this_object()->eventCreateDoor(val, filename); + } + return 1; + } + + varargs int eventStartGenericQuestions(object ob, string tempfile, string *new_arr, string what){ + target = ob; + temporary = tempfile; + NewArr -= ({ 0 }); + NewArr = new_arr; + func = what; + write("This setting takes multiple values. If you have no more values to "+ + "enter, then enter a dot on a blank line. To cancel, enter a single q on "+ + "a blank line."); + if(NewArr && sizeof(NewArr)) array_val = NewArr; + else array_val = ({}); + array_val -= ({0}); + array_val -= ({"0"}); + if(sizeof(array_val)) + write("You may now enter the next value. So far, we have: "+identify(array_val)); + else write("You may now enter the next value. So far, it is blank."); + write("If you're done entering values, enter a dot on a blank line."); + + input_to( (: eventGetArray :) ); + return 1; + } + + int eventGetArray(string str){ + if(!str || str == "" || str == "."){ + write("Entries complete. Final array is: "+identify(array_val)); + NewArr = array_val; + if(!sizeof(array_val)){ + write("Blank array. Modification cancelled."); + return 1; + } + if(target->GetDoor() || inherits(LIB_DOOR,target)){ + this_object()->eventReceiveId(target, NewArr); + } + else this_object()->eventResumeArrayMod(target, temporary, NewArr, func); + array_val = ({}); + return 1; + } + else { + array_val += ({str}); + array_val -= ({0}); + array_val -= ({"0"}); + if(sizeof(array_val)) + write("You may now enter the next value. So far, we have: "+identify(array_val)); + else write("You may now enter the next value. So far, it is blank."); + write("If you're done entering values, enter a dot on a blank line."); + input_to( (: eventGetArray :) ); + } + + return 1; + } + int eventDeleteItem(object ob1, object ob2){ + string name, tmpname; + mapping Inventory; + + name = base_name(ob1); + if(!check_privs(this_player(), base_name(ob2)) ){ + write("Insufficient privileges. Addition halted."); + return 1; + } + + tmpname = generate_tmp(); + Inventory = this_object()->QueryMap("SetInventory",ob2); + if(sizeof(Inventory[name])) map_delete(Inventory,name); + else if(sizeof(Inventory[name+".c"])) map_delete(Inventory,name+".c"); + map_delete(Inventory,name); + map_delete(Inventory,name+".c"); + globalstr = tmpname; + globalstr2 = base_name(ob2)+".c"; + unguarded( (: cp(globalstr2, globalstr) :) ); + this_object()->eventResumeMappingChange(ob2, tmpname, Inventory, "SetInventory"); + unguarded( (: rm(globalstr) :) ); + return 1; + } + + int eventAddItem(object ob, string addendum){ + target = ob; + v2 = addendum; + if(!check_privs(this_player(), base_name(target)) || !check_privs(this_player(), addendum)){ + write("Insufficient privileges. Addition halted."); + return 1; + } + + InvMap = this_object()->QueryMap("SetInventory",ob); + if(!inherits(LIB_NPC,ob)){ + write("Please enter the number of these that you want to add:"); + } + else write("Please enter a command for the NPC to perform with this "+ + "item. If you have no such command to enter, enter the number of "+ + "these items you want to add:"); + input_to( (: eventDoAddition :) ); + return 1; + } + + int eventDoAddition(string str){ + this_object()->GetValue("AUTOMATED",target, generate_tmp(target), v2, str, InvMap, "SetInventory"); + return 1; + } + + int eventGeneralStuff(string str){ + globalstr = str; + globalstr2 = str; + write("Indenting file..."); + unguarded( (: indent_file(globalstr) :) ); + //Checking for valid init + unguarded( (: this_object()->eventAddInit(globalstr) :) ); + //changing customdefs + unguarded( (: globalstr = replace_line(read_file(globalstr) ,({"customdefs.h"}), "#include \""+homedir(this_player())+"/customdefs.h\"") :) ); + globalstr = replace_string(globalstr,"\n\n\n","\n\n"); + globalstr = replace_string(globalstr,"//funs",""); + globalstr = replace_string(globalstr,"//snuf",""); + globalstr = replace_string(globalstr,"//extras",""); + unguarded( (: write_file(globalstr2, globalstr, 1) :) ); + return 1; + } + diff -c -r --new-file ds1.1/lib/secure/modules/mapping.c ds2.0r27/lib/secure/modules/mapping.c *** ds1.1/lib/secure/modules/mapping.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/modules/mapping.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,368 ---- + #include <lib.h> + #include <daemons.h> + #include <modules.h> + + string globaltmp, globalstr, globalstr2, func, data, temporary; + int automated; + object target; + mixed newval; + + int GetKey(string str); + varargs mapping GetValue(string str, object targ, string tempy, string k1, string v1, mapping MapThing, string passed_fun); + + string *key_arr = ({}); + mapping NewMap = ([]); + + int eventStoreMapping(string savefile, mapping plan){ + string filename = "/tmp/"+savefile; + if(file_exists(filename) && !check_privs(this_player(),filename)){ + write("You do not appear to have access to this file. Modification aborted."); + return 1; + } + store_variable("data", plan); + } + + varargs int eventStartMappingQuestions(mapping oldmap, object ob, string tmpfile, string auto){ + if(ob) target = ob; + if(tmpfile) temporary = tmpfile; + if(auto && auto != "") { + automated = 1; + func = auto; + } + + if(ob && !check_privs(this_player(),ob)){ + write("You do not appear to have access to this file. Modification aborted."); + return 1; + } + + if(file_exists(temporary) && !check_privs(this_player(),temporary)){ + write("You do not appear to have access to this file. Modification aborted."); + return 1; + } + if(sizeof(oldmap)) NewMap = oldmap; + else NewMap = ([]); + key_arr = ({}); + write("If you don't understand these questions, type the letter q on a blank "+ + "line and hit enter.\n"); + write("Please enter the first key element for this mapping:\n"); + input_to( (: GetKey :) ); + return 1; + } + + int GetKey(string str){ + if(file_exists(temporary) && !check_privs(this_player(),temporary)){ + write("You do not appear to have access to this file. Modification aborted."); + return 1; + } + if(str && str == "q" ) { + write("Aborting modification. For information on mappings, type: help mappings"); + rm(temporary); + return 1; + } + if(!str || str == "" || str == "."){ + if(!sizeof(key_arr)){ + write("Aborting modification. For information on mappings, type: help mappings"); + rm(temporary); + return 1; + } + write("Please enter the value for key "+identify(key_arr)+":\n"); + input_to( (: GetValue :) ); + return 1; + } + else { + key_arr += ({ str }); + write("Please enter the next key element, or enter a single dot to " + "finish entering key elements."); + input_to( (: GetKey :) ); + return 1; + } + } + + varargs mapping GetValue(string str, object targ, string tempy, string k1, string v1, mapping MapThing, string passed_fun){ + int i; + string repl_key; + string *mapkeys; + + if(!str && !targ && !tempy && !k1 && !v1){ + return 0; + } + if(str == "AUTOMATED"){ + NewMap = ([]); + automated = 1; + target = targ; + key_arr = ({ k1 }); + temporary = tempy; + str = v1; + if(sizeof(MapThing)) NewMap = MapThing; + func = passed_fun; + unguarded( (: cp(base_name(target)+".c",temporary) :) ); + } + if(file_exists(temporary) && !check_privs(this_player(),temporary)){ + write("You do not appear to have access to this file. Modification aborted."); + return ([]); + } + if(!str || str == "" || str == "." || str == "q") { + write("Aborting modification. For information on mappings, type: help mappings"); + rm(temporary); + return ([]); + } + + if(sscanf(str,"%d",i) == 1) newval = i; + else newval = str; + + mapkeys = keys(NewMap); + foreach(mixed llave in mapkeys){ + foreach(string nueva_llave in key_arr){ + if(arrayp(llave) && member_array(nueva_llave,llave) != -1) repl_key = llave; + else if(stringp(llave) && nueva_llave == llave ) repl_key = llave; + } + } + + if(repl_key || repl_key != "") map_delete(NewMap, repl_key); + if(sizeof(key_arr) > 1) NewMap[key_arr] = newval; + else NewMap[key_arr[0]] = newval; + if(automated){ + automated = 0; + if(func) this_object()->eventResumeMappingChange(target, temporary, NewMap, func); + else this_object()->eventResumeMappingChange(target, temporary, NewMap); + } + return copy(NewMap); + } + + varargs string eventStringifyMap(mapping source, string key_excl, string val_excl){ + string map_str, key; + mixed val; + + if(!key_excl) key_excl = ""+time(); + if(!val_excl) val_excl = ""+time(); + + map_str = "([\n"; + + foreach( key, val in source){ + if(intp(val)){ + map_str += identify(key) + " : " + val +",\n"; + } + else if(stringp(val) && last(val,1) == "'" && first(val,1) == "'"){ + val = replace_string(val,"'",""); + map_str += identify(key) + " : " + val +",\n"; + } + else + map_str += identify(key) + " : " + identify(val) +",\n"; + } + map_str += "])"; + return map_str; + } + + + + string eventReadThing(string map){ + // This doesn't actually work yet, and perhaps never will, + // but I'm leaving it here to remind myself to fix it. + // -Crat + + string new_string; + int i, iterations; + string *arr; + string *new_arr = ({}); + + new_string = ""; + arr = explode(map,":"); + + foreach(string element in arr){ + string s1, s2, type; + int num; + if(!sizeof(new_arr)) new_arr = ({ replace_string(element,"\"", "") }); + else if(sizeof(element) && element != ""){ + + if(sscanf(element,"%d ,%s",num,s1) != 2) { + sscanf(element,"%d,%s",num,s1); + type = "int"; + } + if(!s1 || s1 == "") { + sscanf(element,"(:%s:)%s", s1, s2); + type = "function"; + } + if(!s2 || s2 == "") { + sscanf(element,"([%s])%s", s1, s2); + type = "mapping"; + } + if(!s2 || s2 == "") { + sscanf(element,"\"%s\"%s", s1, s2); + type = "string"; + } + if(!s2 || s2 == "") { + s1 = element; + type = "null"; + } + + if(!type || type == ""){ + write("Whoops! An incomprehensible error occurs."); + return ""; + } + + if(type == "int") new_arr += ({ ""+num }); + else if(type == "function") new_arr += ({ "(: "+s1+" :)" }); + else if(type == "mapping") new_arr += ({ "([ "+s1+" ])" }); + else if(type == "string") new_arr += ({ "\""+s1+"\"" }); + else if(type == "null") new_arr += ({ replace_string(s1,",","",1) }); + } + } + + iterations = sizeof(new_arr); + + for( i = 0; i < (iterations -2) ; i = i+2 ){ + new_string += new_arr[i]+" : "+new_arr[i+1]+",\n"; + } + new_string += new_arr[iterations -1]+"\n"; + + new_string += "])"; + + return new_string; + } + + int eventSpecialMapHandler(object ob, string func, mixed mode, mixed value){ + string tmp, filename, func2, junk, junk2; + string *plural_maps; + int integer; + mapping NewMap = ([]); + mapping FirstMap = ([]); + mapping SecondMap = ([]); + + plural_maps = ({ "SetProperties" }); + //tc("mode: "+mode,"red"); + if(stringp(value)) value = trim(replace_string(value,mode,"")); + //tc("value: "+value,"red"); + + if(stringp(value) && !grepp(lower_case(func),"prop") ){ + if(sscanf(value,"%d",integer) != 1 && + sscanf(value,"%d %s",integer,junk) != 2) { + sscanf(value,"%s %s",tmp,junk); + if(!tmp || !junk) value = 0; + else if(sscanf(junk,"%d",integer) != 1) sscanf(junk,"%d %s",integer,junk2); + //tc("tmp: "+tmp); + if(tmp) mode += " "+tmp; + } + if(integer) value = integer; + else value = 0; + if(!intp(value)) value = 0; + } + + else { + if(sscanf(value,"%s %s",tmp, junk) == 2){ + mode += " "+tmp; + value = trim(junk); + } + } + + //tc("mode: "+mode,"green"); + //tc("value: "+value,"green"); + + filename = base_name(ob)+".c"; + if(!check_privs(this_player(),filename)){ + write("You do not appear to have access to this file. Modification aborted."); + return 1; + } + if(!mode || !value){ + write("Invalid entry. Modification cancelled."); + return 1; + } + + globalstr = filename; + unguarded( (: globalstr2 = read_file(globalstr) :) ); + + + switch(func){ + case "SetProperties" : func2 = "SetProperty";break; + case "SetSkills" : func2 = "SetSkill";break; + case "SetStats" : func2 = "SetStat";break; + } + + FirstMap = this_object()->eventReadPair(filename, func2, 1); + SecondMap = this_object()->eventReadMapping(filename, ({ func }), 1); + NewMap = add_maps(FirstMap, SecondMap); + if(stringp(value) && sscanf(value,"%d",integer) == 1) { + //integer = value; + //NewMap[mode] = 0; + //NewMap[mode] += integer; + //NewMap[mode] += integer; + NewMap[mode] = integer; + } + else NewMap[mode] = value; + //write("mapping: "+identify(NewMap)); + globaltmp = generate_tmp(ob); + //globalstr = filename; + //unguarded( (: globalstr2 = read_file(globalstr) :) ); + //tc("globalstr: "+globalstr,"yellow"); + //tc("globaltmp: "+globaltmp,"yellow"); + //tc("globalstr2: "+globalstr2,"blue"); + unguarded( (: write_file(globaltmp,globalstr2,1) :) ); + + if(member_array(func,plural_maps) != -1) + this_object()->eventResumeMappingChange(ob,globaltmp,copy(NewMap),func); + else this_object()->eventAddSettings(ob,globaltmp,copy(NewMap),func2); + //write("hmm."); + //unguarded( (: tc("new file: "+read_file(globalstr)) :) ); + return 1; + } + + mapping eventReadPair(string filename, string param, int destructive){ + mixed numerator, denominator; + int integer; + string s1, junk, contents, tmp; + string *file_arr, *line_arr; + mapping NewMap = ([]); + + if(file_exists(filename) && !check_privs(this_player(),filename)){ + write("You do not appear to have access to this file. Modification aborted."); + return ([]); + } + + globalstr = filename; + if(file_exists(filename)) { + unguarded( (: globalstr2 = read_file(globalstr) :) ); + } + contents = globalstr2; + file_arr = explode(contents,"\n"); + line_arr = ({}); + + foreach(string line in file_arr){ + if(grepp(line,param)) line_arr += ({ line }); + } + + if(!sizeof(line_arr)) return ([]); + + foreach(string element in line_arr){ + element = trim(element); + if(sscanf(element,param+"(%s);",s1) != -1) sscanf(element,param+"(%s) ;",s1); + if(!s1) sscanf(element,param+" (%s);",s1,junk); + sscanf(s1,"%s,%s",denominator,numerator); + numerator = trim(numerator); + denominator = trim(denominator); + if(sscanf(denominator,"\"%s\"",junk) == 1) denominator = junk; + if(sscanf(numerator,"%d",integer) == 1) numerator = integer; + else if(sscanf(numerator,"\"%s\"",junk) == 1) numerator = junk; + if(stringp(numerator)) numerator = trim(numerator); + denominator = trim(denominator); + NewMap[denominator] = numerator; + } + + if(destructive) { + globalstr2 = remove_matching_line(globalstr2, param, 1); + globalstr = generate_tmp(); + unguarded( (: write_file(globalstr,globalstr2,1) :) ); + tmp = globalstr; + //tc(tmp+" is: "+read_file(tmp)); + globalstr = filename; + globalstr2 = tmp; + //tc("globalstr2: "+globalstr2); + //tc("globalstr: "+globalstr); + unguarded( (: cp(globalstr2, globalstr) :) ); + rm(tmp); + } + return copy(NewMap); + } + + + + + diff -c -r --new-file ds1.1/lib/secure/modules/money.c ds2.0r27/lib/secure/modules/money.c *** ds1.1/lib/secure/modules/money.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/modules/money.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,105 ---- + #include <lib.h> + #include <dirs.h> + #include <daemons.h> + #include <modules.h> + #include <commands.h> + #include <rooms.h> + + + string globalstr, globalstr2, globalstr3, globaltmp; + mapping TmpMap = ([]); + mapping LoadMap = ([]); + + int eventModCost(object ob, string type, mixed val); + + int eventModMoney(object ob, string type, mixed val){ + string junk1; + int amount, npc; + mapping NewMap; + + TmpMap = ([]); + NewMap = ([]); + LoadMap = ([]); + globalstr = ""; + globalstr2 = ""; + globalstr3 = ""; + + + if(inherits(LIB_NPC,ob)) npc = 1; + + if(!intp(val) ) sscanf(val,"%s %d",junk1,amount); + if(amount) val = amount; + else val = 0; + amount = 0; + + globalstr3 = base_name(ob)+".c"; + globalstr = generate_tmp(ob); + unguarded( (: cp(globalstr3, globalstr) :) ); + if(!check_privs(this_player(),globalstr3)){ + write("You do not appear to have access to this file. Modification aborted."); + return 1; + } + if(npc){ + unguarded( (: TmpMap = this_object()->eventMappifyLine(globalstr,"SetCurrency") :) ); + LoadMap = this_object()->eventParsePair(globalstr,"AddCurrency","string","literal"); + foreach(string foo, mixed bar in LoadMap) if(stringp(bar)) LoadMap[foo] = amount; + unguarded( (: globaltmp = remove_matching_line(globalstr,"AddCurrency",1) :) ); + unguarded( (: globaltmp = remove_matching_line(globaltmp,"SetCurrency",1) :) ); + globalstr2 = "SetCurrency( "; + NewMap = add_maps(LoadMap,TmpMap); + } + + else { + unguarded( (: TmpMap = this_object()->eventMappifyLine(globalstr,"SetMoney") :) ); + LoadMap = this_object()->eventParsePair(globalstr,"AddMoney","string","literal"); + foreach(string foo, mixed bar in LoadMap) if(stringp(bar)) LoadMap[foo] = amount; + unguarded( (: globaltmp = remove_matching_line(globalstr,"AddMoney",1) :) ); + unguarded( (: globaltmp = remove_matching_line(globaltmp,"SetMoney",1) :) ); + globalstr2 = "SetMoney( "; + NewMap = add_maps(copy(LoadMap),copy(TmpMap)); + } + + if(stringp(val)) val = amount; + NewMap[type] = val; + globalstr2 += this_object()->eventStringifyMap(NewMap) + " );"; + globaltmp = this_object()->eventAppend(globaltmp,({"SetItems","SetInventory","SetLong"}),"\n"+globalstr2+"\n"); + unguarded( (: write_file(globalstr,globaltmp,1) :) ); + this_object()->eventGeneralStuff(globalstr); + unguarded( (: cp(globalstr,globalstr3) :) ); + unguarded( (: rm(globalstr) :) ); + reload(ob); + return 1; + } + + int eventModCost(object ob, string type, mixed val){ + string new_line, junk; + int amount; + + if(stringp(val)) sscanf(val,"%s %d",junk,amount); + else amount = val; + globalstr = base_name(ob)+".c"; + if(!check_privs(this_player(),globalstr)){ + write("You do not appear to have access to this file. Modification aborted."); + return 1; + } + + unguarded( (: globalstr2 = read_file(globalstr) :) ); + + globalstr2 = remove_matching_line(globalstr2,"SetBaseCost",1); + globalstr2 = remove_matching_line(globalstr2,"SetDollarCost",1); + globalstr2 = remove_matching_line(globalstr2,"SetCost",1); + globalstr2 = remove_matching_line(globalstr2,"SetValue",1); + + if(!type) type = "silver"; + + new_line = "SetBaseCost(\""+type+"\", "+amount+");"; + globalstr2 = this_object()->eventAppend(globalstr2,({"SetMass","SetItems","SetLong","SetInventory","SetVendorType"}), "\n"+new_line+"\n"); + + unguarded( (: write_file(globalstr, globalstr2, 1) :) ); + + this_object()->eventGeneralStuff(globalstr); + reload(ob); + + + return 1; + } diff -c -r --new-file ds1.1/lib/secure/modules/read.c ds2.0r27/lib/secure/modules/read.c *** ds1.1/lib/secure/modules/read.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/modules/read.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,120 ---- + #include <lib.h> + #include <modules.h> + string globalstr, globalstr2, globalstr3; + + mixed eventReadValue(string str, string method){ + string val, junk1, junk2; + int value, quid; + string substr = this_object()->ReadMatchingLine(str,method); + quid = sscanf(substr,"%s"+last(method,2)+"("+"%s"+")%s",junk1, val, junk2); + if(quid < 3) return 0; + val = trim(val); + sscanf(val,"%d",value); + if(value) return value; + else return this_object()->eventCleanString(val); + } + + varargs string ReadMatchingLine(string target, string substring, string exclude){ + int omit, done, tail_search, i; + string line, filename, new_file; + globalstr = ""; + globalstr2 = ""; + globalstr3 = ""; + + if(!target || !file_exists(target)) true(); + else target = read_file(target); + if(!target) return ""; + if(strsrch(target,substring) == -1) return ""; + if(strsrch(target,"\n") == -1) return ""; + filename = generate_tmp(this_object()); + new_file = ""; + if(!exclude) exclude = filename; + + write_file(filename,target); + + omit = 1; + for(i=1; !done; i++){ + line = read_file(filename, i, 1); + if(!line) break; + if(grepp(line,substring) ) { + omit =0; + } + if(!omit && truncate(last(line,2,1),1) != ";") { + tail_search = 1; + } + else { + tail_search = 0; + } + + if(!omit) { + new_file += line; + } + + if(!tail_search) omit = 1; + if(!line) done = 100; + if(i == 999) done = 100; + } + + rm(filename); + return new_file; + } + + mapping eventParsePair(string file, string param, string type, string mode){ + mixed val, key; + string func, junk; + int tempint; + mapping RetMap = ([]); + string line = this_object()->ReadMatchingLine(file, param); + sscanf(line,"%s(%s,%s);%s",func,key,val,junk); + if(!key || !val) { + return ([]); + } + if(sscanf(val,"%d",tempint) && !alphap(val)) val = tempint; + key = this_object()->eventCleanString(key); + if(stringp(val)) val = this_object()->eventCleanString(val); + RetMap[key] = val; + return RetMap; + } + + string eventCleanString(string str){ + str = replace_string(str,"\n",""); + str = replace_string(str,"\t",""); + str = replace_string(str,"\"",""); + str = space_trim(str); + str = trim(str); + return str; + } + + mapping eventMappifyLine(string file, string param){ + mixed RetMap; + string schmutz; + + schmutz = this_object()->ReadMatchingLine(file, param); + if(!grepp(schmutz,param)) return ([]); + schmutz = this_object()->eventExtractMapString(schmutz); + schmutz = replace_string(schmutz,"\n",""); + schmutz = replace_string(schmutz,"\t",""); + schmutz = replace_string(schmutz," : ",":"); + schmutz = space_trim(schmutz); + schmutz = replace_string(schmutz,", \"",",\""); + schmutz = trim(schmutz); + if(last(schmutz,1) != ","){ + schmutz = "(["+schmutz+",])"; + } + else schmutz = "(["+schmutz+"])"; + RetMap = restore_variable(schmutz); + if(!mapp(RetMap)){ + write("Mappification unsuccessful."); + return ([]); + } + else return RetMap; + } + + string eventExtractMapString(string str){ + string meat, junk1, junk2; + str = replace_string(str,"[","OPENBRACKET",1); + str = reverse_string(replace_string(reverse_string(str),"]","TEKCARBESOLC",1)); + sscanf(str,"%sOPENBRACKET%sCLOSEBRACKET%s",junk1,meat,junk2); + return meat; + } + diff -c -r --new-file ds1.1/lib/secure/modules/room.c ds2.0r27/lib/secure/modules/room.c *** ds1.1/lib/secure/modules/room.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/modules/room.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,593 ---- + #include <lib.h> + #include <modules.h> + + string globalstr, globalstr2, globaltmp; + string globalroom, globalfile; + + varargs int eventCreateExit(string dir, string room, string file, int remote); + varargs int eventCreateEnter(string dir, string room, string file, int remote); + int eventRemoveExit(string dir, string filename); + varargs mixed eventProcessExits(string filename, string dir, string location); + varargs mixed eventProcessEnters(string filename, string dir, string location, object room); + string eventCopyRoom(string source, string dest); + + string *cardinal_dirs = ( ({"north","south","east","west", "northeast","northwest","southeast","southwest","up","down", "out"}) ); + + mixed make(string str) { + int enter; + string *exits; + string *enters; + string foo, current_dir, current_room, this_room, new_room, room_dir; + string tmp_path, new_file, arg1, arg2, s1, s2; + object room; + + if(!str || str == "") { + write("You'll need to be more specific. Try 'help create'"); + return 1; + } + + if(environment(this_player())->GetDirectionMap()){ + write("This is a virtual room. It cannot be modified with the QCS."); + return 1; + } + + + foo = ""+time(); + room = environment(this_player()); + current_dir = this_player()->query_cwd(); + current_room = base_name(room); + room_dir = path_prefix(current_room); + + + if(file_exists(current_room+".c") && !check_privs(this_player(),current_room+".c")){ + write("You do not appear to have access to this room file. Modification aborted."); + return 1; + } + + if(!write_file(room_dir+"/"+foo+".foo","",1)) { + write("You do not have write privileges to this area."); + return 1; + } + + rm(room_dir+"/"+foo+".foo"); + write("It appears you have write access to this area."); + this_room = read_file(current_room+".c"); + new_room = read_file("/obj/room.c"); + + + if(sscanf(str," %s %s", s1, s2) == 2){ + arg1 = s1; + arg2 = s2; + if(sizeof(opposite_dir(arg1))) enter = 0; + else enter = 1; + } + else { + write("Usage: create room <direction> <file>"); + return 1; + } + + exits = room->GetExits(); + enters = room->GetEnters(); + + if(member_array(arg1,exits) != -1){ + write("This room already has an exit in that direction."); + return 1; + } + + if(member_array(arg1,enters) != -1){ + write("This room already has an enter by that name."); + return 1; + } + + if(strsrch(arg2,".c") == -1) arg2 += ".c"; + if(strsrch(arg2," ") != -1) arg2 = replace_string(arg2," ","_"); + + if(file_exists(arg2)) new_file = arg2; + else if(strsrch(arg2,"./") != -1) { + //tc("found dotslash"); + arg2 = replace_string(arg2,"./",""); + new_file = absolute_path((string)this_player()->query_cwd(), arg2); + //tc("new_file: "+new_file); + } + else if(directory_exists(path_prefix(arg2))){ + //tc("new_file: "+new_file,"red"); + new_file = arg2; + } + else if(grepp(arg2,"/")){ + new_file = room_dir +"/"+ last_string_element(arg2,"/"); + //tc("new_file: "+new_file,"green"); + } + + else { + new_file = room_dir +"/"+ arg2; + //tc("new_file: "+new_file,"blue"); + } + + if(!check_privs(this_player(),new_file)){ + write("Invalid directory."); + return 1; + } + + if(new_file[0..7] == "/realms/" && strsrch(new_file,"/area/room/") != -1){ + if(!file_exists(new_file)) cp("/obj/area_room.c",new_file); + } + else { + if(!file_exists(new_file)) cp("/obj/room.c",new_file); + } + + if(enter == 0) eventCreateExit(arg1, current_room+".c", new_file); + else eventCreateEnter(arg1, current_room+".c", new_file); + if(file_exists(new_file) && + grepp(read_file(new_file),"SetShort(\"a blank room\");") ) { + eventCopyRoom(current_room+".c", new_file); + reload(new_file); + } + return 1; + } + + varargs int eventCreateExit(string dir, string room, string file, int remote){ + string param; + string *file_arr; + + if(member_array(dir,cardinal_dirs) == -1) { + this_object()->eventCreateEnter(dir, room, file, remote); + return 1; + } + if(file_exists(room) && !check_privs(this_player(),room)){ + write("You do not appear to have access to this room file. Modification aborted."); + return 1; + } + + globalstr = room; + unguarded( (: globaltmp = read_file(globalstr) :) ); + file_arr = explode(globaltmp,"\n"); + + if(remote && member_array(dir,load_object(room)->GetExits()) != -1) return 0; + + if(strsrch(globaltmp,"SetExits") != -1) param = "SetExits"; + else if(strsrch(globaltmp,"AddExit") != -1) param = "AddExit"; + else if(strsrch(globaltmp,"SetLong") != -1) param = "SetLong"; + else { + //write("The room you are in is screwed up. Creation process halted."); + } + globaltmp = remove_matching_line(globaltmp,"SetObviousExits",1); + globaltmp = remove_matching_line(globaltmp,"//extras",1); + unguarded( (: write_file(globalstr,globaltmp,1) :) ); + reload(room); + eventProcessExits(room, dir, file); + + if(!remote) { + eventCreateExit(opposite_dir(dir), file, room, 1 ); + write("You begin uttering a magical incantation."); + say(this_player()->GetCapName()+" begins uttering a magical incantation."); + this_object()->eventGeneralStuff(room); + } + this_object()->eventAddInit(room); + if(remote){ + this_object()->eventGeneralStuff(room); + write("You wave your hand, and a new exit appears."); + say(this_player()->GetCapName()+" waves "+possessive(this_player())+" hand and a new exit appears."); + } + return 1; + } + + int eventRemoveExit(string dir, string filename){ + string contents, search_str, map_str, key, val, new_file, tmpfile; + string *file_arr; + mapping PointlessMap; + mapping ExitsMap = load_object(filename)->GetExitMap(); + + //if(!sizeof(ExitsMap)) tc("Exitsmap is nothing"); + //else tc("ExitsMap: "+identify(ExitsMap)); + + if(file_exists(filename) && !check_privs(this_player(),filename)){ + write("You do not appear to have access to this room's file. Modification aborted."); + return 1; + } + + tmpfile = generate_tmp(load_object(filename)); + //tmpfile = generate_tmp(); + globalstr = filename; + globaltmp = tmpfile; + unguarded( (: globalstr2 = read_file(globalstr) :) ); + contents = globalstr2; + //tc("filename: "+filename); + //tc("contents: "+contents); + PointlessMap = ([]); + + PointlessMap = load_object(filename)->GetFullExitData(); + + //if(!sizeof(PointlessMap)) write("PointlessMap is nothing"); + // else write("PointlessMap: "+identify(PointlessMap)); + + //if(file_exists(filename)) tc(filename+" exists."); + // else tc(filename+" doesn't exist."); + + if( member_array(dir,load_object(filename)->GetExits()) != -1 + && !functionp(PointlessMap[dir]["pre"]) + && !functionp(PointlessMap[dir]["post"]) ) { + this_object()->eventReadMapping(filename,({"SetExits"}), 1); + //write("ExitsMap: "+identify(ExitsMap)); + map_delete(ExitsMap,dir); + //tc("ExitsMap: "+identify(ExitsMap)); + map_str = "SetExits( ([ \n"; + foreach( key, val in ExitsMap){ + if(!functionp(PointlessMap[key]["pre"]) + && !functionp(PointlessMap[key]["post"])) map_str += "\""+key+"\" : \""+val+"\",\n"; + } + map_str += "]) );"; + //write("map_str: "+map_str); + + unguarded( (: globalstr2 = read_file(globalstr) :) ); + contents = globalstr2; + + new_file = remove_matching_line(contents, "SetExits", 1); + new_file = this_object()->eventAppend(new_file,({"SetItems","SetLong","SetDayLong","SetNightLong"}),"\n"+map_str+"\n"); + new_file = remove_matching_line(new_file,"SetObviousExits"); + new_file = remove_matching_line(new_file,"//extras"); + new_file = remove_matching_line(new_file,"AddExit(", 1, ":)"); + globalstr2 = new_file; + unguarded( (: write_file(globaltmp,globalstr2,1) :) ); + this_object()->eventGeneralStuff(tmpfile); + globalstr = tmpfile; + globalstr2 = filename; + unguarded( (: cp(globalstr, globalstr2) :) ); + reload(filename); + rm(tmpfile); + write("With a puff of smoke, an exit vanishes!"); + return 1; + } + + + if(member_array(dir,load_object(filename)->GetExits()) != -1){ + globalstr = filename; + new_file = read_file(filename); + file_arr = explode(read_file(filename),"\n"); + foreach(string linea in file_arr){ + if(strsrch(linea,"AddExit") != -1 && strsrch(linea,dir) != -1) { + search_str = linea; + } + } + globalstr = tmpfile; + globalstr2 = filename; + globaltmp = remove_matching_line(new_file, search_str); + unguarded( (: write_file(globalstr,globaltmp,1) :) ); + unguarded( (: cp(globalstr, globalstr2) :) ); + eventProcessExits(filename); + reload(filename); + rm(tmpfile); + write("With a puff of smoke, an exit vanishes!"); + return 1; + } + + write("This room's SetExits does not contain that direction."); + return 1; + } + + varargs mixed eventProcessExits(string filename, string dir, string location){ + string map_str, key, val, new_file; + mapping PointlessMap; + + mapping ExitsMap = load_object(filename)->GetExitMap(); + + if(file_exists(filename) && !check_privs(this_player(),filename)){ + write("You do not appear to have access to this file. Modification aborted."); + return 1; + } + + PointlessMap = load_object(filename)->GetFullExitData(); + map_str = "SetExits( ([\n"; + + this_object()->eventReadMapping(filename,({"SetExits"}), 1); + new_file = remove_matching_line(read_file(filename),"SetObviousExits"); + new_file = remove_matching_line(new_file,"//extras"); + new_file = remove_matching_line(new_file, "AddExit(", 1, ":)"); + + foreach( key, val in ExitsMap){ + if(!functionp(PointlessMap[key]["pre"]) && + !functionp(PointlessMap[key]["post"])) map_str += "\""+key+"\" : \""+val+"\",\n"; + } + if(dir && location && member_array(dir,load_object(filename)->GetExits()) == -1){ + map_str += "\""+dir+"\" : \""+location+"\",\n"; + } + map_str += "]) );"; + + globalstr = filename; + globaltmp = generate_tmp(); + + globalstr2 = this_object()->eventAppend(new_file,({"SetItems","SetLong","SetDayLong","SetNightLong","SetShort","create()","create"}),"\n"+map_str+"\n"); + unguarded( (: write_file(globaltmp,globalstr2,1) :) ); + unguarded( (: cp(globaltmp,globalstr) :) ); + reload(filename); + rm(globaltmp); + return 1; + } + + string eventCopyRoom(string source, string dest){ + string homedir, areadir, tmpsource, map_str, new_file; + mapping DestExits; + + if(file_exists(source) && !check_privs(this_player(),source)){ + write("You do not appear to have access to this file. Modification aborted."); + return ""; + } + + if(file_exists(dest) && !check_privs(this_player(),dest)){ + write("You do not appear to have access to that file. Modification aborted."); + return ""; + } + + tmpsource = generate_tmp(source); + globalstr2 = source; + globalstr = tmpsource; + unguarded( (: cp(globalstr2, globalstr) :) ); + globalstr2 = dest; + if(!file_exists(source)) return "Source read has failed."; + if(!file_exists(tmpsource)) return "Read failed."; + if(!file_exists(dest)) return "Destination read failed."; + homedir = "/realms/"+this_player()->GetKeyName(); + areadir = homedir+"/area"; + + unguarded( (: this_object()->eventReadMapping(globalstr,({"SetExits"}),1) :) ); + unguarded( (: this_object()->eventReadMapping(globalstr2,({"SetExits"}),1) :) ); + DestExits = load_object(dest)->GetExitMap(); + //tc("\n--------\n"); + + unguarded( (: globaltmp = read_file(globalstr) :) ); + //write("globaltmp: "+globaltmp); + //tc("\n--------\n"); + + //write("DestExitS: "+identify(DestExits)); + map_str = "SetExits("+this_object()->eventStringifyMap(DestExits)+");\n"; + new_file = this_object()->eventAppend(globaltmp,({"SetItems","SetLong","SetDayLong"}),"\n"+map_str+"\n"); + new_file = replace_line(new_file,({"SetShort(",");"}),"SetShort(\"copy of "+last_string_element(source,"/")+"\");"); + replace_string(new_file,"\n\n\n","\n\n"); + new_file = remove_matching_line(new_file, "SetDoor", 1); + + //tc("new_file: "+new_file); + //tc("\n--------\n"); + write_file(tmpsource,new_file,1); + + this_object()->eventGeneralStuff(tmpsource); + globalstr = tmpsource; + globalstr2 = dest; + + if(!unguarded( (: cp(globalstr, globalstr2) :) )){ + return "Write failed."; + } + + this_object()->eventAddInit(dest); + rm(tmpsource); + return "Room data copy complete."; + } + + varargs int eventCreateEnter(string dir, string room, string file, int remote){ + + if(file_exists(room) && !check_privs(this_player(),room)){ + write("You do not appear to have access to this room file. Modification aborted."); + return 1; + } + + if(!present(dir,environment(this_player()))){ + write("This room needs a corresponding SetItem to make a SetEnter "); + write("of "+dir); + return 1; + } + + globalroom = room; + globalfile = file; + globaltmp = ""; + + if(remote) unguarded( (: globaltmp = read_file(globalroom) :) ); + else unguarded( (: globaltmp = read_file(globalfile) :) ); + + if(remote && member_array("out",load_object(room)->GetExits()) != -1) return 0; + + //globaltmp = remove_matching_line(globaltmp,"SetObviousExits",1); + //globaltmp = remove_matching_line(globaltmp,"SetExits",1); + //globaltmp = remove_matching_line(globaltmp,"SetDoor",1); + globaltmp = remove_matching_line(globaltmp,"SetEnters",1); + globaltmp = remove_matching_line(globaltmp,"//extras",1); + //tc("remote: "+remote,"yellow"); + //tc("globalroom: "+globalroom); + //tc("globalfile: "+globalfile); + //tc("globaltmp: "+read_matching_line(globaltmp,"Long")); + //unguarded( (: tc("globalfile is: "+read_matching_line(read_file(globalfile),"Long"),"red") :) ); + //unguarded( (: tc("globalroom is: "+read_matching_line(read_file(globalroom),"Long"),"red") :) ); + unguarded( (: write_file(globalfile,globaltmp,1) :) ); + //players = get_livings(environment(this_player()),1); + //load_object("/secure/cmds/creators/update")->cmd("-a "+room); + //unguarded( (: tc("globalfile is: "+read_matching_line(read_file(globalfile),"Long"),"red") :) ); + //unguarded( (: tc("globalroom is: "+read_matching_line(read_file(globalroom),"Long"),"red") :) ); + + if(!remote) { + //tc("size of globalroom: "+sizeof(read_file(globalroom))); + //tc("size of globalfile: "+sizeof(read_file(globalfile))); + //tc(""); + eventProcessEnters(room, dir, file); + //tc("size of globalroom: "+sizeof(read_file(globalroom))); + //tc("size of globalfile: "+sizeof(read_file(globalfile))); + this_object()->eventCreateExit("out", file, room, 1 ); + //players->eventMove(load_object(room)); + say(this_player()->GetCapName()+" waves "+possessive(this_player())+" hand and a new enter appears."); + this_object()->eventGeneralStuff(room); + } + this_object()->eventAddInit(room); + if(remote){ + this_object()->eventGeneralStuff(room); + write("You begin uttering a magical incantation."); + write("You wave your hand, and a new enter appears."); + say(this_player()->GetCapName()+" begins uttering a magical incantation."); + + } + reload(room); + reload(file); + room = ""; + file = ""; + globalroom = ""; + globalfile = ""; + globaltmp =""; + return 1; + } + + int eventRemoveEnter(string dir, string filename){ + string contents, search_str, map_str, new_file, tmpfile; + mixed *key; + mixed val; + string *file_arr; + mixed *key_arr; + mapping PointlessMap; + mapping EntersMap = load_object(filename)->GetEnterMap(); + + //if(!sizeof(EntersMap)) tc("Entersmap is nothing"); + //else tc("EntersMap: "+identify(EntersMap)); + + if(file_exists(filename) && !check_privs(this_player(),filename)){ + write("You do not appear to have access to this room's file. Modification aborted."); + return 1; + } + + tmpfile = generate_tmp(load_object(filename)); + //tmpfile = generate_tmp(); + globalstr = filename; + globaltmp = tmpfile; + unguarded( (: globalstr2 = read_file(globalstr) :) ); + contents = globalstr2; + //tc("filename: "+filename); + //tc("contents: "+contents); + PointlessMap = ([]); + + PointlessMap = load_object(filename)->GetEnterMap(); + + //if(!sizeof(PointlessMap)) write("PointlessMap is nothing"); + // else write("PointlessMap: "+identify(PointlessMap)); + + //if(file_exists(filename)) tc(filename+" exists."); + // else tc(filename+" doesn't exist."); + + if( member_array(dir,load_object(filename)->GetEnters()) != -1) { + //&& !functionp(PointlessMap[dir]["pre"]) ) { + this_object()->eventReadMapping(filename,({"SetEnters"}), 1); + //write("EntersMap: "+identify(EntersMap)); + foreach(key,val in EntersMap){ + //write("key: "+identify(key)); + //write("key: "+typeof(key)); + //write("val: "+identify(val)); + //write("val: "+typeof(val)); + if(arrayp(key) && member_array(dir,key) != -1) + key_arr = key; + true(); + } + map_delete(EntersMap,key_arr); + //tc("EntersMap: "+identify(EntersMap)); + map_str = "SetEnters( ([ \n"; + foreach( key, val in EntersMap){ + //if(!functionp(PointlessMap[key]["pre"])) + map_str += "\""+key[0]+"\" : \""+val+"\",\n"; + } + map_str += "]) );"; + //write("map_str: "+map_str); + + unguarded( (: globalstr2 = read_file(globalstr) :) ); + contents = globalstr2; + + new_file = remove_matching_line(contents, "SetEnters", 1); + new_file = this_object()->eventAppend(new_file,({"AddItem","SetItems"}),"\n"+map_str+"\n"); + new_file = remove_matching_line(new_file,"SetObviousEnters"); + new_file = remove_matching_line(new_file,"//extras"); + new_file = remove_matching_line(new_file,"AddEnter(", 1); + globalstr2 = new_file; + unguarded( (: write_file(globaltmp,globalstr2,1) :) ); + this_object()->eventGeneralStuff(tmpfile); + globalstr = tmpfile; + globalstr2 = filename; + unguarded( (: cp(globalstr, globalstr2) :) ); + rm(tmpfile); + reload(filename); + write("With a puff of smoke, an enter vanishes!"); + return 1; + } + + + if(member_array(dir,load_object(filename)->GetEnters()) != -1){ + globalstr = filename; + new_file = read_file(filename); + file_arr = explode(read_file(filename),"\n"); + foreach(string linea in file_arr){ + if(strsrch(linea,"AddEnter") != -1 && strsrch(linea,dir) != -1) { + search_str = linea; + } + } + globalstr = tmpfile; + globalstr2 = filename; + globaltmp = remove_matching_line(new_file, search_str); + unguarded( (: write_file(globalstr,globaltmp,1) :) ); + unguarded( (: cp(globalstr, globalstr2) :) ); + eventProcessEnters(filename); + reload(filename); + rm(tmpfile); + write("With a puff of smoke, an enter vanishes!"); + return 1; + } + + write("This room's SetEnters does not contain that direction."); + return 1; + } + + varargs mixed eventProcessEnters(string filename, string dir, string location, object room) { + string map_str, key, val, new_file; + string *id_array; + object *dummies; + mapping PointlessMap; + + mapping EntersMap = load_object(filename)->GetEnterMap(); + id_array = ({}); + dummies = load_object(filename)->GetDummyItems(); + if(sizeof(dummies)) foreach(object dumdum in dummies){ + id_array += dumdum->GetId(); + } + + if(file_exists(filename) && !check_privs(this_player(),filename)){ + write("You do not appear to have access to this file. Modification aborted."); + return 1; + } + + PointlessMap = load_object(filename)->GetEnterMap(); + //tc("PointlessMap: "+identify(PointlessMap)); + //tc("EntersMap: "+identify(EntersMap)); + map_str = "SetEnters( ([\n"; + globalstr = filename; + + unguarded( (: this_object()->eventReadMapping(globalstr,({"SetEnters"}), 1) :) ); + new_file = remove_matching_line(unguarded( (: read_file(globalstr) :) ),"SetObviousExits"); + new_file = remove_matching_line(new_file,"//extras"); + new_file = remove_matching_line(new_file, "AddEnter(", 1, ":)"); + + //foreach( key, val in EntersMap){ + // if(!functionp(PointlessMap[key]["pre"]) + // &&!functionp(PointlessMap[key]["post"]) + // && present(key,load_object(filename)) ) + // map_str += "\""+key+"\" : \""+val+"\",\n"; + //} + + foreach( key, val in EntersMap){ + //if(present(key[0],load_object(filename)) ) map_str += "\""+key[0]+"\" : \""+val+"\",\n"; + map_str += "\""+key[0]+"\" : \""+val+"\",\n"; + } + + if(dir && location && member_array(dir,id_array) != -1){ + map_str += "\""+dir+"\" : \""+location+"\",\n"; + } + map_str += "]) );"; + + globalstr = filename; + globaltmp = generate_tmp(load_object(filename)); + + globalstr2 = this_object()->eventAppend(new_file,({"AddItem","SetItems","SetExits","AddExit"}),"\n"+map_str+"\n"); + unguarded( (: write_file(globaltmp,globalstr2,1) :) ); + unguarded( (: cp(globaltmp,globalstr) :) ); + reload(filename); + rm(globaltmp); + return 1; + } + diff -c -r --new-file ds1.1/lib/secure/npc/drone.c ds2.0r27/lib/secure/npc/drone.c *** ds1.1/lib/secure/npc/drone.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/npc/drone.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,187 ---- + #include <lib.h> + #include <save.h> + #include <privs.h> + #include "/daemon/include/races.h" + + int eventReceiveCommand(string butt, string munch); + int SetOwner(string hole); + string GetOwner(); + int ListenUp(int foo); + int itemcheck,listening; + mixed arguments; + string owner, mm, vv, printvar,owner; + string mensaje, clase_mensaje,desc,control_code; + object dude,ww, ownerob; + void doPrint(string str1, string str2); + + void validate(){ + //tc("control code: "+control_code,"green"); + //tc(" previous_object()->GetControlCode(): "+ previous_object()->GetControlCode(),"red"); + //tc("hmm. previous_object: "+identify(previous_object(-1))); + if(base_name(previous_object()) != "/secure/obj/control" || + previous_object()->GetControlCode() != control_code){ + if(ownerob){ + tell_object(ownerob,"%^RED%^Security violation. Someone is attempting to "+ + "hijack your drone. Guilty object stack: %^YELLOW%^"+ + identify(previous_object(-1))+"%^RESET%^"); + } + error("Illegal control attempt by: "+identify(previous_object(-1))+", "+get_stack()); + } + return; + } + + int doCheckLiving(object ob){ + if(living(ob) && ob->GetInvis() !=1){ + if(file_name(ob) != file_name(this_object()) ) + desc += ob->GetShort()+" is here.\n"; + } + return 1; + } + + int doCheckItem(object ob){ + string s1; + if(!living(ob) + && !sscanf(file_name(ob),"/lib/std/dummy#%s",s1) ){ + if(itemcheck==0){ + desc+="Here you see:\n"; + itemcheck=1; + } + if(ob->GetInvis() != 1) desc += ob->GetShort()+"\n"; + } + return 1; + } + + int ListenUp(int i){ + listening=i; + return 1; + this_object()->set_heart_beat(1); + } + void init(){ + itemcheck=0; + this_object()->set_heart_beat(1); + this_object()->SetNoClean(1); + } + + void receive_message(string s1, string s2){ + if(ownerob && listening) tell_object(ownerob,"Remote: "+s2); + } + + varargs mixed eventHearTalk(object who, object target, int cls, string verb, + string msg, string lang) { + ww=who; + vv=verb; + mm=msg; + dude=this_object()->GetShadowedObject(); + this_object()->receive_message("me",ww->GetName()+" "+vv+"s: "+mm) ; + return; + } + + varargs int doPrint(string msg, string msg_class){ + printvar=msg; + this_object()->receive_message("me again",printvar) ; + return 1; + } + + varargs int eventPrint(string msg, string msg_class){ + mensaje = msg; + clase_mensaje = msg_class; + doPrint( mensaje, clase_mensaje) ; + return 1; + } + + int eventDescribeEnvironment(mixed args){ + dude=this_object()->GetShadowedObject(); + arguments = args; + //dude->eDE(arguments) ; + unguarded((: tell_object(ownerob,this_object()->eDE()+"\n") :)); + return 1; + } + + int eventReceiveCommand(string str){ + string thing; + + validate(); + + if(!query_heart_beat(this_object())) this_object()->set_heart_beat(1); + if(ownerob && str != "look" && str != "l") this_object()->eventForce(str); + else if(ownerob){ + //tell_object(ownerob,"This is where the env dsc comes in."); + unguarded((: this_object()->eventDescribeEnvironment() :)) ; + //ownerob->eventPrint(this_object()->eventDescribeEnvironment(this_object())) ; + } + else if(!ownerob) return 0; + return 1; + } + + int SetOwner(string str){ + //tc("control code: "+control_code,"blue"); + if(sizeof(owner) && this_object()->GetOwner() != "NONE") { + validate(); + } + if(str == "NONE") { + control_code = ""; + owner = "NONE"; + ownerob = 0; + listening = 0; + return 1; + } + owner=str; + ownerob=find_player(owner); + listening=1; + this_object()->set_heart_beat(1); + return 1; + } + + string GetOwner(){ + if(owner) return owner; + else return "NONE"; + } + + + int SetControlCode(string str){ + if(sizeof(control_code) && GetOwner() != "NONE" ){ + if(ownerob){ + tell_object(ownerob,"%^RED%^Security violation. Someone is attempting to " + "hijack your drone. Guilty object stack: %^YELLOW%^"+ + identify(previous_object(-1))+"%^RESET%^"); + } + error("Illegal control attempt by: "+identify(previous_object(-1))+", "+get_stack()); + } + else control_code = str; + return 1; + } + + string eDE(int brief) { + object env; + object *invarr; + mixed tmp; + string *shorts; + string smell, sound, touch; + int i, maxi; + dude=this_object()->GetShadowedObject(); + if(!(env = environment(this_object()->GetShadowedObject()))) { + eventPrint(dude->GetName()); + eventPrint(file_name(dude)); + eventPrint(base_name(environment(find_object(file_name(dude))))); + eventPrint("You are nowhere.","Room Desc"); + return; + } + desc = (string)env->GetObviousExits() || ""; + desc = capitalize(env->GetInternalShort() || env->GetShort() || "") + + " [" + desc + "]\n"; + desc += (env->GetInternalLong() || env->GetLong() || ""); + smell = env->GetSmell(); + sound = env->GetListen(); + touch = env->GetTouch(); + //if(desc) eventPrint(desc, "Room DEsc"); + + if( smell ) desc += "%^GREEN%^\n"; + if( sound ) desc += "%^CYAN%^\n"; + if( touch ) desc += "%^YELLOW%^\n"; + + invarr = all_inventory(env); + filter(invarr, (: doCheckLiving($1) :) ); + filter(invarr, (: doCheckItem($1) :) ); + desc += "\n"; + return desc; + } diff -c -r --new-file ds1.1/lib/secure/obj/arch_board.c ds2.0r27/lib/secure/obj/arch_board.c *** ds1.1/lib/secure/obj/arch_board.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/obj/arch_board.c Wed Jul 5 00:48:30 2006 *************** *** 0 **** --- 1,83 ---- + #include <lib.h> + #include <privs.h> + + inherit LIB_SECURE_BOARD; + + void create(){ + ::create(); + + SetKeyName("chalkboard"); + SetId(({ "board", "chalkboard" })); + set_board_id("admin_board"); + SetShort("The Arch Board"); + SetLong("This is the Arch board. You know how to use it."); + } + + void init(){ + ::init(); + } + + void validate(){ + if( !this_player() || !archp(this_player()) ) + error("Illegal attempt to access arch board: "+get_stack()+" "+identify(previous_object(-1))); + } + + int cmd_read(string str) { + validate(); + return ::cmd_read(str); + } + + int cmd_post(string str) { + validate(); + return ::cmd_post(str); + } + + void continue_post(string subj, string file) { + validate(); + return ::continue_post(subj, file); + } + + void end_post(string subj, string mail) { + validate(); + return ::end_post(subj, mail); + } + + int cmd_followup_and_respond(string str) { + validate(); + return ::cmd_followup_and_respond(str); + } + + + void continue_followup(mapping post, string subj, string file) { + validate(); + return ::continue_followup(post, subj, file); + } + + void continue_mail(mapping post, string subj, string file) { + validate(); + return ::continue_mail(post, subj, file); + } + + int cmd_remove(string str){ + validate(); + return ::cmd_remove(str); + } + + int cmd_edit(string str){ + validate(); + return ::cmd_edit(str); + } + + void end_edit(string subj, int num) { + validate(); + return ::end_edit(subj, num); + } + + string GetExternalDesc() { + validate(); + return ::GetExternalDesc(); + } + + + + diff -c -r --new-file ds1.1/lib/secure/obj/control.c ds2.0r27/lib/secure/obj/control.c *** ds1.1/lib/secure/obj/control.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/obj/control.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,142 ---- + /* remote control by Cratylus @ Frontiers + * Sep 21 2005 + */ + + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + int controlling; + string remote, control_code; + object owner; + + void create(){ + ::create(); + SetKeyName("remote control"); + SetId(({"device","controller","remote","control"})); + SetAdjectives(({"small","electronic"})); + SetShort("a remote control"); + SetLong("This is a small electronic "+ + "device with various labeled buttons on it. "+ + "It seems you can \"control something\" with "+ + "it, and also \"release\" it. To command your "+ + "remote servant, you evidently have to preface the command "+ + "with the ] character (example: ] look at menu)."); + SetProperties(([ + "no steal" : 1, + ])); + SetMass(20); + SetValue(10); + SetVendorType(VT_TREASURE); + control_code = alpha_crypt(16); + } + + void init(){ + ::init(); + if(living(environment())) owner = environment(); + else owner = 0; + //tc("control code: "+control_code); + add_action("control","control"); + add_action("release","release"); + add_action("do_control","]"); + } + + int control(string str){ + object ob; + string *eyedees; + if(!str){ + return 0; + } + ob=present(str, environment(this_player())); + if(!ob){ + write("There is no such thing to be controlled here."); + return 1; + } + + if(!creatorp(this_player()) && !present("visitor pass",this_player())){ + write("Your puny mortal mind can't wrap itself around the use " + "of this powerful instrument."); + log_file("adm/control",capitalize(this_player()->GetKeyName())+ + " attempted to use the remote control on "+str+": "+timestamp()+"\n"); + tell_creators("SECURITY: "+capitalize(this_player()->GetKeyName())+ + " attempted to use the remote control on "+str+"."); + return 1; + } + + if(!living(ob)){ + write(capitalize(ob->GetKeyName())+" is not a living thing."); + return 1; + } + if(!strsrch(base_name(ob),"/secure") ){ + write(ob->GetName()+" is not controllable with this device."); + say(this_player()->GetName()+" tries to establish control over "+ob->GetName()+" and fails.\n"); + return 1; + } + if(controlling){ + write("Your remote control is busy controlling some other creature."); + return 1; + } + + if(ob->GetOwner() && ob->GetOwner() != "NONE"){ + write("That creature is already in someone's thrall."); + return 1; + } + + if(!(ob->GetOwner())) new("/shadows/drone")->eventShadow(ob); + remote=file_name(ob); + ob->SetOwner(this_player()->GetKeyName()); + ob->SetListen(1); + ob->SetControlCode(control_code); + eyedees = ob->GetId(); + eyedees += ({"servant","drone","thrall"}); + ob->SetId(eyedees); + + write("You establish a remote control connection with "+capitalize(str)+"."); + say(this_player()->GetName()+" establishes a control link with "+capitalize(str)+"."); + controlling=1; + return 1; + } + + int do_control(string str){ + object obj; + + if(!controlling){ + write("You are not currently linked to any living thing."); + return 1; + } + + if(!str || str == ""){ + write("Nothing happens."); + return 1; + } + + if(environment() != owner){ + write("You don't seem to be in possession of the remote control."); + tell_object(environment(),"Possible security violation on remote control."); + error("Illegal access of remote control: "+get_stack()+" "+identify(previous_object(-1))); + return 1; + } + + obj=find_object(remote); + if(obj) obj->eventReceiveCommand(str); + else { + write("There seems to be a problem."); + this_object()->release(); + } + return 1; + } + + int release(){ + object dingus; + if(remote && dingus=find_object(remote) ){ + dingus->SetOwner("NONE"); + } + controlling=0; + write("You release your remote link."); + return 1; + } + + string GetControlCode(){ + //tc("previous object: "+identify(previous_object()),"white"); + if(base_name(previous_object()) != "/shadows/drone") return alpha_crypt(16); + else return control_code; + } diff -c -r --new-file ds1.1/lib/secure/obj/glasses.c ds2.0r27/lib/secure/obj/glasses.c *** ds1.1/lib/secure/obj/glasses.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/obj/glasses.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,34 ---- + #include <lib.h> + #include <modules.h> + #include <armor_types.h> + #include <damage_types.h> + + inherit LIB_ARMOR; + inherit MODULES_ARMOR; + inherit MODULES_CREATE; + inherit MODULES_MAPPING; + inherit MODULES_GENERIC; + inherit MODULES_ROOM; + inherit MODULES_FILE; + inherit MODULES_MONEY; + inherit MODULES_READ; + inherit MODULES_DOOR; + + static void create(){ + armor::create(); + SetKeyName("glasses"); + SetId(({"tanstaafl"})); + SetAdjectives(({"wire-rimmed", "wire rimmed"})); + SetShort("wire-rimmed glasses"); + SetLong("A pair of glasses with magic properties for Creators."); + SetMass(5); + SetBaseCost("silver",30); + SetDamagePoints(1); + SetProtection(BLUNT,1); + SetProtection(BLADE,1); + SetProtection(KNIFE,1); + SetArmorType(A_VISOR); + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/secure/obj/machine.c ds2.0r27/lib/secure/obj/machine.c *** ds1.1/lib/secure/obj/machine.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/obj/machine.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,201 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + + int count, state, blocked, short, logged; + string message, announce, name, final, cratty, f_global; + object owner; + + int read_it(string str); + + void create(){ + ::create(); + SetKeyName("answering machine"); + SetId( ({"machine","voicemail"}) ); + SetShort("an answering machine"); + SetLong("This is a portable answering machine. There is a label on " + "it you can read."); + SetItems(([ + "label" : "A label you can read.", + ])); + SetRead(([ + "label" : (: read_it :), + ])); + SetDefaultRead("read_it"); + SetProperties(([ + "no steal" : 1, + ])); + SetMass(1); + SetValue(1); + SetVendorType(VT_TREASURE); + state=0; + count = 0; + set_heart_beat(5); + } + + void init(){ + ::init(); + add_action("toggle_answer","answer"); + add_action("check_it","check"); + add_action("set_ann","announce"); + add_action("check_mess","tells"); + add_action("erase","erase"); + add_action("arch_it","archive"); + this_object()->get_ann(); + } + + void heart_beat(){ + count++; + if(count > 720){ + count = 0; + if(creatorp(environment(this_object())) && + file_exists("/realms/"+name+"/messages/messages")){ + tell_object(environment(this_object()),"The answering machine %^BOLD%^YELLOW%^BEEPS%^RESET%^."); + } + } + } + + int toggle_answer(string str){ + if(str=="on"){ + if(state==1){ + write("The answering machine is already on.\n"); + return 1; + } + state=1; + blocked=1; + short=1; + logged=1; + this_object()->log_it("*** Answering machine activated on "+ + local_ctime(time())+".\n"); + write("The answering machine is on.\n"); + return 1; + } + if(str=="off"){ + if(state==0){ + write("The machine is already turned off.\n"); + return 1; + } + state=0; + blocked=0; + short=0; + logged=0; + write("The answering machine is off.\n"); + return 1; + } + } + + int query_answer(){ + return state; + } + + int get_message(string str){ + cratty=str; + this_object()->final(); + return 1; + } + + string send_message(){ + return announce; + } + + int log_it(string str){ + f_global=str; + owner=environment(this_object()); + name=lower_case(owner->GetKeyName()); + if(file_size("/realms/"+name+"/messages") > 0) { + cp("/realms/"+name+"/messages","/realms/"+name+"/messages.bak"); + rm("/realms/"+name+"/messages"); + } + if(file_size("/realms/"+name+"/messages") != -2) { + mkdir("/realms/"+name+"/messages"); + } + unguarded((: write_file("/realms/"+name+"/messages/messages", f_global+"\n") :)); + return 1; + } + + int final(){ + string tempy,a1,a2; + if(sscanf(cratty,"%s tells you: %s", a1, a2) >1){ + tempy="From "+a1+" at "+local_ctime(time())+":\n"+a2; + } + if(!blocked){ + message("info",final+"\n", environment(this_object())); + } + if(short){ + //message("info",a1+" telled to you.", environment(this_object())); + } + if(logged){ + this_object()->log_it(tempy); + } + } + + int set_ann(string str){ + if(!state){ + write("The machine is not turned on.\n"); + return 1; + } + announce=str; + rm("/realms/"+name+"/messages/annc"); + write_file("/realms/"+name+"/messages/annc", announce); + return 1; + } + + int get_ann(){ + owner=environment(this_object()); + if(creatorp(owner)){ + name=lower_case(owner->GetKeyName()); + if(file_size("/realms/"+name+"/messages/annc") > 0){ + announce=read_file("/realms/"+name+"/messages/annc"); + return 1; + } + announce=owner->GetName()+" cannot " + "answer your tell right now. Your message has been recorded " + "and "+nominative(owner)+" will get back to you as soon as possible."; + return 1; + } + } + + int check_mess(string str){ + if(!str){ + this_player()->more("/realms/"+name+"/messages/messages"); + return 1; + } + } + + int read_it(string str){ + write("\n" + "answer on/off - on activates the machine. off doesn't.\n" + "announce <msg> - '<msg>' is whatever you want the sender to see.\n" + "tells - lists messages by date, time and sender.\n"+ + "erase tape - erases all messages on the machine.\n" + "archive tape - copies tape onto backup archive file.\n" + "\n"); + return 1; + } + + int erase(string str){ + if(str=="tape"){ + write("You erase the answering machine tape.\n"); + rm("/realms/"+name+"/messages/messages"); + return 1; + } + } + + int arch_it(string str){ + string temp; + if(str=="tape"){ + write("You save the contents of the answering machine tape " + "into /realms/"+name+"/messages/archive.\n"); + temp=read_file("/realms/"+name+"/messages/messages"); + write_file("/realms/"+name+"/messages/archive", temp); + return 1; + } + } + + int clean_tape(string str){ + if(str=="tape"){ + this_object()->arch_it("tape"); + this_object()->erase("tape"); + return 1; + } + } diff -c -r --new-file ds1.1/lib/secure/obj/meditate_mojo.c ds2.0r27/lib/secure/obj/meditate_mojo.c *** ds1.1/lib/secure/obj/meditate_mojo.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/obj/meditate_mojo.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,77 ---- + #include <lib.h> + #include <vendor_types.h> + #include <damage_types.h> + inherit LIB_ITEM; + int damage1(); + int damage2(); + int damage3(); + int damage4(); + object victim; + int counter; + + void create(){ + ::create(); + SetKeyName("meditate mojo"); + SetId(({"meditate mojo"})); + SetLong(" "); + SetInvis(1); + set_heart_beat(1); + counter = 0; + } + + void init(){ + if(living(environment())){ + victim = environment(); + } + } + + + int eventMojofy(){ + int x; + x=random(100); + if(x < 5) damage4(); + else if(x < 20) damage3(); + else if(x < 35) damage2(); + else if(x < 50) damage1(); + return 1; + } + + int damage1(){ + if(victim) victim->AddStaminaPoints(random(5)+1); + return 1; + } + + int damage2(){ + if(victim) victim->AddHP(random(2)+1); + if(victim) victim->AddStaminaPoints(random(5)+1); + return 1; + } + + int damage3(){ + if(victim) victim->AddHP(random(3)+1); + if(victim) victim->AddStaminaPoints(random(5)+1); + return 1; + } + + int damage4(){ + if(victim) victim->AddHP(random(4)+1); + if(victim) victim->AddStaminaPoints(random(5)+1); + return 1; + } + + void heart_beat(){ + if(environment() && !living(environment())) this_object()->eventDestruct(); + if(counter == 50){ + if(environment()) tell_object(environment(),"You feel the effects of your meditation wear off."); + this_object()->eventMove("/domains/town/room/furnace"); + } + + counter++; + eventMojofy(); + } + + + + mixed CanGet(object ob) { return " ";} + mixed CanDrop(object ob) { return " ";} + diff -c -r --new-file ds1.1/lib/secure/obj/medtric.c ds2.0r27/lib/secure/obj/medtric.c *** ds1.1/lib/secure/obj/medtric.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/obj/medtric.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,1261 ---- + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + + void analyze(string butt); + object scanner,tricorder,person; + object *gstuff,*ngstuff; + mixed *statlist,*skilllist; + mapping this_stat,this_skill; + int allowed,statpoints,statlevel,statclass,tempint,i; + int skilllevel,skillclass,skillpoints; + string name; + string *stumps; + void create(){ + ::create(); + SetKeyName("creator tricorder"); + SetId(({"tricorder","scanner","device","tool","medtric","tric"})); + SetAdjectives(({"electronic","admin","diagnostic"})); + SetShort("a medical tricorder"); + SetLong("This is a palm-sized electronic device designed to run various "+ + "medical tests and provide treatment of disease and injury. "+ + "Written in bold red letters across its face are the words: \"%^BOLD%^RED%^FOR AUTHORIZED TEST CHARACTER "+ + "USE ONLY%^RESET%^\".\n%^YELLOW%^NOTE: Some functions do not work "+ + "with drones. This is due to safeguards in the master object security "+ + "model, and it will not be \"fixed\".%^RESET%^\n"+ + "\n Labeled buttons on this device read:\n"+ + "* medscan: scan for disease, poison, etc\t%^RED%^offline%^RESET%^\n"+ + "* fscan: readout of all files inherited\t\t%^GREEN%^ONLINE%^RESET%^\n"+ + "* enshadow: move a shadow to an object\t\t%^RED%^offline%^RESET%^\n"+ + "* deshadow: remove all shadows from an object\t%^GREEN%^ONLINE%^RESET%^\n"+ + "* diagnose: assess health status\t\t%^GREEN%^ONLINE%^RESET%^\n"+ + "* inject: insert substance into patient\t\t%^RED%^offline%^RESET%^\n"+ + "* extract: remove a foreign body or substance\t%^GREEN%^ONLINE%^RESET%^ (slugs only)\n"+ + "* modhealth: raise or lower health level\t%^GREEN%^ONLINE%^RESET%^\n"+ + "* modcaff: raise or lower caffeine level\t%^GREEN%^ONLINE%^RESET%^\n"+ + "* modalc: raise or lower alcohol level\t\t%^GREEN%^ONLINE%^RESET%^\n"+ + "* modfood: raise or lower food level\t\t%^GREEN%^ONLINE%^RESET%^\n"+ + "* moddrink: raise or lower drink level\t\t%^GREEN%^ONLINE%^RESET%^\n"+ + "* modmag: raise or lower magic level\t\t%^GREEN%^ONLINE%^RESET%^\n"+ + "* modstam: raise or lower stamina\t\t%^GREEN%^ONLINE%^RESET%^\n"+ + "* modtox: raise or lower poison\t\t\t%^GREEN%^ONLINE%^RESET%^\n"+ + "* setskill: set skill level\t\t\t%^GREEN%^ONLINE%^RESET%^\n"+ + "* setstat: set stat level\t\t\t%^GREEN%^ONLINE%^RESET%^\n"+ + "* amputate: remove limb\t\t\t\t%^GREEN%^ONLINE%^RESET%^\n"+ + "* regenerate: restore all amputated limbs\t%^GREEN%^ONLINE%^RESET%^\n"+ + "* cure: eliminate known diseases\t\t%^GREEN%^ONLINE%^RESET%^\n"+ + "* infect: introduce disease into patient\t%^GREEN%^ONLINE%^RESET%^\n"+ + "* inoculate: raise immunity to a disease\t%^RED%^offline%^RESET%^\n"+ + "* posture: change your own posture.\t\t%^RED%^offline%^RESET%^\n"); + SetProperties(([ + "no steal" : 1, + ])); + SetMass(12); + SetValue(10); + SetVendorType(VT_TREASURE); + } + void init(){ + ::init(); + add_action("fscan","fscan"); + add_action("assess","assess"); + add_action("assess","diagnose"); + add_action("extract","extract"); + add_action("addhp","addhp"); + add_action("addhp","modhealth"); + add_action("modcaff","modcaff"); + add_action("modalc","modalc"); + add_action("modfood","modfood"); + add_action("moddrink","moddrink"); + add_action("modmag","modmag"); + add_action("modstam","modstam"); + add_action("modtox","modtox"); + add_action("setstat","setstat"); + add_action("setskill","setskill"); + add_action("regenerate","regenerate"); + add_action("amputate","amputate"); + add_action("infect","infect"); + add_action("germ_scan","germscan"); + add_action("germ_squash","cure"); + add_action("medscan","medscan"); + add_action("posture","posture"); + add_action("enshadow","enshadow"); + add_action("deshadow","deshadow"); + add_action("TestFun","HEINEKEN"); + } + int TestFun(){ + write("WOOHOO"); + return 1; + } + int preAction(){ + scanner=this_player(); + tricorder=this_object(); + if(!present(tricorder, scanner)){ + write("You are not holding the tricorder."); + return 2; + } + if(!creatorp(scanner) && !present("visitor pass",scanner)){ + write("Your puny mortal mind can't wrap itself around the use " + "of this powerful instrument."); + log_file("adm/tricorder",capitalize(this_player()->GetKeyName())+ + " attempted to use the medical tricorder: "+timestamp()+"\n"); + tell_creators("SECURITY: "+capitalize(this_player()->GetKeyName())+ + " attempted to use the medical tricorder."); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 2; + } + + say(scanner->GetName()+" operates a medical tricorder.",scanner); + write("The tricorder makes a low, warbling sound."); + return 1; + } + + int posture(int i){ + allowed=preAction(); + if(allowed == 2) return 1; + if(!i) { + write("Please include the position number desired."); + return 0; + } + this_player()->SetPosition(i); + return i; + } + int deshadow(string str){ + object target; + allowed=preAction(); + if(allowed == 2) return 1; + if(str == "me") str = this_player()->GetKeyName(); + if(!target = present(str,this_player())){ + target = present(str,environment(this_player())); + } + if(!target){ + write("That's not here."); + return 1; + } + else { + if(shadow(target,0)){ + remove_shadow(target); + write("You deshadow "+str); + } + else write("No shadows there."); + } + return 1; + } + int enshadow(string str){ + object target; + string s1,s2,s3,file; + allowed=preAction(); + if(allowed == 2) return 1; + if(sscanf(str,"%sshadow/%s %s",s1,s2,s3) > 0) file = s2; + else if(sscanf(str,"%sshadow/%s.c %s",s1,s2,s3) > 0) file = s2; + else if(sscanf(str,"%s %s",s1,s2) > 0) file = s1; + else { + write("You must specify a file within /shadows and a target."); + return 1; + } + if( s3 && s3 != "") target = present(s3,environment(this_player())); + else if(s3 == "me") target = this_player(); + else target = present(s2,environment(this_player())); + + if(!target) { + write("Please specify a file within /shadows and a target."); + return 1; + } + + if(file_size("/shadow/"+file) < 1){ + write("That is not a valid shadow."); + return 1; + } + + new("/shadow/"+file)->eventShadow(target); + write("You enshadow "+target->GetName()+" with /shadow/"+file); + return 1; + } + int medscan(string str){ + allowed=preAction(); + if(allowed == 2) return 1; + if(!str || str == "") { + write("Please rephrase, including your target this time."); + return 1; + } + if(str == "me") str = this_player()->GetKeyName(); + person=present(str,environment(scanner)); + if(!person || !living(person)){ + write("Disease check: No such being found"); + return 1; + } + write("Scanning for germs..."); + this_object()->germ_scan(str); + write("Germ scan complete.\n"); + write("Wound scan currently offline."); + return 1; + } + int germ_scan(mixed strob ){ + int i; + string a,b,c,str; + if(stringp(strob)) { + str = strob; + if(str == "me") str = this_player()->GetKeyName(); + person=present(str,environment(scanner)); + if(!person || !living(person)){ + write("This being was not found."); + return 2; + } + } + if(objectp(strob)){ + person = strob; + str = person->GetName(); + } + if(!str || str == "") { + write("Please rephrase, including your target this time."); + return 1; + } + if(!living(person)){ + write("This thing is not alive."); + return 2; + } + ngstuff=all_inventory(person); + gstuff = ({}); + say(scanner->GetName()+" waves a tricorder at "+person->GetName()+".",({scanner,person}) ); + tell_object(person,scanner->GetName()+" waves a tricorder at you."); + + for(i=0;i<sizeof(ngstuff);i++){ + if(ngstuff[i]->isGerm()== 1 && !sizeof(gstuff)) gstuff = ({ngstuff[i]}); + if(ngstuff[i]->isGerm()== 1 && sizeof(gstuff) > 0 ) gstuff += ({ngstuff[i]}); + } + if(!sizeof(gstuff)){ + write(person->GetName()+" has no detectable diseases."); + return 2; + } + for(i=0;i<sizeof(gstuff);i++){ + if(!a=gstuff[i]->GetKeyName() || a == "" ) a = "generic disease"; + if(!b=gstuff[i]->GetType() || b == "" ) b = "unknown type"; + if(intp(gstuff[i]->GetCure())) c=gstuff[i]->GetCure(); + if(!c) c = 0; + write("Disease: "+a+", type: "+b+", severity: "+c); + return 1; + } + write("Please specify a living being that shares your current location."); + return 2; + } + int germ_squash(string str){ + int i,bar,c; + object array whom; + allowed=preAction(); + if(allowed == 2) return 1; + if(!str || str == "") { + write("Please specify a living thing, or \"all\" for everything in "+ + "your environment."); + return 1; + } + if(str == "me") str = this_player()->GetKeyName(); + person=present(str,environment(scanner)); + whom = ({}); + if(!person && str !="all"){ + write("Disease check: No such being found"); + return 1; + } + + if( str !="all" && !living(person)){ + write("Disease check: No such living being found"); + return 1; + } + if(str =="all") whom = get_livings(environment(this_player())); + if(str !="all") whom = ({person}); + foreach(object ingrate in whom){ + i=germ_scan(ingrate); + if(i!=2 && intp(gstuff[i]->GetCure()) ) bar=gstuff[i]->GetCure(); + if(i!=2 && !intp(gstuff[i]->GetCure()) ) write("GetCureType: "+typeof(gstuff[i]->GetCure())); + if(!i) { write("Extremely weird error here."); return 1; } + for(i=0;i<sizeof(gstuff);i++){ + if(gstuff[i] && gstuff[i]->isGerm() ){ + c=10; + gstuff[i]->SetCure(c); + if(intp(gstuff[i]->GetCure()) ){ + gstuff[i]->eventCure(ingrate,c,gstuff[i]->GetType()); + write("You cure "+ingrate->GetName()+"'s disease."); + say(ingrate->GetName()+" looks healthier.",ingrate); + tell_object(ingrate,"You feel less sick."); + } + if(gstuff[i] && gstuff[i]->isGerm() && !intp(gstuff[i]->GetCure())){ + write("This disease uses a functional as its SetCure condition."); + write("It will not be cured by this device. You will have to "+ + "manually review the germ's code to determine what will cure it."); + write("SetCure() data type: "+typeof(gstuff[i]->GetCure())); + write("Filename: "+base_name(gstuff[i])+"\n"); + } + } + } + gstuff=({}); + } + return 1; + } + int infect(string str){ + string whom,what,disease; + object ob; + allowed=preAction(); + if(allowed == 2) return 1; + if(!str){ + write("Please indicate whom to infect, and with what. Example:"); + write("infect doofus cold"); + write("Current valid diseases: cold, flu, fleas, lice"); + return 1; + } + if(sscanf(str,"%s %s",whom,what)) { + if(!whom || !what || whom == "" || what == ""){ + write("Please indicate whom to infect, and with what. Example:"); + write("infect doofus cold"); + write("Current valid diseases: cold, flu, fleas, lice"); + return 1; + } + } + if(!whom || !what || whom == "" || what == ""){ + write("Please indicate whom to infect, and with what. Example:"); + write("infect doofus cold"); + write("Current valid diseases: cold, flu, fleas, lice"); + return 1; + } + if(whom == "me") whom = this_player()->GetKeyName(); + person=find_living(whom); + if(!person || !living(person)){ + write("This being was not found."); + return 1; + } + if(what == "cold") disease = "/domains/town/obj/cold"; + else if(what == "flu") disease = "/domains/town/obj/flu"; + else if(what == "fleas") disease = "/domains/town/obj/fleas"; + else if(what == "lice") disease = "/domains/town/obj/lice"; + else if(what == "rage") disease = "/domains/town/obj/rage"; + else if(what != "") { + write("That isn't a valid disease."); + return 1; + } + if(person=find_living(whom)){ + write(person->GetName()+" located. Infecting..."); + say(scanner->GetName()+" waves a tricorder at "+person->GetName()+".",person); + if(present(whom,environment(scanner))) { + tell_object(person,scanner->GetName()+" waves a tricorder at you."); + } + } + ob=new(disease); + if(ob) ob->eventInfect(person); + else write("There's a problem with that parasite."); + return 1; + } + int amputate(string str){ + string whom,which,limb,both; + allowed=preAction(); + if(allowed == 2) return 1; + if(!str){ + write("Please indicate whose limbs you wish to amputate, and which. Example:"); + write("amputate joey left hand"); + return 1; + } + if(sscanf(str,"%s %s %s",whom,which,limb)) { + if(!limb) sscanf(str,"%s %s",whom,limb); + } + if(whom && whom == "me") whom = this_player()->GetKeyName(); + if(!whom || !limb){ + write("Please indicate whose limbs you wish to amputate, and which. Example:"); + write("amputate joey left hand"); + return 1; + } + if(!person=present(whom,environment(scanner))){ + write(capitalize(whom)+" isn't here."); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + both = limb; + if(which && which !="") both = which+" "+limb; + write("both: "+both); + + if(both == "head"){ + tell_room(environment(person),scanner->GetName()+" waves a tricorder at "+person->GetName()+", and "+ + person->GetName()+"'s head falls off!", ({ scanner,person }) ); + write("You decapitate "+person->GetName()+"."); + tell_object(person,scanner->GetName()+" decapitates you with a wave of "+possessive(scanner)+" tricorder!"); + person->RemoveLimb(both, scanner); + return 1; + } + stumps=person->GetLimbs(); + if(!stumps) { + write(person->GetName()+" hasn't any limbs."); + say(scanner->GetName()+" waves a tricorder at "+person->GetName()+".",scanner,person); + tell_object(person,scanner->GetName()+" waves a tricorder at you."); + return 1; + } + if(member_array(both,stumps) != -1){ + person->RemoveLimb(both, scanner); + write("You amputate "+person->GetName()+"'s "+both); + say(scanner->GetName()+" has amputated "+person->GetName()+"'s "+both+" "+ + "with an energy beam from a medical tricorder.",scanner,person); + tell_object(person,scanner->GetName()+" waves a tricorder at you and "+ + "your "+both+" is severed."); + return 1; + } + if(member_array(limb,stumps)!= -1){ + person->RemoveLimb(limb, scanner); + write("You amputate "+person->GetName()+"'s "+limb+"."); + say(scanner->GetName()+" has amputated "+person->GetName()+"'s "+both+" "+ + "with an energy beam from a medical tricorder.",scanner,person); + tell_object(person,scanner->GetName()+" waves a tricorder at you and"+ + "your "+limb+" is severed."); + return 1; + } + write("There is some sort of problem, it looks like. No "+ + "limbs are severed."); + return 1; + } + int regenerate(string str){ + allowed=preAction(); + if(allowed==2) return 1; + if(!str){ + write("Please indicate whose limbs you wish to regenerate."); + return 1; + } + if(str == "me") str = this_player()->GetKeyName(); + if(!person=present(str,environment(scanner))){ + write(capitalize(str)+" isn't here."); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + stumps=person->GetMissingLimbs(); + if(!stumps) { + write(person->GetName()+" isn't missing any limbs."); + say(scanner->GetName()+" waves a tricorder at "+person->GetName()+".",scanner,person); + tell_object(person,scanner->GetName()+" waves a tricorder at you."); + return 1; + } + for(i=0;i<sizeof(stumps);i++){ + person->RestoreLimb(stumps[i]); + write("You regenerate "+person->GetName()+"'s "+stumps[i]+"."); + say(scanner->GetName()+" regenerates "+person->GetName()+"'s "+stumps[i]+".",scanner,person); + tell_object(person,scanner->GetName()+" regenerates your "+stumps[i]+"."); + } + return 1; + } + int DoSkillChange(string str, int i){ + int more_or_less; + if(str == "me") str = this_player()->GetKeyName(); + this_skill = person->GetSkill(str); + if(this_skill["level"] < i) more_or_less = 1; + skillclass=this_skill["class"]; + person->SetSkill(str,i,skillclass); + say(scanner->GetName()+" waves a medical tricorder at "+person->GetName()+".",({person,scanner})); + tell_object(person,scanner->GetName()+" waves a medical tricorder at you."); + if(more_or_less == 1) tell_room(environment(person), person->GetName()+" looks somehow more experienced.",({person}) ); + if(more_or_less != 1) tell_room(environment(person), person->GetName()+" looks somehow less experienced.",({person}) ); + write("You've set "+person->GetName()+"'s "+str+" to level "+i+"."); + return 1; + } + int DoAllSkills(int foo){ + int i; + for(i=0;i<sizeof(skilllist);i++){ + this_skill = person->GetSkill(skilllist[i]); + skillclass=this_skill["class"]; + person->SetSkill(skilllist[i],foo,skillclass); + write("You've set "+person->GetName()+"'s "+skilllist[i]+" to level "+foo+"."); + } + say(scanner->GetName()+" waves a medical tricorder at "+person->GetName()+".",({person,scanner})); + say(person->GetName()+" seems to undergo an almost undetectable, subtle transformation.",({person,scanner})); + tell_object(person,scanner->GetName()+" waves a medical tricorder at you."); + return 1; + } + int setskill(string str){ + string whom,skill; + string skill1,skill2,rubbish; + int amt; + allowed=preAction(); + if(allowed==2) return 1; + if(!str) { + write("Syntax: setskill <person> <skill> <amount>"); + write("If there is a space in the skill name, replace it with "+ + "an underscore. Example:\nsetskill schmucky blade_attack 5"); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + if(!sscanf(str,"%s %s %d",whom,skill,amt)) { sscanf(str,"%s %s",whom,skill); } + if(sscanf(str,"%s %s_%s ",rubbish,skill1,skill2) && skill1 && skill2){ + whom = rubbish; + skill = skill1 + " " +skill2; + } + write("skill: "+skill); + if(!whom || whom == ""){ + write("Syntax: setskill <person> <skill> <amount>"); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + if(whom == "me") whom = this_player()->GetKeyName(); + if(!person=present(whom,environment(scanner))){ + write(capitalize(whom)+" isn't here."); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + this_skill = ([]); + skilllist = ({}); + skilllist = person->GetSkills(); + if(amt < 0) amt = 0; + if(allowed==2) return 1; + if ( !whom || !skill || !amt || !intp(amt) ){ + write("Syntax: setskill <person> <skill> <amount>"); + write("If there is a space in the skill name, replace it with "+ + "an underscore. Example:\nsetskill schmucky blade_attack 5"); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + if(skill == "all") { DoAllSkills(amt); return 1; } + if(member_array(skill,skilllist) == -1) { + write(capitalize(whom)+" doesn't have that skill."); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + DoSkillChange(skill, amt); + return 1; + } + int DoStatChange(string str, int i){ + if(str == "me") str = this_player()->GetKeyName(); + this_stat = person->GetStat(str); + statclass=this_stat["class"]; + person->SetStat(str,i,statclass); + say(scanner->GetName()+" waves a medical tricorder at "+person->GetName()+".",({person,scanner})); + tell_object(person,scanner->GetName()+" waves a medical tricorder at you."); + write("You've set "+person->GetName()+"'s "+str+" to level "+i+"."); + return 1; + } + int DoAllStats(int foo){ + int i; + for(i=0;i<sizeof(statlist);i++){ + this_stat = person->GetStat(statlist[i]); + statclass=this_stat["class"]; + person->SetStat(statlist[i],foo,statclass); + write("You've set "+person->GetName()+"'s "+statlist[i]+" to level "+foo+"."); + } + say(scanner->GetName()+" waves a medical tricorder at "+person->GetName()+".",({person,scanner})); + tell_object(person,scanner->GetName()+" waves a medical tricorder at you."); + return 1; + } + int setstat(string str){ + string whom,stat; + int amt; + allowed=preAction(); + if(allowed==2) return 1; + if(!str) { + write("Syntax: setstat <person> <stat> <amount>"); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + if(!sscanf(str,"%s %s %d",whom,stat,amt)) { sscanf(str,"%s %s",whom,stat); } + if(!whom || whom == ""){ + write("Syntax: setstat <person> <stat> <amount>"); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + if(whom == "me") whom = this_player()->GetKeyName(); + if(!person=present(whom,environment(scanner))){ + write(capitalize(whom)+" isn't here."); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + this_stat = ([]); + statlist = ({}); + statlist = person->GetStats(); + if(amt < 0) amt = 0; + if(allowed==2) return 1; + if ( !whom || !stat || !amt || !intp(amt) ){ + write("Syntax: setstat <person> <stat> <amount>"); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + if(stat == "all") { DoAllStats(amt); return 1; } + if(member_array(stat,statlist) == -1) { + write(capitalize(whom)+" doesn't have that stat."); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + DoStatChange(stat, amt); + return 1; + } + int modstam(string str, int stamina){ + string whom; + int tempint,staminalevel; + object person; + allowed=preAction(); + if(allowed==2) return 1; + if(!str){ + write("Syntax: modstam <person> <amount>"); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + sscanf(str,"%s %d",whom,stamina); + if (!whom || !stamina){ + write("Syntax: modstam <person> <amount>"); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + if(whom == "me") whom = this_player()->GetKeyName(); + if(!intp(stamina)){ + write("Syntax: modstam <person> <amount>"); + write("Where <amount> is an integer. For example:\nmodstam joe 3\nmodstam mike -10\n"); + say(scanner->GetName()+" fumbles stupidly with a medical tricorder.",scanner); + return 1; + } + person=present(whom,environment(scanner)); + if(!person){ + write(capitalize(whom)+" isn't here."); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + staminalevel=person->GetStaminaPoints(); + tempint = staminalevel + stamina; + if(tempint < 0) { + stamina = stamina + absolute_value(tempint); + } + person->AddStaminaPoints(stamina); + if(stamina > 0){ + say(scanner->GetName()+" points a medical tricorder at "+capitalize(whom)+", "+ + "and "+nominative(person)+" looks a bit more at ease.", ({person,scanner}) ); + tell_object(person,scanner->GetName()+" points a medical tricorder at you and you "+ + "suddenly feel stronger."); + write("You've raised "+capitalize(whom)+"'s stamina level by "+stamina+" points."); + return 1; + } + if(stamina < 0){ + stamina=absolute_value(stamina); + say(scanner->GetName()+" points a medical tricorder at "+capitalize(whom)+", "+ + "and "+nominative(person)+" looks uncomfortable.", ({person,scanner}) ); + tell_object(person,scanner->GetName()+" points a medical tricorder at you and you "+ + "suddenly feel weaker."); + write("You've lowered "+capitalize(whom)+"'s stamina level by "+stamina+" points."); + return 1; + } + write("Aucun effet."); + return 1; + } + int modtox(string str, int poison){ + string whom; + int tempint,poisonlevel; + object person; + allowed=preAction(); + if(allowed==2) return 1; + if(!str){ + write("Syntax: modtox <person> <amount>"); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + sscanf(str,"%s %d",whom,poison); + if (!whom || !poison){ + write("Syntax: modtox <person> <amount>"); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + if(whom == "me") whom = this_player()->GetKeyName(); + if(!intp(poison)){ + write("Syntax: modtox <person> <amount>"); + write("Where <amount> is an integer. For example:\nmodtox joe 3\nmodtox mike -10\n"); + say(scanner->GetName()+" fumbles stupidly with a medical tricorder.",scanner); + return 1; + } + person=present(whom,environment(scanner)); + if(!person){ + write(capitalize(whom)+" isn't here."); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + poisonlevel=person->GetPoison(); + tempint = poisonlevel + poison; + if(tempint < 0) { + poison = poison + absolute_value(tempint); + } + person->AddPoison(poison); + if(poison > 0){ + say(scanner->GetName()+" points a medical tricorder at "+capitalize(whom)+", "+ + "and "+nominative(person)+" looks paler and shaky.", ({person,scanner}) ); + tell_object(person,scanner->GetName()+" points a medical tricorder at you and you "+ + "suddenly feel ill."); + write("You've raised "+capitalize(whom)+"'s poison level by "+poison+" points."); + return 1; + } + if(poison < 0){ + poison=absolute_value(poison); + say(scanner->GetName()+" points a medical tricorder at "+capitalize(whom)+", "+ + "and "+nominative(person)+" looks less ill.", ({person,scanner}) + ); + tell_object(person,scanner->GetName()+" points a medical tricorder at you and you "+ + "suddenly feel better than before."); + write("You've lowered "+capitalize(whom)+"'s poison level by "+poison+" points."); + return 1; + } + write("Aucun effet."); + return 1; + } + int modmag(string str, int magic){ + string whom; + int tempint,magiclevel; + object person; + allowed=preAction(); + if(allowed==2) return 1; + if(!str){ + write("Syntax: modmagic <person> <amount>"); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + sscanf(str,"%s %d",whom,magic); + if (!whom || !magic){ + write("Syntax: modmagic <person> <amount>"); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + if(whom == "me") whom = this_player()->GetKeyName(); + + if(!intp(magic)){ + write("Syntax: modmagic <person> <amount>"); + write("Where <amount> is an integer. For example:\nmodmagic joe 3\nmodmagic mike -10\n"); + say(scanner->GetName()+" fumbles stupidly with a medical tricorder.",scanner); + return 1; + } + person=present(whom,environment(scanner)); + if(!person){ + write(capitalize(whom)+" isn't here."); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + magiclevel=person->GetMagicPoints(); + tempint = magiclevel + magic; + if(tempint < 0) { + magic = magic + absolute_value(tempint); + } + person->AddMagicPoints(magic); + if(magic > 0){ + say(scanner->GetName()+" points a medical tricorder at "+capitalize(whom)+", "+ + "and "+nominative(person)+" glows briefly.", ({person,scanner}) ); + tell_object(person,scanner->GetName()+" points a medical tricorder at you and you "+ + "suddenly feel more magical."); + write("You've raised "+capitalize(whom)+"'s magic level by "+magic+" points."); + return 1; + } + if(magic < 0){ + magic=absolute_value(magic); + say(scanner->GetName()+" points a medical tricorder at "+capitalize(whom)+", "+ + "and "+nominative(person)+" looks somehow more plain.", ({person,scanner}) ); + tell_object(person,scanner->GetName()+" points a medical tricorder at you and you "+ + "suddenly feel less magical."); + write("You've lowered "+capitalize(whom)+"'s magic level by "+magic+" points."); + return 1; + } + write("Aucun effet."); + return 1; + } + int moddrink(string str, int drink){ + string whom; + int tempint,drinklevel; + object person; + allowed=preAction(); + if(allowed==2) return 1; + if(!str){ + write("Syntax: moddrink <person> <amount>"); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + sscanf(str,"%s %d",whom,drink); + if (!whom || !drink){ + write("Syntax: moddrink <person> <amount>"); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + if(whom == "me") whom = this_player()->GetKeyName(); + + if(!intp(drink)){ + write("Syntax: moddrink <person> <amount>"); + write("Where <amount> is an integer. For example:\nmoddrink joe 3\nmoddrink mike -10\n"); + say(scanner->GetName()+" fumbles stupidly with a medical tricorder.",scanner); + return 1; + } + person=present(whom,environment(scanner)); + if(!person){ + write(capitalize(whom)+" isn't here."); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + drinklevel=person->GetDrink(); + tempint = drinklevel + drink; + if(tempint < 0) { + drink = drink + absolute_value(tempint); + } + person->AddDrink(drink); + if(drink > 0){ + say(scanner->GetName()+" points a medical tricorder at "+capitalize(whom)+", "+ + "and "+nominative(person)+" looks a bit more at ease.", ({person,scanner}) ); + tell_object(person,scanner->GetName()+" points a medical tricorder at you and you "+ + "suddenly feel more hydrated."); + write("You've raised "+capitalize(whom)+"'s drink level by "+drink+" points."); + return 1; + } + if(drink < 0){ + drink=absolute_value(drink); + say(scanner->GetName()+" points a medical tricorder at "+capitalize(whom)+", "+ + "and "+nominative(person)+" looks uncomfortable.", ({person,scanner}) ); + tell_object(person,scanner->GetName()+" points a medical tricorder at you and you "+ + "suddenly feel thirstier."); + write("You've lowered "+capitalize(whom)+"'s drink level by "+drink+" points."); + return 1; + } + write("Aucun effet."); + return 1; + } + int modfood(string str, int food){ + string whom; + int tempint,foodlevel; + object person; + allowed=preAction(); + if(allowed==2) return 1; + if(!str){ + write("Syntax: modfood <person> <amount>"); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + sscanf(str,"%s %d",whom,food); + if (!whom || !food){ + write("Syntax: modfood <person> <amount>"); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + if(whom == "me") whom = this_player()->GetKeyName(); + + if(!intp(food)){ + write("Syntax: modfood <person> <amount>"); + write("Where <amount> is an integer. For example:\nmodfood joe 3\nmodfood mike -10\n"); + say(scanner->GetName()+" fumbles stupidly with a medical tricorder.",scanner); + return 1; + } + person=present(whom,environment(scanner)); + if(!person){ + write(capitalize(whom)+" isn't here."); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + foodlevel=person->GetFood(); + tempint = foodlevel + food; + if(tempint < 0) { + food = food + absolute_value(tempint); + } + person->AddFood(food); + if(food > 0){ + say(scanner->GetName()+" points a medical tricorder at "+capitalize(whom)+", "+ + "and "+nominative(person)+" looks a bit more at ease.", ({person,scanner}) ); + tell_object(person,scanner->GetName()+" points a medical tricorder at you and you "+ + "suddenly feel more nourished."); + write("You've raised "+capitalize(whom)+"'s food level by "+food+" points."); + return 1; + } + if(food < 0){ + food=absolute_value(food); + say(scanner->GetName()+" points a medical tricorder at "+capitalize(whom)+", "+ + "and "+nominative(person)+" looks uncomfortable.", ({person,scanner}) ); + tell_object(person,scanner->GetName()+" points a medical tricorder at you and you "+ + "suddenly feel hungrier."); + write("You've lowered "+capitalize(whom)+"'s food level by "+food+" points."); + return 1; + } + write("Aucun effet."); + return 1; + } + int modcaff(string str, int caff){ + string whom; + int tempint,cafflevel; + object person; + allowed=preAction(); + if(allowed==2) return 1; + if(!str){ + write("Syntax: modcaff <person> <amount>"); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + sscanf(str,"%s %d",whom,caff); + if (!whom || !caff){ + write("Syntax: modcaff <person> <amount>"); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + if(whom == "me") whom = this_player()->GetKeyName(); + + if(!intp(caff)){ + write("Syntax: modcaff <person> <amount>"); + write("Where <amount> is an integer. For example:\nmodcaff joe 3\nmodcaff mike -10\n"); + say(scanner->GetName()+" fumbles stupidly with a medical tricorder.",scanner); + return 1; + } + + person=present(whom,environment(scanner)); + if(!person){ + write(capitalize(whom)+" isn't here."); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + cafflevel=person->GetCaffeine(); + tempint = cafflevel + caff; + if(tempint < 0) { + caff = caff + absolute_value(tempint); + } + person->AddCaffeine(caff); + if(caff > 0){ + say(scanner->GetName()+" points a medical tricorder at "+capitalize(whom)+", "+ + "and "+nominative(person)+" looks a bit keener.", ({person,scanner}) ); + tell_object(person,scanner->GetName()+" points a medical tricorder at you and you "+ + "suddenly feel tipsy."); + write("You've raised "+capitalize(whom)+"'s caffeine level by "+caff+" points."); + return 1; + } + if(caff < 0){ + caff=absolute_value(caff); + say(scanner->GetName()+" points a medical tricorder at "+capitalize(whom)+", "+ + "and "+nominative(person)+" looks more focused and alert.", ({person,scanner}) ); + tell_object(person,scanner->GetName()+" points a medical tricorder at you and you "+ + "suddenly feel more awake."); + write("You've lowered "+capitalize(whom)+"'s caffeine level by "+caff+" points."); + return 1; + } + write("Aucun effet."); + return 1; + } + int modalc(string str, int alc){ + string whom; + int tempint,alclevel; + object person; + allowed=preAction(); + if(allowed==2) return 1; + if(!str){ + write("Syntax: modalc <person> <amount>"); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + sscanf(str,"%s %d",whom,alc); + if (!whom || !alc){ + write("Syntax: modalc <person> <amount>"); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + if(whom == "me") whom = this_player()->GetKeyName(); + + if(!intp(alc)){ + write("Syntax: modalc <person> <amount>"); + write("Where <amount> is an integer. For example:\nmodalc joe 3\nmodalc mike -10\n"); + say(scanner->GetName()+" fumbles stupidly with a medical tricorder.",scanner); + return 1; + } + + person=present(whom,environment(scanner)); + if(!person){ + write(capitalize(whom)+" isn't here."); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + alclevel=person->GetAlcohol(); + tempint = alclevel + alc; + if(tempint < 0) { + alc = alc + absolute_value(tempint); + } + + person->AddAlcohol(alc); + if(alc > 0){ + say(scanner->GetName()+" points a medical tricorder at "+capitalize(whom)+", "+ + "and "+nominative(person)+" looks dizzier and more disoriented.", ({person,scanner}) ); + tell_object(person,scanner->GetName()+" points a medical tricorder at you and you "+ + "suddenly feel tipsy."); + write("You've raised "+capitalize(whom)+"'s alcohol level by "+alc+" points."); + return 1; + } + if(alc < 0){ + alc=absolute_value(alc); + say(scanner->GetName()+" points a medical tricorder at "+capitalize(whom)+", "+ + "and "+nominative(person)+" looks more focused and alert.", ({person,scanner}) ); + tell_object(person,scanner->GetName()+" points a medical tricorder at you and you "+ + "suddenly feel more sober."); + write("You've lowered "+capitalize(whom)+"'s alcohol level by "+alc+" points."); + return 1; + } + write("Aucun effet."); + return 1; + } + int addhp(string str, int hp){ + string whom; + object person; + allowed=preAction(); + if(allowed==2) return 1; + if(!str){ + write("Syntax: addhp <person> <amount>"); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + sscanf(str,"%s %d",whom,hp); + if (!whom || !hp){ + write("Syntax: addhp <person> <amount>"); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + if(whom == "me") whom = this_player()->GetKeyName(); + + if(!intp(hp)){ + write("Syntax: addhp <person> <amount>"); + write("Where <amount> is an integer. For example:\naddhp joe 3\naddhp mike -10\n"); + say(scanner->GetName()+" fumbles stupidly with a medical tricorder.",scanner); + return 1; + } + person=present(whom,environment(scanner)); + if(!person){ + write(capitalize(whom)+" isn't here."); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + person->AddHP(hp); + if(hp > 0){ + say(scanner->GetName()+" points a medical tricorder at "+capitalize(whom)+", "+ + "and "+nominative(person)+" looks stronger and more refreshed.", ({person,scanner}) ); + tell_object(person,scanner->GetName()+" points a medical tricorder at you and you "+ + "suddenly feel stronger and more refreshed."); + write("You've raised "+capitalize(whom)+"'s health by "+hp+" points."); + return 1; + } + if(hp < 0){ + hp=absolute_value(hp); + say(scanner->GetName()+" points a medical tricorder at "+capitalize(whom)+", "+ + "and "+nominative(person)+" looks weaker and duller.", ({person,scanner}) ); + tell_object(person,scanner->GetName()+" points a medical tricorder at you and you "+ + "suddenly feel weaker and more frail."); + write("You've lowered "+capitalize(whom)+"'s health by "+hp+" points."); + return 1; + } + write("Aucun effet."); + return 1; + } + int extract(string str){ + string what,whom; + object person, slug; + int rifleshot_wounds,firearms_wounds,wounds; + allowed=preAction(); + if(allowed==2) return 1; + if(!str){ + write("Extract what from whom?"); + write("Example: extract slug from <person>"); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + sscanf(str,"%s from %s",what,whom); + if (!what || ! whom){ + write("Extract what from whom?"); + write("Example: extract slug from <person>"); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + if(whom == "me") whom = this_player()->GetKeyName(); + person=present(whom,environment(scanner)); + if(!person){ + write(capitalize(whom)+" isn't here."); + say(scanner->GetName()+" fumbles with a medical tricorder.",scanner); + return 1; + } + slug=present("firearms_wound",person); + wounds=0; + wounds=person->GetLead("gunshot_wounds"); + wounds+=person->GetLead("rifleshot_wounds"); + if(!slug && what=="slug"){ + write(capitalize(whom)+" has no gunshot injury."); + say(scanner->GetName()+" looks a bit silly waving a medical tricorder at "+capitalize(whom)+".",({ scanner, person }) ); + tell_object(person,scanner->GetName()+" looks a bit silly waving a medical tricorder at you."); + return 1; + } + if(slug && what=="slug" && wounds > 0 ){ + write("You extract a lead slug from "+capitalize(whom)+"'s body."); + say(scanner->GetName()+" deftly extracts a lead slug from "+capitalize(whom)+" with a medical tricorder.",({ scanner, person }) ); + tell_object(person,scanner->GetName()+" deftly extracts a lead slug from you with a medical tricorder."); + firearms_wounds=person->GetLead("firearms_wounds"); + rifleshot_wounds=person->GetLead("rifleshot_wounds"); + slug=new("/domains/town/obj/spent"); + if(person->GetLead("gunshot_wounds") > 0) { + person->AddLead("gunshot_wounds", -1); + slug->SetShort("a spent pistol slug"); + --wounds; + slug->eventMove(environment(scanner)); + if(person->GetLead() < 1){ + slug=present("firearms_wound",person); + if(slug) slug->eventDestruct(); + return 1; + } + return 1; + } + if(person->GetLead("rifleshot_wounds") > 0) { + person->AddLead("rifleshot_wounds", -1); + slug->SetShort("a spent rifle slug"); + --wounds; + slug->eventMove(environment(scanner)); + if(person->GetLead() < 1){ + if(slug) slug->eventDestruct(); + slug=present("firearms_wound",person); + if(slug) slug->eventDestruct(); + return 1; + } + } + slug->eventMove(environment(scanner)); + slug=present("firearms_wound",person); + if(wounds < 1 && slug){ + slug->eventDestruct(); + return 1; + } + } + return 1; + } + int fscan(string str){ + object ob; + object *stuffs; + mixed *stuff; + allowed=preAction(); + if(allowed==2) return 1; + if(!str || str=="" || str=="here") { + ob = environment(this_player()); + name = ob->GetShort(); + str = base_name(ob); + } + if(str == "me") str = this_player()->GetKeyName(); + if(present(str,this_player())) { + ob = present(str,this_player()); + name = ob->GetName(); + } + if(present(str,environment(this_player()))) { + ob=present(str,environment(this_player())); + name = ob->GetName(); + } + if(!ob){ + write("The tricorder fails to locate any such person, object, or environment.\n"); + say(this_player()->GetName()+" scans around aimlessly with "+ + " a medical tricorder.\n"); + return 1; + } + write("You perform a file scan of "+name+".\n\n"); + write("\n"+name+" is in posession of the following items:"); + write("-------------------------------------------"); + say(this_player()->GetName()+" performs a tricorder scan of "+name+".\n",ob); + tell_object(ob,this_player()->GetName()+" scans you with "+ + "a medical tricorder.\n"); + stuffs=deep_inventory(ob); + filter(stuffs, (: this_object()->analyze(file_name($1)) :), this_object()); + filter(stuffs, (: this_object()->getname($1) :), this_object()); + stuff=deep_inherit_list(ob); + write("\n"+name+" is composed of the following files:\n"); + write("-------------------------------------------"); + foreach(mixed gene in deep_inherit_list(ob)) { + if(!stringp(gene)) break; + if(!gene) gene=""; + write(gene); + } + write("\nSCAN COMPLETE"); + return 1; + } + void analyze(string str){ + string temp, temp2; + sscanf(str,"%s#%s",temp,temp2); + if(temp=="/lib/corpse"){ + write("Found a corpse. Absolute name:\n"+str); + return; + } + return; + } + string getname(object ob){ + string temp, temp2; + if(!ob) return "No object found."; + else + sscanf(file_name(ob),"%s#%s",temp,temp2); + write(ob->GetName()+",\t\tfilename: "+temp+".c"); + return ob->GetName(); + } + mixed assess(string args) { + string *lines, *arr, *limbs; + object ob; + string tmp1, tmp2; + int i, x, y, cols; + if( args == "" || !args ) return 0; + if(args == "me") args = this_player()->GetKeyName(); + if( !(ob = present(args, environment(this_player()))) ) + if( !(ob = find_player(convert_name(args))) && + !(ob = find_living(lower_case(args))) ) + return capitalize(args) + " is nowhere to be found."; + if( creatorp(ob) ) return "You cannot get stat information on a creator."; + if(tmp1 = ob->GetGender()) { + cols = ((int *)this_player()->GetScreen())[0]; + tmp1 = (string)ob->GetCapName() + " aka " + (string)ob->GetShort() + + ", level " + (int)ob->GetLevel() + " " + (string)ob->GetGender(); + if( !(tmp2 = (string)ob->GetRace()) ) tmp2 = "blob"; + tmp1 += " " + tmp2; + if( !(tmp2 = (string)ob->GetClass()) ) tmp2 = "drifter"; + tmp1 += " " + capitalize(tmp2); + if( tmp2 = (string)ob->GetSpouse() ) + tmp1 += " (spouse: " + tmp2 + ")"; + lines = ({ center(tmp1, cols) }); + if( (int)ob->GetUndead() ) tmp1 = "Undead"; + else tmp1 = "Alive"; + if( (int)ob->GetSleeping() ) tmp1 += " / Sleeping"; + else tmp1 += " / Awake"; + if( (int)ob->GetParalyzed() ) tmp1 += " / Paralyzed"; + lines += ({ center(tmp1, cols), "" }); + lines += ({ center("Health: " +(int)ob->GetHealthPoints() + "/"+ + (int)ob->GetMaxHealthPoints() + " Magic: " + + (int)ob->GetMagicPoints() + "/" + + (int)ob->GetMaxMagicPoints() + " Stamina: " + + (int)ob->GetStaminaPoints() + "/" + + to_int((float)ob->GetMaxStaminaPoints()) + " Carry: " + + (int)ob->GetCarriedMass() + "/" + + (int)ob->GetMaxCarry(), cols) }); + lines += ({ center("Food: " + (int)ob->GetFood() + " " + + "Drink: " + (int)ob->GetDrink() + " " + + "Alcohol: " + (int)ob->GetAlcohol() + " " + + "Caffeine: " + (int)ob->GetCaffeine() + " " + + "Poison: " + (int)ob->GetPoison() + " ", cols) }); + lines += ({ center("Training Points: " + (int)ob->GetTrainingPoints()) }); + lines += ({ "", "Limbs:" }); + limbs = (string *)ob->GetWieldingLimbs(); + arr = map((string *)ob->GetLimbs(), + (: sprintf("%:-14s%s (%d) %d/%d", $1, + ((member_array($1, $(limbs)) == -1) ? " " : "*"), + (int)($(ob))->GetLimbClass($1), + (int)($(ob))->GetHealthPoints($1), + (int)($(ob))->GetMaxHealthPoints($1)) :)); + i = sizeof(arr); + while(i--) if( (y = strlen(arr[i])) > x ) x = y; + x = cols/(x+2); + lines += explode(format_page(arr, x), "\n") + ({ "", "Skills:" }); + arr = map((string *)ob->GetSkills(), + function(string skill, object who) { + mapping mp = (mapping)who->GetSkill(skill); + int x; + x = to_int(percent(mp["points"], + (int)who->GetMaxSkillPoints(skill, mp["level"]))); + return sprintf("%:-18s (%d) %:2d%% - %d/%d", + skill, mp["class"], x, + (int)who->GetSkillLevel(skill), mp["level"] ); + }, ob); + i = sizeof(arr); + while(i--) if( (y = strlen(arr[i])) > x ) x = y; + x = cols/(x+2); + lines += explode(format_page(arr, x), "\n") + ({ "", "Stats:" }); + arr = map((string *)ob->GetStats(), + (: sprintf("%:-12s (%d) %d/%d", $1, + (int)($(ob))->GetStatClass($1), + (int)($(ob))->GetStatLevel($1), + (int)($(ob))->GetBaseStatLevel($1)) :)); + i = sizeof(arr); + x = 0; + while(i--) if( (y = strlen(arr[i])) > x ) x = y; + x =cols/(x+2); + lines += explode(format_page(arr, x), "\n"); + lines += ({ "", (string)ob->GetName()+" has amassed a net worth of " + + ( (int)ob->GetNetWorth() * currency_rate("gold") ) + " gold."}); + arr = filter( map((string *)ob->GetCurrencies(), + (: ($(ob))->GetCurrency($1) && + sprintf("%d %s", ($(ob))->GetCurrency($1), $1) :)), + (: $1 :)); + lines += ({ "Money on hand: "+implode(arr, ", ") }); + this_player()->eventPage(lines, "system"); + return 1; + } + else { + write("You can't stat a non-living object!"); + return 1; + } + } diff -c -r --new-file ds1.1/lib/secure/obj/memo.c ds2.0r27/lib/secure/obj/memo.c *** ds1.1/lib/secure/obj/memo.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/obj/memo.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,95 ---- + /* memo pad by Cratylus @ Frontiers + * Sep 21 2005 + */ + + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + int dirchecked; + string ownerstr,capownerstr,fileread; + object ownerob; + void create(){ + ::create(); + SetKeyName("memo pad"); + SetId( ({"pad","memo","memo pad","notepad"}) ); + SetShort("a yellow memo pad"); + SetLong("A yellow pad of papers to write your memos on. "+ + "There seems to be instructions on the reverse side."); + SetMass(20); + SetValue(10); + SetVendorType(VT_TREASURE); + } + void init(){ + add_action("memo","memo"); + add_action("read_memo","read"); + add_action("clean_memo","fresh"); + add_action("erase_memo","erase"); + add_action("help_memo","help"); + add_action("exa_inst","examine"); + add_action("exa_inst","look"); + add_action("exa_inst","look at"); + ownerob=environment(this_object()); + if(living(ownerob)) capownerstr=capitalize(ownerob->GetKeyName()); + if(capownerstr) ownerstr=lower_case(capownerstr); + dirchecked=0; + } + int memo(string str){ + if(!dirchecked){ + this_object()->checkdir(); + } + if(!str){ + write("You do not write anything on your memo pad.\n"); + return 1; + } + write_file("/realms/"+ownerstr+"/log/memo",str+"\n"); + write("You add a memorandum to your memo pad.\n"); + say(capownerstr+" scribbles in "+possessive(this_player())+" memo pad."); + return 1; + } + int read_memo(string str){ + if(str=="memo" || str=="memo pad" || str=="pad" || str=="notepad"){ + if(!dirchecked){ + this_object()->checkdir(); + } + fileread=read_file("/realms/"+ownerstr+"/log/memo"); + if(!fileread){ + write("The memo pad is blank.\n"); + return 1; + } + write("The pad reads:\n"+fileread+"\n"); + say(capownerstr+" flips through "+possessive(this_player())+" memo pad.\n"); + return 1; + } + if(str=="instructions" || str=="instruction"){ + this_object()->help_msg(); + return 1; + } + } + int help_mem(string str){ + if(str=="memo" || str=="memo pad" ||str=="pad"||str=="notepad"){ + this_object()->help_msg(); + return 1; + } + } + int help_msg(){ + write("The back of the pad reads:\n\n"+ + "cReMem Memo Pad, For your note-taking needs! Memo pad commands:\n"+ + "----------\n"+ + "memo <string> : Writes <string> into the pad.\n"+ + "read memo : Reads the contents of your memo pad.\n"+ + "----------\n"); + say(capownerstr+" reads the back of a memo pad.\n"); + return 1; + } + int exa_inst(string str){ + if(str=="instruction" || str=="instructions" || + str=="at instruction" || str=="at instructions"){ + write("Instructions on the use of the memo pad.\n"); + return 1; + } + } + int checkdir(){ + if(file_size("/realms/"+ownerstr+"/log") != -2) mkdir("/realms/"+ownerstr+"/log"); + dirchecked=1; + return 1; + } diff -c -r --new-file ds1.1/lib/secure/obj/mojo.c ds2.0r27/lib/secure/obj/mojo.c *** ds1.1/lib/secure/obj/mojo.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/obj/mojo.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,74 ---- + #include <lib.h> + #include <vendor_types.h> + #include <damage_types.h> + inherit LIB_ITEM; + int damage1(); + int damage2(); + int damage3(); + int damage4(); + object victim; + int counter; + + void create(){ + ::create(); + SetKeyName("clepius mojo"); + SetId(({"clepius mojo"})); + SetLong(" "); + SetInvis(1); + set_heart_beat(1); + counter = 0; + } + + void init(){ + if(living(environment())){ + victim = environment(); + } + } + + + int eventMojofy(){ + int x; + x=random(100); + if(x < 5) damage4(); + else if(x < 20) damage3(); + else if(x < 35) damage2(); + else if(x < 50) damage1(); + return 1; + } + + int damage1(){ + if( victim && victim->GetStaminaPoints() < 50) victim->AddStaminaPoints(random(5)+1); + return 1; + } + + int damage2(){ + if(victim) victim->AddHP(1); + return 1; + } + + int damage3(){ + if(victim) victim->AddHP(2); + return 1; + } + + int damage4(){ + if(victim) victim->AddHP(3); + return 1; + } + + void heart_beat(){ + if(environment() && !living(environment())) this_object()->eventDestruct(); + if(counter == 100){ + if(environment()) tell_object(environment(),"You feel the effects of the healing salve wear off."); + this_object()->eventMove("/domains/town/room/furnace"); + } + + counter++; + eventMojofy(); + } + + + + mixed CanGet(object ob) { return " ";} + mixed CanDrop(object ob) { return " ";} + diff -c -r --new-file ds1.1/lib/secure/obj/post.c ds2.0r27/lib/secure/obj/post.c *** ds1.1/lib/secure/obj/post.c Sun Feb 1 21:30:47 1998 --- ds2.0r27/lib/secure/obj/post.c Wed Jul 5 00:01:06 2006 *************** *** 3,16 **** * the user front end to the IIPS version 3.1 * created by Descartes of Borg 940509 */ ! #include <lib.h> #include <daemons.h> #include <iips.h> #include "include/post.h" ! inherit LIB_ITEM; ! static private int __Screen, __Lines, __NumLetters; static private int __Begin,__Current,__CommandLine,__FromMenu,__IncomingFlag; static private string __Folder, __Owner, __CurrentMenu; --- 3,16 ---- * the user front end to the IIPS version 3.1 * created by Descartes of Borg 940509 */ ! #include <lib.h> #include <daemons.h> #include <iips.h> #include "include/post.h" ! inherit LIB_ITEM; ! static private int __Screen, __Lines, __NumLetters; static private int __Begin,__Current,__CommandLine,__FromMenu,__IncomingFlag; static private string __Folder, __Owner, __CurrentMenu; *************** *** 18,24 **** static private int *__Delete; static private string *__FwdRply; static private mapping *__BoxInfo, *__PostalOptions; ! void create() { item::create(); SetKeyName("post box"); --- 18,24 ---- static private int *__Delete; static private string *__FwdRply; static private mapping *__BoxInfo, *__PostalOptions; ! void create() { item::create(); SetKeyName("post box"); *************** *** 35,82 **** SetPreventPut( (: Destruct :) ); __PostalOptions = ({ ([ "key":"askcc", "value":({"N","Y"}), "desc":"Prompt for cc when " ! "sending mail:" ]), (["key":"quit", "value":({"N","Y"}), "desc":"Confirm quit from mail:"]), (["key":"metoo", "value":({"N","Y"}),"desc":"Send mail to yourself " ! "with you in alias:"]), (["key":"delete", "value":({"N","Y"}), "desc":"Confirm deletion of " ! "letters:" ]), (["key":"notify", "value":({"N","Y"}), "desc":"Notify me when new mail " ! "is received:" ]), ([ "key":"message", "value":"New mail has arrived from $N\n" ! "Subject: $S", "desc":"Mail message when notify occurs:" ]), ([ "key": "content", "value":({"message only", "header and message"}), ! "desc":"Content of letters when reading mail:" ]), ([ "key":"forward", "value":"none", "desc":"Address to forward " ! "incoming mail to:" ]), ([ "key":"sig file", "value":"none", "desc":"Signature file:" ]), ([ "key":"commands", "value":({"N","Y"}), "desc":"Exclude command " ! "listing from menus:" ]), ([ "key":"read", "value":({"N","Y"}), "desc":"Read letter when you make " ! "it current:" ]) ! }); } ! void init() { item::init(); if(this_player() != environment(this_object())) { ! this_object()->eventDestruct(); ! return; } __Options = (mapping)OPTIONS_D->query_options(__Owner = (string)this_player()->GetKeyName()); if(!(__Lines = to_int((string)this_player()->GetEnvVar("LINES")))) ! __Lines = 24; if(!(__Screen = to_int((string)this_player()->GetEnvVar("SCREEN")))) ! __Screen = 80; if((__NumLetters = __Lines - 10) < 0) __NumLetters = 5; } ! static private void restore_box(string folder) { int x; ! if(!pointerp(__BoxInfo=(mapping *)FOLDERS_D->query_box_info(__Owner, folder))) ! __BoxInfo = ({}); __Folder = folder; __TmpPost = ([]); __Delete = allocate(x = sizeof(__BoxInfo)); --- 35,82 ---- SetPreventPut( (: Destruct :) ); __PostalOptions = ({ ([ "key":"askcc", "value":({"N","Y"}), "desc":"Prompt for cc when " ! "sending mail:" ]), (["key":"quit", "value":({"N","Y"}), "desc":"Confirm quit from mail:"]), (["key":"metoo", "value":({"N","Y"}),"desc":"Send mail to yourself " ! "with you in alias:"]), (["key":"delete", "value":({"N","Y"}), "desc":"Confirm deletion of " ! "letters:" ]), (["key":"notify", "value":({"N","Y"}), "desc":"Notify me when new mail " ! "is received:" ]), ([ "key":"message", "value":"New mail has arrived from $N\n" ! "Subject: $S", "desc":"Mail message when notify occurs:" ]), ([ "key": "content", "value":({"message only", "header and message"}), ! "desc":"Content of letters when reading mail:" ]), ([ "key":"forward", "value":"none", "desc":"Address to forward " ! "incoming mail to:" ]), ([ "key":"sig file", "value":"none", "desc":"Signature file:" ]), ([ "key":"commands", "value":({"N","Y"}), "desc":"Exclude command " ! "listing from menus:" ]), ([ "key":"read", "value":({"N","Y"}), "desc":"Read letter when you make " ! "it current:" ]) ! }); } ! void init() { item::init(); if(this_player() != environment(this_object())) { ! this_object()->eventDestruct(); ! return; } __Options = (mapping)OPTIONS_D->query_options(__Owner = (string)this_player()->GetKeyName()); if(!(__Lines = to_int((string)this_player()->GetEnvVar("LINES")))) ! __Lines = 24; if(!(__Screen = to_int((string)this_player()->GetEnvVar("SCREEN")))) ! __Screen = 80; if((__NumLetters = __Lines - 10) < 0) __NumLetters = 5; } ! static private void restore_box(string folder) { int x; ! if(!pointerp(__BoxInfo=(mapping *)FOLDERS_D->query_box_info(__Owner, folder))) ! __BoxInfo = ({}); __Folder = folder; __TmpPost = ([]); __Delete = allocate(x = sizeof(__BoxInfo)); *************** *** 84,90 **** else __Current = 0; __Begin = 0; } ! static private void save_box() { FOLDERS_D->delete_posts(__Owner, __Folder, __Delete); } --- 84,90 ---- else __Current = 0; __Begin = 0; } ! static private void save_box() { FOLDERS_D->delete_posts(__Owner, __Folder, __Delete); } *************** *** 93,99 **** message("mail", str, this_player()); this_object()->eventDestruct(); } ! static private int valid_folder(string str) { int i; --- 93,99 ---- message("mail", str, this_player()); this_object()->eventDestruct(); } ! static private int valid_folder(string str) { int i; *************** *** 103,121 **** while(i-- > 1) if(str[i] < 'a' || str[i] > 'z') return 0; return 1; } ! static private int set_current(mixed val) { int i; if(intp(val)) __Current = val; else { ! i = sizeof(__BoxInfo); ! while(i--) { ! if(__BoxInfo[i]["id"] == val) { ! __Current = i; ! break; ! } ! } } if(__Current < __Begin) __Begin = __Current; else if(__Current >= __Begin+10) __Begin = __Current-9; --- 103,121 ---- while(i-- > 1) if(str[i] < 'a' || str[i] > 'z') return 0; return 1; } ! static private int set_current(mixed val) { int i; if(intp(val)) __Current = val; else { ! i = sizeof(__BoxInfo); ! while(i--) { ! if(__BoxInfo[i]["id"] == val) { ! __Current = i; ! break; ! } ! } } if(__Current < __Begin) __Begin = __Current; else if(__Current >= __Begin+10) __Begin = __Current-9; *************** *** 127,513 **** int i, maxi;; if(str && str != "") { ! maxi = sizeof(args = explode(str, " ")); ! if(args[0][0] == '-' && strlen(args[0]) == 2) { ! switch(args[0][1]) { ! case 'r': ! restore_box("new"); ! index_cmd(""); ! return; ! case 'f': ! if(maxi < 2) { ! message("mail", "No folder named.", this_player()); ! this_object()->eventDestruct(); ! return; ! } ! else if(maxi>2 || (!valid_folder(args[1]) && ! args[1] != "new")) { ! message("mail", "Illegal folder name.", this_player()); ! this_object()->eventDestruct(); ! return; ! } ! else { ! restore_box(args[1]); ! indices(0); ! return; ! } ! case 'a': ! __CommandLine = 1; ! if(maxi < 2) index_cmd("a"); ! else index_cmd(implode(args[1..maxi-1], " ")); ! return; ! } ! } ! __CommandLine = 1; ! __TmpPost = ([]); ! __FwdRply = 0; ! send_letter(args); ! return; } restore_box("new"); indices(0); } ! static private void primary_prompt() { message("prompt", "\nCommand: ", this_player()); } ! static private void secondary_prompt() { message("prompt", sprintf("\nCommand (%s for %s menu): ", ! __CurrentMenu[0..0], __CurrentMenu), this_player()); } ! varargs static private void postal_error(string str, string ind, mixed args) { message("mail", sprintf("\n%%^RED%%^%s", str), this_player()); primary_prompt(); if(args) input_to(sprintf("%s_cmd", (ind ? ind : __CurrentMenu)), args); else input_to(sprintf("%s_cmd", (ind ? ind : __CurrentMenu))); ! } ! varargs static private void postal_success(string str,string ind,mixed args) { message("mail", sprintf("\n%%^GREEN%%^%s", str), this_player()); secondary_prompt(); if(args) input_to(sprintf("%s_cmd", (ind ? ind : __CurrentMenu)), args); else input_to(sprintf("%s_cmd", (ind ? ind : __CurrentMenu))); ! } ! varargs static void indices(int x, string str) { int i, maxi; ! __CurrentMenu = "index"; if(str && str != "") { ! index_cmd(str); ! return; } __Begin = x; __FromMenu = 1; message("mail", "\n%^INITTERM%^Imaginary Intermud Postal Service " "(IIPS) 3.1 Descartes of Borg 1993, 1994", this_player()); message("mail", sprintf("\n%%^CYAN%%^%s", center(sprintf("Folder is %s " ! "with %s.\n",__Folder,consolidate(maxi=sizeof(__BoxInfo),"one letter")), ! __Screen)), this_player()); if(!maxi) __Current = -1; else for(i=x; i<maxi && i < x+__NumLetters; i++) ! message("mail", sprintf("%s%s) %s %s %s %s %s", ! (__Current == i ? "%^YELLOW%^BOLD%^*" : " "), ! ((i+1 > 99) ? (""+(i+1)) : ((i+1 > 9) ? (" "+(i+1)) : (" "+(i+1)))), ! (__BoxInfo[i]["read"] ? " " : "N"), ! (__Delete[i] ? "D" : " "), ! arrange_string(capitalize(__BoxInfo[i]["from"]), 20), ! arrange_string(postal_time(__BoxInfo[i]["date"]), 7), ! arrange_string(__BoxInfo[i]["subject"], __Screen-40)), this_player()); index_menu(); } ! varargs static void aliases(string str) { __CurrentMenu = "alias"; if(str && str != "") { ! alias_cmd(str); ! return; } message("mail", "\n%^INITTERM%^Imaginary Intermud Postal Service " "(IIPS) 3.1 Descartes of Borg 1993, 1994", this_player()); message("mail", sprintf("\n%%^CYAN%%^%s", center(sprintf("%s and " ! "Personal Alias Menu", mud_name()))), this_player()); message("mail", sprintf("\n%s", ! format_page(keys((mapping)OPTIONS_D->query_groups(__Owner) + ! (mapping)LOCALPOST_D->query_mud_groups()),__Screen/20)),this_player()); alias_menu(); } ! varargs static void options(string str) { string tmp; int i, maxi; ! __CurrentMenu = "option"; if(str && str != "") { ! option_cmd(str); ! return; } message("mail", "\n%^INITTERM%^Imaginary Intermud Postal Service " "(IIPS) 3.1 Descartes of Borg 1993, 1994", this_player()); message("mail", sprintf("\n%%^CYAN%%^%s", center("IIPS 3.1 Options Menu\n", ! __Screen)), this_player()); maxi = sizeof(__PostalOptions); for(i=0; i<maxi; i++) { ! if(pointerp(__PostalOptions[i]["value"])) ! tmp = __PostalOptions[i]["value"][__Options[__PostalOptions[i]["key"]]]; ! else if(!(tmp = __Options[__PostalOptions[i]["key"]])) ! tmp = __PostalOptions[i]["value"]; ! message("mail", sprintf("%s) %-45s %s", (i+1>9) ? (i+1)+"" :" "+(i+1), ! __PostalOptions[i]["desc"], tmp), ! this_player()); ! } option_menu(); ! } ! static private void help(string arg, string ind) { if(!ind) ind = __CurrentMenu; if(arg && arg != "") { ! help_cmd(arg, ind); ! return; ! } message("mail", "\n%^INITTERM%^Imaginary Intermud Postal Service " "(IIPS) 3.1 Descartes of Borg 1993, 1994", this_player()); message("mail",sprintf("\n%%^CYAN%%^%s",center("IIPS 3.1 Help Menu", ! __Screen)), this_player()); help_menu(ind); } ! static private void index_menu() { if(__Options["commands"]) { ! primary_prompt(); ! input_to("index_cmd"); ! return; } message("mail", "\n"+center("a)lias menu, c)hange folder, d)elete, " ! "f)orward, h)elp, m)ail,", __Screen), this_player()); message("mail", center("n)ext letter, o)ptions menu, p)revious " ! "letter, q)uit, Q)uit without saving,", __Screen), this_player()); message("mail", center("s)ave to folder, S)ave to file, " ! "u)ndelete", __Screen), this_player()); message("mail", center("<return> to read selected letter", __Screen), this_player()); primary_prompt(); input_to("index_cmd"); ! } ! static private void alias_menu() { if(__Options["commands"]) { ! primary_prompt(); ! input_to("alias_cmd"); ! return; } message("mail", center("d)elete from an alias, e)nter into an alias, " ! "h)elp, i)ndex menu, ", __Screen), this_player()); message("mail", center("l)ist an alias, m)ake an alias, o)ptions menu, " ! "q)uit, Q)uit without saving, ", __Screen), this_player()); message("mail", center("r)emove an alias", __Screen),this_player()); primary_prompt(); input_to("alias_cmd"); ! } ! static private void option_menu() { if(__Options["commands"]) { ! primary_prompt(); ! input_to("option_cmd"); ! return; } message("mail", "\n"+center("Enter the number of an option to " ! "change it.", __Screen), this_player()); message("mail", center("a)lias menu, h)elp, i)ndex menu, " ! "q)uit, Q)uit without saving,", __Screen), this_player()); message("mail", center("s)ave option changes", __Screen), this_player()); primary_prompt(); input_to("option_cmd"); } ! static private void help_menu(string ind) { int i, maxi; message("help", "\n\n\tEnter one of the following to visit " "another menu:", this_player()); message("help", center("a)lias menu, i)ndex menu, o)ptions menu", ! __Screen), this_player()); message("help", "\n\tOr enter one of the following for detailed help:", this_player()); switch(ind) { ! case "index": ! message("help", center("c)hange folder, d)elete, f)orward, " ! "m)ail letter, n)ext letter,", __Screen), this_player()); ! message("help", center("p)revious letter, q)uit, " ! "Q)uit without saving, r)eply,", __Screen), this_player()); ! message("help", center("s)ave to folder, S)ave to file,", ! __Screen), this_player()); ! message("help", center("x) help from another menu, y) detailed " ! "IIPS user manual", __Screen), this_player()); ! break; ! case "alias": ! message("help", center("d)elete from an alias, e)nter into " ! "an alias, m)ake an alias, q)uit,", __Screen), this_player()); ! message("help", center("Q)uit without saving, r)emove " ! "an alias,", __Screen), this_player()); ! message("help", center("x) help from another menu, y) detailed " ! "IIPS user manual", __Screen), this_player()); ! break; ! case "option": ! for(i=0, maxi = sizeof(__PostalOptions); i<maxi;i++) ! message("help", center(sprintf("%d) %s", (i+1), ! __PostalOptions[i]["desc"]), __Screen), this_player()); ! message("help", sprintf("\n%s",center("Also: q)uit, Q)uit without " ! "saving, s)ave option changes,", __Screen)), this_player()); ! message("help", center("x) help from another menu, y) detailed " ! "IIPS user manual", __Screen), this_player()); ! break; ! default: ! postal_error("Invalid postal menu."); ! return; } primary_prompt(); input_to("help_cmd", ind); } ! static void index_cmd(string str) { string cmd, args; string *tmp; int x; ! __CurrentMenu = "index"; if(__IncomingFlag) { ! __IncomingFlag = 0; ! postal_error("New mail has arrived!\nCommand Ignored."); ! return; } if(str == "" || !str) { ! if(__Current < 0 || __Current >= sizeof(__BoxInfo)) { ! postal_error("No current letter set."); ! return; ! } ! if(__FromMenu) read_letter(__Current); ! else if(set_current(__Current+1) < sizeof(__BoxInfo)) ! read_letter(__Current); ! else read_letter(set_current(__Current - 1)); ! return; ! } if(sscanf(str, "%d", x) && x) { ! if(x>0 && x <= sizeof(__BoxInfo)) { ! if(__Options["read"]) read_letter(set_current(x-1)); ! else { ! set_current(x-1); indices(__Begin); ! } ! } ! else postal_error("Invalid letter number."); ! return; ! } if(!sizeof(tmp = explode(str, " "))) cmd = ""; else cmd = tmp[0][0..0]; if(sizeof(tmp) > 1) args = implode(tmp = tmp[1..sizeof(tmp)-1], " "); else { ! args = ""; ! tmp = ({}); } switch(cmd) { ! case "a": aliases(args); return; ! case "c": change_folder(args); return; ! case "d": case "u": delete_letter(cmd, args); return; ! case "f": forward_letter(args, 0); return; ! case "h": help(args, "index"); return; ! case "i": ! indices(__Current < __Begin+__NumLetters ? __Begin : ! __Current-(__NumLetters-1), args); ! return; ! case "m": ! __FwdRply = 0; ! __TmpPost = ([]); ! send_letter(tmp); ! return; ! case "n": index_cmd(""+(__Current+2)); return; ! case "o": options(args); return; ! case "p": index_cmd(""+(__Current)); return; ! case "q": case "Q": quit_box(cmd); return; ! case "r": reply(args); return; ! case "s": case "S": save_letter(cmd, args); return; ! default: ! postal_error("Invalid postal command."); ! return; } } ! static void alias_cmd(string str) { string cmd, args; string *tmp; ! __CurrentMenu = "alias"; if(str == "" || !str) { ! if(__CommandLine) destruct_box("Invalid alias command."); ! else postal_error("Invalid alias command."); ! return; } cmd = (tmp = explode(str, " "))[0][0..0]; if(sizeof(tmp) > 1) args = implode(tmp[1..sizeof(tmp)-1], " "); else args = ""; switch(cmd) { ! case "a": aliases(args); return; ! case "d": case "e": alias_members(cmd, args); return; ! case "m": case "r": alias_creation(cmd, args); return; ! case "h": help(args, "alias"); return; ! case "i": ! indices(__Current < __Begin+__NumLetters ? __Begin : ! __Current-(__NumLetters-1), args); ! return; ! case "l": list_alias(args); return; ! case "o": options(args); return; ! case "q": case "Q": quit_box(cmd); return; ! case "s": aliases(args); return; ! default: alias_cmd(0); return; } } ! static void option_cmd(string str) { string cmd, args; string *tmp; int x; ! __CurrentMenu = "option"; if(str == "" || !str) { ! postal_error("Invalid option command."); ! return; } if(sscanf(str, "%d", x) && x) { ! change_option(x-1); ! return; } cmd = (tmp = explode(str, " "))[0][0..0]; if(sizeof(tmp) > 1) args = implode(tmp[1..sizeof(tmp)-1], " "); else args = ""; switch(cmd) { ! case "a": aliases(args); return; ! case "h": help(args, "option"); return; ! case "i": ! indices(__Current < __Begin+__NumLetters ? __Begin : ! __Current-(__NumLetters-1), args); ! return; ! case "o": options(args); return; ! case "q": case "Q": quit_box(cmd); return; ! case "s": save_options(); return; ! default: option_cmd(0); return; } } ! static void help_cmd(string str, string ind) { string tmp, file; ! if(str == "" || !str) { ! postal_error("Invalid help command.", "help", ind); ! return; } switch(str = str[0..0]) { ! case "a": aliases(""); return; ! case "i": indices(__Begin); return; ! case "o": options(""); return; ! case "q": case "Q": file = "quitting"; break; } if(!(tmp = read_file(DIR_POSTAL_HELP+"/"+file))) tmp = "Not found.\n"; this_player()->eventPage(explode(tmp, "\n"), "help", (: end_help :)); --- 127,513 ---- int i, maxi;; if(str && str != "") { ! maxi = sizeof(args = explode(str, " ")); ! if(args[0][0] == '-' && strlen(args[0]) == 2) { ! switch(args[0][1]) { ! case 'r': ! restore_box("new"); ! index_cmd(""); ! return; ! case 'f': ! if(maxi < 2) { ! message("mail", "No folder named.", this_player()); ! this_object()->eventDestruct(); ! return; ! } ! else if(maxi>2 || (!valid_folder(args[1]) && ! args[1] != "new")) { ! message("mail", "Illegal folder name.", this_player()); ! this_object()->eventDestruct(); ! return; ! } ! else { ! restore_box(args[1]); ! indices(0); ! return; ! } ! case 'a': ! __CommandLine = 1; ! if(maxi < 2) index_cmd("a"); ! else index_cmd(implode(args[1..maxi-1], " ")); ! return; ! } ! } ! __CommandLine = 1; ! __TmpPost = ([]); ! __FwdRply = 0; ! send_letter(args); ! return; } restore_box("new"); indices(0); } ! static private void primary_prompt() { message("prompt", "\nCommand: ", this_player()); } ! static private void secondary_prompt() { message("prompt", sprintf("\nCommand (%s for %s menu): ", ! __CurrentMenu[0..0], __CurrentMenu), this_player()); } ! varargs static private void postal_error(string str, string ind, mixed args) { message("mail", sprintf("\n%%^RED%%^%s", str), this_player()); primary_prompt(); if(args) input_to(sprintf("%s_cmd", (ind ? ind : __CurrentMenu)), args); else input_to(sprintf("%s_cmd", (ind ? ind : __CurrentMenu))); ! } ! varargs static private void postal_success(string str,string ind,mixed args) { message("mail", sprintf("\n%%^GREEN%%^%s", str), this_player()); secondary_prompt(); if(args) input_to(sprintf("%s_cmd", (ind ? ind : __CurrentMenu)), args); else input_to(sprintf("%s_cmd", (ind ? ind : __CurrentMenu))); ! } ! varargs static void indices(int x, string str) { int i, maxi; ! __CurrentMenu = "index"; if(str && str != "") { ! index_cmd(str); ! return; } __Begin = x; __FromMenu = 1; message("mail", "\n%^INITTERM%^Imaginary Intermud Postal Service " "(IIPS) 3.1 Descartes of Borg 1993, 1994", this_player()); message("mail", sprintf("\n%%^CYAN%%^%s", center(sprintf("Folder is %s " ! "with %s.\n",__Folder,consolidate(maxi=sizeof(__BoxInfo),"one letter")), ! __Screen)), this_player()); if(!maxi) __Current = -1; else for(i=x; i<maxi && i < x+__NumLetters; i++) ! message("mail", sprintf("%s%s) %s %s %s %s %s", ! (__Current == i ? "%^YELLOW%^BOLD%^*" : " "), ! ((i+1 > 99) ? (""+(i+1)) : ((i+1 > 9) ? (" "+(i+1)) : (" "+(i+1)))), ! (__BoxInfo[i]["read"] ? " " : "N"), ! (__Delete[i] ? "D" : " "), ! arrange_string(capitalize(__BoxInfo[i]["from"]), 20), ! arrange_string(postal_time(__BoxInfo[i]["date"]), 7), ! arrange_string(__BoxInfo[i]["subject"], __Screen-40)), this_player()); index_menu(); } ! varargs static void aliases(string str) { __CurrentMenu = "alias"; if(str && str != "") { ! alias_cmd(str); ! return; } message("mail", "\n%^INITTERM%^Imaginary Intermud Postal Service " "(IIPS) 3.1 Descartes of Borg 1993, 1994", this_player()); message("mail", sprintf("\n%%^CYAN%%^%s", center(sprintf("%s and " ! "Personal Alias Menu", mud_name()))), this_player()); message("mail", sprintf("\n%s", ! format_page(keys((mapping)OPTIONS_D->query_groups(__Owner) + ! (mapping)LOCALPOST_D->query_mud_groups()),__Screen/20)),this_player()); alias_menu(); } ! varargs static void options(string str) { string tmp; int i, maxi; ! __CurrentMenu = "option"; if(str && str != "") { ! option_cmd(str); ! return; } message("mail", "\n%^INITTERM%^Imaginary Intermud Postal Service " "(IIPS) 3.1 Descartes of Borg 1993, 1994", this_player()); message("mail", sprintf("\n%%^CYAN%%^%s", center("IIPS 3.1 Options Menu\n", ! __Screen)), this_player()); maxi = sizeof(__PostalOptions); for(i=0; i<maxi; i++) { ! if(pointerp(__PostalOptions[i]["value"])) ! tmp = __PostalOptions[i]["value"][__Options[__PostalOptions[i]["key"]]]; ! else if(!(tmp = __Options[__PostalOptions[i]["key"]])) ! tmp = __PostalOptions[i]["value"]; ! message("mail", sprintf("%s) %-45s %s", (i+1>9) ? (i+1)+"" :" "+(i+1), ! __PostalOptions[i]["desc"], tmp), ! this_player()); ! } option_menu(); ! } ! static private void help(string arg, string ind) { if(!ind) ind = __CurrentMenu; if(arg && arg != "") { ! help_cmd(arg, ind); ! return; ! } message("mail", "\n%^INITTERM%^Imaginary Intermud Postal Service " "(IIPS) 3.1 Descartes of Borg 1993, 1994", this_player()); message("mail",sprintf("\n%%^CYAN%%^%s",center("IIPS 3.1 Help Menu", ! __Screen)), this_player()); help_menu(ind); } ! static private void index_menu() { if(__Options["commands"]) { ! primary_prompt(); ! input_to("index_cmd"); ! return; } message("mail", "\n"+center("a)lias menu, c)hange folder, d)elete, " ! "f)orward, h)elp, m)ail,", __Screen), this_player()); message("mail", center("n)ext letter, o)ptions menu, p)revious " ! "letter, q)uit, Q)uit without saving,", __Screen), this_player()); message("mail", center("s)ave to folder, S)ave to file, " ! "u)ndelete", __Screen), this_player()); message("mail", center("<return> to read selected letter", __Screen), this_player()); primary_prompt(); input_to("index_cmd"); ! } ! static private void alias_menu() { if(__Options["commands"]) { ! primary_prompt(); ! input_to("alias_cmd"); ! return; } message("mail", center("d)elete from an alias, e)nter into an alias, " ! "h)elp, i)ndex menu, ", __Screen), this_player()); message("mail", center("l)ist an alias, m)ake an alias, o)ptions menu, " ! "q)uit, Q)uit without saving, ", __Screen), this_player()); message("mail", center("r)emove an alias", __Screen),this_player()); primary_prompt(); input_to("alias_cmd"); ! } ! static private void option_menu() { if(__Options["commands"]) { ! primary_prompt(); ! input_to("option_cmd"); ! return; } message("mail", "\n"+center("Enter the number of an option to " ! "change it.", __Screen), this_player()); message("mail", center("a)lias menu, h)elp, i)ndex menu, " ! "q)uit, Q)uit without saving,", __Screen), this_player()); message("mail", center("s)ave option changes", __Screen), this_player()); primary_prompt(); input_to("option_cmd"); } ! static private void help_menu(string ind) { int i, maxi; message("help", "\n\n\tEnter one of the following to visit " "another menu:", this_player()); message("help", center("a)lias menu, i)ndex menu, o)ptions menu", ! __Screen), this_player()); message("help", "\n\tOr enter one of the following for detailed help:", this_player()); switch(ind) { ! case "index": ! message("help", center("c)hange folder, d)elete, f)orward, " ! "m)ail letter, n)ext letter,", __Screen), this_player()); ! message("help", center("p)revious letter, q)uit, " ! "Q)uit without saving, r)eply,", __Screen), this_player()); ! message("help", center("s)ave to folder, S)ave to file,", ! __Screen), this_player()); ! message("help", center("x) help from another menu, y) detailed " ! "IIPS user manual", __Screen), this_player()); ! break; ! case "alias": ! message("help", center("d)elete from an alias, e)nter into " ! "an alias, m)ake an alias, q)uit,", __Screen), this_player()); ! message("help", center("Q)uit without saving, r)emove " ! "an alias,", __Screen), this_player()); ! message("help", center("x) help from another menu, y) detailed " ! "IIPS user manual", __Screen), this_player()); ! break; ! case "option": ! for(i=0, maxi = sizeof(__PostalOptions); i<maxi;i++) ! message("help", center(sprintf("%d) %s", (i+1), ! __PostalOptions[i]["desc"]), __Screen), this_player()); ! message("help", sprintf("\n%s",center("Also: q)uit, Q)uit without " ! "saving, s)ave option changes,", __Screen)), this_player()); ! message("help", center("x) help from another menu, y) detailed " ! "IIPS user manual", __Screen), this_player()); ! break; ! default: ! postal_error("Invalid postal menu."); ! return; } primary_prompt(); input_to("help_cmd", ind); } ! static void index_cmd(string str) { string cmd, args; string *tmp; int x; ! __CurrentMenu = "index"; if(__IncomingFlag) { ! __IncomingFlag = 0; ! postal_error("New mail has arrived!\nCommand Ignored."); ! return; } if(str == "" || !str) { ! if(__Current < 0 || __Current >= sizeof(__BoxInfo)) { ! postal_error("No current letter set."); ! return; ! } ! if(__FromMenu) read_letter(__Current); ! else if(set_current(__Current+1) < sizeof(__BoxInfo)) ! read_letter(__Current); ! else read_letter(set_current(__Current - 1)); ! return; ! } if(sscanf(str, "%d", x) && x) { ! if(x>0 && x <= sizeof(__BoxInfo)) { ! if(__Options["read"]) read_letter(set_current(x-1)); ! else { ! set_current(x-1); indices(__Begin); ! } ! } ! else postal_error("Invalid letter number."); ! return; ! } if(!sizeof(tmp = explode(str, " "))) cmd = ""; else cmd = tmp[0][0..0]; if(sizeof(tmp) > 1) args = implode(tmp = tmp[1..sizeof(tmp)-1], " "); else { ! args = ""; ! tmp = ({}); } switch(cmd) { ! case "a": aliases(args); return; ! case "c": change_folder(args); return; ! case "d": case "u": delete_letter(cmd, args); return; ! case "f": forward_letter(args, 0); return; ! case "h": help(args, "index"); return; ! case "i": ! indices(__Current < __Begin+__NumLetters ? __Begin : ! __Current-(__NumLetters-1), args); ! return; ! case "m": ! __FwdRply = 0; ! __TmpPost = ([]); ! send_letter(tmp); ! return; ! case "n": index_cmd(""+(__Current+2)); return; ! case "o": options(args); return; ! case "p": index_cmd(""+(__Current)); return; ! case "q": case "Q": quit_box(cmd); return; ! case "r": reply(args); return; ! case "s": case "S": save_letter(cmd, args); return; ! default: ! postal_error("Invalid postal command."); ! return; } } ! static void alias_cmd(string str) { string cmd, args; string *tmp; ! __CurrentMenu = "alias"; if(str == "" || !str) { ! if(__CommandLine) destruct_box("Invalid alias command."); ! else postal_error("Invalid alias command."); ! return; } cmd = (tmp = explode(str, " "))[0][0..0]; if(sizeof(tmp) > 1) args = implode(tmp[1..sizeof(tmp)-1], " "); else args = ""; switch(cmd) { ! case "a": aliases(args); return; ! case "d": case "e": alias_members(cmd, args); return; ! case "m": case "r": alias_creation(cmd, args); return; ! case "h": help(args, "alias"); return; ! case "i": ! indices(__Current < __Begin+__NumLetters ? __Begin : ! __Current-(__NumLetters-1), args); ! return; ! case "l": list_alias(args); return; ! case "o": options(args); return; ! case "q": case "Q": quit_box(cmd); return; ! case "s": aliases(args); return; ! default: alias_cmd(0); return; } } ! static void option_cmd(string str) { string cmd, args; string *tmp; int x; ! __CurrentMenu = "option"; if(str == "" || !str) { ! postal_error("Invalid option command."); ! return; } if(sscanf(str, "%d", x) && x) { ! change_option(x-1); ! return; } cmd = (tmp = explode(str, " "))[0][0..0]; if(sizeof(tmp) > 1) args = implode(tmp[1..sizeof(tmp)-1], " "); else args = ""; switch(cmd) { ! case "a": aliases(args); return; ! case "h": help(args, "option"); return; ! case "i": ! indices(__Current < __Begin+__NumLetters ? __Begin : ! __Current-(__NumLetters-1), args); ! return; ! case "o": options(args); return; ! case "q": case "Q": quit_box(cmd); return; ! case "s": save_options(); return; ! default: option_cmd(0); return; } } ! static void help_cmd(string str, string ind) { string tmp, file; ! if(str == "" || !str) { ! postal_error("Invalid help command.", "help", ind); ! return; } switch(str = str[0..0]) { ! case "a": aliases(""); return; ! case "i": indices(__Begin); return; ! case "o": options(""); return; ! case "q": case "Q": file = "quitting"; break; } if(!(tmp = read_file(DIR_POSTAL_HELP+"/"+file))) tmp = "Not found.\n"; this_player()->eventPage(explode(tmp, "\n"), "help", (: end_help :)); *************** *** 522,564 **** string *parts; string heure; int x; ! if(stringp(val) && x = to_int(val)) heure = ctime(time()); else if(stringp(val)) heure = val; else heure = ctime(val); parts = explode(replace_string(heure, " ", " "), " "); return sprintf("%s %s", parts[2], parts[1]); } ! static private string header(mapping borg) { int x; return sprintf("%s from %%^GREEN%%^%s%%^RESET%%^\nTo: %s%s" "Subject: %%^GREEN%%^%s", (stringp(borg["date"]) ? ((x=to_int(borg["date"])) ? ctime(x) : ! borg["date"]) : ctime(borg["date"])), capitalize(borg["from"]), wrap(implode(borg["to"], ", "), __Screen), (sizeof(borg["cc"]) ? sprintf("Cc: %s",wrap(implode(borg["cc"], ", "), ! __Screen)) : ""), borg["subject"]); } ! static void change_folder(string str) { if(str == "" || !str) { ! message("prompt", "Change to which folder? ", this_player()); ! input_to("get_folder"); ! return; ! } if(!valid_folder(str)) { ! __FromMenu = 1; ! postal_error("Invalid folder name."); ! return; } if(!__Options["delete"] || member_array(1, __Delete) == -1) ! next_folder("", str); else { ! message("prompt", "Delete marked letters (default 'y')? ", ! this_player()); ! input_to("next_folder", str); } } --- 522,564 ---- string *parts; string heure; int x; ! if(stringp(val) && x = to_int(val)) heure = ctime(time()); else if(stringp(val)) heure = val; else heure = ctime(val); parts = explode(replace_string(heure, " ", " "), " "); return sprintf("%s %s", parts[2], parts[1]); } ! static private string header(mapping borg) { int x; return sprintf("%s from %%^GREEN%%^%s%%^RESET%%^\nTo: %s%s" "Subject: %%^GREEN%%^%s", (stringp(borg["date"]) ? ((x=to_int(borg["date"])) ? ctime(x) : ! borg["date"]) : ctime(borg["date"])), capitalize(borg["from"]), wrap(implode(borg["to"], ", "), __Screen), (sizeof(borg["cc"]) ? sprintf("Cc: %s",wrap(implode(borg["cc"], ", "), ! __Screen)) : ""), borg["subject"]); } ! static void change_folder(string str) { if(str == "" || !str) { ! message("prompt", "Change to which folder? ", this_player()); ! input_to("get_folder"); ! return; ! } if(!valid_folder(str)) { ! __FromMenu = 1; ! postal_error("Invalid folder name."); ! return; } if(!__Options["delete"] || member_array(1, __Delete) == -1) ! next_folder("", str); else { ! message("prompt", "Delete marked letters (default 'y')? ", ! this_player()); ! input_to("next_folder", str); } } *************** *** 567,821 **** else str = (lower_case(str)[0..0]); if(str == "y") save_box(); else if(str != "n") { ! message("prompt", "Invalid command. Enter 'y' or 'n': ",this_player()); ! input_to("next_folder"); } restore_box(folder); indices(__Begin); } ! static void get_folder(string str) { if(str == "" || !str) { ! __FromMenu = 1; ! postal_error("Invalid folder name."); ! return; } change_folder(str); } ! static private void delete_letter(string cmd, string args) { int x, i, from, to, maxi; ! if(args == "" || !args) { ! from = __Current; ! to = __Current; } else { ! sscanf(args, "%d-%d", from, to); ! if(!to) to = from-1; ! else to--; ! from--; } if(from > to || from < 0 || to >= sizeof(__BoxInfo)) { ! postal_error("Invalid letter range."); ! return; } for(i= from; i < to+1; i++) { ! if(cmd == "u" && !__Delete[i]) { ! __FromMenu = 1; ! postal_error(sprintf("Letter %d is not marked for deletion!",i+1)); } ! else if(cmd == "d" && __Delete[i]) ! postal_error(sprintf("Letter %d is already marked for deletion!",i+1)); ! else if(!__BoxInfo[i]["read"] && cmd == "d" && ! !__Options["unread delete"]) { ! message("mail", sprintf("\n%%^RED%%^Letter %d is still unread!", ! i+1), this_player()); ! message("prompt","Delete it anyways (default n): ",this_player()); ! input_to("unread_delete", ({ i+1, to+1 })); ! return; } ! else __Delete[i] = (cmd == "u" ? 0 : 1); } if(cmd == "d" && (args == "" || !args)) { ! for(i=__Current, maxi = sizeof(__BoxInfo); i<maxi; i++) { ! if(!__Delete[i]) { ! set_current(i); ! if(!__FromMenu) { ! read_letter(__Current); ! return; } ! else { ! indices(__Current < __Begin+__NumLetters ? __Begin : ! __Current-(__NumLetters-1)); ! return; } } } } if(__FromMenu) { ! indices(__Current < __Begin+__NumLetters ? __Begin : ! __Current-(__NumLetters-1)); ! return; } if(to == from) postal_success(sprintf("Letter %d %s",from+1, ! (cmd == "d" ? "marked for deletion" : "undeleted"))); else postal_error(sprintf("Letters %d through %d %s.", ! (from+1), (to+1), (cmd == "d" ? "marked for deletion" : "undeleted"))); } ! static void unread_delete(string str, int *milk) { if(str == "" || !str) str = "y"; else str = lower_case(str[0..0]); if(str == "y") __Delete[milk[0]-1] = 1; if(milk[0] < milk[1]) { ! delete_letter("d", milk[0]+"-"+milk[1]); ! return; ! } __FromMenu = 1; secondary_prompt(); input_to("index_cmd"); } ! static private void quit_box(string cmd) { int i; ! if(__Options["quit"]) { ! message("prompt", "Do you really wish to quit (default 'n')? ", ! this_player()); ! input_to("confirm_quit", cmd); ! return; ! } really_quit(cmd); ! } ! static private void really_quit(string cmd) { int i; if(cmd == "Q") { ! message("mail", "\nExiting from IIPS without saving deletions.", ! this_player()); ! this_object()->eventDestruct(); ! return; ! } if(!__Options["delete"]) { ! save_box(); ! message("mail", "\nExiting from IIPS.", this_player()); ! this_object()->eventDestruct(); ! return; ! } i = sizeof(__Delete); while(i--) { ! if(__Delete[i]) { ! message("prompt", "Delete marked letters (default 'y')? ", ! this_player()); ! input_to("confirm_delete"); ! return; ! } ! } message("mail", "\nExiting from IIPS.", this_player()); this_object()->eventDestruct(); ! } ! static void confirm_quit(string str, string cmd) { if(str == "" || !str) str = "n"; else str = lower_case(str)[0..0]; if(str == "y") { ! really_quit(cmd); ! return; } else if(str == "n") { ! indices(__Current < __Begin+__NumLetters ? __Begin : ! __Current - (__Lines-1)); ! return; ! } message("prompt", "Answer 'y' or 'n': ", this_player()); input_to("confirm_quit", cmd); ! } ! static void confirm_delete(string str) { if(str == "" || !str) str = "y"; else str = lower_case(str)[0..0]; if(str == "y") { ! save_box(); ! message("mail", "\nExiting from IIPS.", this_player()); ! this_object()->eventDestruct(); ! return; ! } else if(str == "n") { ! message("mail", "\nMarked letters will remain undeleted.\n" ! "Exiting from IIPS.", this_player()); ! this_object()->eventDestruct(); ! return; ! } message("prompt", "Answer 'y' or 'n': ", this_player()); input_to("confirm_delete"); ! } ! static private void save_letter(string cmd, string args) { string *tmp; string folder; int letter, i, maxi; ! if(args && args != "") { ! if(sizeof(tmp = explode(args, " ")) == 2) { ! if(!sscanf(tmp[0], "%d", letter) || !letter) { ! sscanf(tmp[1], "%d", letter); ! folder = tmp[0]; ! } ! else folder = tmp[1]; ! } ! else if(!sscanf(args, "%d", letter) || !letter) folder = args; ! else folder = args; ! } else { ! folder = 0; ! letter = 0; ! } if(!letter) letter = __Current; else letter--; if(!folder) { ! if(cmd == "S") message("prompt","Save to which file? ",this_player()); ! else message("prompt", sprintf("Save to which folder (default %s)? ", ! sprintf("=%s", convert_name(__BoxInfo[letter]["from"]))), ! this_player()); ! input_to("get_save_location", ({ letter, cmd })); ! return; ! } if(cmd == "s") { ! if(!valid_folder(folder)) { ! postal_error("Invalid folder name."); ! return; } ! FOLDERS_D->add_post(__Owner, folder, __BoxInfo[letter]); ! message("mail", "\nLetter saved.", this_player()); ! set_current(letter); ! __Delete[__Current] = 1; } else if(cmd == "S") { ! folder = absolute_path((string)this_player()->get_path(), folder); ! if(!creatorp(this_player()) || ! !((int)master()->valid_write(folder, this_player()))) { ! postal_error("Access denied."); ! return; ! } ! write_file(folder, ! (string)LETTERS_D->query_letter(__BoxInfo[letter]["id"])); ! message("mail", sprintf("Letter saved to %s.", folder), ! this_player()); ! set_current(letter); ! __Delete[__Current] = 1; ! } if(!__FromMenu) ! for(i=__Current, maxi = sizeof(__BoxInfo); i<maxi; i++) { ! if(!__Delete[i]) { ! read_letter(__Current); ! return; ! } ! } secondary_prompt(); input_to("index_cmd"); ! } ! static void get_save_location(string str, mixed *vals) { if(str == "" || !str) { ! if(vals[1] == "s") ! str = sprintf("=%s", convert_name(__BoxInfo[vals[0]]["from"])); ! else { ! postal_error("Invalid file name."); ! return; ! } } save_letter(vals[1], sprintf("%d %s", vals[0]+1, str)); } ! static private void read_letter(int x) { string tmp; ! if(__Options["content"]) ! message("Nmail", sprintf("\n%%^INITTERM%%^Letter %d%s\n", (x+1), ! (__Delete[x] ? " [DELETED]:" : ":")), this_player()); else message("Nmail", "\n%^INITTERM%^", this_player()); if(__Options["content"]) tmp = header(__BoxInfo[x])+"\n"; else tmp = ""; --- 567,821 ---- else str = (lower_case(str)[0..0]); if(str == "y") save_box(); else if(str != "n") { ! message("prompt", "Invalid command. Enter 'y' or 'n': ",this_player()); ! input_to("next_folder"); } restore_box(folder); indices(__Begin); } ! static void get_folder(string str) { if(str == "" || !str) { ! __FromMenu = 1; ! postal_error("Invalid folder name."); ! return; } change_folder(str); } ! static private void delete_letter(string cmd, string args) { int x, i, from, to, maxi; ! if(args == "" || !args) { ! from = __Current; ! to = __Current; } else { ! sscanf(args, "%d-%d", from, to); ! if(!to) to = from-1; ! else to--; ! from--; } if(from > to || from < 0 || to >= sizeof(__BoxInfo)) { ! postal_error("Invalid letter range."); ! return; } for(i= from; i < to+1; i++) { ! if(cmd == "u" && !__Delete[i]) { ! __FromMenu = 1; ! postal_error(sprintf("Letter %d is not marked for deletion!",i+1)); } ! else if(cmd == "d" && __Delete[i]) ! postal_error(sprintf("Letter %d is already marked for deletion!",i+1)); ! else if(!__BoxInfo[i]["read"] && cmd == "d" && ! !__Options["unread delete"]) { ! message("mail", sprintf("\n%%^RED%%^Letter %d is still unread!", ! i+1), this_player()); ! message("prompt","Delete it anyways (default n): ",this_player()); ! input_to("unread_delete", ({ i+1, to+1 })); ! return; } ! else __Delete[i] = (cmd == "u" ? 0 : 1); } if(cmd == "d" && (args == "" || !args)) { ! for(i=__Current, maxi = sizeof(__BoxInfo); i<maxi; i++) { ! if(!__Delete[i]) { ! set_current(i); ! if(!__FromMenu) { ! read_letter(__Current); ! return; } ! else { ! indices(__Current < __Begin+__NumLetters ? __Begin : ! __Current-(__NumLetters-1)); ! return; } } } } if(__FromMenu) { ! indices(__Current < __Begin+__NumLetters ? __Begin : ! __Current-(__NumLetters-1)); ! return; } if(to == from) postal_success(sprintf("Letter %d %s",from+1, ! (cmd == "d" ? "marked for deletion" : "undeleted"))); else postal_error(sprintf("Letters %d through %d %s.", ! (from+1), (to+1), (cmd == "d" ? "marked for deletion" : "undeleted"))); } ! static void unread_delete(string str, int *milk) { if(str == "" || !str) str = "y"; else str = lower_case(str[0..0]); if(str == "y") __Delete[milk[0]-1] = 1; if(milk[0] < milk[1]) { ! delete_letter("d", milk[0]+"-"+milk[1]); ! return; ! } __FromMenu = 1; secondary_prompt(); input_to("index_cmd"); } ! static private void quit_box(string cmd) { int i; ! if(__Options["quit"]) { ! message("prompt", "Do you really wish to quit (default 'n')? ", ! this_player()); ! input_to("confirm_quit", cmd); ! return; ! } really_quit(cmd); ! } ! static private void really_quit(string cmd) { int i; if(cmd == "Q") { ! message("mail", "\nExiting from IIPS without saving deletions.", ! this_player()); ! this_object()->eventDestruct(); ! return; ! } if(!__Options["delete"]) { ! save_box(); ! message("mail", "\nExiting from IIPS.", this_player()); ! this_object()->eventDestruct(); ! return; ! } i = sizeof(__Delete); while(i--) { ! if(__Delete[i]) { ! message("prompt", "Delete marked letters (default 'y')? ", ! this_player()); ! input_to("confirm_delete"); ! return; ! } ! } message("mail", "\nExiting from IIPS.", this_player()); this_object()->eventDestruct(); ! } ! static void confirm_quit(string str, string cmd) { if(str == "" || !str) str = "n"; else str = lower_case(str)[0..0]; if(str == "y") { ! really_quit(cmd); ! return; } else if(str == "n") { ! indices(__Current < __Begin+__NumLetters ? __Begin : ! __Current - (__Lines-1)); ! return; ! } message("prompt", "Answer 'y' or 'n': ", this_player()); input_to("confirm_quit", cmd); ! } ! static void confirm_delete(string str) { if(str == "" || !str) str = "y"; else str = lower_case(str)[0..0]; if(str == "y") { ! save_box(); ! message("mail", "\nExiting from IIPS.", this_player()); ! this_object()->eventDestruct(); ! return; ! } else if(str == "n") { ! message("mail", "\nMarked letters will remain undeleted.\n" ! "Exiting from IIPS.", this_player()); ! this_object()->eventDestruct(); ! return; ! } message("prompt", "Answer 'y' or 'n': ", this_player()); input_to("confirm_delete"); ! } ! static private void save_letter(string cmd, string args) { string *tmp; string folder; int letter, i, maxi; ! if(args && args != "") { ! if(sizeof(tmp = explode(args, " ")) == 2) { ! if(!sscanf(tmp[0], "%d", letter) || !letter) { ! sscanf(tmp[1], "%d", letter); ! folder = tmp[0]; ! } ! else folder = tmp[1]; ! } ! else if(!sscanf(args, "%d", letter) || !letter) folder = args; ! else folder = args; ! } else { ! folder = 0; ! letter = 0; ! } if(!letter) letter = __Current; else letter--; if(!folder) { ! if(cmd == "S") message("prompt","Save to which file? ",this_player()); ! else message("prompt", sprintf("Save to which folder (default %s)? ", ! sprintf("=%s", convert_name(__BoxInfo[letter]["from"]))), ! this_player()); ! input_to("get_save_location", ({ letter, cmd })); ! return; ! } if(cmd == "s") { ! if(!valid_folder(folder)) { ! postal_error("Invalid folder name."); ! return; } ! FOLDERS_D->add_post(__Owner, folder, __BoxInfo[letter]); ! message("mail", "\nLetter saved.", this_player()); ! set_current(letter); ! __Delete[__Current] = 1; } else if(cmd == "S") { ! folder = absolute_path((string)this_player()->get_path(), folder); ! if(!creatorp(this_player()) || ! !((int)master()->valid_write(folder, this_player()))) { ! postal_error("Access denied."); ! return; ! } ! write_file(folder, ! (string)LETTERS_D->query_letter(__BoxInfo[letter]["id"])); ! message("mail", sprintf("Letter saved to %s.", folder), ! this_player()); ! set_current(letter); ! __Delete[__Current] = 1; ! } if(!__FromMenu) ! for(i=__Current, maxi = sizeof(__BoxInfo); i<maxi; i++) { ! if(!__Delete[i]) { ! read_letter(__Current); ! return; ! } ! } secondary_prompt(); input_to("index_cmd"); ! } ! static void get_save_location(string str, mixed *vals) { if(str == "" || !str) { ! if(vals[1] == "s") ! str = sprintf("=%s", convert_name(__BoxInfo[vals[0]]["from"])); ! else { ! postal_error("Invalid file name."); ! return; ! } } save_letter(vals[1], sprintf("%d %s", vals[0]+1, str)); } ! static private void read_letter(int x) { string tmp; ! if(__Options["content"]) ! message("Nmail", sprintf("\n%%^INITTERM%%^Letter %d%s\n", (x+1), ! (__Delete[x] ? " [DELETED]:" : ":")), this_player()); else message("Nmail", "\n%^INITTERM%^", this_player()); if(__Options["content"]) tmp = header(__BoxInfo[x])+"\n"; else tmp = ""; *************** *** 824,1059 **** __BoxInfo[x]["read"] = 1; this_player()->eventPage(explode(tmp, "\n"), "mail", (: end_read :)); } ! void end_read() { __FromMenu = 0; secondary_prompt(); input_to("index_cmd"); } ! static private void alias_members(string cmd, string args) { string *members, *old_members; string grp; ! if(args == "" || !args) { ! message("prompt", sprintf("%s which alias? ", ! (cmd == "e" ? "Enter into" : "Delete from")), this_player()); ! input_to("get_alias", cmd); ! return; ! } if(sizeof(members = explode(args, " ")) == 1) { ! message("prompt", sprintf("%s which members? ", ! (cmd == "e" ? "Enter" : "Delete")), this_player()); ! input_to("get_members", ({ cmd, args })); ! return; ! } if(!sizeof(members -= ({ grp = members[0] }))) { ! if(__CommandLine) destruct_box("Invalid alias member."); ! else postal_error("Invalid alias member."); ! return; } if(user_exists(grp = lower_case(grp)) || (string *)LOCALPOST_D->query_mud_group(grp)) { ! if(__CommandLine) destruct_box("Invalid alias."); ! else postal_error("Invalid alias."); ! return; } if(!(old_members = (string *)OPTIONS_D->query_group(__Owner, grp))) { ! if(__CommandLine) destruct_box("No such alias."); ! else postal_error(sprintf("No such alias %s.", grp)); ! return; } if(cmd == "e") members = distinct_array(members + old_members); else if(!sizeof(members = old_members - members)) members = 0; OPTIONS_D->set_group(__Owner, grp, members); if(cmd == "d") { ! if(!members) ! message("mail", "\n%^GREEN%^All members deleted.", this_player()); ! else message("mail", "\n%^GREEN%^Members deleted from alias.", ! this_player()); ! } else message("mail", "\n%^GREEN%^Members entered into alias.", ! this_player()); if(__CommandLine) this_object()->eventDestruct(); else { ! secondary_prompt(); ! input_to("alias_cmd"); } ! } ! static void get_alias(string str, string cmd) { if(str == "" || !str) { ! if(__CommandLine) destruct_box("Invalid alias name."); ! else postal_error("Invalid alias name."); ! return; } alias_members(cmd, str); } ! static void get_members(string str, string *args) { if(str == "" || !str) { ! if(__CommandLine) destruct_box("Invalid alias members."); ! else postal_error("Invalid alias members."); ! return; } alias_members(args[0], sprintf("%s %s", args[1], str)); } ! static private void alias_creation(string cmd, string args) { string *members; if(args == "" || !args) { ! message("prompt", sprintf("Name of alias to %s: ", ! (cmd == "m" ? "make" : "remove")), this_player()); ! input_to("get_alias_name", cmd); ! return; } if(cmd == "m" && sizeof(members=explode(args=lower_case(args)," ")) == 1) { ! message("prompt", "Enter members for the alias: ", this_player()); ! input_to("get_new_alias_members", ({ cmd, args })); ! return; ! } else if(cmd == "m") members = members - ({ args = members[0] }); else members = 0; if(cmd == "m" && (user_exists(args) || (mapping)LOCALPOST_D->query_mud_group(args))) { ! if(__CommandLine) destruct_box("Invalid alias name."); ! else postal_error("Invalid alias name."); ! return; } if(!((string *)OPTIONS_D->query_group(__Owner, args))) { ! if(cmd == "r") { ! if(__CommandLine) destruct_box("No such alias to remove."); ! else postal_error("No such alias to remove."); ! return; } } else if(cmd == "m") { ! if(__CommandLine) destruct_box("Alias already exists."); ! else postal_error("That alias already exists."); ! return; ! } OPTIONS_D->set_group(__Owner, args, members); if(__CommandLine) ! destruct_box(sprintf("Alias %s.", (cmd == "m" ? "made" : "removed"))); else ! postal_success(sprintf("Alias %s.", (cmd == "m" ? "made" : "removed"))); } ! static void get_alias_name(string str, string cmd) { if(str == "" || !str) { ! if(__CommandLine) destruct_box("Invalid alias name."); ! else postal_error("Invalid alias name."); ! return; } alias_creation(cmd, lower_case(str)); } ! static void get_new_alias_members(string str, string *args) { if(str == "" || !str) { ! if(__CommandLine) destruct_box("Invalid alias members."); ! else postal_error("Invalid alias members."); ! return; } alias_creation(args[0], sprintf("%s %s", args[1], lower_case(str))); } ! static private void list_alias(string str) { string *who; ! if(str == "" || !str) { ! if(__CommandLine) destruct_box("Invalid alias name."); ! else postal_error("Invalid alias name."); ! return; } if(!(who = (string *)LOCALPOST_D->query_mud_group(str=lower_case(str)))) { ! who = (string *)OPTIONS_D->query_group(__Owner, str); } if(!who) { ! if(__CommandLine) destruct_box("No such alias exists."); ! else postal_error("No such alias exists."); ! return; } message("mail", "\n%^INITTERM%^"+center(sprintf("Alias: %s", str), ! __Screen), this_player()); message("mail", "\n\n"+implode(who, ", "), this_player()); if(__CommandLine) this_object()->eventDestruct(); else { ! secondary_prompt(); ! input_to("alias_cmd"); ! } } ! static private void save_options() { string *cles; int i; if(!__ChangedOptions) { ! postal_error("No options have changed."); ! return; } i = sizeof(cles = keys(__ChangedOptions)); while(i--) ! OPTIONS_D->set_option(__Owner, cles[i], __ChangedOptions[cles[i]]); __Options = (mapping)OPTIONS_D->query_options(__Owner); postal_success("New options now saved."); } ! static private void change_option(int x) { if(pointerp(__PostalOptions[x]["value"])) { ! message("mail", sprintf("%s\n\t0) %s\n\t1) %s", ! __PostalOptions[x]["desc"], ! __PostalOptions[x]["value"][0], __PostalOptions[x]["value"][1]), ! this_player()); } else message("mail", __PostalOptions[x]["desc"], this_player()); message("prompt", "Enter in a proper value: ", this_player()); input_to("really_change_option", 0, x); ! } ! static void really_change_option(string str, int x) { int y; if(!__ChangedOptions) __ChangedOptions = ([]); if(pointerp(__PostalOptions[x]["value"])) { ! if((y=to_int(str)) != 0 && y != 1) { ! postal_error("Invalid value. No option has changed."); ! return; ! } ! __ChangedOptions[__PostalOptions[x]["key"]] = y; } else __ChangedOptions[__PostalOptions[x]["key"]] = (str == "" ? 0 : str); postal_success("You must remember to save for this option to take effect."); } ! static private void reply(string str) { int x, i; if(str == "" || !str) x = __Current; else x = to_int(str)-1; if(x < 0 || x >= sizeof(__BoxInfo)) { ! postal_error("Invalid letter number for reply."); ! return; ! } set_current(x); __TmpPost = ([ "date":time(), "from": (string)this_player()->GetKeyName()]); ! if((__TmpPost["subject"] = __BoxInfo[x]["subject"])[0..2] != "Re:") ! __TmpPost["subject"] = sprintf("Re: %s", __TmpPost["subject"]); ! message("prompt", "Include original text (default 'n'): ", this_player()); ! input_to("get_reply_confirm"); ! } static void get_reply_confirm(string str) { if(str == "" || !str) str = "n"; else str = lower_case(str)[0..0]; if(str == "y") __FwdRply = ({ "r", query_reply_text() }); else if(str != "n") { ! message("prompt", "Answer 'y' or 'n': ", this_player()); ! input_to("get_reply_confirm"); ! return; ! } else __FwdRply = 0; message("mail", sprintf("\n%s", center("Reply to: a)ll, c)c list and " ! "sender, s)ender only, t)o list and sender",__Screen)), this_player()); message("prompt", "\nEnter choice (default 's'): ", this_player()); input_to("get_reply_list"); } --- 824,1059 ---- __BoxInfo[x]["read"] = 1; this_player()->eventPage(explode(tmp, "\n"), "mail", (: end_read :)); } ! void end_read() { __FromMenu = 0; secondary_prompt(); input_to("index_cmd"); } ! static private void alias_members(string cmd, string args) { string *members, *old_members; string grp; ! if(args == "" || !args) { ! message("prompt", sprintf("%s which alias? ", ! (cmd == "e" ? "Enter into" : "Delete from")), this_player()); ! input_to("get_alias", cmd); ! return; ! } if(sizeof(members = explode(args, " ")) == 1) { ! message("prompt", sprintf("%s which members? ", ! (cmd == "e" ? "Enter" : "Delete")), this_player()); ! input_to("get_members", ({ cmd, args })); ! return; ! } if(!sizeof(members -= ({ grp = members[0] }))) { ! if(__CommandLine) destruct_box("Invalid alias member."); ! else postal_error("Invalid alias member."); ! return; } if(user_exists(grp = lower_case(grp)) || (string *)LOCALPOST_D->query_mud_group(grp)) { ! if(__CommandLine) destruct_box("Invalid alias."); ! else postal_error("Invalid alias."); ! return; } if(!(old_members = (string *)OPTIONS_D->query_group(__Owner, grp))) { ! if(__CommandLine) destruct_box("No such alias."); ! else postal_error(sprintf("No such alias %s.", grp)); ! return; } if(cmd == "e") members = distinct_array(members + old_members); else if(!sizeof(members = old_members - members)) members = 0; OPTIONS_D->set_group(__Owner, grp, members); if(cmd == "d") { ! if(!members) ! message("mail", "\n%^GREEN%^All members deleted.", this_player()); ! else message("mail", "\n%^GREEN%^Members deleted from alias.", ! this_player()); ! } else message("mail", "\n%^GREEN%^Members entered into alias.", ! this_player()); if(__CommandLine) this_object()->eventDestruct(); else { ! secondary_prompt(); ! input_to("alias_cmd"); } ! } ! static void get_alias(string str, string cmd) { if(str == "" || !str) { ! if(__CommandLine) destruct_box("Invalid alias name."); ! else postal_error("Invalid alias name."); ! return; } alias_members(cmd, str); } ! static void get_members(string str, string *args) { if(str == "" || !str) { ! if(__CommandLine) destruct_box("Invalid alias members."); ! else postal_error("Invalid alias members."); ! return; } alias_members(args[0], sprintf("%s %s", args[1], str)); } ! static private void alias_creation(string cmd, string args) { string *members; if(args == "" || !args) { ! message("prompt", sprintf("Name of alias to %s: ", ! (cmd == "m" ? "make" : "remove")), this_player()); ! input_to("get_alias_name", cmd); ! return; } if(cmd == "m" && sizeof(members=explode(args=lower_case(args)," ")) == 1) { ! message("prompt", "Enter members for the alias: ", this_player()); ! input_to("get_new_alias_members", ({ cmd, args })); ! return; ! } else if(cmd == "m") members = members - ({ args = members[0] }); else members = 0; if(cmd == "m" && (user_exists(args) || (mapping)LOCALPOST_D->query_mud_group(args))) { ! if(__CommandLine) destruct_box("Invalid alias name."); ! else postal_error("Invalid alias name."); ! return; } if(!((string *)OPTIONS_D->query_group(__Owner, args))) { ! if(cmd == "r") { ! if(__CommandLine) destruct_box("No such alias to remove."); ! else postal_error("No such alias to remove."); ! return; } } else if(cmd == "m") { ! if(__CommandLine) destruct_box("Alias already exists."); ! else postal_error("That alias already exists."); ! return; ! } OPTIONS_D->set_group(__Owner, args, members); if(__CommandLine) ! destruct_box(sprintf("Alias %s.", (cmd == "m" ? "made" : "removed"))); else ! postal_success(sprintf("Alias %s.", (cmd == "m" ? "made" : "removed"))); } ! static void get_alias_name(string str, string cmd) { if(str == "" || !str) { ! if(__CommandLine) destruct_box("Invalid alias name."); ! else postal_error("Invalid alias name."); ! return; } alias_creation(cmd, lower_case(str)); } ! static void get_new_alias_members(string str, string *args) { if(str == "" || !str) { ! if(__CommandLine) destruct_box("Invalid alias members."); ! else postal_error("Invalid alias members."); ! return; } alias_creation(args[0], sprintf("%s %s", args[1], lower_case(str))); } ! static private void list_alias(string str) { string *who; ! if(str == "" || !str) { ! if(__CommandLine) destruct_box("Invalid alias name."); ! else postal_error("Invalid alias name."); ! return; } if(!(who = (string *)LOCALPOST_D->query_mud_group(str=lower_case(str)))) { ! who = (string *)OPTIONS_D->query_group(__Owner, str); } if(!who) { ! if(__CommandLine) destruct_box("No such alias exists."); ! else postal_error("No such alias exists."); ! return; } message("mail", "\n%^INITTERM%^"+center(sprintf("Alias: %s", str), ! __Screen), this_player()); message("mail", "\n\n"+implode(who, ", "), this_player()); if(__CommandLine) this_object()->eventDestruct(); else { ! secondary_prompt(); ! input_to("alias_cmd"); ! } } ! static private void save_options() { string *cles; int i; if(!__ChangedOptions) { ! postal_error("No options have changed."); ! return; } i = sizeof(cles = keys(__ChangedOptions)); while(i--) ! OPTIONS_D->set_option(__Owner, cles[i], __ChangedOptions[cles[i]]); __Options = (mapping)OPTIONS_D->query_options(__Owner); postal_success("New options now saved."); } ! static private void change_option(int x) { if(pointerp(__PostalOptions[x]["value"])) { ! message("mail", sprintf("%s\n\t0) %s\n\t1) %s", ! __PostalOptions[x]["desc"], ! __PostalOptions[x]["value"][0], __PostalOptions[x]["value"][1]), ! this_player()); } else message("mail", __PostalOptions[x]["desc"], this_player()); message("prompt", "Enter in a proper value: ", this_player()); input_to("really_change_option", 0, x); ! } ! static void really_change_option(string str, int x) { int y; if(!__ChangedOptions) __ChangedOptions = ([]); if(pointerp(__PostalOptions[x]["value"])) { ! if((y=to_int(str)) != 0 && y != 1) { ! postal_error("Invalid value. No option has changed."); ! return; ! } ! __ChangedOptions[__PostalOptions[x]["key"]] = y; } else __ChangedOptions[__PostalOptions[x]["key"]] = (str == "" ? 0 : str); postal_success("You must remember to save for this option to take effect."); } ! static private void reply(string str) { int x, i; if(str == "" || !str) x = __Current; else x = to_int(str)-1; if(x < 0 || x >= sizeof(__BoxInfo)) { ! postal_error("Invalid letter number for reply."); ! return; ! } set_current(x); __TmpPost = ([ "date":time(), "from": (string)this_player()->GetKeyName()]); ! if((__TmpPost["subject"] = __BoxInfo[x]["subject"])[0..2] != "Re:") ! __TmpPost["subject"] = sprintf("Re: %s", __TmpPost["subject"]); ! message("prompt", "Include original text (default 'n'): ", this_player()); ! input_to("get_reply_confirm"); ! } static void get_reply_confirm(string str) { if(str == "" || !str) str = "n"; else str = lower_case(str)[0..0]; if(str == "y") __FwdRply = ({ "r", query_reply_text() }); else if(str != "n") { ! message("prompt", "Answer 'y' or 'n': ", this_player()); ! input_to("get_reply_confirm"); ! return; ! } else __FwdRply = 0; message("mail", sprintf("\n%s", center("Reply to: a)ll, c)c list and " ! "sender, s)ender only, t)o list and sender",__Screen)), this_player()); message("prompt", "\nEnter choice (default 's'): ", this_player()); input_to("get_reply_list"); } *************** *** 1065,1089 **** else str = lower_case(str)[0..0]; __TmpPost["to"] = ({ convert_name(__BoxInfo[__Current]["from"]) }); switch(str) { ! case "a": ! __TmpPost["to"] += __BoxInfo[__Current]["to"]; ! __TmpPost["cc"] = __BoxInfo[__Current]["cc"]; ! break; ! case "c": __TmpPost["cc"] = __BoxInfo[i]["cc"]; break; ! case "s": __TmpPost["cc"] = ({}); break; ! case "t": ! __TmpPost["to"] += __BoxInfo[__Current]["to"]; ! __TmpPost["cc"] = ({}); ! break; ! default: ! message("prompt","Invalid choice. Choose again: ", this_player()); ! input_to("get_reply_list"); ! return; ! } if(!__Options["askcc"]) get_cc(""); else { ! message("prompt", "Copies to: ", this_player()); ! input_to("get_cc"); } } --- 1065,1089 ---- else str = lower_case(str)[0..0]; __TmpPost["to"] = ({ convert_name(__BoxInfo[__Current]["from"]) }); switch(str) { ! case "a": ! __TmpPost["to"] += __BoxInfo[__Current]["to"]; ! __TmpPost["cc"] = __BoxInfo[__Current]["cc"]; ! break; ! case "c": __TmpPost["cc"] = __BoxInfo[i]["cc"]; break; ! case "s": __TmpPost["cc"] = ({}); break; ! case "t": ! __TmpPost["to"] += __BoxInfo[__Current]["to"]; ! __TmpPost["cc"] = ({}); ! break; ! default: ! message("prompt","Invalid choice. Choose again: ", this_player()); ! input_to("get_reply_list"); ! return; ! } if(!__Options["askcc"]) get_cc(""); else { ! message("prompt", "Copies to: ", this_player()); ! input_to("get_cc"); } } *************** *** 1099,1134 **** int i, x; if(str == "" || !str) { ! message("prompt", "To: ", this_player()); ! input_to("get_forward_list"); ! return; ! } i = sizeof(args = explode(lower_case(str), " ")); if(!flag) { ! while(i--) if(sscanf(args[i], "%d", x) && x) break; ! if(!x) x = __Current; ! else { ! x--; ! if( !i ) { ! if(sizeof(args) == 1) args = ({}); ! else args = args[1..]; ! } ! else if( i == sizeof(args)) { ! args = args[0..<2]; ! } ! else if(sizeof(args) == 1) ! args = ({}); ! else args = args[0..(i-1)] + args[(i+1)..]; ! } ! if(x < 0 || x > sizeof(__BoxInfo)) { ! postal_error("Letter number is out of range."); ! return; ! } ! if(!sizeof(args)) { ! forward_letter(0, 1); ! return; ! } ! } set_current(x); __TmpPost["to"] = args; if((__TmpPost["subject"]=__BoxInfo[__Current]["subject"])[0..4] != --- 1099,1134 ---- int i, x; if(str == "" || !str) { ! message("prompt", "To: ", this_player()); ! input_to("get_forward_list"); ! return; ! } i = sizeof(args = explode(lower_case(str), " ")); if(!flag) { ! while(i--) if(sscanf(args[i], "%d", x) && x) break; ! if(!x) x = __Current; ! else { ! x--; ! if( !i ) { ! if(sizeof(args) == 1) args = ({}); ! else args = args[1..]; ! } ! else if( i == sizeof(args)) { ! args = args[0..<2]; ! } ! else if(sizeof(args) == 1) ! args = ({}); ! else args = args[0..(i-1)] + args[(i+1)..]; ! } ! if(x < 0 || x > sizeof(__BoxInfo)) { ! postal_error("Letter number is out of range."); ! return; ! } ! if(!sizeof(args)) { ! forward_letter(0, 1); ! return; ! } ! } set_current(x); __TmpPost["to"] = args; if((__TmpPost["subject"]=__BoxInfo[__Current]["subject"])[0..4] != *************** *** 1138,1172 **** message("prompt", "Comment on original letter (default 'n')? ", this_player()); input_to("confirm_comments"); ! } static void get_forward_list(string str) { if(str == "" || !str) { ! message("prompt","Invalid recipients. Abort forward (default 'y')? ", ! this_player()); ! input_to("confirm_forward_abort"); ! return; ! } else forward_letter(str, 1); ! } static void confirm_comments(string str) { if(str == "" || !str) str = "n"; else str = lower_case(str)[0..0]; if(str == "y") __FwdRply = ({ "f", query_forward_text() }); else if(str == "n") { ! __FwdRply = 0; ! __TmpPost["message"] = query_forward_text(); ! } else { ! message("prompt", "Answer 'y' or 'n': ", this_player()); ! input_to("confirm_comments"); ! return; } if(!__Options["askcc"]) get_cc(""); else { ! message("prompt", "Copies to: ", this_player()); ! input_to("get_cc"); } } --- 1138,1172 ---- message("prompt", "Comment on original letter (default 'n')? ", this_player()); input_to("confirm_comments"); ! } static void get_forward_list(string str) { if(str == "" || !str) { ! message("prompt","Invalid recipients. Abort forward (default 'y')? ", ! this_player()); ! input_to("confirm_forward_abort"); ! return; ! } else forward_letter(str, 1); ! } static void confirm_comments(string str) { if(str == "" || !str) str = "n"; else str = lower_case(str)[0..0]; if(str == "y") __FwdRply = ({ "f", query_forward_text() }); else if(str == "n") { ! __FwdRply = 0; ! __TmpPost["message"] = query_forward_text(); ! } else { ! message("prompt", "Answer 'y' or 'n': ", this_player()); ! input_to("confirm_comments"); ! return; } if(!__Options["askcc"]) get_cc(""); else { ! message("prompt", "Copies to: ", this_player()); ! input_to("get_cc"); } } *************** *** 1179,1404 **** capitalize(__BoxInfo[__Current]["from"]), postal_time(__BoxInfo[__Current]["date"]), center("--- --- Begin Forwarded Text --- ---"), tmp); ! } ! static void confirm_forward_abort(string str) { if(str == "" || !str) str = "y"; else str = lower_case(str)[0..0]; if(str == "y") { ! postal_error("Forward aborted."); ! return; ! } else if(str != "n") { ! message("prompt", "Answer 'y' or 'n': ", this_player()); ! input_to("confirm_forward_abort"); ! return; ! } message("prompt", "To: ", this_player()); input_to("get_forward_list"); ! } static private void send_letter(string *args) { string flag, tmp; int j, i, maxi, x; ! if(!args || !sizeof(args)) { ! message("prompt", "To: ", this_player()); ! input_to("get_to"); ! return; ! } __FwdRply = 0; __TmpPost = ([ "from": (string)this_player()->GetKeyName(),"date":time()]); ! for(i=0, maxi = sizeof(args); i<maxi; i++) { ! if(args[i] == "" || !args[i]) continue; ! if(!flag && i < maxi-1 && args[i][0] == '-' && strlen(args[i]) > 1) { ! if(member_array(args[i][1..1], ({"c","s","i"})) == -1) ! continue; ! else flag = args[i][1..1]; ! } ! else if(!flag && args[i][0] == '\\' && strlen(args[i]) > 1) ! args[i] = args[i][1..strlen(args[1])-1]; ! else if(flag) { ! if(args[i][0] != '\'') tmp = args[i]; ! else if(args[i][x=strlen(args[i])-1] =='\'') tmp =args[i][1..x-1]; ! else { ! tmp = args[j=i][1..x]; ! while(++j < maxi && args[j][x=strlen(args[j])-1] != '\'') ! if(x > 0) tmp += " "+args[j][0..x-1]; ! if(args[j][x] == '\'' && x > 1) tmp += " "+args[j][0..x-1]; ! i = j; ! } ! switch(flag) { ! case "c": ! if(!__TmpPost["cc"]) __TmpPost["cc"] = ({}); ! __TmpPost["cc"] += ({ convert_name(tmp) }); ! break; ! case "s": __TmpPost["subject"] = tmp; break; ! case "i": ! tmp=absolute_path((string)this_player()->get_path(),tmp); ! if(sscanf(tmp,user_path(this_player())+"%s", flag) != 1 || ! !((int)master()->valid_read(tmp,this_player()))) { ! if(__CommandLine) { ! this_object()->eventDestruct(); ! return; ! } ! __TmpPost = ([]); ! postal_error("Access denied."); ! return; ! } ! if(!file_exists(tmp)) { ! if(__CommandLine) { ! this_object()->eventDestruct(); ! return; ! } ! __TmpPost = ([]); ! postal_error(sprintf("File %s does not exist.",tmp)); ! return; ! } ! if(!(__TmpPost["message"] = read_file(tmp))) ! __TmpPost["message"] = "EMPTY FILE"; ! break; ! } ! flag = 0; ! } ! else { ! if(!__TmpPost["to"]) __TmpPost["to"] = ({ convert_name(args[i]) }); ! else __TmpPost["to"] += ({ convert_name(args[i]) }); ! } ! } ! if(!__TmpPost["to"]) { ! message("prompt", "To: ", this_player()); ! input_to("get_to"); ! return; } ! if(!__TmpPost["subject"]) { ! message("prompt", "Subject: ", this_player()); ! input_to("get_subject"); ! return; } - else message("mail", sprintf("Subject: %s", __TmpPost["subject"]), - this_player()); - if(!__TmpPost["cc"] && __Options["askcc"]) { - message("prompt", "Copies to: ", this_player()); - input_to("get_cc"); - return; - } - else if(!__TmpPost["cc"]) __TmpPost["cc"] = ({}); - if(!__TmpPost["message"]) get_cc(""); else { ! __TmpPost["message"] = sprintf("%s%s", __TmpPost["message"], ! query_signature()); ! confirm_send(); ! } } ! static void get_to(string str) { if(str == "" || !str) { ! if(__CommandLine) { ! this_object()->eventDestruct(); ! return; ! } ! postal_error("No recipients given. Mail aborted."); ! return; ! } send_letter(explode(str, " ")); ! } ! static void get_subject(string str) { string tmp; ! if(str == "" || !str) { ! message("prompt", "No subject given. Continue (default 'n')? ", ! this_player()); ! input_to("confirm_subject"); ! return; ! } __TmpPost["subject"] = str; if(!__TmpPost["cc"] && __Options["askcc"]) { ! message("prompt", "Copies to: ", this_player()); ! input_to("get_cc"); ! return; ! } else if(!__TmpPost["cc"]) __TmpPost["cc"] = ({}); if(!__TmpPost["message"]) get_cc(""); else { ! __TmpPost["message"] = sprintf("%s%s", __TmpPost["message"], ! query_signature()); ! confirm_send(); } ! } ! static void confirm_subject(string str) { if(str == "" || !str) str = "n"; else str = lower_case(str)[0..0]; if(str == "n") { ! if(__CommandLine) { ! this_object()->eventDestruct(); ! return; ! } ! __TmpPost = ([]); ! postal_error("Mail aborted."); ! return; ! } else if(str == "y") get_subject("[No Subject]"); else { ! message("prompt", "Answer 'y' or 'n': ", this_player()); ! input_to("confirm_subject"); ! return; ! } ! } ! static void get_cc(string str) { string tmp; ! if(!__TmpPost["cc"]) __TmpPost["cc"] = ({}); if(str && str != "") __TmpPost["cc"] += explode(str, " "); if(__TmpPost["message"]) { ! __TmpPost["message"] = sprintf("%s%s", __TmpPost["message"], ! query_signature()); ! confirm_send(); ! return; ! } if(file_exists(tmp = DIR_TMP+"/"+(string)this_player()->GetKeyName())) ! rm(tmp); if(!__FwdRply || __FwdRply[0] == "f") { ! message("mail",sprintf("\n%%^INITTERM%%^%s", header(__TmpPost)), ! this_player()); ! this_player()->eventEdit(tmp, (: complete_send :)); ! return; } write_file(tmp, __FwdRply[1]); message("mail", sprintf("\n%%^INITTERM%%^%s", header(__TmpPost)), this_player()); this_player()->eventEdit(tmp, (: complete_send :)); ! } ! void complete_send() { string str; ! if( !(str = read_file(DIR_TMP "/" + (string)this_player()->GetKeyName()))) ! str = "No message."; if(__FwdRply && __FwdRply[0] == "f") ! str = sprintf("%s\n%s\n%s", str, __FwdRply[1], query_signature()); else str = sprintf("%s%s", str, query_signature()); __TmpPost["message"] = str; __FwdRply = 0; confirm_send(); } ! static private string query_signature() { string tmp; ! if(!__Options["sig file"]) return ""; if(strsrch(__Options["sig file"], " ") != -1) ! return sprintf("\n%s", __Options["sig file"]); tmp = absolute_path(user_path((string)this_player()->GetKeyName()), __Options["sig file"]); if(!((int)master()->valid_read(tmp, this_player())) || !file_exists(tmp)) { ! return sprintf("\n%s", __Options["sig file"]); } return read_file(tmp); } ! static private void confirm_send() { message("mail", center("e)dit, f)orget, s)end", __Screen), this_player()); message("prompt", "\nCommand (default 's'): ", this_player()); --- 1179,1404 ---- capitalize(__BoxInfo[__Current]["from"]), postal_time(__BoxInfo[__Current]["date"]), center("--- --- Begin Forwarded Text --- ---"), tmp); ! } ! static void confirm_forward_abort(string str) { if(str == "" || !str) str = "y"; else str = lower_case(str)[0..0]; if(str == "y") { ! postal_error("Forward aborted."); ! return; ! } else if(str != "n") { ! message("prompt", "Answer 'y' or 'n': ", this_player()); ! input_to("confirm_forward_abort"); ! return; ! } message("prompt", "To: ", this_player()); input_to("get_forward_list"); ! } static private void send_letter(string *args) { string flag, tmp; int j, i, maxi, x; ! if(!args || !sizeof(args)) { ! message("prompt", "To: ", this_player()); ! input_to("get_to"); ! return; ! } __FwdRply = 0; __TmpPost = ([ "from": (string)this_player()->GetKeyName(),"date":time()]); ! for(i=0, maxi = sizeof(args); i<maxi; i++) { ! if(args[i] == "" || !args[i]) continue; ! if(!flag && i < maxi-1 && args[i][0] == '-' && strlen(args[i]) > 1) { ! if(member_array(args[i][1..1], ({"c","s","i"})) == -1) ! continue; ! else flag = args[i][1..1]; } ! else if(!flag && args[i][0] == '\\' && strlen(args[i]) > 1) ! args[i] = args[i][1..strlen(args[1])-1]; ! else if(flag) { ! if(args[i][0] != '\'') tmp = args[i]; ! else if(args[i][x=strlen(args[i])-1] =='\'') tmp =args[i][1..x-1]; ! else { ! tmp = args[j=i][1..x]; ! while(++j < maxi && args[j][x=strlen(args[j])-1] != '\'') ! if(x > 0) tmp += " "+args[j][0..x-1]; ! if(args[j][x] == '\'' && x > 1) tmp += " "+args[j][0..x-1]; ! i = j; ! } ! switch(flag) { ! case "c": ! if(!__TmpPost["cc"]) __TmpPost["cc"] = ({}); ! __TmpPost["cc"] += ({ convert_name(tmp) }); ! break; ! case "s": __TmpPost["subject"] = tmp; break; ! case "i": ! tmp=absolute_path((string)this_player()->get_path(),tmp); ! if(sscanf(tmp,user_path(this_player())+"%s", flag) != 1 || ! !((int)master()->valid_read(tmp,this_player()))) { ! if(__CommandLine) { ! this_object()->eventDestruct(); ! return; ! } ! __TmpPost = ([]); ! postal_error("Access denied."); ! return; ! } ! if(!file_exists(tmp)) { ! if(__CommandLine) { ! this_object()->eventDestruct(); ! return; ! } ! __TmpPost = ([]); ! postal_error(sprintf("File %s does not exist.",tmp)); ! return; ! } ! if(!(__TmpPost["message"] = read_file(tmp))) ! __TmpPost["message"] = "EMPTY FILE"; ! break; ! } ! flag = 0; } else { ! if(!__TmpPost["to"]) __TmpPost["to"] = ({ convert_name(args[i]) }); ! else __TmpPost["to"] += ({ convert_name(args[i]) }); ! } ! } ! if(!__TmpPost["to"]) { ! message("prompt", "To: ", this_player()); ! input_to("get_to"); ! return; ! } ! if(!__TmpPost["subject"]) { ! message("prompt", "Subject:\n ", this_player()); ! input_to("get_subject"); ! return; ! } ! else message("mail", sprintf("Subject: %s", __TmpPost["subject"]), ! this_player()); ! if(!__TmpPost["cc"] && __Options["askcc"]) { ! message("prompt", "Copies to: ", this_player()); ! input_to("get_cc"); ! return; ! } ! else if(!__TmpPost["cc"]) __TmpPost["cc"] = ({}); ! if(!__TmpPost["message"]) get_cc(""); ! else { ! __TmpPost["message"] = sprintf("%s%s", __TmpPost["message"], ! query_signature()); ! confirm_send(); } ! } ! static void get_to(string str) { if(str == "" || !str) { ! if(__CommandLine) { ! this_object()->eventDestruct(); ! return; ! } ! postal_error("No recipients given. Mail aborted."); ! return; ! } send_letter(explode(str, " ")); ! } ! static void get_subject(string str) { string tmp; ! if(str == "" || !str) { ! message("prompt", "No subject given. Continue (default 'n')?\n ", ! this_player()); ! input_to("confirm_subject"); ! return; ! } __TmpPost["subject"] = str; if(!__TmpPost["cc"] && __Options["askcc"]) { ! message("prompt", "Copies to:\n ", this_player()); ! input_to("get_cc"); ! return; ! } else if(!__TmpPost["cc"]) __TmpPost["cc"] = ({}); if(!__TmpPost["message"]) get_cc(""); else { ! __TmpPost["message"] = sprintf("%s%s", __TmpPost["message"], ! query_signature()); ! confirm_send(); } ! } ! static void confirm_subject(string str) { if(str == "" || !str) str = "n"; else str = lower_case(str)[0..0]; if(str == "n") { ! if(__CommandLine) { ! this_object()->eventDestruct(); ! return; ! } ! __TmpPost = ([]); ! postal_error("Mail aborted."); ! return; ! } else if(str == "y") get_subject("[No Subject]"); else { ! message("prompt", "Answer 'y' or 'n': ", this_player()); ! input_to("confirm_subject"); ! return; ! } ! } ! static void get_cc(string str) { string tmp; ! if(!__TmpPost["cc"]) __TmpPost["cc"] = ({}); if(str && str != "") __TmpPost["cc"] += explode(str, " "); if(__TmpPost["message"]) { ! __TmpPost["message"] = sprintf("%s%s", __TmpPost["message"], ! query_signature()); ! confirm_send(); ! return; ! } if(file_exists(tmp = DIR_TMP+"/"+(string)this_player()->GetKeyName())) ! rm(tmp); if(!__FwdRply || __FwdRply[0] == "f") { ! message("mail",sprintf("\n%%^INITTERM%%^%s", header(__TmpPost)), ! this_player()); ! this_player()->eventEdit(tmp, (: complete_send :)); ! return; } write_file(tmp, __FwdRply[1]); message("mail", sprintf("\n%%^INITTERM%%^%s", header(__TmpPost)), this_player()); this_player()->eventEdit(tmp, (: complete_send :)); ! } ! void complete_send() { string str; ! if( !(str = read_file(DIR_TMP "/" + (string)this_player()->GetKeyName()))) ! str = "No message."; if(__FwdRply && __FwdRply[0] == "f") ! str = sprintf("%s\n%s\n%s", str, __FwdRply[1], query_signature()); else str = sprintf("%s%s", str, query_signature()); __TmpPost["message"] = str; __FwdRply = 0; confirm_send(); } ! static private string query_signature() { string tmp; ! if(!__Options["sig file"]) return ""; if(strsrch(__Options["sig file"], " ") != -1) ! return sprintf("\n%s", __Options["sig file"]); tmp = absolute_path(user_path((string)this_player()->GetKeyName()), __Options["sig file"]); if(!((int)master()->valid_read(tmp, this_player())) || !file_exists(tmp)) { ! return sprintf("\n%s", __Options["sig file"]); } return read_file(tmp); } ! static private void confirm_send() { message("mail", center("e)dit, f)orget, s)end", __Screen), this_player()); message("prompt", "\nCommand (default 's'): ", this_player()); *************** *** 1411,1461 **** if(str == "" || !str) str = "s"; else str = lower_case(str)[0..0]; switch(str) { ! case "s": ! notify_send((string *)LOCALPOST_D->send_post(copy(__TmpPost))); ! break; ! case "f": ! __TmpPost = ([]); ! postal_error("Mail aborted!"); ! break; ! case "e": ! if(file_exists(tmp = sprintf("%s/%s.iips", DIR_TMP, ! (string)this_player()->GetKeyName()))) rm(tmp); ! write_file(tmp, __TmpPost["message"]); ! map_delete(__TmpPost, "message"); ! this_player()->eventEdit(tmp, (: complete_send :)); ! break; ! default: ! message("prompt", "Invalid command. Command: ", this_player()); ! input_to("handle_send_choice"); ! break; } } static private void notify_send(string *failures) { string *arr; string tmp; ! if(!sizeof(failures)) ! message("mail", "\n\t%^GREEN%^Mail successfully sent!", this_player()); else { ! message("mail", sprintf("\nFailed to send to: %s", ! implode(failures, ", ")), this_player()); ! if(creatorp(this_player())) { ! write_file(tmp=user_path((string)this_player()->GetKeyName())+"/dead.letter", ! __TmpPost["message"]); ! } ! else write_file(tmp = sprintf("%s/%s.letter", DIR_TMP, ! (string)this_player()->GetKeyName()), __TmpPost["message"]); ! message("mail", sprintf("A copy of the letter was saved to %s", tmp), ! this_player()); } if(sizeof(arr=distinct_array(__TmpPost["to"]+__TmpPost["cc"])-failures)) ! message("mail", sprintf("Mail sent to: %s", implode(arr,", ")), ! this_player()); if(__CommandLine) { ! this_object()->eventDestruct(); ! return; } secondary_prompt(); input_to("index_cmd"); --- 1411,1461 ---- if(str == "" || !str) str = "s"; else str = lower_case(str)[0..0]; switch(str) { ! case "s": ! notify_send((string *)LOCALPOST_D->send_post(copy(__TmpPost))); ! break; ! case "f": ! __TmpPost = ([]); ! postal_error("Mail aborted!"); ! break; ! case "e": ! if(file_exists(tmp = sprintf("%s/%s.iips", DIR_TMP, ! (string)this_player()->GetKeyName()))) rm(tmp); ! write_file(tmp, __TmpPost["message"]); ! map_delete(__TmpPost, "message"); ! this_player()->eventEdit(tmp, (: complete_send :)); ! break; ! default: ! message("prompt", "Invalid command. Command: ", this_player()); ! input_to("handle_send_choice"); ! break; } } static private void notify_send(string *failures) { string *arr; string tmp; ! if(!sizeof(failures)) ! message("mail", "\n\t%^GREEN%^Mail successfully sent!", this_player()); else { ! message("mail", sprintf("\nFailed to send to: %s", ! implode(failures, ", ")), this_player()); ! if(creatorp(this_player())) { ! write_file(tmp=user_path((string)this_player()->GetKeyName())+"/dead.letter", ! __TmpPost["message"]); ! } ! else write_file(tmp = sprintf("%s/%s.letter", DIR_TMP, ! (string)this_player()->GetKeyName()), __TmpPost["message"]); ! message("mail", sprintf("A copy of the letter was saved to %s", tmp), ! this_player()); } if(sizeof(arr=distinct_array(__TmpPost["to"]+__TmpPost["cc"])-failures)) ! message("mail", sprintf("Mail sent to: %s", implode(arr,", ")), ! this_player()); if(__CommandLine) { ! this_object()->eventDestruct(); ! return; } secondary_prompt(); input_to("index_cmd"); diff -c -r --new-file ds1.1/lib/secure/obj/replacer.c ds2.0r27/lib/secure/obj/replacer.c *** ds1.1/lib/secure/obj/replacer.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/obj/replacer.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,192 ---- + // string replacer, by Cratylus. + // Use this carelessly at your own peril. + + #include <lib.h> + #include <vendor_types.h> + inherit LIB_ITEM; + inherit LIB_TURN; + + string a1,a2,a3,line; + int n, active; + + static private void validate() { + if(!this_player()) return 0; + if( !((int)master()->valid_apply(({ "SECURE" }))) || !securep(this_player())) + error("Illegal attempt to use replacer: "+get_stack()+" "+identify(previous_object(-1))); + } + + void create(){ + ::create(); + SetKeyName("string replacer"); + SetId(({"replacer","thing","gadget","string replacer","device"})); + SetShort("a string replacer"); + SetLong("This is the most dangerous device on the mud.\n"+ + "It allows you to replace strings in files.\n"+ + "To use it, you must first \"turn on replacer\"\n"+ + "Then you have two options:\n"+ + "To replace a word in one file: replace <filename> <oldword> <newword>\n"+ + "To replace a word in EVERY FILE IN YOUR CURRENT WORKING DIRECTORY:\n autorep <oldword> <newword>\n\n"+ + "It does not handle spaces or special characters well. Using "+ + "strings with parentheses, brackets, or anything other than "+ + "the english alphabet may have unexpected results."+ + "\n%^RED%^%^BOLD%^ADMIN USE ONLY!%^RESET%^"); + SetMass(20); + SetValue(10); + SetVendorType(VT_TREASURE); + active = 0; + } + + void init(){ + add_action("rep_string","replace"); + add_action("autorep","autorep"); + } + + int eventActivate(){ + validate(); + write("With an unearthly roar, the string replacer comes "+ + "to life. You sense great danger."); + write("\n\nWARNING: Your current working directory is:\n\n"); + write(this_player()->query_cwd()+"\n\n"); + say(this_player()->GetName()+" turns on "+possessive(this_player())+ + " string replacer and you hear a loud, unearthly "+ + "roar that makes the ground tremble."); + active = 1; + return 1; + } + + int eventDeactivate(){ + validate(); + write("The string replacer powers off with a peculiar "+ + "mechanical whine. You feel safer."); + say(this_player()->GetName()+"'s string replacer "+ + "powers down."); + active = 0; + return 1; + } + + varargs mixed eventTurn(string str){ + validate(); + if( this_player() != environment() ) { write("You don't have that."); return 0; } + write("You turn the replacer over in your hands."); + say(this_player()->GetKeyName()+" turns over a string replacer in "+possessive(this_player())+" hands."); + return 1; + } + + int eventTurnOn(object ob){ + validate(); + + if( this_player() != environment() ) { write("You don't have that."); return 0; } + + if(!creatorp(this_player())) { + write("This device is not usable by mortals."); + return 0; + } + + if(active){ + write("It's already on."); + return 0; + } + else eventActivate(); + + return 1; + } + + varargs mixed eventTurnOff(string str){ + validate(); + if( this_player() != environment() ) { write("You don't have that."); return 0; } + if(!active){ + write("It's already off."); + return 0; + } + else eventDeactivate(); + + return 1; + } + + int autorep(string str){ + string dir, a1, a2; + string *listing; + + validate(); + if(!active){ + write("The string replacer is not turned on."); + return 1; + } + + if( !str || str=="" || sscanf(str,"%s %s",a1,a2) != 2){ + write("Syntax: autorep <oldword> <newword>\n"); + eventDeactivate(); + return 1; + } + dir=this_player()->query_cwd()+"/"; + listing=get_dir(dir); + foreach(string file in listing){ + if(file_size(dir+file) > 0) this_object()->rep_string(file+" "+str); + } + eventDeactivate(); + return 1; + } + + int rep_string(string str){ + string dir,file,tempfile,backup; + int valid_line; + + validate(); + if(!active){ + write("The string replacer is not turned on."); + return 1; + } + + valid_line=1; + n=1; + if( !str || str==""){ + write("Syntax: replace <filename> <oldword> <newword>\n"); + eventDeactivate(); + return 1; + } + if(sscanf(str,"%s %s %s",a1,a2,a3) == 3){ + dir=this_player()->query_cwd()+"/"; + file=dir+a1; + + if(file_size(file) <= 0 ) { + write("Invalid filename."); + eventDeactivate(); + return 1; + } + + tempfile="/tmp/"+lower_case(this_player()->GetName())+".TempReplace"; + backup="/tmp/"+lower_case(this_player()->GetName())+"."+a1+".bak"; + if(file_size(backup)){ rm(backup); } + if(file_size(tempfile)){ rm(tempfile); } + write("Searching "+a1+" for string: "+a2+".\n"); + while(valid_line){ + line=read_file(file, n, 1); + if(!line || line=="") valid_line=0; + this_object()->replace(line); + if(line) write_file(tempfile,line); + n++; + } + cp(file, backup); + cp(tempfile, file); + if(file_size(backup)){ rm(backup); } + if(file_size(tempfile)){ rm(tempfile); } + write("Replace action complete. File "+file+" modified.\n"); + if(query_verb() == "replace") eventDeactivate(); + return 1; + } + write("Syntax: replace <filename> <oldstring> <newstring>\n"); + eventDeactivate(); + return 1; + } + + int replace(string str){ + string s1,s2; + validate(); + if(sizeof(str) && sscanf(str,"%s"+a2+"%s",s1,s2)>1){ + line=s1+a3+s2; + write("Found string in line "+n+". Replacing with: "+a3+".\n"); + this_object()->replace(line); + } + //tc("line: "+line); + return 1; + } diff -c -r --new-file ds1.1/lib/secure/obj/roommaker.c ds2.0r27/lib/secure/obj/roommaker.c *** ds1.1/lib/secure/obj/roommaker.c Sun Feb 1 21:30:47 1998 --- ds2.0r27/lib/secure/obj/roommaker.c Wed Jul 5 00:01:06 2006 *************** *** 1,685 **** ! /* /secure/obj/roommaker.c ! * from the Dead Souls Object Library ! * a room building object ! * created by Descartes of Borg 951202 ! */ #include <lib.h> ! #include <message_class.h> ! #include "include/roommaker.h" ! inherit LIB_ROOM; - private int Columns; - private string RoomFile; - private object Author; static void create() { ! room::create(); ! SetNoClean(1); ! SetProperties( ([ "light" : 2 ]) ); ! } ! ! void eventAbort() { ! if( previous_object() != Author ) return; ! rm(RoomFile); ! Author->eventPrint("Room creation aborted.", MSG_SYSTEM); ! Destruct(); ! } ! ! varargs mixed eventCreateRoom(string file, string climate) { ! if( file_exists(file) ) { ! Destruct(); ! return "You cannot overwrite an existing file."; ! } ! if( !write_file(file, "") ) { ! Destruct(); ! return "Permission denied."; ! } ! if( !climate || climate == "" ) SetClimate("temperate"); ! SetClimate(climate); ! RoomFile = file; ! Author = this_player(); ! Columns = ((int *)Author->GetScreen())[0]; ! MainMenu(); ! return 1; ! } ! ! static void eventPrintTitle(string title) { ! Author->eventPrint(center("Dead Souls Object Library Room Maker", Columns) + ! "\n", MSG_SYSTEM); ! Author->eventPrint(center(title, Columns) +"\n\n", MSG_SYSTEM); ! } ! ! static void MainMenu() { ! string str; ! ! eventPrintTitle("Main Menu"); ! str = "1) Climate (" + GetClimate() + ")\n"; ! str += "2) Town (" + GetTown() + ")\n"; ! str += "3) Properties (" + GetValue(GetProperties()) + ")\n"; ! str += "4) Short (" + GetValue(GetShort()) + ")\n"; ! str += "5) Long (" + GetValue(GetLong()) + ")\n"; ! str += "6) Inventory (" + GetValue(GetInventory()) + ")\n"; ! str += "7) Items (" + GetValue(GetId()) + ")\n"; ! str += "8) Enters (" + GetValue(GetEnters()) + ")\n"; ! str += "9) Exits (" + GetValue(GetExits()) + ")\n"; ! str += "10) Obvious Exits (" + GetObviousExits() + ")\n"; ! str += "\n"; ! str += "s) Save the room\n"; ! str += "q) Quit\n"; ! str += "x) Save then quit\n\n"; ! Author->eventPrint(str, MSG_SYSTEM); ! Author->eventPrint("Choice: ", MSG_PROMPT); ! input_to((: MainMenuCommand :)); ! } ! ! static void MainMenuCommand(string str) { ! if( !str || str == "" ) { ! Author->eventPrint("Invalid command, try again: ", MSG_PROMPT); ! input_to((: MainMenuCommand :)); ! return; ! } ! switch(lower_case(str)) { ! case "1": ! ClimateMenu(); ! return; ! ! case "2": ! TownMenu(); ! return; ! ! case "3": ! PropertiesMenu(); ! return; ! ! case "4": ! ShortMenu(); ! return; ! ! case "5": ! LongMenu(); ! return; ! ! case "6": ! InventoryMenu(); ! return; ! ! case "7": ! ItemsMenu(); ! return; ! ! case "8": ! DirsMenu("enter"); ! return; ! ! case "9": ! DirsMenu("exit"); ! return; ! ! case "10": ! ObviousExitsMenu(); ! return; ! ! case "s": ! SaveRoom(); ! MainMenu(); ! return; ! ! case "q": ! Author->eventPrint("Exiting the room maker.", MSG_SYSTEM); ! Destruct(); ! return; ! ! case "x": ! SaveRoom(); ! Author->eventPrint("Exiting the room maker.", MSG_SYSTEM); ! Destruct(); ! return; ! ! default: ! Author->eventPrint("Invalid command, please try again: ", MSG_PROMPT); ! input_to((: MainMenuCommand :)); ! return; ! } ! } ! ! static void ClimateMenu() { ! string str; ! ! eventPrintTitle("Climate Painter"); ! Author->eventPrint("Current climate: " + GetClimate() +"\n\n", MSG_SYSTEM); ! str = ("1) indoors\n" ! "2) arctic\n" ! "3) sub-arctic\n" ! "4) temperate\n" ! "5) tropical\n" ! "6) sub-tropical\n" ! "7) arid\n\n" ! "k) Keep current climate\n\n"); ! Author->eventPrint(str, MSG_SYSTEM); ! Author->eventPrint("Choice: ", MSG_PROMPT); ! input_to((: ClimateMenuCommand :)); ! } ! ! static void ClimateMenuCommand(string cmd) { ! if( !cmd ) cmd = ""; ! switch(lower_case(cmd)) { ! case "1": ! cmd = "indoors"; ! break; ! ! case "2": ! cmd = "arctic"; ! break; ! ! case "3": ! cmd = "sub-arctic"; ! break; ! ! case "4": ! cmd = "temperate"; ! break; ! ! case "5": ! cmd = "tropical"; ! break; ! ! case "6": ! cmd = "sub-tropical"; ! break; ! ! case "7": ! cmd = "arid"; ! break; ! ! case "k": ! cmd = 0; ! break; ! ! default: ! eventPrint("Invalid command, please try again: ", MSG_PROMPT); ! input_to((: ClimateMenuCommand :)); ! return; ! } ! if( cmd ) SetClimate(cmd); ! MainMenu(); ! } ! ! static void TownMenu() { ! eventPrintTitle("Town Painter"); ! Author->eventPrint("Current town: " + GetTown() + "\n\n", MSG_SYSTEM); ! Author->eventPrint("New town (<return> to keep current town): ", ! MSG_PROMPT); ! input_to((: TownMenuCommand :)); ! } ! ! static void TownMenuCommand(string cmd) { ! if( cmd && cmd != "" ) SetTown(cmd); ! MainMenu(); ! } ! ! static void PropertiesMenu() { ! string *props; ! mapping mp; ! string str; ! int i; ! ! eventPrintTitle("Property Painter"); ! props = keys(mp = GetProperties()); ! for(str = "", i=0; i<sizeof(props); i++) ! str += (i+1) + ") " + props[i] + ": " + identify(mp[props[i]]) + "\n"; ! str += "\nn) New property\nr) Return to main menu\n\n"; ! Author->eventPrint(str, MSG_SYSTEM); ! Author->eventPrint("Choice: ", MSG_PROMPT); ! input_to((: PropertiesMenuCommand :), props); } - static void PropertiesMenuCommand(string cmd, string *props) { - int x; ! if( x = to_int(cmd) ) x--; ! else { ! switch(lower_case(cmd)) { ! case "n": ! Author->eventPrint("Property name: ", MSG_PROMPT); ! input_to(function(string str) { ! if( !str || str == "" ) { ! PropertiesMenu(); ! return; ! } ! Author->eventPrint("Value for " + str + ": ", ! MSG_PROMPT); ! input_to(function(string str, string prop) { ! int x; ! ! if( !str || str == "" ) { ! PropertiesMenu(); ! return; ! } ! if( (x = to_int(str)) || str == "0" ) ! SetProperty(prop, x); ! else SetProperty(prop, str); ! PropertiesMenu(); ! }, str); ! }); ! return; ! ! case "r": ! MainMenu(); ! return; ! ! default: ! Author->eventPrint("Invalid command, please try again: ", ! MSG_PROMPT); ! input_to((: PropertiesMenuCommand :), props); ! return; ! } ! } ! if( x >= sizeof(props) || x < 0 ) { ! Author->eventPrint("Invalid command, please try again: ", MSG_PROMPT); ! input_to((: PropertiesMenuCommand :), props); ! return; ! } ! Author->eventPrint("New value for " + props[x] + " (<return> to delete): ", ! MSG_PROMPT); ! input_to(function(string str, string prop) { ! if( !str || str == "" ) RemoveProperty(prop); ! else { ! int x; ! ! if( (x = to_int(str)) || str == "0" ) ! SetProperty(prop, x); ! else SetProperty(prop, str); ! } ! PropertiesMenu(); ! return; ! }, props[x]); ! } ! ! static void ShortMenu() { ! eventPrintTitle("Short Description Painter"); ! Author->eventPrint("Current short: " + GetShort() + "\n\n", MSG_SYSTEM); ! Author->eventPrint("New short (<return> to keep current short): ", ! MSG_PROMPT); ! input_to((: ShortMenuCommand :)); ! } ! ! static void ShortMenuCommand(string cmd) { ! if( cmd && cmd != "" ) SetShort(cmd); ! MainMenu(); ! } ! ! static void LongMenu() { ! string str; ! ! eventPrintTitle("Long Description Painter"); ! Author->eventPrint(GetLong() + "\n", MSG_SYSTEM); ! str = ("e) Edit current long\n" ! "k) Keep current long\n" ! "n) New long\n\n"); ! Author->eventPrint(str, MSG_SYSTEM); ! Author->eventPrint("Choice: ", MSG_PROMPT); ! input_to((: LongMenuCommand :)); ! } ! ! static void LongMenuCommand(string cmd) { ! string str; ! ! if( !cmd ) cmd = ""; ! switch(cmd) { ! case "e": ! str = GetLong(); ! break; ! ! case "k": ! MainMenu(); ! return; ! ! case "n": ! str = ""; ! break; ! ! default: ! Author->eventPrint("Invalid command, please try again: ", MSG_PROMPT); ! input_to((: LongMenuCommand :)); ! return; ! } ! if( file_exists( DIR_TMP + "/" + (string)Author->GetKeyName()) ) ! rm(DIR_TMP + "/" + (string)Author->GetKeyName()); ! write_file(DIR_TMP + "/" + (string)Author->GetKeyName(), str); ! Author->eventEdit(DIR_TMP + "/" + (string)Author->GetKeyName(), ! function() { ! string str; ! ! if( !(str = read_file(DIR_TMP + "/" + ! (string)Author->GetKeyName()))) ! MainMenu(); ! else SetLong(replace_string(str, "\n", " ")); ! MainMenu(); ! }); ! } ! ! static void InventoryMenu() { ! string *items; ! mapping mp; ! string str; ! int i; ! ! eventPrintTitle("Inventory Painter"); ! items = keys(mp = GetInventory()); ! for(str = "", i=0; i<sizeof(items); i++) ! str += (i+1) + ") " + items[i] + ": " + mp[items[i]] + "\n"; ! str += "\nn) New inventory item\nr) Return to main menu\n\n"; ! Author->eventPrint(str, MSG_SYSTEM); ! Author->eventPrint("Choice: ", MSG_PROMPT); ! input_to((: InventoryMenuCommand :), items); } - static void InventoryMenuCommand(string cmd, string *items) { - int x; ! if( x = to_int(cmd) ) x--; else { ! switch(lower_case(cmd)) { ! case "n": ! Author->eventPrint("Inventory name: ", MSG_PROMPT); ! input_to(function(string str) { ! if( !str || str == "" ) { ! InventoryMenu(); ! return; ! } ! Author->eventPrint("Value for " + str + ": ", ! MSG_PROMPT); ! input_to(function(string str, string prop) { ! mapping mp; ! int x; ! ! if( !str || str=="" || !(x=to_int(str))){ ! InventoryMenu(); ! return; ! } ! mp = GetInventory(); ! mp[prop] = x; ! SetInventory(mp); ! InventoryMenu(); ! }, str); ! }); ! return; ! ! case "r": ! MainMenu(); ! return; ! ! default: ! Author->eventPrint("Invalid command, please try again: ", ! MSG_PROMPT); ! input_to((: InventoryMenuCommand :), items); ! return; ! } ! } ! if( x >= sizeof(items) || x < 0 ) { ! Author->eventPrint("Invalid command, please try again: ", MSG_PROMPT); ! input_to((: InventoryMenuCommand :), items); ! return; ! } ! Author->eventPrint("New value for " + items[x] + " (<return> to delete): ", ! MSG_PROMPT); ! input_to(function(string str, string item) { ! mapping mp; ! ! if( !str || str == "" ) { ! mp = GetInventory(); ! map_delete(mp, item); ! SetInventory(mp); ! } ! else { ! mp = GetInventory(); ! mp[item] = to_int(str); ! SetInventory(mp); ! } ! InventoryMenu(); ! return; ! }, items[x]); ! } ! ! static void ItemsMenu() { ! string *items; ! string str = ""; ! int i; ! ! eventPrintTitle("Items Painter"); ! for(i=0, items = GetId(); i<sizeof(items); i++) ! str += (i+1) + ") " + items[i] + " (" + ! GetValue(GetItemDescription(items[i])) + ")\n"; ! str += "\nn) New items\n"; ! str += "r) Return to main menu\n"; ! Author->eventPrint(str, MSG_SYSTEM); ! Author->eventPrint("Choice: ", MSG_PROMPT); ! input_to((: ItemsMenuCommand :), items); ! } ! ! static void ItemsMenuCommand(string cmd, string *items) { ! int x; ! ! if( !cmd ) cmd = ""; ! if( !(x = to_int(cmd)) ) { ! switch(lower_case(cmd)) { ! case "n": ! Author->eventPrint("List of new items, comma separated: ", ! MSG_PROMPT); ! input_to(function(string str) { ! string *items; ! ! items = explode(str, ","); ! if( !sizeof(items) ) { ! ItemsMenu(); ! return; ! } ! Author->eventPrint("Description:", MSG_SYSTEM); ! if( file_exists(DIR_TMP + "/" + ! (string)Author->GetKeyName()) ) ! rm(DIR_TMP + "/" + (string)Author->GetKeyName()); ! Author->eventEdit(DIR_TMP + "/" + ! (string)Author->GetKeyName(), ! (: CompleteItem, items :)); ! }); ! return; ! ! case "r": ! MainMenu(); ! return; ! ! default: ! Author->eventPrint("Invalid command, please try again: ", ! MSG_PROMPT); ! input_to((: ItemsMenuCommand :), items); ! return; ! } ! } ! else if( x >= sizeof(items) || x < 0 ) { ! Author->eventPrint("Invalid command, please try again: ", MSG_PROMPT); ! input_to((: ItemsMenuCommand :), items); ! return; ! } ! Author->eventPrint("New value for " + items[x]+" (empty desc to delete): ", ! MSG_SYSTEM); ! if( file_exists(DIR_TMP + "/" + (string)Author->GetKeyName()) ) ! rm(DIR_TMP + "/" + (string)Author->GetKeyName()); ! write_file(DIR_TMP + "/" + (string)Author->GetKeyName(), ! GetItemDescription(items[x])); ! Author->eventEdit(DIR_TMP + "/" + (string)Author->GetKeyName(), ! (: CompleteItem, ({ items[x] }) :)); ! } ! ! void CompleteItem(string *items) { ! string str, item; ! ! if( previous_object() != Author ) return; ! str = read_file(DIR_TMP + "/" + (string)Author->GetKeyName()); ! rm(DIR_TMP + "/" + (string)Author->GetKeyName()); ! if( !str || trim(str) == "" ) foreach(item in items) RemoveItem(item); ! else foreach(item in items) AddItem(item, replace_string(str, "\n", " ")); ! ItemsMenu(); ! } ! ! static void DirsMenu(string type) { ! string *sorties; ! function f; ! string str; ! int i; ! ! if( type == "enter" ) { ! eventPrintTitle("Enters Painter"); ! sorties = GetEnters(); ! f = (: GetEnter :); } else { ! eventPrintTitle("Exits Painter"); ! sorties = GetExits(); ! f = (: GetExit :); ! } ! for(str = "", i=0; i<sizeof(sorties); i++) ! str += (i+1) + ") " + sorties[i] + ": " + evaluate(f, sorties[i]) +"\n"; ! str += "\nn) New " + type + "\nr) Return to main menu\n\n"; ! Author->eventPrint(str, MSG_SYSTEM); ! Author->eventPrint("Choice: ", MSG_PROMPT); ! input_to((: DirsMenuCommand :), type, sorties); } ! static void DirsMenuCommand(string cmd, string type, string *sorties) { ! int x; ! if( x = to_int(cmd) ) x--; ! else { ! switch(lower_case(cmd)) { ! case "n": ! Author->eventPrint(capitalize(type) + " name: ", MSG_PROMPT); ! input_to(function(string str, string type) { ! if( !str || str == "" ) { ! DirsMenu(type); ! return; ! } ! Author->eventPrint("Destination for " + str + ": ", ! MSG_PROMPT); ! input_to(function(string str,string type,string dir){ ! int x; ! ! if( !str || str == "" ) { ! DirsMenu(type); ! return; ! } ! if( type == "enter" ) AddEnter(dir, str); ! else AddExit(dir, str); ! DirsMenu(type); ! }, type, str); ! }, type); ! return; ! ! case "r": ! MainMenu(); ! return; ! ! default: ! Author->eventPrint("Invalid command, please try again: ", ! MSG_PROMPT); ! input_to((: InventoryMenuCommand :), sorties); ! return; ! } ! } ! if( x >= sizeof(sorties) || x < 0 ) { ! Author->eventPrint("Invalid command, please try again: ", MSG_PROMPT); ! input_to((: DirsMenuCommand :), type, sorties); ! return; ! } ! Author->eventPrint("New value for " + sorties[x]+" (<return> to delete): ", ! MSG_PROMPT); ! input_to(function(string str, string type, string dir) { ! if( !str || str == "" ) { ! if( type == "enter" ) RemoveEnter(dir); ! else RemoveExit(dir); ! } ! else { ! if( type == "enter" ) AddEnter(dir, str); ! else AddExit(dir, str); ! } ! DirsMenu(type); ! return; ! }, type, sorties[x]); ! } ! ! static void ObviousExitsMenu() { ! eventPrintTitle("Obvious Exits Painter"); ! Author->eventPrint("Current obvious exits: " + GetObviousExits() + "\n\n", ! MSG_SYSTEM); ! Author->eventPrint("New obvious exits (<return> to keep current exits): ", ! MSG_PROMPT); ! input_to((: ObviousExitsMenuCommand :)); ! } ! ! static void ObviousExitsMenuCommand(string cmd) { ! if( cmd && cmd != "" ) SetObviousExits(cmd); ! MainMenu(); ! } ! ! static void LoadInventory() { } ! ! static void SaveRoom() { ! string str; ! ! str = "/* " + RoomFile + "\n"; ! str += " * created by " + (string)Author->GetCapName() + "@" + ! mud_name() + "\n"; ! str += " * Date: " + ctime(time()) + "\n */\n\n"; ! str += "#include <lib.h>\n\n"; ! str += "inherit LIB_ROOM;\n\n"; ! str += "static void create() {\n room::create();\n"; ! str += " SetTown(" + save_variable(GetTown()) + ");\n"; ! str += " SetClimate(" +save_variable(GetClimate()) + ");\n"; ! str += " SetProperties(" + save_variable(GetProperties()) + ");\n"; ! str += " SetShort(" + save_variable(GetShort()) + ");\n"; ! str += " SetLong(\"" + GetLong() + "\");\n"; ! str += " SetInventory(" + save_variable(GetInventory()) + ");\n"; ! str += " SetItems( ([ "; ! foreach(string item in GetId()) ! str += "\"" + item + "\" : \"" + GetItemDescription(item) + "\",\n"; ! str += " ]));\n"; ! foreach(string dir in GetEnters()) ! str += " AddEnter(\"" + dir + "\", \"" + GetEnter(dir) + "\");\n"; ! foreach(string dir2 in GetExits()) ! str += " AddExit(\"" + dir2 + "\", \"" + GetExit(dir2) + "\");\n"; ! str += " SetObviousExits(" + save_variable(GetObviousExits()) + ");\n"; ! str += "}\n"; ! write_file(RoomFile, str); ! } ! ! varargs static string GetValue(mixed val, string str) { ! str = save_variable(val); ! if( strlen(str) >= (Columns - 25) ) str = str[0..(Columns-26)] + "..."; ! /* ! if( !str ) str = ""; ! if( stringp(val) || intp(val) ) { ! str += val; ! ! return replace_string(str, "\n", "\\n"); ! } ! if( arrayp(val) ) { ! str += "({"; ! foreach(mixed thing in val) str = GetValue(thing, str) + ","; ! str += "})"; ! if( strlen(str) >= (Columns - 25) ) str = str[0..(Columns-26)]; ! return str; ! } ! if( mapp(val) ) { ! str += "(["; ! foreach(string key, mixed v in val) { ! str += key + " : "; ! str = GetValue(v, str); ! str += ","; ! } ! str += "])"; ! if( strlen(str) >= (Columns - 25) ) str = str[0..(Columns-26)]; ! return str; ! } */ ! return str; } --- 1,1982 ---- ! /* Roommaker by Haderach @ Frontiers ! * Sep 21 2005 ! */ #include <lib.h> ! #include <vendor_types.h> ! inherit LIB_ITEM; ! int Begin(); // The function that gets called when the object is activated ! ! //=================== ! //= Reset Functions = ! //=================== ! void reset_room_header (); ! void reset_room_properties(); ! void reset_room_attributes(); ! void reset_temps (); ! ! //=========================== ! //= Menu Printing Functions = ! //=========================== ! ! int print_menu_main (); ! int print_menu_room_create(); ! int print_menu_item_create(); ! int print_menu_room_climate(); ! int print_menu_room_properties(); ! int print_menu_room_exits(); ! int print_menu_room_enters(); ! int print_menu_room_inventory(); ! int print_menu_room_item(); ! int print_menu_room_smell(); ! int print_menu_room_listen(); ! ! //============================= ! //= Menu Processing Functions = ! //============================= ! ! int process_default (string str); ! int process_menu_main (string str); ! int process_room_create(string str); ! int process_room_climate(string str); ! int process_room_properties(string str); ! int process_room_exits(string str); ! int process_room_enters(string str); ! int process_room_item(string str); ! int process_room_inventory(string str); ! int process_room_smell(string str); ! int process_room_listen(string str); ! ! //============================= ! //= Room Setter Functions = ! //============================= ! int set_town(string str); ! int set_short(string str); ! int set_obvious(string str); ! int set_light(string str); ! int set_long(string str); ! int set_room_exit(string str); ! int set_room_exit_helper(string str); ! int set_room_enter(string str); ! int set_room_enter_helper(string str); ! int set_room_inventory(string str); ! int set_room_inventory_helper(string str); ! int set_room_item_single(string str); ! int set_room_item_multiple(string str); ! int set_room_item_description(string str); ! int set_room_smell_single(string str); ! int set_room_smell_multiple(string str); ! int set_room_smell_description(string str); ! int set_room_listen_single(string str); ! int set_room_listen_multiple(string str); ! int set_room_listen_description(string str); ! int set_defaultdir_helper(string str); ! int set_defaultdir(string str); ! int set_defaultdir_main(string str); ! // toggle the room properties ! int toggle_attack(); ! int toggle_bump(); ! int toggle_steal(); ! int toggle_magic(); ! int toggle_paralyze(); ! int toggle_teleport(); ! ! //============================== ! //= Display Printing Functions = ! //============================== ! string print_room_list_for_display (mapping room_map); ! string print_properties_for_display (); ! string print_room_items_for_display (); ! string print_room_inventory_for_display (); ! string print_room_exits_for_display (); ! string print_room_enters_for_display (); ! string print_room_smells_for_display (); ! string print_room_listens_for_display (); ! ! //============================== ! //= File Printing Functions = ! //============================== ! string print_room_for_file_helper (mapping room_map); ! string print_properties_for_file (); ! string print_room_items_for_file (); ! string print_room_inventory_for_file (); ! string print_room_smells_for_file (); ! string print_room_listens_for_file (); ! string print_room_exits_for_file (); ! string print_room_enters_for_file (); ! ! ! //============================= ! //= Room Load/Save Functions = ! //============================= ! int write_to_file(string str); ! //int read_room(string str); ! ! //==================================================== ! //= Initialize variables to the beginning values = ! //==================================================== ! ! mapping climates = (([ "1":"indoors", "2":"temperate", "3":"arid", ! "4":"arctic", "5":"tropical", "6":"sub-tropical" ])); ! mapping room_properties_map = (([ "no attack":"0", ! "no bump":"0", ! "no steal":"0", ! "no magic":"0", ! "no paralyze":"0", ! "no teleport":"0" ! ])); ! ! mapping room_attributes_map = (([ "Town":"", ! "Climate":"", ! "Short Desc":"", ! "Long Desc (Day)":"", ! "Long Desc (Night)":"", ! "Obvious Exits":"", ! "Light Level (Day)":"30", ! "Light Level (Night)":"15" ])); ! ! mapping room_items_map = ([]); ! mapping room_inventory_map = ([]); ! mapping room_exits_map = ([]); ! mapping room_enters_map = ([]); ! mapping room_smells_map = ([]); ! mapping room_listens_map = ([]); ! ! string *multi_item_array = ({}); ! string objectdescription = ""; ! ! string tempdir = ""; ! string prefix = ""; ! string defaultdir = ""; ! ! string username = ""; // the administrator's lowercase name ! string capitalname = ""; // the administrator's proper name ! ! string header = ""; ! string tail = ""; ! string extrafuns = ""; ! ! string globalstr = ""; ! string globalstr2 = ""; ! ! int check_prop(mixed arg){ ! if(!arg || sizeof(arg) < 1) return 0; ! else return 1; ! } ! ! ! //==================================================== ! //= Main function. Creates the actual item = ! //==================================================== static void create() { ! item::create(); ! SetKeyName("Object Maker"); ! SetId( ({"om", "room maker", "roommaker", "maker", "tool"}) ); ! SetShort("a room maker"); ! SetLong("This is a great tool for any creator.\n" ! "Type \"rmake\" to start the roommaker. Be aware that it keeps the " ! "variables that you type in within its memory. If you want to create " ! "a completely new room, simply clear the buffers. Otherwise, this " ! "roommaker can save you a lot of time if you're creating virtually " ! "similar rooms. You can simply keep writing to different file names. " ! "Hope you enjoy, and mail me with comments, questions, or bug reports.\n" ! "Documentation has been written. Just ask Haderach for it.\n"); ! SetVendorType(VT_TREASURE); } ! //==================================================== ! //= Creates the action that starts the roommaker = ! //==================================================== ! ! ! void init() { ! ::init(); ! add_action("Begin","rmake"); ! } ! ! int Begin () { ! // Keep people who are not wizards from using this object ! if (!creatorp(environment(this_object()))) { ! write ("Your mortal mind cannot comprehend how to work this mighty object."); ! return 1; ! } ! if (strlen (username) == 0) { ! username = lower_case(environment(this_object())->GetName()); ! } ! if (strlen (capitalname) == 0) { ! capitalname = environment(this_object())->GetCapName(); ! } ! // Set everything to its default value. ! if (strlen (defaultdir) == 0) { ! defaultdir = "/realms/" + username + "/area/room/"; ! } ! ! // Print the starting menu ! this_object()->print_menu_main(); ! return 1; ! } ! ! ! //=================== ! //= Reset Functions = ! //=================== ! ! void reset_room_header () ! { ! header = "/* \nFile created with Roommaker \n" ! "written by Haderach@Frontiers \n" ! "Room made by " + capitalname + "\n" ! "Date: "+ ctime(time()) + "\n" ! "WARNING! WARNING! If you edit this room by hand " ! "the room maker may be unable to read\n" ! "it properly. Hand-edit at your own risk.\n" ! "\n*/\n\n" ! "#include <lib.h>\n" ! "#include \"../../customdefs.h\";\n" ! "inherit LIB_ROOM;\n" ! "\n" ! "static void create() {\n" ! " room::create();\n"; ! } ! ! void reset_room_properties() { ! string *propkey = keys (room_properties_map); ! int index = 0; ! while (index < sizeof (propkey)) { ! room_properties_map[propkey[index]] = "0"; ! index++; ! } ! } ! ! void reset_room_attributes () { ! string *propkey = keys (room_attributes_map); ! int index = 0; ! while (index < sizeof (propkey)) { ! room_attributes_map[propkey[index]] = ""; ! index++; ! } ! room_attributes_map["Light Level (Day)"] = "30"; ! room_attributes_map["Light Level (Night)"] = "15"; ! } ! ! void reset_everything_in_room () ! { ! reset_room_header (); ! reset_room_properties (); ! reset_room_attributes (); ! ! room_items_map = ([]); ! room_inventory_map = ([]); ! room_exits_map = ([]); ! room_enters_map = ([]); ! room_smells_map = ([]); ! room_listens_map = ([]); ! ! reset_temps (); ! ! tail = ""; ! extrafuns = ""; ! } ! ! void reset_temps () ! { ! multi_item_array = ({}); ! tempdir = ""; ! prefix = ""; ! objectdescription = ""; ! } ! ! //============================== ! //= Printing/Display Functions = ! //============================== ! ! // Utility function that other functions call ! string print_room_list_for_display (mapping room_map) { ! string display = ""; ! string *roomlist = keys (room_map); ! string scounter = ""; ! for (int counter = 0; counter < sizeof (roomlist); counter++) { ! scounter = (string) counter + 1; ! display += " " + scounter + ". " + roomlist[counter] + " : " + room_map[roomlist[counter]]; ! if (counter + 1 < sizeof (roomlist)) { ! display += "\n"; ! } ! } ! return display; ! } ! ! string print_properties_for_display () { ! string properties = ! " \"No Attack\":" + room_properties_map["no attack"] + ", \n" ! " \"No Bump\":" + room_properties_map["no bump"] + ", \n" ! " \"No Steal\":" + room_properties_map["no steal"] + ", \n" ! " \"No Magic\":" + room_properties_map["no magic"] + ", \n" ! " \"No Paralyze\":" + room_properties_map["no paralyze"] + ", \n" ! " \"No Teleport\":" + room_properties_map["no teleport"] + "\n"; ! return properties; ! } ! ! string print_room_items_for_display () { ! return print_room_list_for_display (room_items_map); ! } ! ! string print_room_inventory_for_display () { ! return print_room_list_for_display (room_inventory_map); ! } ! ! string print_room_exits_for_display () { ! return print_room_list_for_display (room_exits_map); ! } ! ! string print_room_enters_for_display () { ! return print_room_list_for_display (room_enters_map); ! } ! ! string print_room_smells_for_display () { ! return print_room_list_for_display (room_smells_map); ! } ! ! string print_room_listens_for_display () { ! return print_room_list_for_display (room_listens_map); ! } ! ! string print_properties_for_file () { ! string properties = " SetProperties (([\n"; ! properties += ! " \"no attack\":" + room_properties_map["no attack"] + ", \n" ! " \"no bump\":" + room_properties_map["no bump"] + ", \n" ! " \"no steal\":" + room_properties_map["no steal"] + ", \n" ! " \"no magic\":" + room_properties_map["no magic"] + ", \n" ! " \"no paralyze\":" + room_properties_map["no paralyze"] + ", \n" ! " \"no teleport\":" + room_properties_map["no teleport"]; ! properties += "]));\n"; ! return properties; ! } ! ! string print_room_for_file_helper (mapping room_map) { ! string strresult = ""; ! string *roomlist = keys (room_map); ! for (int counter = 0; counter < sizeof (roomlist); counter++) { ! strresult += " " + roomlist[counter] + " : " + room_map[roomlist[counter]]; ! if (counter != (sizeof (roomlist) - 1)) { ! strresult += " ,\n"; ! } ! } ! strresult += "]));\n"; ! return strresult; ! } ! ! string print_room_items_for_file () { ! string strresult = " SetItems((["; ! strresult += print_room_for_file_helper (room_items_map); ! return strresult; ! } ! ! string print_room_inventory_for_file () { ! string strresult = " SetInventory((["; ! strresult += print_room_for_file_helper (room_inventory_map); ! return strresult; ! } ! ! string print_room_smells_for_file () { ! string strresult = " SetSmell((["; ! strresult += print_room_for_file_helper (room_smells_map); ! return strresult; ! } ! ! string print_room_listens_for_file () { ! string strresult = " SetListen((["; ! strresult += print_room_for_file_helper (room_listens_map); ! return strresult; ! } ! ! string print_room_exits_for_file () { ! string strresult = ""; ! string *roomlist = keys (room_exits_map); ! for (int counter = 0; counter < sizeof (roomlist); counter++) { ! strresult += " AddExit(" + roomlist[counter] + ", " + room_exits_map[roomlist[counter]] + ");\n"; ! } ! return strresult; ! } ! ! string print_room_enters_for_file () { ! string strresult = ""; ! string *roomlist = keys (room_enters_map); ! for (int counter = 0; counter < sizeof (roomlist); counter++) { ! strresult += " AddEnter(" + roomlist[counter] + ", " + room_enters_map[roomlist[counter]] + ");\n"; ! } ! return strresult; } ! //==================================================== ! //= Prints the Main menu = ! //==================================================== ! ! int print_menu_main() { ! write(" MAIN MENU\n" ! "================\n\n" ! "1. Create Room\n" ! "2. Load Room\n" ! "3. Set Default Directory [ " + defaultdir + " ]\n" ! "q. Quit\n\n" ! "Enter Your Choice: "); ! input_to("process_menu_main"); ! return 1; ! } ! ! ! //==================================================== ! //= Processes the input of the main menu selection = ! //==================================================== ! ! int process_default (string str) ! { ! // This takes care of the default commands that every menu ! // should support. ! switch (str) { ! case "q": ! case "quit": ! case "exit": ! return 1; ! default: ! return 0; ! } ! return 1; ! } ! ! int process_menu_main (string str) { ! switch(str) { ! case "1": // Create Room ! this_object()->print_menu_room_create(); ! return 1; ! case "2": // Load Room ! write("Enter file name within " + defaultdir + " : "); ! this_object()->reset_everything_in_room (); ! input_to("read_room"); ! return 1; ! case "3": // Set Default Directory ! write("Enter default directory: ( " + defaultdir + ! " ) type c to cancel [default: " + ! (string)this_player()->query_cwd() + " ]"); ! input_to("set_defaultdir_main"); ! return 1; ! default: ! if (process_default (str) == 0) { ! write("Invalid choice. Try again."); ! input_to("process_menu_main"); ! } ! return 1; ! } ! return 1; ! } ! ! ! //==================================================== ! //= Prints the Create Room menu = ! //==================================================== ! ! int print_menu_room_create () { ! write(" ROOM EDITOR\n" ! "================\n\n" ! "1. Town [ " + room_attributes_map["Town"] + " ]\n" ! "2. Climate [ " + room_attributes_map["Climate"] + " ]\n" ! "3. Properties \n" + print_properties_for_display () + ! "4. Short Desc[ " + room_attributes_map["Short Desc"] + " ]\n" ! "5. Long Desc (Day) [ " + room_attributes_map["Long Desc (Day)"] + " ]\n" ! "6. Long Desc (Night) [ " + room_attributes_map["Long Desc (Night)"] + " ]\n" ! "7. Items [ " + print_room_items_for_display () + " ]\n" ! "8. Inventory [ " + print_room_inventory_for_display () + " ]\n" ! "9. Smell [ " + print_room_smells_for_display () + " ]\n" ! "10. Listen [ " + print_room_listens_for_display () + " ]\n" ! "11. Obvious Exits [ " + room_attributes_map["Obvious Exits"] + " ]\n" ! "12. Exits [ " + print_room_exits_for_display () + " ]\n" ! "13. Light Level (Day) [ " + room_attributes_map["Light Level (Day)"] + " ]\n" ! "14. Light Level (Night) [ " + room_attributes_map["Light Level (Night)"] + " ]\n" ! "15. Enters [ " + print_room_enters_for_display () + " ]\n" ! "w. Write to File\n" ! "c. Clear Buffers\n" ! "d. Default Directory [" + defaultdir + "]\n" ! "p. Previous Menu\n\n" ! "Enter Your Choice: "); ! input_to("process_room_create"); ! return 1; ! } ! ! //==================================================== ! //= Processes the input from the Create Room menu = ! //==================================================== ! ! int process_room_create(string str) { ! switch(str) { ! case "1": ! write("Enter name of Town: "); ! input_to("set_town"); ! return 1; ! case "2": ! this_object()->print_menu_room_climate(); ! return 1; ! case "3": ! this_object()->print_menu_room_properties(); ! return 1; ! case "4": ! write("Enter Short Description: "); ! input_to("set_short"); ! return 1; ! case "5": ! write("Enter Long Description (Day). End with q on a single line\n" ! "type load <filename> to load file as text."); ! room_attributes_map["Long Desc (Day)"] = ""; ! input_to("set_long"); ! return 1; ! case "6": ! write("Enter Long Description (Night). End with q on a single line.\n" ! "Type s to have same as Long Desc (Day).\n" ! "type load <filename> to load file as text."); ! room_attributes_map["Long Desc (Night)"] = ""; ! input_to("set_nightlong"); ! return 1; ! case "7": ! this_object()->print_menu_room_item(); ! return 1; ! case "8": ! this_object()->print_menu_room_inventory(); ! return 1; ! case "9": ! this_object()->print_menu_room_smell(); ! return 1; ! case "10": ! this_object()->print_menu_room_listen(); ! return 1; ! case "11": ! write("Enter obvious exits, separated by commas: (eg. s, w)"); ! input_to("set_obvious"); ! return 1; ! case "12": ! this_object()->print_menu_room_exits(); ! return 1; ! case "13": ! write("Enter a new light level for the daytime: "); ! input_to("set_light"); ! return 1; ! case "14": ! write("Enter a new light level for the nighttime: "); ! input_to("set_nightlight"); ! return 1; ! case "15": ! this_object()->print_menu_room_enters(); ! return 1; ! ! case "w": ! write("Enter filename within default directory: ( " + defaultdir + ! " ) type c to cancel [default: " + (string)this_player()->query_cwd() + " ]"); ! input_to("write_to_file"); ! return 1; ! case "c": // Clear ! // Reset Everything ! this_object()->reset_everything_in_room (); ! // Print out the main menu again ! this_object()->print_menu_room_create(); ! return 1; ! case "d": ! write("Enter default directory: ( " + defaultdir + " ) type q to cancel"); ! input_to("set_defaultdir"); ! return 1; ! case "p": ! this_object()->print_menu_main(); ! return 1; ! default: ! if (process_default (str) == 0) { ! write("Invalid Choice. Try again."); ! input_to("process_room_create"); ! } ! return 1; ! } ! } ! ! //==================================================== ! //= Prints the Available Climates menu = ! //==================================================== ! ! int print_menu_room_climate() { ! write(" Available Climates\n" ! "===================\n\n" ! "1. Indoors\n" ! "2. Temperate\n" ! "3. Arid\n" ! "4. Arctic\n" ! "5. Tropical\n" ! "6. Sub-tropical\n" ! "p. Previous Menu\n\n" ! "Enter Your Choice: "); ! input_to("process_room_climate"); ! return 1; ! } ! ! //==================================================== ! //= Processes the input from the Climate menu = ! //==================================================== ! ! int process_room_climate(string str) { ! if(str == "p") { ! this_object()->print_menu_room_create(); ! return 1; ! } ! if(climates[str]) { ! room_attributes_map["Climate"] = climates[str]; ! this_object()->print_menu_room_create(); ! return 1; ! } ! if (process_default(str) == 0) { ! write("Invalid Choice. Try again."); ! input_to("process_room_climate"); ! } ! return 1; ! } ! ! //==================================================== ! //= Prints the Available Properties = ! //==================================================== ! ! int print_menu_room_properties() { ! write(" Toggle Room Properties\n" ! "=======================\n\n" ! "1. No Attack [current: " + room_properties_map["no attack"] + "]\n" ! "2. No Bump [current: " + room_properties_map["no bump"] + "]\n" ! "3. No Steal [current: " + room_properties_map["no steal"] + "]\n" ! "4. No Magic [current: " + room_properties_map["no magic"] + "]\n" ! "5. No Paralyze [current: " + room_properties_map["no paralyze"] + "]\n" ! "6. No Teleport [current: " + room_properties_map["no teleport"] + "]\n" ! "p. Previous Menu\n\n" ! "Enter Your Choice: "); ! input_to("process_room_properties"); ! return 1; ! } ! ! //==================================================== ! //= Processes the input from the Properties menu = ! //==================================================== ! ! int process_room_properties(string str) { ! switch(str) { ! case "1": ! this_object()->toggle_attack(); ! return 1; ! case "2": ! this_object()->toggle_bump(); ! return 1; ! case "3": ! this_object()->toggle_steal(); ! return 1; ! case "4": ! this_object()->toggle_magic(); ! return 1; ! case "5": ! this_object()->toggle_paralyze(); ! return 1; ! case "6": ! this_object()->toggle_teleport(); ! return 1; ! case "p": ! this_object()->print_menu_room_create(); ! return 1; ! default: ! if (process_default(str) == 0) { ! write("Invalid Choice. Try again."); ! input_to("process_room_properties"); ! } ! return 1; ! } ! } ! ! //==================================================== ! //= Prints the Add Exits menu = ! //==================================================== ! ! int print_menu_room_exits() { ! write(" Exits Menu\n" ! "==========\n\n" ! "1. Add to MY_ROOM\n" ! "2. Add to absolute room\n" ! "3. Remove Exit\n" ! "c. Clear Exits\n" ! "p. Return to previous menu.\n\n" ! "Enter your choice: "); ! input_to("process_room_exits"); ! return 1; ! } ! ! //==================================================== ! //= Processes the Add Exits Menu = ! //==================================================== ! ! int process_room_exits(string str) { ! string *exitlist = keys (room_exits_map); ! string stempindex = ""; ! int exitsize = 0; ! int tempindex; ! switch(str) { ! case "1": ! write("Enter exit direction: "); ! prefix = "MY_ROOM + \"/\" +"; ! input_to("set_room_exit"); ! return 1; ! case "2": ! write("Enter exit direction: "); ! prefix = ""; ! input_to("set_room_exit"); ! return 1; ! case "3": ! exitsize = sizeof(exitlist); ! write(" Exits"); ! for(int counter = 0; counter < exitsize; counter++) { ! tempindex = counter + 1; ! stempindex = (string)tempindex; ! write(stempindex + ". " + exitlist[counter] + " == > " + room_exits_map[exitlist[counter]]); ! } ! write("Enter Exit number to remove: "); ! input_to("remove_exit"); ! return 1; ! case "c": ! room_exits_map = ([]); ! this_object()->print_menu_room_create(); ! return 1; ! case "p": ! this_object()->print_menu_room_create(); ! return 1; ! default: ! if (process_default(str) == 0) { ! write("Invalid Choice. Try again."); ! input_to("process_room_exits"); ! } ! return 1; ! } ! } ! ! //==================================================== ! //= Prints the Add Enters menu = ! //==================================================== ! ! int print_menu_room_enters() { ! write(" Enters Menu\n" ! "==========\n\n" ! "1. Add to MY_ROOM\n" ! "2. Add to absolute room\n" ! "3. Remove Enter\n" ! "c. Clear Enters\n" ! "p. Return to previous menu.\n\n" ! "Your choice: "); ! input_to("process_room_enters"); ! return 1; ! } ! ! //==================================================== ! //= Processes the Add Enters Menu = ! //==================================================== ! ! int process_room_enters(string str) { ! string *enterlist = keys (room_enters_map); ! string stempindex = ""; ! int entersize = 0; ! int tempindex; ! switch(str) { ! case "1": ! write("What is entered? Please remember that if what you enter here "); ! write("does not have a matching item in SetItems or AddItem, your "); ! write("room will not load until you include that item in "); ! write("the room's code."); ! prefix = "MY_ROOM + \"/\" +"; ! input_to("set_room_enter"); ! return 1; ! case "2": ! write("What is entered? Please remember that if what you enter here "); ! write("does not have a matching item in SetItems or AddItem, your "); ! write("room will not load until you include that item in "); ! write("the room's code."); ! prefix = ""; ! input_to("set_room_enter"); ! return 1; ! case "3": ! entersize = sizeof(enterlist); ! write(" Enters"); ! for(int counter = 0; counter < entersize; counter++) { ! tempindex = counter + 1; ! stempindex = (string)tempindex; ! write(stempindex + ". " + enterlist[counter] + " == > " + room_enters_map[enterlist[counter]]); ! } ! write("Enter number to remove: "); ! input_to("remove_enter"); ! return 1; ! case "c": ! room_enters_map = ([]); ! this_object()->print_menu_room_create(); ! return 1; ! case "p": ! this_object()->print_menu_room_create(); ! return 1; ! default: ! if (process_default(str) == 0) { ! write("Invalid Choice. Try again."); ! input_to("process_room_enters"); ! } ! return 1; ! } ! } ! ! //==================================================== ! //= Prints the Add Inventory menu = ! //==================================================== ! ! int print_menu_room_inventory() { ! write(" Inventory Menu\n" ! "=====================\n\n" ! "1. Add an object from MY_NPC\n" ! "2. Add an object from MY_AREA\n" ! "3. Enter absolute path for object\n" ! "4. Remove Inventory Item\n" ! "c. Clear Inventory\n" ! "p. Return to previous menu.\n\n" ! "Enter your choice: "); ! input_to("process_room_inventory"); ! return 1; ! } ! ! //==================================================== ! //= Processes the Add Inventory Menu = ! //==================================================== ! ! int process_room_inventory(string str) { ! string *invlist = keys (room_inventory_map); ! int tempindex = 0; ! int invsize = 0; ! string stempindex; ! switch(str) { ! case "1": ! write("Enter filename: "); ! prefix = "MY_NPC + \"/\" +"; ! input_to("set_room_inventory"); ! return 1; ! case "2": ! write("Enter filename: "); ! prefix = "MY_AREA + \"/\" +"; ! input_to("set_room_inventory"); ! return 1; ! case "3": ! write("Enter absolute filename: "); ! prefix = ""; ! input_to("set_room_inventory"); ! return 1; ! case "4": ! invsize = sizeof(invlist); ! write(" Inventory Items"); ! for(int counter = 0; counter < invsize; counter++) { ! tempindex = counter + 1; ! stempindex = (string)tempindex; ! write(stempindex + ". " + invlist[counter]); ! } ! write("Enter Inventory number to remove: "); ! input_to("remove_inventory"); ! return 1; ! case "c": ! room_inventory_map = ([]); ! this_object()->print_menu_room_create(); ! return 1; ! case "p": ! this_object()->print_menu_room_create(); ! return 1; ! default: ! if (process_default(str) == 0) { ! write("Invalid choice. Try again."); ! input_to("process_room_inventory"); ! } ! return 1; ! } ! } ! ! //==================================================== ! //= Prints the Add Item menu = ! //==================================================== ! ! int print_menu_room_item() { ! write(" Items Menu\n" ! "===========\n\n" ! "1. Add a single item\n" ! "2. Add multiple items with same description\n" ! "3. Remove Item\n" ! "c. Clear Items\n" ! "p. Return to previous menu.\n\n" ! "Enter your choice: "); ! input_to("process_room_item"); ! return 1; ! } ! ! //==================================================== ! //= Processes the Add Items Menu = ! //==================================================== ! ! int process_room_item(string str) { ! string *roomitemlist = keys (room_items_map); ! int itemsize = 0; ! int tempindex = 0; ! int counter = -1; ! string stempindex; ! switch(str) { ! case "1": ! write("Enter item name: "); ! input_to("set_room_item_single"); ! return 1; ! case "2": ! write("Enter first item: "); ! input_to("set_room_item_multiple"); ! return 1; ! case "3": ! itemsize = sizeof(roomitemlist); ! write(" Items\n"); ! //for(int counter = 0; counter < itemsize; counter++) { ! // tempindex = counter + 1; ! // stempindex = (string)tempindex; ! // write(stempindex + ". " + roomitemlist[counter]); ! //} ! ! foreach(string item_key in roomitemlist){ ! counter ++; ! tempindex = counter +1 ; ! stempindex = (string)tempindex; ! write("size of roomitemlist is "+sizeof(roomitemlist)); ! write("roomitemlist is "+identify(roomitemlist)); ! write(stempindex + ". " + roomitemlist[counter]); ! } ! ! write("Enter Item number to remove: "); ! input_to("remove_item"); ! return 1; ! case "c": ! room_items_map = ([]); ! this_object()->print_menu_room_create(); ! return 1; ! case "p": ! this_object()->print_menu_room_create(); ! return 1; ! default: ! if (process_default(str) == 0) { ! write("Invalid Choice. Try again."); ! input_to("process_room_item"); ! } ! return 1; ! } ! } ! ! int remove_item(string str) { ! int index; ! string *roomitemlist = ({}); ! int itemsize = -1; ! sscanf(str, "%d", index); ! if (index <= 0) { ! write("Invalid choice."); ! this_object()->print_menu_room_item(); ! return 1; ! } ! ! index--; ! ! roomitemlist = keys (room_items_map); ! itemsize = sizeof(roomitemlist); ! ! if(index >= itemsize) { ! write("Invalid choice."); ! this_object()->print_menu_room_item(); ! return 1; ! } ! ! map_delete (room_items_map, roomitemlist[index]); ! ! this_object()->print_menu_room_item(); ! return 1; ! } ! ! //==================================================== ! //= Prints the Add Smell menu = ! //==================================================== ! ! int print_menu_room_smell() { ! write(" Smell Menu\n" ! "===========\n\n" ! "1. Add a single smell\n" ! "2. Add multiple smells with same description\n" ! "3. Remove Smell.\n" ! "c. Clear Smells\n" ! "p. Return to previous menu.\n\n" ! "Please rememeber to AddItem or SetItems the thing " ! "to be smelled, or your room may not load. If it's " ! "the \"default\" smell, then adding that isn't necessary.\n\n" ! "Enter your choice: "); ! input_to("process_room_smell"); ! return 1; ! } ! ! //==================================================== ! //= Processes the Add Smell Menu = ! //==================================================== ! ! int process_room_smell(string str) { ! string *roomsmelllist = keys (room_smells_map); ! int smellsize = 0; ! int tempindex = 0; ! string stempindex; ! switch(str) { ! case "1": ! write("Enter item name: "); ! input_to("set_room_smell_single"); ! return 1; ! case "2": ! write("Enter first item: "); ! input_to("set_room_smell_multiple"); ! return 1; ! case "3": ! smellsize = sizeof(roomsmelllist); ! write(" Smells\n"); ! for(int counter = 0; counter < smellsize; counter++) { ! tempindex = counter + 1; ! stempindex = (string)tempindex; ! write(stempindex + ". " + roomsmelllist[counter]); ! } ! write("Enter Smell number to remove: "); ! input_to("remove_smell"); ! return 1; ! case "c": ! room_smells_map = ([]); ! this_object()->print_menu_room_create(); ! return 1; ! case "p": ! this_object()->print_menu_room_create(); ! return 1; ! default: ! if (process_default(str) == 0) { ! write("Invalid Choice. Try again."); ! input_to("process_room_smell"); ! } ! return 1; ! } ! } ! ! int remove_smell(string str) { ! int index; ! string *roomsmelllist = ({}); ! int smellsize = -1; ! sscanf(str, "%d", index); ! if (index <= 0) { ! write("Invalid choice."); ! this_object()->print_menu_room_smell(); ! return 1; ! } ! ! index--; ! ! roomsmelllist = keys (room_smells_map); ! smellsize = sizeof(roomsmelllist); ! ! if(index >= smellsize) { ! write("Invalid choice."); ! this_object()->print_menu_room_smell(); ! return 1; ! } ! ! map_delete (room_smells_map, roomsmelllist[index]); ! ! this_object()->print_menu_room_smell(); ! return 1; ! } ! ! //==================================================== ! //= Prints the Add Listen menu = ! //==================================================== ! ! int print_menu_room_listen() { ! write(" Listen Menu\n" ! "===========\n\n" ! "1. Add a single listen\n" ! "2. Add multiple listens with same description\n" ! "3. Remove Listen\n" ! "c. Clear Listens\n" ! "p. Return to previous menu.\n\n" ! "Please rememeber to AddItem or SetItems the thing " ! "to be listened to, or your room may not load. If it's " ! "the \"default\" listen, then adding that isn't necessary.\n\n" ! "Enter your choice: "); ! input_to("process_room_listen"); ! return 1; ! } ! ! //==================================================== ! //= Processes the Add Listen Menu = ! //==================================================== ! ! int process_room_listen(string str) { ! string *roomlistenlist = keys (room_listens_map); ! int listensize = 0; ! int tempindex = 0; ! string stempindex; ! switch(str) { ! case "1": ! write("Enter item name: "); ! input_to("set_room_listen_single"); ! return 1; ! case "2": ! write("Enter first item: "); ! input_to("set_room_listen_multiple"); ! return 1; ! case "3": ! listensize = sizeof(roomlistenlist); ! write(" Listen List\n"); ! for(int counter = 0; counter < listensize; counter++) { ! tempindex = counter + 1; ! stempindex = (string)tempindex; ! write(stempindex + ". " + roomlistenlist[counter]); ! } ! write("Enter Listen number to remove: "); ! input_to("remove_listen"); ! return 1; ! case "c": ! room_listens_map = ([]); ! this_object()->print_menu_room_create(); ! return 1; ! case "p": ! this_object()->print_menu_room_create(); ! return 1; ! default: ! if (process_default(str) == 0) { ! write("Invalid Choice. Try again."); ! input_to("process_room_listen"); ! } ! return 1; ! } ! } ! ! int remove_listen(string str) { ! int index; ! string *roomlistenlist = ({}); ! int listensize = -1; ! sscanf(str, "%d", index); ! if (index <= 0) { ! write("Invalid choice."); ! this_object()->print_menu_room_listen(); ! return 1; ! } ! ! index--; ! ! roomlistenlist = keys (room_listens_map); ! listensize = sizeof(roomlistenlist); ! ! if(index >= listensize) { ! write("Invalid choice."); ! this_object()->print_menu_room_listen(); ! return 1; ! } ! ! map_delete (room_listens_map, roomlistenlist[index]); ! ! this_object()->print_menu_room_listen(); ! return 1; ! } ! ! //==================================================== ! //= Sets the town variable = ! //==================================================== ! ! int set_attribute_helper (string str, string keyname) { ! if(str == "c") { ! this_object()->print_menu_room_create(); ! return 1; ! } ! room_attributes_map[keyname] = str; ! this_object()->print_menu_room_create(); ! return 1; ! } ! ! int set_town(string str) { ! return set_attribute_helper (str, "Town"); ! } ! ! //==================================================== ! //= Sets the short variable = ! //==================================================== ! ! int set_short(string str) { ! return set_attribute_helper (str, "Short Desc"); ! } ! ! //==================================================== ! //= Sets the obvious variable = ! //==================================================== ! ! int set_obvious(string str) { ! return set_attribute_helper (str, "Obvious Exits"); ! } ! ! //==================================================== ! //= Sets the night light = ! //==================================================== ! ! int set_nightlight(string str) { ! set_attribute_helper (str, "Light Level (Night)"); ! } ! ! //==================================================== ! //= Functions to set properties = ! //==================================================== ! ! int set_light(string str) { ! set_attribute_helper (str, "Light Level (Day)"); ! } ! ! int toggle_helper (string keyname) { ! if( room_properties_map[keyname] == "0" ) { ! room_properties_map[keyname] = "1"; ! } else { ! room_properties_map[keyname] = "0"; ! } ! this_object()->print_menu_room_create(); ! return 1; ! } ! ! int toggle_attack() { ! return toggle_helper ("no attack"); ! } ! ! int toggle_bump() { ! return toggle_helper ("no bump"); ! } ! ! int toggle_steal() { ! return toggle_helper ("no steal"); ! } ! ! int toggle_magic() { ! return toggle_helper ("no magic"); ! } ! ! int toggle_paralyze() { ! return toggle_helper ("no paralyze"); ! } ! ! int toggle_teleport() { ! return toggle_helper ("no teleport"); ! } ! ! //==================================================== ! //= Sets the Long description = ! //==================================================== ! ! int set_long_description_helper (string str, string keyname, string functionname) ! { ! string file; ! string contents; ! if(str == "c") { ! this_object()->print_menu_room_create(); ! return 1; ! } ! if(sscanf(str, "load %s", file) == 1) { ! if(!(contents = read_file(file))) { ! write("Invalid text file."); ! this_object()->print_menu_room_create(); ! return 1; ! } ! room_attributes_map[keyname] = contents; ! this_object()->print_menu_room_create(); ! return 1; ! } ! if(str == "q") { ! // remove the trailing endline. ! sscanf (room_attributes_map[keyname], "%s%*(\\\\n$)", contents); ! room_attributes_map[keyname] = contents; ! this_object()->print_menu_room_create(); ! return 1; ! } ! room_attributes_map[keyname] = room_attributes_map[keyname] + str + "\\n"; ! input_to(functionname); ! return 1; ! } ! ! int set_long(string str) { ! return set_long_description_helper (str, "Long Desc (Day)", "set_long"); ! } ! ! //==================================================== ! //= Sets the Night Long description = ! //==================================================== ! ! int set_nightlong(string str) { ! return set_long_description_helper (str, "Long Desc (Night)", "set_nightlong"); ! } ! ! //==================================================== ! //= Sets the exit = ! //==================================================== ! ! int set_room_exit(string str) { ! if(str == "c") { ! this_object()->print_menu_room_create(); ! return 1; ! } ! tempdir = "\"" + str + "\""; ! write("Enter room filename: "); ! input_to("set_room_exit_helper"); ! return 1; ! } ! ! int set_room_exit_helper(string str) { ! if(str == "c") { ! this_object()->print_menu_room_create(); ! return 1; ! } ! room_exits_map[tempdir] = prefix + "\"" + str + "\""; ! this_object()->print_menu_room_create(); ! return 1; ! } ! ! int remove_exit(string str) { ! int index = -1; ! string *exitkeys = ({}); ! sscanf(str, "%d", index); ! if (index <= 0) { ! write ("Invalid choice."); ! this_object()->print_menu_room_exits(); ! return 1; ! } ! ! // decrement the index ! index--; ! ! // We have the input index and the key array ! exitkeys = keys (room_exits_map); ! ! if (index >= sizeof (exitkeys)) { ! write ("Invalid choice."); ! this_object()->print_menu_room_exits(); ! return 1; ! } ! ! map_delete (room_exits_map, exitkeys[index]); ! ! this_object()->print_menu_room_exits(); ! return 1; ! } ! ! //==================================================== ! //= Sets the enter = ! //==================================================== ! ! int set_room_enter(string str) { ! if(str == "c") { ! this_object()->print_menu_room_create(); ! return 1; ! } ! tempdir = "\"" + str + "\""; ! write("Enter room filename: "); ! input_to("set_room_enter_helper"); ! return 1; ! } ! ! int set_room_enter_helper(string str) { ! if(str == "c") { ! this_object()->print_menu_room_create(); ! return 1; ! } ! room_enters_map[tempdir] = prefix + "\"" + str + "\""; ! this_object()->print_menu_room_create(); ! return 1; ! } ! ! int remove_enter(string str) { ! int index = -1; ! string *enterkeys = ({}); ! sscanf(str, "%d", index); ! if (index <= 0) { ! write ("Invalid choice."); ! this_object()->print_menu_room_enters(); ! return 1; ! } ! ! // decrement the index ! index--; ! ! // We have the input index and the key array ! enterkeys = keys (room_enters_map); ! ! if (index >= sizeof (enterkeys)) { ! write ("Invalid choice."); ! this_object()->print_menu_room_enters(); ! return 1; ! } ! ! map_delete (room_enters_map, enterkeys[index]); ! ! this_object()->print_menu_room_enters(); ! return 1; ! } ! ! //==================================================== ! //= Sets the inventory items = ! //==================================================== ! ! int set_room_inventory(string str) { ! if(str == "c") { ! this_object()->print_menu_room_create(); ! return 1; ! } ! tempdir = str; ! write("Enter number of objects to have: "); ! input_to("set_room_inventory_helper"); ! return 1; ! } ! ! int set_room_inventory_helper(string str) { ! if(str == "c") { ! this_object()->print_menu_room_create(); ! return 1; ! } ! room_inventory_map[prefix + "\"" + tempdir + "\""] = str; ! this_object()->print_menu_room_create(); ! return 1; ! } ! ! int remove_inventory(string str) { ! int index; ! string *invlist = ({}); ! int invsize = -1; ! sscanf(str, "%d", index); ! if (index <= 0) { ! write("Invalid choice."); ! this_object()->print_menu_room_inventory(); ! return 1; ! } ! ! index--; ! ! invlist = keys (room_inventory_map); ! invsize = sizeof(invlist); ! ! if(index >= invsize) { ! write("Invalid choice."); ! this_object()->print_menu_room_inventory(); ! return 1; ! } ! ! map_delete(room_inventory_map, invlist[index]); ! ! this_object()->print_menu_room_inventory(); ! return 1; ! } ! ! //==================================================== ! //= Sets the Items = ! //==================================================== ! ! int set_room_description_helper (string str, mapping room_map, string functionname) { ! string finaldescription = ""; ! if(str == "c") { ! reset_temps (); ! this_object()->print_menu_room_create(); ! return 1; ! } ! ! if(str == "q") { ! string array_string = ""; ! // We need to remove the ending endline. ! sscanf (objectdescription, "%s%*(\\\\n$)", finaldescription); ! finaldescription = "\"" + finaldescription + "\""; ! write(get_stack()); ! if(sizeof(multi_item_array)){ ! foreach(string element in multi_item_array){ ! if(array_string == "") array_string = "({"; ! array_string += "\""+element+"\""; ! if(multi_item_array[sizeof(multi_item_array)-1] == element){ ! array_string += "})"; ! } ! else array_string += ","; ! } ! } ! if(array_string == "") array_string = tempdir; ! room_map[array_string] = finaldescription; ! ! // clear the array now ! multi_item_array = ({}); ! // Clear the temp variables now. ! reset_temps (); ! this_object()->print_menu_room_create(); ! return 1; ! } ! ! objectdescription = objectdescription + str + "\\n"; ! input_to(functionname); ! return 1; ! } ! ! int set_room_item_single(string str) { ! if(str == "c") { ! reset_temps (); ! this_object()->print_menu_room_create(); ! return 1; ! } ! tempdir = "\"" + str + "\""; ! write("Enter item description. End with q on a blank line.: "); ! input_to("set_room_item_description"); ! return 1; ! } ! ! int set_room_item_description(string str) { ! return set_room_description_helper (str, room_items_map, "set_room_item_description"); ! } ! ! int set_room_item_multiple(string str) { ! if(str == "c") { ! reset_temps (); ! this_object()->print_menu_room_create(); ! return 1; ! } ! if(str == "q") { ! write("Enter item description. End with q on a blank line: "); ! input_to("set_room_item_description"); ! return 1; ! } ! multi_item_array += ({ str }); ! write("Enter next item or type q to end"); ! input_to("set_room_item_multiple"); ! return 1; ! } ! ! //==================================================== ! //= Sets the Smells = ! //==================================================== ! ! int set_room_smell_single(string str) { ! if(str == "c") { ! reset_temps (); ! this_object()->print_menu_room_create(); ! return 1; ! } ! tempdir = "\"" + str + "\""; ! write("Enter smell description. End with q on a blank line.: "); ! input_to("set_room_smell_description"); ! return 1; ! } ! ! int set_room_smell_description(string str) { ! return set_room_description_helper (str, room_smells_map, "set_room_smell_description"); ! } ! ! int set_room_smell_multiple(string str) { ! if(str == "c") { ! reset_temps (); ! this_object()->print_menu_room_create(); ! return 1; ! } ! ! if(str == "q") { ! write("Enter smell description. End with q on a blank line: "); ! input_to("set_room_smell_description"); ! return 1; ! } ! ! multi_item_array += ({ str }); ! write("Enter next item or type q to end"); ! input_to("set_room_smell_multiple"); ! return 1; ! } ! ! //==================================================== ! //= Sets the Listens = ! //==================================================== ! ! int set_room_listen_single(string str) { ! if(str == "c") { ! reset_temps (); ! this_object()->print_menu_room_create(); ! return 1; ! } ! tempdir = "\"" + str + "\""; ! write("Enter listen description. End with q on a blank line.: "); ! input_to("set_room_listen_description"); ! return 1; ! } ! ! int set_room_listen_description(string str) { ! return set_room_description_helper (str, room_listens_map, "set_room_listen_description"); ! } ! ! int set_room_listen_multiple(string str) { ! if(str == "c") { ! reset_temps (); ! this_object()->print_menu_room_create(); ! return 1; ! } ! ! if(str == "q") { ! write("Enter listen description. End with q on a blank line: "); ! input_to("set_room_listen_description"); ! return 1; ! } ! ! multi_item_array += ({ str }); ! write("Enter next listen or type q to end"); ! input_to("set_room_listen_multiple"); ! return 1; ! } ! ! //==================================================== ! //= Sets the default directory = ! //==================================================== ! ! int set_defaultdir_helper(string str) { ! int index; ! index = strlen(str); ! if (index <= 0) { ! // The user just pressed enter. Change it to the ! // current working directory. ! defaultdir = (string)this_player()->query_cwd(); ! return 1; ! } ! index--; ! if(str[index] != '/') str = str + "/"; ! defaultdir = str; ! return 1; ! } ! ! int set_defaultdir(string str) { ! if(str == "c") { ! write("Change cancelled."); ! this_object()->print_menu_room_create(); ! return 1; ! } ! set_defaultdir_helper (str); ! this_object()->print_menu_room_create(); ! return 1; ! } ! ! int set_defaultdir_main(string str) { ! if(str == "c") { ! write("Change cancelled."); ! this_object()->print_menu_main(); ! return 1; ! } ! set_defaultdir_helper (str); ! this_object()->print_menu_main(); ! return 1; ! } ! ! ! ! //==================================================== ! //= Writes all the stuff to the room file = ! //==================================================== ! ! int write_to_file(string str) { ! if(str == "q") { ! write("Write cancelled"); ! this_object()->print_menu_room_create(); ! return 1; ! } ! str = defaultdir+str; ! reset_room_header (); ! globalstr = str; ! globalstr2 = header + ! //unguarded( (: write_file(globalstr, header + ! " SetTown(\"" + room_attributes_map["Town"] + "\");\n" + ! " SetClimate(\"" + room_attributes_map["Climate"] + "\");\n"; ! ! if(!check_prop(room_attributes_map["Long Desc (Night)"])) { ! globalstr2 += " SetAmbientLight(" + room_attributes_map["Light Level (Day)"] + ");\n"; ! } else { ! globalstr2 += " SetDayLight(" + room_attributes_map["Light Level (Day)"] + ");\n"+ ! " SetNightLight(" + room_attributes_map["Light Level (Night)"] + ");\n"; ! } ! ! globalstr2 += " SetShort(\"" + room_attributes_map["Short Desc"] + "\");\n"; ! ! if(!check_prop(room_attributes_map["Long Desc (Night)"])){ ! globalstr2 += " SetLong(\"" + room_attributes_map["Long Desc (Day)"] + "\");\n"; } else { ! ! globalstr2 += " SetDayLong(\"" + room_attributes_map["Long Desc (Day)"] + "\");\n" + ! " SetNightLong(\"" + room_attributes_map["Long Desc (Night)"] + "\");\n"; ! } ! ! globalstr2 += print_properties_for_file () + ! print_room_items_for_file () + ! print_room_inventory_for_file () + ! " SetObviousExits(\"" + room_attributes_map["Obvious Exits"] + "\");\n" + ! print_room_exits_for_file () + ! print_room_enters_for_file () + ! "//funs\n" + ! extrafuns + ! "//snuf\n" + ! "}\n" + ! "void init() {\n::init();\n" + ! print_room_smells_for_file () + ! print_room_listens_for_file () + ! "}\n" + ! "//extras\n" + ! tail; ! unguarded( (: write_file(globalstr, globalstr2, 1) :) ); ! ! write("\nRoom written to: " + str + "\n"); ! this_object()->print_menu_room_create(); ! return 1; } ! //================================================= ! //= Room Loading Section = ! //================================================= ! int get_town(string str) { ! sscanf(str, "%*sSetTown(\"%s\");%*s", room_attributes_map["Town"]); ! return 1; ! } ! ! int get_climate(string str) { ! sscanf(str, "%*sSetClimate(\"%s\");%*s", room_attributes_map["Climate"]); ! return 1; ! } ! ! int get_short(string str) { ! sscanf(str, "%*sSetShort(\"%s\");%*s", room_attributes_map["Short Desc"]); ! return 1; ! } ! ! int get_daylong(string str) { ! if(sscanf(str, "%*sSetDayLong(\"%s\");%*s", room_attributes_map["Long Desc (Day)"]) == 0) { ! sscanf(str, "%*sSetLong(\"%s\");%*s", room_attributes_map["Long Desc (Day)"]); ! } ! return 1; ! } ! ! int get_nightlong(string str) { ! if(strsrch(str,"SetNightLong")){ ! sscanf(str, "%*sSetNightLong(\"%s\");%*s", room_attributes_map["Long Desc (Night)"]); ! } ! return 1; ! } ! ! int get_daylight(string str) { ! if(sscanf(str, "%*sSetDayLight(%s);%*s", room_attributes_map["Light Level (Day)"]) == 0){ ! sscanf(str, "%*sSetAmbientLight(%s);%*s", room_attributes_map["Light Level (Day)"]); ! } ! return 1; ! } ! ! int get_nightlight(string str) { ! if(strsrch(str,"SetNightLight")){ ! sscanf(str, "%*sSetNightLight(%s);%*s", room_attributes_map["Light Level (Night)"]); ! } ! return 1; ! } ! ! void add_map_to_mapping (mapping room_map, string inputstring) { ! // We need to split up items, and add them to room_map ! string *itemlist = explode (inputstring, ", "); ! string strKey = ""; ! string strValue = ""; ! for (int counter = 0; counter < sizeof (itemlist); counter++) { ! strKey = ""; ! strValue = ""; ! sscanf (itemlist[counter], "%s:%s", strKey, strValue); ! ! //sscanf (itemlist[counter], "%*s\"%s\"%*s:%*s\"%s\"%*s", strKey, strValue); ! if (strlen (strKey) > 0) { ! room_map[strKey] = strValue; ! } ! } ! } ! ! int get_items(string str) { ! string strItems, key, val; ! string *elements; ! if(sscanf(str, "%*sSetItems(([%s]));%*s", strItems) < 1) { ! return 1; ! } ! //elements = explode(strItems," ,\\n"); ! elements = explode(strItems," ,"); ! if(!elements) elements = ({ strItems }); ! if(!elements) { ! return 1; ! } ! foreach(string element in elements){ ! if(sscanf(element, "%s : %s", key, val ) < 2) break; ! room_items_map[key] = val; ! } ! return 1; ! } ! ! int get_smell(string str) { ! string strItems = ""; ! sscanf(str, "%*sSetSmell(([%s]));%*s", strItems); ! add_map_to_mapping (room_smells_map, strItems); ! return 1; ! } ! ! int get_listen(string str) { ! string strItems = ""; ! sscanf(str, "%*sSetListen(([%s]));%*s", strItems); ! add_map_to_mapping (room_listens_map, strItems); ! return 1; ! } ! ! string strip_whitespaces (string str) { ! string temp = ""; ! string final = ""; ! sscanf (str, "%*(^ *)%s", temp); ! sscanf (temp, "%s%*( *$)", final); ! return final; ! } ! ! int get_inventory(string str) { ! string strItems = ""; ! string strKey = ""; ! string strValue = ""; ! string *itemlist; ! sscanf(str, "%*sSetInventory(([%s]));%*s", strItems); ! // We need to split up items, and add them to room_map ! itemlist = explode (strItems, ","); ! for (int counter = 0; counter < sizeof (itemlist); counter++) { ! strKey = ""; ! strValue = ""; ! sscanf (itemlist[counter], "%s:%s", strKey, strValue); ! strKey = strip_whitespaces (strKey); ! strValue = strip_whitespaces (strValue); ! if (strlen (strKey) > 0) { ! room_inventory_map[strKey] = strValue; ! } ! } ! return 1; ! } ! ! int get_obviousexits(string str) { ! sscanf(str, "%*sSetObviousExits(\"%s\");%*s", room_attributes_map["Obvious Exits"]); ! return 1; ! } ! ! int get_properties(string str) { ! string fixedstring = ""; ! sscanf(str, ! "%*s\"no attack\":%s," ! "%*s\"no bump\":%s," ! "%*s\"no steal\":%s," ! "%*s\"no magic\":%s," ! "%*s\"no paralyze\":%s," ! "%*s\"no teleport\":%s]", ! room_properties_map["no attack"], ! room_properties_map["no bump"], ! room_properties_map["no steal"], ! room_properties_map["no magic"], ! room_properties_map["no paralyze"], ! room_properties_map["no teleport"]); ! if (sscanf (room_properties_map["no teleport"], "%s\n", fixedstring) == 1) { ! room_properties_map["no teleport"] = fixedstring; ! } ! return 1; ! } ! ! int get_exits(string str) { ! string *exittemp = explode(str, ";"); ! string exitarguments = ""; ! string strDirection = ""; ! string strFile = ""; ! for(int counter = 0; counter < sizeof(exittemp); counter++) { ! strDirection = ""; ! strFile = ""; ! sscanf(exittemp[counter], "%*sAddExit(%s)%*s", exitarguments); ! // Exit can have more than two arguments. We need to check for that ! if (sscanf(exitarguments, "\"%s\", %s,", strDirection, strFile) != 2) { ! sscanf (exitarguments, "\"%s\", %s", strDirection, strFile); ! } ! if (strlen (strDirection) > 0) { ! strDirection = "\"" + strDirection + "\""; ! room_exits_map[strDirection] = strFile; ! } ! } ! return 1; ! } ! ! int get_enters(string str) { ! string *entertemp = explode(str, ";"); ! string enterarguments = ""; ! string strDirection = ""; ! string strFile = ""; ! for(int counter = 0; counter < sizeof(entertemp); counter++) { ! strDirection = ""; ! strFile = ""; ! sscanf(entertemp[counter], "%*sAddEnter(%s)%*s", enterarguments); ! // Enter can have more than two arguments. We need to check for that ! if (sscanf(enterarguments, "\"%s\", %s,", strDirection, strFile) != 2) { ! sscanf (enterarguments, "\"%s\", %s", strDirection, strFile); ! } ! if (strlen (strDirection) > 0) { ! strDirection = "\"" + strDirection + "\""; ! room_enters_map[strDirection] = strFile; ! } ! } ! return 1; ! } ! ! int get_header(string str) { ! sscanf(str, "%s::create%*s", header); ! header = header + "::create();\n"; ! return 1; ! } ! ! int get_tail(string str) { ! if(sscanf(str, "%*s//extras\n%s", tail) != 2) { ! tail = ""; ! } ! return 1; ! } ! ! int get_extrafuns(string str) { ! if(sscanf(str, "%*s//funs\n%s//snuf%*s", extrafuns) != 3) { ! extrafuns = ""; ! } ! return 1; ! } ! ! int read_room(string str) { ! string file; ! str = defaultdir+str; ! ! if(file_size(str) < 0) { ! write("Invalid file. Perhaps you forgot to add \".c\"? Please try again."); ! this_object()->print_menu_main(); ! return 1; ! } ! if(!(file = read_file(str))) { ! write("A permissons error occurred. You'll have to start over."); ! this_object()->print_menu_main(); ! return 1; ! } ! get_town(file); ! get_climate(file); ! get_short(file); ! get_daylong(file); ! get_nightlong(file); ! get_daylight(file); ! get_nightlight(file); ! get_items(file); ! get_smell(file); ! get_listen(file); ! get_inventory(file); ! get_obviousexits(file); ! get_properties(file); ! get_exits(file); ! get_enters(file); ! get_header(file); ! get_tail(file); ! get_extrafuns(file); ! this_object()->print_menu_room_create(); ! return 1; } diff -c -r --new-file ds1.1/lib/secure/obj/snooper.c ds2.0r27/lib/secure/obj/snooper.c *** ds1.1/lib/secure/obj/snooper.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/obj/snooper.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,91 ---- + #include <lib.h> + #include <rooms.h> + #include <daemons.h> + #include <vendor_types.h> + inherit LIB_ITEM; + + string guy, stringy; + int seconds; + object ob; + + void create(){ + item::create(); + + SetKeyName("snooper object"); + SetId( ({"thing","item","thang","dingus","snooper","object"}) ); + SetAdjectives( ({"invisible","snooper","snoop"}) ); + SetShort("an invisible object"); + SetLong("This is an object of indeterminate nature and proportions. " + "It is intentionally invisible, and your attempts to " + "understand it may constitute a security breach. You'd " + "be well advised to leave it alone."); + SetInvis(1); + set_heart_beat(10); + SetNoClean(1); + SNOOP_D->RegisterSnooper(); + } + + void init(){ + ::init(); + } + + void stamp_time(){ + seconds = time(); + write_file("/secure/log/adm/"+guy+".log","\n"+timestamp()+"\n"); + } + + void heart_beat(){ + object dude; + if(!guy || !(dude = find_player(guy))) { + //tc("I can't find "+guy); + eventDestruct(); + } + if(dude && environment(dude) && base_name(environment(dude)) == ROOM_FREEZER) eventDestruct(); + if(time() - seconds > 600 ) stamp_time(); + } + + void receive_snoop(string str){ + stringy = str; + unguarded((: write_file("/secure/log/adm/"+guy+".log",guy+" "+timestamp()+": "+stringy) :)); + SNOOP_D->GetSnoop(guy, stringy); + if( file_size("/secure/log/adm/"+guy+".log") > 200000) { + rename("/secure/log/adm/"+guy+".log", "/secure/log/bak/"+guy+"."+time()); + } + } + + int eventStartSnoop(string str){ + string snoopee; + if(!str || str == "") return 0; + //tc("thingy: "+str); + snoopee = "nobody"; + str = lower_case(str); + guy = str; + + if(!ob=find_player(str)) { write("Target not found."); return; } + unguarded((: write_file("/secure/log/adm/snoop.err",snoop(this_object(), ob)?"":guy+": snoop failed.\n") :)); + if(query_snooping(this_object())) snoopee = identify(query_snooping(this_object())); + //tc("I am: "+identify(this_object())+", and I am snooping: "+snoopee); + SNOOP_D->RegisterSnooper(); + write_file("/secure/log/adm/"+str+".log","\nNEW SESSION: "+timestamp()+"\n"); + return 1; + } + + void receive_message(string s1, string s2){ + stringy = s2; + unguarded((: write_file("/secure/log/adm/"+guy+".log",guy+": "+stringy) :)); + SNOOP_D->GetSnoop(guy, stringy); + } + + int eventDestruct(){ + if(base_name(previous_object()) != SNOOP_D && !archp(previous_object(2)) && + previous_object() != this_object()) return 0; + SNOOP_D->UnregisterSnooper(); + return item::eventDestruct(); + } + + string GetSnooped(){ + //debug("I am snooping ",guy,"green"); + if( !((int)master()->valid_apply(({ "PRIV_ASSIST", "PRIV_SECURE", "SNOOP_D" }))) ) return ""; + else return guy; + //return guy; + } diff -c -r --new-file ds1.1/lib/secure/obj/staff.c ds2.0r27/lib/secure/obj/staff.c *** ds1.1/lib/secure/obj/staff.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/obj/staff.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,43 ---- + #include <lib.h> + #include <damage_types.h> + #include <vendor_types.h> + #include <modules.h> + + inherit LIB_ITEM; + inherit MODULES_ARMOR; + inherit MODULES_CREATE; + inherit MODULES_MAPPING; + inherit MODULES_GENERIC; + inherit MODULES_ROOM; + inherit MODULES_FILE; + inherit MODULES_MONEY; + inherit MODULES_READ; + inherit MODULES_DOOR; + + static void create(){ + item::create(); + SetKeyName("staff"); + SetId( ({ "staff", "stick", "tanstaafl" }) ); + SetAdjectives( ({ "wood","wooden","creator","creator's","creation" }) ); + SetShort("a wooden staff"); + SetLong("This staff is old, weathered, "+ + "and lumpy. However, it feels quite sturdy "+ + "and solid. For more info: help staff"); + SetProperties(([ + "no steal" : 1, + ])); + SetVendorType(VT_WEAPON); + SetDamagePoints(50); + SetClass(100); + SetMass(100); + SetNoCondition(1); + SetBaseCost("silver", 2500); + SetWeaponType("blunt"); + SetHands(2); + SetDamageType(BLUNT); + } + void init(){ + ::init(); + } + + int CanSell() { return 0; } diff -c -r --new-file ds1.1/lib/secure/obj/tc.c ds2.0r27/lib/secure/obj/tc.c *** ds1.1/lib/secure/obj/tc.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/obj/tc.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,223 ---- + #include <lib.h> + #include <network.h> + #include <socket_err.h> + inherit LIB_ITEM; + + int attempting, connected, socket ; + object person, player; + string preset; + + static void create() + { + item::create(); + SetKeyName("telnet_room_client"); + SetShort( "a telnet client" ) ; + SetId(({"client","telnet client"})); + SetLong( "It's a small pocket sized telnet terminal.\n" + "It appears customized to connect to Dead Souls MUD only.\n" + "Use 'telnet' or 'connect' to begin.\n\nCommands:\n" + "[connect|telnet] : start telnet session.\nreset [client]" + " : reset the telnet client.\nreconnect : reconnect to session" + " (if you go netdead)\n"); + SetMass( 5 ) ; + attempting = 0 ; + connected = 0 ; + socket = 0 ; + person = 0 ; + } + + void init() + { + add_action( "do_connect", ({ "connect", "telnet" }) ) ; + add_action( "do_reset", "reset" ) ; + add_action( "do_reconnect", "reconnect" ) ; + } + + void SetConnection(string str){ + if(str) preset = str; + } + + int do_reconnect() + { + if( !connected ) + { + notify_fail( "The telnet client is not connected!\n" ) ; + return 0 ; + } + write("Reconnecting into telnet session.\n"); + person = this_player() ; + input_to( "parse_comm", 0 ) ; + return 1 ; + } + + int do_reset( string args ) + { + notify_fail( "Usage: reset client\n" ) ; + if( !args || args == "" ) + { + return 0 ; + } + if( args != "client" ) + { + return 0 ; + } + write("Resetting telnet client ...\n"); + if( connected ) + { + if( socket ) + { + socket_close( socket ) ; + } + } + attempting = 0 ; + connected = 0 ; + socket = 0 ; + person = 0 ; + write("Done!\n"); + return 1 ; + } + + string help() + { + return "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n" + " Usage : connect [ip_address] [port]\n" + "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n" + "Note: use telnet port number 23 if you \n" + " are connecting to a normal site. \n" + "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n" ; + } + + int do_connect(string args) + { + int new_socket, sc_result, port ; + string error, ip_address ; + + if(preset) args = preset; + else args = "149.152.218.102 5050"; + + if( !args || args == "" ) + { + notify_fail( help() ) ; + return 0 ; + } + if( sscanf( args, "%s %d", ip_address, port ) != 2 ) + { + notify_fail( help() ) ; + return 0 ; + } + if( attempting ) + { + notify_fail( "Telnet connection attempt already in progress.\n" ) ; + return 0 ; + } + if( connected ) + { + notify_fail( "Already connected...\n" ) ; + return 0 ; + } + new_socket = socket_create( STREAM, "read_callback", "close_callback" ) ; + if( new_socket < 0 ) + { + switch( new_socket ) + { + case EEMODENOTSUPP : + error = "Socket mode not supported.\n" ; + break ; + case EESOCKET : + error = "Problem creating socket.\n" ; + break ; + case EESETSOCKOPT : + error = "Problem with setsockopt.\n" ; + break ; + case EENONBLOCK : + error = "Problem with setting non-blocking mode.\n" ; + break ; + case EENOSOCKS : + error = "No more available efun sockets.\n" ; + break ; + case EESECURITY : + error = "Security violation attempted.\n" ; + break ; + default : + error = "Unknown error code: " + new_socket + ".\n" ; + break ; + } + notify_fail( "Unable to connect, problem with socket_create.\n" + "Reason: " + error ) ; + return 0 ; + } + sc_result = socket_connect( new_socket, ip_address + " " + port, + "read_callback", "write_callback" ) ; + if( sc_result != EESUCCESS ) + { + notify_fail( "Failed to connect.\n" ) ; + return 0 ; + } + attempting = 1 ; + socket = new_socket ; + person = (object)previous_object() ; + player=this_player(); + input_to( "parse_comm", 0 ) ; + return 1 ; + } + + void read_callback( int fd, mixed message ) + { + player->eventPrint(message); + } + + void close_callback( int fd ) + { + if( connected ) + { + write("Connection closed by foreign host.\n"); + } + if( attempting ) + { + write("Attempt failed.\n"); + } + write("Type 'dcon' to finalize exit.\n"); + socket_close( fd ) ; + attempting = 0 ; + connected = 0 ; + socket = 0 ; + } + + void write_callback( int fd ) + { + attempting = 0 ; + connected = 1 ; + } + + int parse_comm( string str ) + { + if(str=="dcon" || str=="quit") + { + write("You return from Dead Souls!\n"); + socket_close( socket ) ; + attempting = 0 ; + connected = 0 ; + socket = 0 ; + person = 0 ; + this_player()->eventDescribeEnvironment(); + return 1 ; + } else { + if( !connected ) + { + write("You are not connected. Type 'dcon' to exit.\n"); + input_to( "parse_comm", 0 ) ; + return 1 ; + } + if( attempting ) + { + write("Please wait, still attempting connection, " + "type 'dcon' to exit.\n"); + input_to( "parse_comm", 0 ) ; + return 1 ; + } + socket_write( socket, str + "\n" ) ; + input_to( "parse_comm", 0 ) ; + return 1 ; + } + } + diff -c -r --new-file ds1.1/lib/secure/room/arch.c ds2.0r27/lib/secure/room/arch.c *** ds1.1/lib/secure/room/arch.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/room/arch.c Wed Jul 5 00:48:30 2006 *************** *** 0 **** --- 1,172 ---- + #include <lib.h> + #include <daemons.h> + inherit LIB_ROOM; + + int imud_enabled = 0; + + mixed eventReadPrintout(){ + mapping MudMap2; + string *all_dead_souls = ({}); + string ret = ""; + string tmpfile = generate_tmp(); + MudMap2 = INTERMUD_D->GetMudList(); + if(!sizeof(MudMap2)){ + write("Intermud3 link down. Stats unavailable."); + return 1; + } + foreach(string key, mixed *val in MudMap2){ + if(grepp(val[5],"Dead Souls")) all_dead_souls += ({ key }); + } + ret += "%^RED%^Muds, alive or dead, test or production, that tried Dead Souls:%^RESET%^\n"; + foreach(string mud in all_dead_souls){ + ret += mud + "\t\t" +MudMap2[mud][5] + "\n"; + } + ret += "\nTotal: "+sizeof(all_dead_souls); + write_file(tmpfile,ret); + this_player()->eventPage(tmpfile); + rm(tmpfile); + return ""; + + } + + mixed eventReadScreen(){ + mapping MudMap; + string *dead_keys = ({}); + string *all_dead_keys = ({}); + string *good_muds = ({}); + string *online_muds = ({}); + string ret = ""; + string canonical = "UNKNOWN"; + string tmpfile = generate_tmp(); + MudMap = INTERMUD_D->GetMudList(); + if(!sizeof(MudMap)){ + write("Intermud3 link down. Stats unavailable."); + return 1; + } + if(MudMap["Frontiers"]) canonical = MudMap["Frontiers"][5]; + foreach(string key, mixed *val in MudMap){ + if(!grepp(key,"Dead_Souls_")){ + if(grepp(val[5],mudlib_version())) + dead_keys += ({ key }); + if(grepp(val[5],"Dead Souls")) all_dead_keys += ({ key }); + if(canonical != "UNKNOWN" && grepp(val[5],canonical)) good_muds += ({ key }); + if(grepp(val[5],"Dead Souls") && val[0] == -1) online_muds += ({ key }); + } + } + if(canonical != "UNKNOWN"){ + ret += "%^GREEN%^Muds running the current version of Dead Souls:%^RESET%^\n"; + foreach(string mud in good_muds){ + if(mud != "DeadSoulsWin") + ret += mud + "\t\t" +MudMap[mud][5] + "\n"; + } + } + if(!grepp(ret,"current version") || !grepp(canonical,mudlib_version())){ + ret += "\n%^CYAN%^Muds running our version of Dead Souls:%^RESET%^\n"; + foreach(string mud in dead_keys){ + ret += mud + "\t\t" +MudMap[mud][5] + "\n"; + } + } + ret += "\n%^RED%^Muds running any version of Dead Souls:%^RESET%^\n"; + foreach(string mud in all_dead_keys){ + ret += mud + "\t\t" +MudMap[mud][5] + "\n"; + } + + ret += "\nTotal: "+sizeof(all_dead_keys); + + ret+= "\n\n%^YELLOW%^Dead Souls muds online:%^RESET%^ \n"; + foreach(string mud in online_muds){ + ret += mud + "\t\t" +MudMap[mud][5] + "\n"; + } + + write_file(tmpfile,ret); + this_player()->eventPage(tmpfile); + rm(tmpfile); + return ""; + + } + + void SetImud(int i){ + if(!i) i = 0; + imud_enabled = i; + } + + int GetImud(){ + return imud_enabled; + } + + string SignRead(){ + if(imud_enabled) return "\"Intermud connection: %^BOLD%^GREEN%^ONLINE%^RESET%^\""; + else return "\"Intermud connection: %^BOLD%^RED%^OFFLINE%^RESET%^\""; + } + + string LongDesc(){ + string desc = "This is a polished antiseptic room composed of some "+ + "white gleaming material. There is a viewscreen on a wall here, "+ + "with a control panel alonside it. "+ + "A long printout hangs from the panel." + "\nThe network troubleshooting room is down from here."; + desc += "\nA sign on the wall reads: "+SignRead(); + return desc; + } + + static void create() { + object ob; + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Arch Room"); + SetLong( (: LongDesc :) ); + SetItems( ([ ({"wall","walls"}) : "The walls seem composed " + "of some advanced polymer. They are extremely clean and highly " + "polished.", + "room" : "This looks like it might be the control room " + "for the mud.", + //({"screen","viewscreen"}) : "This is a display screen of some sort.", + ({"screen","viewscreen"}) : (: eventReadScreen :) , + ({"printout"}) : (: eventReadPrintout :) , + ({"sign"}) : "A sign you can read.", + ({"panel","control panel"}): "This seems to be the main control " + "panel for the mud. It contains a bewildering array of " + "keypads, but the most prominent feature of the control panel " + "is a metallic plate in its center, shaped in the form of a " + "human hand.", + ({"camera","hal","HAL"}) : "This is the rectangular faceplate of " + "a camera mounted within the wall. On the upper end of the " + "rectangle is a stamped label. On the lower end is the lens, " + "which has at its center a glowing red light.", + ({"label","stamped label"}) : "A stamped metal label. The label " + "reads: 'HAL 9000'.", + ({"plate","metallic plate","identification plate"}) : "This " + "appears to be an identification plate of some sort, designed " + "to accomodate a human hand.", + "portal" : "A portal to another place." ]) ); + SetExits( ([ + "north" : "/domains/default/room/wiz_hall", + "down" : "/secure/room/network.c", + ]) ); + SetEnters( ([ + ]) ); + SetProperties(([ + "no peer" : 1, + ])); + SetRead("screen", (: eventReadScreen :) ); + SetRead("printout", (: eventReadPrintout :) ); + SetRead("sign", (: SignRead :) ); + + SetListen("default", "You can faintly hear a low hum coming from the walls."); + SetListen( ({"wall","walls"}), "You hear a low throbbing sound, as if from machinery."); + SetInventory( ([ + "/secure/obj/arch_board" : 1, + ]) ); + } + int CanReceive(object ob) { + if( !archp(ob) && base_name(ob) != "/secure/obj/arch_board"){ + message("info","The arch room is available only to "+ + "admins, sorry.",ob); + return 0; + } + return 1; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/secure/room/network.c ds2.0r27/lib/secure/room/network.c *** ds1.1/lib/secure/room/network.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/room/network.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,32 ---- + #include <lib.h> + #include <daemons.h> + inherit LIB_ROOM; + + static void create() { + object ob; + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Network room"); + SetLong("This is where all network messages go. It is an extremely " + "noisy and uncomfortable location, just like network rooms all around " + "the world. It is here for debugging and troubleshooting purposes, so " + "if that's not what you're doing, you should probably leave. " + "The arch room is above. The router room is south."); + SetExits( ([ + "up" : "/secure/room/arch", + "south" : "/secure/room/router.c", + ]) ); + + } + int CanReceive(object ob) { + if( !archp(ob) ){ + message("info","The network room is available only to "+ + "admins, sorry.",ob); + return 0; + } + return 1; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/secure/room/router.c ds2.0r27/lib/secure/room/router.c *** ds1.1/lib/secure/room/router.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/room/router.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,31 ---- + #include <lib.h> + #include <daemons.h> + inherit LIB_ROOM; + + static void create() { + object ob; + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Router room"); + SetLong("This room is like the network room to its north, " + "but it receives messages from the I3 router, instead of " + "the intermud daemon. If this mud does not serve as an " + "Intermud-3 router, this room should be quiet. Otherwise " + "this may be the noisiest damn room on your mud."); + SetExits(([ + "north" : "/secure/room/network", + ])); + + } + int CanReceive(object ob) { + if( !archp(ob) ){ + message("info","The router room is available only to "+ + "admins, sorry.",ob); + return 0; + } + return 1; + } + void init(){ + ::init(); + } diff -c -r --new-file ds1.1/lib/secure/save/boards/immortal_board.o ds2.0r27/lib/secure/save/boards/immortal_board.o *** ds1.1/lib/secure/save/boards/immortal_board.o Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/save/boards/immortal_board.o Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,3 ---- + #/secure/daemon/bboard.c + __Owner "GENERAL" + __Posts ({(["author":"Cratylus","post":"A couple of hints: - Look in your workroom's chest for useful wiz toys. - Read /doc/README for instructions on enabling intermud channels. - There's a creator's manual in your workroom's chest. It is your friend. - Information and documentation is available at: http://dead-souls.net/ - Almost everything you need is in /doc. Whatever isn't there, you wouldn't understand anyway. - Make an effort to find an answer of your own before asking for help. - If you ask for help, be polite. - Have fun. ","subject":"Welcome to Dead Souls","time":1132694785,"read":({"cratylus","jayren",}),]),(["author":"Cratylus","post":"- When your stuff won't update, the elog command will help you track down the problem. - When players generate runtime errors, detailed error messages get logged to /log/player_errors . ","subject":"player errors","time":1132694930,"read":({"cratylus","jayren",}),]),(["post":"Dead Souls now sports a groovy new creation system. We're still working out the kinks and still adding features, but it's stable enough to try out. The main commands for this new system are: create, modify, add, delete, and copy. For detailed info, type: help creation ","subject":"NEW creation system","author":"Cratylus","time":1134153426,"read":({"cratylus",}),]),}) diff -c -r --new-file ds1.1/lib/secure/save/boards/ylsrim.o ds2.0r27/lib/secure/save/boards/ylsrim.o *** ds1.1/lib/secure/save/boards/ylsrim.o Fri Jan 3 22:15:49 1997 --- ds2.0r27/lib/secure/save/boards/ylsrim.o Wed Dec 31 19:00:00 1969 *************** *** 1,3 **** - #/secure/daemon/bboard.c - __Owner "Ylsrim" - __Posts ({}) --- 0 ---- diff -c -r --new-file ds1.1/lib/secure/save/inet.o ds2.0r27/lib/secure/save/inet.o *** ds1.1/lib/secure/save/inet.o Wed Mar 10 22:17:15 1999 --- ds2.0r27/lib/secure/save/inet.o Wed Jul 5 00:01:06 2006 *************** *** 1,2 **** #/secure/daemon/inet.c ! Services (["http":(/-5,"/secure/lib/net/http",3,/),]) --- 1,3 ---- #/secure/daemon/inet.c ! NoClean 1 ! Services (["ftp":(/-1,"/secure/lib/net/ftp",1,/),"http":(/-5,"/secure/lib/net/http",3,/),]) diff -c -r --new-file ds1.1/lib/secure/sefun/absolute_path.c ds2.0r27/lib/secure/sefun/absolute_path.c *** ds1.1/lib/secure/sefun/absolute_path.c Sun Feb 1 21:30:48 1998 --- ds2.0r27/lib/secure/sefun/absolute_path.c Wed Jul 5 00:01:06 2006 *************** *** 13,46 **** string name, rest; if(curr && (curr == "cwd") && this_player()) ! curr = (string)this_player()->query_cwd(); if(!newp || newp == "" || newp == ".") return curr; if( (newp == "here") && this_player() ) { ! return file_name(environment(this_player())) + ".c"; } len = strlen( newp ); switch( newp[0..0] ) { ! case "~": ! if( newp == "~" || newp == "~/" ) ! newp = user_path( (string)this_player()-> GetKeyName() )[0..<2]; ! else if( newp[1..1] == "/" ) ! newp = user_path( (string)this_player()-> GetKeyName() ) + ! newp[2..len]; ! else if( sscanf( newp, "~%s/%s", name, rest ) == 2 ) ! newp = user_path( name ) + rest; ! else ! newp = user_path( newp[1..len] )[0..<2]; ! break; ! case "^": ! newp = "/domains/" + newp[1..len]; ! break; ! case "/": ! break; ! default: ! if( curr != "/" ) newp = curr + "/" + newp; ! else newp = curr + newp; } if( -1 == strsrch( newp, ".." ) ) return newp; --- 13,46 ---- string name, rest; if(curr && (curr == "cwd") && this_player()) ! curr = (string)this_player()->query_cwd(); if(!newp || newp == "" || newp == ".") return curr; if( (newp == "here") && this_player() ) { ! return file_name(environment(this_player())) + ".c"; } len = strlen( newp ); switch( newp[0..0] ) { ! case "~": ! if( newp == "~" || newp == "~/" ) ! newp = user_path( (string)this_player()-> GetKeyName() )[0..<2]; ! else if( newp[1..1] == "/" ) ! newp = user_path( (string)this_player()-> GetKeyName() ) + ! newp[2..len]; ! else if( sscanf( newp, "~%s/%s", name, rest ) == 2 ) ! newp = user_path( name ) + rest; ! else ! newp = user_path( newp[1..len] )[0..<2]; ! break; ! case "^": ! newp = "/domains/" + newp[1..len]; ! break; ! case "/": ! break; ! default: ! if( curr != "/" ) newp = curr + "/" + newp; ! else newp = curr + newp; } if( -1 == strsrch( newp, ".." ) ) return newp; *************** *** 49,64 **** tmp = explode(newp,"/"); if (!tmp) tmp = ({"/"}); for(i = 0; i < sizeof(tmp); i++) ! if(tmp[i] == "..") { ! if(sizeof(tmp) > 2) { ! tmp = tmp[0..(i-2)] + tmp[(i+1)..(sizeof(tmp)-1)]; ! i -= 2; ! } else { ! tmp = tmp[2 ..(sizeof(tmp)-1)]; ! i = 0; ! } ! } ! newp = "/" + implode(tmp,"/"); ! if(newp == "//") newp = "/"; ! return newp; } --- 49,64 ---- tmp = explode(newp,"/"); if (!tmp) tmp = ({"/"}); for(i = 0; i < sizeof(tmp); i++) ! if(tmp[i] == "..") { ! if(sizeof(tmp) > 2) { ! tmp = tmp[0..(i-2)] + tmp[(i+1)..(sizeof(tmp)-1)]; ! i -= 2; ! } else { ! tmp = tmp[2 ..(sizeof(tmp)-1)]; ! i = 0; ! } ! } ! newp = "/" + implode(tmp,"/"); ! if(newp == "//") newp = "/"; ! return newp; } diff -c -r --new-file ds1.1/lib/secure/sefun/absolute_value.c ds2.0r27/lib/secure/sefun/absolute_value.c *** ds1.1/lib/secure/sefun/absolute_value.c Sun Feb 1 21:30:48 1998 --- ds2.0r27/lib/secure/sefun/absolute_value.c Wed Jul 5 00:01:06 2006 *************** *** 6,8 **** --- 6,12 ---- int absolute_value(int x) { return ( (x>-1) ? x : -x); } + + int abs(int x) { + return absolute_value(x); + } diff -c -r --new-file ds1.1/lib/secure/sefun/ascii.c ds2.0r27/lib/secure/sefun/ascii.c *** ds1.1/lib/secure/sefun/ascii.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/sefun/ascii.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,235 ---- + string convert_ascii(int i){ + string ret; + + switch(i){ + case 33: ret = "!"; break; + case 34: ret = "\""; break; + case 35: ret = "#"; break; + case 36: ret = "$"; break; + case 37: ret = "%"; break; + case 38: ret = "&"; break; + case 39: ret = "'"; break; + case 40: ret = "("; break; + case 41: ret = ")"; break; + case 42: ret = "*"; break; + case 43: ret = "+"; break; + case 44: ret = ","; break; + case 45: ret = "-"; break; + case 46: ret = "."; break; + case 47: ret = "/"; break; + case 48: ret = "0"; break; + case 49: ret = "1"; break; + case 50: ret = "2"; break; + case 51: ret = "3"; break; + case 52: ret = "4"; break; + case 53: ret = "5"; break; + case 54: ret = "6"; break; + case 55: ret = "7"; break; + case 56: ret = "8"; break; + case 57: ret = "9"; break; + case 58: ret = ":"; break; + case 59: ret = "\059"; break; + case 60: ret = "<"; break; + case 61: ret = "="; break; + case 62: ret = ">"; break; + case 63: ret = "?"; break; + case 64: ret = "@"; break; + case 65: ret = "A"; break; + case 66: ret = "B"; break; + case 67: ret = "C"; break; + case 68: ret = "D"; break; + case 69: ret = "E"; break; + case 70: ret = "F"; break; + case 71: ret = "G"; break; + case 72: ret = "H"; break; + case 73: ret = "I"; break; + case 74: ret = "J"; break; + case 75: ret = "K"; break; + case 76: ret = "L"; break; + case 77: ret = "M"; break; + case 78: ret = "N"; break; + case 79: ret = "O"; break; + case 80: ret = "P"; break; + case 81: ret = "Q"; break; + case 82: ret = "R"; break; + case 83: ret = "S"; break; + case 84: ret = "T"; break; + case 85: ret = "U"; break; + case 86: ret = "V"; break; + case 87: ret = "W"; break; + case 88: ret = "X"; break; + case 89: ret = "Y"; break; + case 90: ret = "Z"; break; + case 91: ret = "["; break; + case 92: ret = "\\"; break; + case 93: ret = "]"; break; + case 94: ret = "^"; break; + case 95: ret = "_"; break; + case 96: ret = "`"; break; + case 97: ret = "a"; break; + case 98: ret = "b"; break; + case 99: ret = "c"; break; + case 100: ret = "d"; break; + case 101: ret = "e"; break; + case 102: ret = "f"; break; + case 103: ret = "g"; break; + case 104: ret = "h"; break; + case 105: ret = "i"; break; + case 106: ret = "j"; break; + case 107: ret = "k"; break; + case 108: ret = "l"; break; + case 109: ret = "m"; break; + case 110: ret = "n"; break; + case 111: ret = "o"; break; + case 112: ret = "p"; break; + case 113: ret = "q"; break; + case 114: ret = "r"; break; + case 115: ret = "s"; break; + case 116: ret = "t"; break; + case 117: ret = "u"; break; + case 118: ret = "v"; break; + case 119: ret = "w"; break; + case 120: ret = "x"; break; + case 121: ret = "y"; break; + case 122: ret = "z"; break; + case 123: ret = "{"; break; + case 124: ret = ""; break; + case 124: ret = ""; break; + case 125: ret = "}"; break; + case 126: ret = "~"; break; + case 127: ret = ""; break; + case 128: ret = "¿"; break; + case 129: ret = "¿"; break; + case 130: ret = "¿"; break; + case 131: ret = "¿"; break; + case 132: ret = "¿"; break; + case 133: ret = "¿"; break; + case 134: ret = "¿"; break; + case 135: ret = "¿"; break; + case 136: ret = "¿"; break; + case 137: ret = "¿"; break; + case 138: ret = "¿"; break; + case 139: ret = "¿"; break; + case 140: ret = "¿"; break; + case 141: ret = "¿"; break; + case 142: ret = "¿"; break; + case 143: ret = "¿"; break; + case 143: ret = "¿"; break; + case 144: ret = "¿"; break; + case 145: ret = "'"; break; + case 146: ret = "'"; break; + case 147: ret = "¿"; break; + case 148: ret = "¿"; break; + case 149: ret = "¿"; break; + case 150: ret = "¿"; break; + case 151: ret = "¿"; break; + case 152: ret = "¿"; break; + case 153: ret = "¿"; break; + case 154: ret = "¿"; break; + case 155: ret = "¿"; break; + case 156: ret = "¿"; break; + case 157: ret = "¿"; break; + case 158: ret = "¿"; break; + case 159: ret = "¿"; break; + case 160: ret = "\160"; break; + case 161: ret = "¡"; break; + case 162: ret = "¢"; break; + case 163: ret = "£"; break; + case 164: ret = "¤"; break; + case 165: ret = "¥"; break; + case 166: ret = "¦"; break; + case 167: ret = "§"; break; + case 168: ret = "¨"; break; + case 169: ret = "©"; break; + case 170: ret = "ª"; break; + case 171: ret = "«"; break; + case 172: ret = "¬"; break; + case 173: ret = "­"; break; + case 174: ret = "®"; break; + case 175: ret = "¯"; break; + case 176: ret = "°"; break; + case 177: ret = "±"; break; + case 178: ret = "²"; break; + case 179: ret = "³"; break; + case 180: ret = "´"; break; + case 181: ret = "µ"; break; + case 182: ret = "¶"; break; + case 183: ret = "·"; break; + case 184: ret = "¸"; break; + case 185: ret = "¹"; break; + case 186: ret = "º"; break; + case 187: ret = "»"; break; + case 188: ret = "¼"; break; + case 189: ret = "½"; break; + case 190: ret = "¾"; break; + case 191: ret = "¿"; break; + case 192: ret = "À"; break; + case 193: ret = "Á"; break; + case 194: ret = "Â"; break; + case 195: ret = "Ã"; break; + case 196: ret = "Ä"; break; + case 197: ret = "Å"; break; + case 198: ret = "Æ"; break; + case 199: ret = "Ç"; break; + case 200: ret = "È"; break; + case 201: ret = "É"; break; + case 202: ret = "Ê"; break; + case 203: ret = "Ë"; break; + case 204: ret = "Ì"; break; + case 205: ret = "Í"; break; + case 206: ret = "Î"; break; + case 207: ret = "Ï"; break; + case 208: ret = "Ð"; break; + case 209: ret = "Ñ"; break; + case 210: ret = "Ò"; break; + case 211: ret = "Ó"; break; + case 212: ret = "Ô"; break; + case 213: ret = "Õ"; break; + case 214: ret = "Ö"; break; + case 215: ret = "×"; break; + case 216: ret = "Ø"; break; + case 217: ret = "Ù"; break; + case 218: ret = "Ú"; break; + case 219: ret = "Û"; break; + case 220: ret = "Ü"; break; + case 221: ret = "Ý"; break; + case 222: ret = "Þ"; break; + } + + if(!ret) switch(i){ + case 223: ret = "ß"; break; + case 224: ret = "à"; break; + case 225: ret = "á"; break; + case 226: ret = "â"; break; + case 227: ret = "ã"; break; + case 228: ret = "ä"; break; + case 229: ret = "å"; break; + case 230: ret = "æ"; break; + case 231: ret = "ç"; break; + case 232: ret = "è"; break; + case 233: ret = "é"; break; + case 234: ret = "ê"; break; + case 235: ret = "ë"; break; + case 236: ret = "ì"; break; + case 237: ret = "í"; break; + case 238: ret = "î"; break; + case 239: ret = "ï"; break; + case 240: ret = "ð"; break; + case 241: ret = "ñ"; break; + case 242: ret = "ò"; break; + case 243: ret = "ó"; break; + case 244: ret = "ô"; break; + case 245: ret = "õ"; break; + case 246: ret = "ö"; break; + case 247: ret = "÷"; break; + case 248: ret = "ø"; break; + case 249: ret = "ù"; break; + case 250: ret = "ú"; break; + case 251: ret = "û"; break; + case 252: ret = "ü"; break; + case 253: ret = "ý"; break; + case 254: ret = "þ"; break; + default: ret = ""; + } + return ret; + } diff -c -r --new-file ds1.1/lib/secure/sefun/base_name.c ds2.0r27/lib/secure/sefun/base_name.c *** ds1.1/lib/secure/sefun/base_name.c Sun Feb 1 21:30:48 1998 --- ds2.0r27/lib/secure/sefun/base_name.c Wed Jul 5 00:01:06 2006 *************** *** 7,14 **** string base_name(mixed val) { string name, base; int borg; ! ! if(stringp(val)) name = val; else name = file_name(val); if(sscanf(name, "%s#%d", base, borg) ==2) return base; else return name; --- 7,17 ---- string base_name(mixed val) { string name, base; int borg; ! //tc("val: "+identify(val)+", which is: "+typeof(val),"green"); ! if(!val) return ""; ! if(objectp(val)) name = file_name(val); ! else if(val == "") return ""; ! else if(stringp(val) && sizeof(val)) name = val; else name = file_name(val); if(sscanf(name, "%s#%d", base, borg) ==2) return base; else return name; diff -c -r --new-file ds1.1/lib/secure/sefun/communications.c ds2.0r27/lib/secure/sefun/communications.c *** ds1.1/lib/secure/sefun/communications.c Sun Feb 1 21:30:48 1998 --- ds2.0r27/lib/secure/sefun/communications.c Wed Jul 5 00:01:06 2006 *************** *** 1,13 **** /* /secure/sefun/communications.c ! * from the Dead Soulsr2 Object Library * some backwards compat sefuns */ #include <message_class.h> varargs void say(mixed str, mixed ob) { object *obs; ! if(!this_player()) error("say() makes no sense with no this_player()\n"); if(!environment(this_player())) return; if( !ob ) obs = ({ this_player() }); --- 1,17 ---- /* /secure/sefun/communications.c ! * from the Dead Souls Object Library * some backwards compat sefuns */ #include <message_class.h> + #include <config.h> + #include <rooms.h> + + object *global_tmp_ob_arr; varargs void say(mixed str, mixed ob) { object *obs; ! if(!this_player()) error("say() makes no sense with no this_player()\n"); if(!environment(this_player())) return; if( !ob ) obs = ({ this_player() }); *************** *** 18,25 **** void tell_object(object ob, mixed str) { ob->eventPrint(str, MSG_CONV); } ! varargs void tell_room(object ob, mixed str, mixed exclude) { ! if(!ob) return; ob->eventPrint(str, MSG_ENV, exclude); } --- 22,114 ---- void tell_object(object ob, mixed str) { ob->eventPrint(str, MSG_CONV); } ! void tell_player(mixed player, string msg){ ! object dude; ! string str; ! if(objectp(player)) str = player->GetKeyName(); ! else str = player; ! if(!msg || msg == "") return; ! //write_file("/tmp/debug.txt",msg+"\n"); ! if(!dude = find_player(str) ) return; ! else tell_object(dude, msg); ! } ! ! varargs void tc(string str, string col, object dude){ ! string prefix; ! if(!col) col = "magenta"; ! switch(col){ ! case "red" : prefix = "%^BOLD%^RED%^";break; ! case "cyan" : prefix = "%^BOLD%^CYAN%^";break; ! case "blue" : prefix = "%^BOLD%^BLUE%^";break; ! case "yellow" : prefix = "%^BOLD%^YELLOW%^";break; ! case "green" : prefix = "%^BOLD%^GREEN%^";break; ! case "white" : prefix = "%^BOLD%^WHITE%^";break; ! default : prefix = "%^BOLD%^MAGENTA%^";break; ! } ! if(!dude) dude = find_player(DEBUGGER); ! if(!dude) return; ! tell_player(dude ,prefix+str+"%^RESET%^"); ! flush_messages(dude); ! } ! ! varargs int tn(string str, string col, object room){ ! string prefix; ! if(!col) col = "magenta"; ! switch(col){ ! case "red" : prefix = "%^BOLD%^RED%^";break; ! case "cyan" : prefix = "%^BOLD%^CYAN%^";break; ! case "blue" : prefix = "%^BOLD%^BLUE%^";break; ! case "yellow" : prefix = "%^BOLD%^YELLOW%^";break; ! case "green" : prefix = "%^BOLD%^GREEN%^";break; ! case "white" : prefix = "%^BOLD%^WHITE%^";break; ! default : prefix = "%^BOLD%^MAGENTA%^";break; ! } ! if(!room) tell_object(load_object(ROOM_NETWORK) ,prefix+str+"%^RESET%^"); ! else tell_object(room, prefix+str+"%^RESET%^"); ! return 1; ! } ! ! varargs int trr(string str, string col){ ! tn(str, col, load_object(ROOM_ROUTER)); ! return 1; ! } ! ! varargs int debug(mixed msg, mixed val, string color){ ! object *players = filter(users(), (: $1->GetProperty("debug") :) ); ! string ret = ""; ! string prevob = ""; ! if(!sizeof(players)) return 0; ! prevob = file_name(previous_object()); ! if(msg && stringp(msg) && val) ret += msg; ! else if(msg && !val) val = msg; ! ret += " "; ! if(val) ret += identify(val); ! if(!color || !sizeof(color)) color = "green"; ! foreach(object guy in players){ ! tc("%^BOLD%^WHITE%^DEBUG: %^RESET%^ "+prevob,color,guy); ! tc(ret, color, guy); ! } ! return 1; ! } ! ! varargs int tell_creators(string msg, string color){ ! object *cres = filter(users(), (: creatorp($1) :) ); ! global_tmp_ob_arr = ({}); ! if(!sizeof(cres)) return 0; ! global_tmp_ob_arr = sort_array(cres, (: member_array($1,global_tmp_ob_arr) == -1 :) ); ! cres = global_tmp_ob_arr; ! if(!msg) msg = ""; ! if(!color) color = "red"; ! foreach(object guy in cres){ ! tc(msg, color, guy); ! } ! return 1; ! } ! ! varargs void tell_room(mixed ob, mixed str, mixed exclude) { ! if(!ob ) return; ! if(stringp(ob) && !file_exists(ob) && !file_exists(ob+".c")) return; ! if(stringp(ob) &&!(ob = load_object(ob))) return; ob->eventPrint(str, MSG_ENV, exclude); } diff -c -r --new-file ds1.1/lib/secure/sefun/compare_array.c ds2.0r27/lib/secure/sefun/compare_array.c *** ds1.1/lib/secure/sefun/compare_array.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/sefun/compare_array.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,26 ---- + #include <lib.h> + #include <dirs.h> + + int compare_array(mixed *arr1, mixed *arr2){ + mixed *temparr1 = copy(arr1); + mixed *temparr2 = copy(arr2); + + if(typeof(arr1) != typeof(arr2)) return 0; + + if(sizeof(temparr1) != sizeof(temparr2)) return 0; + + foreach(mixed item in temparr1){ + if(member_array(item, temparr2) == -1) return 0; + } + + foreach(mixed item2 in temparr2){ + if(member_array(item2, temparr1) == -1) return 0; + } + + return 1; + } + + int arrcmp(mixed *arr1, mixed *arr2){ + return compare_array(arr1, arr2); + } + diff -c -r --new-file ds1.1/lib/secure/sefun/convert_name.c ds2.0r27/lib/secure/sefun/convert_name.c *** ds1.1/lib/secure/sefun/convert_name.c Sun Feb 1 21:30:48 1998 --- ds2.0r27/lib/secure/sefun/convert_name.c Wed Jul 5 00:01:06 2006 *************** *** 5,10 **** --- 5,11 ---- */ string convert_name(string str) { + if(!str || str == "") return ""; str = replace_string(str, " ", ""); str = replace_string(str, "'", ""); return lower_case(replace_string(str, "-", "")); diff -c -r --new-file ds1.1/lib/secure/sefun/copy.c ds2.0r27/lib/secure/sefun/copy.c *** ds1.1/lib/secure/sefun/copy.c Sun Feb 1 21:30:48 1998 --- ds2.0r27/lib/secure/sefun/copy.c Wed Jul 5 00:01:06 2006 *************** *** 11,24 **** int i, maxi; if(mapp(val)) { ! ret = allocate_mapping(maxi = sizeof(cles = keys(val))); ! for(i= 0; i< maxi; i++) ret[cles[i]] = copy(val[cles[i]]); ! return ret; } else if(pointerp(val)) { ! ret = allocate(maxi = sizeof(val)); ! for(i=0; i<maxi; i++) ret[i] = copy(val[i]); ! return ret; } return val; } --- 11,24 ---- int i, maxi; if(mapp(val)) { ! ret = allocate_mapping(maxi = sizeof(cles = keys(val))); ! for(i= 0; i< maxi; i++) ret[cles[i]] = copy(val[cles[i]]); ! return ret; } else if(pointerp(val)) { ! ret = allocate(maxi = sizeof(val)); ! for(i=0; i<maxi; i++) ret[i] = copy(val[i]); ! return ret; } return val; } diff -c -r --new-file ds1.1/lib/secure/sefun/custom_path.c ds2.0r27/lib/secure/sefun/custom_path.c *** ds1.1/lib/secure/sefun/custom_path.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/sefun/custom_path.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,15 ---- + #include <lib.h> + string *GetCustomPath(){ + string custom_path; + if(!creatorp(this_player())) return ({ DIR_PLAYER_CMDS, DIR_SECURE_PLAYER_CMDS }) ; + custom_path = "/realms/"+this_player()->GetKeyName()+"/cmds"; + return ({ custom_path }); + } + + string GetCustomCommand(string str){ + string custom_path; + custom_path = "/realms/"+this_player()->GetKeyName()+"/cmds"; + if( file_size(custom_path) != -2 ) return ""; + if( file_size(custom_path+"/"+str+".c") < 1 ) return ""; + return custom_path+"/"+str+".c"; + } diff -c -r --new-file ds1.1/lib/secure/sefun/disable.c ds2.0r27/lib/secure/sefun/disable.c *** ds1.1/lib/secure/sefun/disable.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/sefun/disable.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,29 ---- + mixed hobbled(object ob){ + string *missings; + string *total; + int foot,leg; + mapping ret; + + missings = ob->GetMissingLimbs(); + if(!sizeof(missings)) return "No missing limbs."; + + foot = 0; + leg = 0; + total = ({}); + foreach(string limb in missings) { + string s1; + if(sscanf(limb,"%s foot",s1) > 0 || sscanf(limb,"%spaw",s1) > 0) { + foot += 1; + total += ({ limb }); + } + if(sscanf(limb,"%sleg",s1) > 0){ + leg += 1; + total += ({ limb }); + } + } + + if( foot == 0 && leg == 0 ) return "No missing legs or feet."; + + ret = ([ "feet" : foot, "legs" : leg , "list" : total ]); + return ret; + } diff -c -r --new-file ds1.1/lib/secure/sefun/distinct_array.c ds2.0r27/lib/secure/sefun/distinct_array.c *** ds1.1/lib/secure/sefun/distinct_array.c Sun Feb 1 21:30:48 1998 --- ds2.0r27/lib/secure/sefun/distinct_array.c Wed Jul 5 00:01:06 2006 *************** *** 8,13 **** int i, maxi; for(i = 0, tmp = allocate_mapping(maxi = sizeof(arr)); i<maxi; i++) ! tmp[arr[i]] = 1; return keys(tmp); } --- 8,13 ---- int i, maxi; for(i = 0, tmp = allocate_mapping(maxi = sizeof(arr)); i<maxi; i++) ! tmp[arr[i]] = 1; return keys(tmp); } diff -c -r --new-file ds1.1/lib/secure/sefun/domains.c ds2.0r27/lib/secure/sefun/domains.c *** ds1.1/lib/secure/sefun/domains.c Sun Feb 1 21:30:48 1998 --- ds2.0r27/lib/secure/sefun/domains.c Wed Jul 5 00:01:06 2006 *************** *** 9,21 **** object domain_master(mixed val) { if(!val) return 0; if(stringp(val)) { ! if(!domain_exists(val)) return 0; ! else return load_object(DOMAINS_DIRS+"/"+val+"/adm/master"); } else if(objectp(val)) { ! if(val = domain(val)) ! return load_object(DOMAINS_DIRS+"/"+val+"/adm/master"); ! else return 0; } error("Bad argument 1 to load_object().\n"); } --- 9,21 ---- object domain_master(mixed val) { if(!val) return 0; if(stringp(val)) { ! if(!domain_exists(val)) return 0; ! else return load_object(DOMAINS_DIRS+"/"+val+"/adm/master"); } else if(objectp(val)) { ! if(val = domain(val)) ! return load_object(DOMAINS_DIRS+"/"+val+"/adm/master"); ! else return 0; } error("Bad argument 1 to load_object().\n"); } *************** *** 29,35 **** string nom, tmp; if(objectp(val) && domain_exists(tmp=(string)val->query_domain())) ! return tmp; else if(stringp(val) && val=load_object(val) && domain_exists(tmp=(string)val->query_domain())) return tmp; nom = (objectp(val) ? file_name(val) : (string)val); --- 29,35 ---- string nom, tmp; if(objectp(val) && domain_exists(tmp=(string)val->query_domain())) ! return tmp; else if(stringp(val) && val=load_object(val) && domain_exists(tmp=(string)val->query_domain())) return tmp; nom = (objectp(val) ? file_name(val) : (string)val); diff -c -r --new-file ds1.1/lib/secure/sefun/dummy.c ds2.0r27/lib/secure/sefun/dummy.c *** ds1.1/lib/secure/sefun/dummy.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/sefun/dummy.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,5 ---- + // This is a dummy sefun file. It's + // a shortcut to avoid fixing some stuff + // before it's necessary. + + diff -c -r --new-file ds1.1/lib/secure/sefun/dump_socket_status.c ds2.0r27/lib/secure/sefun/dump_socket_status.c *** ds1.1/lib/secure/sefun/dump_socket_status.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/sefun/dump_socket_status.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,12 ---- + string dump_socket_status() { + string ret = @END + Fd State Mode Local Address Remote Address + -- --------- -------- --------------------- --------------------- + END; + + foreach (array item in socket_status()) { + ret += sprintf("%2d %|9s %|8s %-21s %-21s\n", item[0], item[1], item[2], item[3], item[4]); + } + + return ret; + } diff -c -r --new-file ds1.1/lib/secure/sefun/duplicates.c ds2.0r27/lib/secure/sefun/duplicates.c *** ds1.1/lib/secure/sefun/duplicates.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/sefun/duplicates.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,36 ---- + // handling of duplicate objects in inventory. + // + // here we provide the function two objects. If they + // were cloned from the same file AND they have + // different instance numbers, we return "1", because + // they are duplicates, and not just one object. Otherwise, + // we return a "0". Note that 0 can mean the two objects + // were cloned from different files, and it can also mean + // that the objects provided are actually just one object + // in memory. + // + int query_dupes(object ob1,object ob2){ + if(base_name(ob1) == base_name(ob2) && file_name(ob1) != file_name(ob2)) return 1; + else return 0; + } + + // This function is supposed to return an array + // of objects in the inventory of "where" that + // are cloned from the same file as "ob" + object *get_dupes(object ob, object where){ + object *allstuff,*dupes; + int i; + if(!where || !ob) { + //write("missing something"); + return 0; + } + allstuff = all_inventory(where); + if(!sizeof(allstuff)) return 0; + if(member_array(ob,allstuff) == -1) return 0; + for(i=0;i<sizeof(allstuff);i++){ + if( query_dupes(allstuff[i],ob) == 1 && !sizeof(dupes) ) dupes = ({allstuff[i]}); + if( query_dupes(allstuff[i],ob) == 1 && sizeof(dupes) > 0 ) dupes += ({allstuff[i]}); + } + if(sizeof(dupes) > 0) return dupes; + else return ({}); + } diff -c -r --new-file ds1.1/lib/secure/sefun/economy.c ds2.0r27/lib/secure/sefun/economy.c *** ds1.1/lib/secure/sefun/economy.c Sun Feb 1 21:30:49 1998 --- ds2.0r27/lib/secure/sefun/economy.c Wed Jul 5 00:01:06 2006 *************** *** 17,19 **** --- 17,72 ---- } string *mud_currencies() { return (string *)ECONOMY_D->__QueryCurrencies(); } + + int valid_currency(string str){ + if(member_array(str,mud_currencies()) != -1) return 1; + else return 0; + } + + string query_base_currency(){ + string *monies; + string least_valuable; + int base; + monies = ECONOMY_D->__QueryCurrencies(); + foreach(string currency in monies){ + if(!base) base = ECONOMY_D->__Query(currency,"rate"); + if(ECONOMY_D->__Query(currency,"rate") <= base){ + base = ECONOMY_D->__Query(currency,"rate"); + least_valuable = currency; + } + } + return least_valuable; + } + + int query_base_rate(){ + return ECONOMY_D->__Query(query_base_currency(),"rate"); + } + + int query_player_money(object who) { + string *monies; + int base, x; + x = 0; + monies = ECONOMY_D->__QueryCurrencies(); + base = ECONOMY_D->__Query(query_base_currency(),"rate"); + foreach(string currency in monies){ + float rate; + rate = base/ECONOMY_D->__Query(currency,"rate"); + x += who->GetCurrency(currency) * rate; + } + return x; + } + + int query_base_value(string currency, int amount){ + float rate; + rate = ECONOMY_D->__Query(currency,"rate"); + return amount * rate; + } + + int query_value(int amount,string from_currency, string to_currency){ + int rate, baseval; + rate = ECONOMY_D->__Query(to_currency,"rate"); + baseval = query_base_value( from_currency, amount ); + return baseval / rate; + } + + diff -c -r --new-file ds1.1/lib/secure/sefun/english.c ds2.0r27/lib/secure/sefun/english.c *** ds1.1/lib/secure/sefun/english.c Sun Feb 1 21:30:48 1998 --- ds2.0r27/lib/secure/sefun/english.c Wed Jul 5 00:01:06 2006 *************** *** 18,35 **** return str; } switch(str[0]) { ! case 'a': case 'e': case 'i': case 'o': case 'u': ! case 'A': case 'E': case 'I': case 'O': case 'U': return "an " + str; ! default: return "a " + str; } } string remove_article(string str) { string tmp; ! if( !stringp(str) ) error("Bad argument 1 to remove_article().\n"); if( sscanf(str, "the %s", tmp) ) return tmp; if( sscanf(str, "a %s", tmp) ) return tmp; --- 18,35 ---- return str; } switch(str[0]) { ! case 'a': case 'e': case 'i': case 'o': case 'u': ! case 'A': case 'E': case 'I': case 'O': case 'U': return "an " + str; ! default: return "a " + str; } } string remove_article(string str) { string tmp; ! if( !stringp(str) ) error("Bad argument 1 to remove_article().\n"); if( sscanf(str, "the %s", tmp) ) return tmp; if( sscanf(str, "a %s", tmp) ) return tmp; *************** *** 49,377 **** items = explode(list, ","); } items = map(items, function(string str) { ! if( !str ) { ! return 0; ! } ! str = trim(str); ! if( strlen(str) > 4 && str[0..3] == "and " ) { ! str = str[4..]; ! } ! str = remove_article(str); ! if( strlen(str) > 3 && str[0..2] == "my " ) { ! str = str[3..]; ! } ! return str; ! }); ! return filter(items, (: $1 && $1 != "" :)); ! } ! varargs string item_list(mixed array items...) { ! mapping list = ([]); ! string str; ! int maxi; ! ! if( !sizeof(items) ){ ! error("Bad argument 1 to item_list().\n"); ! } ! if( arrayp(items[0]) ) { ! if( !sizeof(items[0]) ) { ! return ""; } ! items = items[0]; ! } ! foreach(mixed value in items) { ! if( objectp(value) ) { ! if( living(value) ) { ! value = value->GetName(); } else { ! value = value->GetShort(); } } ! if( !value ) { ! continue; } ! if( !list[value] ) { ! list[value] = 1; } ! else { ! list[value]++; } - } - maxi = sizeof(items = keys(list)); - if( maxi < 1 ) { - return ""; - } - str = consolidate(list[items[0]], items[0]); - if( maxi == 1 ) { return str; } ! if( maxi > 2 ) { ! str += ","; ! } ! for(int i=1; i<maxi; i++) { ! if( i == maxi-1 ) { ! str += " and "; ! } ! else { ! str += " "; ! } ! str += consolidate(list[items[i]], items[i]); ! if( i < maxi-1 ) { ! str += ","; } } - return str; - } - - string possessive_noun(mixed val) { - if(objectp(val)) val = (string)val->GetName(); - else if(!stringp(val)) error("Bad argument 1 to possessive_noun().\n"); - switch(val[strlen(val)-1]) { - case 'x': case 'z': case 's': return sprintf("%s'", val); - default: return sprintf("%s's", val); - } - } ! string possessive(mixed val) { ! switch(objectp(val) ? (string)val->GetGender() : (string)val) { ! case "male": return "his"; ! case "female": return "her"; ! default: return "its"; } - } ! string strip_article(mixed val) { ! int x; ! if( objectp(val) ) val = (string)val->GetShort(); ! x = strlen(val); ! if( x <= 2 ) return val; ! if( val[0..1] == "a " || val[0..1] == "A " ) return val[2..]; ! if( x <= 3 ) return val; ! if( val[0..2] == "an " || val[0..2] == "An " ) return val[3..]; ! if( x <= 4 ) return val; ! if( val[0..3] == "the " || val[0..3] == "The " ) return val[4..]; ! return val; ! } ! ! string nominative(mixed val) { ! switch(objectp(val) ? (string)val->GetGender() : (string)val) { ! case "male": return "he"; ! case "female": return "she"; ! default: return "it"; } - } ! string objective(mixed val) { ! switch(objectp(val) ? (string)val->GetGender() : (string)val) { ! case "male": return "him"; ! case "female": return "her"; ! default: return "it"; } - } ! string reflexive(mixed val) { return sprintf("%sself", objective(val)); } ! /* #define VOWELS ({"a","e","i","o","u"}) #define ABNORMAL ([ "moose":"moose", "mouse":"mice", "die":"dice", "index":"indices", "human":"humans", "sheep":"sheep", "fish":"fish", "child":"children", "ox":"oxen", "tooth":"teeth", "deer":"deer", "bus":"busses" ]) ! string pluralize(mixed single) { ! int x, i, y, ind; ! string str, tmp, tmp1; ! string *words; ! ! if(objectp(single)) { ! if(str = (string)single->query_plural_name()) return str; ! else str = (string)single->GetKeyName(); ! } ! else if(stringp(single)) str = (string)single; ! else error("Bad argument 1 to pluralize()"); ! if(!str) return str; ! i = sizeof(words = explode(str, " ")); ! if( i > 1 && words[i-1][0] == '(' && words[i-1][1<] == ')' ) ! return pluralize( implode(words[1..(i-2)]), " " ); ! if(words[0] == "a" || words[0] == "an" || words[0] == "the") ! i = sizeof(words = words[1..(i-1)]); ! if((y=member_array("of", words)) > 0 || (y=member_array("Of",words))>0) ! str = words[ind = y-1]; ! else str = words[ind = i-1]; ! x = strlen(str); ! if(ABNORMAL[str]) return ABNORMAL[str]; ! if(x > 2 && str[x-3..x-1] == "man") { ! words[ind] = str[0..x-3]+"en"; ! return implode(words, " "); ! } ! if(x > 1) { ! tmp = str[x-2..x-1]; ! switch(tmp) { ! case "ch": case "sh": ! words[ind] = sprintf("%ses", str); ! return implode(words, " "); ! case "ff": case "fe": ! words[ind] = sprintf("%sves", str[0..x-3]); ! return implode(words, " "); ! case "us": ! words[ind] = sprintf("%si", str[0..x-3]); ! return implode(words, " "); ! case "um": ! words[ind] = sprintf("%sa", str[0..x-3]); ! return implode(words, " "); ! case "ef": ! words[ind] = sprintf("%ss", str); ! return implode(words, " "); ! } ! } ! tmp = str[x-1..x-1]; ! switch(tmp) { ! case "o": case "x": case "s": ! words[ind] = sprintf("%ses", str); ! return implode(words, " "); ! case "f": ! words[ind] = sprintf("%sves", str[0..x-2]); ! return implode(words, " "); ! case "y": ! if(member_array(str[x-2..x-2],VOWELS)!=-1) ! words[ind] = sprintf("%ss",str); ! else ! words[ind] = sprintf("%sies", str[0..x-2]); ! return implode(words, " "); } ! words[ind] = sprintf("%ss", str); ! return implode(words, " "); ! } ! */ ! string cardinal(int x) { ! string tmp; ! int a; ! ! if(!x) return "zero"; ! if(x < 0) { ! tmp = "negative "; ! x = absolute_value(x); ! } ! else tmp = ""; ! switch(x) { ! case 1: return tmp+"one"; ! case 2: return tmp+"two"; ! case 3: return tmp+"three"; ! case 4: return tmp+"four"; ! case 5: return tmp+"five"; ! case 6: return tmp+"six"; ! case 7: return tmp+"seven"; ! case 8: return tmp+"eight"; ! case 9: return tmp+"nine"; ! case 10: return tmp+"ten"; ! case 11: return tmp+"eleven"; ! case 12: return tmp+"twelve"; ! case 13: return tmp+"thirteen"; ! case 14: return tmp+"fourteen"; ! case 15: return tmp+"fifteen"; ! case 16: return tmp+"sixteen"; ! case 17: return tmp+"seventeen"; ! case 18: return tmp+"eighteen"; ! case 19: return tmp+"nineteen"; ! case 20: return tmp+"twenty"; ! default: ! if(x > 1000000000) return "over a billion"; ! else if(a = x /1000000) { ! if(x = x %1000000) ! return sprintf("%s million %s", cardinal(a), cardinal(x)); ! else return sprintf("%s million", cardinal(a)); ! } ! else if(a = x / 1000) { ! if(x = x % 1000) ! return sprintf("%s thousand %s", cardinal(a), cardinal(x)); ! else return sprintf("%s thousand", cardinal(a)); ! } ! else if(a = x / 100) { ! if(x = x % 100) ! return sprintf("%s hundred %s", cardinal(a), cardinal(x)); ! else return sprintf("%s hundred", cardinal(a)); ! } ! else { ! a = x / 10; ! if(x = x % 10) tmp = "-"+cardinal(x); ! else tmp = ""; ! switch(a) { ! case 2: return "twenty"+tmp; ! case 3: return "thirty"+tmp; ! case 4: return "forty"+tmp; ! case 5: return "fifty"+tmp; ! case 6: return "sixty"+tmp; ! case 7: return "seventy"+tmp; ! case 8: return "eighty"+tmp; ! case 9: return "ninety"+tmp; ! default: return "error"; ! } ! } } - } - - varargs string conjunction(mixed expressions, string coordinator) { - int size; - string tmp; ! if(!expressions) error("Bad argument 1 to conjunction().\n"); ! else if(stringp(expressions)) expressions = ({ expressions }); ! else if(!pointerp(expressions)) ! error("Bad argument 1 to conjunction().\n"); ! ! size = sizeof(expressions); ! if(size < 2) return expressions[0]; ! ! // Form the conjunction. ! if(!coordinator) coordinator = "and"; ! tmp = ""; ! for(int i = 0; i < size; i++) { ! tmp += expressions[i]; ! if(i < size - 2) tmp += ", "; ! else return tmp + " " + coordinator + " " + expressions[size - 1]; } - } ! string consolidate(int x, string str) { ! string array words; ! string tmp; ! if( x == 1 || !sizeof(str) ) return str; ! words = explode(str, " "); ! if( sscanf(words[<1], "(%s)", tmp) ) { ! if( sizeof(words) == 1 ) ! return "(" + consolidate(x, tmp) + ")"; ! else return consolidate(x, implode(words[0..<2], " ")) + ! " (" + tmp + ")"; ! } ! if( sscanf(words[<1], "[%s]", tmp) ) { ! if( sizeof(words) == 1 ) ! return "[" + consolidate(x, tmp) + "]"; ! else return consolidate(x, implode(words[0..<2], " ")) + ! " [" + tmp + "]"; ! } ! if( words[0][0..1] == "%^" ) { ! string array parts; ! string part, colour = ""; ! int i = 0; ! ! parts = explode(words[0], "%^"); ! if( sizeof(parts) == 1 ) { ! if( sizeof(words) == 1 ) return words[0]; ! else return words[0] + consolidate(x, implode(words[1..], " ")); ! } ! ! foreach(part in parts) { ! if( sizeof(part) && !sizeof(strip_colours("%^" + part + "%^")) ) ! colour += ("%^" + part + "%^"); ! else return colour + consolidate(x, ! (implode(parts[i..], "%^")) + " " + ! (implode(words[1..], " ")) ); ! i++; ! } ! return words[0] + " " + consolidate(x, implode(words[1..], " ")); ! ! } ! if( member_array(lower_case(strip_colours(words[0])), ! ({"a", "an", "the", "one"}) ) > -1 ) words = words[1..]; ! return (cardinal(x) + " " + pluralize(implode(words, " "))); ! } --- 49,377 ---- items = explode(list, ","); } items = map(items, function(string str) { ! if( !str ) { ! return 0; ! } ! str = trim(str); ! if( strlen(str) > 4 && str[0..3] == "and " ) { ! str = str[4..]; ! } ! str = remove_article(str); ! if( strlen(str) > 3 && str[0..2] == "my " ) { ! str = str[3..]; ! } ! return str; ! }); ! return filter(items, (: $1 && $1 != "" :)); ! } ! ! varargs string item_list(mixed array items...) { ! mapping list = ([]); ! string str; ! int maxi; ! if( !sizeof(items) ){ ! error("Bad argument 1 to item_list().\n"); } ! if( arrayp(items[0]) ) { ! if( !sizeof(items[0]) ) { ! return ""; ! } ! items = items[0]; ! } ! foreach(mixed value in items) { ! if( objectp(value) ) { ! if( living(value) ) { ! value = value->GetName(); ! } ! else { ! value = value->GetShort(); ! } ! } ! if( !value ) { ! continue; ! } ! if( !list[value] ) { ! list[value] = 1; } else { ! list[value]++; } } ! maxi = sizeof(items = keys(list)); ! if( maxi < 1 ) { ! return ""; } ! str = consolidate(list[items[0]], items[0]); ! if( maxi == 1 ) { ! return str; } ! if( maxi > 2 ) { ! str += ","; ! } ! for(int i=1; i<maxi; i++) { ! if( i == maxi-1 ) { ! str += " and "; ! } ! else { ! str += " "; ! } ! str += consolidate(list[items[i]], items[i]); ! if( i < maxi-1 ) { ! str += ","; ! } } return str; } ! ! string possessive_noun(mixed val) { ! if(objectp(val)) val = (string)val->GetName(); ! else if(!stringp(val)) error("Bad argument 1 to possessive_noun().\n"); ! switch(val[strlen(val)-1]) { ! case 'x': case 'z': case 's': return sprintf("%s'", val); ! default: return sprintf("%s's", val); } } ! string possessive(mixed val) { ! switch(objectp(val) ? (string)val->GetGender() : (string)val) { ! case "male": return "his"; ! case "female": return "her"; ! default: return "its"; ! } } ! string strip_article(mixed val) { ! int x; ! if( objectp(val) ) val = (string)val->GetShort(); ! x = strlen(val); ! if( x <= 2 ) return val; ! if( val[0..1] == "a " || val[0..1] == "A " ) return val[2..]; ! if( x <= 3 ) return val; ! if( val[0..2] == "an " || val[0..2] == "An " ) return val[3..]; ! if( x <= 4 ) return val; ! if( val[0..3] == "the " || val[0..3] == "The " ) return val[4..]; ! return val; ! } ! ! string nominative(mixed val) { ! switch(objectp(val) ? (string)val->GetGender() : (string)val) { ! case "male": return "he"; ! case "female": return "she"; ! default: return "it"; ! } } ! string objective(mixed val) { ! switch(objectp(val) ? (string)val->GetGender() : (string)val) { ! case "male": return "him"; ! case "female": return "her"; ! default: return "it"; ! } } ! string reflexive(mixed val) { return sprintf("%sself", objective(val)); } ! /* #define VOWELS ({"a","e","i","o","u"}) #define ABNORMAL ([ "moose":"moose", "mouse":"mice", "die":"dice", "index":"indices", "human":"humans", "sheep":"sheep", "fish":"fish", "child":"children", "ox":"oxen", "tooth":"teeth", "deer":"deer", "bus":"busses" ]) ! string pluralize(mixed single) { ! int x, i, y, ind; ! string str, tmp, tmp1; ! string *words; ! ! if(objectp(single)) { ! if(str = (string)single->query_plural_name()) return str; ! else str = (string)single->GetKeyName(); ! } ! else if(stringp(single)) str = (string)single; ! else error("Bad argument 1 to pluralize()"); ! if(!str) return str; ! i = sizeof(words = explode(str, " ")); ! if( i > 1 && words[i-1][0] == '(' && words[i-1][1<] == ')' ) ! return pluralize( implode(words[1..(i-2)]), " " ); ! if(words[0] == "a" || words[0] == "an" || words[0] == "the") ! i = sizeof(words = words[1..(i-1)]); ! if((y=member_array("of", words)) > 0 || (y=member_array("Of",words))>0) ! str = words[ind = y-1]; ! else str = words[ind = i-1]; ! x = strlen(str); ! if(ABNORMAL[str]) return ABNORMAL[str]; ! if(x > 2 && str[x-3..x-1] == "man") { ! words[ind] = str[0..x-3]+"en"; ! return implode(words, " "); ! } ! if(x > 1) { ! tmp = str[x-2..x-1]; ! switch(tmp) { ! case "ch": case "sh": ! words[ind] = sprintf("%ses", str); ! return implode(words, " "); ! case "ff": case "fe": ! words[ind] = sprintf("%sves", str[0..x-3]); ! return implode(words, " "); ! case "us": ! words[ind] = sprintf("%si", str[0..x-3]); ! return implode(words, " "); ! case "um": ! words[ind] = sprintf("%sa", str[0..x-3]); ! return implode(words, " "); ! case "ef": ! words[ind] = sprintf("%ss", str); ! return implode(words, " "); ! } ! } ! tmp = str[x-1..x-1]; ! switch(tmp) { ! case "o": case "x": case "s": ! words[ind] = sprintf("%ses", str); ! return implode(words, " "); ! case "f": ! words[ind] = sprintf("%sves", str[0..x-2]); ! return implode(words, " "); ! case "y": ! if(member_array(str[x-2..x-2],VOWELS)!=-1) ! words[ind] = sprintf("%ss",str); ! else ! words[ind] = sprintf("%sies", str[0..x-2]); ! return implode(words, " "); ! } ! words[ind] = sprintf("%ss", str); ! return implode(words, " "); } ! */ ! string cardinal(int x) { ! string tmp; ! int a; ! ! if(!x) return "zero"; ! if(x < 0) { ! tmp = "negative "; ! x = absolute_value(x); ! } ! else tmp = ""; ! switch(x) { ! case 1: return tmp+"one"; ! case 2: return tmp+"two"; ! case 3: return tmp+"three"; ! case 4: return tmp+"four"; ! case 5: return tmp+"five"; ! case 6: return tmp+"six"; ! case 7: return tmp+"seven"; ! case 8: return tmp+"eight"; ! case 9: return tmp+"nine"; ! case 10: return tmp+"ten"; ! case 11: return tmp+"eleven"; ! case 12: return tmp+"twelve"; ! case 13: return tmp+"thirteen"; ! case 14: return tmp+"fourteen"; ! case 15: return tmp+"fifteen"; ! case 16: return tmp+"sixteen"; ! case 17: return tmp+"seventeen"; ! case 18: return tmp+"eighteen"; ! case 19: return tmp+"nineteen"; ! case 20: return tmp+"twenty"; ! default: ! if(x > 1000000000) return "over a billion"; ! else if(a = x /1000000) { ! if(x = x %1000000) ! return sprintf("%s million %s", cardinal(a), cardinal(x)); ! else return sprintf("%s million", cardinal(a)); ! } ! else if(a = x / 1000) { ! if(x = x % 1000) ! return sprintf("%s thousand %s", cardinal(a), cardinal(x)); ! else return sprintf("%s thousand", cardinal(a)); ! } ! else if(a = x / 100) { ! if(x = x % 100) ! return sprintf("%s hundred %s", cardinal(a), cardinal(x)); ! else return sprintf("%s hundred", cardinal(a)); ! } ! else { ! a = x / 10; ! if(x = x % 10) tmp = "-"+cardinal(x); ! else tmp = ""; ! switch(a) { ! case 2: return "twenty"+tmp; ! case 3: return "thirty"+tmp; ! case 4: return "forty"+tmp; ! case 5: return "fifty"+tmp; ! case 6: return "sixty"+tmp; ! case 7: return "seventy"+tmp; ! case 8: return "eighty"+tmp; ! case 9: return "ninety"+tmp; ! default: return "error"; ! } ! } ! } } ! varargs string conjunction(mixed expressions, string coordinator) { ! int size; ! string tmp; ! ! if(!expressions) error("Bad argument 1 to conjunction().\n"); ! else if(stringp(expressions)) expressions = ({ expressions }); ! else if(!pointerp(expressions)) ! error("Bad argument 1 to conjunction().\n"); ! ! size = sizeof(expressions); ! if(size < 2) return expressions[0]; ! ! // Form the conjunction. ! if(!coordinator) coordinator = "and"; ! tmp = ""; ! for(int i = 0; i < size; i++) { ! tmp += expressions[i]; ! if(i < size - 2) tmp += ", "; ! else return tmp + " " + coordinator + " " + expressions[size - 1]; ! } } ! string consolidate(int x, string str) { ! string array words; ! string tmp; ! ! if( x == 1 || !sizeof(str) ) return str; ! words = explode(str, " "); ! if( sscanf(words[<1], "(%s)", tmp) ) { ! if( sizeof(words) == 1 ) ! return "(" + consolidate(x, tmp) + ")"; ! else return consolidate(x, implode(words[0..<2], " ")) + ! " (" + tmp + ")"; ! } ! if( sscanf(words[<1], "[%s]", tmp) ) { ! if( sizeof(words) == 1 ) ! return "[" + consolidate(x, tmp) + "]"; ! else return consolidate(x, implode(words[0..<2], " ")) + ! " [" + tmp + "]"; ! } ! if( words[0][0..1] == "%^" ) { ! string array parts; ! string part, colour = ""; ! int i = 0; ! ! parts = explode(words[0], "%^"); ! if( sizeof(parts) == 1 ) { ! if( sizeof(words) == 1 ) return words[0]; ! else return words[0] + consolidate(x, implode(words[1..], " ")); ! } ! foreach(part in parts) { ! if( sizeof(part) && !sizeof(strip_colours("%^" + part + "%^")) ) ! colour += ("%^" + part + "%^"); ! else return colour + consolidate(x, ! (implode(parts[i..], "%^")) + " " + ! (implode(words[1..], " ")) ); ! i++; ! } ! return words[0] + " " + consolidate(x, implode(words[1..], " ")); ! ! } ! if( member_array(lower_case(strip_colours(words[0])), ! ({"a", "an", "the", "one"}) ) > -1 ) words = words[1..]; ! return (cardinal(x) + " " + pluralize(implode(words, " "))); ! } diff -c -r --new-file ds1.1/lib/secure/sefun/events.c ds2.0r27/lib/secure/sefun/events.c *** ds1.1/lib/secure/sefun/events.c Sun Feb 1 21:30:49 1998 --- ds2.0r27/lib/secure/sefun/events.c Wed Jul 5 00:01:06 2006 *************** *** 16,21 **** --- 16,31 ---- EVENTS_D->AddEvent(fn, fn, f, when, args, reg); } + varargs void add_event(string source, string ob, string fun, mixed *args, int when, int repeat){ + if(!archp(this_player())) return; + EVENTS_D->AddEvent(source, ob, fun, args, when, repeat); + } + + varargs void remove_event(int i){ + if(!archp(this_player())) return; + EVENTS_D->RemoveEvent(i); + } + int event_pending(object ob) { mapping tmp; int *cles; diff -c -r --new-file ds1.1/lib/secure/sefun/expand_keys.c ds2.0r27/lib/secure/sefun/expand_keys.c *** ds1.1/lib/secure/sefun/expand_keys.c Sun Feb 1 21:30:49 1998 --- ds2.0r27/lib/secure/sefun/expand_keys.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /secure/sefun/expand_keys.c ! * from the Dead Soulsr2 Object Library * takes a mapping with array keys and flattens the arrays * created by Descartes of Borg 951013 */ --- 1,5 ---- /* /secure/sefun/expand_keys.c ! * from the Dead Souls Object Library * takes a mapping with array keys and flattens the arrays * created by Descartes of Borg 951013 */ diff -c -r --new-file ds1.1/lib/secure/sefun/files.c ds2.0r27/lib/secure/sefun/files.c *** ds1.1/lib/secure/sefun/files.c Sun Feb 1 21:30:49 1998 --- ds2.0r27/lib/secure/sefun/files.c Wed Jul 5 00:01:06 2006 *************** *** 4,13 **** * created by Descartes of Borg 940926 */ ! int file_exists(string str) { return (file_size(str) > -1); } string save_file(string who) { if( !stringp(who) ) error("Bad argument 1 to save_file()."); who = convert_name(who); return (string)master()->player_save_file(who); } --- 4,49 ---- * created by Descartes of Borg 940926 */ ! string gtempname, gfilename; ! ! int file_exists(string str) { ! if(!str) return 0; ! return (file_size(str) > -1); ! } ! ! int directory_exists(string str) { return (file_size(str) == -2); } string save_file(string who) { if( !stringp(who) ) error("Bad argument 1 to save_file()."); who = convert_name(who); return (string)master()->player_save_file(who); } + + int indent_file(string filename){ + + string tempname; + tempname = "/tmp/indent."+time()+".tmp"; + + write_file(tempname,"I\n"); + + gtempname = tempname; + gfilename = filename; + if(!cp(filename,tempname+".dat")){ + write("You don't have read access to "+filename); + return 0; + } + + load_object("/secure/cmds/creators/lsed")->cmd(tempname+" "+tempname+".dat"); + + if(!unguarded((: cp(gtempname+".dat", gfilename) :)) ){ + write("You don't have write access to "+filename); + rm(tempname+".dat"); + rm(tempname); + return 0; + } + + rm(tempname+".dat"); + rm(tempname); + return 1; + } + diff -c -r --new-file ds1.1/lib/secure/sefun/findobs.c ds2.0r27/lib/secure/sefun/findobs.c *** ds1.1/lib/secure/sefun/findobs.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/sefun/findobs.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,59 ---- + #include <lib.h> + private static string source; + + mixed *findobs(mixed arg){ + object target; + object *targets = ({}); + + if(objectp(arg)) target = arg; + if(stringp(arg) ) { + if(grepp(arg,"/")){ + if(!file_exists(arg)) arg += ".c"; + if(!file_exists(arg)) return ({}); + if(!target = find_object(arg)) return ({}); + } + else { + foreach(object ob in objects()){ + if(answers_to(arg,ob)) targets += ({ ob }); + } + } + } + if(target){ + foreach(object ob in objects()){ + if(base_name(ob) == base_name(target)) targets += ({ ob }); + } + } + return targets; + } + + mixed find_inheritors(mixed arg){ + object *targets = ({}); + if(objectp(arg)) source = base_name(arg); + else { + if(!stringp(arg)) return -2; + if(!file_exists(arg)) arg += ".c"; + if(!file_exists(arg)) return -1; + source = truncate(arg,2); + } + //tc("source: "+source); + targets = filter(objects(), (: inherits(source, $1) :) ); + //tc("targetsize: "+sizeof(targets)); + if(sizeof(targets)) return targets; + else return ({}); + } + + mixed find_deep_inheritors(mixed arg){ + object *targets = ({}); + if(objectp(arg)) source = base_name(arg)+".c"; + else { + if(!stringp(arg)) return -2; + if(!file_exists(arg)) arg += ".c"; + if(!file_exists(arg)) return -1; + source = arg; + } + + targets = filter(objects(), (: member_array(source, deep_inherit_list($1)) != -1 :) ); + if(sizeof(targets)) return targets; + else return ({}); + } + diff -c -r --new-file ds1.1/lib/secure/sefun/flat_map.c ds2.0r27/lib/secure/sefun/flat_map.c *** ds1.1/lib/secure/sefun/flat_map.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/sefun/flat_map.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,32 ---- + string flat_map(mapping mp) { + mapping carte = ([]); + mixed key, val; + string retkey, retval, retstring; + + retstring = ""; + + carte = expand_keys(mp); + + foreach( key, val in carte){ + if(arrayp(key)){ + if(!sizeof(key)) retkey = "BLANK ARRAY"; + else retkey = "ARRAY ("+implode(key,", ")+")"; + } + else if(objectp(key)) retkey = "OBJECT ("+file_name(key)+")"; + else if(intp(key)) retkey = ""+key; + else retkey = key; + if(arrayp(val)){ + if(!sizeof(val)) retval = "BLANK ARRAY"; + else retval = "ARRAY ("+implode(val,", ")+")"; + } + else if(objectp(val)) retval = "OBJECT ("+file_name(val)+")"; + else if(intp(val)) retval = ""+val; + else retval = val; + + if(!retstring || retstring == "") retstring = retkey+":"+retval; + else retstring += ", "+retkey+":"+retval; + } + + return retstring; + + } diff -c -r --new-file ds1.1/lib/secure/sefun/format_page.c ds2.0r27/lib/secure/sefun/format_page.c *** ds1.1/lib/secure/sefun/format_page.c Sun Feb 1 21:30:49 1998 --- ds2.0r27/lib/secure/sefun/format_page.c Wed Jul 5 00:01:06 2006 *************** *** 8,18 **** else width = 75; width = width/columns; for(i=0, x = sizeof(items); i<x; i+=columns) { ! for(j=0; j<columns; j++) { ! if(i+j >= x) break; ! ret += arrange_string(items[i+j], width); ! } ! ret += "\n"; } return ret; } --- 8,18 ---- else width = 75; width = width/columns; for(i=0, x = sizeof(items); i<x; i+=columns) { ! for(j=0; j<columns; j++) { ! if(i+j >= x) break; ! ret += arrange_string(items[i+j], width); ! } ! ret += "\n"; } return ret; } diff -c -r --new-file ds1.1/lib/secure/sefun/generic.c ds2.0r27/lib/secure/sefun/generic.c *** ds1.1/lib/secure/sefun/generic.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/sefun/generic.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,7 ---- + int true(){ + return 1; + } + + int false(){ + return 0; + } diff -c -r --new-file ds1.1/lib/secure/sefun/get_cmds.c ds2.0r27/lib/secure/sefun/get_cmds.c *** ds1.1/lib/secure/sefun/get_cmds.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/sefun/get_cmds.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,39 ---- + /* /secure/sefun/get_cmds.c + * returns an array of available commands + * Created by Cratylus 23JAN2005 + * Version: @(#) get_cmds.c 1.1@(#) + * Last modified: 2005/01/23 + */ + + string *get_cmds(){ + int i; + string str; + string *temparr,*cmds,*NULL; + + NULL = ({ "irony" }); + + if(!get_dir("/cmds/")) return NULL; + + foreach(str in get_dir("/cmds/")) + { + temparr=get_dir("/cmds/"+str+"/*.c"); + for(i=0;i<sizeof(temparr);i++){ + //write(temparr[i]); + if(temparr[i] && !sizeof(cmds)) cmds = ({temparr[i]}); + if(temparr[i] && sizeof(cmds) > 0) cmds += ({temparr[i]}); + } + } + + foreach(str in get_dir("/secure/cmds/")) + { + temparr=get_dir("/secure/cmds/"+str+"/*.c"); + for(i=0;i<sizeof(temparr);i++){ + //write(temparr[i]); + if(temparr[i] && !sizeof(cmds)) cmds = ({temparr[i]}); + if(temparr[i] && sizeof(cmds) > 0) cmds += ({temparr[i]}); + } + } + + return cmds; + + } diff -c -r --new-file ds1.1/lib/secure/sefun/get_livings.c ds2.0r27/lib/secure/sefun/get_livings.c *** ds1.1/lib/secure/sefun/get_livings.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/sefun/get_livings.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,61 ---- + /* /secure/sefun/get_livings.c + * From the Frontiers LPC Library + * an ugly hack to return an array of living things. + * Give it an integer argument to return interactives only + * Created by Cratylus 23JAN2005 + * Version: @(#) getlivings.c 1.1@(#) + */ + + varargs object array get_livings(object ob,int foo){ + object *stuff,*lstuff,*istuff; + int i; + if(!ob) return ({}); + stuff=all_inventory(ob); + lstuff = ({}); + for(i=0;i<sizeof(stuff);i++){ + if(living(stuff[i]) && !sizeof(lstuff)) lstuff = ({stuff[i]}); + if(living(stuff[i]) && sizeof(lstuff) > 0 && + member_array(stuff[i],lstuff) == -1) lstuff += ({stuff[i]}); + } + + if(foo == 1){ + istuff=({}); + for(i=0;i<sizeof(lstuff);i++){ + if( interactive(lstuff[i]) && !sizeof(istuff) ) istuff = ({lstuff[i]}); + if( interactive(lstuff[i]) && sizeof(istuff)> 0 && + member_array(lstuff[i],istuff) == -1) istuff+= ({lstuff[i]}); + } + if(sizeof(istuff) > 0) return istuff; + if(!sizeof(istuff)) return 0; + } + + if(foo == 2){ + istuff=({}); + for(i=0;i<sizeof(lstuff);i++){ + if( !interactive(lstuff[i]) && !sizeof(istuff) ) istuff = ({lstuff[i]}); + if( !interactive(lstuff[i]) && sizeof(istuff)> 0 && + member_array(lstuff[i],istuff) == -1) istuff+= ({lstuff[i]}); + } + if(sizeof(istuff) > 0) return istuff; + if(!sizeof(istuff)) return 0; + } + + if(sizeof(lstuff) > 0) return lstuff; + if(!sizeof(lstuff)) return 0; + } + + varargs object get_random_living(object room, int foo){ + object *livings; + + if(!foo) foo = 0; + + livings = get_livings(room, foo); + foo = random(sizeof(livings)); + + return livings[foo]; + } + + + + + diff -c -r --new-file ds1.1/lib/secure/sefun/get_object.c ds2.0r27/lib/secure/sefun/get_object.c *** ds1.1/lib/secure/sefun/get_object.c Sun Feb 1 21:30:49 1998 --- ds2.0r27/lib/secure/sefun/get_object.c Wed Jul 5 00:01:06 2006 *************** *** 22,77 **** varargs object get_object( string str, object player ) { ! object what; ! mixed tmp; ! // Prevent wizards finding things they shouldn't. ! if( !str ) return 0; ! if( !player || !living( player ) ) player = this_player(); ! if( sscanf( str, "@%s", tmp ) && ! ( tmp = get_object( tmp, player ) ) && ! ( what = environment( tmp ) ) ) ! return what; ! if( player ) // Check existance of this_player() ! { ! if( str == "me" ) return player; ! if( what = present( str, player ) ) return what; // Inventory check ! if( what = environment( player ) ) // Environment check { ! if (str == "here" || str == "env" || str == "environment") ! return what; ! if( what = present( str, what ) ) return what; } - } - - // Call might be made by a room so make a previous_object() check - // first just to be sure - - if( what = present( str, previous_object() ) ) return what; - - // Check to see if a living object matches the name - - if( what = find_player( str ) ) return what; - if( what = find_living( str ) ) return what; - - // Search for a matching file_name, completing path with - // user's present path - - if( player ) - { - // this option removed because Dead Souls doesn't support cwf - // if( str == "cwf" ) str = (string)player-> query( "cwf" ); - str = absolute_path( (string)player-> get_path(), str ); - } - - // Make sure the object is loaded into memory, if it exists - - catch( call_other( str, "???" ) ); - - // Finally return any object found matching the requested name ! return find_object( str ); } // Created by Pallando@Tabor (93-03-02) --- 22,77 ---- varargs object get_object( string str, object player ) { ! object what; ! mixed tmp; ! // Prevent wizards finding things they shouldn't. ! if( !str ) return 0; ! if( !player || !living( player ) ) player = this_player(); ! if( sscanf( str, "@%s", tmp ) && ! ( tmp = get_object( tmp, player ) ) && ! ( what = environment( tmp ) ) ) ! return what; ! if( player ) // Check existance of this_player() { ! if( str == "me" ) return player; ! if( what = present( str, player ) ) return what; // Inventory check ! if( what = environment( player ) ) // Environment check ! { ! if (str == "here" || str == "env" || str == "environment") ! return what; ! if( what = present( str, what ) ) return what; ! } } ! // Call might be made by a room so make a previous_object() check ! // first just to be sure ! ! if( what = present( str, previous_object() ) ) return what; ! ! // Check to see if a living object matches the name ! ! if( what = find_player( str ) ) return what; ! if( what = find_living( str ) ) return what; ! ! // Search for a matching file_name, completing path with ! // user's present path ! ! if( player ) ! { ! // this option removed because Dead Souls doesn't support cwf ! // if( str == "cwf" ) str = (string)player-> query( "cwf" ); ! str = absolute_path( (string)player-> get_path(), str ); ! } ! ! // Make sure the object is loaded into memory, if it exists ! ! catch( call_other( str, "???" ) ); ! ! // Finally return any object found matching the requested name ! ! return find_object( str ); } // Created by Pallando@Tabor (93-03-02) *************** *** 89,153 **** // "users:e:guard" - searches the environments of all users for a guard. varargs mixed get_objects( string str, object player, int no_arr ) { ! mixed base, tmp, ret; ! object what; ! int i, s; ! // Hmm. i and s do several jobs here. It would be clearer to use different ! // variables (with longer names) for each job. ! // Is it worth slowing the function (using more memory) to do this? ! ! ! if( !str ) return 0; ! s = strlen( str ); ! i = s; ! while( i-- && ( str[i..i] != ":" ) ); // a reverse sscanf ! if( ( i > 0 ) && ( i < ( s - 1 ) ) ) // of form "%s:%s" ! { ! base = get_objects( str[0..(i-1)], player ); ! str = str[(i+1)..s]; ! if( !base ) return 0; ! if( !pointerp( base ) ) base = ({ base }); ! s = sizeof( base ); ! ret = ({ }); ! if( str == "e" ) { ! while( s-- ) ! if( tmp = environment( base[s] ) ) ! ret += ({ tmp }); ! } else if( str == "i" ) { ! while( s-- ) ! if( tmp = all_inventory( base[s] ) ) ! ret += ( pointerp( tmp ) ? tmp : ({ tmp }) ); ! } else if( str == "d" ) { ! while( s-- ) ! if( tmp = deep_inventory( base[s] ) ) ! ret += ( pointerp( tmp ) ? tmp : ({ tmp }) ); ! } else if( sscanf( str, "%d", i ) ) { ! if( ( i > -1 ) && ( i < s ) ) return base[i]; ! else return 0; ! } else { ! // This is the location to add more syntax options if wanted such as ! // ith item in jth base object, all such items in all base objects, etc ! while( s-- ) ! if( what = present( str, base[s] ) ) ! return what; ! return 0; } ! switch( sizeof( ret ) ) { ! case 0: return 0; ! case 1: return ret[0]; } ! return( no_arr ? ret[0] : ret ); ! } ! if( str == "users" ) ! { ! ret = users(); ! if( !no_arr ) return ret; ! if( sizeof( ret ) ) return ret[0]; ! return 0; ! } ! return get_object( str, player ); } /* --- 89,153 ---- // "users:e:guard" - searches the environments of all users for a guard. varargs mixed get_objects( string str, object player, int no_arr ) { ! mixed base, tmp, ret; ! object what; ! int i, s; ! // Hmm. i and s do several jobs here. It would be clearer to use different ! // variables (with longer names) for each job. ! // Is it worth slowing the function (using more memory) to do this? ! ! ! if( !str ) return 0; ! s = strlen( str ); ! i = s; ! while( i-- && ( str[i..i] != ":" ) ); // a reverse sscanf ! if( ( i > 0 ) && ( i < ( s - 1 ) ) ) // of form "%s:%s" { ! base = get_objects( str[0..(i-1)], player ); ! str = str[(i+1)..s]; ! if( !base ) return 0; ! if( !pointerp( base ) ) base = ({ base }); ! s = sizeof( base ); ! ret = ({ }); ! if( str == "e" ) ! { ! while( s-- ) ! if( tmp = environment( base[s] ) ) ! ret += ({ tmp }); ! } else if( str == "i" ) { ! while( s-- ) ! if( tmp = all_inventory( base[s] ) ) ! ret += ( pointerp( tmp ) ? tmp : ({ tmp }) ); ! } else if( str == "d" ) { ! while( s-- ) ! if( tmp = deep_inventory( base[s] ) ) ! ret += ( pointerp( tmp ) ? tmp : ({ tmp }) ); ! } else if( sscanf( str, "%d", i ) ) { ! if( ( i > -1 ) && ( i < s ) ) return base[i]; ! else return 0; ! } else { ! // This is the location to add more syntax options if wanted such as ! // ith item in jth base object, all such items in all base objects, etc ! while( s-- ) ! if( what = present( str, base[s] ) ) ! return what; ! return 0; ! } ! switch( sizeof( ret ) ) ! { ! case 0: return 0; ! case 1: return ret[0]; ! } ! return( no_arr ? ret[0] : ret ); } ! if( str == "users" ) { ! ret = users(); ! if( !no_arr ) return ret; ! if( sizeof( ret ) ) return ret[0]; ! return 0; } ! return get_object( str, player ); } /* diff -c -r --new-file ds1.1/lib/secure/sefun/get_stack.c ds2.0r27/lib/secure/sefun/get_stack.c *** ds1.1/lib/secure/sefun/get_stack.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/sefun/get_stack.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,8 ---- + string get_stack() { + string *stack; + string list; + stack = call_stack(2); + list = implode(stack," "); + return list; + } + diff -c -r --new-file ds1.1/lib/secure/sefun/get_verbs.c ds2.0r27/lib/secure/sefun/get_verbs.c *** ds1.1/lib/secure/sefun/get_verbs.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/sefun/get_verbs.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,25 ---- + /* /secure/sefun/get_verbs.c + * returns an array of available verbs + * Created by Cratylus 23JAN2005 + * Version: @(#) get_verbs.c 1.1@(#) + * Last modified: 2005/01/23 + */ + + string *get_verbs(){ + int i; + string str; + string *temparr,*verbs; + + foreach(str in get_dir("/verbs/")) + { + temparr=get_dir("/verbs/"+str+"/*.c"); + for(i=0;i<sizeof(temparr);i++){ + //write(temparr[i]); + if(temparr[i] && !sizeof(verbs)) verbs = ({temparr[i]}); + if(temparr[i] && sizeof(verbs) > 0) verbs += ({temparr[i]}); + } + } + return verbs; + + } + diff -c -r --new-file ds1.1/lib/secure/sefun/identify.c ds2.0r27/lib/secure/sefun/identify.c *** ds1.1/lib/secure/sefun/identify.c Sun Feb 1 21:30:49 1998 --- ds2.0r27/lib/secure/sefun/identify.c Wed Jul 5 00:01:06 2006 *************** *** 7,60 **** string identify( mixed a ) { ! int i, s; ! string ret; ! mapping RealMap; ! if( undefinedp( a ) ) return "UNDEFINED"; ! if( nullp( a ) ) return "0"; ! if( intp( a ) ) return "" + a; ! if( floatp( a ) ) return "" + a; ! if( objectp( a ) ) ! { ! if( ret = a-> GetKeyName() ) ret += " "; ! else ret = ""; ! return "OBJ(" + ret + file_name( a ) + ")"; ! } ! if( stringp( a ) ) ! { ! a = replace_string( a, "\"", "\\\"" ); ! a = "\"" + a + "\""; ! a = replace_string( a, "\\", "\\\\" ); ! a = replace_string( a, "\\\"", "\"" ); ! a = replace_string( a, "\n", "\\n" ); ! a = replace_string( a, "\t", "\\t" ); ! return a; ! } ! if( pointerp( a ) ) ! { ! ret = "({ "; ! s = sizeof( a ); ! for( i = 0 ; i < s ; i++ ) { ! if( i ) ret += ", "; ! ret += identify( a[i] ); } ! return ret + ( s ? " " : "" ) + "})"; ! } ! if( mapp( a ) ) ! { ! ret = "([ "; ! RealMap = (mapping)(a); ! a = keys( RealMap ); ! s = sizeof( a ); ! for( i = 0 ; i < s ; i++ ) { ! if( i ) ret += ", "; ! ret += identify( a[i] ) + " : " + identify( RealMap[a[i]] ); } - return ret + ( s ? " " : "" ) + "])"; - } if(functionp(a)) return sprintf("%O", a); ! return "UNKNOWN"; } --- 7,60 ---- string identify( mixed a ) { ! int i, s; ! string ret; ! mapping RealMap; ! if( undefinedp( a ) ) return "UNDEFINED"; ! if( nullp( a ) ) return "0"; ! if( intp( a ) ) return "" + a; ! if( floatp( a ) ) return "" + a; ! if( objectp( a ) ) { ! if( ret = a-> GetKeyName() ) ret += " "; ! else ret = ""; ! return "OBJ(" + ret + file_name( a ) + ")"; } ! if( stringp( a ) ) { ! a = replace_string( a, "\"", "\\\"" ); ! a = "\"" + a + "\""; ! a = replace_string( a, "\\", "\\\\" ); ! a = replace_string( a, "\\\"", "\"" ); ! a = replace_string( a, "\n", "\\n" ); ! a = replace_string( a, "\t", "\\t" ); ! return a; ! } ! if( pointerp( a ) ) ! { ! ret = "({ "; ! s = sizeof( a ); ! for( i = 0 ; i < s ; i++ ) ! { ! if( i ) ret += ", "; ! ret += identify( a[i] ); ! } ! return ret + ( s ? " " : "" ) + "})"; ! } ! if( mapp( a ) ) ! { ! ret = "([ "; ! RealMap = (mapping)(a); ! a = keys( RealMap ); ! s = sizeof( a ); ! for( i = 0 ; i < s ; i++ ) ! { ! if( i ) ret += ", "; ! ret += identify( a[i] ) + " : " + identify( RealMap[a[i]] ); ! } ! return ret + ( s ? " " : "" ) + "])"; } if(functionp(a)) return sprintf("%O", a); ! return "UNKNOWN"; } diff -c -r --new-file ds1.1/lib/secure/sefun/legacy.c ds2.0r27/lib/secure/sefun/legacy.c *** ds1.1/lib/secure/sefun/legacy.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/sefun/legacy.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,25 ---- + #include <rooms.h> + #include <daemons.h> + + void set(mixed arg1, mixed arg2){ + arg1 = capitalize(arg1); + call_other( previous_object(), ({ "Set"+arg1, arg2 }) ); + return; + } + + void query(mixed arg1, mixed arg2){ + arg1 = capitalize(arg1); + call_other( previous_object(), ({ "Get"+arg1, arg2 }) ); + return; + } + + void personal_log(string str){ + tell_room(ROOM_ARCH,str); + return; + } + + void add_sky_event(function f){ + SEASONS_D->AddTimeEvent("night", f); + } + + diff -c -r --new-file ds1.1/lib/secure/sefun/light.c ds2.0r27/lib/secure/sefun/light.c *** ds1.1/lib/secure/sefun/light.c Sun Feb 1 21:30:49 1998 --- ds2.0r27/lib/secure/sefun/light.c Wed Jul 5 00:01:06 2006 *************** *** 11,20 **** int i, x; if( !ob ) ob = previous_object(); - if( creatorp(ob) || newbiep(ob) ) return 1; x = total_light(ob) + (int)ob->GetSightBonus(); i = sizeof(inv = all_inventory(ob)); ! while(i--) x += (int)inv[i]->GetProperty("light"); return x; } --- 11,19 ---- int i, x; if( !ob ) ob = previous_object(); x = total_light(ob) + (int)ob->GetSightBonus(); i = sizeof(inv = all_inventory(ob)); ! while(i--) x += (int)inv[i]->GetRadiantLight(); return x; } *************** *** 26,42 **** if( !ob ) ob = previous_object(); if( !(env = environment(ob)) ) return 0; i = sizeof(inv = all_inventory(env)); ! x = (int)env->GetProperty("light"); ! while(i--) x += (int)inv[i]->GetProperty("light"); ! if( (int)env->GetProperty("indoors") ) return x; switch((string)SEASONS_D->query_time_of_day()) { ! case "day": return x; ! case "night": ! x += (int)SEASONS_D->GetMoonLight(); ! x += (int)env->GetProperty("night light") - 4; ! return x; ! case "dawn": case "twilight": return (x-1); ! default: return x; } } --- 25,41 ---- if( !ob ) ob = previous_object(); if( !(env = environment(ob)) ) return 0; i = sizeof(inv = all_inventory(env)); ! x = (int)env->GetAmbientLight(); ! x += ob->GetRadiantLight(); ! while(i--) x += (int)inv[i]->GetRadiantLight(); ! if( env->GetClimate() == "indoors" ) return x; switch((string)SEASONS_D->query_time_of_day()) { ! case "day": return x; ! case "night": ! x += (int)SEASONS_D->GetMoonLight(); ! return x; ! case "dawn": case "twilight": return (x-1); ! default: return x; } } *************** *** 49,51 **** --- 48,65 ---- else if( x > 3 || x < 0 ) return 1; else return 2; } + + mixed check_light(object who) { + int light; + if(!who) who = this_player(); + if( (light = who->GetEffectiveVision()) < 3 ) { + return "It's too dark to see."; + } + else if( light > 6 ) { + return "It's too bright to see."; + } + else { + return 1; + } + } + diff -c -r --new-file ds1.1/lib/secure/sefun/load_object.c ds2.0r27/lib/secure/sefun/load_object.c *** ds1.1/lib/secure/sefun/load_object.c Sun Feb 1 21:30:49 1998 --- ds2.0r27/lib/secure/sefun/load_object.c Wed Jul 5 00:01:06 2006 *************** *** 4,14 **** * created by Descartes of Borg 940213 */ object load_object(string str) { object ob; ! if(!stringp(str)) error("Bad argument 1 to load_object().\n"); if(ob = find_object(str)) return ob; catch(call_other(str, "???")); return find_object(str); } --- 4,57 ---- * created by Descartes of Borg 940213 */ + object global_load_ob; + object load_object(string str) { object ob; ! if(!str) return 0; if(!stringp(str)) error("Bad argument 1 to load_object().\n"); if(ob = find_object(str)) return ob; catch(call_other(str, "???")); return find_object(str); } + + int update(string file){ + object ob; + + //tc("previous obs: "+identify(previous_object(-1)),"red"); + if(!file_exists(file)) file += ".c"; + if(!file_exists(file)) return 1; + //tc("file: "+file); + if(last(file,2) == ".c") file = truncate(file,2); + //tc("file: "+file); + if(ob = find_object(file)) { + global_load_ob = ob; + //tc("ob = find_object(file) is true. about to dest file."); + unguarded( (: global_load_ob->eventDestruct() :) ); + } + if(find_object(file)) { + //tc("hmmm1. it's still there. let's try to destruct it again."); + if(find_object(file)) destruct(ob); + } + if(find_object(file)) { + //tc("hmmm2, wtf. ok let's try to reap it"); + if(find_object(file)) reap_other(); + } + if(find_object(file)) { + //tc("hmmm3, well i dont get it. we're gonna give up destroying it."); + return 2; + } + //tc("ok so it's destroyed. now let's load it."); + catch(call_other(file, "???")); + if(!find_object(file)) { + //tc("the call_other didn't load it. odd. let's try the load_object sefun"); + load_object(file); + } + if(!find_object(file)) { + //tc("erm....wtf. it's still not loaded. fuck this."); + return 3; + } + //tc("success!!","green"); + return 4; + } + diff -c -r --new-file ds1.1/lib/secure/sefun/local_time.c ds2.0r27/lib/secure/sefun/local_time.c *** ds1.1/lib/secure/sefun/local_time.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/sefun/local_time.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,76 ---- + /* This file cleane dup by Jonez, + * 21Mar06 + */ + + #include <lib.h> + #include <privs.h> + #include <config.h> + #include <daemons.h> + + string tz; + + string query_tz(){ + string zone; + if (file_size("/cfg/timezone.cfg") > 0) + zone = read_file("/cfg/timezone.cfg")[0..2]; + if (!zone) zone = "GMT"; + return zone; + } + + mixed local_ctime(int i){ + return ctime(i + ((TIME_D->GetOffset(query_tz()) ) * 3600)); + } + + mixed local_time(mixed val){ + string *zonearray; + string tzone,l_time, os; + int timediff,offset; + + os = query_os_type(); + + if(stringp(val)) { + tzone = upper_case(val); + zonearray = explode(read_file("/cfg/timezones.cfg"),"\n"); + if(member_array(tzone,zonearray) == -1) tzone = query_tz(); + if(!tzone || tzone == "") tzone = query_tz(); + offset = TIME_D-> GetOffset(tzone); + offset += EXTRA_TIME_OFFSET; + timediff = offset * 3600; + if(os != "windows") l_time=ctime(time() + timediff); + else l_time=ctime(time()); + return l_time; + } + if(intp(val)){ + mixed *stuff; + offset = TIME_D-> GetOffset(query_tz()); + offset *= 3600; + stuff = localtime(time()+offset); + stuff[9] = query_tz(); + return stuff; + } + + } + + int valid_timezone(string str){ + string *zonearray; + if(!str || str == "") return 0; + str = upper_case(str)[0..2]; + zonearray = explode(read_file("/cfg/timezones.cfg"),"\n"); + zonearray += ({""}); + if(member_array(str,zonearray) == -1) { + return 0; + } + else return 1; + } + + string set_tz(string str){ + if(!str) str = ""; + if( str != "" && !valid_timezone(str)) { + return "Invalid time zone."; + } + tz = str; + if( !((int)master()->valid_apply(({ "PRIV_ASSIST", "PRIV_SECURE" }))) ) + error("Illegal attempt to modify timezone: "+get_stack()+" "+identify(previous_object(-1))); + unguarded( (: write_file("/cfg/timezone.cfg",tz,1) :) ); + return "Mud time zone is now "+read_file("/cfg/timezone.cfg"); + } diff -c -r --new-file ds1.1/lib/secure/sefun/log_file.c ds2.0r27/lib/secure/sefun/log_file.c *** ds1.1/lib/secure/sefun/log_file.c Sun Feb 1 21:30:50 1998 --- ds2.0r27/lib/secure/sefun/log_file.c Wed Jul 5 00:01:06 2006 *************** *** 12,20 **** if(!stringp(msg)) msg = identify(msg); if(strsrch(fl, "..") != -1) error("Illegal file reference.\n"); if(userp(previous_object(0)) || previous_object(0) == master()) ! fl = DIR_LOGS + "/" + fl; else if((int)master()->valid_apply(({ PRIV_CMDS, PRIV_MUDLIB }))) ! fl = DIR_LOGS+"/"+fl; else if(member_array(PRIV_SECURE,explode(query_privs(previous_object()),":")) != -1) fl = DIR_LOGS+"/"+fl; else fl = DIR_LOGS+"/open/"+fl; --- 12,20 ---- if(!stringp(msg)) msg = identify(msg); if(strsrch(fl, "..") != -1) error("Illegal file reference.\n"); if(userp(previous_object(0)) || previous_object(0) == master()) ! fl = DIR_LOGS + "/" + fl; else if((int)master()->valid_apply(({ PRIV_CMDS, PRIV_MUDLIB }))) ! fl = DIR_LOGS+"/"+fl; else if(member_array(PRIV_SECURE,explode(query_privs(previous_object()),":")) != -1) fl = DIR_LOGS+"/"+fl; else fl = DIR_LOGS+"/open/"+fl; diff -c -r --new-file ds1.1/lib/secure/sefun/make_workroom.c ds2.0r27/lib/secure/sefun/make_workroom.c *** ds1.1/lib/secure/sefun/make_workroom.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/sefun/make_workroom.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,59 ---- + string nom; + + int make_workroom(mixed dude) { + string cdir, tdir, dir_line; + + if(!dude) return 0; + + if(objectp(dude) && !nom = dude->GetKeyName()) return 3; + if(stringp(dude) && !nom = lower_case(dude)) return 2; + + if(unguarded( (: file_size("/realms/template/") :) ) == -1) return 4; + + if(unguarded( (: file_size("/realms/"+nom) :) ) == -1){ + cdir = "/realms/"+nom; + tdir = "/realms/template/"; + dir_line = "#define MY_DIR \"/realms/"+nom+"\""; + mkdir(cdir); + mkdir(cdir+"/cmds"); + mkdir(cdir+"/log"); + mkdir(cdir+"/bak"); + mkdir(cdir+"/tmp"); + mkdir(cdir+"/area"); + mkdir(cdir+"/area/room"); + mkdir(cdir+"/area/weap"); + mkdir(cdir+"/area/obj"); + mkdir(cdir+"/area/npc"); + mkdir(cdir+"/area/armor"); + mkdir(cdir+"/area/etc"); + mkdir(cdir+"/area/doors"); + mkdir(cdir+"/area/meals"); + cp(tdir+"workroom.c", cdir+"/workroom.c"); + cp(tdir+"workroom.bak", cdir+"/workroom.bak"); + cp(tdir+"bak/workroom.orig", cdir+"/bak/workroom.orig"); + cp(tdir+"bak/bk.db", cdir+"/bak/bk.db"); + cp(tdir+"plan", cdir+"/.plan"); + cp(tdir+"profile", cdir+"/.profile"); + cp(tdir+"cmds/custom.c", cdir+"/cmds/custom.c"); + cp(tdir+"customdefs.part1", cdir+"/customdefs.h"); + write_file(cdir+"/customdefs.h","\n"+dir_line+"\n"); + write_file(cdir+"/customdefs.h",read_file(tdir+"customdefs.part2")); + cp(tdir+"area/room/sample_room.c", cdir+"/area/room/sample_room.c"); + cp(tdir+"area/room/sample_two.c", cdir+"/area/room/sample_two.c"); + cp(tdir+"area/weap/sword.c", cdir+"/area/weap/sword.c"); + cp(tdir+"area/obj/table.c", cdir+"/area/obj/table.c"); + cp(tdir+"area/obj/key.c", cdir+"/area/obj/key.c"); + cp(tdir+"area/obj/case.c", cdir+"/area/obj/case.c"); + cp(tdir+"area/obj/watch.c", cdir+"/area/obj/watch.c"); + cp(tdir+"area/npc/fighter.c", cdir+"/area/npc/fighter.c"); + cp(tdir+"area/armor/chainmail.c", cdir+"/area/armor/chainmail.c"); + cp(tdir+"area/armor/leather_boot_r.c", cdir+"/area/armor/leather_boot_r.c"); + cp(tdir+"area/armor/leather_boot_l.c", cdir+"/area/armor/leather_boot_l.c"); + return 1; + } + + else { + //write("That person already has a homedir."); + return 5; + } + } diff -c -r --new-file ds1.1/lib/secure/sefun/mappings.c ds2.0r27/lib/secure/sefun/mappings.c *** ds1.1/lib/secure/sefun/mappings.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/sefun/mappings.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,80 ---- + string flat_map(mapping mp) { + mapping carte = ([]); + mixed key, val; + string retkey, retval, retstring; + + retstring = ""; + + carte = expand_keys(mp); + + foreach( key, val in carte){ + if(arrayp(key)){ + if(!sizeof(key)) retkey = "BLANK ARRAY"; + else retkey = "ARRAY ("+implode(key,", ")+")"; + } + else if(objectp(key)) retkey = "OBJECT ("+file_name(key)+")"; + else if(intp(key)) retkey = ""+key; + else retkey = key; + if(arrayp(val)){ + if(!sizeof(val)) retval = "BLANK ARRAY"; + else retval = "ARRAY ("+implode(val,", ")+")"; + } + else if(objectp(val)) retval = "OBJECT ("+file_name(val)+")"; + else if(intp(val)) retval = ""+val; + else retval = val; + + if(!retstring || retstring == "") retstring = retkey+":"+retval; + else retstring += ", "+retkey+":"+retval; + } + + return retstring; + + } + + varargs mapping add_maps(mapping FirstMapping,mapping SecondMapping, int preference){ + mapping OutMap = ([]); + mapping FirstMap = copy(FirstMapping); + mapping SecondMap = copy(SecondMapping); + mixed *schluessel1 = ({}); + mixed *schluessel2 = ({}); + + if(!SecondMap) SecondMap = ([]); + + schluessel1 = keys(FirstMap); + schluessel2 = keys(SecondMap); + + if(!preference) preference = 0; + + if(sizeof(schluessel1)) + foreach(mixed element in schluessel1){ + OutMap[element] = copy(FirstMap[element]); + } + + if(sizeof(schluessel2)) + foreach(mixed element in schluessel2){ + if(member_array(element,schluessel1) != -1 && preference == 1) + OutMap[element] = copy(FirstMap[element]); + else OutMap[element] = copy(SecondMap[element]); + } + + return OutMap; + } + + int mgrepp(string primary, string *sub){ + foreach(string element in sub){ + if(strsrch(primary,element) != -1) return 0; + } + return 1; + } + + mixed mapping_member(mapping Map, string sub){ + foreach(mixed key, mixed val in Map){ + if(stringp(key) && key == sub) return key; + else if(arrayp(key) && member_array(sub, key) != -1) return key; + } + return 0; + } + + + + diff -c -r --new-file ds1.1/lib/secure/sefun/messaging.c ds2.0r27/lib/secure/sefun/messaging.c *** ds1.1/lib/secure/sefun/messaging.c Sun Feb 1 21:30:47 1998 --- ds2.0r27/lib/secure/sefun/messaging.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /secure/sefun/messaging.c ! * From the Dead Souls V Object Library * Messaging efuns, based on ideas shamelessly borrowed from Lima * Created by Descartes of Borg 961029 * Version: @(#) messaging.c 1.10@(#) --- 1,5 ---- /* /secure/sefun/messaging.c ! * From the Dead Souls Object Library * Messaging efuns, based on ideas shamelessly borrowed from Lima * Created by Descartes of Borg 961029 * Version: @(#) messaging.c 1.10@(#) *************** *** 9,27 **** #include <pov.h> string create_message(int pov, string array verb, string message, ! string subject, string subject_gen, string targets, ! string target_gen, mapping special) { string array words = explode(message, " "); string array control = copy(words); int i, maxi = sizeof(words); int verb_count = 0; int c; ! switch(pov) { case POV_SUBJECT: for(i=0; i<maxi; i++) { string punctuation = ""; ! if( words[i] == "" ) { continue; } --- 9,27 ---- #include <pov.h> string create_message(int pov, string array verb, string message, ! string subject, string subject_gen, string targets, ! string target_gen, mapping special) { string array words = explode(message, " "); string array control = copy(words); int i, maxi = sizeof(words); int verb_count = 0; int c; ! switch(pov) { case POV_SUBJECT: for(i=0; i<maxi; i++) { string punctuation = ""; ! if( words[i] == "" ) { continue; } *************** *** 52,58 **** case "$agent_verb": words[i] = verb[verb_count++]; break; ! case "$agent_name": case "$agent_nominative": case "$agent_objective": words[i] = "you"; --- 52,58 ---- case "$agent_verb": words[i] = verb[verb_count++]; break; ! case "$agent_name": case "$agent_nominative": case "$agent_objective": words[i] = "you"; *************** *** 61,67 **** case "$agent_possessive_noun": words[i] = "your"; break; ! case "$agent_possessive": words[i] = "your"; break; --- 61,67 ---- case "$agent_possessive_noun": words[i] = "your"; break; ! case "$agent_possessive": words[i] = "your"; break; *************** *** 84,90 **** } verb_count++; break; ! case "$target_name": if( subject == targets ) { // subject? object? if( i == 0 ) { // certainly subject --- 84,90 ---- } verb_count++; break; ! case "$target_name": if( subject == targets ) { // subject? object? if( i == 0 ) { // certainly subject *************** *** 107,113 **** words[i] = targets; } break; ! case "$target_nominative": if( subject == targets ) { words[i] = "you"; --- 107,113 ---- words[i] = targets; } break; ! case "$target_nominative": if( subject == targets ) { words[i] = "you"; *************** *** 124,130 **** } } break; ! case "$target_objective": if( subject == targets ) { words[i] = "yourself"; --- 124,130 ---- } } break; ! case "$target_objective": if( subject == targets ) { words[i] = "yourself"; *************** *** 141,147 **** } } break; ! case "$target_possessive_noun": if( subject == targets ) { words[i] = "your"; --- 141,147 ---- } } break; ! case "$target_possessive_noun": if( subject == targets ) { words[i] = "your"; *************** *** 158,164 **** } } break; ! case "$target_possessive": if( subject == targets ) { words[i] = "your"; --- 158,164 ---- } } break; ! case "$target_possessive": if( subject == targets ) { words[i] = "your"; *************** *** 175,181 **** } } break; ! case "$target_reflexive": if( subject == targets ) { words[i] = "yourself"; --- 175,181 ---- } } break; ! case "$target_reflexive": if( subject == targets ) { words[i] = "yourself"; *************** *** 192,198 **** } } break; ! default: if( special[words[i]] ) { words[i] = special[words[i]]; --- 192,198 ---- } } break; ! default: if( special[words[i]] ) { words[i] = special[words[i]]; *************** *** 205,211 **** case POV_TARGET: for(i=0; i<maxi; i++) { string punctuation = ""; ! if( words[i] == "" ) { continue; } --- 205,211 ---- case POV_TARGET: for(i=0; i<maxi; i++) { string punctuation = ""; ! if( words[i] == "" ) { continue; } *************** *** 249,255 **** words[i] = nominative(subject_gen); } break; ! case "$agent_objective": if( !subject_gen ) { words[i] = subject; --- 249,255 ---- words[i] = nominative(subject_gen); } break; ! case "$agent_objective": if( !subject_gen ) { words[i] = subject; *************** *** 262,268 **** case "$agent_possessive_noun": words[i] = possessive_noun(subject); break; ! case "$agent_possessive": if( !subject_gen ) { words[i] = possessive_noun(subject); --- 262,268 ---- case "$agent_possessive_noun": words[i] = possessive_noun(subject); break; ! case "$agent_possessive": if( !subject_gen ) { words[i] = possessive_noun(subject); *************** *** 284,290 **** case "$target_verb": words[i] = verb[verb_count++]; break; ! case "$target_name": case "$target_nominative": case "$target_objective": words[i] = "you"; --- 284,290 ---- case "$target_verb": words[i] = verb[verb_count++]; break; ! case "$target_name": case "$target_nominative": case "$target_objective": words[i] = "you"; *************** *** 293,299 **** case "$target_possessive_noun": words[i] = "your"; break; ! case "$target_possessive": words[i] = "your"; break; --- 293,299 ---- case "$target_possessive_noun": words[i] = "your"; break; ! case "$target_possessive": words[i] = "your"; break; *************** *** 301,307 **** case "$target_reflexive": words[i] = "yourself"; break; ! default: if( special[words[i]] ) { words[i] = special[words[i]]; --- 301,307 ---- case "$target_reflexive": words[i] = "yourself"; break; ! default: if( special[words[i]] ) { words[i] = special[words[i]]; *************** *** 314,320 **** case POV_OBSERVER: for(i=0; i<maxi; i++) { string punctuation = ""; ! if( words[i] == "" ) { continue; } --- 314,320 ---- case POV_OBSERVER: for(i=0; i<maxi; i++) { string punctuation = ""; ! if( words[i] == "" ) { continue; } *************** *** 343,355 **** } switch(words[i]) { case "$agent_verb": ! words[i] = pluralize(verb[verb_count++]); break; ! case "$agent_name": words[i] = subject; break; ! case "$agent_nominative": if( !subject_gen ) { words[i] = subject; --- 343,358 ---- } switch(words[i]) { case "$agent_verb": ! //words[i] = pluralize(replace_string(identify(verb),"\"","")); ! //tc("verb: "+identify(verb)); ! //tc("verb: "+typeof(verb)); ! words[i] = ""+pluralize(verb[0]); break; ! case "$agent_name": words[i] = subject; break; ! case "$agent_nominative": if( !subject_gen ) { words[i] = subject; *************** *** 358,364 **** words[i] = nominative(subject_gen); } break; ! case "$agent_objective": if( !subject_gen ) { words[i] = subject; --- 361,367 ---- words[i] = nominative(subject_gen); } break; ! case "$agent_objective": if( !subject_gen ) { words[i] = subject; *************** *** 371,377 **** case "$agent_possessive_noun": words[i] = possessive_noun(subject); break; ! case "$agent_possessive": if( !subject_gen ) { words[i] = possessive_noun(subject); --- 374,380 ---- case "$agent_possessive_noun": words[i] = possessive_noun(subject); break; ! case "$agent_possessive": if( !subject_gen ) { words[i] = possessive_noun(subject); *************** *** 399,405 **** } verb_count++; break; ! case "$target_name": words[i] = targets; break; --- 402,408 ---- } verb_count++; break; ! case "$target_name": words[i] = targets; break; *************** *** 439,445 **** words[i] = possessive_noun(targets); } break; ! case "$target_possessive": if( !target_gen ) { words[i] = possessive_noun(targets); --- 442,448 ---- words[i] = possessive_noun(targets); } break; ! case "$target_possessive": if( !target_gen ) { words[i] = possessive_noun(targets); *************** *** 479,489 **** } void send_messages(mixed verb, string message, object subject, mixed targets, ! mixed observers, mapping special) { string sname = subject->GetName(); string sgen = (subject->GetGender() || "neuter"); string tname, tgen; ! if( arrayp(targets) ) { if( !sizeof(targets) ) { tname = tgen = 0; --- 482,492 ---- } void send_messages(mixed verb, string message, object subject, mixed targets, ! mixed observers, mapping special) { string sname = subject->GetName(); string sgen = (subject->GetGender() || "neuter"); string tname, tgen; ! if( arrayp(targets) ) { if( !sizeof(targets) ) { tname = tgen = 0; *************** *** 539,559 **** } if( subject ) { string str = create_message(POV_SUBJECT, verb, message, sname, sgen, ! tname, tgen, special); ! subject->eventPrint(str); } if( targets && targets != subject ) { string str = create_message(POV_TARGET, verb, message, sname, sgen, ! tname, tgen, special); targets->eventPrint(str); } if( observers ) { string str = create_message(POV_OBSERVER, verb, message, sname, sgen, ! tname, tgen, special); object array exclude = ({}); ! if( subject ) { exclude = ({ subject }); } --- 542,562 ---- } if( subject ) { string str = create_message(POV_SUBJECT, verb, message, sname, sgen, ! tname, tgen, special); ! subject->eventPrint(str); } if( targets && targets != subject ) { string str = create_message(POV_TARGET, verb, message, sname, sgen, ! tname, tgen, special); targets->eventPrint(str); } if( observers ) { string str = create_message(POV_OBSERVER, verb, message, sname, sgen, ! tname, tgen, special); object array exclude = ({}); ! if( subject ) { exclude = ({ subject }); } diff -c -r --new-file ds1.1/lib/secure/sefun/morality.c ds2.0r27/lib/secure/sefun/morality.c *** ds1.1/lib/secure/sefun/morality.c Sun Feb 1 21:30:48 1998 --- ds2.0r27/lib/secure/sefun/morality.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /secure/sefun/morality.c ! * from the Dead Soulsr2 Object Library * handles moral actions * created by Descartes of Borg 951016 */ --- 1,5 ---- /* /secure/sefun/morality.c ! * from the Dead Souls Object Library * handles moral actions * created by Descartes of Borg 951016 */ diff -c -r --new-file ds1.1/lib/secure/sefun/mud_info.c ds2.0r27/lib/secure/sefun/mud_info.c *** ds1.1/lib/secure/sefun/mud_info.c Wed Mar 10 22:18:19 1999 --- ds2.0r27/lib/secure/sefun/mud_info.c Wed Jul 5 01:20:21 2006 *************** *** 1,12 **** // /adm/simul_efun/mud_info.c // from the Dead Souls Mudlib // gives information simul_efuns about the mud ! // created by Descartes of Borg 930814 #include <config.h> string mud_name() { return MUD_NAME; } #ifdef MUDOS_VERSION string version() { return MUDOS_VERSION; } #endif // MUDOS_VERSION --- 1,14 ---- // /adm/simul_efun/mud_info.c // from the Dead Souls Mudlib // gives information simul_efuns about the mud ! // created by Descartes of Borg #include <config.h> string mud_name() { return MUD_NAME; } + string admin_email() { return ADMIN_EMAIL; } + #ifdef MUDOS_VERSION string version() { return MUDOS_VERSION; } #endif // MUDOS_VERSION *************** *** 23,34 **** string architecture() { return __ARCH__; } #endif // __ARCH__ - /* Changing this value with prior consent is a violation of the Dead Souls - * Object Library License Agreement and will result in the loss of - * your right to use Dead Souls - */ string mudlib() { return "Dead Souls"; } ! string mudlib_version() { return "1.1pre"; } int query_host_port() { return __PORT__; } --- 25,47 ---- string architecture() { return __ARCH__; } #endif // __ARCH__ string mudlib() { return "Dead Souls"; } ! string mudlib_version() { return "2.0r27"; } int query_host_port() { return __PORT__; } + + string query_os_type(){ + string config_file, s1, s2, s3; + if(function_exists("architecture",load_object("/secure/sefun/sefun"))){ + if(architecture() == "Cygwin-32") return "windows"; + if(!file_exists("/secure/cfg/mudos.cfg")) return architecture(); + } + if(!file_exists("/secure/cfg/mudos.cfg")) return ""; + config_file = read_matching_line("/secure/cfg/mudos.cfg","mudlib directory :"); + if(!config_file) return ""; + if(sscanf(config_file,"%s:%s:%s",s1,s2,s3) == 3){ + return "windows"; + } + else return "unix"; + } diff -c -r --new-file ds1.1/lib/secure/sefun/numbers.c ds2.0r27/lib/secure/sefun/numbers.c *** ds1.1/lib/secure/sefun/numbers.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/sefun/numbers.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,17 ---- + + int bool_reverse(mixed arg){ + if(!arg || (intp(arg) && arg < 1)) return 1; + else return 0; + } + + int atoi(string str){ + int integer; + if(!str) return 0; + if(!sscanf(str, "%d", integer)) return 0; + return integer; + } + + string itoa(int i){ + return ""+i; + } + diff -c -r --new-file ds1.1/lib/secure/sefun/ordinal.c ds2.0r27/lib/secure/sefun/ordinal.c *** ds1.1/lib/secure/sefun/ordinal.c Sun Feb 1 21:30:50 1998 --- ds2.0r27/lib/secure/sefun/ordinal.c Wed Jul 5 00:01:06 2006 *************** *** 7,15 **** if( x<14 && x>10 ) x = 4; else x = x%10; switch(x) { ! case 1: return "st"; break; ! case 2: return "nd"; break; ! case 3: return "rd"; break; ! default: return "th"; break; } } --- 7,15 ---- if( x<14 && x>10 ) x = 4; else x = x%10; switch(x) { ! case 1: return "st"; break; ! case 2: return "nd"; break; ! case 3: return "rd"; break; ! default: return "th"; break; } } diff -c -r --new-file ds1.1/lib/secure/sefun/parse_objects.c ds2.0r27/lib/secure/sefun/parse_objects.c *** ds1.1/lib/secure/sefun/parse_objects.c Sun Feb 1 21:30:50 1998 --- ds2.0r27/lib/secure/sefun/parse_objects.c Wed Jul 5 00:01:06 2006 *************** *** 13,19 **** inv = all_inventory(where); for(i=0, skip = 0; i<sizeof(inv); i++) { if(inv[i]->id(what)) skip ++; ! if(skip == which) return inv[i]; } return 0; } --- 13,19 ---- inv = all_inventory(where); for(i=0, skip = 0; i<sizeof(inv); i++) { if(inv[i]->id(what)) skip ++; ! if(skip == which) return inv[i]; } return 0; } diff -c -r --new-file ds1.1/lib/secure/sefun/path_file.c ds2.0r27/lib/secure/sefun/path_file.c *** ds1.1/lib/secure/sefun/path_file.c Sun Feb 1 21:30:50 1998 --- ds2.0r27/lib/secure/sefun/path_file.c Wed Jul 5 00:01:06 2006 *************** *** 4,30 **** */ mixed *path_file(mixed full_path) { ! mixed *tmp, *dirs; ! int i; ! if(pointerp(full_path)) { ! dirs = allocate(2); ! dirs[0] = ({ }); ! dirs[1] = ({ }); ! for(i = 0; i < sizeof(full_path); i++) { ! tmp = path_file(full_path[i]); ! dirs[0] = dirs[0] + ({ tmp[0] }); ! dirs[1] = dirs[1] + ({ tmp[1] }); ! } ! return dirs; ! } ! if(full_path == "/") ! return ({ "/","" }); ! if(file_size(full_path) == -2) ! return ({ full_path, "" }); ! dirs = explode(full_path,"/"); ! tmp = dirs[0 .. sizeof(dirs) - 2]; ! return ({ "/" + implode(tmp,"/"), dirs[sizeof(dirs) - 1] }); } --- 4,30 ---- */ mixed *path_file(mixed full_path) { ! mixed *tmp, *dirs; ! int i; ! if(pointerp(full_path)) { ! dirs = allocate(2); ! dirs[0] = ({ }); ! dirs[1] = ({ }); ! for(i = 0; i < sizeof(full_path); i++) { ! tmp = path_file(full_path[i]); ! dirs[0] = dirs[0] + ({ tmp[0] }); ! dirs[1] = dirs[1] + ({ tmp[1] }); ! } ! return dirs; ! } ! if(full_path == "/") ! return ({ "/","" }); ! if(file_size(full_path) == -2) ! return ({ full_path, "" }); ! dirs = explode(full_path,"/"); ! tmp = dirs[0 .. sizeof(dirs) - 2]; ! return ({ "/" + implode(tmp,"/"), dirs[sizeof(dirs) - 1] }); } diff -c -r --new-file ds1.1/lib/secure/sefun/pointers.c ds2.0r27/lib/secure/sefun/pointers.c *** ds1.1/lib/secure/sefun/pointers.c Sun Feb 1 21:30:48 1998 --- ds2.0r27/lib/secure/sefun/pointers.c Wed Jul 5 00:01:06 2006 *************** *** 15,28 **** return (userp(ob) && member_group(ob, "AMBASSADOR")); } ! int archp(object ob) { ! string str; if(!ob) ob = previous_object(); if(!creatorp(ob)) return 0; return (member_group(ob, "ASSIST") || member_group(ob, "SECURE")); } varargs int creatorp(object ob) { if(!ob) ob = previous_object(); if(!ob || !userp(ob)) return 0; --- 15,59 ---- return (userp(ob) && member_group(ob, "AMBASSADOR")); } ! int elderp(object ob) { ! if(!ob) ob = previous_object(); ! return (userp(ob) && member_group(ob, "ELDER")); ! } + int testp(object ob) { + if(!ob) ob = previous_object(); + return (userp(ob) && member_group(ob, "TEST")); + } + + int archp(object ob) { if(!ob) ob = previous_object(); if(!creatorp(ob)) return 0; return (member_group(ob, "ASSIST") || member_group(ob, "SECURE")); } + int imud_privp(mixed guy) { + if(member_group(guy, "INTERMUD")) return 1; + else return 0; + } + + int securep(mixed guy) { + mixed dude = guy; + if(!guy) guy = previous_object(); + if(!stringp(guy)) guy = guy->GetKeyName(); + if(!guy || guy == "") guy = base_name(dude); + if(member_group(guy, "SECURE")) return 1; + else return 0; + } + + int assistp(mixed guy) { + mixed dude = guy; + if(!guy) guy = previous_object(); + if(!stringp(guy)) guy = guy->GetKeyName(); + if(!guy || guy == "") guy = base_name(dude); + if(member_group(guy, "ASSIST")) return 1; + else return 0; + } + varargs int creatorp(object ob) { if(!ob) ob = previous_object(); if(!ob || !userp(ob)) return 0; *************** *** 44,50 **** if(!ob) ob = previous_object(); if( ! catch( val = (int)VOTING_D->IsCouncilMember(ob) ) ) ! return (!creatorp(ob) && ( val )); return 0; } --- 75,81 ---- if(!ob) ob = previous_object(); if( ! catch( val = (int)VOTING_D->IsCouncilMember(ob) ) ) ! return (!creatorp(ob) && ( val )); return 0; } diff -c -r --new-file ds1.1/lib/secure/sefun/query_carrying.c ds2.0r27/lib/secure/sefun/query_carrying.c *** ds1.1/lib/secure/sefun/query_carrying.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/sefun/query_carrying.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,11 ---- + int query_carrying(object who, mixed thing){ + if(objectp(thing)) thing = base_name(thing); + if(last(thing,2) == ".c") truncate(thing,2); + + if(!file_exists(thing+".c")) return 0; + + foreach(object ob in deep_inventory(who)){ + if(base_name(ob) == thing) return 1; + } + return 0; + } diff -c -r --new-file ds1.1/lib/secure/sefun/query_invis.c ds2.0r27/lib/secure/sefun/query_invis.c *** ds1.1/lib/secure/sefun/query_invis.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/sefun/query_invis.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,24 ---- + // /adm/simul_efun/absolute_value.c + // from the Dead Souls mudlib + // an absolute value simul_efun + // created by Descartes 28 april 1993 + + varargs int query_invis(object lookee, object looker) { + if(!lookee && !looker) lookee = this_object(); + if(!looker) looker = previous_object(); + if(looker == lookee) looker = previous_object(1); + if(!looker || !living(looker)) return 2; + if(!living(lookee) && lookee->GetInvis()) return 1; + if(!lookee->GetInvis()) return 0; + if(creatorp(lookee) && lookee->GetInvis() && !creatorp(looker)) return 1; + if(archp(lookee) && lookee->GetInvis() && !archp(looker)) return 1; + if(living(lookee)){ + int lookeelevel, lookerlevel; + lookeelevel = lookee->GetLevel(); + lookerlevel = looker->GetLevel(); + if(lookeelevel && lookerlevel && lookeelevel > lookerlevel){ + return 1; + } + } + return 0; + } diff -c -r --new-file ds1.1/lib/secure/sefun/query_names.c ds2.0r27/lib/secure/sefun/query_names.c *** ds1.1/lib/secure/sefun/query_names.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/sefun/query_names.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,32 ---- + #include <lib.h> + + string *query_names(object whom) { + string *name = ({}); + string *names = ({}); + if(!whom) return name; + write_file("/tmp/wtf.txt",identify(whom)); + if(inherits(LIB_DOOR,whom) || base_name(whom) == LIB_DOOR) + { + name = ({ "door" }); + } + else { + if(whom->GetName()) name += ({ lower_case(whom->GetName()) }); + if(whom->GetKeyName()) name += ({ lower_case(whom->GetKeyName()) }); + if(sizeof(whom->GetId())) { + if(arrayp(whom->GetId()))name += whom->GetId(); + else name += ({ whom->GetId() }); + } + } + if(sizeof(name)){ + foreach(mixed subst in name){ + if(arrayp(subst)) names += subst; + else names += ({ lower_case(subst) }); + } + } + return names; + } + + int answers_to(string name, object what){ + if(member_array(lower_case(name),query_names(what)) != -1) return 1; + else return 0; + } diff -c -r --new-file ds1.1/lib/secure/sefun/reaper.c ds2.0r27/lib/secure/sefun/reaper.c *** ds1.1/lib/secure/sefun/reaper.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/sefun/reaper.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,76 ---- + #include <lib.h> + + void reap_dummies(){ + // + // destroys any dummy objects that do not + // have an environment + // + object *objects; + object *dummies; + + objects = objects(); + dummies = ({}); + + foreach(object ob in objects){ + if(base_name(ob) == "/lib/std/dummy"){ + dummies += ({ ob }); + } + } + + foreach(object dummy in dummies){ + if(!environment(dummy)) dummy->eventDestruct(); + } + } + + varargs void reap_other(string str){ + // + // destroys any cloned objects that + // do not have an environment + // + string s1,s2; + object *objects; + object *others; + + objects = objects(); + others = ({}); + + foreach(object ob in objects){ + if(sscanf(file_name(ob),"%s#%s",s1,s2) > 0) { + if(base_name(ob) != LIB_CONNECT) others += ({ ob }); + } + } + + foreach(object thingy in others){ + if(!userp(thingy) && !environment(thingy) && + base_name(thingy) != "/secure/obj/snooper" ) { + thingy->eventDestruct(); + } + } + } + + mixed reap_list(){ + // + // returns a list of cloned objects without an environment + // + string s1,s2,list; + object *objects; + object *clones; + + objects = objects(); + clones = ({}); + list = ""; + + foreach(object thing in objects){ + if(sscanf(file_name(thing),"%s#%s",s1,s2) > 0) { + if(!environment(thing)) clones += ({ thing }); + } + } + + rm("/tmp/lost_object_list.txt"); + foreach(object clone in clones){ + write_file("/tmp/lost_object_list.txt", file_name(clone)+"\n"); + } + //write("Total size of list: "+sizeof(clones)+" lost objects."); + return this_player()->eventPage("/tmp/lost_object_list.txt"); + } + diff -c -r --new-file ds1.1/lib/secure/sefun/reload.c ds2.0r27/lib/secure/sefun/reload.c *** ds1.1/lib/secure/sefun/reload.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/sefun/reload.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,92 ---- + #include <lib.h> + #include <daemons.h> + #include <modules.h> + #include <rooms.h> + #include <commands.h> + mixed mx; + object next; + object *dudes; + string filename, args; + + varargs mixed reload(mixed ob, int recursive) { + mapping StringFellows = ([]); + int stringed; + object env; + mx = 0; + + //tc("ob: "+identify(ob),"red"); + + if(!ob) return 0; + + if(objectp(ob) && environment(ob)) env = environment(ob); + + if(stringp(ob)) { + stringed = 1; + filename = ob; + if(!grepp(filename,"#") && last(filename,2) != ".c") filename += ".c"; + ob = find_object(filename); + if(!ob) ob = load_object(filename); + } + if(!ob || !objectp(ob)) { + write("No such object."); + return 0; + } + + //tc("ob: "+identify(ob),"green"); + if(ob->GetDoor() && sizeof(ob->GetDoor())) ob = load_object(ob->GetDoor()); + + if(!file_exists(base_name(ob))) filename = base_name(ob)+".c"; + else filename = base_name(ob); + + if(recursive) args = "-a -r "; + else args = "-a "; + + if(!grepp(unguarded( (: read_file(filename) :) ),"void init()" || !grepp(unguarded( (: read_file(filename) :) ),"::init()"))) { + write("This object lacks a working init function. Please run initfix on it as soon as possible."); + } + + //tc("ob: "+identify(ob),"blue"); + + if(inherits(LIB_ROOM,ob)){ + dudes = get_livings(ob,1); + if(dudes) { + foreach(object fellow in dudes){ + string ubi = fellow->GetProperty("LastLocation"); + if(ubi) StringFellows[fellow->GetKeyName()] = ubi; + } + } + + unguarded( (: mx = catch(load_object(CMD_UPDATE)->cmd(args + filename)) :) ); + if(mx) { + write("There appears to be a problem updating one or more files."); + write("Reload failed."); + } + else { + if(dudes) { + dudes->eventMove(filename); + foreach(object fellow in dudes){ + if(sizeof(StringFellows[fellow->GetKeyName()])){ + fellow->SetProperty("LastLocation",StringFellows[fellow->GetKeyName()]); + } + } + } + write("Reload complete."); + } + StringFellows = ([]); + return 1; + } + unguarded( (: mx = load_object(CMD_UPDATE)->cmd(args + filename) :) ); + if(!mx || !intp(mx) || mx == 0) { + write("There appears to be a problem updating one or more files."); + write("Reload failed."); + return 0; + } + + if(ob && !inherits(LIB_DOOR, ob) && !stringed && env) { + unguarded( (: next = new(filename) :) ); + ob->eventMove(ROOM_FURNACE); + next->eventMove(env); + } + write("Reload complete."); + return 1; + } diff -c -r --new-file ds1.1/lib/secure/sefun/rooms.c ds2.0r27/lib/secure/sefun/rooms.c *** ds1.1/lib/secure/sefun/rooms.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/sefun/rooms.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,58 ---- + string namen, ret; + + int reload_room(object ob) { + string name; + object *stuff; + name=base_name(ob); + stuff = deep_inventory(ob); + foreach(object item in stuff){ + if(!interactive(item) && + !interactive(environment(item)) && + !interactive(environment(environment(item))) ) + item->eventDestruct(); + } + ob->eventDestruct(); + load_object(name); + return 1; + } + + int query_night_light(object ob){ + string file; + string filename = base_name(ob)+".c"; + namen = filename; + if(file_size(filename) < 1) return -1; + file = unguarded( (: read_file(namen) :) ); + if(strsrch(file,"SetNightLight") != -1) return 1; + else return 0; + } + + int query_day_light(object ob){ + string filename = base_name(ob)+".c"; + if(file_size(filename) < 1) return -1; + if(strsrch(read_file(filename),"SetDayLight") != -1) return 1; + else return 0; + } + + int query_ambient_light(object ob){ + string filename = base_name(ob)+".c"; + if(file_size(filename) < 1) return -1; + if(strsrch(read_file(filename),"SetAmbientLight") != -1) return 1; + else return 0; + } + + string opposite_dir(string str){ + switch(str){ + case "north" : ret = "south";break; + case "south" : ret = "north";break; + case "east" : ret = "west";break; + case "west" : ret = "east";break; + case "northeast" : ret = "southwest";break; + case "northwest" : ret = "southeast";break; + case "southeast" : ret = "northwest";break; + case "southwest" : ret = "northeast";break; + case "up" : ret = "down";break; + case "down" : ret = "up";break; + default : ret = "";break; + } + return ret; + } diff -c -r --new-file ds1.1/lib/secure/sefun/security.c ds2.0r27/lib/secure/sefun/security.c *** ds1.1/lib/secure/sefun/security.c Sun Feb 1 21:30:50 1998 --- ds2.0r27/lib/secure/sefun/security.c Wed Jul 5 00:01:06 2006 *************** *** 12,34 **** if(!sizeof(path = explode(file, "/"))) return 0; switch(path[0]) { ! case "adm": return PRIV_SECURE; ! case "cmds": return PRIV_CMDS; ! case "daemon": return PRIV_MUDLIB; ! case "estates": return PRIV_GENERAL; ! case "lib": return PRIV_GENERAL; ! case "obj": return PRIV_GENERAL; ! case "secure": return PRIV_SECURE; ! case "shadows": return PRIV_GENERAL; ! case "verbs": return PRIV_CMDS; ! case "www": return PRIV_GENERAL; ! case "realms": ! if(sizeof(path) > 1) return lower_case(path[1]); ! else return 0; ! case "domains": ! if(sizeof(path) > 1) return capitalize(lower_case(path[1])); ! else return 0; ! default: return 0; } } --- 12,34 ---- if(!sizeof(path = explode(file, "/"))) return 0; switch(path[0]) { ! case "adm": return PRIV_SECURE; ! case "cmds": return PRIV_CMDS; ! case "daemon": return PRIV_MUDLIB; ! case "estates": return PRIV_GENERAL; ! case "lib": return PRIV_GENERAL; ! case "obj": return PRIV_GENERAL; ! case "secure": return PRIV_SECURE; ! case "shadows": return PRIV_GENERAL; ! case "verbs": return PRIV_CMDS; ! case "www": return PRIV_GENERAL; ! case "realms": ! if(sizeof(path) > 1) return lower_case(path[1]); ! else return 0; ! case "domains": ! if(sizeof(path) > 1) return capitalize(lower_case(path[1])); ! else return 0; ! default: return 0; } } *************** *** 40,43 **** --- 40,101 ---- return (member_array(who, ppl) != -1); } + int domain_admin(mixed pretender, string domain){ + mapping DomainsMap = ([]); + string write_perms = read_file("/secure/cfg/write.cfg"); + string *tmp_array = explode(write_perms, "\n"); + string *admin_array = ({}); + if(objectp(pretender)) pretender = pretender->GetKeyName(); + foreach(string line in tmp_array){ + string where, admins; + if(sscanf(line,"(/domains/%s/) %s", where, admins)){ + DomainsMap[where] = admins; + } + } + //tc("I think pretender is: "+identify(pretender)+", type: "+typeof(pretender),"yellow"); + if(!sizeof(DomainsMap[domain])) return 0; + admin_array = explode(DomainsMap[domain],":"); + //tc("will I return 0?"); + if(member_array(lower_case(pretender), admin_array) == -1){ + //tc("about to return 0"); + return 0; + } + else { + //tc("about to return 1"); + return 1; + } + } + + int check_privs(mixed pretender, mixed target){ + int x; + string domain, junk; + if(stringp(pretender)) pretender = load_object(pretender); + if(objectp(target)) target = base_name(target)+".c"; + if(!stringp(target)) x= 1; + if(!pretender) x= 2; + if(pretender->GetForced() ) x= 3; + foreach(object ob in previous_object(-1)){ + if(ob && ob->GetForced() ) x= 4; + } + if(first_string_element(target,"/",1) == "tmp" ) x= 15; + else if(first_string_element(target,"/",1) == "open") x= 16; + else if(first_string_element(target,"/",1) == "realms" && + grepp(target,homedir(pretender)) ) x= 17; + else if(archp(pretender)) x= 18; + else x= 9; + + if(stringp(target) && first_string_element(target,"/",1) == "domains"){ + //tc("entered new test sub","blue"); + if(sscanf(target,"/domains/%s/%s", domain, junk) == 2){ + //tc("entered subsub","blue"); + //tc("pretender: "+identify(pretender),"white"); + //tc("domain: "+identify(domain),"white"); + if(domain_admin(pretender, domain)) x = 19; + } + } + //tc("x: "+x); + if(x < 10) return 0; + if(x > 10) return 1; + } + mixed unguarded(function f) { return (mixed)master()->apply_unguarded(f); } diff -c -r --new-file ds1.1/lib/secure/sefun/sefun.c ds2.0r27/lib/secure/sefun/sefun.c *** ds1.1/lib/secure/sefun/sefun.c Sun Feb 1 21:30:50 1998 --- ds2.0r27/lib/secure/sefun/sefun.c Wed Jul 5 00:01:06 2006 *************** *** 4,15 **** * created by Descartes of Borg 940213 */ - #pragma save_binary - #include <lib.h> #include <daemons.h> #include <commands.h> #include <objects.h> #include "sefun.h" #include "/secure/sefun/absolute_value.c" --- 4,14 ---- * created by Descartes of Borg 940213 */ #include <lib.h> #include <daemons.h> #include <commands.h> #include <objects.h> + #include <privs.h> #include "sefun.h" #include "/secure/sefun/absolute_value.c" *************** *** 51,98 **** #include "/secure/sefun/user_exists.c" #include "/secure/sefun/user_path.c" #include "/secure/sefun/visible.c" int destruct(object ob) { string *privs; string tmp; ! if(previous_object(0) == ob) return efun::destruct(ob); if(!(tmp = query_privs(previous_object(0)))) return 0; if(member_array(PRIV_SECURE, explode(tmp, ":")) != -1) ! return efun::destruct(ob); privs = ({ file_privs(file_name(ob)) }); if((int)master()->valid_apply(({ "ASSIST" }) + privs)) ! return efun::destruct(ob); else return 0; } varargs void shutdown(int code) { ! if(!((int)master()->valid_apply(({})))) return; if(this_player()) ! log_file("shutdowns", (string)this_player()->GetCapName()+ ! " shutdown "+mud_name()+" at "+ctime(time())+"\n"); else log_file("shutdowns", "Game shutdown by "+ ! file_name(previous_object(0))+" at "+ctime(time())+"\n"); efun::shutdown(code); } varargs object snoop(object who, object target) { if(!target) return efun::snoop(who); ! if(!creatorp(who)) return 0; if(!((int)master()->valid_apply(({ "ASSIST" })))) { ! if(!((int)target->query_snoopable())) return 0; ! else return efun::snoop(who, target); } else if(member_group(target, PRIV_SECURE)) { ! message("system", (string)who->GetCapName()+" is now snooping " ! "you.", target); ! return efun::snoop(who, target); } else return efun::snoop(who, target); } object query_snoop(object ob) { ! if(!userp(previous_object(0))) return 0; return efun::query_snoop(ob); } --- 50,197 ---- #include "/secure/sefun/user_exists.c" #include "/secure/sefun/user_path.c" #include "/secure/sefun/visible.c" + #include "/secure/sefun/tail.c" + #include "/secure/sefun/dump_socket_status.c" + #include "/secure/sefun/local_time.c" + #include "/secure/sefun/get_livings.c" + #include "/secure/sefun/get_verbs.c" + #include "/secure/sefun/get_cmds.c" + #include "/secure/sefun/get_stack.c" + #include "/secure/sefun/timestamp.c" + #include "/secure/sefun/duplicates.c" + #include "/secure/sefun/reaper.c" + #include "/secure/sefun/custom_path.c" + #include "/secure/sefun/mappings.c" + #include "/secure/sefun/dummy.c" + #include "/secure/sefun/disable.c" + #include "/secure/sefun/make_workroom.c" + #include "/secure/sefun/query_invis.c" + #include "/secure/sefun/rooms.c" + #include "/secure/sefun/generic.c" + #include "/secure/sefun/singular_array.c" + #include "/secure/sefun/reload.c" + #include "/secure/sefun/wipe_inv.c" + #include "/secure/sefun/numbers.c" + #include "/secure/sefun/query_carrying.c" + #include "/secure/sefun/findobs.c" + #include "/secure/sefun/query_names.c" + #include "/secure/sefun/ascii.c" + #include "/secure/sefun/wild_card.c" + #include "/secure/sefun/compare_array.c" + #include "/secure/sefun/legacy.c" + + + object find_object( string str ){ + if((int)master()->valid_apply(({ "SECURE", "ASSIST", "SNOOP_D" }))) return efun::find_object(str); + if(base_name(efun::find_object(str)) == "/secure/obj/snooper") return 0; + else return efun::find_object(str); + } + + varargs mixed objects(mixed arg1, mixed arg2){ + object array tmp_obs = efun::objects(); + + if(base_name(previous_object()) == SNOOP_D || archp(this_player())){ + return tmp_obs; + } + if(!arg1){ + return filter(tmp_obs, (: base_name($1) != "/secure/obj/snooper" :) ); + } + + if(arg1 && !arg2) { + object *ret_arr = ({}); + if(!functionp(arg1)) return 0; + foreach(object ob in filter(tmp_obs, (: base_name($1) != "/secure/obj/snooper" :) )){ + if(evaluate(arg1, ob)) ret_arr += ({ ob }); + } + return ret_arr; + } + + if(arg1 && arg2) { + object *ret_arr = ({}); + if(!functionp(arg1)) return 0; + if(!objectp(arg2)) return 0; + foreach(object ob in filter(tmp_obs, (: base_name($1) != "/secure/obj/snooper" :) )){ + if(call_other(arg2, arg1, ob)) ret_arr += ({ ob }); + } + return ret_arr; + } + + else return ({}); + } + + varargs string socket_address(mixed arg, int foo) { + string ret, port; + if(objectp(arg)) return efun::socket_address(arg); + ret = socket_status(arg)[4]; + port = last_string_element(ret,"."); + ret = replace_string(ret,"."+port,""); + if(!foo) return ret; + else return ret+" "+port; + } + + mixed array users(){ + return filter(efun::users(), (: ($1) && environment($1) :) ); + } int destruct(object ob) { string *privs; string tmp; + //tc("destruct sefun being called. ob is: "+identify(ob)+".","red"); + //tc("this_object is: "+identify(this_object())+".","red"); + //tc("previous objects are: "+identify(previous_object(-1))+".","yellow"); + //tc("calling stack is: "+get_stack()+".","red"); ! if(previous_object(0) && previous_object(0) == ob) return efun::destruct(ob); if(!(tmp = query_privs(previous_object(0)))) return 0; if(member_array(PRIV_SECURE, explode(tmp, ":")) != -1) ! return efun::destruct(ob); privs = ({ file_privs(file_name(ob)) }); if((int)master()->valid_apply(({ "ASSIST" }) + privs)) ! return efun::destruct(ob); else return 0; } varargs void shutdown(int code) { ! if(!((int)master()->valid_apply(({"ASSIST"}))) && ! !((int)master()->valid_apply(({"SECURE"})))) return; if(this_player()) ! log_file("shutdowns", (string)this_player()->GetCapName()+ ! " shutdown "+mud_name()+" at "+ctime(time())+"\n"); else log_file("shutdowns", "Game shutdown by "+ ! file_name(previous_object(0))+" at "+ctime(time())+"\n"); efun::shutdown(code); } + int valid_snoop(object snooper, object target){ + if(member_group(target, PRIV_SECURE)) { + message("system", (string)snooper->GetCapName()+" is trying to snoop " + "you.", target); + if(!member_group(snooper, PRIV_SECURE)) return 0; + } + if(archp(snooper)) return 1; + if( base_name(snooper) == "/secure/obj/snooper" ) return 1; + if(creatorp(snooper) && playerp(target)) return 1; + return 0; + } + varargs object snoop(object who, object target) { if(!target) return efun::snoop(who); ! if(!creatorp(who) && base_name(who) != "/secure/obj/snooper" ) return 0; if(!((int)master()->valid_apply(({ "ASSIST" })))) { ! if(!((int)target->query_snoopable())) return 0; ! else return efun::snoop(who, target); } else if(member_group(target, PRIV_SECURE)) { ! message("system", (string)who->GetCapName()+" is now snooping " ! "you.", target); ! return efun::snoop(who, target); } else return efun::snoop(who, target); } object query_snoop(object ob) { ! if(base_name(previous_object()) != SNOOP_D) ! return 0; return efun::query_snoop(ob); } *************** *** 105,111 **** string tmp; tmp = base_name(previous_object()); ! if(tmp != LIB_CONNECT && tmp != CMD_ENCRE && tmp != CMD_DECRE) return 0; return efun::exec(target, src); } --- 204,210 ---- string tmp; tmp = base_name(previous_object()); ! if(tmp != LIB_CONNECT && tmp != CMD_ENCRE && tmp != CMD_DECRE && tmp != SU) return 0; return efun::exec(target, src); } *************** *** 135,141 **** string capitalize(string str) { string *words, *tmp; int i; ! /* error condition, let it look like an efun */ if( !str || str == "" ) return efun::capitalize(str); /* most strings are not colour strings */ --- 234,240 ---- string capitalize(string str) { string *words, *tmp; int i; ! /* error condition, let it look like an efun */ if( !str || str == "" ) return efun::capitalize(str); /* most strings are not colour strings */ diff -c -r --new-file ds1.1/lib/secure/sefun/sefun.h ds2.0r27/lib/secure/sefun/sefun.h *** ds1.1/lib/secure/sefun/sefun.h Sun Feb 1 21:30:48 1998 --- ds2.0r27/lib/secure/sefun/sefun.h Wed Jul 5 00:01:06 2006 *************** *** 1,3 **** --- 1,11 ---- + /** + * + * 2006-03-21, jonez + * - changed prototype for update to return int instead of object + * - changed prototype for reload_room to remove the "recurse" argument + * - changed prototype for itoa to return string instead of int + */ + #ifndef l_sefun_h #define l_sefun_h *************** *** 88,94 **** void tell_object(object ob, mixed str); varargs void tell_room(object ob, mixed str, mixed exclude); varargs object this_agent(mixed val); ! void time_event(string tod, function f); object to_object(mixed target); varargs int total_light(object ob); string translate(string str, int prof); --- 96,102 ---- void tell_object(object ob, mixed str); varargs void tell_room(object ob, mixed str, mixed exclude); varargs object this_agent(mixed val); ! function time_event(string tod, function f); object to_object(mixed target); varargs int total_light(object ob); string translate(string str, int prof); *************** *** 102,108 **** varargs int visible(object detectee_obj, object detector_obj); varargs string wrap(string str, int width); void write(string str); #endif /* l_sefun_h */ - - --- 110,218 ---- varargs int visible(object detectee_obj, object detector_obj); varargs string wrap(string str, int width); void write(string str); + int tail(string file); + void tell_player(mixed player, string msg); + string *GetCustomPath(); + string GetCustomCommand(string str); + string dump_socket_status(); + string flat_map(mapping mp); + string *get_cmds(); + string *get_verbs(); + varargs object array get_livings(object ob,int foo); + string local_time(string str); + void reap_dummies(); + varargs void reap_other(string str); + mixed reap_list(); + string timestamp(string str); + object *get_dupes(object ob, object where); + string get_stack(); + mixed hobbled(object ob); + string query_base_currency(); + int query_base_rate(); + int query_player_money(object who); + int query_base_value(string currency, int amount); + int make_workroom(object dude); + int valid_currency(string str); + varargs int query_invis(object lookee, object looker); + string set_tz(string str); + string admin_email(); + int query_night_light(object ob); + int query_day_light(object ob); + int query_ambient_light(object ob); + int reload_room(object ob); + void tc(string str); + string opposite_dir(string str); + mixed *singular_array(mixed *arr); + varargs mixed remove_matching_line(string target, string substring, int i, string exclude); + string truncate(string str, int i); + int check_privs(mixed pretender, mixed target); + int true(); + int false(); + int indent_file(string filename); + string path_prefix(string str); + varargs string first_string_element(string str, string delimiter, int stripfirst); + string last_string_element(string str, string delimiter); + string replace_line(string file, string *params, string repl); + int memberp(mixed *primary, mixed sub); + int reverse_memberp(string primary, string *sub); + int mgrepp(string primary, string *sub); + int grepp(string primary, string sub); + varargs mixed replace_matching_line(string target, string substring, string replace, int i, string exclude); + varargs mixed remove_matching_line(string target, string substring, int i, string exclude); + string first(string str, int i); + varargs string last(string str, int i, int significant); + int starts_with_arr(string primary, string *sub); + int starts_with(string primary, string sub); + string reverse_string(string str); + mixed homedir(object ob); + varargs string generate_tmp(mixed arg); + string newline_trim(string str); + int directory_exists(string str); + mixed reload(object ob); + string query_os_type(); + varargs mixed read_matching_line(string target, string substring, int i, string exclude); + int abs(int x); + int wipe_inv(mixed dude); + int bool_reverse(mixed arg); + mixed check_light(object who); + int query_carrying(object who, mixed thing); + mixed *findobs(mixed arg); + int atoi(string str); + string itoa(int i); + string *query_names(object whom); + int answers_to(string name, object what); + varargs void add_event(string source, string ob, string fun, mixed *args, int when, int repeat); + varargs void remove_event(int i); + int update(string str); + mixed local_ctime(int i); + int numericp(mixed arg); + int basic_punctuationp(mixed arg); + mixed mapping_member(mapping Map, string sub); + mixed find_inheritors(mixed arg); + mixed find_deep_inheritors(mixed arg); + int imud_privp(mixed guy); + int securep(mixed guy); + string convert_ascii(int i); + varargs object get_random_living(object room, int foo); + varargs string socket_address(mixed arg, int foo); + varargs int debug(mixed msg, mixed val, string color); + int valid_timezone(string str); + varargs int tell_creators(string msg, string color); + varargs int tn(string str, string col, object room); + varargs int trr(string str, string col); + varargs string *wild_card(string str); + nomask int remove_dots(string str); + int domain_admin(string pretender, string domain); + int compare_array(mixed *arr1, mixed *arr2); + int arrcmp(mixed *arr1, mixed *arr2); + string append_line(string file, string *params, string repl); + varargs mixed alpha_crypt(mixed arg1, mixed arg2); + void set(mixed arg1, mixed arg2); + void query(mixed arg1, mixed arg2); + void personal_log(string str); + void add_sky_event(function f); + int assistp(mixed guy); + int elderp(object ob); + int testp(object ob); #endif /* l_sefun_h */ diff -c -r --new-file ds1.1/lib/secure/sefun/singular_array.c ds2.0r27/lib/secure/sefun/singular_array.c *** ds1.1/lib/secure/sefun/singular_array.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/sefun/singular_array.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,9 ---- + mixed *singular_array(mixed *arr) { + mixed *ret = ({}); + + foreach(mixed item in arr){ + if(member_array(item, ret) == -1) ret += ({item}); + } + + return ret; + } diff -c -r --new-file ds1.1/lib/secure/sefun/strings.c ds2.0r27/lib/secure/sefun/strings.c *** ds1.1/lib/secure/sefun/strings.c Sun Feb 1 21:30:48 1998 --- ds2.0r27/lib/secure/sefun/strings.c Wed Jul 5 00:01:06 2006 *************** *** 18,25 **** } varargs string arrange_string(string str, int x) { - int y; - if(!x) x = 80; x += strlen(str) - strlen(strip_colours(str)); return sprintf(sprintf("%%:-%ds", x), str); --- 18,23 ---- *************** *** 50,56 **** string trim(string str) { string *whitespace; int j, i = 0; ! j = strlen(str) - 1; whitespace = ({ ' ', '\t' }); while(member_array(str[i], whitespace) != -1) i++; --- 48,54 ---- string trim(string str) { string *whitespace; int j, i = 0; ! j = strlen(str) - 1; whitespace = ({ ' ', '\t' }); while(member_array(str[i], whitespace) != -1) i++; *************** *** 58,85 **** return str[i..j]; } varargs string wrap(string str, int x) { if( !x ) { ! if( !this_player() ) x = 79; ! else { ! int *tmp; ! ! tmp = (int *)this_player()->GetScreen(); ! if( tmp ) x = (tmp[0] || 79); ! else x = 79; ! } } ! return sprintf("%-=" + x + "s\n", str); } varargs mixed convert_string(string str, int flag) { mixed *ret = ({ 0, "" }); if( (str = trim(str)) == "" ) return 0; if( str[0] == '(' ) { switch(str[1]) { ! case '{': ret[0] = ({}); str = str[2..]; --- 56,114 ---- return str[i..j]; } + string space_trim(string str) { + string whitespace; + + whitespace = " " ; + while(grepp(str, whitespace)) { + str = replace_string(str," "," "); + } + return str; + } + + string newline_trim(string str) { + string *whitespace; + int j, i = 0; + + j = strlen(str) - 1; + whitespace = ({ '\n' }); + while(member_array(str[i], whitespace) != -1) i++; + while(i < j && member_array(str[j], whitespace) != -1) j--; + return str[i..j]; + } + varargs string wrap(string str, int x) { if( !x ) { ! if( !this_player() ) x = 79; ! else { ! int *tmp; ! ! tmp = (int *)this_player()->GetScreen(); ! if( tmp ) x = (tmp[0] || 79); ! else x = 79; ! } } ! if(sizeof(str) < 7900) return sprintf("%-=" + x + "s\n", str); ! else { ! string tmpfile = generate_tmp(); ! write_file(tmpfile,str); ! str = read_bytes(tmpfile,0,7900); ! rm(tmpfile); ! str += "\n*** TRUNCATED ***\n"; ! return sprintf("%-=" + x + "s\n", str); ! } } varargs mixed convert_string(string str, int flag) { mixed *ret = ({ 0, "" }); + if(!str || !sizeof(str) || str == "") return 0; + if( (str = trim(str)) == "" ) return 0; if( str[0] == '(' ) { switch(str[1]) { ! case '{': ret[0] = ({}); str = str[2..]; *************** *** 91,97 **** str = tmp[1]; while(str[0] == ' ' || str[0] == '\t') str = str[1..]; if( str[0] != ',' && str[0] != '}' ) ! error("Improperly formatted array: " + str + "\n"); else if( str[0] == ',') { str = str[1..]; while(str[0] == ' ' || str[0] == '\t') str = str[1..]; --- 120,126 ---- str = tmp[1]; while(str[0] == ' ' || str[0] == '\t') str = str[1..]; if( str[0] != ',' && str[0] != '}' ) ! error("Improperly formatted array: " + str + "\n"); else if( str[0] == ',') { str = str[1..]; while(str[0] == ' ' || str[0] == '\t') str = str[1..]; *************** *** 108,133 **** while(ret[1][0] == ' ' || ret[1][0] == '\t') ret[1] = ret[1][1..]; return ret; ! case '[': ret[0] = ([]); str = str[2..]; while(str[0] != ']') { mixed *tmp; ! mixed cle, val; tmp = convert_string(str, 1); str = tmp[1]; while(str[0] == ' ' || str[0] == '\t') str = str[1..]; if( str[0] != ':' ) ! error("Illegally formatting mapping: " + str + "\n"); cle = tmp[0]; tmp = convert_string(str[1..], 1); ret[0][cle] = tmp[0]; str = tmp[1]; while(str[0] == ' ' || str[0] == '\t') str = str[1..]; if( str[0] != ',' && str[0] != ']' ) ! error("Illegally formatted mapping: " + str + "n"); else if( str[0] != ']' ) { str = str[1..]; while(str[0] == ' ' || str[0] == '\t') str = str[1..]; --- 137,162 ---- while(ret[1][0] == ' ' || ret[1][0] == '\t') ret[1] = ret[1][1..]; return ret; ! case '[': ret[0] = ([]); str = str[2..]; while(str[0] != ']') { mixed *tmp; ! mixed cle; tmp = convert_string(str, 1); str = tmp[1]; while(str[0] == ' ' || str[0] == '\t') str = str[1..]; if( str[0] != ':' ) ! error("Illegally formatting mapping: " + str + "\n"); cle = tmp[0]; tmp = convert_string(str[1..], 1); ret[0][cle] = tmp[0]; str = tmp[1]; while(str[0] == ' ' || str[0] == '\t') str = str[1..]; if( str[0] != ',' && str[0] != ']' ) ! error("Illegally formatted mapping: " + str + "n"); else if( str[0] != ']' ) { str = str[1..]; while(str[0] == ' ' || str[0] == '\t') str = str[1..]; *************** *** 143,149 **** if( !flag ) return ret[0]; while(ret[1][0] == ' ' || ret[1][0] == '\t') ret[1] = ret[1][1..]; return ret; ! } } else if( str[0] == '"' ) { string tmp; --- 172,178 ---- if( !flag ) return ret[0]; while(ret[1][0] == ' ' || ret[1][0] == '\t') ret[1] = ret[1][1..]; return ret; ! } } else if( str[0] == '"' ) { string tmp; *************** *** 161,167 **** else if( str[0] >= '0' && str[0] <= '9' || str[0] == '-' ) { string tmp; int y; ! if( strlen(str) > 1 && str[0] == '-' ) { tmp = str[0..0]; str = str[1..]; --- 190,196 ---- else if( str[0] >= '0' && str[0] <= '9' || str[0] == '-' ) { string tmp; int y; ! if( strlen(str) > 1 && str[0] == '-' ) { tmp = str[0..0]; str = str[1..]; *************** *** 196,204 **** tmp = ""; while(strlen(str) && ((str[0] >= 'a' && str[0] <= 'z') || ! (str[0] >= 'A' && str[0] <= 'Z') || ! (str[0] >= '0' && str[0] <= '9') || ! (str[0] == '_'))) { tmp += str[0..0]; if( strlen(str) > 1 ) str = str[1..]; else str = ""; --- 225,233 ---- tmp = ""; while(strlen(str) && ((str[0] >= 'a' && str[0] <= 'z') || ! (str[0] >= 'A' && str[0] <= 'Z') || ! (str[0] >= '0' && str[0] <= '9') || ! (str[0] == '_'))) { tmp += str[0..0]; if( strlen(str) > 1 ) str = str[1..]; else str = ""; *************** *** 208,210 **** --- 237,633 ---- } error("Gobbledygook in string.\n"); } + + //this sefun courtesy of Duuk@Haven + string reverse_string(string str) { + int i; + string newstring = ""; + + if (!str) error("The reverse_string sefun needs input."); + + for (i = strlen(str); i >= 0; i--) { + newstring += str[i..i]; + } + return newstring; + } + + int starts_with(string primary, string sub){ + string rev, junk; + //primary = replace_string(primary,"\t"," "); + if(!primary) return 0; + rev = reverse_string(primary); + rev = trim(rev); + if(!rev) return 0; + primary = reverse_string(rev); + if(!sscanf(primary,sub+" %s",junk) > 0) + sscanf(primary,sub+"%s",junk); + if(junk) return 1; + + else return 0; + } + + int starts_with_arr(string primary, string *sub){ + string rev, junk; + if(!primary ||!stringp(primary)) return 0; + if(!rev = reverse_string(primary)) return 0; + rev = trim(rev); + if(!rev) return 0; + primary = reverse_string(rev); + foreach(string element in sub){ + if(sscanf(primary,element+" %s",junk) > 0) return 1; + } + return 0; + } + + // returns the last [i] characters of a string. + varargs string last(string str, int i, int significant){ + string ret, tmp; + ret = str[(strlen(str) - i )..(strlen(str) -1)]; + if(significant) { + tmp = trim(str); + ret = tmp[(strlen(tmp) - i )..(strlen(tmp) -1)]; + } + return ret; + } + + // returns the first [i] characters of a string. + string first(string str, int i){ + return str[0..(i-1)]; + } + + // return a string with the last [i] characters removed. + string truncate(string str, int i){ + return str[0..(sizeof(str) - i - 1 )]; + } + + // remove_matching_line will search the string provided, + // and delete lines that match the search substring. If no number is + // given as the third argument, it will return a string with + // the first line that matches the substring removed. If a + // number is given as a third argument, it returns a string + // with all matching lines removed. + varargs mixed remove_matching_line(string target, string substring, int i, string exclude){ + int omit, done, tail_search; + string line, filename, new_file; + + if(!target || !file_exists(target)) true(); + else target = read_file(target); + if(!target) return 0; + if(strsrch(target,substring) == -1) return target; + if(strsrch(target,"\n") == -1) return 0; + filename = "/tmp/"+random(time())+time()+".tmp"; + new_file = ""; + if(!exclude) exclude = filename; + + write_file(filename,target); + + for(i=1; !done; i++){ + line = read_file(filename, i, 1); + if(!line) break; + if(strsrch(line,substring) != -1 && strsrch(line,exclude) == -1) omit =1; + + if(omit && last(line[0..strlen(line)-2],1,1) != ";") { + tail_search = 1; + } + else tail_search = 0; + + if(!omit && !tail_search) { + new_file += line; + } + + if(!tail_search) omit = 0; + if(!line) done = 100; + if(i == 999) done = 100; + } + + rm(filename); + return new_file; + } + + varargs mixed read_matching_line(string target, string substring, int i, string exclude){ + string *ret_array; + int omit, done, tail_search; + string wtf, line, filename, new_file; + + if(i && i > 0) wtf = "wtf"; + if(!target || !file_exists(target)) true(); + else target = read_file(target); + if(!target) return 0; + if(strsrch(target,substring) == -1) return target; + if(strsrch(target,"\n") == -1) return 0; + filename = "/tmp/"+random(time())+time()+".tmp"; + new_file = ""; + if(!exclude) exclude = filename; + + write_file(filename,target); + + for(i=1; !done; i++){ + line = read_file(filename, i, 1); + if(!line) break; + if(strsrch(line,substring) != -1 && strsrch(line,exclude) == -1) omit =1; + if(omit && last(line[0..strlen(line)-2],1,1) != ";") { + tail_search = 1; + } + else tail_search = 0; + + if(omit || tail_search) { + new_file += line; + } + + + if(!tail_search) omit = 0; + if(!line) done = 100; + if(i == 999) done = 100; + } + + rm(filename); + ret_array = explode(new_file,"\n"); + //return ret_array[0]; + if(wtf) return new_file; + else return ret_array[0]; + } + + + //If you try to use replace_matching_line and it doesn't work, + //it may be that the file in question is not a .c file. This sefun + //keys on .c file syntax to know where lines begin and end. If the + //string you're editing doesn't have, for example, semicolons, + //your line replacememnt probably won't work well. Instead use the + //sefun replace_line. + varargs mixed replace_matching_line(string target, string substring, string replace, int i, string exclude){ + int omit, done, tail_search, tag_it; + string line, filename, new_file; + + tag_it = 0; + omit = 0; + + if(!target || !file_exists(target)) true(); + else target = read_file(target); + if(!target) return 0; + if(strsrch(target,substring) == -1) return target; + if(strsrch(target,"\n") == -1) return 0; + filename = "/tmp/"+random(time())+time()+".tmp"; + new_file = ""; + + write_file(filename,target); + + for(i=1; !done; i++){ + line = read_file(filename, i, 1); + if(!line) break; + //write("line: "+line); + if(strsrch(line,substring) != -1 ) omit =1; + //tc("omit: "+omit); + + if(omit && last(line[0..strlen(line)-2],1,1) != ";") { + tail_search = 1; + //write("tail_search: "+tail_search); + } + else { + tail_search = 0; + if(omit) tag_it = 1; + //tc("tail_search: "+tail_search+", tag_it: "+tag_it+", omit: "+omit); + } + + if(!omit && !tail_search) { + new_file += line; + //write("adding the line."); + } + + if(tag_it == 1){ + //tc("adding the replace"); + new_file += replace+"\n"; + tag_it = 0; + } + + if(!tail_search) omit = 0; + if(!line) done = 100; + if(i == 999) done = 100; + } + + rm(filename); + return new_file; + } + + int grepp(string primary, string sub){ + if(!primary || ! sub) return 0; + if(strsrch(primary,sub) != -1) return 1; + else return 0; + } + + int memberp(mixed *primary, mixed sub){ + if(member_array(sub,primary) != -1) return 1; + else return 0; + } + + int reverse_memberp(string primary, string *sub){ + foreach(string element in sub){ + if(strsrch(primary,element) != -1) return 1; + } + return 0; + } + + //This sefun is for non-code text. To replace lines in an LPC-code + //formatted string, use replace_matching_line instead. + string replace_line(string file, string *params, string repl){ + string *file_arr; + int alarm; + + if(!file || !stringp(file)) return ""; + file_arr = explode(file, "\n"); + + foreach(string line in file_arr){ + alarm = 0; + + foreach(string element in params){ + if(grepp(line,element)) alarm++; + } + + if(alarm == sizeof(params)){ + file_arr[member_array(line,file_arr)] = repl; + } + + } + return implode(file_arr,"\n"); + } + + string append_line(string file, string *params, string repl){ + string *file_arr; + int alarm; + + if(!file || !stringp(file)) return ""; + file_arr = explode(file, "\n"); + + foreach(string line in file_arr){ + alarm = 0; + + foreach(string element in params){ + if(grepp(line,element)) alarm++; + } + + if(alarm == sizeof(params)){ + file_arr[member_array(line,file_arr)] += ("\n"+repl); + } + + } + return implode(file_arr,"\n"); + } + + string last_string_element(string str, string delimiter){ + string rev, revd, revret, junk; + if(!str || !delimiter) return ""; + if(!grepp(str,delimiter)) return ""; + rev = reverse_string(str); + revd = reverse_string(delimiter); + sscanf(rev,"%s"+revd+"%s",revret,junk); + if(!revret || revret == "") return ""; + return reverse_string(revret); + } + + varargs string first_string_element(string str, string delimiter, int stripfirst){ + string ret, junk; + if(!str || !delimiter) return ""; + if(!grepp(str,delimiter)) return ""; + if(stripfirst) str = str[1..sizeof(str)-1]; + sscanf(str,"%s"+delimiter+"%s",ret,junk); + if(!ret || ret == "") return ""; + return ret; + } + + string path_prefix(string str){ + int i = sizeof(str) - sizeof(last_string_element(str,"/")); + return str[0..i-2]; + } + + mixed homedir(object ob){ + if(creatorp(ob)) return "/realms/"+ob->GetKeyName(); + else return 0; + } + + varargs mixed alpha_crypt(mixed arg1, mixed arg2){ + string ret; + if(!intp(arg1) && !arg2) return 0; + if(intp(arg1)) { + if(arg1 > 64) arg1 = 64; + ret = crypt(""+random(arg1+2)+arg1,""+random(arg1+2)+arg1); + ret += crypt(""+random(arg1+2)+arg1,""+random(arg1+2)+arg1); + ret = replace_string(ret,"`",""); + ret = replace_string(ret,"!",""); + ret = replace_string(ret,"/",""); + ret = replace_string(ret,".",""); + return ret[0..(arg1 - 1)]; + } + + ret = crypt(arg1, arg2); + ret = replace_string(ret,"`",""); + ret = replace_string(ret,"!",""); + ret = replace_string(ret,"/",""); + ret = replace_string(ret,".",""); + + return ret; + } + + + varargs string generate_tmp(mixed arg){ + string ret; + //string randy = replace_string(replace_string(crypt(""+random(88)+11,""+random(88)+11),"/","XXX"),".","YYY"); + string randy = alpha_crypt(8); + + if(!arg) return "/open/"+time()+".c"; + + if(objectp(arg) && this_player() && creatorp(this_player())) + ret = homedir(this_player())+"/tmp/"+last_string_element(base_name(arg),"/")+randy+time()+".c"; + + else if(objectp(arg) && this_player()) + ret = "/tmp/"+last_string_element(base_name(arg),"/")+randy+time()+".c"; + + else if(stringp(arg) && this_player() && creatorp(this_player())) { + if(file_exists(arg)) ret = homedir(this_player())+"/tmp/"+last_string_element(arg,"/")+randy+time()+".c"; + else ret = homedir(this_player())+"/tmp/"+randy+time()+".c"; + //ret = homedir(this_player())+"/tmp/"+last_string_element(arg,"/")+randy+time()+".c"; + } + + else if(stringp(arg) && this_player()) { + if(objectp(load_object(arg))) ret = "/tmp/"+last_string_element(arg,"/")+randy+time()+".c"; + else ret = "/open/"+last_string_element(arg,"/")+randy+time()+".tmp"; + } + + else if(creatorp(this_player())) ret = homedir(this_player())+"/tmp/"+randy+time()+".tmp"; + + else ret = "/open/"+randy+time()+".c"; + //tc("generate_tmp ret: "+ret); + return ret; + } + + int alphap(mixed arg){ + string *alphabet = ({ "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" }); + alphabet += ({ "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" }); + if(!stringp(arg)) return 0; + foreach(string element in alphabet){ + if(grepp(arg,element)) return 1; + } + return 0; + } + + int numericp(mixed arg){ + string *alphabet = ({"1", "2", "3", "4", "5", "6", "7", "8", "9", "0"}); + if(intp(arg)) arg = itoa(arg); + if(!stringp(arg)) return 0; + foreach(string element in alphabet){ + if(grepp(arg,element)) return 1; + } + return 0; + } + + int basic_punctuationp(mixed arg){ + string *alphabet = ({",", ".", "-", "_", "+", "#", ";", "^", "&", "(", ")" }); + alphabet += ({ "@", "!", "$", "%", "=", "{", "}", "[", "]", ":", "<", ">" }); + if(!stringp(arg)) return 0; + foreach(string element in alphabet){ + if(grepp(arg,element)) return 1; + } + return 0; + } + + + + diff -c -r --new-file ds1.1/lib/secure/sefun/tail.c ds2.0r27/lib/secure/sefun/tail.c *** ds1.1/lib/secure/sefun/tail.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/sefun/tail.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,17 ---- + int tail(string file) { + string str; + int diff; + + diff = file_size(file); + if (diff < 0) return 0; + + diff -= 1024; + if (diff < 0) diff = 0; + str = read_bytes(file, diff, 1024); + if (!str) return 0; + if (diff) str = str[strsrch(str, "\n")+1..]; + + write(str); + + return 1; + } diff -c -r --new-file ds1.1/lib/secure/sefun/this_agent.c ds2.0r27/lib/secure/sefun/this_agent.c *** ds1.1/lib/secure/sefun/this_agent.c Sun Feb 1 21:30:50 1998 --- ds2.0r27/lib/secure/sefun/this_agent.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /secure/sefun/this_agent.c ! * from the Dead Soulsr2 Object Library * if 0 is the arg, returns the current agent, other wise * sets a new agent and returns the old * created by Descartes of Borg 951021 --- 1,5 ---- /* /secure/sefun/this_agent.c ! * from the Dead Souls Object Library * if 0 is the arg, returns the current agent, other wise * sets a new agent and returns the old * created by Descartes of Borg 951021 *************** *** 16,19 **** else Agent = val; return old_agent; } ! --- 16,19 ---- else Agent = val; return old_agent; } ! diff -c -r --new-file ds1.1/lib/secure/sefun/timestamp.c ds2.0r27/lib/secure/sefun/timestamp.c *** ds1.1/lib/secure/sefun/timestamp.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/sefun/timestamp.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,32 ---- + #include <config.h> + #include <daemons.h> + #include <localtime.h> + + /** + * 2006-03-22, jonez + * - changed prototype so it does not accept an argument since that was not + * used anywhere in the entire lib. + */ + + string timestamp(){ + string rawtz; + int *t, gmtoff, offset; + + gmtoff = localtime(time())[LT_GMTOFF]; + + // if the gmtoffset is set to zero by the driver, then we need to + // calculate an offset + if (gmtoff == 0){ + // if the timezone.cfg file exists, use it else default to GMT + rawtz = query_tz(); + offset = TIME_D->GetOffset(rawtz); + offset += EXTRA_TIME_OFFSET; + } + else { + rawtz = upper_case(localtime(time())[LT_ZONE]); + offset = 0; + } + + t = localtime(time()+(offset*3600)); + return sprintf("%04d.%02d.%02d-%02d.%02d", t[LT_YEAR], (t[LT_MON])+1, t[LT_MDAY], t[LT_HOUR], t[LT_MIN]); + } diff -c -r --new-file ds1.1/lib/secure/sefun/to_object.c ds2.0r27/lib/secure/sefun/to_object.c *** ds1.1/lib/secure/sefun/to_object.c Sun Feb 1 21:30:48 1998 --- ds2.0r27/lib/secure/sefun/to_object.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /secure/sefun/to_object.c ! * from the Dead Soulsr2.4 Library * recreated by Blitz@Dead Souls * * Purpose: Parse passed string argument and --- 1,5 ---- /* /secure/sefun/to_object.c ! * from the Dead Souls.4 Library * recreated by Blitz@Dead Souls * * Purpose: Parse passed string argument and *************** *** 23,121 **** */ #include <global.h> ! object to_object(mixed var) { object env, ob, *obs; string tmp, where; int i, char; ! if( objectp(var) ) return var; else if( !stringp(var) || !sizeof(var) ) return 0; if( sscanf(var, "%s@%s", tmp, where) == 2 ) { ! var = tmp; ! if( !env = to_object(where) ) return 0; ! if( !sizeof(var) ) return environment(env); } switch(var) { ! case "here" : return environment(this_player()); ! case "me" : return this_player(); ! case "sefun" : return find_object(SEFUN); } if( sscanf(var, "%s#%d", tmp, i) == 2 ) { ! if( ob = find_object(var) ) return ob; ! else var = tmp; } else i = 1; if( i < 1 ) return 0; if( member_array(var[0], ({ '/', '$', '%', }) ) > -1 ) { ! char = var[0]; ! var = var[1..]; } switch( char ) { ! case '/' : ! if( var[<2..] != ".c" ) var += ".c"; ! if( !file_exists(var) ) return 0; ! return load_object(var); ! break; ! case '%' : ! if( !(ob = find_player(var)) ) return 0; ! else return ob; ! break; ! case '$' : ! if( env ) { ! obs = filter(all_inventory(env), ! (: living($1) && !interactive($1) && $1->id($(var)) :)); ! if( sizeof(obs) < i ) return 0; ! else return obs[i - 1]; ! } ! if( (ob = find_living(var)) && !interactive(ob) ) return ob; ! else return 0; ! break; ! default: ! if( !env ) { ! env = this_player(); ! } ! if( i > 1 ) { ! obs = filter(all_inventory(env), (: $1->id($(var)) :)); ! if( sizeof(obs) < i ) { ! if( !env = environment(env) ) { ! ob = 0; ! } ! else { ! obs = filter(all_inventory(env), (: $1->id($(var)) :)); ! if( sizeof(obs) < i ) { ! ob = 0; ! } ! else { ! ob = obs[i - 1]; ! } ! } ! } ! else { ! ob = obs[i-1]; ! } ! if( ob ) { ! return ob; ! } ! } ! else { ! ob = present(var, env); ! if( ob ) return ob; ! else if( env = environment(env) ) { ! ob = present(var, env); ! if( ob ) return ob; ! } ! if( ob = find_player(var) ) return ob; ! if( ob = find_living(var) ) return ob; ! if( !this_player() ) { ! return 0; ! } ! var = absolute_path(this_player()->query_cwd(), var); ! if( ob = load_object(var) ) { ! return ob; ! } ! } ! return 0; } return 0; } --- 23,123 ---- */ #include <global.h> ! object to_object(mixed var) { object env, ob, *obs; string tmp, where; int i, char; ! if( objectp(var) ) return var; else if( !stringp(var) || !sizeof(var) ) return 0; if( sscanf(var, "%s@%s", tmp, where) == 2 ) { ! var = tmp; ! if( !env = to_object(where) ) return 0; ! if( !sizeof(var) ) return environment(env); } switch(var) { ! case "here" : return environment(this_player()); ! case "me" : return this_player(); ! case "sefun" : return find_object(SEFUN); } if( sscanf(var, "%s#%d", tmp, i) == 2 ) { ! if( ob = find_object(var) ) return ob; ! else var = tmp; } else i = 1; if( i < 1 ) return 0; if( member_array(var[0], ({ '/', '$', '%', }) ) > -1 ) { ! char = var[0]; ! var = var[1..]; } switch( char ) { ! case '/' : ! if( var[<2..] != ".c" ) var += ".c"; ! if( !file_exists(var) ) return 0; ! return load_object(var); ! break; ! case '%' : ! if( !(ob = find_player(var)) ) return 0; ! else return ob; ! break; ! case '$' : ! if( env ) { ! obs = filter(all_inventory(env), ! (: living($1) && !interactive($1) && $1->id($(var)) :)); ! if( sizeof(obs) < i ) return 0; ! else return obs[i - 1]; ! } ! if( (ob = find_living(var)) && !interactive(ob) ) return ob; ! else return 0; ! break; ! default: ! if( !env ) { ! env = this_player(); ! } ! if( i > 1 ) { ! obs = filter(all_inventory(env), (: $1->id($(var)) :)); ! if( sizeof(obs) < i ) { ! if( !env = environment(env) ) { ! ob = 0; ! } ! else { ! obs = filter(all_inventory(env), (: $1->id($(var)) :)); ! if( sizeof(obs) < i ) { ! ob = 0; ! } ! else { ! ob = obs[i - 1]; ! } ! } ! } ! else { ! ob = obs[i-1]; ! } ! if( ob ) { ! return ob; ! } ! } ! else { ! ob = present(var, env); ! if( ob ) return ob; ! else if( env = environment(env) ) { ! ob = present(var, env); ! if( ob ) return ob; ! } ! if( ob = find_player(var) ) return ob; ! if( ob = find_living(var) ) return ob; ! if( !this_player() ) { ! return 0; ! } ! var = absolute_path(this_player()->query_cwd(), var); ! if(!file_exists(var)) var += ".c"; ! if(!file_exists(var)) var = ""; ! if( sizeof(var) && ob = load_object(var) ) { ! return ob; ! } ! } ! return 0; } return 0; } diff -c -r --new-file ds1.1/lib/secure/sefun/to_object.orig ds2.0r27/lib/secure/sefun/to_object.orig *** ds1.1/lib/secure/sefun/to_object.orig Fri Jan 3 22:16:26 1997 --- ds2.0r27/lib/secure/sefun/to_object.orig Wed Dec 31 19:00:00 1969 *************** *** 1,149 **** - // file: to_object.c (simul_efun) - // mudlib: CynoMUD-II - // author: Truilkan - // date: 1992 September 17 - // purpose: Converts a string into the object it represents. This object - // is intended to be used as a parser by those wizard commands that need - // to refer to objects by various means (such as dest and trans). - - // to_object() returns the object that a given string references. - // strings are of the form 'object' or 'object@environment' where environment - // can also be of the form 'object@environment'. object may also be of - // the form 'e(object)' which refers to the environment of object. - // - // object may optionally be prefixed with one of the following symbols: - // - // ! (what follows names an object that is not an NPC or a player) - // % (what follows names a player) - // $ (what follows names an NPC) - // # (what follows is an ordinal value, e.g. #3, #4, etc) - // / (what follows is a filename of an object) - // - // object may also be one of the words "here" or "me" where here refers - // to the environment of this player and "me" refers to this_player(). - // - // example usage: - - /* - object obj; - - // find the object which has an id of "key" and is in player truilkan's - // inventory. - // - obj = to_object("!key@%truilkan"); - // - // find the orc NPC which is in the bag which is in the church - // - obj = to_object("$orc@!bag@/room/church"); - // - // Destroy the 4th object in the inventory of the environment of this - // player (0 is the first object :) - // - to_object("#3@here")->eventDestruct(); - */ - - static object - e(object p, int outside) - { - if (outside) { - return p ? environment(p) : 0; - } else { - return p; - } - } - - object - to_object(mixed target) - { - int ch; - string err; - - if (objectp(target)) { /* already an object */ - return target; - } else if (stringp(target)) { /* is a string */ - string str, thing, env_desc, temp, path; - object env, p, *list; - int len, outside, is_object, place, which; - - outside = 0; - place = 0; - env = 0; - str = (string)target; - if (sscanf(str,"e(%s)",temp) == 1) { - str = temp; - outside = 1; - } - if (sscanf(str,"%s@%s", thing, env_desc) == 2) { - str = thing; - if (!(env = to_object(env_desc))) { - return 0; - } - place = 1; - } - if (str == "here") { - return e(environment(this_player()), outside); - } - if (str == "me") { - return e(this_player(), outside); - } - if (!env) { - env = this_player(); - } - len = strlen(str); - ch = str[0]; - if (ch == '/' || ch == '$' || ch == '#' || ch == '%' || ch == '!') { - if (len < 2) { - return 0; - } - if (ch != '/') { - str = str[1..len-1]; - len--; - } - } - p = 0; - is_object = 0; - switch (ch) { - case '/' : /* filename */ - if(file_size(str + ".c") < 0) return 0; /* patch by val */ - return e(load_object(str), outside); - case '#' : /* nth object */ - list = all_inventory(env); - sscanf(str, "%d", which); - return e(list[which], outside); - case '$' : /* monster */ - p = find_living(str); - if (!p || interactive(p)) { - return 0; /* p non-existent or was a player */ - } - break; - case '%' : /* player */ - p = find_player(str); - if (!p) { - return 0; - } - break; - case '!' : - is_object = 1; - break; - } - if (!is_object) { - if (!p) { - p = find_player(str); - } - if (!p) { - p = find_living(str); - } - } - if (!p) { - p = present(str, env); - } - if (p && (!place || present(p, env))) { - return e(p, outside); - } - path = (string)this_player()->resolve_path(str); - if(!path) return 0; - /* patch added by valodin to avoid searching for bad path */ - return e(load_object(path), outside); - } - return 0; - } --- 0 ---- diff -c -r --new-file ds1.1/lib/secure/sefun/translate.c ds2.0r27/lib/secure/sefun/translate.c *** ds1.1/lib/secure/sefun/translate.c Sun Feb 1 21:30:50 1998 --- ds2.0r27/lib/secure/sefun/translate.c Wed Jul 5 00:01:06 2006 *************** *** 4,26 **** // created by Descartes of Borg 930823 // based on a speak function by Valodin@Dead Souls ! #define FLUBS ({ "womble", "assimilate", "scruvy", "bing", "lait", "krishe",\ ! "something", "blarg", "gyro", "yellow hephalumps", "darmok", "tanagra",\ ! "cabbage", "blurgle", "jello", "migrated", "furry", "driznit", "folnar",\ ! "pamplemousse", "burrito", "eyne", "duh", "hamster",\ }) string translate(string str, int prof) { if( prof >= 100 ) return str; else { string *words; - string word; int fs, i, maxi; fs = sizeof(FLUBS); words = explode(str, " "); ! for(i=0, maxi = sizeof(words); i < maxi; i++) ! if( random(100) >= prof ) words[i] = FLUBS[random(fs)]; return implode(words, " "); } } --- 4,73 ---- // created by Descartes of Borg 930823 // based on a speak function by Valodin@Dead Souls ! #define FLUBS ({ "lacunae", "uns", "sur",\ ! "HWAET","shaka","jalad", "darmok", "tanagra",\ ! "scyld", "sweorda", "narthex", "luft", "mit", "folnar",\ ! "temba", "temak", "le","la","nous","avec","mais","foutre",\ ! "cyning", "thara", "stanas", "seo", "stanum", "res", "ipso","stana",\ ! "meh", "nehi", "samastahum", "tora", "kia-ab", "boltehe", \ ! "ata", "mevin", "ivrit", "ktzat", "lo", "ani", "tov","aval", \ ! "verstehen", "sie", "bisschen", "sehr", "aber", "etwas", "keinen",\ ! "shomo", "mifahmin", "mifahmam", "katalavenete", "hellenika",\ ! "spreek", "uw", "vrauw", "nit", "shiz", "se","pericolo",\ ! "iskit", "imhud", "halas", "sagud", "imche", "eigoga", "nihongo",\ ! "wakarimaska", "wakarimasen", "samastihenh", "iye", "hai",\ ! "ni", "huei", "shwa", "potong-hwa", "mah", "wa", "ideahr",\ ! "khairei", "hoc", "propter", "auch", "vielen",\ ! "forshtor", "deuw", "noshk", "puedo", "pero", "debajo" , "atras",\ ! "mientras", "desde", "nunca", "haka", "silflay", "embleer", "hraka",\ ! "mbembe", "mau-mau","tiki","meka","leka","hai","haini","ho", \ ! "chonny","mola","chala","hala","hei","thlon","mey","nikto",\ ! "ecgum", "eyne", "sobre","dupa","zum","schlampe","jodio","con",\ ! "narfle", "garthak", "hokanda-matuso","oota-goota","mafi","makka",\ ! "shukran", "akbar", "mokele",\ ! "curiae", "aethelingas", "eorlas","carajo","oder",\ ! "ae","aroha","awarua","atua","tenei",\ ! "tangata","koa","kora","hupane","upane",\ ! "baardaap","droogkloot","reetketelsteenbeeldhouwer","asbak","haka",\ ! "zaadje","verkloten","teef","moffie","shele",\ ! "anasi","atouche","ayir","boos","teezee",\ ! "durka","haista","vittu","kyrpä","räkä",\ ! "suoro","voi","debil","kunel","shinel",\ ! "sasikumea","zakila","txakurra","soustat","irrumator",\ ! "mentula","koproskilo","malakas","la'a'za'zel","zayin",\ ! "ar","ot","ti","fi","na",\ ! "ar","ot","ti","fi","na",\ ! "ar","ot","ti","fi","na",\ ! "ar","ot","ti","fi","na",\ ! "ar","ot","ti","fi","na",\ ! "ar","ot","ti","fi","na",\ ! "o","u","y","e",\ ! "o","u","y","e",\ ! "o","u","y","e",\ ! "o","u","y","e",\ ! "o","u","y","e",\ ! "o","u","y","e",\ ! "ki","ika","ita","ite","ni",\ ! "ki","ika","ita","ite","ni",\ ! "kii-oto","kii-oto","kii-oto","kii-oto","kii-oto",\ ! "kii-ateh","kii-ateh","kii-ateh","kii-ateh","kii-ateh",\ }) string translate(string str, int prof) { if( prof >= 100 ) return str; else { string *words; int fs, i, maxi; fs = sizeof(FLUBS); words = explode(str, " "); ! for(i=0, maxi = sizeof(words); i < maxi; i++){ ! string prefix = ""; ! string suffix = ""; ! if(!alphap(first(words[i],1))) prefix = first(words[i],1); ! if(!alphap(last(words[i],1))) suffix = last(words[i],1); ! if( random(100) >= prof ) words[i] = prefix+FLUBS[random(fs)]+suffix; ! } return implode(words, " "); } } diff -c -r --new-file ds1.1/lib/secure/sefun/user_path.c ds2.0r27/lib/secure/sefun/user_path.c *** ds1.1/lib/secure/sefun/user_path.c Sun Feb 1 21:30:50 1998 --- ds2.0r27/lib/secure/sefun/user_path.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** string user_path(string name) { ! return ("/realms/"+name+"/"); } --- 1,5 ---- string user_path(string name) { ! return ("/realms/"+name+"/"); } diff -c -r --new-file ds1.1/lib/secure/sefun/values.c ds2.0r27/lib/secure/sefun/values.c *** ds1.1/lib/secure/sefun/values.c Sun Feb 1 21:30:50 1998 --- ds2.0r27/lib/secure/sefun/values.c Wed Jul 5 00:01:06 2006 *************** *** 7,14 **** #include "sefun.h" mixed convert_value(string val) { ! if( !val || val == "" ) return 0; ! switch( val[0] ) { ! case '(': ! if( strlen(val) == 1 ) error("Badly formed value: " + val + "\n"); ! switch( val[1] ) { --- 7,31 ---- #include "sefun.h" mixed convert_value(string val) { ! return 1; ! } ! ! int round(string f){ ! int frac,num; ! string str; ! if(strsrch(f,".") == -1) { ! if(!sscanf(f,"%d",num)) return 0; ! else return num; ! } ! ! if(sscanf(f,"%d.%s",num,str) < 2) sscanf(f,".%s",str); ! ! if(!str || str == "") return -1; ! ! if(!sscanf(str[0],"%d",frac)) return -2; ! ! if(frac > 4) num++; ! else num--; ! return num; ! } ! diff -c -r --new-file ds1.1/lib/secure/sefun/visible.c ds2.0r27/lib/secure/sefun/visible.c *** ds1.1/lib/secure/sefun/visible.c Sun Feb 1 21:30:51 1998 --- ds2.0r27/lib/secure/sefun/visible.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** varargs int visible( object detectee_obj, object detector_obj ) { return 0; ! /* this function is not quite working without uid's ! */ } --- 1,5 ---- varargs int visible( object detectee_obj, object detector_obj ) { return 0; ! /* this function is not quite working without uid's ! */ } diff -c -r --new-file ds1.1/lib/secure/sefun/wild_card.c ds2.0r27/lib/secure/sefun/wild_card.c *** ds1.1/lib/secure/sefun/wild_card.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/sefun/wild_card.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,23 ---- + /* + * Brodbane@Eve 03/03/06 + * Adapted from original by Caliel@BloodRose + */ + varargs string *wild_card(string str) { + mixed pf; string *tmp, cwd; + if((cwd = absolute_path("cwd",str)) == "/") return ({ "/" }); + if((string)(pf= path_file(cwd)) == "/") pf[0] = ""; + if(!(tmp = get_dir(cwd))) tmp = ({}); + tmp -= ({ ".", ".." }); + if(!str || str[0] != '.') tmp = filter_array(tmp,"remove_dots",this_object()); + for(int i=0;i<sizeof(tmp);i++) { + if(file_size(sprintf("%s/%s", pf[0], pf[1])) == -2) tmp[i] = pf[0]; + else tmp[i] = sprintf("%s/%s", pf[0], tmp[i]); + if(strlen(tmp[i]) > 1 && tmp[i][0..1] == "//") + tmp[i] = tmp[i][1..strlen(tmp[i])-1]; + } + return tmp; + } + + nomask int remove_dots(string str) { return !(str[0] == '.'); } + + diff -c -r --new-file ds1.1/lib/secure/sefun/wipe_inv.c ds2.0r27/lib/secure/sefun/wipe_inv.c *** ds1.1/lib/secure/sefun/wipe_inv.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/secure/sefun/wipe_inv.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,26 ---- + #include <lib.h> + #include <dirs.h> + + int wipe_inv(mixed dude){ + string nom, str, orig_file, bak_file, contents; + + if(objectp(dude) && !nom = dude->GetKeyName()) return 0; + if(stringp(dude) && !nom = lower_case(dude)) return -1; + if(!nom || !sizeof(nom)) return -2; + if(!user_exists(nom)) return -3; + + str = DIR_PLAYERS "/" + nom[0..0] + "/" + nom; + if( !str || !file_exists(str + __SAVE_EXTENSION__) ) + str = DIR_CRES "/" + nom[0..0] + "/" + nom; + + orig_file = str + __SAVE_EXTENSION__; + bak_file = str + "_rescue" + __SAVE_EXTENSION__; + + cp(orig_file, bak_file); + contents = replace_string(read_file(orig_file),"\n",";\n"); + contents = remove_matching_line(contents, "Inventory"); + contents = replace_string(contents, ";\n", "\n"); + //write_file(generate_tmp()+".o",contents); + write_file(orig_file, contents,1); + return 1; + } diff -c -r --new-file ds1.1/lib/shadows/drone.c ds2.0r27/lib/shadows/drone.c *** ds1.1/lib/shadows/drone.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/shadows/drone.c Wed Jul 5 00:00:59 2006 *************** *** 0 **** --- 1,12 ---- + #include <lib.h> + #include <dirs.h> + + inherit "/secure/npc/drone"; + inherit "/lib/shadow"; + + int QueryDrone(){ + return 1; + } + + + diff -c -r --new-file ds1.1/lib/spells/buffer.c ds2.0r27/lib/spells/buffer.c *** ds1.1/lib/spells/buffer.c Sun Feb 1 21:31:01 1998 --- ds2.0r27/lib/spells/buffer.c Wed Jul 5 00:00:59 2006 *************** *** 27,35 **** SetDifficulty(50); SetMorality(10); SetHelp("Syntax: <cast buffer>\n" ! " <cast buffer on LIV>\n\n" ! "A magical defense spell that allows the caster to create " ! "a glowing shield around the LIVing object named.\n\n"); } int eventCast(object who, int level, string race, object array targets) { --- 27,35 ---- SetDifficulty(50); SetMorality(10); SetHelp("Syntax: <cast buffer>\n" ! " <cast buffer on LIV>\n\n" ! "A magical defense spell that allows the caster to create " ! "a glowing shield around the LIVing object named.\n\n"); } int eventCast(object who, int level, string race, object array targets) { *************** *** 53,91 **** target->AddMagicProtection(protection); if( target == who ) { send_messages("", "A %^BOLD%^CYAN%^translucent magical shield%^RESET%^ " ! "suddenly appears around $agent_possessive_noun body.", who, 0, ! environment(target)); } else { send_messages("", "A %^BOLD%^CYAN%^translucent magical shield%^RESET%^ " ! "suddenly appears around $target_possessive_noun body.", who, ! target, environment(target)); } return 1; } int hitCallback(object who, object agent, int x, class MagicProtection cl) { ! string str; ! object Caster = cl->caster; ! ! if( (int)agent->GetUndead() ) return 0; ! str = (string)agent->GetName() || (string)agent->GetShort(); ! if( who == Caster ) { ! who->eventTrainSkill("magic defense",cl->args,x,1); } ! else if( Caster && playerp(who) && Caster != who ) { ! Caster->eventTrainSkill("magic defense",cl->args,0,1); } ! send_messages("", "The %^YELLOW%^magical shield%^RESET%^ around " ! "$agent_name wavers as $target_name strikes it.", ! who, agent, environment(who)); ! return x; } ! void endCallback(object who) { if( who ) { send_messages("", "The %^BOLD%^CYAN%^magical shield%^RESET%^ around " ! "$agent_name shatters into nothingness.", who, 0, environment(who)); } } --- 53,91 ---- target->AddMagicProtection(protection); if( target == who ) { send_messages("", "A %^BOLD%^CYAN%^translucent magical shield%^RESET%^ " ! "suddenly appears around $agent_possessive_noun body.", who, 0, ! environment(target)); } else { send_messages("", "A %^BOLD%^CYAN%^translucent magical shield%^RESET%^ " ! "suddenly appears around $target_possessive_noun body.", who, ! target, environment(target)); } return 1; } int hitCallback(object who, object agent, int x, class MagicProtection cl) { ! string str; ! object Caster = cl->caster; ! ! if( (int)agent->GetUndead() ) return 0; ! str = (string)agent->GetName() || (string)agent->GetShort(); ! if( who == Caster ) { ! who->eventTrainSkill("magic defense",cl->args,x,1); } ! else if( Caster && playerp(who) && Caster != who ) { ! Caster->eventTrainSkill("magic defense",cl->args,0,1); } ! send_messages("", "The %^YELLOW%^magical shield%^RESET%^ around " ! "$agent_name wavers as $target_name strikes it.", ! who, agent, environment(who)); ! return x; } ! void endCallback(object who) { if( who ) { send_messages("", "The %^BOLD%^CYAN%^magical shield%^RESET%^ around " ! "$agent_name shatters into nothingness.", who, 0, environment(who)); } } diff -c -r --new-file ds1.1/lib/spells/cure.c ds2.0r27/lib/spells/cure.c *** ds1.1/lib/spells/cure.c Sun Feb 1 21:31:01 1998 --- ds2.0r27/lib/spells/cure.c Wed Jul 5 00:00:59 2006 *************** *** 20,30 **** SetRequiredMagic(300); SetSkills(([ "healing" : 30 ])); SetMagicCost( 3, 3); ! SetHealing(3,3); SetDifficulty(30); SetHelp("Syntax: <cast cure on LIV>\n\n" ! "This powerful healing spell completely heals the" ! " target at great expense to the caster."); } int eventCast(object who, int level, mixed limbs, object array targets) { --- 20,30 ---- SetRequiredMagic(300); SetSkills(([ "healing" : 30 ])); SetMagicCost( 3, 3); ! SetHealing(3,3); SetDifficulty(30); SetHelp("Syntax: <cast cure on LIV>\n\n" ! "This powerful healing spell completely heals the" ! " target at great expense to the caster."); } int eventCast(object who, int level, mixed limbs, object array targets) { *************** *** 33,66 **** if(!spell::eventCast(who,level,targets)) return 0; if( target == who ) { who->eventPrint("You can't cast cure on yourself!"); ! return 0; } else { send_messages("", "$agent_possessive_noun spell completely heals " ! "$target_name!",who, ! target, environment(target)); ! health = target->GetMaxHealthPoints()-target->GetHealthPoints(); ! magic = target->GetMaxMagicPoints()-target->GetMagicPoints(); ! stamina = target->GetMaxStaminaPoints()-target->GetStaminaPoints(); ! if(health) target->eventHealDamage(health); ! if(magic) target->AddMagicPoints(magic); ! if(stamina) target->AddStaminaPoints(stamina); ! tot = health+magic+stamina; ! if(tot) ! who->eventTrainSkill("healing",0,0,1,tot); ! health -= level * 3; ! stamina -= level * 3; send_messages("collapse","%^RED%^$agent_name $agent_verb " ! "from the effort of casting " ! "such a spell!%^RESET%^", who, ! 0, environment(target)); ! if(health > who->GetHealthPoints()) ! who->eventReceiveDamage(who,SHOCK,who->GetHealthPoints()-1); ! else who->eventReceiveDamage(who,SHOCK,health); ! who->AddStaminaPoints(-stamina); ! who->AddMagicPoints(-who->GetMagicPoints()); ! who->eventForce("lie down"); ! who->SetParalyzed(3+random(3)); } return 1; } --- 33,66 ---- if(!spell::eventCast(who,level,targets)) return 0; if( target == who ) { who->eventPrint("You can't cast cure on yourself!"); ! return 0; } else { send_messages("", "$agent_possessive_noun spell completely heals " ! "$target_name!",who, ! target, environment(target)); ! health = target->GetMaxHealthPoints()-target->GetHealthPoints(); ! magic = target->GetMaxMagicPoints()-target->GetMagicPoints(); ! stamina = target->GetMaxStaminaPoints()-target->GetStaminaPoints(); ! if(health) target->eventHealDamage(health); ! if(magic) target->AddMagicPoints(magic); ! if(stamina) target->AddStaminaPoints(stamina); ! tot = health+magic+stamina; ! if(tot) ! who->eventTrainSkill("healing",0,0,1,tot); ! health -= level * 3; ! stamina -= level * 3; send_messages("collapse","%^RED%^$agent_name $agent_verb " ! "from the effort of casting " ! "such a spell!%^RESET%^", who, ! 0, environment(target)); ! if(health > who->GetHealthPoints()) ! who->eventReceiveDamage(who,SHOCK,who->GetHealthPoints()-1); ! else who->eventReceiveDamage(who,SHOCK,health); ! who->AddStaminaPoints(-stamina); ! who->AddMagicPoints(-who->GetMagicPoints()); ! who->eventForce("lie down"); ! who->SetParalyzed(3+random(3)); } return 1; } diff -c -r --new-file ds1.1/lib/spells/fireball.c ds2.0r27/lib/spells/fireball.c *** ds1.1/lib/spells/fireball.c Sun Feb 1 21:31:01 1998 --- ds2.0r27/lib/spells/fireball.c Wed Jul 5 00:00:59 2006 *************** *** 18,44 **** SetSpellType(SPELL_COMBAT); SetRequiredMagic(50); SetSkills(([ "conjuring" : 8, "magic attack" : 0 ])); ! SetMagicCost(10, 8); SetDifficulty(10); SetMorality(-20); SetAutoDamage(0); ! SetDamage(MAGIC|HEAT, 20, 15); SetMessages(({ ({ "accept", "$target_name $target_verb " ! "$agent_possessive_noun fireball with a " ! "smile." }), ! ({ "are", "$target_name $target_verb slightly " ! "charred by $agent_possessive_noun " ! "fireball." }), ! ({ "", "$agent_possessive_noun " ! "%^RED%^fireball%^RESET%^ " ! "lights $target_name on fire!" }), ! ({ "are", "$target_name $target_verb burned to " ! "a crisp by $agent_possessive_noun " ! "%^BOLD%^RED%^fireball%^RESET%^." }) })); SetHelp("Syntax: <cast fireball>\n" ! " <cast fireball on LIVING>\n\n" ! "This spell creates a conjures a tremendous fireball out of " ! "thin air and sends it hurling towards an unsuspecting enemy. " ! "If cast without specifying a target while in combat, the " ! "fireball is targetted at your current enemy."); } --- 18,45 ---- SetSpellType(SPELL_COMBAT); SetRequiredMagic(50); SetSkills(([ "conjuring" : 8, "magic attack" : 0 ])); ! SetMagicCost(30, 24); ! SetStaminaCost(20, 16); SetDifficulty(10); SetMorality(-20); SetAutoDamage(0); ! SetDamage(MAGIC|HEAT, ({ 20, 15 }) ); SetMessages(({ ({ "accept", "$target_name $target_verb " ! "$agent_possessive_noun fireball with a " ! "smile." }), ! ({ "are", "$target_name $target_verb slightly " ! "charred by $agent_possessive_noun " ! "fireball." }), ! ({ "", "$agent_possessive_noun " ! "%^RED%^fireball%^RESET%^ " ! "lights $target_name on fire!" }), ! ({ "are", "$target_name $target_verb burned to " ! "a crisp by $agent_possessive_noun " ! "%^BOLD%^RED%^fireball%^RESET%^." }) })); SetHelp("Syntax: <cast fireball>\n" ! " <cast fireball on LIVING>\n\n" ! "This spell creates a conjures a tremendous fireball out of " ! "thin air and sends it hurling towards an unsuspecting enemy. " ! "If cast without specifying a target while in combat, the " ! "fireball is targetted at your current enemy."); } diff -c -r --new-file ds1.1/lib/spells/meditate.c ds2.0r27/lib/spells/meditate.c *** ds1.1/lib/spells/meditate.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/spells/meditate.c Wed Jul 5 00:00:59 2006 *************** *** 0 **** --- 1,48 ---- + /* /spells/buffer.c + * From Nightmare LPMud + * Created by Blitz + * Converted to new spell system by BillGates 961119 + * Version: @(#) buffer.c 1.6@(#) + * Last modified: 96/11/10 + */ + + #include <lib.h> + #include <magic.h> + #include <damage_types.h> + #include <magic_protection.h> + + inherit LIB_SPELL; + + static void create() { + spell::create(); + SetSpell("meditate"); + SetRules("", "LIV"); + SetSpellType(SPELL_DEFENSE); + SetRequiredMagic(50); + SetSkills(([ "magic defense" : 0 ])); + SetMagicCost(150, 100); + SetDifficulty(1); + SetMorality(10); + SetHelp("Syntax: <cast meditate>\n" + "A magical restoration spell that allows the caster to " + "restore their health and strength more quickly.\n\n"); + } + + int eventCast(object who, int level) { + int wis, skill, stamina_level; + wis = who->GetStatLevel("wisdom"); + skill = who->GetSkillLevel("magic defense"); + stamina_level = level; + stamina_level *= (random(skill/10) + 1); + stamina_level += random(wis/2); + stamina_level += 10; + + who->AddStaminaPoints(stamina_level); + new("/secure/obj/meditate_mojo")->eventMove(who); + + send_messages("", "A %^BOLD%^MAGENTA%^dark magical field%^RESET%^ " + "briefly appears around $agent_possessive_noun body.", who, 0, + environment(who)); + return 1; + } + diff -c -r --new-file ds1.1/lib/spells/missile.c ds2.0r27/lib/spells/missile.c *** ds1.1/lib/spells/missile.c Sun Feb 1 21:31:01 1998 --- ds2.0r27/lib/spells/missile.c Wed Jul 5 00:00:59 2006 *************** *** 19,39 **** SetRequiredMagic(5); SetSkills(([ "conjuring" : 0, "magic attack" : 0 ])); SetMagicCost(5, 3); SetDifficulty(0); SetMorality(-1); ! SetAutoDamage(0); ! SetDamage(MAGIC|BLUNT, 10, 5); SetMessages(({ ({ "are", "$target_name $target_verb " ! "unharmed by $agent_possessive " ! "missile." }), ! ({ "sting", "$agent_possessive_noun missile " ! "$agent_verb $target_name." }), ! ({ "slam", "$agent_possessive_noun missile " ! "$agent_verb $target_name." }) })); SetHelp("Syntax: <cast missile>\n" ! " <cast missile on LIVING>\n\n" ! "This spell creates a conjures a magic missile out of " ! "thin air and sends it hurling towards an unsuspecting enemy. " ! "If cast without specifying a target while in combat, the " ! "missile is targetted at your current enemy."); } --- 19,40 ---- SetRequiredMagic(5); SetSkills(([ "conjuring" : 0, "magic attack" : 0 ])); SetMagicCost(5, 3); + SetStaminaCost(5, 3); SetDifficulty(0); SetMorality(-1); ! SetAutoDamage(3); ! SetDamage(MAGIC|BLUNT, ({15, 15}) ); SetMessages(({ ({ "are", "$target_name $target_verb " ! "unharmed by $agent_possessive " ! "missile." }), ! ({ "stings", "$agent_possessive_noun missile " ! "$agent_verb $target_name." }), ! ({ "slams", "$agent_possessive_noun missile " ! "$agent_verb $target_name." }) })); SetHelp("Syntax: <cast missile>\n" ! " <cast missile on LIVING>\n\n" ! "This spell creates a conjures a magic missile out of " ! "thin air and sends it hurling towards an unsuspecting enemy. " ! "If cast without specifying a target while in combat, the " ! "missile is targetted at your current enemy."); } diff -c -r --new-file ds1.1/lib/spells/resurrection.c ds2.0r27/lib/spells/resurrection.c *** ds1.1/lib/spells/resurrection.c Sun Feb 1 21:31:01 1998 --- ds2.0r27/lib/spells/resurrection.c Wed Jul 5 00:00:59 2006 *************** *** 24,51 **** SetDifficulty(40); SetMorality(5); SetHelp("Syntax: <cast refresh>\n" ! " <cast refresh on LIVING>\n\n" ! "This spell allows the caster to \"refresh\" his " ! "or her target's stamina. The amount of stamina " ! "refreshed depends solely on the magical powers of " ! "the caster.\n\n"); } varargs int CanCast(object who, int level, string limb, object array targs) { object target = targs[0]; string targ_rel, my_rel; ! targ_rel = target->GetReligion(1); my_rel = who->GetReligion(1); if( !(int)target->GetUndead() ) { ! who->eventPrint((string)target->GetName() + " is not undead!"); ! return 0; } if( (int)who->ClassMember("cleric") ) return 1; if( targ_rel != my_rel ) { send_messages("are", "$target_name $target_verb not of ", ! "$agent_possessive faith.", ! who, target); return 0; } return spell::CanCast(who, level, limb, targs); --- 24,51 ---- SetDifficulty(40); SetMorality(5); SetHelp("Syntax: <cast refresh>\n" ! " <cast refresh on LIVING>\n\n" ! "This spell allows the caster to \"refresh\" his " ! "or her target's stamina. The amount of stamina " ! "refreshed depends solely on the magical powers of " ! "the caster.\n\n"); } varargs int CanCast(object who, int level, string limb, object array targs) { object target = targs[0]; string targ_rel, my_rel; ! targ_rel = target->GetReligion(1); my_rel = who->GetReligion(1); if( !(int)target->GetUndead() ) { ! who->eventPrint((string)target->GetName() + " is not undead!"); ! return 0; } if( (int)who->ClassMember("cleric") ) return 1; if( targ_rel != my_rel ) { send_messages("are", "$target_name $target_verb not of ", ! "$agent_possessive faith.", ! who, target); return 0; } return spell::CanCast(who, level, limb, targs); *************** *** 55,83 **** object target = targs[0]; int chance = level + random((int)who->GetSkillLevel("healing")); if( level < (30 + random(30)) ) { ! target->AddStaminaPoints(-(int)target->GetStaminaPoints()); ! who->AddStaminaPoints(-(int)who->GetStaminaPoints()); ! who->eventPrint("You feel utterly drained as your " ! "spell of resurrection goes awry.", target); ! target->eventPrint("You feel a draining effect as " + ! possessive_noun(who) + " attempt to resurrect you " ! "goes awry.", who); ! environment(who)->eventPrint( (string)who->GetCapName()+" and "+ ! (string)target->GetCapName()+" both double over in pain " ! "as "+possessive_noun(who)+" spell fails.", ! ({ who, target }) ); ! who->AddMagicPoints(-(int)who->GetMagicPoints()); ! return 0; } send_messages(({ "bring" }), "$agent_name $agent_verb " ! "$target_name back from the dead.", ! who, target, environment(who)); target->eventRevive(); ! who->AddMagicPoints(-(int)who->GetMagicPoints()); return 1; } ! int GetMagicCost() { ! return (int)this_player()->GetMagicPoints(); } --- 55,83 ---- object target = targs[0]; int chance = level + random((int)who->GetSkillLevel("healing")); if( level < (30 + random(30)) ) { ! target->AddStaminaPoints(-(int)target->GetStaminaPoints()); ! who->AddStaminaPoints(-(int)who->GetStaminaPoints()); ! who->eventPrint("You feel utterly drained as your " ! "spell of resurrection goes awry.", target); ! target->eventPrint("You feel a draining effect as " + ! possessive_noun(who) + " attempt to resurrect you " ! "goes awry.", who); ! environment(who)->eventPrint( (string)who->GetCapName()+" and "+ ! (string)target->GetCapName()+" both double over in pain " ! "as "+possessive_noun(who)+" spell fails.", ! ({ who, target }) ); ! who->AddMagicPoints(-(int)who->GetMagicPoints()); ! return 0; } send_messages(({ "bring" }), "$agent_name $agent_verb " ! "$target_name back from the dead.", ! who, target, environment(who)); target->eventRevive(); ! who->AddMagicPoints(-(int)who->GetMagicPoints()); return 1; } ! int GetMagicCost() { ! return (int)this_player()->GetMagicPoints(); } diff -c -r --new-file ds1.1/lib/verbs/common/ask.c ds2.0r27/lib/verbs/common/ask.c *** ds1.1/lib/verbs/common/ask.c Sun Feb 1 21:30:56 1998 --- ds2.0r27/lib/verbs/common/ask.c Wed Jul 5 00:01:06 2006 *************** *** 2,34 **** * from the Dead Souls Object Library * created by Blitz@Dead Souls */ ! #pragma save_binary #include <lib.h> #include <talk_type.h> #include "include/ask.h" ! inherit LIB_VERB; ! static void create() { verb::create(); SetVerb("ask"); SetRules("LIV STR", "STR", "LIV to STR", "LIV for STR"); SetErrorMessage("Ask what? Or ask whom to do what?"); SetHelp("Syntax: <ask LIVING SOMETHING>\n" ! " <ask SOMETHING>\n" ! " <ask LIVING to DO SOMETHING>\n" ! " <ask LIVING for SOMTHING>\n\n" ! "Some npcs and perhaps some inanimate objects will respond " ! "when you query the target with a specific question.\n\n" ! "See also: reply, say, shout, speak, tell, whisper, yell"); } ! mixed can_ask_liv_to_str(string str) { return 1; } ! mixed can_ask_liv_for_str(string str) { return 1; } ! mixed can_ask_liv_str(string str) { string tmp; --- 2,34 ---- * from the Dead Souls Object Library * created by Blitz@Dead Souls */ ! #pragma save_binary #include <lib.h> #include <talk_type.h> #include "include/ask.h" ! inherit LIB_VERB; ! static void create() { verb::create(); SetVerb("ask"); SetRules("LIV STR", "STR", "LIV to STR", "LIV for STR"); SetErrorMessage("Ask what? Or ask whom to do what?"); SetHelp("Syntax: <ask LIVING SOMETHING>\n" ! " <ask SOMETHING>\n" ! " <ask LIVING to DO SOMETHING>\n" ! " <ask LIVING for SOMTHING>\n\n" ! "Some npcs and perhaps some inanimate objects will respond " ! "when you query the target with a specific question.\n\n" ! "See also: reply, say, shout, speak, tell, whisper, yell"); } ! mixed can_ask_liv_to_str(string str) { return 1; } ! mixed can_ask_liv_for_str(string str) { return 1; } ! mixed can_ask_liv_str(string str) { string tmp; *************** *** 39,73 **** else if( sscanf(str, "for %s", tmp) ) return 1; else return (mixed)this_player()->CanSpeak(/* ob */0, TALK_LOCAL, str); } ! mixed can_ask_str(string str) { return (mixed)this_player()->CanSpeak(0, TALK_LOCAL, str);; } ! mixed do_ask_liv_to_str(object ob, string str) { message("my_action", "You ask "+(string)ob->GetName()+" to "+str+".", ! this_player() ); message("other_action", (string)this_player()->GetName()+" asks " ! "you to "+str+".", ob); message("other_action", (string)this_player()->GetName()+" asks "+ ! (string)ob->GetName()+" to "+str+".", ! environment(ob), ({ ob, this_player() }) ); ob->eventAsk(this_player(), str); return 1; } ! mixed do_ask_liv_for_str(object ob, string str) { message("my_action", "You ask "+(string)ob->GetName()+" for "+str+".", ! this_player() ); message("other_action", (string)this_player()->GetName()+" asks "+ ! (string)ob->GetName()+" for "+str+".", ! environment(ob), ({ ob, this_player() }) ); if( !((int)ob->eventRequest(this_player(), str)) ) ! message("other_action", (string)this_player()->GetName()+" asks " ! "you for "+str+".", ob); return 1; } ! mixed do_ask_liv_str(object ob, string str) { mixed tmp; --- 39,73 ---- else if( sscanf(str, "for %s", tmp) ) return 1; else return (mixed)this_player()->CanSpeak(/* ob */0, TALK_LOCAL, str); } ! mixed can_ask_str(string str) { return (mixed)this_player()->CanSpeak(0, TALK_LOCAL, str);; } ! mixed do_ask_liv_to_str(object ob, string str) { message("my_action", "You ask "+(string)ob->GetName()+" to "+str+".", ! this_player() ); message("other_action", (string)this_player()->GetName()+" asks " ! "you to "+str+".", ob); message("other_action", (string)this_player()->GetName()+" asks "+ ! (string)ob->GetName()+" to "+str+".", ! environment(ob), ({ ob, this_player() }) ); ob->eventAsk(this_player(), str); return 1; } ! mixed do_ask_liv_for_str(object ob, string str) { message("my_action", "You ask "+(string)ob->GetName()+" for "+str+".", ! this_player() ); message("other_action", (string)this_player()->GetName()+" asks "+ ! (string)ob->GetName()+" for "+str+".", ! environment(ob), ({ ob, this_player() }) ); if( !((int)ob->eventRequest(this_player(), str)) ) ! message("other_action", (string)this_player()->GetName()+" asks " ! "you for "+str+".", ob); return 1; } ! mixed do_ask_liv_str(object ob, string str) { mixed tmp; *************** *** 77,83 **** else str = capitalize(str); return (mixed)this_player()->eventSpeak(ob, TALK_LOCAL, str); } ! mixed do_ask_str(string str) { if( str[<1] != '?' ) str = capitalize(str) + "?"; else str = capitalize(str); --- 77,83 ---- else str = capitalize(str); return (mixed)this_player()->eventSpeak(ob, TALK_LOCAL, str); } ! mixed do_ask_str(string str) { if( str[<1] != '?' ) str = capitalize(str) + "?"; else str = capitalize(str); diff -c -r --new-file ds1.1/lib/verbs/common/body.c ds2.0r27/lib/verbs/common/body.c *** ds1.1/lib/verbs/common/body.c Sun Feb 1 21:30:57 1998 --- ds2.0r27/lib/verbs/common/body.c Wed Jul 5 00:01:06 2006 *************** *** 3,26 **** * gives player a report based on limb damage * created by Blitz@Dead Souls */ ! #pragma save_binary #include <lib.h> #include <rounds.h> ! inherit LIB_DAEMON; ! varargs void eventCheckBody(object ob, object receiver); ! static void create() { ! daemon::create(); ! SetNoClean(1); ! parse_init(); ! parse_add_rule("body", "LIV"); ! parse_add_rule("body", ""); } ! static string *DamageDegree = ({ "is in critical condition!", "is battered beyond recognition.", --- 3,26 ---- * gives player a report based on limb damage * created by Blitz@Dead Souls */ ! #pragma save_binary #include <lib.h> #include <rounds.h> ! inherit LIB_DAEMON; ! varargs void eventCheckBody(object ob, object receiver); ! static void create() { ! daemon::create(); ! SetNoClean(1); ! parse_init(); ! parse_add_rule("body", "LIV"); ! parse_add_rule("body", ""); } ! static string *DamageDegree = ({ "is in critical condition!", "is battered beyond recognition.", *************** *** 33,137 **** "is in very good shape.", "is in excellent shape.", }); ! int livings_are_remote() { return 1; } ! mixed can_body() { ! if( creatorp(this_player()) ) ! return "Creator syntax: body <living>"; ! return 1; } ! mixed can_body_liv() { ! if( !creatorp(this_player()) ) ! return "Body does not require any arguments."; ! return 1; } ! mixed do_body() { ! message("other_action", (string)this_player()->GetName()+" checks "+ ! reflexive(this_player())+" for injuries.", ! environment(this_player()), this_player() ); ! eventCheckBody(this_player()); ! return 1; } ! mixed do_body_liv(object ob) { ! eventCheckBody(ob, this_player()); ! return 1; } ! varargs void eventCheckBody(object ob, object receiver) { ! string ret, name; ! string *limbs; ! mapping mp; ! int i, damage; ! int *key; ! ! mp = ([ ]); ! if( !ob ) return; ! if( !receiver ) receiver = ob; ! i = sizeof(limbs = (string *)ob->GetLimbs()); ! while(i--) { ! damage = to_int( percent( (int)ob->GetHealthPoints(limbs[i]), ! (int)ob->GetMaxHealthPoints(limbs[i]) )); ! if( !mp[damage] ) mp[damage] = ({ limbs[i] }); ! else mp[damage] += ({ limbs[i] }); ! } ! i = sizeof(key = sort_array(keys(mp), 1)); ! name = (ob == receiver ? "Your" : capitalize(possessive(ob))); ! ret = possessive_noun((string)ob->GetCapName()) + " bodily damage " ! "report:\n\n"; ! foreach(damage in key) { ! string str; ! string color; ! int x; ! i = sizeof(limbs = mp[damage]); while(i--) { ! switch(damage) { ! case 0..3: color = "%^BOLD%^%^RED%^"; break; ! case 4..10: color = "%^RED%^"; break; ! case 11..20: color = "%^YELLOW%^"; break; ! default: color = ""; ! } ! if( damage > 97 ) ! str = name +" "+ limbs[i] + " is in perfect condition."; ! else if( damage < 4 ) ! str = name+" "+ limbs[i] +" is about to fall off!"; ! else { ! x = damage / 10; ! if(x>9) x = 9; ! str = name +" "+ limbs[i] +" "+ DamageDegree[x]; ! } ! if( creatorp(receiver) ) ! ret += sprintf("%s%-45s %s(%d / 100%%)%s\n", color, str, ! "", damage,"%^RESET%^"); ! else ret += (color + str + "%^RESET%^\n"); } ! } ! if( i = sizeof(limbs = (string *)ob->GetMissingLimbs()) ) { ! ret += "\n"+(ob == receiver ? ! "You are missing " : (string)ob->GetName()+" is missing "); ! switch(i) { ! case 0: break; ! case 1: ret += "a "+limbs[0]+"."; break; ! case 2: ret += "a "+limbs[0]+" and a "+limbs[1]+"."; break; ! default: ret += "a "+implode(limbs[0..(i-2)], ", ")+" and " ! "a "+limbs[i-1]+"."; } ! } ! receiver->eventPage(explode(ret, "\n"), "info"); ! return; } ! string GetHelp(string str) { ! if( creatorp(this_player()) ) ! return "Syntax: body LIVING\n\n" ! "This command will display the current limb damage " ! "statistics of the living object named."; ! else ! return "Syntax: body\n\n" ! "This command will display your current limb damage " ! "statistics. The limbs will be displayed in order " ! "of the most damaged to the least."; } --- 33,135 ---- "is in very good shape.", "is in excellent shape.", }); ! int livings_are_remote() { return 1; } ! mixed can_body() { ! return 1; } ! mixed can_body_liv() { ! if( !creatorp(this_player()) ) ! return "Body does not require any arguments."; ! return 1; } ! mixed do_body() { ! message("other_action", (string)this_player()->GetName()+" checks "+ ! reflexive(this_player())+" for injuries.", ! environment(this_player()), this_player() ); ! eventCheckBody(this_player()); ! return 1; } ! mixed do_body_liv(object ob) { ! eventCheckBody(ob, this_player()); ! return 1; } ! varargs void eventCheckBody(object ob, object receiver) { ! string ret, name; ! string *limbs; ! mapping mp; ! int i, damage; ! int *key; ! ! mp = ([ ]); ! if( !ob ) return; ! if( !receiver ) receiver = ob; ! i = sizeof(limbs = (string *)ob->GetLimbs()); while(i--) { ! damage = to_int( percent( (int)ob->GetHealthPoints(limbs[i]), ! (int)ob->GetMaxHealthPoints(limbs[i]) )); ! if( !mp[damage] ) mp[damage] = ({ limbs[i] }); ! else mp[damage] += ({ limbs[i] }); ! } ! i = sizeof(key = sort_array(keys(mp), 1)); ! name = (ob == receiver ? "Your" : capitalize(possessive(ob))); ! ret = possessive_noun((string)ob->GetCapName()) + " bodily damage " ! "report:\n\n"; ! foreach(damage in key) { ! string str; ! string color; ! int x; ! i = sizeof(limbs = mp[damage]); ! while(i--) { ! switch(damage) { ! case 0..3: color = "%^BOLD%^%^RED%^"; break; ! case 4..10: color = "%^RED%^"; break; ! case 11..20: color = "%^YELLOW%^"; break; ! default: color = ""; ! } ! if( damage > 97 ) ! str = name +" "+ limbs[i] + " is in perfect condition."; ! else if( damage < 4 ) ! str = name+" "+ limbs[i] +" is about to fall off!"; ! else { ! x = damage / 10; ! if(x>9) x = 9; ! str = name +" "+ limbs[i] +" "+ DamageDegree[x]; ! } ! if( creatorp(receiver) ) ! ret += sprintf("%s%-45s %s(%d / 100%%)%s\n", color, str, ! "", damage,"%^RESET%^"); ! else ret += (color + str + "%^RESET%^\n"); ! } } ! if( i = sizeof(limbs = (string *)ob->GetMissingLimbs()) ) { ! ret += "\n"+(ob == receiver ? ! "You are missing " : (string)ob->GetName()+" is missing "); ! switch(i) { ! case 0: break; ! case 1: ret += "a "+limbs[0]+"."; break; ! case 2: ret += "a "+limbs[0]+" and a "+limbs[1]+"."; break; ! default: ret += "a "+implode(limbs[0..(i-2)], ", ")+" and " ! "a "+limbs[i-1]+"."; ! } } ! receiver->eventPage(explode(ret, "\n"), "info"); ! return; } ! string GetHelp(string str) { ! if( creatorp(this_player()) ) ! return "Syntax: body LIVING\n\n" ! "This command will display the current limb damage " ! "statistics of the living object named."; ! else ! return "Syntax: body\n\n" ! "This command will display your current limb damage " ! "statistics. The limbs will be displayed in order " ! "of the most damaged to the least."; } diff -c -r --new-file ds1.1/lib/verbs/common/codesay.c ds2.0r27/lib/verbs/common/codesay.c *** ds1.1/lib/verbs/common/codesay.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/verbs/common/codesay.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,69 ---- + /* /verbs/common/codesay.c + * from the Dead Souls Object Library + * codesay + * codesay STR + */ + + #pragma save_binary + + #include <lib.h> + #include <talk_type.h> + #include "include/codesay.h" + + inherit LIB_DAEMON; + + static void create() { + daemon::create(); + SetNoClean(1); + parse_init(); + /* error conditions */ + parse_add_rule("codesay", ""); + /* actual verbs */ + parse_add_rule("codesay", "STR"); + } + + mixed can_codesay() { return "Say what?"; } + + mixed can_codesay_str(string str) { + if( !str ) return 0; + else return 1; + } + + varargs mixed do_codesay_str(string str) { + string filename = DIR_TMP + "/" + this_player()->GetKeyName() + ".codesay"; + if( !str ) return "Huh?"; + if(strsrch(str,";") == -1){ + write("You codesay: "+"%^BOLD%^CYAN%^"+str+"%^RESET%^"); + say(this_player()->GetCapName()+" codesays: "+ + "%^BOLD%^CYAN%^"+str+"%^RESET%^"); + } + else { + str = replace_string(str, ";", ";\n"); + str = replace_string(str, "{", "{\n"); + str = replace_string(str, "}", "}\n"); + write_file(filename,str,1); + write_file(filename+"_rule","I",1); + load_object("/secure/cmds/creators/lsed")->cmd(filename+"_rule "+filename); + write("You codesay: "); + say(this_player()->GetCapName()+" codesays: "); + tell_room(environment(this_player()),"\n"+ + "%^BOLD%^CYAN%^"+read_file(filename)+"%^RESET%^"); + } + return 1; + } + + mixed do_codesay() { return do_codesay_str(); } + + string GetHelp(string str) { + return ("Syntax: <codesay MESSAGE>\n\n" + "Sends out a message that everyone in the room can see. " + "This message will be stripped of normal punctuation so " + "that text that needs to be seen literally does not cause confusion. " + "If the message contains a semicolon, this command will attempt " + "to format it in indented LPC style. " + "\n\n" + "See also: shout, speak, reply, tell, whisper"); + } + + + diff -c -r --new-file ds1.1/lib/verbs/common/include/codesay.h ds2.0r27/lib/verbs/common/include/codesay.h *** ds1.1/lib/verbs/common/include/codesay.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/verbs/common/include/codesay.h Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,11 ---- + #ifndef l_codesay_h + #define l_codesay_h + + static void create(); + mixed can_codesay(); + mixed can_codesay_str(string str); + mixed do_codesay(); + varargs mixed do_codesay_str(string str); + string GetHelp(string str); + + #endif /* l_codesay_h */ diff -c -r --new-file ds1.1/lib/verbs/common/mail.c ds2.0r27/lib/verbs/common/mail.c *** ds1.1/lib/verbs/common/mail.c Sun Feb 1 21:30:57 1998 --- ds2.0r27/lib/verbs/common/mail.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/common/mail.c ! * from the Dead Souls V Object Library * mail * mail STR * created by Descartes of Borg 950113 --- 1,5 ---- /* /verbs/common/mail.c ! * from the Dead Souls Object Library * mail * mail STR * created by Descartes of Borg 950113 *************** *** 40,55 **** mixed do_mail_str(string str) { object ob; ! if( !creatorp(this_player()) ) ! return (mixed)environment(this_player())->eventMail(this_player(), str); if( !(ob = new(OBJ_POST)) ) { this_player()->eventPrint("Failed to load postal object!"); return 1; } if( !((int)ob->eventMove(this_player())) ) { this_player()->eventPrint("You can't seem to carry the postal " ! "object."); return 1; } ob->start_post(str); --- 40,55 ---- mixed do_mail_str(string str) { object ob; ! if( !creatorp(this_player()) ) ! return (mixed)environment(this_player())->eventMail(this_player(), str); if( !(ob = new(OBJ_POST)) ) { this_player()->eventPrint("Failed to load postal object!"); return 1; } if( !((int)ob->eventMove(this_player())) ) { this_player()->eventPrint("You can't seem to carry the postal " ! "object."); return 1; } ob->start_post(str); *************** *** 58,72 **** string GetHelp(string str) { return ("Syntax: <mail>\n" ! " <mail PLAYER>\n" ! " <mail GROUP>\n\n" ! " <mail PLAYER@MUD>\n\n" ! "Allows you to send mail to another player on this game or " ! "to a player on another game connected to the Intermud 3 " ! "system. Without arguments, you are simply set to read your " ! "mail. With arguments, you are creating mail to be sent. " ! "You may only read mail in your home town. The mailer will " ! "properly route any mail you send to the proper home town " ! "for the player or players you intend it to go to.\n\n" ! "See also: mudlist"); } --- 58,72 ---- string GetHelp(string str) { return ("Syntax: <mail>\n" ! " <mail PLAYER>\n" ! " <mail GROUP>\n\n" ! " <mail PLAYER@MUD>\n\n" ! "Allows you to send mail to another player on this game or " ! "to a player on another game connected to the Intermud 3 " ! "system. Without arguments, you are simply set to read your " ! "mail. With arguments, you are creating mail to be sent. " ! "You may only read mail in your home town. The mailer will " ! "properly route any mail you send to the proper home town " ! "for the player or players you intend it to go to.\n\n" ! "See also: mudlist"); } diff -c -r --new-file ds1.1/lib/verbs/common/say.c ds2.0r27/lib/verbs/common/say.c *** ds1.1/lib/verbs/common/say.c Sun Feb 1 21:30:57 1998 --- ds2.0r27/lib/verbs/common/say.c Wed Jul 5 00:01:06 2006 *************** *** 35,47 **** } mixed can_say_to_liv_str(object targ, string str) { if( !targ || !str ) return 0; ! return (mixed)this_player()->CanSpeak(targ, TALK_LOCAL, str); } mixed can_say_str(string str) { if( !str ) return 0; ! return (mixed)this_player()->CanSpeak(0, TALK_LOCAL, str); } mixed do_say() { return 1; } --- 35,49 ---- } mixed can_say_to_liv_str(object targ, string str) { + string lang = (string)this_player()->GetNativeLanguage() || "english"; if( !targ || !str ) return 0; ! return (mixed)this_player()->CanSpeak(targ, TALK_LOCAL, str, lang); } mixed can_say_str(string str) { + string lang = (string)this_player()->GetNativeLanguage() || "english"; if( !str ) return 0; ! return (mixed)this_player()->CanSpeak(0, TALK_LOCAL, str, lang); } mixed do_say() { return 1; } *************** *** 49,67 **** mixed do_say_to_liv(object ob) { return 1; } mixed do_say_to_liv_str(object targ, string str) { ! return (mixed)this_player()->eventSpeak(targ, TALK_LOCAL, str); } mixed do_say_str(string str) { return do_say_to_liv_str(0, str); } string GetHelp(string str) { return ("Syntax: <say MESSAGE>\n" ! " <say to LIVING MESSAGE>\n\n" ! "Sends out a message that everyone in the room can see. If you " ! "specify a target, the target person is shown as being the target " ! "of the message.\n\n" ! "See also: shout, speak, reply, tell, whisper"); } ! ! ! --- 51,70 ---- mixed do_say_to_liv(object ob) { return 1; } mixed do_say_to_liv_str(object targ, string str) { ! string lang = (string)this_player()->GetNativeLanguage() || "english"; ! return (mixed)this_player()->eventSpeak(targ, TALK_LOCAL, str, lang); } mixed do_say_str(string str) { return do_say_to_liv_str(0, str); } string GetHelp(string str) { return ("Syntax: <say MESSAGE>\n" ! " <say to LIVING MESSAGE>\n\n" ! "Sends out a message that everyone in the room can see. If you " ! "specify a target, the target person is shown as being the target " ! "of the message.\n\n" ! "See also: shout, speak, reply, tell, whisper"); } ! ! ! diff -c -r --new-file ds1.1/lib/verbs/common/shout.c ds2.0r27/lib/verbs/common/shout.c *** ds1.1/lib/verbs/common/shout.c Sun Feb 1 21:30:57 1998 --- ds2.0r27/lib/verbs/common/shout.c Wed Jul 5 00:01:06 2006 *************** *** 36,42 **** mixed can_shout_in_wrd_str(string lang, string str) { if( !lang || !str ) return 0; if( !creatorp(this_player()) && (int)this_player()->GetStaminaPoints()<100 ) ! return "You are too tired to shout."; if( strlen(str) > 250 ) return "That is way too much to shout!"; return (mixed)this_player()->CanSpeak(0, TALK_WORLD, str, lang); } --- 36,42 ---- mixed can_shout_in_wrd_str(string lang, string str) { if( !lang || !str ) return 0; if( !creatorp(this_player()) && (int)this_player()->GetStaminaPoints()<100 ) ! return "You are too tired to shout."; if( strlen(str) > 250 ) return "That is way too much to shout!"; return (mixed)this_player()->CanSpeak(0, TALK_WORLD, str, lang); } *************** *** 52,58 **** mixed do_shout_in_wrd_str(string lang, string str) { if( str[<1] != '!' && str[<1] != '?' && str[<1] != '.' ) ! str = capitalize(str) + "."; else str = capitalize(str); this_player()->AddStaminaPoints(-100); return (mixed)this_player()->eventSpeak(0, TALK_WORLD, str, lang); --- 52,58 ---- mixed do_shout_in_wrd_str(string lang, string str) { if( str[<1] != '!' && str[<1] != '?' && str[<1] != '.' ) ! str = capitalize(str) + "."; else str = capitalize(str); this_player()->AddStaminaPoints(-100); return (mixed)this_player()->eventSpeak(0, TALK_WORLD, str, lang); *************** *** 60,68 **** string GetHelp(string str) { return ("Syntax: <shout MESSAGE>\n" ! " <shout in LANGUAGE MESSAGE>\n\n" ! "Sends a message to all players on " + mud_name() + ". If you " ! "fail to specify a language, your native language is used. " ! "Abuse of shouting is a violation of " + mud_name() + " laws.\n\n" ! "See also: reply, say, speak, tell, whisper, yell"); } --- 60,68 ---- string GetHelp(string str) { return ("Syntax: <shout MESSAGE>\n" ! " <shout in LANGUAGE MESSAGE>\n\n" ! "Sends a message to all players on " + mud_name() + ". If you " ! "fail to specify a language, your native language is used. " ! "Abuse of shouting is a violation of " + mud_name() + " laws.\n\n" ! "See also: reply, say, speak, tell, whisper, yell"); } diff -c -r --new-file ds1.1/lib/verbs/common/speak.c ds2.0r27/lib/verbs/common/speak.c *** ds1.1/lib/verbs/common/speak.c Sun Feb 1 21:30:57 1998 --- ds2.0r27/lib/verbs/common/speak.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/players/speak.c ! * from the Dead Soulsr2 Object Library * speak * speak STR * speak in WRD STR --- 1,5 ---- /* /verbs/players/speak.c ! * from the Dead Souls Object Library * speak * speak STR * speak in WRD STR *************** *** 32,38 **** mixed can_speak_str(string str) { string lang; ! if( !str ) return 0; if( strlen(str) > 3 && str[0..2] == "in " ) return 0; lang = (string)this_player()->GetNativeLanguage() || "english"; --- 32,38 ---- mixed can_speak_str(string str) { string lang; ! if( !str ) return 0; if( strlen(str) > 3 && str[0..2] == "in " ) return 0; lang = (string)this_player()->GetNativeLanguage() || "english"; *************** *** 58,76 **** mixed do_speak_in_wrd_str(string lang, string str) { if( str[<1] != '.' && str[<1] != '?' && str[<1] != '!' ) ! str = capitalize(str) + "."; else str = capitalize(str); return (mixed)this_player()->eventSpeak(0, TALK_LOCAL, str, lang); } string GetHelp(string str) { return ("Syntax: <speak MESSAGE>\n" ! " <speak in LANGUAGE MESSAGE>\n\n" ! "Sends the message you specify to all people in the same room " ! "as you. If you are an avatar, you have the ability to customize " ! "the way these messages come out through the \"message\" " ! "command. If you fail to specify a language, your native " ! "language will be used.\n\n" ! "See also: message, say, shout, speak, tell"); } --- 58,76 ---- mixed do_speak_in_wrd_str(string lang, string str) { if( str[<1] != '.' && str[<1] != '?' && str[<1] != '!' ) ! str = capitalize(str) + "."; else str = capitalize(str); return (mixed)this_player()->eventSpeak(0, TALK_LOCAL, str, lang); } string GetHelp(string str) { return ("Syntax: <speak MESSAGE>\n" ! " <speak in LANGUAGE MESSAGE>\n\n" ! "Sends the message you specify to all people in the same room " ! "as you. If you are an avatar, you have the ability to customize " ! "the way these messages come out through the \"message\" " ! "command. If you fail to specify a language, your native " ! "language will be used.\n\n" ! "See also: message, say, shout, speak, tell"); } diff -c -r --new-file ds1.1/lib/verbs/common/whisper.c ds2.0r27/lib/verbs/common/whisper.c *** ds1.1/lib/verbs/common/whisper.c Sun Feb 1 21:30:57 1998 --- ds2.0r27/lib/verbs/common/whisper.c Wed Jul 5 00:01:06 2006 *************** *** 15,30 **** verb::create(); SetVerb("whisper"); SetRules("to LIV", "in WRD", "in WRD to LIV", "to LIV STR", ! "to LIV in WRD STR", "in WRD to LIV STR"); SetErrorMessage("Whisper to whom what?"); SetHelp("Syntax: <whisper to LIVING MESSAGE>\n" ! " <whisper to LIVING in LANGUAGE MESSAGE>\n" ! " <whisper in LANGUAGE to LIVING MESSAGE>\n\n" ! "Privately sends a message to the targetted person in the " ! "language you specify with a small chance of being overheard. " ! "If you fail to specify a language, your native language is " ! "used.\n\n" ! "See also: say, shout, speak, tell, yell"); } --- 15,30 ---- verb::create(); SetVerb("whisper"); SetRules("to LIV", "in WRD", "in WRD to LIV", "to LIV STR", ! "to LIV in WRD STR", "in WRD to LIV STR"); SetErrorMessage("Whisper to whom what?"); SetHelp("Syntax: <whisper to LIVING MESSAGE>\n" ! " <whisper to LIVING in LANGUAGE MESSAGE>\n" ! " <whisper in LANGUAGE to LIVING MESSAGE>\n\n" ! "Privately sends a message to the targetted person in the " ! "language you specify with a small chance of being overheard. " ! "If you fail to specify a language, your native language is " ! "used.\n\n" ! "See also: say, shout, speak, tell, yell"); } *************** *** 42,48 **** mixed can_whisper_to_liv_str(object targ, string str) { string lang; ! lang = (string)this_player()->GetNativeLanguage() || "english"; return can_whisper_to_liv_in_wrd_str(targ, lang, str); } --- 42,48 ---- mixed can_whisper_to_liv_str(object targ, string str) { string lang; ! lang = (string)this_player()->GetNativeLanguage() || "english"; return can_whisper_to_liv_in_wrd_str(targ, lang, str); } *************** *** 76,82 **** mixed do_whisper_to_liv_in_wrd_str(object targ, string lang, string str) { if( str[<1] != '?' && str[<2] != '!' && str[<1] != '.' ) ! str = capitalize(str) + "."; else str = capitalize(str); return (mixed)this_player()->eventSpeak(targ, TALK_SEMI_PRIVATE, str,lang); } --- 76,82 ---- mixed do_whisper_to_liv_in_wrd_str(object targ, string lang, string str) { if( str[<1] != '?' && str[<2] != '!' && str[<1] != '.' ) ! str = capitalize(str) + "."; else str = capitalize(str); return (mixed)this_player()->eventSpeak(targ, TALK_SEMI_PRIVATE, str,lang); } diff -c -r --new-file ds1.1/lib/verbs/common/yell.c ds2.0r27/lib/verbs/common/yell.c *** ds1.1/lib/verbs/common/yell.c Sun Feb 1 21:30:57 1998 --- ds2.0r27/lib/verbs/common/yell.c Wed Jul 5 00:01:06 2006 *************** *** 49,63 **** mixed do_yell_in_wrd_str(string lang, string str) { if( str[<1] != '!' && str[<1] != '?' && str[<1] != '.' ) ! str = capitalize(str) + "."; else str = capitalize(str); return (mixed)this_player()->eventSpeak(0, TALK_AREA, str, lang); } string GetHelp(string str) { return ("Syntax: <yell MESSAGE>\n" ! " <yell in LANGUAGE MESSAGE>\n\n" ! "Sends a message to the area around you. If you fail to " ! "specify a language, your native language is used.\n\n" ! "See also: reply, say, shout, speak, tell, whisper"); } --- 49,63 ---- mixed do_yell_in_wrd_str(string lang, string str) { if( str[<1] != '!' && str[<1] != '?' && str[<1] != '.' ) ! str = capitalize(str) + "."; else str = capitalize(str); return (mixed)this_player()->eventSpeak(0, TALK_AREA, str, lang); } string GetHelp(string str) { return ("Syntax: <yell MESSAGE>\n" ! " <yell in LANGUAGE MESSAGE>\n\n" ! "Sends a message to the area around you. If you fail to " ! "specify a language, your native language is used.\n\n" ! "See also: reply, say, shout, speak, tell, whisper"); } diff -c -r --new-file ds1.1/lib/verbs/creators/add.c ds2.0r27/lib/verbs/creators/add.c *** ds1.1/lib/verbs/creators/add.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/verbs/creators/add.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,110 ---- + #pragma save_binary + + #include <lib.h> + #include <daemons.h> + #include <rooms.h> + #include <modules.h> + #include <commands.h> + + inherit LIB_VERB; + + mixed do_add_obj_to_obj(object ob, object ob2); + + static void create() { + verb::create(); + SetVerb("add"); + SetRules("OBJ", "OBJ to OBJ", "OBJ to here", "OBJ to room"); + SetErrorMessage("Add what?"); + SetHelp("Syntax: <add [OBJ] to [OBJ]>\n" + " <add [OBJ]>\n" + "This command adds the first object to the permanent " + "inventory of the second object, if you have access " + "privileges to both files. You will be prompted for input. " + "If the taget is an NPC, you can input a command for the " + "NPC to execute when it is created, such as: wear shirt\n" + "Otherwise, enter the number of these items you want when " + "prompted.\n" + "\nSee also: copy, create, delete, modify, reload, initfix "); + } + + + + mixed can_add_obj_to_obj(string one, string two){ + if(!creatorp(this_player())) return "This command is for creators only."; + return 1; + } + mixed can_add_obj_to_here(string one) { return 1; } + mixed can_add_obj(string one) { return 1; } + mixed can_add_obj_to_room(string one) { return 1; } + + + mixed do_add_obj_to_here(object ob){ + return do_add_obj_to_obj(ob, environment(this_player())); + } + + mixed do_add_obj_to_room(object ob){ + return do_add_obj_to_obj(ob, environment(this_player())); + } + + mixed do_add_obj(object ob){ + return do_add_obj_to_obj(ob, environment(this_player())); + } + + mixed do_add_obj_to_obj(object ob, object ob2) { + object staff; + string str, sourcefile; + staff = present("tanstaafl",this_player()); + if(!staff) { + write("You must be holding the creator staff in order to use this command."); + write("If you don't know where you put it, get another one from the chest "); + write("in your workroom."); + return 1; + } + str = base_name(ob2)+".c"; + sourcefile = base_name(ob)+".c"; + + if(userp(ob)){ + write("You can't do that to a player."); + return 1; + } + + if(!living(ob2) && + !inherits(LIB_STORAGE,ob2) && + !inherits(LIB_WORN_STORAGE,ob2) && + !inherits(LIB_ROOM,ob2)){ + write("That object is not intended to contain other objects. Addition halted."); + write("If you are sure this is incorrect, then the target object may be "); + write("missing a working init function. Fix it with the initfix command."); + return 0; + } + + if(!check_privs(this_player(),str) || + !check_privs(this_player(),sourcefile)){ + write("You lack sufficient privileges for this operation. Copy failed."); + return 0; + } + if(!file_exists(sourcefile) || !file_exists(str)) { + write("That file no longer exists."); + return 0; + } + + if(base_name(ob2) == LIB_DUMMY) ob = environment(this_player()); + if(base_name(ob) == LIB_DUMMY) { + write("That's not the kind of thing you can add to something."); + return 1; + } + + if(starts_with(base_name(ob2),"/lib/")) { + write("This appears to be a library object. Canceling modification."); + return 1; + } + + if(ob2->GetNoModify()){ + write("This object must be modified by hand."); + return 1; + } + + staff->eventAddItem(ob2, base_name(ob)); + if(ob) ob->eventMove(ROOM_FURNACE); + return 1; + } diff -c -r --new-file ds1.1/lib/verbs/creators/copy.c ds2.0r27/lib/verbs/creators/copy.c *** ds1.1/lib/verbs/creators/copy.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/verbs/creators/copy.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,124 ---- + #pragma save_binary + + #include <lib.h> + #include <daemons.h> + #include <rooms.h> + #include <modules.h> + #include <commands.h> + + inherit LIB_VERB; + + mixed do_copy_obj_str(object ob, string str); + + int success; + string sourcefile, targetfile; + + static void create() { + verb::create(); + SetVerb("copy"); + SetRules("STR", "OBJ STR"); + SetErrorMessage("Copy what?"); + SetHelp("Syntax: <copy [OBJ] [NAME]>\n" + " <copy [FILENAME]\n\n" + "With a room's filename as an argument, this command " + "copies everything about that room (except exits) into " + "your current room.\n\n" + "When you specify an object and provide a filename, this " + "command makes a copy of the object's file and gives it " + "the name you provide.\n\n" + "\nSee also: create, delete, modify, reload, initfix, add" ); + } + + mixed can_copy_obj_str(object ob, string str) { return 1; } + mixed can_copy_str(string str) { return 1; } + + mixed do_copy_obj_str(object ob, string str) { + object staff; + staff = present("tanstaafl",this_player()); + if(!staff) { + write("You must be holding the creator staff in order to use this command."); + write("If you don't know where you put it, get another one from the chest "); + write("in your workroom."); + return 1; + } + + if(userp(ob)){ + write("No."); + return 1; + } + success = 0; + sourcefile = ""; + targetfile = ""; + if(last(str,2) != ".c") str += ".c"; + str = absolute_path((string)this_player()->query_cwd(), str); + if( !directory_exists(path_prefix(str)) ) return "Directory not found."; + + sourcefile = base_name(ob)+".c"; + targetfile = str; + if(!check_privs(this_player(),str) || + !check_privs(this_player(),sourcefile)){ + write("You lack sufficient privileges for this operation. Copy failed."); + return 0; + } + if(!file_exists(sourcefile)) { + write("That file no longer exists."); + return 0; + } + else unguarded( (: success = cp(sourcefile, targetfile) :) ); + if(success) { + write("Copy successful."); + return 1; + } + else write("Copy failed."); + return 0; + } + + mixed do_copy_str(string str) { + string tmp, new_room; + mixed source_update; + object staff; + staff = present("tanstaafl",this_player()); + if(!staff) { + write("You must be holding the creator staff in order to use this command."); + write("If you don't know where you put it, get another one from the chest "); + write("in your workroom."); + return 1; + } + + if(last(str,2) != ".c") str += ".c"; + str = absolute_path((string)this_player()->query_cwd(), str); + if( !file_exists(str) ) return "File " + str + " not found."; + else if( !(tmp = read_file(str)) || !tmp || tmp == ""){ + write("Unable to read file " + str + "."); + return 1; + } + + if(!check_privs(this_player(),str) || + !check_privs(this_player(),base_name(environment(this_player()))+".c")){ + write("You lack sufficient privileges for this operation. Copy failed."); + return 1; + } + source_update = load_object("/secure/cmds/creators/update")->cmd("-a "+str); + if(!source_update || !intp(source_update) || source_update == 0) { + write("Your source file doesn't update correctly. Fix it first. Copy aborted."); + return 1; + } + + if(!inherits("/lib/std/room",load_object(str))) { + write("The file you want to copy isn't a recognized room. Copy aborted."); + return 1; + } + + new_room = base_name(environment(this_player())); + + load_object("/secure/cmds/creators/bk")->cmd(new_room+".c"); + write("Backed up this room. To restore from this backup, type: "); + write("restore "+last_string_element(new_room,"/")); + write("Then: update"); + + staff->eventCopyRoom(str,new_room+".c"); + load_object("/secure/cmds/creators/update")->cmd("-a "+new_room); + this_player()->eventMoveLiving(new_room); + write("Room copy complete."); + return 1; + } diff -c -r --new-file ds1.1/lib/verbs/creators/delete.c ds2.0r27/lib/verbs/creators/delete.c *** ds1.1/lib/verbs/creators/delete.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/verbs/creators/delete.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,182 ---- + #include <lib.h> + #include <daemons.h> + #include <rooms.h> + #include <modules.h> + #include <commands.h> + + inherit LIB_VERB; + + int eventDeleteExit(string str); + int eventDeleteObject(object ob1, object ob2); + + static void create() { + verb::create(); + SetVerb("delete"); + SetRules("enter STR", "room STR", "enter STR", "exit STR", "OBJ", "OBJ from OBJ", "OBJ from here", "OBJ from room"); + SetErrorMessage("Delete what?"); + SetHelp("Syntax: <delete exit DIRECTION>\n" + " <delete OBJECT>\n" + " <delete OBJECT from OBJECT>\n" + " This command removes an object from the permanent " + "inventory of another object. When only one object is specified, " + "this command assumes you mean to remove an object from the " + "inventory of the room you are in.\n" + " If the \"exit\" keyword is used, this command attempts to " + "remove the exit in the direction you specify.\n" + "See also: add, copy, create, delete, modify, reload, initfix"); + } + + + mixed can_delete_exit_str(string str) { + return 1; + } + + mixed can_delete_enter_str(string str) { + return 1; + } + + mixed can_delete_room_str(string str) { + return 1; + } + + mixed can_delete_obj(object ob){ + return 1; + } + + mixed can_delete_obj_from_obj(object ob1, object ob2){ + return 1; + } + + mixed can_delete_obj_from_here(object ob){ + return 1; + } + + mixed can_delete_obj_from_room(object ob){ + return 1; + } + + mixed do_delete_exit_str(string str) { + return eventDeleteExit(str); + } + + mixed do_delete_enter_str(string str) { + return do_delete_exit_str(str); + } + + mixed do_delete_room_str(string str) { + return do_delete_exit_str(str); + } + + mixed do_delete_obj(object ob){ + return eventDeleteObject(ob, environment(this_player())); + } + + mixed do_delete_obj_from_obj(object ob1, object ob2){ + return eventDeleteObject(ob1,ob2); + } + + mixed do_delete_obj_from_room(object ob){ + return do_delete_obj_from_obj(ob, environment(this_player())); + } + + mixed do_delete_obj_from_here(object ob){ + return do_delete_obj_from_obj(ob, environment(this_player())); + } + + int eventDeleteObject(object ob1, object ob2){ + string door; + object staff; + staff = present("tanstaafl",this_player()); + if(!staff) { + write("You must be holding the creator staff in order to use this command."); + write("If you don't know where you put it, get another one from the chest "); + write("in your workroom."); + return 1; + } + + if(userp(ob1) || userp(ob2)){ + write("No."); + return 1; + } + + if(environment(ob1) != ob2) { + write("That doesn't exist there."); + return 1; + } + + door = ob1->GetDoor(); + if(door){ + staff->eventDeleteDoor(door); + return 1; + } + + if(starts_with(base_name(ob2),"/lib/")) { + write("This appears to be a library object. Canceling modification."); + return 1; + } + + if(ob2->GetNoModify()){ + write("This object must be modified by hand."); + return 1; + } + + staff->eventGeneralStuff(base_name(ob1)+".c"); + staff->eventGeneralStuff(base_name(ob2)+".c"); + staff->eventDeleteItem(ob1, ob2); + return 1; + } + + int eventDeleteExit(string str){ + string filename; + string *exits; + string *enters; + object *players; + object staff; + staff = present("tanstaafl",this_player()); + if(!staff) { + write("You must be holding the creator staff in order to use this command."); + write("If you don't know where you put it, get another one from the chest "); + write("in your workroom."); + return 1; + } + //tc("staff: "+file_name(staff)); + + filename = base_name(environment(this_player()))+".c"; + exits = load_object(filename)->GetExits(); + enters = load_object(filename)->GetEnters(); + + if(member_array(str,exits) == -1 && member_array(str,enters) == -1) { + write("That exit does not exist here."); + return 1; + } + + if(base_name(environment(this_player())) == ROOM_START){ + write("You should edit the start room by hand. Change cancelled."); + return 1; + } + + if(!check_privs(this_player(),filename)){ + write("You can't delete an exit from a room that is not yours."); + return 1; + } + + players = get_livings(environment(this_player()),1); + if(member_array(str,exits) != -1) staff->eventRemoveExit(str, filename); + else staff->eventRemoveEnter(str, filename); + load_object("/secure/cmds/creators/update")->cmd("-a "+filename); + players->eventMove(load_object(filename)); + + exits = load_object(filename)->GetExits(); + + if(member_array(str,exits) == -1) { + write("Exit successfully removed."); + say(this_player()->GetCapName()+" removes an exit."); + return 1; + } + + else { + write("Exit removal failed."); + return 1; + } + + } diff -c -r --new-file ds1.1/lib/verbs/creators/dest.c ds2.0r27/lib/verbs/creators/dest.c *** ds1.1/lib/verbs/creators/dest.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/verbs/creators/dest.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,78 ---- + #pragma save_binary + + #include <lib.h> + #include <daemons.h> + #include <modules.h> + #include <rooms.h> + #include <commands.h> + + + inherit LIB_VERB; + + static void create() { + verb::create(); + SetVerb("dest"); + SetRules("OBS","STR"); + SetErrorMessage("dest what?"); + SetHelp("Syntax: <dest OBJ>\n\n" + "Destroy an object.\n" + "\nSee also: zap"); + } + + mixed can_dest_obj(string str) { + if(!creatorp(this_player())) return "This command is only available to builders and creators."; + else return 1; + } + + mixed can_dest_str(){ + //The desting of strings is not yet supported. + //return 1; + return 0; + } + + mixed do_dest_obj(object ob){ + string name; + if(base_name(ob) == LIB_DUMMY) { + write(capitalize(ob->GetShort())+" isn't a normal destable item. It remains in place."); + return 1; + } + if(archp(ob) && !archp(this_player())){ + write("You can't dest an admin."); + tell_player(ob, this_player()->GetName()+" just tried to dest you."); + return 1; + } + if(!living(ob)) name = ob->GetShort(); + else name = ob->GetName(); + write("You dest "+name+"."); + say( this_player()->GetMessage( "dest", ob ) ); + ob->eventDestruct(); + if(ob) destruct(ob); + return 1; + } + + mixed do_dest_obs(object *obs) { + foreach(object ob in obs){ + if(!interactive(ob)) do_dest_obj(ob); + } + write("Desting complete."); + return 1; + } + + mixed do_dest_str(string str){ + object *objects; + //tc("str: "+str); + if(!objects = findobs(str)){ + write("No such thing was found."); + return 1; + } + if(sizeof(objects) != 1){ + write("The return list is ambiguous. Nothing was dested."); + return 1; + } + + objects[0]->eventDestruct(); + if(objects[0]) destruct(objects[0]); + if(objects[0]) write(file_name(objects[0])+" was not destructed."); + else write("Desting complete."); + return 1; + } diff -c -r --new-file ds1.1/lib/verbs/creators/echo.c ds2.0r27/lib/verbs/creators/echo.c *** ds1.1/lib/verbs/creators/echo.c Sun Feb 1 21:30:52 1998 --- ds2.0r27/lib/verbs/creators/echo.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/creators/echo.c ! * from the Dead Soulsr2 Object Library * echo * echo STR * echo to LIV STR --- 1,5 ---- /* /verbs/creators/echo.c ! * from the Dead Souls Object Library * echo * echo STR * echo to LIV STR *************** *** 63,73 **** void eventEcho(object *targs, string str) { object ob; ! foreach(ob in targs) { if( archp(ob) ) ! ob->eventPrint((string)this_player()->GetCapName() + ! " echoes: " + str, MSG_CONV); else ob->eventPrint(str, MSG_CONV); } this_player()->eventPrint("You echo: " + str, MSG_CONV); --- 63,73 ---- void eventEcho(object *targs, string str) { object ob; ! foreach(ob in targs) { if( archp(ob) ) ! ob->eventPrint((string)this_player()->GetCapName() + ! " echoes: " + str, MSG_CONV); else ob->eventPrint(str, MSG_CONV); } this_player()->eventPrint("You echo: " + str, MSG_CONV); *************** *** 75,87 **** string GetHelp(string str) { return ("Syntax: <echo MESSAGE>\n" ! " <echo to LIVING MESSAGE>\n" ! " <echo to all MESSAGE>\n\n" ! "Sends a message without prefixing around to everyone in the " ! "room if you fail to specify to whom you are echoing. You " ! "may echo to everyone in the game as well. Abuse of this " ! "command is a severe violation of MUD ethics.\n\n" ! "See also: say, tell"); } ! --- 75,87 ---- string GetHelp(string str) { return ("Syntax: <echo MESSAGE>\n" ! " <echo to LIVING MESSAGE>\n" ! " <echo to all MESSAGE>\n\n" ! "Sends a message without prefixing around to everyone in the " ! "room if you fail to specify to whom you are echoing. You " ! "may echo to everyone in the game as well. Abuse of this " ! "command is a severe violation of MUD ethics.\n\n" ! "See also: say, tell"); } ! diff -c -r --new-file ds1.1/lib/verbs/creators/initfix.c ds2.0r27/lib/verbs/creators/initfix.c *** ds1.1/lib/verbs/creators/initfix.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/verbs/creators/initfix.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,63 ---- + #pragma save_binary + + #include <lib.h> + #include <daemons.h> + #include <modules.h> + + inherit LIB_VERB; + + static void create() { + verb::create(); + SetVerb("initfix"); + SetRules("OBJ", "here"); + SetErrorMessage("initfix what?"); + SetHelp("Syntax: <initfix OBJ>\n\n" + "If you have write permissions to the file of the object " + "specified, this command adds an init(){} function. Lacking " + "this function makes many objects break or behave unpredictably." + "\nSee also: copy, create, delete, modify, reload, add"); + } + + mixed can_initfix_obj(string str) { + if(!creatorp(this_player())) + return "This command is only available to builders and creators."; + else return 1; + } + + mixed can_initfix_word(string str) { return can_initfix_obj("foo"); } + + mixed do_initfix_obj(object ob) { + object staff; + staff = present("tanstaafl",this_player()); + if(!staff) { + write("You must be holding the creator staff in order to use this command."); + write("If you don't know where you put it, get another one from the chest "); + write("in your workroom."); + return 1; + } + + if(ob->GetDoor()) ob = load_object(ob->GetDoor()); + + if(first(base_name(ob),5) == "/lib/") { + write("This appears to be a lib file. Aborting modification."); + return 1; + } + + if(interactive(ob)) { + write("Players are not initfixable."); + return 1; + } + + if(staff->eventAddInit(base_name(ob)+".c") == 2) { + write("File already has a working init function."); + } + + else write("Done."); + reload(ob); + return 1; + } + + mixed do_initfix_word(string wrd) { + object ob = environment(this_player()); + return do_initfix_obj(ob); + } diff -c -r --new-file ds1.1/lib/verbs/creators/modify.c ds2.0r27/lib/verbs/creators/modify.c *** ds1.1/lib/verbs/creators/modify.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/verbs/creators/modify.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,105 ---- + #pragma save_binary + + #include <lib.h> + #include <daemons.h> + #include <rooms.h> + #include <modules.h> + + inherit LIB_VERB; + + static void create() { + verb::create(); + SetVerb("modify"); + SetRules("OBJ STR", "here STR", "room STR"); + SetErrorMessage("Modify what how?"); + SetHelp("Syntax: <modify OBJ SETTING VALUE>\n\n" + "If you have write permissions to the file of the object " + "specified, this command initiates changes to that file " + "based on the arguments you supply. For example, to change " + "the short description of the room you are in:\n" + "modify here short a nice new room\n" + "To modify an orc npc's desciption (if he's in your current room):\n " + "modify orc long a polite, well-groomed orc.\n\n" + "Available settings are: \n----\n" + "%^GREEN%^room%^RESET%^: "+MODULES_CREATE->GetSettings("room")+"\n--\n" + "%^GREEN%^npc%^RESET%^: "+MODULES_CREATE->GetSettings("npc")+"\n--\n" + "%^GREEN%^barkeep%^RESET%^: "+MODULES_CREATE->GetSettings("barkeep")+"\n--\n" + "%^GREEN%^vendor%^RESET%^: "+MODULES_CREATE->GetSettings("vendor")+"\n--\n" + "%^GREEN%^weapon%^RESET%^: "+MODULES_CREATE->GetSettings("weapon")+"\n--\n" + "%^GREEN%^item%^RESET%^: "+MODULES_CREATE->GetSettings("item")+"\n--\n" + "%^GREEN%^armor%^RESET%^: "+MODULES_CREATE->GetSettings("armor")+"\n--\n" + "%^GREEN%^worn_storage%^RESET%^: "+MODULES_CREATE->GetSettings("worn_storage")+"\n--\n" + "%^GREEN%^chair%^RESET%^: "+MODULES_CREATE->GetSettings("chair")+"\n--\n" + "%^GREEN%^bed%^RESET%^: "+MODULES_CREATE->GetSettings("bed")+"\n--\n" + "%^GREEN%^table%^RESET%^: "+MODULES_CREATE->GetSettings("table")+"\n--\n" + "%^GREEN%^container%^RESET%^: "+MODULES_CREATE->GetSettings("storage")+"\n----\n" + "%^GREEN%^meal%^RESET%^: "+MODULES_CREATE->GetSettings("meal")+"\n----\n" + "%^GREEN%^drink%^RESET%^: "+MODULES_CREATE->GetSettings("meal")+"\n----\n" + "%^GREEN%^door%^RESET%^: "+MODULES_CREATE->GetSettings("door")+"\n----\n" + "%^GREEN%^book%^RESET%^: "+MODULES_CREATE->GetSettings("book")+"\n----\n" + "\nSee also: copy, create, delete, reload, initfix, add"); + } + + mixed can_modify_obj_str(string str) { + if(!creatorp(this_player())) return "This command is only available to builders and creators."; + else return 1; + } + + mixed can_modify_word_str(string str) { return can_modify_obj_str("foo"); } + + mixed do_modify_obj_str(object ob, string str) { + object staff; + staff = present("tanstaafl",this_player()); + if(!staff) { + write("You must be holding the creator staff in order to use this command."); + write("If you don't know where you put it, get another one from the chest "); + write("in your workroom."); + return 1; + } + + if(ob->GetDirectionMap()){ + write("This is a virtual thing. It cannot be modified with the QCS."); + return 1; + } + + if(ob->GetNoModify() && !grepp(lower_case(str),"modify")) { + write("This needs to be edited by hand."); + return 1; + } + + if(base_name(ob) == LIB_DUMMY && + !ob->GetDoor()) ob = environment(this_player()); + else if(base_name(ob) == LIB_DUMMY) ob = load_object(ob->GetDoor()); + + if(starts_with(base_name(ob),"/lib/")) { + write("This appears to be a library object. Canceling modification."); + return 1; + } + + if(userp(ob)){ + write("You may not modify a player."); + return 1; + } + + return staff->eventModify(ob, str); + } + + mixed do_modify_word_str(string wrd, string str) { + object staff, ob; + staff = present("tanstaafl",this_player()); + if(!staff) { + write("You must be holding the creator staff in order to use this command."); + write("If you don't know where you put it, get another one from the chest "); + write("in your workroom."); + return 1; + } + + ob = environment(this_player()); + + if(starts_with(base_name(ob),"/lib/")) { + write("This appears to be a library object. Canceling modification."); + return 1; + } + + return do_modify_obj_str(ob, str); + } diff -c -r --new-file ds1.1/lib/verbs/creators/pulsecheck.c ds2.0r27/lib/verbs/creators/pulsecheck.c *** ds1.1/lib/verbs/creators/pulsecheck.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/verbs/creators/pulsecheck.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,47 ---- + #pragma save_binary + + #include <lib.h> + #include <daemons.h> + #include <damage_types.h> + #include <modules.h> + #include <rooms.h> + #include <commands.h> + + inherit LIB_VERB; + + static void create() { + verb::create(); + SetVerb("pulsecheck"); + SetRules("LVS"); + SetErrorMessage("pulsecheck what?"); + SetHelp("Syntax: <pulsecheck CREATURE>\n\n" + "Check a creature's heartbeat.\n" + "\nSee also: zap"); + } + + mixed can_pulsecheck_liv(string str) { + if(!creatorp(this_player())) return "This command is only available to builders and creators."; + else return 1; + } + + mixed do_pulsecheck_liv(object ob){ + string name; + int mhp; + + if(!living(ob)) { + write("You can only pulsecheck living things."); + return 1; + + } + write(ob->GetName()+"'s heart_beat is "+query_heart_beat(ob)+"."); + write(ob->GetName()+"'s HeartRate is "+ob->GetHeartRate()+".\n"); + return 1; + } + + mixed do_pulsecheck_lvs(object *obs) { + foreach(object ob in obs){ + if(!(ob == this_player())) do_pulsecheck_liv(ob); + } + return 1; + } + diff -c -r --new-file ds1.1/lib/verbs/creators/reload.c ds2.0r27/lib/verbs/creators/reload.c *** ds1.1/lib/verbs/creators/reload.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/verbs/creators/reload.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,134 ---- + #pragma save_binary + + #include <lib.h> + #include <daemons.h> + #include <modules.h> + #include <rooms.h> + #include <commands.h> + + inherit LIB_VERB; + + string libfile = "foo"; + + static void create() { + verb::create(); + SetVerb("reload"); + SetRules("OBJ", "STR OBJ", "STR here", "here", "every STR"); + SetErrorMessage("reload what?"); + SetHelp("Syntax: <reload OBJ>, <reload every OBJ>\n\n" + "This command loads into memory the file of the object " + "you specify, and replaces the current copy with a new " + "copy. If you change something about a sword you are " + "holding, for example, \"reload sword\" will update the " + "changes and you will be holding a sword with the updates.\n" + " When used with the -r flag it recursively loads all the objects " + "inherited by the target object. If any of those objects " + "or the target object's file fail to load, the object " + "is not updated.\n" + " If you \"reload every npc\", then any loaded object that " + "inherits LIB_NPC gets reloaded. Other valid lib objects " + "that can be used this way are: room, sentient, armor, item.\n" + "Please note that if there are too many items to reload, " + "the command will fail with \"Too long evaluation\" errors.\n" + " Books, due to their processing-intensive load time, " + "are excluded from the \"every\" keyword.\n" + "\nSee also: copy, create, delete, modify, initfix, add"); + } + + mixed can_reload_obj(string str) { + if(!creatorp(this_player())) return "This command is only available to builders and creators."; + else return 1; + } + + mixed can_reload_every_str(string str){ + if(!creatorp(this_player())) return "This command is only available to builders and creators."; + else return 1; + } + + mixed can_reload_str_obj(string str) { + return can_reload_obj(str); + } + + mixed can_reload_word(string str) { + return can_reload_obj("foo"); } + + mixed can_reload_str_word(string str, string str2) { + return can_reload_obj("foo"); } + + mixed do_reload_obj(object ob) { + if(userp(ob)) { + write("No."); + return 1; + } + return reload(ob); + } + + mixed do_reload_str_obj(string str, object ob) { + if(str == "-r") reload(ob, 1); + else return reload(ob); + } + + mixed do_reload_word(string wrd) { + object ob = environment(this_player()); + if(wrd == "here") return do_reload_obj(ob); + else return "failed."; + } + + mixed do_reload_str_word(string wrd1, string wrd2) { + object ob = environment(this_player()); + if(wrd1 == "-r" && wrd2 = "here") reload(ob, 1); + else return "Failed."; + } + + mixed do_reload_every_str(string str){ + object *ob_pool = ({}); + //tc("str: "+str); + + if(!archp(this_player())){ + write("This verb is intended for arches only."); + return 1; + } + + switch(str){ + case "npc" : libfile = LIB_NPC; break; + case "sentient" : libfile = LIB_SENTIENT; break; + case "room" : libfile = LIB_ROOM; break; + case "weapon" : libfile = LIB_WEAPON; break; + case "item" : libfile = LIB_ITEM; break; + case "container" : libfile = LIB_STORAGE; break; + case "armor" : libfile = LIB_ARMOR; break; + case "worn_storage" : libfile = LIB_WORN_STORAGE; break; + default : libfile = "/lib/foo"; + } + + //tc("libfile: "+libfile); + + if(!file_exists(libfile+".c")){ + write("There is no such library file."); + return 1; + } + + load_object("/secure/cmds/creators/update")->cmd("-a -r "+libfile); + + ob_pool = filter(objects(), (: ( inherits(libfile, $1) && + !inherits(LIB_BOOK, $1) ) :) ); + + if(!sizeof(ob_pool)) { + write("None found."); + return 1; + } + + //tc("ob_pool: "+identify(ob_pool)); + + foreach(object ob in ob_pool){ + //if(ob) tc("reloading: "+file_name(ob),"red"); + if(ob) write("reloading: "+file_name(ob)); + reload(ob); + } + + write("Done."); + libfile = "foo"; + return 1; + } + + diff -c -r --new-file ds1.1/lib/verbs/creators/resurrect.c ds2.0r27/lib/verbs/creators/resurrect.c *** ds1.1/lib/verbs/creators/resurrect.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/verbs/creators/resurrect.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,56 ---- + #pragma save_binary + + #include <lib.h> + #include <daemons.h> + #include <modules.h> + #include <rooms.h> + #include <commands.h> + + inherit LIB_VERB; + + static void create() { + verb::create(); + SetVerb("resurrect"); + SetRules("OBJ", "here"); + SetErrorMessage("resurrect what?"); + SetHelp("Syntax: <resurrect OBJ>\n\n" + "Bring back to life a dead player or creator.\n" + "\nSee also: zap"); + } + + mixed can_resurrect_obj(string str) { + if(!creatorp(this_player())) return "This command is only available to builders and creators."; + else return 1; + } + + + mixed do_resurrect_obj(object ob) { + if(!interactive(ob)) { + write("You may only resurrect dead players."); + return 1; + } + + if(!ob->GetGhost()) { + write("You can't resurrect the living."); + return 1; + } + + if(environment(ob) != environment(this_player())) { + write(capitalize(ob->GetKeyName())+" isn't here."); + return 1; + } + + tell_player(this_player(),"You wave your hand, and with a flash "+ + "of light, "+ob->GetCapName()+" comes back to life!"); + tell_player(ob,capitalize(this_player()->GetKeyName())+" waves "+ + possessive(this_player())+ + " hand, and with a flash of light, you come back from the dead!"); + tell_room(environment(this_player()),this_player()->GetCapName()+" waves "+ + possessive(this_player())+ + " hand, and with a flash of light, "+ob->GetCapName()+" comes back to life!", + ({ob, this_player()}) ); + ob->eventRevive(); + ob->eventMoveLiving(ROOM_START); + return 1; + } + diff -c -r --new-file ds1.1/lib/verbs/creators/zap.c ds2.0r27/lib/verbs/creators/zap.c *** ds1.1/lib/verbs/creators/zap.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/verbs/creators/zap.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,54 ---- + #pragma save_binary + + #include <lib.h> + #include <daemons.h> + #include <damage_types.h> + #include <modules.h> + #include <rooms.h> + #include <commands.h> + + inherit LIB_VERB; + + static void create() { + verb::create(); + SetVerb("zap"); + SetRules("LVS"); + SetErrorMessage("zap what?"); + SetHelp("Syntax: <zap CREATURE>\n\n" + "Deal massive damage to a living thing.\n" + "\nSee also: dest"); + } + + mixed can_zap_liv(string str) { + if(!creatorp(this_player())) return "This command is only available to builders and creators."; + else return 1; + } + + mixed do_zap_liv(object ob){ + string name; + int mhp; + + if(!living(ob)) { + write("You can only zap living things."); + return 1; + + } + else name = ob->GetName(); + mhp = ob->GetMaxHealthPoints(); + if(!mhp) mhp = 99999; + write("You zap "+name+"."); + say(this_player()->GetName()+" raises a hand and %^RED%^ZAPS%^RESET%^"+ + " "+name+"!",({ob})); + tell_object(ob,this_player()->GetName()+" raises a hand and %^RED%^ZAPS%^RESET%^ you!"); + ob->eventReceiveDamage(this_player(),BLUNT,(mhp * 5),0,({"torso"})); + + return 1; + } + + mixed do_zap_lvs(object *obs) { + foreach(object ob in obs){ + if(!(ob == this_player())) do_zap_liv(ob); + } + return 1; + } + diff -c -r --new-file ds1.1/lib/verbs/items/bait.c ds2.0r27/lib/verbs/items/bait.c *** ds1.1/lib/verbs/items/bait.c Sun Feb 1 21:30:53 1998 --- ds2.0r27/lib/verbs/items/bait.c Wed Jul 5 00:01:06 2006 *************** *** 1,33 **** /* /verbs/items/bait.c ! * from the Dead Souls V Object Library * bait verb used with /lib/bait.c * created by Blitz@Dead Souls 960117 */ ! #pragma save_binary #include <lib.h> #include "include/bait.h" ! inherit LIB_VERB; ! static void create() { verb::create(); SetVerb("bait"); SetRules("OBJ with OBJ"); SetErrorMessage("Bait what with what?"); SetHelp("Syntax: bait <POLE> with <BAIT>\n\n" ! "The bait command is normally used to fasten bait onto " ! "a fishing pole. The POLE must be a device of some " ! "kind which is used for catching fish. The BAIT " ! "must be some sort of fishing bait."); } ! mixed can_bait_obj_with_obj(string verb) { return 1; } ! mixed do_bait_obj_with_obj(object pole, object bait) { if( pole == bait ) { ! this_player()->eventPrint("You can't use it to bait itself!"); return 1; } return (mixed)bait->eventBait(this_player(), pole); --- 1,33 ---- /* /verbs/items/bait.c ! * from the Dead Souls Object Library * bait verb used with /lib/bait.c * created by Blitz@Dead Souls 960117 */ ! #pragma save_binary #include <lib.h> #include "include/bait.h" ! inherit LIB_VERB; ! static void create() { verb::create(); SetVerb("bait"); SetRules("OBJ with OBJ"); SetErrorMessage("Bait what with what?"); SetHelp("Syntax: bait <POLE> with <BAIT>\n\n" ! "The bait command is normally used to fasten bait onto " ! "a fishing pole. The POLE must be a device of some " ! "kind which is used for catching fish. The BAIT " ! "must be some sort of fishing bait."); } ! mixed can_bait_obj_with_obj(string verb) { return this_player()->CanManipulate(); } ! mixed do_bait_obj_with_obj(object pole, object bait) { if( pole == bait ) { ! this_player()->eventPrint("You can't use it to bait itself!"); return 1; } return (mixed)bait->eventBait(this_player(), pole); diff -c -r --new-file ds1.1/lib/verbs/items/balance.c ds2.0r27/lib/verbs/items/balance.c *** ds1.1/lib/verbs/items/balance.c Sun Feb 1 21:30:55 1998 --- ds2.0r27/lib/verbs/items/balance.c Wed Jul 5 00:01:06 2006 *************** *** 14,100 **** verb::create(); SetVerb("balance"); SetSynonyms("weigh"); ! SetRules("OBJ to OBJ"); SetErrorMessage("What two things would you like to balance?"); SetHelp("Syntax: balance OBJ to OBJ\n\n" ! "A simple tool for determining which is the heavier of two objects." ! "See help: item commands"); } mixed can_balance_obj_to_obj() { ! return this_player()->CanCastMagic(1, "balance"); } mixed do_balance_obj_to_obj(object obj1, object obj2) { ! string name1, name2; ! object caster = this_player(); ! if (!obj1 || !obj2) return "You must judge one thing vs another."; ! if (obj1 == obj2) return "That would do a lot of good!"; ! /* Check for presence of objects */ ! name1 = obj1->GetShort(); ! name2 = obj2->GetShort(); ! ! if( environment(obj1) != caster ) { ! caster->eventPrint("You do not have "+name1+"."); ! return 1; ! } ! ! if( environment(obj2) != caster ) { ! caster->eventPrint("You do not have "+name2+"."); ! return 1; ! } ! ! caster->eventPrint("You stare intently at "+name1+" and "+name2+"."); ! environment(caster)->eventPrint( (string)caster->GetName() + ! " concentrates on " + name1 + " and " + name2 + ".", caster); ! if( (int)this_player()->GetInCombat() ) ! this_player()->SetAttack(0, ! (: eventBalance, this_player(), obj1, obj2 :), ! ROUND_OTHER); ! else eventBalance(this_player(), obj1, obj2); ! return 1; } int eventBalance(object caster, object obj1, object obj2) { ! int obj1lvl, obj2lvl; ! string better; ! int cost = random(50) + 50; ! if( !(obj1 && obj2) ) return 0; ! if( (environment(obj1) != caster) || (environment(obj2) != caster) ) { ! caster->eventPrint("You must have both items in your possesion " ! "to compare them."); ! return 0; } if( cost > (int)caster->GetStaminaPoints() ) { ! caster->eventPrint("You are too weary to balance right now."); ! environment(caster)->eventPrint( ! (string)caster->GetName() + " looks tired.", caster); ! return 0; ! ! } ! caster->AddStaminaPoints(-cost); ! obj1lvl = (int)obj1->GetMass(); ! obj2lvl = (int)obj2->GetMass(); ! ! /* Return the right answer */ ! if(obj1lvl == obj2lvl) { ! caster->eventPrint("%^BOLD%^%^WHITE%^" ! "You determine that these two items are equally heavy." ! ".%^RESET%^"); ! return 1; ! } ! if(obj1lvl > obj2lvl) { ! better = obj1->GetShort(); ! } ! else better = obj2->GetShort(); ! caster->eventPrint("%^BOLD%^%^WHITE%^" ! "You determine that " + better + "%^BOLD%^%^WHITE%^" ! " is the heavier object.%^RESET%^"); ! return 1; } --- 14,100 ---- verb::create(); SetVerb("balance"); SetSynonyms("weigh"); ! SetRules("OBJ to OBJ"); SetErrorMessage("What two things would you like to balance?"); SetHelp("Syntax: balance OBJ to OBJ\n\n" ! "A simple tool for determining which is the heavier of two objects." ! "See help: item commands"); } mixed can_balance_obj_to_obj() { ! return this_player()->CanCastMagic(1, "balance"); } mixed do_balance_obj_to_obj(object obj1, object obj2) { ! string name1, name2; ! object caster = this_player(); ! if (!obj1 || !obj2) return "You must judge one thing vs another."; ! if (obj1 == obj2) return "That would do a lot of good!"; ! /* Check for presence of objects */ ! name1 = obj1->GetShort(); ! name2 = obj2->GetShort(); ! ! if( environment(obj1) != caster ) { ! caster->eventPrint("You do not have "+name1+"."); ! return 1; ! } ! ! if( environment(obj2) != caster ) { ! caster->eventPrint("You do not have "+name2+"."); ! return 1; ! } ! ! caster->eventPrint("You stare intently at "+name1+" and "+name2+"."); ! environment(caster)->eventPrint( (string)caster->GetName() + ! " concentrates on " + name1 + " and " + name2 + ".", caster); ! if( (int)this_player()->GetInCombat() ) ! this_player()->SetAttack(0, ! (: eventBalance, this_player(), obj1, obj2 :), ! ROUND_OTHER); ! else eventBalance(this_player(), obj1, obj2); ! return 1; } int eventBalance(object caster, object obj1, object obj2) { ! int obj1lvl, obj2lvl; ! string better; ! int cost = random(50) + 50; ! if( !(obj1 && obj2) ) return 0; ! if( (environment(obj1) != caster) || (environment(obj2) != caster) ) { ! caster->eventPrint("You must have both items in your possesion " ! "to compare them."); ! return 0; } if( cost > (int)caster->GetStaminaPoints() ) { ! caster->eventPrint("You are too weary to balance right now."); ! environment(caster)->eventPrint( ! (string)caster->GetName() + " looks tired.", caster); ! return 0; ! ! } ! caster->AddStaminaPoints(-cost); ! obj1lvl = (int)obj1->GetMass(); ! obj2lvl = (int)obj2->GetMass(); ! ! /* Return the right answer */ ! if(obj1lvl == obj2lvl) { ! caster->eventPrint("%^BOLD%^%^WHITE%^" ! "You determine that these two items are equally heavy." ! ".%^RESET%^"); ! return 1; ! } ! if(obj1lvl > obj2lvl) { ! better = obj1->GetShort(); ! } ! else better = obj2->GetShort(); ! caster->eventPrint("%^BOLD%^%^WHITE%^" ! "You determine that " + better + "%^BOLD%^%^WHITE%^" ! " is the heavier object.%^RESET%^"); ! return 1; } diff -c -r --new-file ds1.1/lib/verbs/items/bury.c ds2.0r27/lib/verbs/items/bury.c *** ds1.1/lib/verbs/items/bury.c Sun Feb 1 21:30:54 1998 --- ds2.0r27/lib/verbs/items/bury.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/items/bury.c ! * From the Dead Soulsr2 Object Library * Buries objects where no one can find them * Created by Descartes of Borg 951030 */ --- 1,5 ---- /* /verbs/items/bury.c ! * From the Dead Souls Object Library * Buries objects where no one can find them * Created by Descartes of Borg 951030 */ *************** *** 23,33 **** varargs static void eventPrepareBury(object who, object tool, object what) { function f = (: eventBury($(who), $(tool), $(what),environment($(who))) :); ! if( who->GetInCombat() ) { send_messages("start", "$agent_name $agent_verb to bury " + ! "with " + tool->GetShort() + ".", who, 0, ! environment(who)); who->SetAttack(0, f, ROUND_OTHER); } else { --- 23,33 ---- varargs static void eventPrepareBury(object who, object tool, object what) { function f = (: eventBury($(who), $(tool), $(what),environment($(who))) :); ! if( who->GetInCombat() ) { send_messages("start", "$agent_name $agent_verb to bury " + ! "with " + tool->GetShort() + ".", who, 0, ! environment(who)); who->SetAttack(0, f, ROUND_OTHER); } else { *************** *** 41,48 **** SetErrorMessage("Bury what with what?"); SetRules("OBJ with OBJ", "STR with OBJ"); SetHelp("Syntax: <bury ITEM with TOOL>\n\n" ! "Allows you to use a digging tool to bury things.\n\n" ! "See also: dig"); } mixed can_bury_str_with_obj() { --- 41,48 ---- SetErrorMessage("Bury what with what?"); SetRules("OBJ with OBJ", "STR with OBJ"); SetHelp("Syntax: <bury ITEM with TOOL>\n\n" ! "Allows you to use a digging tool to bury things.\n\n" ! "See also: dig"); } mixed can_bury_str_with_obj() { *************** *** 52,58 **** if( this_player()->GetPosition() != POSITION_STANDING ) { return "You can only bury things while standing!"; } ! return 1; } mixed can_bury_obj_with_obj() { --- 52,58 ---- if( this_player()->GetPosition() != POSITION_STANDING ) { return "You can only bury things while standing!"; } ! return this_player()->CanManipulate(); } mixed can_bury_obj_with_obj() { *************** *** 61,67 **** mixed do_bury_str_with_obj(string str, object tool) { eventPrepareBury(this_player(), tool); ! return 1; } mixed do_bury_obj_with_obj(object what, object tool) { --- 61,67 ---- mixed do_bury_str_with_obj(string str, object tool) { eventPrepareBury(this_player(), tool); ! return this_player()->CanManipulate(); } mixed do_bury_obj_with_obj(object what, object tool) { diff -c -r --new-file ds1.1/lib/verbs/items/buy.c ds2.0r27/lib/verbs/items/buy.c *** ds1.1/lib/verbs/items/buy.c Sun Feb 1 21:30:56 1998 --- ds2.0r27/lib/verbs/items/buy.c Wed Jul 5 00:01:06 2006 *************** *** 17,35 **** SetRules("STR from LIV"); SetErrorMessage("Buy what from whom?"); SetHelp("Syntax: <buy ITEM from VENDOR>\n\n" ! "When in the presence of vendors, you may buy and sell goods " ! "which match the type of goods the vendor in question trades in. " ! "The \"buy\" command naturally allows you to buy the items " ! "the vendor has for sale.\n\n" ! "Synonyms: purchase\n\n" ! "See also: ask, sell, vendors"); } mixed can_buy_str_from_liv(string str) { if( this_player()->GetParalyzed() ) { return "You cannot do anything."; } ! return 1; } mixed do_buy_str_from_liv(string str, object vendor) { --- 17,35 ---- SetRules("STR from LIV"); SetErrorMessage("Buy what from whom?"); SetHelp("Syntax: <buy ITEM from VENDOR>\n\n" ! "When in the presence of vendors, you may buy and sell goods " ! "which match the type of goods the vendor in question trades in. " ! "The \"buy\" command naturally allows you to buy the items " ! "the vendor has for sale.\n\n" ! "Synonyms: purchase\n\n" ! "See also: ask, sell, vendors"); } mixed can_buy_str_from_liv(string str) { if( this_player()->GetParalyzed() ) { return "You cannot do anything."; } ! return this_player()->CanManipulate(); } mixed do_buy_str_from_liv(string str, object vendor) { diff -c -r --new-file ds1.1/lib/verbs/items/capture.c ds2.0r27/lib/verbs/items/capture.c *** ds1.1/lib/verbs/items/capture.c Sun Feb 1 21:30:54 1998 --- ds2.0r27/lib/verbs/items/capture.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/items/capture.c ! * From the Dead Souls V Object Library * A verb to allow people to capture or catch things with an object * Creatd by Descartes of Borg 961010 * Version: @(#) capture.c 1.4@(#) --- 1,5 ---- /* /verbs/items/capture.c ! * From the Dead Souls Object Library * A verb to allow people to capture or catch things with an object * Creatd by Descartes of Borg 961010 * Version: @(#) capture.c 1.4@(#) *************** *** 17,30 **** SetSynonyms("catch", "trap"); SetErrorMessage("Capture what with what?"); SetHelp("Syntax: <capture OBJECT with OBJECT>\n\n" ! "Some objects can be used to trap living things. This command " ! "therefore allows you to capture those things.\n\n" ! "Synonyms: catch, trap\n\n" ! "See also: free"); } mixed can_capture_liv_word_obj() { ! return 1; } mixed do_capture_liv_word_obj(object target, string word, object tool) { --- 17,30 ---- SetSynonyms("catch", "trap"); SetErrorMessage("Capture what with what?"); SetHelp("Syntax: <capture OBJECT with OBJECT>\n\n" ! "Some objects can be used to trap living things. This command " ! "therefore allows you to capture those things.\n\n" ! "Synonyms: catch, trap\n\n" ! "See also: free"); } mixed can_capture_liv_word_obj() { ! return this_player()->CanManipulate(); } mixed do_capture_liv_word_obj(object target, string word, object tool) { diff -c -r --new-file ds1.1/lib/verbs/items/close.c ds2.0r27/lib/verbs/items/close.c *** ds1.1/lib/verbs/items/close.c Sun Feb 1 21:30:54 1998 --- ds2.0r27/lib/verbs/items/close.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/items/close.c ! * from the Dead Souls V Object Library * close OBJ * created by Descartes of Borg 960115 * Version: @(#) close.c 1.2@(#) --- 1,5 ---- /* /verbs/items/close.c ! * from the Dead Souls Object Library * close OBJ * created by Descartes of Borg 960115 * Version: @(#) close.c 1.2@(#) *************** *** 18,33 **** SetSynonyms("shut"); SetErrorMessage("Close what?"); SetHelp("Syntax: <close OBJECT>\n\n" ! "Closes a door or chest or some other such object.\n\n" ! "Synonyms: shut\n\n" ! "See also: lock, open, pick, unlock"); } mixed can_close_obj(string verb) { if( this_player()->GetParalyzed() ) { return "You are unable to do anything."; } ! return 1; } varargs mixed do_close_obj(object ob, mixed *args...) { --- 18,33 ---- SetSynonyms("shut"); SetErrorMessage("Close what?"); SetHelp("Syntax: <close OBJECT>\n\n" ! "Closes a door or chest or some other such object.\n\n" ! "Synonyms: shut\n\n" ! "See also: lock, open, pick, unlock"); } mixed can_close_obj(string verb) { if( this_player()->GetParalyzed() ) { return "You are unable to do anything."; } ! return this_player()->CanManipulate(); } varargs mixed do_close_obj(object ob, mixed *args...) { diff -c -r --new-file ds1.1/lib/verbs/items/dig.c ds2.0r27/lib/verbs/items/dig.c *** ds1.1/lib/verbs/items/dig.c Sun Feb 1 21:30:55 1998 --- ds2.0r27/lib/verbs/items/dig.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/items/dig.c ! * From the Dead Soulsr2 Object Library * Verb for digging things * Created by Descartes of Borg 951030 * Version: @(#) dig.c 1.2@(#) --- 1,5 ---- /* /verbs/items/dig.c ! * From the Dead Souls Object Library * Verb for digging things * Created by Descartes of Borg 951030 * Version: @(#) dig.c 1.2@(#) *************** *** 25,34 **** varargs static void eventPrepareDig(object who, object tool, object what) { function f = (: eventDig($(who), $(tool), $(what), environment($(who))) :); ! if( (int)this_player()->GetInCombat() ) { send_messages("start", "$agent_name $agent_verb to dig with " + ! tool->GetShort() + ".", who, 0, environment(who)); who->SetAttack(0, f, ROUND_OTHER); } else { --- 25,34 ---- varargs static void eventPrepareDig(object who, object tool, object what) { function f = (: eventDig($(who), $(tool), $(what), environment($(who))) :); ! if( (int)this_player()->GetInCombat() ) { send_messages("start", "$agent_name $agent_verb to dig with " + ! tool->GetShort() + ".", who, 0, environment(who)); who->SetAttack(0, f, ROUND_OTHER); } else { *************** *** 42,53 **** SetRules("with OBJ", "STR with OBJ", "OBJ with OBJ"); SetErrorMessage("Dig with what? Is there anything in particular to dig?"); SetHelp("Syntax: <dig with TOOL>\n" ! " <dig THING with TOOL>\n\n" ! "Allows you to dig with digging tools. Sometimes you may " ! "be required to specify what it is you wish to dig. In " ! "that case, you can use the thing field to specify what it is " ! "you wish to dig.\n\n" ! "See also: bury"); } mixed can_dig_with_obj() { --- 42,53 ---- SetRules("with OBJ", "STR with OBJ", "OBJ with OBJ"); SetErrorMessage("Dig with what? Is there anything in particular to dig?"); SetHelp("Syntax: <dig with TOOL>\n" ! " <dig THING with TOOL>\n\n" ! "Allows you to dig with digging tools. Sometimes you may " ! "be required to specify what it is you wish to dig. In " ! "that case, you can use the thing field to specify what it is " ! "you wish to dig.\n\n" ! "See also: bury"); } mixed can_dig_with_obj() { *************** *** 57,63 **** if( this_player()->GetPosition() != POSITION_STANDING ) { return "Dig when you are not standing?"; } ! return 1; } mixed can_dig_str_with_obj() { --- 57,63 ---- if( this_player()->GetPosition() != POSITION_STANDING ) { return "Dig when you are not standing?"; } ! return this_player()->CanManipulate(); } mixed can_dig_str_with_obj() { diff -c -r --new-file ds1.1/lib/verbs/items/donate.c ds2.0r27/lib/verbs/items/donate.c *** ds1.1/lib/verbs/items/donate.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/verbs/items/donate.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,47 ---- + #include <lib.h> + + inherit LIB_VERB; + + static void create() { + verb::create(); + SetVerb("donate"); + SetRules("STR STR", "STR STR to STR"); + SetErrorMessage("Donate <AMOUNT> <CURRENCY>"); + SetHelp("Syntax: donate <AMOUNT> <CURRENCY>\n\n" + "The donate command is used to donate money."); + } + + mixed can_donate_str_str(string amount, string currency){ + return this_player()->CanManipulate(); + } + + mixed can_donate_str_str_to_str(string amount, string currency, string foo){ + return can_donate_str_str(amount, currency); + } + + mixed do_donate_str_str(string amount, string currency) { + object *stuff; + object *donate_boxes; + + donate_boxes = ({}); + + stuff = all_inventory(environment(this_player())); + + foreach(object thing in stuff){ + if(inherits(LIB_DONATE,thing)){ + donate_boxes += ({ thing }); + } + } + + if(sizeof(donate_boxes)){ + donate_boxes[0]->eventDonate(amount, currency); + } + + else write("There is nowhere to donate that."); + + return 1; + } + + mixed do_donate_str_str_to_str(string amount, string currency, string foo){ + return do_donate_str_str(amount, currency); + } diff -c -r --new-file ds1.1/lib/verbs/items/drink.c ds2.0r27/lib/verbs/items/drink.c *** ds1.1/lib/verbs/items/drink.c Sun Feb 1 21:30:55 1998 --- ds2.0r27/lib/verbs/items/drink.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/items/drink.c ! * from the Dead Soulsr2 Object Library * drink * drink OBJ * created by Descartes of Borg 951113 --- 1,5 ---- /* /verbs/items/drink.c ! * from the Dead Souls Object Library * drink * drink OBJ * created by Descartes of Borg 951113 *************** *** 19,48 **** SetRules("OBJ", "from OBJ"); SetErrorMessage("Drink what?"); SetHelp("Syntax: <drink LIQUID>\n" ! " <drink from THING>\n\n" ! "Allows you to drink a liquid substance. Often these " ! "substances come in the form of caffeine, alcohol, and just " ! "regular drinks. Different types of drinks have different " ! "effects on you which you will learn through experimentation.\n\n" ! "See also: bait, cast, eat, fish"); } ! mixed can_drink_obj(string verb) { return 1; } ! mixed can_drink_from_obj(string verb) { return 1; } mixed do_drink_obj(object ob) { if( (int)this_player()->GetInCombat() ) ! this_player()->SetAttack(0, (: eventDrink, this_player(), ob :), ! ROUND_OTHER); else eventDrink(this_player(), ob); return 1; } mixed do_drink_from_obj(object ob, string id) { if( (int)this_player()->GetInCombat() ) ! this_player()->SetAttack(0, (: eventDrink, this_player(), ob, id :), ! ROUND_OTHER); else eventDrink(this_player(), ob, id); return 1; } --- 19,48 ---- SetRules("OBJ", "from OBJ"); SetErrorMessage("Drink what?"); SetHelp("Syntax: <drink LIQUID>\n" ! " <drink from THING>\n\n" ! "Allows you to drink a liquid substance. Often these " ! "substances come in the form of caffeine, alcohol, and just " ! "regular drinks. Different types of drinks have different " ! "effects on you which you will learn through experimentation.\n\n" ! "See also: bait, cast, eat, fish"); } ! mixed can_drink_obj(string verb) { return this_player()->CanManipulate(); } ! mixed can_drink_from_obj(string verb) { return this_player()->CanManipulate(); } mixed do_drink_obj(object ob) { if( (int)this_player()->GetInCombat() ) ! this_player()->SetAttack(0, (: eventDrink, this_player(), ob :), ! ROUND_OTHER); else eventDrink(this_player(), ob); return 1; } mixed do_drink_from_obj(object ob, string id) { if( (int)this_player()->GetInCombat() ) ! this_player()->SetAttack(0, (: eventDrink, this_player(), ob, id :), ! ROUND_OTHER); else eventDrink(this_player(), ob, id); return 1; } diff -c -r --new-file ds1.1/lib/verbs/items/drop.c ds2.0r27/lib/verbs/items/drop.c *** ds1.1/lib/verbs/items/drop.c Sun Feb 1 21:30:56 1998 --- ds2.0r27/lib/verbs/items/drop.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/items/drop.c ! * from the Dead Souls V Object Library * drop OBJ * drop OBS * drop WRD WRD --- 1,5 ---- /* /verbs/items/drop.c ! * from the Dead Souls Object Library * drop OBJ * drop OBS * drop WRD WRD *************** *** 20,43 **** SetRules("OBS", "WRD WRD"); SetErrorMessage("Drop what?"); SetHelp("Syntax: <drop ITEM>\n" ! " <drop all>\n" ! " <drop all ITEM TYPE>\n" ! " <drop AMOUNT CURRENCY>\n\n" ! "Allows you to drop something you have, or to drop an amount of " ! "some currency you have on you.\n\n" ! "See also: get, put"); } ! mixed can_drop_obj(object ob) { return 1; } mixed can_drop_wrd_wrd(string num, string curr) { int amt; ! if( !num || !curr ) return 0; if( (amt = to_int(num)) < 1 ) return "You cannot do that!"; if( (int)this_player()->GetCurrency(curr) < amt ) ! return "You don't have that much " + curr + "."; ! return 1; } mixed do_drop_obj(object ob) { --- 20,44 ---- SetRules("OBS", "WRD WRD"); SetErrorMessage("Drop what?"); SetHelp("Syntax: <drop ITEM>\n" ! " <drop all>\n" ! " <drop all ITEM TYPE>\n" ! " <drop AMOUNT CURRENCY>\n\n" ! "Allows you to drop something you have, or to drop an amount of " ! "some currency you have on you.\n\n" ! "See also: get, put"); } ! mixed can_drop_obj(object ob) { return this_player()->CanManipulate(); } mixed can_drop_wrd_wrd(string num, string curr) { int amt; ! if( !num || !curr ) return 0; if( (amt = to_int(num)) < 1 ) return "You cannot do that!"; if( (int)this_player()->GetCurrency(curr) < amt ) ! return "You don't have that much " + curr + "."; ! if(this_player()->GetLevel() < 4) return "Newbies can't drop money."; ! return this_player()->CanManipulate(); } mixed do_drop_obj(object ob) { *************** *** 45,71 **** } mixed do_drop_obs(mixed *res) { ! object *obs; mixed tmp; if( !sizeof(res) ) { ! this_player()->eventPrint("You don't have any to drop!"); ! return 1; } obs = filter(res, (: objectp :)); if( !sizeof(obs) ) { ! mixed *ua; ua = unique_array(res, (: $1 :)); foreach(string *list in ua) this_player()->eventPrint(list[0]); return 1; } ! foreach(object ob in obs) ! if( (tmp = (mixed)ob->eventDrop(this_player())) != 1 ) { ! if( stringp(tmp) ) this_player()->eventPrint(tmp); ! else this_player()->eventPrint("You cannot drop " + ! (string)ob->GetShort() + "."); ! } return 1; } --- 46,78 ---- } mixed do_drop_obs(mixed *res) { ! object *obs, *eligible; mixed tmp; if( !sizeof(res) ) { ! this_player()->eventPrint("You don't have any to drop!"); ! return 1; } obs = filter(res, (: objectp :)); if( !sizeof(obs) ) { ! mixed *ua; ua = unique_array(res, (: $1 :)); foreach(string *list in ua) this_player()->eventPrint(list[0]); return 1; } ! eligible=filter(obs, (: (!($1->GetWorn()) && environment($1) == this_player()) :)); ! if(!sizeof(eligible)){ ! write("Remove or unwield items before trying to drop them."); ! eligible = ({}); ! return 1; ! } ! foreach(object ob in eligible) ! if( (tmp = (mixed)ob->eventDrop(this_player())) != 1 ) { ! if( stringp(tmp) ) this_player()->eventPrint(tmp); ! else this_player()->eventPrint("You cannot drop " + ! (string)ob->GetShort() + "."); ! } return 1; } *************** *** 78,91 **** pile = new(LIB_PILE); pile->SetPile(curr, amt); if( !((int)pile->eventMove(env)) || ! (int)this_player()->AddCurrency(curr, -amt) == -1 ) { this_player()->eventPrint("Something prevents your action."); pile->eventDestruct(); return 1; } this_player()->eventPrint("You drop " + amt + " " + curr + "."); environment(this_player())->eventPrint((string)this_player()->GetName() + ! " drops some " + curr + ".", ! this_player()); return 1; } --- 85,98 ---- pile = new(LIB_PILE); pile->SetPile(curr, amt); if( !((int)pile->eventMove(env)) || ! (int)this_player()->AddCurrency(curr, -amt) == -1 ) { this_player()->eventPrint("Something prevents your action."); pile->eventDestruct(); return 1; } this_player()->eventPrint("You drop " + amt + " " + curr + "."); environment(this_player())->eventPrint((string)this_player()->GetName() + ! " drops some " + curr + ".", ! this_player()); return 1; } diff -c -r --new-file ds1.1/lib/verbs/items/eat.c ds2.0r27/lib/verbs/items/eat.c *** ds1.1/lib/verbs/items/eat.c Sun Feb 1 21:30:55 1998 --- ds2.0r27/lib/verbs/items/eat.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/items/eat.c ! * from the Dead Soulsr2 Object Library * created by Descartes of Borg 951113 * Version: @(#) eat.c 1.3@(#) * Last modified: 96/11/03 --- 1,5 ---- /* /verbs/items/eat.c ! * from the Dead Souls Object Library * created by Descartes of Borg 951113 * Version: @(#) eat.c 1.3@(#) * Last modified: 96/11/03 *************** *** 18,26 **** SetErrorMessage("Eat what?"); SetRules("OBJ"); SetHelp("Syntax: <eat FOOD>\n\n" ! "Allows you to munch on some food. Keeping yourself well fed " ! "helps you heal faster from wounds and have greater stamina.\n\n" ! "See also: bait, cast, drink, fish"); } --- 18,26 ---- SetErrorMessage("Eat what?"); SetRules("OBJ"); SetHelp("Syntax: <eat FOOD>\n\n" ! "Allows you to munch on some food. Keeping yourself well fed " ! "helps you heal faster from wounds and have greater stamina.\n\n" ! "See also: bait, cast, drink, fish"); } *************** *** 35,47 **** if( this_player()->GetParalyzed() ) { return "You cannot do anything."; } ! return 1; } mixed do_eat_obj(object ob) { if( this_player()->GetInCombat() ) { this_player()->SetAttack(0, (: eventEat, this_player(), ob :), ! ROUND_OTHER); } else { eventEat(this_player(), ob); --- 35,47 ---- if( this_player()->GetParalyzed() ) { return "You cannot do anything."; } ! return this_player()->CanManipulate(); } mixed do_eat_obj(object ob) { if( this_player()->GetInCombat() ) { this_player()->SetAttack(0, (: eventEat, this_player(), ob :), ! ROUND_OTHER); } else { eventEat(this_player(), ob); diff -c -r --new-file ds1.1/lib/verbs/items/equate.c ds2.0r27/lib/verbs/items/equate.c *** ds1.1/lib/verbs/items/equate.c Sun Feb 1 21:30:55 1998 --- ds2.0r27/lib/verbs/items/equate.c Wed Jul 5 00:01:06 2006 *************** *** 14,132 **** verb::create(); SetVerb("judge"); SetSynonyms("equate"); ! SetRules("OBJ to OBJ"); SetErrorMessage("What two things would you like to equate?"); SetHelp("Syntax: equate OBJ to OBJ\n\n" ! "A bargaining ability which allows people to compare the " ! "relative worth of two items. The more experienced you are " ! "at bartering, the better chance you have of correctly judging " ! "the more valuable item.\n\n" ! "See help: item commands"); } mixed can_judge_obj_to_obj() { ! if( this_player()->GetLevel() < 6 ) { ! this_player()->eventPrint("You are not experienced enough to judge " ! "the value of items accurately."); ! return 0; } ! return this_player()->CanCastMagic(1, "judge"); } mixed do_judge_obj_to_obj(object obj1, object obj2) { ! int level; ! string name1, name2; ! object caster = this_player(); ! if( !((int)caster->GetSkillLevel("bargaining")) ) { ! return "You do not have the skills to judge items."; } ! if (!obj1 || !obj2) return "You must judge one thing vs another."; ! if (obj1 == obj2) return "That would do a lot of good!"; ! ! /* Check for presence of objects */ ! name1 = obj1->GetShort(); ! name2 = obj2->GetShort(); ! ! if( environment(obj1) != caster ) { ! caster->eventPrint("You do not have "+name1+"."); ! return 1; ! } ! ! if( environment(obj2) != caster ) { ! caster->eventPrint("You do not have "+name2+"."); ! return 1; ! } ! ! level = caster->GetSkillLevel("bargaining"); ! caster->eventPrint("You stare intently at "+name1+" and "+name2+"."); ! environment(caster)->eventPrint( (string)caster->GetName() + ! " concentrates on " + name1 + " and " + name2 + ".", caster); ! if( (int)this_player()->GetInCombat() ) ! this_player()->SetAttack(0, ! (: eventJudge, this_player(), obj1, obj2, level :), ! ROUND_OTHER); ! else eventJudge(this_player(), obj1, obj2, level); ! return 1; } int eventJudge(object caster, object obj1, object obj2, int level) { ! int obj1lvl, obj2lvl; ! string better; ! int cost = random(50) + 50; ! if( !(obj1 && obj2) ) return 0; ! if( (environment(obj1) != caster) || (environment(obj2) != caster) ) { ! caster->eventPrint("You must have both items in your possesion " ! "to compare them."); ! return 0; } if( cost > (int)caster->GetStaminaPoints() ) { ! caster->eventPrint("You are too weary to judge right now."); ! environment(caster)->eventPrint( ! (string)caster->GetName() + " looks tired.", caster); ! return 0; ! ! } ! caster->AddStaminaPoints(-cost); ! obj1lvl = (int)obj1->GetValue(); ! obj2lvl = (int)obj2->GetValue(); ! ! if( level < (5 + random(35))) { ! ! if(random(7)) { ! if(random(5) < 2) { ! better = obj2->GetShort(); ! } ! else better = obj1->GetShort(); ! caster->eventPrint("%^BOLD%^%^WHITE%^" ! "You determine that " + better + "%^BOLD%^%^WHITE%^" ! " is the more valuable object.%^RESET%^"); ! return 0; ! } else caster->eventPrint("%^BOLD%^%^WHITE%^" "You determine that these two items are equally valuable." ".%^RESET%^"); - caster->AddSkillPoints("bargaining",random(25)); return 1; ! } ! /* Return the right answer */ ! if(obj1lvl == obj2lvl) { ! caster->eventPrint("%^BOLD%^%^WHITE%^" ! "You determine that these two items are equally valuable." ! ".%^RESET%^"); ! return 1; ! } ! if(obj1lvl > obj2lvl) { ! better = obj1->GetShort(); ! } ! else better = obj2->GetShort(); ! caster->eventPrint("%^BOLD%^%^WHITE%^" ! "You determine that " + better + "%^BOLD%^%^WHITE%^" ! " is the more valuable object.%^RESET%^"); ! caster->AddSkillPoints("bargaining",random(50)); ! return 1; } --- 14,132 ---- verb::create(); SetVerb("judge"); SetSynonyms("equate"); ! SetRules("OBJ to OBJ"); SetErrorMessage("What two things would you like to equate?"); SetHelp("Syntax: equate OBJ to OBJ\n\n" ! "A bargaining ability which allows people to compare the " ! "relative worth of two items. The more experienced you are " ! "at bartering, the better chance you have of correctly judging " ! "the more valuable item.\n\n" ! "See help: item commands"); } mixed can_judge_obj_to_obj() { ! if( this_player()->GetLevel() < 6 ) { ! this_player()->eventPrint("You are not experienced enough to judge " ! "the value of items accurately."); ! return 0; } ! return this_player()->CanCastMagic(1, "judge"); } mixed do_judge_obj_to_obj(object obj1, object obj2) { ! int level; ! string name1, name2; ! object caster = this_player(); ! if( !((int)caster->GetSkillLevel("bargaining")) ) { ! return "You do not have the skills to judge items."; } ! if (!obj1 || !obj2) return "You must judge one thing vs another."; ! if (obj1 == obj2) return "That would do a lot of good!"; ! ! /* Check for presence of objects */ ! name1 = obj1->GetShort(); ! name2 = obj2->GetShort(); ! ! if( environment(obj1) != caster ) { ! caster->eventPrint("You do not have "+name1+"."); ! return 1; ! } ! ! if( environment(obj2) != caster ) { ! caster->eventPrint("You do not have "+name2+"."); ! return 1; ! } ! ! level = caster->GetSkillLevel("bargaining"); ! caster->eventPrint("You stare intently at "+name1+" and "+name2+"."); ! environment(caster)->eventPrint( (string)caster->GetName() + ! " concentrates on " + name1 + " and " + name2 + ".", caster); ! if( (int)this_player()->GetInCombat() ) ! this_player()->SetAttack(0, ! (: eventJudge, this_player(), obj1, obj2, level :), ! ROUND_OTHER); ! else eventJudge(this_player(), obj1, obj2, level); ! return 1; } int eventJudge(object caster, object obj1, object obj2, int level) { ! int obj1lvl, obj2lvl; ! string better; ! int cost = random(50) + 50; ! if( !(obj1 && obj2) ) return 0; ! if( (environment(obj1) != caster) || (environment(obj2) != caster) ) { ! caster->eventPrint("You must have both items in your possesion " ! "to compare them."); ! return 0; } if( cost > (int)caster->GetStaminaPoints() ) { ! caster->eventPrint("You are too weary to judge right now."); ! environment(caster)->eventPrint( ! (string)caster->GetName() + " looks tired.", caster); ! return 0; ! ! } ! caster->AddStaminaPoints(-cost); ! obj1lvl = (int)obj1->GetValue(); ! obj2lvl = (int)obj2->GetValue(); ! ! if( level < (5 + random(35))) { ! ! if(random(7)) { ! if(random(5) < 2) { ! better = obj2->GetShort(); ! } ! else better = obj1->GetShort(); ! caster->eventPrint("%^BOLD%^%^WHITE%^" ! "You determine that " + better + "%^BOLD%^%^WHITE%^" ! " is the more valuable object.%^RESET%^"); ! return 0; ! } else caster->eventPrint("%^BOLD%^%^WHITE%^" + "You determine that these two items are equally valuable." + ".%^RESET%^"); + caster->AddSkillPoints("bargaining",random(25)); + return 1; + } + /* Return the right answer */ + if(obj1lvl == obj2lvl) { + caster->eventPrint("%^BOLD%^%^WHITE%^" "You determine that these two items are equally valuable." ".%^RESET%^"); return 1; ! } ! if(obj1lvl > obj2lvl) { ! better = obj1->GetShort(); ! } ! else better = obj2->GetShort(); ! caster->eventPrint("%^BOLD%^%^WHITE%^" ! "You determine that " + better + "%^BOLD%^%^WHITE%^" ! " is the more valuable object.%^RESET%^"); ! caster->AddSkillPoints("bargaining",random(50)); ! return 1; } diff -c -r --new-file ds1.1/lib/verbs/items/extinguish.c ds2.0r27/lib/verbs/items/extinguish.c *** ds1.1/lib/verbs/items/extinguish.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/verbs/items/extinguish.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,50 ---- + #include <lib.h> + #include "include/extinguish.h" + + inherit LIB_VERB; + + static void create() { + verb::create(); + SetVerb("extinguish"); + SetSynonyms("douse"); + SetRules("OBS"); + SetErrorMessage("Extinguish what?"); + SetHelp("Syntax: <extinguish OBJECT>\n\n" + "Extinguish a burning thing like a torch or a lamp.\n\n" + "See also: light"); + } + + mixed can_extinguish_obj() { + return this_player()->CanManipulate(); + } + + mixed do_extinguish_obj(object target) { + return do_extinguish_obs(({ target })); + } + + mixed do_extinguish_obs(mixed *targs) { + object *obs; + string tmp; + + if( !sizeof(targs) ) { + this_player()->eventPrint("There is no such thing to be extinguished."); + return 1; + } + obs = filter(targs, (: objectp :)); + if( !sizeof(obs) ) { + mixed *ua; + + ua = unique_array(targs, (: $1 :)); + foreach(string *list in ua) this_player()->eventPrint(list[0]); + return 1; + } + obs = filter(obs, (: (int)$1->eventExtinguish(this_player()) :)); + if( !sizeof(obs) ) return 1; + tmp = item_list(obs); + this_player()->eventPrint("You extinguish " + tmp + "."); + environment(this_player())->eventPrint((string)this_player()->GetName() + + " extinguishes " + tmp + ".", + this_player()); + return 1; + } + diff -c -r --new-file ds1.1/lib/verbs/items/free.c ds2.0r27/lib/verbs/items/free.c *** ds1.1/lib/verbs/items/free.c Sun Feb 1 21:30:54 1998 --- ds2.0r27/lib/verbs/items/free.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/items/free.c ! * From the Dead Souls V Object Library * A verb to allow people to free things from traps * Creatd by Descartes of Borg 961010 * Version: @(#) free.c 1.1@(#) --- 1,5 ---- /* /verbs/items/free.c ! * From the Dead Souls Object Library * A verb to allow people to free things from traps * Creatd by Descartes of Borg 961010 * Version: @(#) free.c 1.1@(#) *************** *** 17,29 **** SetSynonyms("release", "liberate", "emancipate"); SetErrorMessage("Free what from what?"); SetHelp("Syntax: <free OBJECT from OBJECT>\n\n" ! "Frees an object from a trap.\n\n" ! "Synonyms: emancipate, liberate, release\n\n" ! "See also: capture"); } mixed can_free_liv_from_obj() { ! return 1; } mixed do_free_liv_from_obj(object target, object tool) { --- 17,29 ---- SetSynonyms("release", "liberate", "emancipate"); SetErrorMessage("Free what from what?"); SetHelp("Syntax: <free OBJECT from OBJECT>\n\n" ! "Frees an object from a trap.\n\n" ! "Synonyms: emancipate, liberate, release\n\n" ! "See also: capture"); } mixed can_free_liv_from_obj() { ! return this_player()->CanManipulate(); } mixed do_free_liv_from_obj(object target, object tool) { diff -c -r --new-file ds1.1/lib/verbs/items/get.c ds2.0r27/lib/verbs/items/get.c *** ds1.1/lib/verbs/items/get.c Sun Feb 1 21:30:52 1998 --- ds2.0r27/lib/verbs/items/get.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/items/get.c ! * from the Dead Souls V Object Library * created by Descartes of Borg 950113 * Version: @(#) get.c 1.5@(#) * Last Modified: 96/11/12 --- 1,5 ---- /* /verbs/items/get.c ! * from the Dead Souls Object Library * created by Descartes of Borg 950113 * Version: @(#) get.c 1.5@(#) * Last Modified: 96/11/12 *************** *** 13,60 **** verb::create(); SetVerb("get"); SetRules("WRD WRD from OBJ", "WRD WRD out of OBJ", "OBS", ! "OBS out of OBJ", "OBS from OBJ"); SetSynonyms("take"); SetErrorMessage("Get what? Or perhaps get something from somewhere?"); SetHelp("Syntax: <get ITEM>\n" ! " <get ITEM from OBJECT>\n" ! " <get ITEM out of OBJECT>\n" ! " <get AMOUNT CURRENCY from pile>\n" ! " <get AMOUNT CURRENCY out of pile>\n\n" ! "This allows you to get items in the same room as you, or " ! "contained inside other items so that you are carrying them. " ! "In addition, you can specify partial amounts of currency to " ! "pick up from a pile lying around.\n\n" ! "Synonyms: take\n\n" ! "See also: drop, give, put"); } mixed eventCheckLight(object who) { int light; ! ! if( (light = effective_light(who)) < 0 ) { if( 100 + (10*light) < random(100) ) ! return "You fumble around in the darkness."; ! else return 1; } ! else if( light > 4 ) { if( 100 - (10*light) < random(100) ) ! return "You fumble around in the blinding light."; ! else return 1; } ! else return 1; } mixed can_get_obj(string verb) { return eventCheckLight(this_player()); } ! mixed can_get_obj_out_of_obj(string verb) { return eventCheckLight(this_player()); } ! mixed can_get_obj_from_obj(string verb) { ! return can_get_obj_out_of_obj(verb); } mixed can_get_wrd_wrd_out_of_obj(string num, string curr) { --- 13,67 ---- verb::create(); SetVerb("get"); SetRules("WRD WRD from OBJ", "WRD WRD out of OBJ", "OBS", ! "OBS out of OBJ", "OBS from OBJ"); SetSynonyms("take"); SetErrorMessage("Get what? Or perhaps get something from somewhere?"); SetHelp("Syntax: <get ITEM>\n" ! " <get ITEM from OBJECT>\n" ! " <get ITEM out of OBJECT>\n" ! " <get AMOUNT CURRENCY from pile>\n" ! " <get AMOUNT CURRENCY out of pile>\n\n" ! "This allows you to get items in the same room as you, or " ! "contained inside other items so that you are carrying them. " ! "In addition, you can specify partial amounts of currency to " ! "pick up from a pile lying around.\n\n" ! "Synonyms: take\n\n" ! "See also: drop, give, put"); } mixed eventCheckLight(object who) { int light; ! ! if( (light = who->GetEffectiveVision()) < 2 ) { if( 100 + (10*light) < random(100) ) ! return "You fumble around in the darkness."; ! else return this_player()->CanManipulate(); } ! else if( light > 5 ) { if( 100 - (10*light) < random(100) ) ! return "You fumble around in the blinding light."; ! else return this_player()->CanManipulate(); } ! else return this_player()->CanManipulate(); } mixed can_get_obj(string verb) { return eventCheckLight(this_player()); } ! varargs mixed can_get_obj_out_of_obj(string verb, string rule, object item, object container, mixed poo) { ! //tc("hit can_get_obj_out_of_obj","blue"); ! //tc("verb: "+verb,"blue"); ! //tc("rule: "+rule,"blue"); ! //tc("item: "+identify(item),"blue"); ! //tc("container: "+identify(container),"blue"); ! //tc("container type: "+typeof(container),"blue"); ! //tc("poo: "+identify(poo),"blue"); return eventCheckLight(this_player()); } ! mixed can_get_obj_from_obj(string verb, string rule, object item, object container) { ! return can_get_obj_out_of_obj(verb, rule, item, container); } mixed can_get_wrd_wrd_out_of_obj(string num, string curr) { *************** *** 66,71 **** --- 73,79 ---- } mixed do_get_obj(object ob) { + //tc("hit do_get_obj"); return ob->eventGet(this_player()); } *************** *** 78,101 **** } mixed do_get_obj_out_of_obj(object ob, object storage) { return (mixed)storage->eventGetFrom(this_player(), ({ ob })); } mixed do_get_obj_from_obj(object ob, object storage) { return do_get_obj_out_of_obj(ob, storage); } mixed do_get_obs(mixed *targs) { object *obs; ! if( !sizeof(targs) ) { ! this_player()->eventPrint("There is no such thing to be taken."); return 1; } obs = filter(targs, (: objectp :)); if( !sizeof(obs) ) { mapping messages = unique_mapping(targs, (: $1 :)); ! foreach(string msg in keys(messages)) { this_player()->eventPrint(msg); } --- 86,123 ---- } mixed do_get_obj_out_of_obj(object ob, object storage) { + //tc("entered do_get_obj_out_of_obj","blue"); + //tc("ob: "+identify(ob),"blue"); + if(!ob) return "No object"; + //tc("storage: "+identify(storage),"blue"); + if(!(environment(ob) == storage)){ + //tc("we noticed it isn't in there.","blue"); + ob = present(ob->GetKeyName(), storage); + //tc("ob: "+identify(ob),"blue"); + if(!ob){ + write("That's not in there."); + return ""; + } + } return (mixed)storage->eventGetFrom(this_player(), ({ ob })); } mixed do_get_obj_from_obj(object ob, object storage) { + //tc("hit do_get_obj_from_obj","blue"); return do_get_obj_out_of_obj(ob, storage); } mixed do_get_obs(mixed *targs) { object *obs; ! //tc("do_get_obs"); if( !sizeof(targs) ) { ! this_player()->eventPrint("There is no such thing to be taken."); return 1; } obs = filter(targs, (: objectp :)); if( !sizeof(obs) ) { mapping messages = unique_mapping(targs, (: $1 :)); ! foreach(string msg in keys(messages)) { this_player()->eventPrint(msg); } *************** *** 111,119 **** mixed do_get_obs_out_of_obj(mixed *targs, object storage) { object *obs; ! if( !sizeof(targs) ) { ! this_player()->eventPrint("There is no such thing to be taken."); return 1; } obs = filter(targs, (: objectp :)); --- 133,141 ---- mixed do_get_obs_out_of_obj(mixed *targs, object storage) { object *obs; ! //tc("do_get_obs_out_of_obj"); if( !sizeof(targs) ) { ! this_player()->eventPrint("There is no such thing to be taken."); return 1; } obs = filter(targs, (: objectp :)); *************** *** 129,133 **** --- 151,156 ---- } mixed do_get_obs_from_obj(mixed *obs, object storage) { + //tc("hit do_get_obs_from_obj"); return do_get_obs_out_of_obj(obs, storage); } diff -c -r --new-file ds1.1/lib/verbs/items/give.c ds2.0r27/lib/verbs/items/give.c *** ds1.1/lib/verbs/items/give.c Sun Feb 1 21:30:56 1998 --- ds2.0r27/lib/verbs/items/give.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/items/give.c ! * from the Dead Souls V Object Library * give LIV OBJ * give OBJ to LIV * give LIV WRD WRD --- 1,5 ---- /* /verbs/items/give.c ! * from the Dead Souls Object Library * give LIV OBJ * give OBJ to LIV * give LIV WRD WRD *************** *** 14,40 **** inherit LIB_VERB; static void create() { verb::create(); SetVerb("give"); SetRules("LIV WRD WRD", "WRD WRD to LIV", "LIV OBS", "OBS to LIV"); SetErrorMessage("Give what to whom?"); SetHelp("Syntax: <give LIVING ITEM>\n" ! " <give LIVING ITEMS>\n" ! " <give ITEM to LIVING>\n" ! " <give ITEMS to LIVING>\n" ! " <give LIVING AMOUNT CURRENCY>\n" ! " <give AMOUNT CURRENCY to LIVING>\n\n" ! "This command allows you to give something you have to " ! "someone else.\n\n" ! "See also: drop, get, put"); } mixed can_give_liv_obj() { return can_give_obj_to_liv(); } ! mixed can_give_obj_to_liv() { return 1; } mixed can_give_liv_wrd_wrd(object targ, string num, string curr) { return can_give_wrd_wrd_to_liv(num, curr, targ); --- 14,43 ---- inherit LIB_VERB; + string curr2; + static void create() { verb::create(); SetVerb("give"); SetRules("LIV WRD WRD", "WRD WRD to LIV", "LIV OBS", "OBS to LIV"); SetErrorMessage("Give what to whom?"); SetHelp("Syntax: <give LIVING ITEM>\n" ! " <give LIVING ITEMS>\n" ! " <give ITEM to LIVING>\n" ! " <give ITEMS to LIVING>\n" ! " <give LIVING AMOUNT CURRENCY>\n" ! " <give AMOUNT CURRENCY to LIVING>\n\n" ! "This command allows you to give something you have to " ! "someone else.\n\n" ! "See also: drop, get, put"); } mixed can_give_liv_obj() { return can_give_obj_to_liv(); } ! mixed can_give_obj_to_liv(mixed arg1, mixed arg2) { ! return this_player()->CanManipulate(); } mixed can_give_liv_wrd_wrd(object targ, string num, string curr) { return can_give_wrd_wrd_to_liv(num, curr, targ); *************** *** 42,51 **** mixed can_give_wrd_wrd_to_liv(string num, string curr, object targ) { int amt; ! ! if( (amt = to_int(num)) < 1 ) return "What sort of amount is that?"; if( amt > (int)this_player()->GetCurrency(lower_case(curr)) ) ! return "You don't have that much " + curr + "."; return 1; } mixed do_give_liv_obj(object target, object what) { --- 45,66 ---- mixed can_give_wrd_wrd_to_liv(string num, string curr, object targ) { int amt; ! curr2 = curr; ! if(!valid_currency(curr)) curr = truncate(curr,1); ! if(!valid_currency(curr)) curr = truncate(curr,1); ! if(!valid_currency(curr)) curr = curr2 +"s"; ! if(!valid_currency(curr)) curr = curr2 +"es"; ! if(valid_currency(curr)) curr2 = curr; ! ! if(sscanf(num,"%d",amt) != 1){ ! if(valid_currency(curr)) return "Please use a number to specify the amount."; ! else return "That isn't a valid currency."; ! } ! if( amt < 1 ) return "What sort of amount is that?"; if( amt > (int)this_player()->GetCurrency(lower_case(curr)) ) ! return "You don't have that much " + curr + "."; ! if(this_player()->GetLevel() < 4) return "Newbies can't give money."; ! return this_player()->CanManipulate(); } mixed do_give_liv_obj(object target, object what) { *************** *** 53,81 **** } mixed do_give_obj_to_liv(object what, object target) { if( !((int)what->eventMove(target)) ) { ! this_player()->eventPrint("It is too heavy to be carried."); return 1; } this_player()->eventPrint("You give " + (string)target->GetName() + " " + ! (string)what->GetShort() + "."); target->eventPrint((string)this_player()->GetName() + " gives you " + ! (string)what->GetShort() + "."); environment(this_player())->eventPrint((string)this_player()->GetName() + ! " gives " + ! (string)target->GetName() + ! " " + (string)what->GetShort() +".", ! ({ this_player(), target })); return 1; } ! mixed do_give_liv_wrd_wrd(object target, string num, string curr) { return do_give_wrd_wrd_to_liv(num, curr, target); } mixed do_give_wrd_wrd_to_liv(string num, string curr, object target) { int amt; ! amt = to_int(num); if( (int)target->AddCurrency(curr, amt) == -1 ) { this_player()->eventPrint("You just can't give that money away."); --- 68,101 ---- } mixed do_give_obj_to_liv(object what, object target) { + if(!intp(target->CanManipulate())){ + this_player()->eventPrint(target->GetName()+" is incapable "+ + "of holding that."); + return 1; + } if( !((int)what->eventMove(target)) ) { ! this_player()->eventPrint("They cannot accept that right now."); return 1; } this_player()->eventPrint("You give " + (string)target->GetName() + " " + ! (string)what->GetShort() + "."); target->eventPrint((string)this_player()->GetName() + " gives you " + ! (string)what->GetShort() + "."); environment(this_player())->eventPrint((string)this_player()->GetName() + ! " gives " + ! (string)target->GetName() + ! " " + (string)what->GetShort() +".", ! ({ this_player(), target })); return 1; } ! mixed do_give_liv_wrd_wrd(object target, string num, string curr) { return do_give_wrd_wrd_to_liv(num, curr, target); } mixed do_give_wrd_wrd_to_liv(string num, string curr, object target) { int amt; ! if(curr2) curr = curr2; amt = to_int(num); if( (int)target->AddCurrency(curr, amt) == -1 ) { this_player()->eventPrint("You just can't give that money away."); *************** *** 87,99 **** return 1; } this_player()->eventPrint("You give " + (string)target->GetName() + " " + ! amt + " " + curr + "."); target->eventPrint((string)this_player()->GetName() + " gives you " + ! amt + " " + curr + "."); environment(this_player())->eventPrint((string)this_player()->GetName() + ! " gives " + amt + " " + curr + ! " to " + (string)target->GetName() + ! ".", ({ target, this_player() })); return 1; } --- 107,119 ---- return 1; } this_player()->eventPrint("You give " + (string)target->GetName() + " " + ! amt + " " + curr + "."); target->eventPrint((string)this_player()->GetName() + " gives you " + ! amt + " " + curr + "."); environment(this_player())->eventPrint((string)this_player()->GetName() + ! " gives " + amt + " " + curr + ! " to " + (string)target->GetName() + ! ".", ({ target, this_player() })); return 1; } *************** *** 105,116 **** object *obs; if( sizeof(items) < 1 ) { ! this_player()->eventPrint("You don't have any to give."); return 1; } obs = filter(items, (: objectp :)); if( !sizeof(obs) ) { ! mixed *ua; ua = unique_array(items, (: $1 :)); foreach(string *list in ua) this_player()->eventPrint(list[0]); --- 125,136 ---- object *obs; if( sizeof(items) < 1 ) { ! this_player()->eventPrint("You don't have any to give."); return 1; } obs = filter(items, (: objectp :)); if( !sizeof(obs) ) { ! mixed *ua; ua = unique_array(items, (: $1 :)); foreach(string *list in ua) this_player()->eventPrint(list[0]); diff -c -r --new-file ds1.1/lib/verbs/items/include/extinguish.h ds2.0r27/lib/verbs/items/include/extinguish.h *** ds1.1/lib/verbs/items/include/extinguish.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/verbs/items/include/extinguish.h Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,11 ---- + #ifndef l_extinguish_h + #define l_extinguish_h + + static void create(); + + mixed can_extinguish_obj(); + + mixed do_extinguish_obj(object target); + mixed do_extinguish_obs(mixed *targs); + + #endif /* l_extinguish_h */ diff -c -r --new-file ds1.1/lib/verbs/items/judge.c ds2.0r27/lib/verbs/items/judge.c *** ds1.1/lib/verbs/items/judge.c Sun Feb 1 21:30:55 1998 --- ds2.0r27/lib/verbs/items/judge.c Wed Jul 5 00:01:06 2006 *************** *** 14,132 **** verb::create(); SetVerb("judge"); SetSynonyms("equate"); ! SetRules("OBJ to OBJ"); SetErrorMessage("What two things would you like to equate?"); SetHelp("Syntax: equate OBJ to OBJ\n\n" ! "A bargaining ability which allows people to compare the " ! "relative worth of two items. The more experienced you are " ! "at bartering, the better chance you have of correctly judging " ! "the more valuable item.\n\n" ! "See help: item commands"); } mixed can_judge_obj_to_obj() { ! if( this_player()->GetLevel() < 6 ) { ! this_player()->eventPrint("You are not experienced enough to judge " ! "the value of items accurately."); ! return 0; } ! return this_player()->CanCastMagic(1, "judge"); } mixed do_judge_obj_to_obj(object obj1, object obj2) { ! int level; ! string name1, name2; ! object caster = this_player(); ! if( !((int)caster->GetSkillLevel("bargaining")) ) { ! return "You do not have the skills to judge items."; } ! if (!obj1 || !obj2) return "You must judge one thing vs another."; ! if (obj1 == obj2) return "That would do a lot of good!"; ! ! /* Check for presence of objects */ ! name1 = obj1->GetShort(); ! name2 = obj2->GetShort(); ! ! if( environment(obj1) != caster ) { ! caster->eventPrint("You do not have "+name1+"."); ! return 1; ! } ! ! if( environment(obj2) != caster ) { ! caster->eventPrint("You do not have "+name2+"."); ! return 1; ! } ! ! level = caster->GetSkillLevel("bargaining"); ! caster->eventPrint("You stare intently at "+name1+" and "+name2+"."); ! environment(caster)->eventPrint( (string)caster->GetName() + ! " concentrates on " + name1 + " and " + name2 + ".", caster); ! if( (int)this_player()->GetInCombat() ) ! this_player()->SetAttack(0, ! (: eventJudge, this_player(), obj1, obj2, level :), ! ROUND_OTHER); ! else eventJudge(this_player(), obj1, obj2, level); ! return 1; } int eventJudge(object caster, object obj1, object obj2, int level) { ! int obj1lvl, obj2lvl; ! string better; ! int cost = random(50) + 50; ! if( !(obj1 && obj2) ) return 0; ! if( (environment(obj1) != caster) || (environment(obj2) != caster) ) { ! caster->eventPrint("You must have both items in your possesion " ! "to compare them."); ! return 0; } if( cost > (int)caster->GetStaminaPoints() ) { ! caster->eventPrint("You are too weary to judge right now."); ! environment(caster)->eventPrint( ! (string)caster->GetName() + " looks tired.", caster); ! return 0; ! ! } ! caster->AddStaminaPoints(-cost); ! obj1lvl = (int)obj1->GetValue(); ! obj2lvl = (int)obj2->GetValue(); ! ! if( level < (5 + random(35))) { ! ! if(random(7)) { ! if(random(5) < 2) { ! better = obj2->GetShort(); ! } ! else better = obj1->GetShort(); ! caster->eventPrint("%^BOLD%^%^WHITE%^" ! "You determine that " + better + "%^BOLD%^%^WHITE%^" ! " is the more valuable object.%^RESET%^"); ! return 0; ! } else caster->eventPrint("%^BOLD%^%^WHITE%^" "You determine that these two items are equally valuable." ".%^RESET%^"); - caster->AddSkillPoints("bargaining",random(25)); return 1; ! } ! /* Return the right answer */ ! if(obj1lvl == obj2lvl) { ! caster->eventPrint("%^BOLD%^%^WHITE%^" ! "You determine that these two items are equally valuable." ! ".%^RESET%^"); ! return 1; ! } ! if(obj1lvl > obj2lvl) { ! better = obj1->GetShort(); ! } ! else better = obj2->GetShort(); ! caster->eventPrint("%^BOLD%^%^WHITE%^" ! "You determine that " + better + "%^BOLD%^%^WHITE%^" ! " is the more valuable object.%^RESET%^"); ! caster->AddSkillPoints("bargaining",random(50)); ! return 1; } --- 14,132 ---- verb::create(); SetVerb("judge"); SetSynonyms("equate"); ! SetRules("OBJ to OBJ"); SetErrorMessage("What two things would you like to equate?"); SetHelp("Syntax: equate OBJ to OBJ\n\n" ! "A bargaining ability which allows people to compare the " ! "relative worth of two items. The more experienced you are " ! "at bartering, the better chance you have of correctly judging " ! "the more valuable item.\n\n" ! "See help: item commands"); } mixed can_judge_obj_to_obj() { ! if( this_player()->GetLevel() < 6 ) { ! this_player()->eventPrint("You are not experienced enough to judge " ! "the value of items accurately."); ! return 0; } ! return this_player()->CanCastMagic(1, "judge"); } mixed do_judge_obj_to_obj(object obj1, object obj2) { ! int level; ! string name1, name2; ! object caster = this_player(); ! if( !((int)caster->GetSkillLevel("bargaining")) ) { ! return "You do not have the skills to judge items."; } ! if (!obj1 || !obj2) return "You must judge one thing vs another."; ! if (obj1 == obj2) return "That would do a lot of good!"; ! ! /* Check for presence of objects */ ! name1 = obj1->GetShort(); ! name2 = obj2->GetShort(); ! ! if( environment(obj1) != caster ) { ! caster->eventPrint("You do not have "+name1+"."); ! return 1; ! } ! ! if( environment(obj2) != caster ) { ! caster->eventPrint("You do not have "+name2+"."); ! return 1; ! } ! ! level = caster->GetSkillLevel("bargaining"); ! caster->eventPrint("You stare intently at "+name1+" and "+name2+"."); ! environment(caster)->eventPrint( (string)caster->GetName() + ! " concentrates on " + name1 + " and " + name2 + ".", caster); ! if( (int)this_player()->GetInCombat() ) ! this_player()->SetAttack(0, ! (: eventJudge, this_player(), obj1, obj2, level :), ! ROUND_OTHER); ! else eventJudge(this_player(), obj1, obj2, level); ! return 1; } int eventJudge(object caster, object obj1, object obj2, int level) { ! int obj1lvl, obj2lvl; ! string better; ! int cost = random(50) + 50; ! if( !(obj1 && obj2) ) return 0; ! if( (environment(obj1) != caster) || (environment(obj2) != caster) ) { ! caster->eventPrint("You must have both items in your possesion " ! "to compare them."); ! return 0; } if( cost > (int)caster->GetStaminaPoints() ) { ! caster->eventPrint("You are too weary to judge right now."); ! environment(caster)->eventPrint( ! (string)caster->GetName() + " looks tired.", caster); ! return 0; ! ! } ! caster->AddStaminaPoints(-cost); ! obj1lvl = (int)obj1->GetValue(); ! obj2lvl = (int)obj2->GetValue(); ! ! if( level < (5 + random(35))) { ! ! if(random(7)) { ! if(random(5) < 2) { ! better = obj2->GetShort(); ! } ! else better = obj1->GetShort(); ! caster->eventPrint("%^BOLD%^%^WHITE%^" ! "You determine that " + better + "%^BOLD%^%^WHITE%^" ! " is the more valuable object.%^RESET%^"); ! return 0; ! } else caster->eventPrint("%^BOLD%^%^WHITE%^" + "You determine that these two items are equally valuable." + ".%^RESET%^"); + caster->AddSkillPoints("bargaining",random(25)); + return 1; + } + /* Return the right answer */ + if(obj1lvl == obj2lvl) { + caster->eventPrint("%^BOLD%^%^WHITE%^" "You determine that these two items are equally valuable." ".%^RESET%^"); return 1; ! } ! if(obj1lvl > obj2lvl) { ! better = obj1->GetShort(); ! } ! else better = obj2->GetShort(); ! caster->eventPrint("%^BOLD%^%^WHITE%^" ! "You determine that " + better + "%^BOLD%^%^WHITE%^" ! " is the more valuable object.%^RESET%^"); ! caster->AddSkillPoints("bargaining",random(50)); ! return 1; } diff -c -r --new-file ds1.1/lib/verbs/items/judge1.c ds2.0r27/lib/verbs/items/judge1.c *** ds1.1/lib/verbs/items/judge1.c Sun Feb 1 21:30:55 1998 --- ds2.0r27/lib/verbs/items/judge1.c Wed Jul 5 00:01:06 2006 *************** *** 14,132 **** verb::create(); SetVerb("judge"); SetSynonyms("equate"); ! SetRules("OBJ to OBJ"); SetErrorMessage("What two things would you like to equate?"); SetHelp("Syntax: equate OBJ to OBJ\n\n" ! "A bargaining ability which allows people to compare the " ! "relative worth of two items. The more experienced you are " ! "at bartering, the better chance you have of correctly judging " ! "the more valuable item.\n\n" ! "See help: item commands"); } mixed can_judge_obj_to_obj() { ! if( this_player()->GetLevel() < 6 ) { ! this_player()->eventPrint("You are not experienced enough to judge " ! "the value of items accurately."); ! return 0; } ! return this_player()->CanCastMagic(1, "judge"); } mixed do_judge_obj_to_obj(object obj1, object obj2) { ! int level; ! string name1, name2; ! object caster = this_player(); ! if( !((int)caster->GetSkillLevel("bargaining")) ) { ! return "You do not have the skills to judge items."; } ! if (!obj1 || !obj2) return "You must judge one thing vs another."; ! if (obj1 == obj2) return "That would do a lot of good!"; ! ! /* Check for presence of objects */ ! name1 = obj1->GetShort(); ! name2 = obj2->GetShort(); ! ! if( environment(obj1) != caster ) { ! caster->eventPrint("You do not have "+name1+"."); ! return 1; ! } ! ! if( environment(obj2) != caster ) { ! caster->eventPrint("You do not have "+name2+"."); ! return 1; ! } ! ! level = caster->GetSkillLevel("bargaining"); ! caster->eventPrint("You stare intently at "+name1+" and "+name2+"."); ! environment(caster)->eventPrint( (string)caster->GetName() + ! " concentrates on " + name1 + " and " + name2 + ".", caster); ! if( (int)this_player()->GetInCombat() ) ! this_player()->SetAttack(0, ! (: eventJudge, this_player(), obj1, obj2, level :), ! ROUND_OTHER); ! else eventJudge(this_player(), obj1, obj2, level); ! return 1; } int eventJudge(object caster, object obj1, object obj2, int level) { ! int obj1lvl, obj2lvl; ! string better; ! int cost = random(50) + 50; ! if( !(obj1 && obj2) ) return 0; ! if( (environment(obj1) != caster) || (environment(obj2) != caster) ) { ! caster->eventPrint("You must have both items in your possesion " ! "to compare them."); ! return 0; } if( cost > (int)caster->GetStaminaPoints() ) { ! caster->eventPrint("You are too weary to judge right now."); ! environment(caster)->eventPrint( ! (string)caster->GetName() + " looks tired.", caster); ! return 0; ! ! } ! caster->AddStaminaPoints(-cost); ! obj1lvl = (int)obj1->GetValue(); ! obj2lvl = (int)obj2->GetValue(); ! ! if( level < (5 + random(35))) { ! ! if(random(7)) { ! if(random(5) < 2) { ! better = obj2->GetShort(); ! } ! else better = obj1->GetShort(); ! caster->eventPrint("%^BOLD%^%^WHITE%^" ! "You determine that " + better + "%^BOLD%^%^WHITE%^" ! " is the more valuable object.%^RESET%^"); ! return 0; ! } else caster->eventPrint("%^BOLD%^%^WHITE%^" "You determine that these two items are equally valuable." ".%^RESET%^"); - caster->AddSkillPoints("bargaining",random(25)); return 1; ! } ! /* Return the right answer */ ! if(obj1lvl == obj2lvl) { ! caster->eventPrint("%^BOLD%^%^WHITE%^" ! "You determine that these two items are equally valuable." ! ".%^RESET%^"); ! return 1; ! } ! if(obj1lvl > obj2lvl) { ! better = obj1->GetShort(); ! } ! else better = obj2->GetShort(); ! caster->eventPrint("%^BOLD%^%^WHITE%^" ! "You determine that " + better + "%^BOLD%^%^WHITE%^" ! " is the more valuable object.%^RESET%^"); ! caster->AddSkillPoints("bargaining",random(50)); ! return 1; } --- 14,132 ---- verb::create(); SetVerb("judge"); SetSynonyms("equate"); ! SetRules("OBJ to OBJ"); SetErrorMessage("What two things would you like to equate?"); SetHelp("Syntax: equate OBJ to OBJ\n\n" ! "A bargaining ability which allows people to compare the " ! "relative worth of two items. The more experienced you are " ! "at bartering, the better chance you have of correctly judging " ! "the more valuable item.\n\n" ! "See help: item commands"); } mixed can_judge_obj_to_obj() { ! if( this_player()->GetLevel() < 6 ) { ! this_player()->eventPrint("You are not experienced enough to judge " ! "the value of items accurately."); ! return 0; } ! return this_player()->CanCastMagic(1, "judge"); } mixed do_judge_obj_to_obj(object obj1, object obj2) { ! int level; ! string name1, name2; ! object caster = this_player(); ! if( !((int)caster->GetSkillLevel("bargaining")) ) { ! return "You do not have the skills to judge items."; } ! if (!obj1 || !obj2) return "You must judge one thing vs another."; ! if (obj1 == obj2) return "That would do a lot of good!"; ! ! /* Check for presence of objects */ ! name1 = obj1->GetShort(); ! name2 = obj2->GetShort(); ! ! if( environment(obj1) != caster ) { ! caster->eventPrint("You do not have "+name1+"."); ! return 1; ! } ! ! if( environment(obj2) != caster ) { ! caster->eventPrint("You do not have "+name2+"."); ! return 1; ! } ! ! level = caster->GetSkillLevel("bargaining"); ! caster->eventPrint("You stare intently at "+name1+" and "+name2+"."); ! environment(caster)->eventPrint( (string)caster->GetName() + ! " concentrates on " + name1 + " and " + name2 + ".", caster); ! if( (int)this_player()->GetInCombat() ) ! this_player()->SetAttack(0, ! (: eventJudge, this_player(), obj1, obj2, level :), ! ROUND_OTHER); ! else eventJudge(this_player(), obj1, obj2, level); ! return 1; } int eventJudge(object caster, object obj1, object obj2, int level) { ! int obj1lvl, obj2lvl; ! string better; ! int cost = random(50) + 50; ! if( !(obj1 && obj2) ) return 0; ! if( (environment(obj1) != caster) || (environment(obj2) != caster) ) { ! caster->eventPrint("You must have both items in your possesion " ! "to compare them."); ! return 0; } if( cost > (int)caster->GetStaminaPoints() ) { ! caster->eventPrint("You are too weary to judge right now."); ! environment(caster)->eventPrint( ! (string)caster->GetName() + " looks tired.", caster); ! return 0; ! ! } ! caster->AddStaminaPoints(-cost); ! obj1lvl = (int)obj1->GetValue(); ! obj2lvl = (int)obj2->GetValue(); ! ! if( level < (5 + random(35))) { ! ! if(random(7)) { ! if(random(5) < 2) { ! better = obj2->GetShort(); ! } ! else better = obj1->GetShort(); ! caster->eventPrint("%^BOLD%^%^WHITE%^" ! "You determine that " + better + "%^BOLD%^%^WHITE%^" ! " is the more valuable object.%^RESET%^"); ! return 0; ! } else caster->eventPrint("%^BOLD%^%^WHITE%^" + "You determine that these two items are equally valuable." + ".%^RESET%^"); + caster->AddSkillPoints("bargaining",random(25)); + return 1; + } + /* Return the right answer */ + if(obj1lvl == obj2lvl) { + caster->eventPrint("%^BOLD%^%^WHITE%^" "You determine that these two items are equally valuable." ".%^RESET%^"); return 1; ! } ! if(obj1lvl > obj2lvl) { ! better = obj1->GetShort(); ! } ! else better = obj2->GetShort(); ! caster->eventPrint("%^BOLD%^%^WHITE%^" ! "You determine that " + better + "%^BOLD%^%^WHITE%^" ! " is the more valuable object.%^RESET%^"); ! caster->AddSkillPoints("bargaining",random(50)); ! return 1; } diff -c -r --new-file ds1.1/lib/verbs/items/light.c ds2.0r27/lib/verbs/items/light.c *** ds1.1/lib/verbs/items/light.c Sun Feb 1 21:30:56 1998 --- ds2.0r27/lib/verbs/items/light.c Wed Jul 5 00:01:06 2006 *************** *** 15,47 **** SetRules("OBS", "OBS with OBJ"); SetErrorMessage("Light what? Or light what with what?"); SetHelp("Syntax: <light OBJECT>\n" ! " <light OBJECT with OBJECT>\n\n" ! "Using the first syntax, you can light things which " ! "do not need another source in order to be lit, like a lamp or " ! "a lighter. The second syntax allows you to light objects which " ! "require burning sources in order for themselves to be light, " ! "like a torch or a camp fire.\n\n" ! "See also: extinguish"); } mixed can_light_obj() { ! return 1; } mixed can_light_obj_with_obj() { ! int light; ! ! if( (light = effective_light(this_player())) < 0 ) { ! if( 100 + (10*light) < random(100) ) ! return "You fumble around in the darkness."; ! else return 1; ! } ! else if( light > 4 ) { ! if( 100 - (10*light) < random(100) ) ! return "You fumble around in the blinding light."; ! else return 1; ! } ! else return 1; } mixed do_light_obj(object target) { --- 15,37 ---- SetRules("OBS", "OBS with OBJ"); SetErrorMessage("Light what? Or light what with what?"); SetHelp("Syntax: <light OBJECT>\n" ! " <light OBJECT with OBJECT>\n\n" ! "Using the first syntax, you can light things which " ! "do not need another source in order to be lit, like a lamp or " ! "a lighter. The second syntax allows you to light objects which " ! "require burning sources in order for themselves to be light, " ! "like a torch or a camp fire.\n\n" ! "See also: extinguish"); } mixed can_light_obj() { ! if(intp(check_light())) return this_player()->CanManipulate(); ! else return check_light(); } mixed can_light_obj_with_obj() { ! if(intp(check_light())) return this_player()->CanManipulate(); ! else return check_light(); } mixed do_light_obj(object target) { *************** *** 55,68 **** mixed do_light_obs(mixed *targs) { object *obs; string tmp; ! if( !sizeof(targs) ) { ! this_player()->eventPrint("There is no such thing to be lit."); return 1; } obs = filter(targs, (: objectp :)); if( !sizeof(obs) ) { ! mixed *ua; ua = unique_array(targs, (: $1 :)); foreach(string *list in ua) this_player()->eventPrint(list[0]); --- 45,58 ---- mixed do_light_obs(mixed *targs) { object *obs; string tmp; ! if( !sizeof(targs) ) { ! this_player()->eventPrint("There is no such thing to be lit."); return 1; } obs = filter(targs, (: objectp :)); if( !sizeof(obs) ) { ! mixed *ua; ua = unique_array(targs, (: $1 :)); foreach(string *list in ua) this_player()->eventPrint(list[0]); *************** *** 73,94 **** tmp = item_list(obs); this_player()->eventPrint("You light " + tmp + "."); environment(this_player())->eventPrint((string)this_player()->GetName() + ! " lights " + tmp + ".", ! this_player()); return 1; } mixed do_light_obs_with_obj(mixed *targs, object source) { object *obs; string tmp; ! if( !sizeof(targs) ) { ! this_player()->eventPrint("There is no such thing to be lit."); return 1; } obs = filter(targs, (: objectp :)); if( !sizeof(obs) ) { ! mixed *ua; ua = unique_array(targs, (: $1 :)); foreach(string *list in ua) this_player()->eventPrint(list[0]); --- 63,84 ---- tmp = item_list(obs); this_player()->eventPrint("You light " + tmp + "."); environment(this_player())->eventPrint((string)this_player()->GetName() + ! " lights " + tmp + ".", ! this_player()); return 1; } mixed do_light_obs_with_obj(mixed *targs, object source) { object *obs; string tmp; ! if( !sizeof(targs) ) { ! this_player()->eventPrint("There is no such thing to be lit."); return 1; } obs = filter(targs, (: objectp :)); if( !sizeof(obs) ) { ! mixed *ua; ua = unique_array(targs, (: $1 :)); foreach(string *list in ua) this_player()->eventPrint(list[0]); *************** *** 98,107 **** if( !sizeof(obs) ) return 1; tmp = item_list(obs); this_player()->eventPrint("You light " + tmp + " with " + ! (string)source->GetShort() + "."); environment(this_player())->eventPrint((string)this_player()->GetName() + ! " lights " + tmp + " with " + ! (string)source->GetShort() + ".", ! this_player()); return 1; } --- 88,97 ---- if( !sizeof(obs) ) return 1; tmp = item_list(obs); this_player()->eventPrint("You light " + tmp + " with " + ! (string)source->GetShort() + "."); environment(this_player())->eventPrint((string)this_player()->GetName() + ! " lights " + tmp + " with " + ! (string)source->GetShort() + ".", ! this_player()); return 1; } diff -c -r --new-file ds1.1/lib/verbs/items/listen.c ds2.0r27/lib/verbs/items/listen.c *** ds1.1/lib/verbs/items/listen.c Sun Feb 1 21:30:54 1998 --- ds2.0r27/lib/verbs/items/listen.c Wed Jul 5 00:01:06 2006 *************** *** 1,31 **** /* /verbs/items/listen.c ! * from the Dead Souls V Object Library * created by Descartes of Borg 961014 * Version: @(#) listen.c 1.1@(#) * Last modified: 96/10/14 */ ! #include <lib.h> #include <daemons.h> #include <function.h> ! inherit LIB_VERB; ! static void create() { verb::create(); SetVerb("listen"); SetRules("", "OBJ", "to OBJ", "to STR on OBJ", "to STR of OBJ"); SetErrorMessage("Listen to something?"); SetHelp("Syntax: <listen>\n" ! " <listen to ITEM>\n\n" ! "Without any arguments, this command allowed you to listen " ! "to your general surroundings. You may, however, concentrate " ! "your listening on any target. If it is making noise and you " ! "can hear well, then you will hear any relevant noise it is " ! "making.\n\n" ! "See also: look, search, smell, touch"); } ! mixed can_listen() { if( !environment(this_player()) ) { return "You are nowhere."; --- 1,31 ---- /* /verbs/items/listen.c ! * from the Dead Souls Object Library * created by Descartes of Borg 961014 * Version: @(#) listen.c 1.1@(#) * Last modified: 96/10/14 */ ! #include <lib.h> #include <daemons.h> #include <function.h> ! inherit LIB_VERB; ! static void create() { verb::create(); SetVerb("listen"); SetRules("", "OBJ", "to OBJ", "to STR on OBJ", "to STR of OBJ"); SetErrorMessage("Listen to something?"); SetHelp("Syntax: <listen>\n" ! " <listen to ITEM>\n\n" ! "Without any arguments, this command allowed you to listen " ! "to your general surroundings. You may, however, concentrate " ! "your listening on any target. If it is making noise and you " ! "can hear well, then you will hear any relevant noise it is " ! "making.\n\n" ! "See also: look, search, smell, touch"); } ! mixed can_listen() { if( !environment(this_player()) ) { return "You are nowhere."; *************** *** 60,67 **** val = "You don't hear a thing."; } environment(this_player())->eventPrint(this_player()->GetName() + ! " puts an ear to the air.", ! this_player()); this_player()->eventPrint(val); return 1; } --- 60,67 ---- val = "You don't hear a thing."; } environment(this_player())->eventPrint(this_player()->GetName() + ! " puts an ear to the air.", ! this_player()); this_player()->eventPrint(val); return 1; } *************** *** 73,79 **** mixed do_listen_to_obj(object ob) { return do_listen_obj(ob); } ! mixed do_listen_to_str_word_obj(string str, object ob) { return ob->eventListen(this_player(), str); } --- 73,79 ---- mixed do_listen_to_obj(object ob) { return do_listen_obj(ob); } ! mixed do_listen_to_str_word_obj(string str, object ob) { return ob->eventListen(this_player(), str); } diff -c -r --new-file ds1.1/lib/verbs/items/lock.c ds2.0r27/lib/verbs/items/lock.c *** ds1.1/lib/verbs/items/lock.c Sun Feb 1 21:30:54 1998 --- ds2.0r27/lib/verbs/items/lock.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/items/lock.c ! * from the Dead Soulsr2 Object Library * lock OBJ with OBJ * created by Descartes of Borg 951028 * Version: @(#) lock.c 1.2@(#) --- 1,5 ---- /* /verbs/items/lock.c ! * from the Dead Souls Object Library * lock OBJ with OBJ * created by Descartes of Borg 951028 * Version: @(#) lock.c 1.2@(#) *************** *** 17,39 **** SetRules("OBJ with OBJ"); SetErrorMessage("Lock what with what?"); SetHelp("Syntax: <lock OBJ with OBJ>\n\n" ! "The first object is something you wish to lock, like a " ! "door or a chest. The second is the key you wish to use to " ! "lock it with. If your key is the right key, then " ! "lock allows you to lock it.\n\n" ! "See also: close, open, pick, unlock"); } mixed can_lock_obj_with_obj(string verb) { if( this_player()->GetParalyzed() ) { return "You cannot do anything."; } ! return 1; } varargs mixed do_lock_obj_with_obj(object target, object key, mixed *words...) { string id; - id = remove_article(lower_case(words[0])); return (mixed)target->eventLock(this_player(), id, key); } --- 17,38 ---- SetRules("OBJ with OBJ"); SetErrorMessage("Lock what with what?"); SetHelp("Syntax: <lock OBJ with OBJ>\n\n" ! "The first object is something you wish to lock, like a " ! "door or a chest. The second is the key you wish to use to " ! "lock it with. If your key is the right key, then " ! "lock allows you to lock it.\n\n" ! "See also: close, open, pick, unlock"); } mixed can_lock_obj_with_obj(string verb) { if( this_player()->GetParalyzed() ) { return "You cannot do anything."; } ! return this_player()->CanManipulate(); } varargs mixed do_lock_obj_with_obj(object target, object key, mixed *words...) { string id; id = remove_article(lower_case(words[0])); return (mixed)target->eventLock(this_player(), id, key); } diff -c -r --new-file ds1.1/lib/verbs/items/look.c ds2.0r27/lib/verbs/items/look.c *** ds1.1/lib/verbs/items/look.c Sun Feb 1 21:30:53 1998 --- ds2.0r27/lib/verbs/items/look.c Wed Jul 5 00:01:06 2006 *************** *** 1,45 **** /* /verbs/items/look.c ! * from the Dead Souls V Object Library * look STR * look at ITEM * created by Descartes of Borg 951218 * Version: @(#) look.c 1.6@(#) * Last modified: 96/11/14 */ ! #include <lib.h> #include <daemons.h> #include "include/look.h" ! inherit LIB_VERB; ! static void create() { verb::create(); SetVerb("look"); SetRules("", "STR", "OBJ", "at STR", "at OBJ", "in OBJ", "inside OBJ", ! "at OBJ:v in OBJ", "at OBJ:v inside OBJ", "at STR on OBJ"); SetErrorMessage("Look at or in something?"); SetHelp("Syntax: <look>\n" ! " <look at ITEM>\n" ! " <look in CONTAINER>\n" ! " <look at ITEM in CONTAINER>\n" ! " <look at ITEM on ITEM>\n\n" ! "Without any arguments, this command allows you to see a " ! "description of the area about you, including what other " ! "things are there with you.\n\n" ! "If you look at something, then you get a detailed description " ! "of the thing at which you are looking. You should be able to " ! "look at any thing you see mentioned in the room when you use the " ! "look command without arguments. Anything you cannot look at is " ! "considered a bug.\n\n" ! "See also: peer"); } ! mixed can_look() { if( !environment(this_player()) ) return "You are nowhere."; ! if( effective_light(this_player()) < -1 ) ! return "It is way too dark for you to see."; ! else return 1; } mixed can_look_str(string str, string verb) { --- 1,43 ---- /* /verbs/items/look.c ! * from the Dead Souls Object Library * look STR * look at ITEM * created by Descartes of Borg 951218 * Version: @(#) look.c 1.6@(#) * Last modified: 96/11/14 */ ! #include <lib.h> #include <daemons.h> #include "include/look.h" ! inherit LIB_VERB; ! static void create() { verb::create(); SetVerb("look"); SetRules("", "STR", "OBJ", "at STR", "at OBJ", "in OBJ", "inside OBJ", ! "at OBJ:v in OBJ", "at OBJ:v inside OBJ", "at STR on OBJ"); SetErrorMessage("Look at or in something?"); SetHelp("Syntax: <look>\n" ! " <look at ITEM>\n" ! " <look in CONTAINER>\n" ! " <look at ITEM in CONTAINER>\n" ! " <look at ITEM on ITEM>\n\n" ! "Without any arguments, this command allows you to see a " ! "description of the area about you, including what other " ! "things are there with you.\n\n" ! "If you look at something, then you get a detailed description " ! "of the thing at which you are looking. You should be able to " ! "look at any thing you see mentioned in the room when you use the " ! "look command without arguments. Anything you cannot look at is " ! "considered a bug.\n\n" ! "See also: peer"); } ! mixed can_look() { if( !environment(this_player()) ) return "You are nowhere."; ! else return check_light(); } mixed can_look_str(string str, string verb) { *************** *** 51,68 **** } mixed can_look_at_str(string str, string verb) { ! if( !environment(this_player()) ) return "You are nowhere."; ! if( SEASONS_D->GetLong(str) == 0 ) { ! return "There is no " + remove_article(str) + " here."; ! } ! else { ! return 1; ! } } mixed can_look_at_obj(string verb, string id) { ! if( effective_light(this_player()) < -1 ) ! return "It is way too dark for you to see anything."; ! return 1; } mixed can_look_in_obj(string verb, string id) { --- 49,65 ---- } mixed can_look_at_str(string str, string verb) { ! ! if( !environment(this_player()) ) return "You are nowhere."; ! if( SEASONS_D->GetLong(str) == 0 ) { ! return "There is no " + remove_article(str) + " here."; ! } ! else { ! return check_light(); ! } } mixed can_look_at_obj(string verb, string id) { ! return check_light(); } mixed can_look_in_obj(string verb, string id) { *************** *** 70,95 **** } mixed can_look_inside_obj(string verb, string id) { ! if( effective_light(this_player()) < -1 ) ! return "It is way too dark for you to see here."; ! return 1; } mixed can_look_at_obj_word_obj(string verb, string targ, string store) { ! if( effective_light(this_player()) < -1 ) ! return "It is way too dark for you to see here."; ! return 1; } mixed can_look_at_str_on_obj(string targ, string verb, string id1, string id2){ ! if( effective_light(this_player()) < -1 ) ! return "It is way too dark for you to see here."; ! return 1; } mixed do_look() { ! environment(this_player())->eventPrint((string)this_player()->GetName() + ! " looks around.", this_player()); this_player()->eventDescribeEnvironment(0); return 1; } --- 67,87 ---- } mixed can_look_inside_obj(string verb, string id) { ! return can_look(); } mixed can_look_at_obj_word_obj(string verb, string targ, string store) { ! return can_look(); } mixed can_look_at_str_on_obj(string targ, string verb, string id1, string id2){ ! return can_look(); } mixed do_look() { ! if(!this_player()->GetInvis()) ! environment(this_player())->eventPrint((string)this_player()->GetName() + ! " looks around.", this_player()); this_player()->eventDescribeEnvironment(0); return 1; } *************** *** 102,114 **** return do_look_at_str(str); } ! varargs mixed do_look_at_obj(object ob) { return ob->eventShow(this_player()); } ! mixed do_look_at_str(string str) { return (mixed)SEASONS_D->eventShow(this_player(), ! remove_article(lower_case(str))); } mixed do_look_in_obj(object ob) { return do_look_inside_obj(ob); } --- 94,111 ---- return do_look_at_str(str); } ! varargs mixed do_look_at_obj(object ob, mixed arg) { ! if(ob->GetInvis() && !archp(this_player()) && ! base_name(ob) != LIB_DUMMY ){ ! write("There is no "+arg+" here."); ! return 1; ! } return ob->eventShow(this_player()); } ! mixed do_look_at_str(string str) { return (mixed)SEASONS_D->eventShow(this_player(), ! remove_article(lower_case(str))); } mixed do_look_in_obj(object ob) { return do_look_inside_obj(ob); } diff -c -r --new-file ds1.1/lib/verbs/items/move.c ds2.0r27/lib/verbs/items/move.c *** ds1.1/lib/verbs/items/move.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/verbs/items/move.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,33 ---- + #include <lib.h> + + inherit LIB_VERB; + + static void create() { + verb::create(); + SetVerb("move"); + SetRules("OBJ", "STR on OBJ"); + SetSynonyms("shove"); + SetErrorMessage("Move what? Or move what on what?"); + SetHelp("Syntax: <move OBJECT>\n" + " <move THING on OBJECT>\n\n" + "Allows you to move an object, or perhaps a thing on the " + "object. For example, you might want to " + "\"move the painting on the wall\", or simply \"move carpet\".\n\n" + "Synonyms: shove"); + } + + mixed can_move_obj() { + return 1; + } + + mixed can_move_str_on_obj() { + return 1; + } + + mixed do_move_obj(object target) { + return target->eventManipulate(this_player()); + } + + varargs mixed do_move_str_on_obj(string thing, object target) { + return target->eventManipulate(this_player(), remove_article(lower_case(thing))); + } diff -c -r --new-file ds1.1/lib/verbs/items/open.c ds2.0r27/lib/verbs/items/open.c *** ds1.1/lib/verbs/items/open.c Sun Feb 1 21:30:54 1998 --- ds2.0r27/lib/verbs/items/open.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/items/open.c ! * from the Dead Souls V Object Library * created by Descartes of Borg 960115 * Version: @(#) open.c 1.2@(#) * Last modified: 96/10/15 --- 1,5 ---- /* /verbs/items/open.c ! * from the Dead Souls Object Library * created by Descartes of Borg 960115 * Version: @(#) open.c 1.2@(#) * Last modified: 96/10/15 *************** *** 16,40 **** SetRules("OBJ", "OBJ with OBJ"); SetErrorMessage("Open what? Or open what with what?"); SetHelp("Syntax: <open OBJECT>\n" ! " <open OBJECT with ITEM>\n\n" ! "Opens a door or chest or some other such object. Some things " ! "may be opened by force using items capable of forcing things " ! "to open.\n\n" ! "See also: close, lock, pick, unlock"); } mixed can_open_obj(string verb, string id) { if( this_player()->GetParalyzed() ) { return "You cannot do anything."; } ! return 1; } mixed can_open_obj_with_obj(string verb, string id1, string id2) { if( this_player()->GetParalyzed() ) { return "You cannot do anything."; } ! return 1; } varargs mixed do_open_obj(object ob, mixed *args...) { --- 16,40 ---- SetRules("OBJ", "OBJ with OBJ"); SetErrorMessage("Open what? Or open what with what?"); SetHelp("Syntax: <open OBJECT>\n" ! " <open OBJECT with ITEM>\n\n" ! "Opens a door or chest or some other such object. Some things " ! "may be opened by force using items capable of forcing things " ! "to open.\n\n" ! "See also: close, lock, pick, unlock"); } mixed can_open_obj(string verb, string id) { if( this_player()->GetParalyzed() ) { return "You cannot do anything."; } ! return this_player()->CanManipulate(); } mixed can_open_obj_with_obj(string verb, string id1, string id2) { if( this_player()->GetParalyzed() ) { return "You cannot do anything."; } ! return this_player()->CanManipulate(); } varargs mixed do_open_obj(object ob, mixed *args...) { diff -c -r --new-file ds1.1/lib/verbs/items/pick.c ds2.0r27/lib/verbs/items/pick.c *** ds1.1/lib/verbs/items/pick.c Sun Feb 1 21:30:54 1998 --- ds2.0r27/lib/verbs/items/pick.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/items/pick.c ! * from the Dead Souls V Object Library * created by Descartes of Borg 951220 * Version: @(#) pick.c 1.4@(#) * Last modified: 96/10/15 --- 1,5 ---- /* /verbs/items/pick.c ! * from the Dead Souls Object Library * created by Descartes of Borg 951220 * Version: @(#) pick.c 1.4@(#) * Last modified: 96/10/15 *************** *** 16,40 **** SetVerb("pick"); SetRules("STR on OBJ", "STR on OBJ with OBJ", "OBJ"); SetErrorMessage("You might pick a flower or perhaps pick the lock on " ! "something?"); SetHelp("Syntax: <pick OBJECT>\n" ! " <pick lock on OBJECT>\n" ! " <pick lock on OBJECT with TOOL>\n\n" ! "Depending on what you are doing, this command captures two " ! "different senses of the verb \"pick\". In the first sense, " ! "<pick OBJECT>, pick allows you to pick things like flowers or " ! "strawberries (not your nose).\n\n" ! "The second conext allows you to open locked things without a key. " ! "Some tools can help you stealthfully pick a lock, while " ! "others may help you pick it through brute force.\n\n" ! "See also: close, lock, open, unlock"); } mixed can_pick_obj() { if( this_player()->GetParalyzed() ) { return "You cannot do anything."; } ! return 1; } mixed can_pick_str_on_obj(string str) { --- 16,40 ---- SetVerb("pick"); SetRules("STR on OBJ", "STR on OBJ with OBJ", "OBJ"); SetErrorMessage("You might pick a flower or perhaps pick the lock on " ! "something?"); SetHelp("Syntax: <pick OBJECT>\n" ! " <pick lock on OBJECT>\n" ! " <pick lock on OBJECT with TOOL>\n\n" ! "Depending on what you are doing, this command captures two " ! "different senses of the verb \"pick\". In the first sense, " ! "<pick OBJECT>, pick allows you to pick things like flowers or " ! "strawberries (not your nose).\n\n" ! "The second conext allows you to open locked things without a key. " ! "Some tools can help you stealthfully pick a lock, while " ! "others may help you pick it through brute force.\n\n" ! "See also: close, lock, open, unlock"); } mixed can_pick_obj() { if( this_player()->GetParalyzed() ) { return "You cannot do anything."; } ! return this_player()->CanManipulate(); } mixed can_pick_str_on_obj(string str) { *************** *** 44,50 **** if( (int)this_player()->GetStaminaPoints() < 20 ) { return "You are too tired."; } ! return 1; } mixed can_pick_str_on_obj_with_obj(string str) { --- 44,50 ---- if( (int)this_player()->GetStaminaPoints() < 20 ) { return "You are too tired."; } ! return this_player()->CanManipulate(); } mixed can_pick_str_on_obj_with_obj(string str) { *************** *** 54,60 **** if( (int)this_player()->GetStaminaPoints() < 30 ) { return "You are too tired."; } ! return 1; } mixed do_pick_obj(object ob, string id) { --- 54,60 ---- if( (int)this_player()->GetStaminaPoints() < 30 ) { return "You are too tired."; } ! return this_player()->CanManipulate(); } mixed do_pick_obj(object ob, string id) { *************** *** 65,83 **** wrd = remove_article(lower_case(args[1])); this_player()->eventPrint("You eye the lock for weaknesses."); if( (int)this_player()->GetInCombat() ) ! this_player()->SetAttack(0, (: $(ob)->eventPick(this_player(), $(wrd)):), ! ROUND_OTHER); else ob->eventPick(this_player(), wrd); return 1; } mixed do_pick_str_on_obj_with_obj(string wrd, object ob, object tool, ! mixed *args...) { wrd = remove_article(lower_case(args[1])); this_player()->eventPrint("You eye the lock for weaknesses."); if( (int)this_player()->GetInCombat() ) ! this_player()->SetAttack(0, (: $(ob)->eventPick(this_player(), $(wrd), ! $(tool)) :),ROUND_OTHER); else ob->eventPick(this_player(), wrd, tool); return 1; } --- 65,83 ---- wrd = remove_article(lower_case(args[1])); this_player()->eventPrint("You eye the lock for weaknesses."); if( (int)this_player()->GetInCombat() ) ! this_player()->SetAttack(0, (: $(ob)->eventPick(this_player(), $(wrd)):), ! ROUND_OTHER); else ob->eventPick(this_player(), wrd); return 1; } mixed do_pick_str_on_obj_with_obj(string wrd, object ob, object tool, ! mixed *args...) { wrd = remove_article(lower_case(args[1])); this_player()->eventPrint("You eye the lock for weaknesses."); if( (int)this_player()->GetInCombat() ) ! this_player()->SetAttack(0, (: $(ob)->eventPick(this_player(), $(wrd), ! $(tool)) :),ROUND_OTHER); else ob->eventPick(this_player(), wrd, tool); return 1; } diff -c -r --new-file ds1.1/lib/verbs/items/poison.c ds2.0r27/lib/verbs/items/poison.c *** ds1.1/lib/verbs/items/poison.c Sun Feb 1 21:30:55 1998 --- ds2.0r27/lib/verbs/items/poison.c Wed Jul 5 00:01:06 2006 *************** *** 5,11 **** * created by Blitz@Dead Souls 951020 * a check for poison uses put in by BillGates 961202 */ ! #pragma save_binary #include <lib.h> --- 5,11 ---- * created by Blitz@Dead Souls 951020 * a check for poison uses put in by BillGates 961202 */ ! #pragma save_binary #include <lib.h> *************** *** 13,37 **** #include "include/poison.h" inherit LIB_VERB; ! static void create() { verb::create(); SetVerb("poison"); SetRules("OBJ with OBJ"); SetErrorMessage("Poison what with what?"); SetHelp("Syntax: <poison ITEM with POISON>\n\n" ! "This command allows you to poison items, provided you " ! "have a poisoning agent, and something to poison. The " ! "ITEM is the item which you want to poison. The " ! "POISON is what you wish to use to poison it with."); } ! ! mixed can_poison_obj_with_obj(string verb) { return 1; } ! mixed do_poison_obj_with_obj(object target, object agent) { if( (int)this_player()->GetInCombat() ) ! this_player()->SetAttack(0, (: eventPoison, this_player(), target, ! agent :), ROUND_OTHER); else eventPoison(this_player(), target, agent); return 1; } --- 13,37 ---- #include "include/poison.h" inherit LIB_VERB; ! static void create() { verb::create(); SetVerb("poison"); SetRules("OBJ with OBJ"); SetErrorMessage("Poison what with what?"); SetHelp("Syntax: <poison ITEM with POISON>\n\n" ! "This command allows you to poison items, provided you " ! "have a poisoning agent, and something to poison. The " ! "ITEM is the item which you want to poison. The " ! "POISON is what you wish to use to poison it with."); } ! ! mixed can_poison_obj_with_obj(string verb) { return this_player()->CanManipulate(); } ! mixed do_poison_obj_with_obj(object target, object agent) { if( (int)this_player()->GetInCombat() ) ! this_player()->SetAttack(0, (: eventPoison, this_player(), target, ! agent :), ROUND_OTHER); else eventPoison(this_player(), target, agent); return 1; } *************** *** 39,50 **** void eventPoison(object who, object target, object agent) { if( !who ) return; if( environment(agent) != this_player() ) { ! who->eventPrint("You no longer have your poison."); return; } if( !(agent->GetPoisonUses()) ) { ! who->eventPrint("Your poison is all used up."); ! return; } agent->eventSpreadPoison(who, target); } --- 39,50 ---- void eventPoison(object who, object target, object agent) { if( !who ) return; if( environment(agent) != this_player() ) { ! who->eventPrint("You no longer have your poison."); return; } if( !(agent->GetPoisonUses()) ) { ! who->eventPrint("Your poison is all used up."); ! return; } agent->eventSpreadPoison(who, target); } diff -c -r --new-file ds1.1/lib/verbs/items/press.c ds2.0r27/lib/verbs/items/press.c *** ds1.1/lib/verbs/items/press.c Sun Feb 1 21:30:55 1998 --- ds2.0r27/lib/verbs/items/press.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/items/press.c ! * from the Dead Souls V Object Library * created by Descartes of Borg 960114 * Version: @(#) press.c 1.3@(#) * Last modified: 96/10/18 --- 1,5 ---- /* /verbs/items/press.c ! * from the Dead Souls Object Library * created by Descartes of Borg 960114 * Version: @(#) press.c 1.3@(#) * Last modified: 96/10/18 *************** *** 16,26 **** SetSynonyms("push", "poke", "prod"); SetErrorMessage("Press what? Or press what on what?"); SetHelp("Syntax: <press OBJECT>\n" ! " <press THING on OBJECT>\n\n" ! "Allows you to press an object, or perhaps a thing on the " ! "object. For example, you might want to " ! "\"press the button on the wall\", or simply \"press button\".\n\n" ! "Synonyms: poke, prod, push"); } mixed can_press_obj() { --- 16,26 ---- SetSynonyms("push", "poke", "prod"); SetErrorMessage("Press what? Or press what on what?"); SetHelp("Syntax: <press OBJECT>\n" ! " <press THING on OBJECT>\n\n" ! "Allows you to press an object, or perhaps a thing on the " ! "object. For example, you might want to " ! "\"press the button on the wall\", or simply \"press button\".\n\n" ! "Synonyms: poke, prod, push"); } mixed can_press_obj() { diff -c -r --new-file ds1.1/lib/verbs/items/pull.c ds2.0r27/lib/verbs/items/pull.c *** ds1.1/lib/verbs/items/pull.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/verbs/items/pull.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,33 ---- + #include <lib.h> + + inherit LIB_VERB; + + static void create() { + verb::create(); + SetVerb("pull"); + SetRules("OBJ", "STR on OBJ"); + SetSynonyms("yank", "haul", "drag"); + SetErrorMessage("Pull what? Or pull what on what?"); + SetHelp("Syntax: <pull OBJECT>\n" + " <pull THING on OBJECT>\n\n" + "Allows you to pull an object, or perhaps a thing on the " + "object. For example, you might want to " + "\"pull the lever on the wall\", or simply \"pull lever\".\n\n" + "Synonyms: haul, drag, yank"); + } + + mixed can_pull_obj() { + return this_player()->CanManipulate(); + } + + mixed can_pull_str_on_obj() { + return this_player()->CanManipulate(); + } + + mixed do_pull_obj(object target) { + return target->eventPull(this_player()); + } + + varargs mixed do_pull_str_on_obj(string thing, object target) { + return target->eventPull(this_player(), remove_article(lower_case(thing))); + } diff -c -r --new-file ds1.1/lib/verbs/items/put.c ds2.0r27/lib/verbs/items/put.c *** ds1.1/lib/verbs/items/put.c Sun Feb 1 21:30:55 1998 --- ds2.0r27/lib/verbs/items/put.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/items/put.c ! * from the Dead Souls V Object Library * put OBJ in OBJ * put OBJ into OBJ * created by Descartes of Borg 950114 --- 1,5 ---- /* /verbs/items/put.c ! * from the Dead Souls Object Library * put OBJ in OBJ * put OBJ into OBJ * created by Descartes of Borg 950114 *************** *** 11,64 **** #include "include/put.h" inherit LIB_VERB; static void create() { verb::create(); SetVerb("put"); SetSynonyms("place", "stick"); ! SetRules("OBS in OBJ", "OBS into OBJ"); ! SetErrorMessage("Put what into what?"); ! SetHelp("Syntax: <put ITEM into CONTAINER>\n\n" ! "Allows you to stick objects into other objects.\n\n" ! "Synonyms: place, stick\n\n" ! "See also: get, give, drop"); } mixed can_put_obj_word_obj(object target, string wrd, object storage) { ! return eventCheckLight(this_player()); } mixed do_put_obj_word_obj(object what, string wrd, object storage) { ! return (mixed)storage->eventPutInto(this_player(), what); } mixed do_put_obs_word_obj(mixed *res, string wrd, object storage) { object *obs; obs = filter(res, (: objectp :)); if( !sizeof(obs) ) { ! mixed *ua; ua = unique_array(res, (: $1 :)); ! foreach(string *lines in ua) this_player()->eventPrint(lines[0]); return 1; } ! foreach(object ob in obs) storage->eventPutInto(this_player(), ob); return 1; } ! mixed eventCheckLight(object who) { ! int light; ! ! if( (light = effective_light(who)) < 0 ) { ! if( 100 + (10*light) < random(100) ) ! return "You fumble around in the darkness."; ! else return 1; ! } ! else if( light > 4 ) { ! if( 100 - (10*light) < random(100) ) ! return "You fumble around in the blinding light."; ! else return 1; } ! else return 1; } --- 11,176 ---- #include "include/put.h" inherit LIB_VERB; + string *eligible; static void create() { verb::create(); SetVerb("put"); SetSynonyms("place", "stick"); ! SetRules("OBS in OBJ", "OBS into OBJ", "OBS on OBJ", "OBS onto OBJ", ! "WRD WRD in OBJ", "WRD WRD into OBJ", "WRD WRD on OBJ", "WRD WRD onto OBJ"); ! SetErrorMessage("Put what where?"); ! SetHelp("Syntax: <put ITEM into CONTAINER>\n" ! "Syntax: <put ITEM onto SURFACE>\n\n" ! "Allows you to stick objects into other objects.\n\n" ! "Synonyms: place, stick\n\n" ! "See also: get, give, drop"); ! } ! ! ! mixed can_put_obs_word_obj(object *foo1, string wrd, object foo2) { ! //tc("1"); ! //tc("foo1: "+identify(foo1)); ! //tc("foo2: "+identify(foo2)); ! if(check_light()) return this_player()->CanManipulate(); ! else return 0; } mixed can_put_obj_word_obj(object target, string wrd, object storage) { ! object *target_arr; ! if(target) target_arr = ({ target }); ! return can_put_obs_word_obj(target_arr, wrd, storage); } mixed do_put_obj_word_obj(object what, string wrd, object storage) { ! ! if(wrd == "in" || wrd == "into") return (mixed)storage->eventPutInto(this_player(), what); ! if(wrd == "on" || wrd == "onto") return (mixed)storage->eventPutOnto(this_player(), what); } mixed do_put_obs_word_obj(mixed *res, string wrd, object storage) { object *obs; + + //tc("2"); obs = filter(res, (: objectp :)); + + //tc("a"); if( !sizeof(obs) ) { ! mixed *ua; ua = unique_array(res, (: $1 :)); ! //tc("b"); ! foreach(string *lines in ua) { ! if(storage && storage->GetClosed()) ! write(capitalize(storage->GetShort())+" is closed."); ! else write("That doesn't seem possible at the moment."); ! return 1; ! } ! //tc("c"); ! if(storage && storage->GetClosed()) ! write(capitalize(storage->GetShort())+" is closed."); ! else write("That doesn't seem possible at the moment."); ! return 1; ! } ! //tc("d"); ! if(!sizeof(filter(obs, (: environment($1) == this_player() :)))){ ! write("You don't seem to be in possession of that."); ! eligible = ({}); ! //tc("1"); return 1; } ! eligible=filter(obs, (: (!($1->GetWorn()) && environment($1) == this_player()) :)); ! if(!sizeof(eligible)){ ! write("Remove or unwield items before trying to put them somewhere."); ! eligible = ({}); ! //tc("2"); ! return 1; ! } ! //tc("eligible: "+identify(eligible)); ! if(wrd == "in" || wrd == "into") { ! foreach(object ob in eligible) ! storage->eventPutInto(this_player(), ob); ! } ! if(wrd == "on" || wrd == "onto") { ! foreach(object ob in eligible) ! storage->eventPutOnto(this_player(), ob); ! } ! eligible = ({}); return 1; } ! mixed can_put_wrd_wrd_word_obj(string num, string curr,string wrd, mixed container) { ! int amt; ! ! //tc("num: "+num); ! //tc("curr: "+curr); ! //tc("wrd: "+wrd); ! //tc("container: "+identify(container)); ! if( !num || !curr ) return 0; ! if( (amt = to_int(num)) < 1 ) return "You cannot do that!"; ! //tc("1","blue"); ! if( (int)this_player()->GetCurrency(curr) < amt ) ! return "You don't have that much " + curr + "."; ! //tc("2","green"); ! if(this_player()->GetLevel() < 4) { ! write("Newbies cannot drop money."); ! return "Newbies can't drop money."; ! } ! if(wrd == "on" || wrd == "onto"){ ! if(container && !inherits( LIB_SURFACE, container ) ) return "#That isn't a load-bearing surface."; ! } ! //tc("3","red"); ! if(container && container->GetClosed()){ ! return "#That's closed."; } ! //tc("hmm"); ! //return this_player()->CanManipulate(); ! if(intp(check_light())) return this_player()->CanManipulate(); ! else return check_light(); ! } ! ! ! mixed do_put_wrd_wrd_word_obj(string num, string curr, mixed wort, object ob) { ! object pile, env; ! int amt; ! //tc("ob: "+identify(ob),"yellow"); ! //tc("wort: "+wort,"yellow"); ! if(wort == "on") wort = "onto"; ! if(wort == "in") wort = "into"; ! //tc("wort: "+wort,"yellow"); ! ! if(wort == "onto" && !inherits( LIB_SURFACE, ob ) ) { ! //tc("wtf1"); ! write("That isn't a load-bearing surface."); ! return 1; ! } ! if(wort == "into" && inherits( LIB_SURFACE, ob ) ) { ! //tc("wtf2"); ! write("That's a surface. Try \"put on\""); ! return 1; ! } ! ! ! amt = to_int(num); ! env = environment(this_player()); ! pile = new(LIB_PILE); ! pile->SetPile(curr, amt); ! if( !((int)pile->eventMove(ob)) || ! (int)this_player()->AddCurrency(curr, -amt) == -1 ) { ! this_player()->eventPrint("Something prevents your action."); ! pile->eventDestruct(); ! return 1; ! } ! this_player()->eventPrint("You put " + amt + " " + curr + ! " "+wort+" "+ob->GetShort()+"."); ! ! environment(this_player())->eventPrint((string)this_player()->GetName() + ! " puts some " + curr + " "+wort+" "+ob->GetShort()+".", ! this_player()); ! return 1; ! } ! ! mixed eventCheckLight(object who) { ! return check_light(who); } diff -c -r --new-file ds1.1/lib/verbs/items/read.c ds2.0r27/lib/verbs/items/read.c *** ds1.1/lib/verbs/items/read.c Sun Feb 1 21:30:54 1998 --- ds2.0r27/lib/verbs/items/read.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/items/read.c ! * from the Dead Souls V Object Library * created by Descartes of Borg 960121 * Version: @(#) read.c 1.2@(#) * Last modified: 96/10/15 --- 1,5 ---- /* /verbs/items/read.c ! * from the Dead Souls Object Library * created by Descartes of Borg 960121 * Version: @(#) read.c 1.2@(#) * Last modified: 96/10/15 *************** *** 8,42 **** #include <lib.h> #include <daemons.h> #include <function.h> ! inherit LIB_VERB; ! static void create() { verb::create(); SetVerb("read"); ! SetRules("OBJ", "STR on OBJ", "STR from OBJ", "STR of OBJ"); SetErrorMessage("Read something?"); SetHelp("Syntax: <read ITEM>\n" ! " <read ITEM on OBJECT>\n" ! " <read ITEM from OBJECT>\n\n" ! "Allows you to read an object with text on it if you have " ! "the proper intelligence.\n\n" ! "See also: listen, look, search, smell, touch"); } ! mixed can_read_obj() { ! return 1; } mixed can_read_str_word_obj() { ! return 1; } mixed do_read_obj(object ob) { return ob->eventRead(this_player()); } ! mixed do_read_str_word_obj(string str, object ob) { ! return ob->eventRead(this_player(), str); } --- 8,55 ---- #include <lib.h> #include <daemons.h> #include <function.h> ! inherit LIB_VERB; ! static void create() { verb::create(); SetVerb("read"); ! SetRules("OBJ", "STR in OBJ","STR on OBJ", "STR from OBJ", "STR of OBJ"); SetErrorMessage("Read something?"); SetHelp("Syntax: <read ITEM>\n" ! " <read ITEM on OBJECT>\n" ! " <read ITEM from OBJECT>\n\n" ! "Allows you to read an object with text on it if you have " ! "the proper intelligence.\n\n" ! "See also: listen, look, search, smell, touch"); } ! mixed can_read_obj() { ! return check_light(); } mixed can_read_str_word_obj() { ! return check_light(); } mixed do_read_obj(object ob) { return ob->eventRead(this_player()); } ! mixed do_read_str_on_obj(string str, object ob) { ! if(ob) return (mixed)ob->eventRead(this_player(), str); ! } ! ! mixed do_read_str_in_obj(string str, object ob) { ! if(ob) return (mixed)ob->eventRead(this_player(), str); ! } ! ! mixed do_read_str_of_obj(string str, object ob) { ! return do_read_str_in_obj(str, ob); ! } ! ! //This function courtesy of Manchi ! mixed do_read_str_from_obj(string str, object ob) { ! return do_read_str_in_obj(str, ob); } diff -c -r --new-file ds1.1/lib/verbs/items/remove.c ds2.0r27/lib/verbs/items/remove.c *** ds1.1/lib/verbs/items/remove.c Sun Feb 1 21:30:56 1998 --- ds2.0r27/lib/verbs/items/remove.c Wed Jul 5 00:01:06 2006 *************** *** 1,6 **** /* /verbs/items/remove.c ! * From the Dead Souls V Object Library ! * Allows players to remove armour * Created by Descartes of Borg 960207 * Version: @(#) remove.c 1.2@(#) * Last modified: 97/01/01 --- 1,6 ---- /* /verbs/items/remove.c ! * From the Dead Souls Object Library ! * Allows players to remove armor * Created by Descartes of Borg 960207 * Version: @(#) remove.c 1.2@(#) * Last modified: 97/01/01 *************** *** 15,51 **** SetVerb("remove"); SetRules("OBS", "OBS from OBJ", "OBS out of OBJ"); SetErrorMessage("Remove what?"); ! SetHelp("Syntax: <remove ARMOUR>\n" ! " <remove all [of ARMOUR]>\n" ! " <remove ITEM from CONTAINER>\n\n" ! "This verb allows you to remove a piece of armour which you are " ! "currently wearing.\n\n" ! "The second syntax is simply a synonym for the \"get\" " ! "command.\n\n" ! "See also: get, wear, wield, unwield"); } mixed can_remove_obj() { if( this_player()->GetParalyzed() ) { return "You cannot do anything."; } ! return 1; } mixed can_remove_obj_out_of_obj() { int light; ! ! if( (light = effective_light(this_player())) < 0 ) { ! if( 100 + (10*light) < random(100) ) ! return "You fumble around in the darkness."; ! else return 1; ! } ! else if( light > 4 ) { ! if( 100 - (10*light) < random(100) ) ! return "You fumble around in the blinding light."; ! else return 1; ! } ! else return 1; } mixed can_remove_obj_from_obj() { --- 15,44 ---- SetVerb("remove"); SetRules("OBS", "OBS from OBJ", "OBS out of OBJ"); SetErrorMessage("Remove what?"); ! SetHelp("Syntax: <remove ARMOR>\n" ! " <remove all [of ARMOR]>\n" ! " <remove ITEM from CONTAINER>\n\n" ! "This verb allows you to remove a piece of armor which you are " ! "currently wearing.\n\n" ! "The second syntax is simply a synonym for the \"get\" " ! "command.\n\n" ! "See also: get, wear, wield, unwield"); } mixed can_remove_obj() { if( this_player()->GetParalyzed() ) { return "You cannot do anything."; } ! if(intp(check_light())) return this_player()->CanManipulate(); ! else return check_light(); ! } mixed can_remove_obj_out_of_obj() { int light; ! ! if(intp(check_light())) return this_player()->CanManipulate(); ! else return check_light(); } mixed can_remove_obj_from_obj() { *************** *** 61,71 **** obs = filter(res, (: objectp :)); if( !sizeof(obs) ) { ! mixed *ua; ua = unique_array(res, (: $1 :)); foreach(string *list in ua) ! this_player()->eventPrint(list[0]); return 1; } res = (mixed *)obs->eventUnequip(this_player()) - ({ 1 }); --- 54,64 ---- obs = filter(res, (: objectp :)); if( !sizeof(obs) ) { ! mixed *ua; ua = unique_array(res, (: $1 :)); foreach(string *list in ua) ! this_player()->eventPrint(list[0]); return 1; } res = (mixed *)obs->eventUnequip(this_player()) - ({ 1 }); diff -c -r --new-file ds1.1/lib/verbs/items/ring.c ds2.0r27/lib/verbs/items/ring.c *** ds1.1/lib/verbs/items/ring.c Sun Feb 1 21:30:54 1998 --- ds2.0r27/lib/verbs/items/ring.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/items/ring.c ! * From the Dead Souls V Object Library * Created by Descartes of Borg 961017 * Version: @(#) ring.c 1.1@(#) * Last modified: 96/10/17 --- 1,5 ---- /* /verbs/items/ring.c ! * From the Dead Souls Object Library * Created by Descartes of Borg 961017 * Version: @(#) ring.c 1.1@(#) * Last modified: 96/10/17 *************** *** 15,31 **** SetRules("OBJ", "STR on OBJ", "OBJ with OBJ", "STR on OBJ with OBJ"); SetErrorMessage("Ring what?"); SetHelp("Syntax: <ring OBJECT>\n" ! " <ring OBJECT on OBJECT>\n" ! " <ring OBJECT with OBJECT>\n" ! " <ring OBJECT on OBJECT with OBJECT>\n\n" ! "Allows you to ring things that ring."); } mixed can_ring_obj() { if( this_player()->GetParalized() > 0 ) { return "You cannot do anything."; } ! return 1; } mixed can_ring_str_on_obj() { --- 15,31 ---- SetRules("OBJ", "STR on OBJ", "OBJ with OBJ", "STR on OBJ with OBJ"); SetErrorMessage("Ring what?"); SetHelp("Syntax: <ring OBJECT>\n" ! " <ring OBJECT on OBJECT>\n" ! " <ring OBJECT with OBJECT>\n" ! " <ring OBJECT on OBJECT with OBJECT>\n\n" ! "Allows you to ring things that ring."); } mixed can_ring_obj() { if( this_player()->GetParalized() > 0 ) { return "You cannot do anything."; } ! return this_player()->CanManipulate(); } mixed can_ring_str_on_obj() { *************** *** 54,58 **** mixed do_ring_str_on_obj_with_obj(string str, object target, object tool) { return target->eventRing(this_player(), remove_article(lower_case(str)), ! tool); } --- 54,58 ---- mixed do_ring_str_on_obj_with_obj(string str, object target, object tool) { return target->eventRing(this_player(), remove_article(lower_case(str)), ! tool); } diff -c -r --new-file ds1.1/lib/verbs/items/search.c ds2.0r27/lib/verbs/items/search.c *** ds1.1/lib/verbs/items/search.c Sun Feb 1 21:30:54 1998 --- ds2.0r27/lib/verbs/items/search.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/items/search.c ! * from the Dead Souls V Object Library * created by Descartes of Borg 960121 * Version: @(#) search.c 1.2@(#) * Last modified: 96/10/15 --- 1,5 ---- /* /verbs/items/search.c ! * from the Dead Souls Object Library * created by Descartes of Borg 960121 * Version: @(#) search.c 1.2@(#) * Last modified: 96/10/15 *************** *** 8,30 **** #include <lib.h> #include <daemons.h> #include <function.h> ! inherit LIB_VERB; ! static void create() { verb::create(); SetVerb("search"); SetRules("", "OBJ", "STR on OBJ", "STR of OBJ"); SetErrorMessage("Search something?"); SetHelp("Syntax: <search>\n" ! " <search ITEM>\n" ! " <search THING on ITEM>\n\n" ! "Without any arguments, this command allows you to search " ! "your general surroundings. You may, however, concentrate " ! "your searching on any target.\n\n" ! "See also: listen, look, read, smell, touch"); } ! mixed can_search() { if( !environment(this_player()) ) { return "You are nowhere."; --- 8,30 ---- #include <lib.h> #include <daemons.h> #include <function.h> ! inherit LIB_VERB; ! static void create() { verb::create(); SetVerb("search"); SetRules("", "OBJ", "STR on OBJ", "STR of OBJ"); SetErrorMessage("Search something?"); SetHelp("Syntax: <search>\n" ! " <search ITEM>\n" ! " <search THING on ITEM>\n\n" ! "Without any arguments, this command allows you to search " ! "your general surroundings. You may, however, concentrate " ! "your searching on any target.\n\n" ! "See also: listen, look, read, smell, touch"); } ! mixed can_search() { if( !environment(this_player()) ) { return "You are nowhere."; *************** *** 56,62 **** val = "You don't find a thing."; } environment(this_player())->eventPrint(this_player()->GetName() + ! " searches around.", this_player()); this_player()->eventPrint(val); return 1; } --- 56,62 ---- val = "You don't find a thing."; } environment(this_player())->eventPrint(this_player()->GetName() + ! " searches around.", this_player()); this_player()->eventPrint(val); return 1; } diff -c -r --new-file ds1.1/lib/verbs/items/sell.c ds2.0r27/lib/verbs/items/sell.c *** ds1.1/lib/verbs/items/sell.c Sun Feb 1 21:30:56 1998 --- ds2.0r27/lib/verbs/items/sell.c Wed Jul 5 00:01:06 2006 *************** *** 16,33 **** SetRules("OBS to LIV", "LIV OBS"); SetErrorMessage("Sell what to whom?"); SetHelp("Syntax: <sell ITEM to LIVING>\n\n" ! "When in the presence of vendors, you may buy and sell goods " ! "which match the type of goods the vendor in question trades in. " ! "The \"sell\" command naturally allows you to sell an item " ! "to an interested vendor.\n\n" ! "See also: ask, sell, vendors"); } mixed can_sell_obj_to_liv() { if( this_player()->GetParalyzed() ) { return "You cannot do anything."; } ! return 1; } mixed can_sell_liv_obs() { --- 16,33 ---- SetRules("OBS to LIV", "LIV OBS"); SetErrorMessage("Sell what to whom?"); SetHelp("Syntax: <sell ITEM to LIVING>\n\n" ! "When in the presence of vendors, you may buy and sell goods " ! "which match the type of goods the vendor in question trades in. " ! "The \"sell\" command naturally allows you to sell an item " ! "to an interested vendor.\n\n" ! "See also: ask, sell, vendors"); } mixed can_sell_obj_to_liv() { if( this_player()->GetParalyzed() ) { return "You cannot do anything."; } ! return this_player()->CanManipulate(); } mixed can_sell_liv_obs() { *************** *** 43,53 **** } mixed do_sell_obs_to_liv(object array items, object vendor) { ! object array obs; obs = filter(items, (: objectp :)); if( !sizeof(obs) ) { ! mixed array ua; ua = unique_array(items, (: $1 :)); foreach(string array list in ua) { --- 43,53 ---- } mixed do_sell_obs_to_liv(object array items, object vendor) { ! object *obs, *eligible; obs = filter(items, (: objectp :)); if( !sizeof(obs) ) { ! mixed array ua; ua = unique_array(items, (: $1 :)); foreach(string array list in ua) { *************** *** 55,61 **** } return 1; } ! return vendor->eventBuy(this_player(), obs); } mixed do_sell_liv_obs(object vendor, object array items) { --- 55,68 ---- } return 1; } ! eligible=filter(obs, (: (!($1->GetWorn()) && environment($1) == this_player()) :)); ! if(!sizeof(eligible)){ ! write("Remove or unwield items before trying to sell them."); ! eligible = ({}); ! return 1; ! } ! ! return vendor->eventBuy(this_player(), eligible); } mixed do_sell_liv_obs(object vendor, object array items) { diff -c -r --new-file ds1.1/lib/verbs/items/shoot.c ds2.0r27/lib/verbs/items/shoot.c *** ds1.1/lib/verbs/items/shoot.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/verbs/items/shoot.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,42 ---- + #include <lib.h> + + inherit LIB_VERB; + + static void create() { + verb::create(); + SetVerb("shoot"); + SetRules("OBJ at STR","WRD with WRD"); + SetSynonyms("fire", "gat", "gank"); + SetErrorMessage("Shoot what?"); + SetHelp("Syntax: <shoot OBJECT>\n\n" + "Shoots a target.\n\n"); + } + + + mixed can_shoot_obj_at_str(object shooter, string target) { + if(intp(check_light())) return this_player()->CanManipulate(); + else return check_light(); + } + + mixed can_shoot_wrd_with_wrd(mixed target,mixed shooter) { + if(intp(check_light())) return this_player()->CanManipulate(); + else return check_light(); + } + + + varargs mixed do_shoot_obj_at_str(object shooter, string target) { + return (mixed)shooter->CanShoot(shooter,target); + return 1; + } + + varargs mixed do_shoot_wrd_with_wrd(mixed target,mixed shooter) { + object rod; + if(!rod = present(shooter,this_player())) { + rod = present(shooter,environment(this_player())); + } + if(rod) return (mixed)rod->CanShoot(rod,target); + else return "Reality has been distorted here. Report this event."; + } + + + diff -c -r --new-file ds1.1/lib/verbs/items/smell.c ds2.0r27/lib/verbs/items/smell.c *** ds1.1/lib/verbs/items/smell.c Sun Feb 1 21:30:54 1998 --- ds2.0r27/lib/verbs/items/smell.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/items/smell.c ! * from the Dead Souls V Object Library * created by Descartes of Borg 960121 * Version: @(#) smell.c 1.2@(#) * Last modified: 96/10/15 --- 1,5 ---- /* /verbs/items/smell.c ! * from the Dead Souls Object Library * created by Descartes of Borg 960121 * Version: @(#) smell.c 1.2@(#) * Last modified: 96/10/15 *************** *** 8,30 **** #include <lib.h> #include <daemons.h> #include <function.h> ! inherit LIB_VERB; ! static void create() { verb::create(); SetVerb("smell"); SetRules("", "OBJ", "STR on OBJ", "STR of OBJ"); SetErrorMessage("Smell something?"); SetHelp("Syntax: <smell>\n" ! " <smell ITEM>\n" ! " <smell THING on ITEM>\n\n" ! "Without any arguments, this command allows you to smell " ! "your general surroundings. You may, however, concentrate " ! "your smelling on any target.\n\n" ! "See also: listen, look, read, search, touch"); } ! mixed can_smell() { if( !environment(this_player()) ) { return "You are nowhere."; --- 8,30 ---- #include <lib.h> #include <daemons.h> #include <function.h> ! inherit LIB_VERB; ! static void create() { verb::create(); SetVerb("smell"); SetRules("", "OBJ", "STR on OBJ", "STR of OBJ"); SetErrorMessage("Smell something?"); SetHelp("Syntax: <smell>\n" ! " <smell ITEM>\n" ! " <smell THING on ITEM>\n\n" ! "Without any arguments, this command allows you to smell " ! "your general surroundings. You may, however, concentrate " ! "your smelling on any target.\n\n" ! "See also: listen, look, read, search, touch"); } ! mixed can_smell() { if( !environment(this_player()) ) { return "You are nowhere."; *************** *** 56,62 **** val = "You don't smell a thing."; } environment(this_player())->eventPrint(this_player()->GetName() + ! " smells around.", this_player()); this_player()->eventPrint(val); return 1; } --- 56,62 ---- val = "You don't smell a thing."; } environment(this_player())->eventPrint(this_player()->GetName() + ! " smells around.", this_player()); this_player()->eventPrint(val); return 1; } diff -c -r --new-file ds1.1/lib/verbs/items/steal.c ds2.0r27/lib/verbs/items/steal.c *** ds1.1/lib/verbs/items/steal.c Sun Feb 1 21:30:56 1998 --- ds2.0r27/lib/verbs/items/steal.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/items/steal.c ! * from the Dead Souls V Object Library * steal WRD from LIV * steal OBJ from LIV * created by Descartes of Borg 951218 --- 1,5 ---- /* /verbs/items/steal.c ! * from the Dead Souls Object Library * steal WRD from LIV * steal OBJ from LIV * created by Descartes of Borg 951218 *************** *** 19,74 **** SetRules("OBJ from LIV", "WRD from LIV", "OBS from LIV"); SetErrorMessage("Steal what from whom?"); SetHelp("Syntax: <steal money from LIVING>\n" ! " <steal ITEM from LIVING>\n" ! " <steal all [of ITEMS] from LIVING>\n\n" ! "Uses your stealing abilities to rob another of items or money. " ! "Items are much harder to steal than money, and trying to steal " ! "multiple items in one shot is dangerous."); } mixed can_steal_wrd_from_liv(string wrd) { if( wrd != "money" ) return 0; if( (int)this_player()->GetSkillLevel("stealing") < 1 ) ! return "You are not skillful enough at stealing."; if( (int)environment(this_player())->GetProperty("no steal") ) ! return "Mystical forces prevent your thievery."; if( (int)this_player()->GetStaminaPoints() < 10 ) ! return "You are too tired for such skullduggery."; ! return 1; } mixed can_steal_obj_from_liv() { if( (int)this_player()->GetSkillLevel("stealing") < 1 ) ! return "You are not skillful enough at stealing."; if( (int)environment(this_player())->GetProperty("no steal") ) ! return "Mystical forces prevent your thievery."; if( (int)this_player()->GetStaminaPoints() < 20 ) ! return "You are too tired for such skullduggery."; ! return 1; } mixed do_steal_wrd_from_liv(string wrd, object liv) { this_player()->eventPrint("You eye " + (string)liv->GetName() + ! " with thoughts on " + possessive(liv) + ! " pockets."); if( (int)this_player()->GetInCombat() ) ! this_player()->SetAttack(0, (: eventSteal,this_player(), "money", liv :), ! ROUND_OTHER); else eventSteal(this_player(), "money", liv); return 1; } mixed do_steal_obj_from_liv(object item, object liv) { if( environment(item) != liv ) { ! this_player()->eventPrint((string)liv->GetName() + " does not have that."); ! return 1; } this_player()->eventPrint("You eye " + (string)liv->GetName() + ! " with thoughts on " + possessive(liv) + " " + ! remove_article((string)item->GetShort()) + "."); if( (int)this_player()->GetInCombat() ) ! this_player()->SetAttack(0, (: eventSteal, this_player(), ({ item }), ! liv :), ROUND_OTHER); else eventSteal(this_player(), ({ item }), liv); return 1; } --- 19,80 ---- SetRules("OBJ from LIV", "WRD from LIV", "OBS from LIV"); SetErrorMessage("Steal what from whom?"); SetHelp("Syntax: <steal money from LIVING>\n" ! " <steal ITEM from LIVING>\n" ! " <steal all [of ITEMS] from LIVING>\n\n" ! "Uses your stealing abilities to rob another of items or money. " ! "Items are much harder to steal than money, and trying to steal " ! "multiple items in one shot is dangerous."); } mixed can_steal_wrd_from_liv(string wrd) { if( wrd != "money" ) return 0; if( (int)this_player()->GetSkillLevel("stealing") < 1 ) ! return "You are not skillful enough at stealing."; if( (int)environment(this_player())->GetProperty("no steal") ) ! return "Mystical forces prevent your thievery."; if( (int)this_player()->GetStaminaPoints() < 10 ) ! return "You are too tired for such skullduggery."; ! if(intp(check_light())) return this_player()->CanManipulate(); ! else return check_light(); } mixed can_steal_obj_from_liv() { if( (int)this_player()->GetSkillLevel("stealing") < 1 ) ! return "You are not skillful enough at stealing."; if( (int)environment(this_player())->GetProperty("no steal") ) ! return "Mystical forces prevent your thievery."; if( (int)this_player()->GetStaminaPoints() < 20 ) ! return "You are too tired for such skullduggery."; ! if(intp(check_light())) return this_player()->CanManipulate(); ! else return check_light(); } mixed do_steal_wrd_from_liv(string wrd, object liv) { this_player()->eventPrint("You eye " + (string)liv->GetName() + ! " with thoughts on " + possessive(liv) + ! " pockets."); if( (int)this_player()->GetInCombat() ) ! this_player()->SetAttack(0, (: eventSteal,this_player(), "money", liv :), ! ROUND_OTHER); else eventSteal(this_player(), "money", liv); return 1; } mixed do_steal_obj_from_liv(object item, object liv) { if( environment(item) != liv ) { ! this_player()->eventPrint((string)liv->GetName() + " does not have that."); ! return 1; ! } ! if(item->GetProperty("no steal")){ ! this_player()->eventPrint("that item cannot be stolen."); ! return 1; } this_player()->eventPrint("You eye " + (string)liv->GetName() + ! " with thoughts on " + possessive(liv) + " " + ! remove_article((string)item->GetShort()) + "."); if( (int)this_player()->GetInCombat() ) ! this_player()->SetAttack(0, (: eventSteal, this_player(), ({ item }), ! liv :), ROUND_OTHER); else eventSteal(this_player(), ({ item }), liv); return 1; } *************** *** 78,99 **** obs = filter(res, (: objectp :)); if( !sizeof(obs) ) { ! mixed *ua; ua = unique_array(res, (: $1 :)); foreach(mixed *lines in ua) this_player()->eventPrint(lines[0]); return 1; } this_player()->eventPrint("You eye " + (string)liv->GetName() + ! " with thoughts on " + possessive(liv) + ! " possessions."); if( (int)this_player()->GetInCombat() ) ! this_player()->SetAttack(0, (: eventSteal, this_player(), obs, liv :), ! ROUND_OTHER); else eventSteal(this_player(), obs, liv); return 1; } static void eventSteal(object who, mixed what, object target) { who->eventSteal(who, what, target); } --- 84,117 ---- obs = filter(res, (: objectp :)); if( !sizeof(obs) ) { ! mixed *ua; ua = unique_array(res, (: $1 :)); foreach(mixed *lines in ua) this_player()->eventPrint(lines[0]); return 1; } + + foreach(mixed thing in res){ + if(objectp(thing) && thing->GetProperty("no steal")){ + this_player()->eventPrint("One of those items cannot be stolen, causing "+ + "you to be distracted from stealing any of the others."); + return 1; + } + } this_player()->eventPrint("You eye " + (string)liv->GetName() + ! " with thoughts on " + possessive(liv) + ! " possessions."); if( (int)this_player()->GetInCombat() ) ! this_player()->SetAttack(0, (: eventSteal, this_player(), obs, liv :), ! ROUND_OTHER); else eventSteal(this_player(), obs, liv); return 1; } static void eventSteal(object who, mixed what, object target) { + if(objectp(what) && what->GetProperty("no steal")){ + write("That item cannot be stolen."); + return; + } who->eventSteal(who, what, target); } diff -c -r --new-file ds1.1/lib/verbs/items/strike.c ds2.0r27/lib/verbs/items/strike.c *** ds1.1/lib/verbs/items/strike.c Sun Feb 1 21:30:56 1998 --- ds2.0r27/lib/verbs/items/strike.c Wed Jul 5 00:01:06 2006 *************** *** 9,22 **** SetRules("OBJ"); SetErrorMessage("Strike what?"); SetHelp("Syntax: <strike OBJECT>\n\n" ! "Certain objects are flammable simply by striking them. " ! "When you strike such objects, they have a chance of " ! "catching fire and burning.\n\n" ! "See also: burn, douse, light"); } mixed can_strike_obj() { ! return 1; } mixed do_strike_obj(object ob) { --- 9,22 ---- SetRules("OBJ"); SetErrorMessage("Strike what?"); SetHelp("Syntax: <strike OBJECT>\n\n" ! "Certain objects are flammable simply by striking them. " ! "When you strike such objects, they have a chance of " ! "catching fire and burning.\n\n" ! "See also: burn, douse, light"); } mixed can_strike_obj() { ! return this_player()->CanManipulate(); } mixed do_strike_obj(object ob) { diff -c -r --new-file ds1.1/lib/verbs/items/throw.c ds2.0r27/lib/verbs/items/throw.c *** ds1.1/lib/verbs/items/throw.c Sun Feb 1 21:30:54 1998 --- ds2.0r27/lib/verbs/items/throw.c Wed Jul 5 00:01:06 2006 *************** *** 20,41 **** SetRules("OBJ", "OBJ at OBJ", "OBJ into OBJ"); SetErrorMessage("Throw what?"); SetHelp("Syntax: <throw OBJ>\n" ! " <throw OBJ at OBJ>\n" ! " <throw OBJ into OBJ>\n\n" ! "Allows you to throw an object. Some object you may also " ! "use offensively by throwing them. Other places may simply " ! "allow you to throw objects into them, say like throwing " ! "equipment down to a friend in a chasm.\n" ! "Note that throwing a weapon at someone will initiate " ! "combat.\n\n" ! "Synonyms: toss"); } mixed can_throw_obj() { if( this_player()->GetParalyzed() ) { return "You cannot do anything."; } ! return 1; } mixed can_throw_obj_word_obj() { --- 20,42 ---- SetRules("OBJ", "OBJ at OBJ", "OBJ into OBJ"); SetErrorMessage("Throw what?"); SetHelp("Syntax: <throw OBJ>\n" ! " <throw OBJ at OBJ>\n" ! " <throw OBJ into OBJ>\n\n" ! "Allows you to throw an object. Some object you may also " ! "use offensively by throwing them. Other places may simply " ! "allow you to throw objects into them, say like throwing " ! "equipment down to a friend in a chasm.\n" ! "Note that throwing a weapon at someone will initiate " ! "combat.\n\n" ! "Synonyms: toss"); } mixed can_throw_obj() { if( this_player()->GetParalyzed() ) { return "You cannot do anything."; } ! if(intp(check_light())) return this_player()->CanManipulate(); ! else return check_light(); } mixed can_throw_obj_word_obj() { *************** *** 57,66 **** } if( this_player()->GetInCombat() || enemy ) { this_player()->eventPrint("You prepare to throw " + ! (string)what->GetShort() + "."); this_player()->SetAttack(enemy, (: eventThrow, this_player(), what, ! where :), (enemy ? ROUND_WEAPON : ! ROUND_OTHER)); return 1; } eventThrow(this_player(), what, where); --- 58,67 ---- } if( this_player()->GetInCombat() || enemy ) { this_player()->eventPrint("You prepare to throw " + ! (string)what->GetShort() + "."); this_player()->SetAttack(enemy, (: eventThrow, this_player(), what, ! where :), (enemy ? ROUND_WEAPON : ! ROUND_OTHER)); return 1; } eventThrow(this_player(), what, where); *************** *** 68,74 **** } void eventThrow(object who, object what, object where) { - mixed tmp; if( !who ) { return; --- 69,74 ---- diff -c -r --new-file ds1.1/lib/verbs/items/touch.c ds2.0r27/lib/verbs/items/touch.c *** ds1.1/lib/verbs/items/touch.c Sun Feb 1 21:30:53 1998 --- ds2.0r27/lib/verbs/items/touch.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/items/touch.c ! * from the Dead Souls V Object Library * created by Descartes of Borg 961014 * Version: @(#) touch.c 1.1@(#) * Last modified: 96/10/15 --- 1,5 ---- /* /verbs/items/touch.c ! * from the Dead Souls Object Library * created by Descartes of Borg 961014 * Version: @(#) touch.c 1.1@(#) * Last modified: 96/10/15 *************** *** 8,28 **** #include <lib.h> #include <daemons.h> #include <function.h> ! inherit LIB_VERB; ! static void create() { verb::create(); SetVerb("touch"); SetRules("OBJ", "STR on OBJ", "STR of OBJ"); SetErrorMessage("Touch something?"); SetHelp("Syntax: <touch ITEM>\n" ! " <touch THING on ITEM>\n\n" ! "This command allows you to touch an object to get an idea " ! "of any special textural properties it may have.\n\n" ! "See also: listen, look, read, search, smell"); } ! mixed can_touch_obj() { return 1; } --- 8,28 ---- #include <lib.h> #include <daemons.h> #include <function.h> ! inherit LIB_VERB; ! static void create() { verb::create(); SetVerb("touch"); SetRules("OBJ", "STR on OBJ", "STR of OBJ"); SetErrorMessage("Touch something?"); SetHelp("Syntax: <touch ITEM>\n" ! " <touch THING on ITEM>\n\n" ! "This command allows you to touch an object to get an idea " ! "of any special textural properties it may have.\n\n" ! "See also: listen, look, read, search, smell"); } ! mixed can_touch_obj() { return 1; } diff -c -r --new-file ds1.1/lib/verbs/items/turn.c ds2.0r27/lib/verbs/items/turn.c *** ds1.1/lib/verbs/items/turn.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/verbs/items/turn.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,64 ---- + /* /verbs/items/turn.c + * from the Frontiers Object Library + * turn STR + * turn on ITEM + * etc + */ + + #include <lib.h> + #include <daemons.h> + + inherit LIB_VERB; + + static void create() { + verb::create(); + SetVerb("turn"); + SetRules("", "OBJ", "on OBJ", "off OBJ"); + SetErrorMessage("Turn on or turn off something?"); + SetHelp("Syntax: <turn>\n" + " <turn on ITEM>\n" + " <turn off ITEM>\n" + " <turn on THING on ITEM>\n" + " <turn off THING on ITEM>\n\n" + ""); + } + + mixed can_turn() { + return this_player()->CanManipulate(); + } + + mixed can_turn_obj(mixed foo) { + return this_player()->CanManipulate(); + } + + mixed can_turn_on_obj(mixed foo) { + return this_player()->CanManipulate(); + } + + mixed can_turn_off_obj(mixed foo) { + return this_player()->CanManipulate(); + } + + mixed do_turn() { + environment(this_player())->eventPrint((string)this_player()->GetName() + + " turns around.", this_player()); + this_player()->eventPrint("You turn around."); + return 1; + } + + varargs mixed do_turn_obj(mixed foo, mixed foo2) { + return foo->eventTurn(); + } + + varargs mixed do_turn_on_obj(mixed foo, mixed foo2) { + return foo->eventTurnOn(); + } + + mixed do_turn_off_obj(mixed foo) { + return foo->eventTurnOff(); + } + + mixed do_turn_on_obj_word_obj(mixed foo, mixed foo2) { + return foo2->eventTurnOn(foo); + } + diff -c -r --new-file ds1.1/lib/verbs/items/unlock.c ds2.0r27/lib/verbs/items/unlock.c *** ds1.1/lib/verbs/items/unlock.c Sun Feb 1 21:30:54 1998 --- ds2.0r27/lib/verbs/items/unlock.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/items/unlock.c ! * from the Dead Soulsr2 Object Library * created by Descartes of Borg 951028 * Version: @(#) unlock.c 1.3@(#) * Last modified: 97/01/02 --- 1,5 ---- /* /verbs/items/unlock.c ! * from the Dead Souls Object Library * created by Descartes of Borg 951028 * Version: @(#) unlock.c 1.3@(#) * Last modified: 97/01/02 *************** *** 16,33 **** SetRules("OBJ with OBJ"); SetErrorMessage("Unlock what with what?"); SetHelp("Syntax: <unlock OBJ with OBJ>\n\n" ! "The first object is something you wish to unlock, like a " ! "door or a chest. The second is the key you wish to use to " ! "unlock it with. If your key is the right key, then " ! "unlock allows you to unlock it.\n\n" ! "See also: close, lock, open, pick"); } mixed can_unlock_obj_with_obj() { if( this_player()->GetParalyzed() ) { return "You cannot do anything."; } ! return 1; } mixed do_unlock_obj_with_obj(object target, object key) { --- 16,33 ---- SetRules("OBJ with OBJ"); SetErrorMessage("Unlock what with what?"); SetHelp("Syntax: <unlock OBJ with OBJ>\n\n" ! "The first object is something you wish to unlock, like a " ! "door or a chest. The second is the key you wish to use to " ! "unlock it with. If your key is the right key, then " ! "unlock allows you to unlock it.\n\n" ! "See also: close, lock, open, pick"); } mixed can_unlock_obj_with_obj() { if( this_player()->GetParalyzed() ) { return "You cannot do anything."; } ! return this_player()->CanManipulate(); } mixed do_unlock_obj_with_obj(object target, object key) { diff -c -r --new-file ds1.1/lib/verbs/items/unwield.c ds2.0r27/lib/verbs/items/unwield.c *** ds1.1/lib/verbs/items/unwield.c Sun Feb 1 21:30:55 1998 --- ds2.0r27/lib/verbs/items/unwield.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/items/unwield.c ! * From the Dead Souls V Object Library * Allows players to stop wielding a weapon * Created by Descartes of Borg 960207 * Version: @(#) unwield.c 1.2@(#) --- 1,5 ---- /* /verbs/items/unwield.c ! * From the Dead Souls Object Library * Allows players to stop wielding a weapon * Created by Descartes of Borg 960207 * Version: @(#) unwield.c 1.2@(#) *************** *** 15,25 **** SetVerb("unwield"); SetRules("OBS"); SetErrorMessage("Unwield what?"); ! SetHelp("Syntax: <unwield ARMOUR>\n" ! " <unwield all [of WEAPON]>\n\n" ! "This verb allows you to unwield a weapon which you are " ! "currently wielding.\n\n" ! "See also: get, remove, wear, wield"); } mixed can_unwield_obj(string verb) { --- 15,25 ---- SetVerb("unwield"); SetRules("OBS"); SetErrorMessage("Unwield what?"); ! SetHelp("Syntax: <unwield ARMOR>\n" ! " <unwield all [of WEAPON]>\n\n" ! "This verb allows you to unwield a weapon which you are " ! "currently wielding.\n\n" ! "See also: get, remove, wear, wield"); } mixed can_unwield_obj(string verb) { *************** *** 37,49 **** object array obs; if( !sizeof(targs) ) { ! this_player()->eventPrint("There is no such thing to be unwielded."); return 1; } obs = filter(targs, (: objectp :)); if( !sizeof(obs) ) { mapping messages = unique_mapping(targs, (: $1 :)); ! foreach(string msg in keys(messages)) { this_player()->eventPrint(msg); } --- 37,49 ---- object array obs; if( !sizeof(targs) ) { ! this_player()->eventPrint("There is no such thing to be unwielded."); return 1; } obs = filter(targs, (: objectp :)); if( !sizeof(obs) ) { mapping messages = unique_mapping(targs, (: $1 :)); ! foreach(string msg in keys(messages)) { this_player()->eventPrint(msg); } diff -c -r --new-file ds1.1/lib/verbs/items/use.c ds2.0r27/lib/verbs/items/use.c *** ds1.1/lib/verbs/items/use.c Sun Feb 1 21:30:56 1998 --- ds2.0r27/lib/verbs/items/use.c Wed Jul 5 00:01:06 2006 *************** *** 11,21 **** SetRules("OBJ to STR"); SetErrorMessage("Use what to do what?"); SetHelp("Syntax: <use OBJ to CMD>\n\n" ! "Certain objects, like scrolls, allow you to perform acts beyond " ! "your naturaly abilities. Of course, the only way to know if an " ! "object can so empower you is either to try it or to somehow " ! "detect its magic.\n\n" ! "See also: detect, discern"); } mixed can_use_obj_to_str(string str) { return 1; } --- 11,21 ---- SetRules("OBJ to STR"); SetErrorMessage("Use what to do what?"); SetHelp("Syntax: <use OBJ to CMD>\n\n" ! "Certain objects, like scrolls, allow you to perform acts beyond " ! "your naturaly abilities. Of course, the only way to know if an " ! "object can so empower you is either to try it or to somehow " ! "detect its magic.\n\n" ! "See also: detect, discern"); } mixed can_use_obj_to_str(string str) { return 1; } diff -c -r --new-file ds1.1/lib/verbs/items/wear.c ds2.0r27/lib/verbs/items/wear.c *** ds1.1/lib/verbs/items/wear.c Sun Feb 1 21:30:55 1998 --- ds2.0r27/lib/verbs/items/wear.c Wed Jul 5 00:01:06 2006 *************** *** 1,13 **** /* /verbs/items/wear.c * From the Dead Souls Object Library ! * Allows a player to wear armour * Created by Descartes of Borg 951020 * Version: @(#) wear.c 1.2@(#) * Last modified: 97/01/01 */ #include <lib.h> ! #include <armour_types.h> inherit LIB_VERB; --- 1,13 ---- /* /verbs/items/wear.c * From the Dead Souls Object Library ! * Allows a player to wear armor * Created by Descartes of Borg 951020 * Version: @(#) wear.c 1.2@(#) * Last modified: 97/01/01 */ #include <lib.h> ! #include <armor_types.h> inherit LIB_VERB; *************** *** 16,37 **** SetVerb("wear"); SetRules("OBS", "OBJ on STR"); SetErrorMessage("Wear what? When in doubt, specify a limb to " ! "wear it on."); ! SetHelp("Syntax: <wear ARMOUR>\n" ! " <wear ARMOUR on LIMB>\n\n" ! "Allows you to take an article of clothing and wear it. Some " ! "bits of clothing may be worn in a variety of places, and thus " ! "require you to specify where it is they should be worn. For " ! "example, a shield could be worn with either the right hand or " ! "left hand. So you would type, \"wear shield on right hand\".\n\n" ! "See also: wield"); } mixed can_wear_obj() { if( this_player()->GetParalyzed() ) { return "You cannot do anything."; } ! return 1; } mixed can_wear_obj_on_str(string str) { --- 16,37 ---- SetVerb("wear"); SetRules("OBS", "OBJ on STR"); SetErrorMessage("Wear what? When in doubt, specify a limb to " ! "wear it on."); ! SetHelp("Syntax: <wear ARMOR>\n" ! " <wear ARMOR on LIMB>\n\n" ! "Allows you to take an article of clothing and wear it. Some " ! "bits of clothing may be worn in a variety of places, and thus " ! "require you to specify where it is they should be worn. For " ! "example, a shield could be worn with either the right hand or " ! "left hand. So you would type, \"wear shield on right hand\".\n\n" ! "See also: wield"); } mixed can_wear_obj() { if( this_player()->GetParalyzed() ) { return "You cannot do anything."; } ! return this_player()->CanManipulate(); } mixed can_wear_obj_on_str(string str) { *************** *** 44,71 **** mixed do_wear_obj_on_str(object ob, string str) { return ob->eventEquip(this_player(), ! ({ remove_article(lower_case(str)) })); } ! mixed do_wear_obs(object array armours) { object array obs; ! if( !sizeof(armours) ) { ! this_player()->eventPrint("There is no such thing to be worn."); return 1; } ! obs = filter(armours, (: objectp :)); if( !sizeof(obs) ) { ! mixed array ua; ! ua = unique_array(armours, (: $1 :)); foreach(string array list in ua) { this_player()->eventPrint(list[0]); } return 1; } ! foreach(object armour in obs) { ! do_wear_obj(armour); } return 1; } --- 44,71 ---- mixed do_wear_obj_on_str(object ob, string str) { return ob->eventEquip(this_player(), ! ({ remove_article(lower_case(str)) })); } ! mixed do_wear_obs(object array armors) { object array obs; ! if( !sizeof(armors) ) { ! this_player()->eventPrint("There is no such thing to be worn."); return 1; } ! obs = filter(armors, (: objectp :)); if( !sizeof(obs) ) { ! mixed array ua; ! ua = unique_array(armors, (: $1 :)); foreach(string array list in ua) { this_player()->eventPrint(list[0]); } return 1; } ! foreach(object armor in obs) { ! do_wear_obj(armor); } return 1; } diff -c -r --new-file ds1.1/lib/verbs/items/wield.c ds2.0r27/lib/verbs/items/wield.c *** ds1.1/lib/verbs/items/wield.c Sun Feb 1 21:30:55 1998 --- ds2.0r27/lib/verbs/items/wield.c Wed Jul 5 00:01:06 2006 *************** *** 12,45 **** string array GetFreeLimbs(object who) { string array limbs = who->GetWieldingLimbs(); ! limbs = filter(limbs, (: !$(who)->GetWielded($1) :)); return limbs; } ! static void create() { verb::create(); SetVerb("wield"); SetRules("OBS", "OBS in STR", "OBS with STR"); SetErrorMessage("Wield what? Perhaps you mean to specify in which " ! "limbs?"); SetHelp( ! "Syntax: <wield all>\n" ! " <wield OBJ>\n" ! " <wield OBJ in LIMB>\n" ! " <wield OBJ with LIMB>\n" ! "\n" ! "This command sets the weapon you name to be wielded in the " ! "limb you specify.\n\n" ! "Note that a limb can be a single limb, or a list of limbs " ! "separated by a comma, or the word \"and\", depending on " ! "how many limbs are required for wielding the weapon. For " ! "example:\n" ! "\twield the rusty sword with my right hand and left hand\n" ! "\twield the artrell sword with first hand, second hand, and " ! "third hand\n" ! "\n" ! "See also: wear"); } mixed can_wield_obj() { --- 12,45 ---- string array GetFreeLimbs(object who) { string array limbs = who->GetWieldingLimbs(); ! limbs = filter(limbs, (: !$(who)->GetWielded($1) :)); return limbs; } ! static void create() { verb::create(); SetVerb("wield"); SetRules("OBS", "OBS in STR", "OBS with STR"); SetErrorMessage("Wield what? Perhaps you mean to specify in which " ! "limbs?"); SetHelp( ! "Syntax: <wield all>\n" ! " <wield OBJ>\n" ! " <wield OBJ in LIMB>\n" ! " <wield OBJ with LIMB>\n" ! "\n" ! "This command sets the weapon you name to be wielded in the " ! "limb you specify.\n\n" ! "Note that a limb can be a single limb, or a list of limbs " ! "separated by a comma, or the word \"and\", depending on " ! "how many limbs are required for wielding the weapon. For " ! "example:\n" ! "\twield the rusty sword with my right hand and left hand\n" ! "\twield the artrell sword with first hand, second hand, and " ! "third hand\n" ! "\n" ! "See also: wear"); } mixed can_wield_obj() { *************** *** 59,65 **** mixed do_wield_obj(object ob) { string array limbs = GetFreeLimbs(this_player()); int hands = ob->GetHands(); ! if( hands < sizeof(limbs) ) { limbs = limbs[0..(hands-1)]; } --- 59,65 ---- mixed do_wield_obj(object ob) { string array limbs = GetFreeLimbs(this_player()); int hands = ob->GetHands(); ! if( hands < sizeof(limbs) ) { limbs = limbs[0..(hands-1)]; } *************** *** 74,86 **** object array obs; if( !sizeof(targs) ) { ! this_player()->eventPrint("There is no such thing to be wielded."); return 1; } obs = filter(targs, (: objectp :)); if( !sizeof(obs) ) { mapping messages = unique_mapping(targs, (: $1 :)); ! foreach(string msg in keys(messages)) { this_player()->eventPrint(msg); } --- 74,86 ---- object array obs; if( !sizeof(targs) ) { ! this_player()->eventPrint("There is no such thing to be wielded."); return 1; } obs = filter(targs, (: objectp :)); if( !sizeof(obs) ) { mapping messages = unique_mapping(targs, (: $1 :)); ! foreach(string msg in keys(messages)) { this_player()->eventPrint(msg); } *************** *** 92,102 **** if( sizeof(limbs) < hands ) { this_player()->eventPrint("You don't have anywhere to wield " + ! item->GetDefiniteShort() + "."); } else { mixed tmp; ! if( hands < sizeof(limbs) ) { limbs = limbs[0..(hands-1)]; } --- 92,102 ---- if( sizeof(limbs) < hands ) { this_player()->eventPrint("You don't have anywhere to wield " + ! item->GetDefiniteShort() + "."); } else { mixed tmp; ! if( hands < sizeof(limbs) ) { limbs = limbs[0..(hands-1)]; } *************** *** 104,110 **** if( tmp != 1 ) { if( !tmp ) { this_player()->eventPrint("You cannot wield " + ! item->GetDefiniteShort() + "."); } else { this_player()->eventPrint(tmp); --- 104,110 ---- if( tmp != 1 ) { if( !tmp ) { this_player()->eventPrint("You cannot wield " + ! item->GetDefiniteShort() + "."); } else { this_player()->eventPrint(tmp); diff -c -r --new-file ds1.1/lib/verbs/players/attack.c ds2.0r27/lib/verbs/players/attack.c *** ds1.1/lib/verbs/players/attack.c Sun Feb 1 21:31:00 1998 --- ds2.0r27/lib/verbs/players/attack.c Wed Jul 5 00:01:06 2006 *************** *** 7,12 **** --- 7,13 ---- */ #include <lib.h> + #include <daemons.h> #include <position.h> #include "include/attack.h" *************** *** 15,72 **** static void create() { verb::create(); SetVerb("attack"); ! SetRules("LVS"); SetErrorMessage("Attack whom?"); SetHelp("Syntax: <attack LIVING>\n" ! " <attack all of LIVING>\n" ! " <attack all>\n\n" ! "This command initiates combat with a living being or group " ! "of living beings using any wielded weapons or your bare hands. " ! "Be very careful not to issue the \"attack all\" with other " ! "players in the room or you will be guilty of attempted player " ! "killing.\n\n" ! "See also: wimpy"); } ! mixed can_attack_liv(object target) { int pos = this_player()->GetPosition(); if( (int)this_player()->GetParalyzed() ) { return "You cannot move!"; } ! if( pos == POSITION_SITTING || pos == POSITION_LYING ) { return "You cannot attack in that position!"; } if( (int)environment(this_player())->GetProperty("no attack") ) { ! message("environment", "A mystical force prevents your malice.", ! this_player()); ! return 1; } return 1; } mixed do_attack_liv(object target) { return do_attack_lvs(({ target })); } ! mixed do_attack_lvs(mixed *targets) { ! object *obs; string tmp; obs = filter(targets, (: objectp :)); if( !sizeof(obs) ) { ! mixed *ua; ua = unique_array(targets, (: $1 :)); foreach(string *lines in ua) this_player()->eventPrint(lines[0]); return 1; } this_player()->SetAttack(obs); tmp = item_list(obs); obs->eventPrint((string)this_player()->GetName() + " attacks you!"); environment(this_player())->eventPrint((string)this_player()->GetName() + ! " attacks " + tmp + "!", ! ({ this_player(), obs... })); this_player()->eventPrint("You advance towards " + tmp + "."); return 1; } --- 16,107 ---- static void create() { verb::create(); SetVerb("attack"); ! SetRules("LVS", "only LVS","LVS only"); ! SetSynonyms("kill", "smite", "waste", "hit"); SetErrorMessage("Attack whom?"); SetHelp("Syntax: <attack LIVING>\n" ! " <attack all of LIVING>\n" ! " <attack all>\n\n" ! "This command initiates combat with a living being or group " ! "of living beings using any wielded weapons or your bare hands. " ! "Be very careful not to issue the \"attack all\" with other " ! "players in the room or you will be guilty of attempted player " ! "killing.\n\n" ! "See also: wimpy, ignore"); } ! varargs mixed can_attack_liv(object target) { int pos = this_player()->GetPosition(); if( (int)this_player()->GetParalyzed() ) { return "You cannot move!"; } ! if( pos == POSITION_SITTING || pos == POSITION_LYING && ! !RACES_D->GetLimblessCombatRace(this_player()->GetRace()) ){ return "You cannot attack in that position!"; } if( (int)environment(this_player())->GetProperty("no attack") ) { ! return "A mystical force prevents your malice."; } return 1; } + mixed can_attack_only_liv(object target){ + return can_attack_liv(target); + } + + mixed can_attack_liv_only(object target){ + return can_attack_liv(target); + } + mixed do_attack_liv(object target) { return do_attack_lvs(({ target })); } ! mixed do_attack_only_liv(object target){ ! return do_attack_lvs(({ target }), 1); ! } ! ! mixed do_attack_liv_only(object target){ ! return do_attack_lvs(({ target }), 1); ! } ! ! varargs mixed do_attack_lvs(mixed *targets, int exclusive) { ! object *obs, *tmpobs; ! object *noattack; string tmp; + noattack = ({}); + tmpobs = ({}); obs = filter(targets, (: objectp :)); if( !sizeof(obs) ) { ! mixed *ua; ua = unique_array(targets, (: $1 :)); foreach(string *lines in ua) this_player()->eventPrint(lines[0]); return 1; } + if(exclusive){ + foreach(object entity in get_livings(environment(this_player()))){ + if(member_array(entity,obs) == -1) noattack += ({ entity }); + } + if(sizeof(noattack)) this_player()->AddNonTargets(noattack); + } + foreach(object subobj in obs){ + if(member_array(this_player(),subobj->GetEnemies()) != -1){ + write("You are already fighting "+subobj->GetName()+"!"); + } + else tmpobs += ({ subobj }); + } + obs = tmpobs; + if(!sizeof(obs)) return 1; + this_player()->SetAttack(obs); tmp = item_list(obs); obs->eventPrint((string)this_player()->GetName() + " attacks you!"); environment(this_player())->eventPrint((string)this_player()->GetName() + ! " attacks " + tmp + "!", ! ({ this_player(), obs... })); this_player()->eventPrint("You advance towards " + tmp + "."); return 1; } diff -c -r --new-file ds1.1/lib/verbs/players/backstab.c ds2.0r27/lib/verbs/players/backstab.c *** ds1.1/lib/verbs/players/backstab.c Sun Feb 1 21:31:00 1998 --- ds2.0r27/lib/verbs/players/backstab.c Wed Jul 5 00:01:06 2006 *************** *** 12,197 **** inherit LIB_VERB; static void create() { ! verb::create(); ! SetVerb("backstab"); ! SetRules("LIV"); ! SetErrorMessage("Who do you want to backstab?"); ! SetHelp("Syntax: backstab LIVING\n\n" ! "This sneaky attack allows more devious players to " ! "backstab a specified target."); } mixed can_backstab_liv() { if( !environment(this_player()) ) return 0; if( this_player()->GetInCombat() ) ! return "You are too busy with combat!"; ! else return 1; } mixed do_backstab_liv(object ob) { ! object env; ! ! if(!(env = environment(this_player()))) return 0; ! if( (int)this_player()->GetPosition() != POSITION_STANDING ) ! this_player()->eventStand(); ! if(!ob || !present(ob, env)) { ! this_player()->eventPrint("Your hapless victim is no longer present."); return 1; - } - this_player()->eventPrint("%^RED%^You sneak up behind " + ob->GetName() + "...%^RESET%^"); - this_player()->SetAttack(ob, (:eventBackstab, this_player(), ob:)); - return 1; } int eventBackstab(object backstabber, object target) { ! object env; ! float tmp; ! int suprise; ! object *weapons; ! int numberOfWeapons; ! int numberOfStabs; ! int i; ! ! if(!backstabber || !(env = environment(backstabber))) return 0; ! if(!target || !present(target, env)) { ! backstabber->eventPrint("Your hapless victim is no longer present."); ! return 1; ! } ! tmp = backstabber->GetSkillLevel("stealth")*1.5; ! tmp += backstabber->GetStatLevel("charisma")/2.0; ! tmp += backstabber->GetStatLevel("luck")/3.0; ! tmp += backstabber->GetMobility()/3.0; ! tmp -= target->GetStatLevel("luck")/3.0; ! tmp -= target->GetStatLevel("wisdom")/3.0; ! tmp -= target->GetMobility()/5.0; ! tmp *= 1.0; ! if(tmp < 1.0) tmp = 1.0; ! suprise = to_int(tmp); ! ! backstabber->AddSkillPoints("stealth", to_int(suprise * 3.0)); ! backstabber->AddStaminaPoints(-(5 + random(5))); ! moral_act(backstabber, target, -30); ! ! if(suprise < random(100) || !present(target, environment(backstabber))) { ! backstabber->eventPrint("%^RED%^" + target->GetName() ! + " evades your poorly executed backstab.%^RESET%^"); ! target->eventPrint("%^RED%^You easily dodge " + possessive_noun(backstabber) ! + " attempted backstab.%^RESET%^"); ! environment(backstabber)->eventPrint("%^RED%^" + target->GetName() ! + " dodges " + possessive_noun(backstabber) + " attempted backstab.%^RESET%^", ! ({backstabber, target})); return 1; - } - - weapons = backstabber->GetWielded(); - numberOfWeapons = sizeof(weapons); - - if(!numberOfWeapons) { - backstabber->eventPrint("%^RED%^You beat your fists ineffectively on " - + possessive_noun(target) + " back.%^RESET%^"); - target->eventPrint("%^RED%^Somebody beats ineffectively upon your back.%^RESET%^"); - environment(backstabber)->eventPrint("%^RED%^" + backstabber->GetName() - + " backstabs " + target->GetName() + " expertly... unfortunately " - + nominative(backstabber) + " forgot " + possessive(backstabber) + " knives.%^RESET%^", - ({backstabber, target})); - return 1; - } - - numberOfStabs = 0; - for(i = 0; i < numberOfWeapons && target; i++) - numberOfStabs += eventStab(backstabber, target, weapons[i]); - if(!numberOfStabs) { - target->eventPrint("%^RED%^You dodge " + possessive_noun(backstabber) - + " attempted backstab.%^RESET%^"); - return 1; - } - - backstabber->eventExecuteAttack(target); - return 1; } int eventStab(object backstabber, object target, object weapon) { ! string weaponType; ! int damage; ! float x; ! int percentDamage; ! float adjustment; ! int numberWielded; ! ! if(!(weaponType = (string)weapon->GetWeaponType())) return 0; ! numberWielded = sizeof(backstabber->GetWielded()); ! ! x = weapon->GetClass() * 5.0; ! x += backstabber->GetSkillLevel(weaponType + " attack")/1.0; ! x += backstabber->GetStatLevel("strength")/2.0; ! x += backstabber->GetStatLevel("luck")/3.0; ! x += backstabber->GetMobility()/3.0; ! if(numberWielded > 1) { ! adjustment = backstabber->GetSkillLevel("multi-weapon") / (numberWielded / 2.0); ! x *= adjustment/100.0; ! } ! x -= target->GetStatLevel("luck")/3.0; ! x *= 0.5; ! x = (x + random(x)) / 2.0; ! if(weaponType != "knife") x = (x - 50.0) / 4.0; ! if(x < 1.0) x = 0.0; ! ! damage = (int)target->eventReceiveDamage(backstabber, ! weapon->GetDamageType(), to_int(x), 0, target->GetTorso()); ! if(damage > 0) { ! weapon->eventReceiveDamage(BLUNT, damage, 0, target->GetTorso()); ! percentDamage = damage * 100 / target->GetMaxHealthPoints(); ! if(percentDamage < 1) percentDamage = 0; ! } ! else percentDamage = 0; ! eventPrintDamage(backstabber, target, weapon, percentDamage); ! backstabber->AddSkillPoints(weaponType + " attack", 7 + damage/10); ! return 1; } int eventPrintDamage(object backstabber, object target, object weapon, int percentDamage) { ! string adverb; ! string myVerb; ! string verb; ! ! if(!percentDamage) { ! backstabber->eventPrint("%^RED%^You fumble awkwardly with your " ! + strip_article(weapon->GetShort()) + ".%^RESET%^"); ! environment(backstabber)->eventPrint("%^RED%^" + backstabber->GetName() ! + " fumbles awkwardly with " + possessive(backstabber) + " " ! + strip_article(weapon->GetShort()) + ".%^RESET%^", ! ({backstabber, target})); ! return 1; ! } ! if(percentDamage < 15) { ! myVerb = "jab "; ! verb = "jabs "; ! adverb = "sharply "; ! } ! else if(percentDamage < 30) { ! myVerb = "stab "; ! verb = "stabs "; ! adverb = "painfully "; ! } ! else { ! myVerb = "slam "; ! verb = "slams "; ! adverb = "deep "; ! } ! ! backstabber->eventPrint("%^RED%^You " + myVerb + "your " ! + strip_article(weapon->GetShort()) + " " + adverb + "into " ! + possessive_noun(target) + " back.%^RESET%^"); ! target->eventPrint("%^RED%^Your back sears with pain as a " + weapon->GetWeaponType() ! + " " + verb + adverb + "into you.%^RESET%^"); ! environment(backstabber)->eventPrint("%^RED%^" + backstabber->GetName() + " " ! + verb + possessive(backstabber) + " " + strip_article(weapon->GetShort()) ! + " " + adverb + "into " + possessive_noun(target) + " back.%^RESET%^", ! ({backstabber, target})); ! return 1; } --- 12,197 ---- inherit LIB_VERB; static void create() { ! verb::create(); ! SetVerb("backstab"); ! SetRules("LIV"); ! SetErrorMessage("Who do you want to backstab?"); ! SetHelp("Syntax: backstab LIVING\n\n" ! "This sneaky attack allows more devious players to " ! "backstab a specified target."); } mixed can_backstab_liv() { if( !environment(this_player()) ) return 0; if( this_player()->GetInCombat() ) ! return "You are too busy with combat!"; ! else return this_player()->CanManipulate(); } mixed do_backstab_liv(object ob) { ! object env; ! ! if(!(env = environment(this_player()))) return 0; ! if( (int)this_player()->GetPosition() != POSITION_STANDING ) ! this_player()->eventStand(); ! if(!ob || !present(ob, env)) { ! this_player()->eventPrint("Your hapless victim is no longer present."); ! return 1; ! } ! this_player()->eventPrint("%^RED%^You sneak up behind " + ob->GetName() + "...%^RESET%^"); ! this_player()->SetAttack(ob, (:eventBackstab, this_player(), ob:)); return 1; } int eventBackstab(object backstabber, object target) { ! object env; ! float tmp; ! int suprise; ! object *weapons; ! int numberOfWeapons; ! int numberOfStabs; ! int i; ! ! if(!backstabber || !(env = environment(backstabber))) return 0; ! if(!target || !present(target, env)) { ! backstabber->eventPrint("Your hapless victim is no longer present."); ! return 1; ! } ! ! tmp = backstabber->GetSkillLevel("stealth")*1.5; ! tmp += backstabber->GetStatLevel("charisma")/2.0; ! tmp += backstabber->GetStatLevel("luck")/3.0; ! tmp += backstabber->GetMobility()/3.0; ! tmp -= target->GetStatLevel("luck")/3.0; ! tmp -= target->GetStatLevel("wisdom")/3.0; ! tmp -= target->GetMobility()/5.0; ! tmp *= 1.0; ! if(tmp < 1.0) tmp = 1.0; ! suprise = to_int(tmp); ! ! backstabber->AddSkillPoints("stealth", to_int(suprise * 3.0)); ! backstabber->AddStaminaPoints(-(5 + random(5))); ! moral_act(backstabber, target, -30); ! ! if(suprise < random(100) || !present(target, environment(backstabber))) { ! backstabber->eventPrint("%^RED%^" + target->GetName() ! + " evades your poorly executed backstab.%^RESET%^"); ! target->eventPrint("%^RED%^You easily dodge " + possessive_noun(backstabber) ! + " attempted backstab.%^RESET%^"); ! environment(backstabber)->eventPrint("%^RED%^" + target->GetName() ! + " dodges " + possessive_noun(backstabber) + " attempted backstab.%^RESET%^", ! ({backstabber, target})); ! return 1; ! } ! ! weapons = backstabber->GetWielded(); ! numberOfWeapons = sizeof(weapons); ! ! if(!numberOfWeapons) { ! backstabber->eventPrint("%^RED%^You beat your fists ineffectively on " ! + possessive_noun(target) + " back.%^RESET%^"); ! target->eventPrint("%^RED%^Somebody beats ineffectively upon your back.%^RESET%^"); ! environment(backstabber)->eventPrint("%^RED%^" + backstabber->GetName() ! + " backstabs " + target->GetName() + " expertly... unfortunately " ! + nominative(backstabber) + " forgot " + possessive(backstabber) + " knives.%^RESET%^", ! ({backstabber, target})); ! return 1; ! } ! ! numberOfStabs = 0; ! for(i = 0; i < numberOfWeapons && target; i++) ! numberOfStabs += eventStab(backstabber, target, weapons[i]); ! if(!numberOfStabs) { ! target->eventPrint("%^RED%^You dodge " + possessive_noun(backstabber) ! + " attempted backstab.%^RESET%^"); ! return 1; ! } ! backstabber->eventExecuteAttack(target); return 1; } int eventStab(object backstabber, object target, object weapon) { ! string weaponType; ! int damage; ! float x; ! int percentDamage; ! float adjustment; ! int numberWielded; ! ! if(!(weaponType = (string)weapon->GetWeaponType())) return 0; ! numberWielded = sizeof(backstabber->GetWielded()); ! ! x = weapon->GetClass() * 5.0; ! x += backstabber->GetSkillLevel(weaponType + " attack")/1.0; ! x += backstabber->GetStatLevel("strength")/2.0; ! x += backstabber->GetStatLevel("luck")/3.0; ! x += backstabber->GetMobility()/3.0; ! if(numberWielded > 1) { ! adjustment = backstabber->GetSkillLevel("multi-weapon") / (numberWielded / 2.0); ! x *= adjustment/100.0; ! } ! x -= target->GetStatLevel("luck")/3.0; ! x *= 0.5; ! x = (x + random(x)) / 2.0; ! if(weaponType != "knife") x = (x - 50.0) / 4.0; ! if(x < 1.0) x = 0.0; ! ! damage = (int)target->eventReceiveDamage(backstabber, ! weapon->GetDamageType(), to_int(x), 0, target->GetTorso()); ! if(damage > 0) { ! weapon->eventReceiveDamage(BLUNT, damage, 0, target->GetTorso()); ! percentDamage = damage * 100 / target->GetMaxHealthPoints(); ! if(percentDamage < 1) percentDamage = 0; ! } ! else percentDamage = 0; ! eventPrintDamage(backstabber, target, weapon, percentDamage); ! backstabber->AddSkillPoints(weaponType + " attack", 7 + damage/10); ! return 1; } int eventPrintDamage(object backstabber, object target, object weapon, int percentDamage) { ! string adverb; ! string myVerb; ! string verb; ! ! if(!percentDamage) { ! backstabber->eventPrint("%^RED%^You fumble awkwardly with your " ! + strip_article(weapon->GetShort()) + ".%^RESET%^"); ! environment(backstabber)->eventPrint("%^RED%^" + backstabber->GetName() ! + " fumbles awkwardly with " + possessive(backstabber) + " " ! + strip_article(weapon->GetShort()) + ".%^RESET%^", ! ({backstabber, target})); ! return 1; ! } ! ! if(percentDamage < 15) { ! myVerb = "jab "; ! verb = "jabs "; ! adverb = "sharply "; ! } ! else if(percentDamage < 30) { ! myVerb = "stab "; ! verb = "stabs "; ! adverb = "painfully "; ! } ! else { ! myVerb = "slam "; ! verb = "slams "; ! adverb = "deep "; ! } ! backstabber->eventPrint("%^RED%^You " + myVerb + "your " ! + strip_article(weapon->GetShort()) + " " + adverb + "into " ! + possessive_noun(target) + " back.%^RESET%^"); ! target->eventPrint("%^RED%^Your back sears with pain as a " + weapon->GetWeaponType() ! + " " + verb + adverb + "into you.%^RESET%^"); ! environment(backstabber)->eventPrint("%^RED%^" + backstabber->GetName() + " " ! + verb + possessive(backstabber) + " " + strip_article(weapon->GetShort()) ! + " " + adverb + "into " + possessive_noun(target) + " back.%^RESET%^", ! ({backstabber, target})); ! return 1; } diff -c -r --new-file ds1.1/lib/verbs/players/bump.c ds2.0r27/lib/verbs/players/bump.c *** ds1.1/lib/verbs/players/bump.c Sun Feb 1 21:31:00 1998 --- ds2.0r27/lib/verbs/players/bump.c Wed Jul 5 00:01:06 2006 *************** *** 2,148 **** * Allows players to possibly bump a target into another room * created by Blitz@Dead Souls */ ! #pragma save_binary #include <lib.h> #include <damage_types.h> #include "include/bump.h" ! inherit LIB_VERB; ! static void create() { verb::create(); SetVerb("bump"); SetRules("LIV"); SetErrorMessage("Whom would you like to bump?"); SetHelp( "Syntax: bump LIV\n\n" ! "This command allows you bump the living object named " ! "into an adjacent room. It is quite possible that " ! "bumping may cause you bodily injury."); } ! mixed can_bump_liv() { object env = environment(this_player()); ! if( !env ) return "You are nowhere!"; if( env->GetProperty("no bump") ) ! return "Mystical forces prevent your pushy actions."; return 1; } mixed do_bump_liv(object ob) { ! int Strength, TargetStrength; ! string *Exits; ! string NewLocation, OldLocation; ! mixed var; ! object env; ! ! if( !ob ) return 0; ! if( !(env = environment(ob)) ) return 0; ! if( (int)ob->GetProperty("no bump") ) { ! message("my_action", "You try to bump "+ ! (string)ob->GetCapName()+".", ! this_player() ); ! message("other_action", (string)this_player()->GetCapName()+" tries " ! "to bump "+(string)ob->GetCapName()+".", ! environment(ob), ({ ob, this_player() }) ); ! message("other_action", (string)this_player()->GetCapName()+" tries " ! "to bump you.", ! ob); ! if( !playerp(ob) ) ! ob->eventForce("growl "+(string)this_player()->GetKeyName()); ! return 1; ! } ! if( var = ob->eventBump(this_player()) ) return var; ! this_player()->AddStaminaPoints( -(random(15) + 3) ); ! if( ( (int)ob->GetStatLevel("agility") / 2 ) > ( (int)this_player()->GetStatLevel("strength")) ) { ! message("my_action", "You deftly sidestep "+ ! possessive_noun((string)this_player()->GetCapName())+" attempt " ! "to bump you.", ! ob); ! message("other_action", (string)ob->GetCapName()+" deftly sidesteps " ! "your attempt to bump "+objective(ob)+".", ! this_player() ); ! message("other_action", (string)ob->GetCapName()+" deftly sidesteps "+ ! possessive_noun((string)this_player()->GetCapName())+" attempt " ! "to bump "+objective(ob)+".", ! env, ({ this_player(), ob })); ! return 1; ! } ! Strength = (int)this_player()->GetStatLevel("strength") + ! random((int)this_player()->GetStatLevel("speed") / 2); ! TargetStrength = (int)ob->GetStatLevel("strength") + ! random( (int)ob->GetStatLevel("agility") / 2 ); ! if( (Strength - TargetStrength) < -10 ) { ! this_player()->eventReceiveDamage(ob, BLUNT, random(5) + 1); ! message("other_action", (string)ob->GetCapName()+" shoves you " ! "to the ground!", ! this_player() ); ! message("my_action", (string)this_player()->GetCapName()+" is shoved " ! "to the ground while trying to bump you.", ! ob); ! message("other_action", (string)this_player()->GetCapName()+" is shoved " ! "to the ground while trying to bump "+(string)ob->GetCapName()+".", ! env, ({ ob, this_player() }) ); ! return 1; ! } ! else if( (Strength - TargetStrength) < (5 + random(20)) ) { ! this_player()->eventReceiveDamage(ob, BLUNT, random(3) + 1); ! message("my_action", "You fail to bump "+(string)ob->GetCapName()+" out " ! "of the way.", this_player() ); ! message("other_action", (string)this_player()->GetCapName()+" fails in " ! "an attempt to bump you.", ! ob); ! message("other_action", (string)this_player()->GetCapName()+" fails in " ! "an attempt to bump "+(string)ob->GetCapName()+".", ! environment(ob), ({ ob, this_player() }) ); ! return 1; ! } else { ! this_player()->AddStatPoints("strength", random(5)); ! Exits = (string *)env->GetExits(); ! Exits = filter(Exits, ! (: !(object)$(env)->GetDoor($1) || ! !(object)$(env)->GetDoor($1)->GetClosed() :) ); ! if( !sizeof(Exits) ) { ! message("system", "There is nowhere for "+(string)ob->GetCapName() ! +" to go!", this_player() ); ! return 1; } ! NewLocation = Exits[ random(sizeof(Exits)) ]; ! NewLocation = environment(ob)->GetExit(NewLocation); ! OldLocation = base_name(environment(ob)); ! message("my_action", "You shove "+(string)ob->GetCapName()+" out " ! "of the way!", ! this_player() ); ! message("other_action", "You are shoved out of the way by "+ ! (string)this_player()->GetCapName()+"!", ! ob); ! message("other_action", (string)this_player()->GetCapName()+" shoves "+ ! (string)ob->GetCapName()+" out of the way!", ! environment(ob), ({ ob, this_player() }) ); ! if( !(int)ob->eventMove(NewLocation) ) { ! message("other_action", (string)ob->GetCapName()+" is bounced " ! "back into the room.", environment(ob), ob); ! message("my_action", "You are bounced back to your original " ! "location.", ! ob); } else { ! ob->eventDescribeEnvironment(0); ! if( !userp(ob) ) ! call_out((: MoveBack :), 12 + random(6), ob, OldLocation); } ! if( (int)ob->GetHealthPoints() > 5 ) ! ob->eventReceiveDamage(this_player(), BLUNT, random(5)); ! return 1; ! } ! return 0; } ! void MoveBack(object ob, string where) { ! if( !ob ) return; ! ob->eventMoveLiving(where, "$N leaves angrily", "$N enters angrily"); ! ob->eventForce("growl"); } ! --- 2,148 ---- * Allows players to possibly bump a target into another room * created by Blitz@Dead Souls */ ! #pragma save_binary #include <lib.h> #include <damage_types.h> #include "include/bump.h" ! inherit LIB_VERB; ! static void create() { verb::create(); SetVerb("bump"); SetRules("LIV"); SetErrorMessage("Whom would you like to bump?"); SetHelp( "Syntax: bump LIV\n\n" ! "This command allows you bump the living object named " ! "into an adjacent room. It is quite possible that " ! "bumping may cause you bodily injury."); } ! mixed can_bump_liv() { object env = environment(this_player()); ! if( !env ) return "You are nowhere!"; if( env->GetProperty("no bump") ) ! return "Mystical forces prevent your pushy actions."; return 1; } mixed do_bump_liv(object ob) { ! int Strength, TargetStrength; ! string *Exits; ! string NewLocation, OldLocation; ! mixed var; ! object env; ! ! if( !ob ) return 0; ! if( !(env = environment(ob)) ) return 0; ! if( (int)ob->GetProperty("no bump") ) { ! message("my_action", "You try to bump "+ ! (string)ob->GetCapName()+".", ! this_player() ); ! message("other_action", (string)this_player()->GetCapName()+" tries " ! "to bump "+(string)ob->GetCapName()+".", ! environment(ob), ({ ob, this_player() }) ); ! message("other_action", (string)this_player()->GetCapName()+" tries " ! "to bump you.", ! ob); ! if( !playerp(ob) ) ! ob->eventForce("growl "+(string)this_player()->GetKeyName()); ! return 1; ! } ! if( var = ob->eventBump(this_player()) ) return var; ! this_player()->AddStaminaPoints( -(random(15) + 3) ); ! if( ( (int)ob->GetStatLevel("agility") / 2 ) > ( (int)this_player()->GetStatLevel("strength")) ) { ! message("my_action", "You deftly sidestep "+ ! possessive_noun((string)this_player()->GetCapName())+" attempt " ! "to bump you.", ! ob); ! message("other_action", (string)ob->GetCapName()+" deftly sidesteps " ! "your attempt to bump "+objective(ob)+".", ! this_player() ); ! message("other_action", (string)ob->GetCapName()+" deftly sidesteps "+ ! possessive_noun((string)this_player()->GetCapName())+" attempt " ! "to bump "+objective(ob)+".", ! env, ({ this_player(), ob })); ! return 1; ! } ! Strength = (int)this_player()->GetStatLevel("strength") + ! random((int)this_player()->GetStatLevel("speed") / 2); ! TargetStrength = (int)ob->GetStatLevel("strength") + ! random( (int)ob->GetStatLevel("agility") / 2 ); ! if( (Strength - TargetStrength) < -10 ) { ! this_player()->eventReceiveDamage(ob, BLUNT, random(5) + 1); ! message("other_action", (string)ob->GetCapName()+" shoves you " ! "to the ground!", ! this_player() ); ! message("my_action", (string)this_player()->GetCapName()+" is shoved " ! "to the ground while trying to bump you.", ! ob); ! message("other_action", (string)this_player()->GetCapName()+" is shoved " ! "to the ground while trying to bump "+(string)ob->GetCapName()+".", ! env, ({ ob, this_player() }) ); ! return 1; } ! else if( (Strength - TargetStrength) < (5 + random(20)) ) { ! this_player()->eventReceiveDamage(ob, BLUNT, random(3) + 1); ! message("my_action", "You fail to bump "+(string)ob->GetCapName()+" out " ! "of the way.", this_player() ); ! message("other_action", (string)this_player()->GetCapName()+" fails in " ! "an attempt to bump you.", ! ob); ! message("other_action", (string)this_player()->GetCapName()+" fails in " ! "an attempt to bump "+(string)ob->GetCapName()+".", ! environment(ob), ({ ob, this_player() }) ); ! return 1; } else { ! this_player()->AddStatPoints("strength", random(5)); ! Exits = (string *)env->GetExits(); ! Exits = filter(Exits, ! (: !(object)$(env)->GetDoor($1) || ! !(object)$(env)->GetDoor($1)->GetClosed() :) ); ! if( !sizeof(Exits) ) { ! message("system", "There is nowhere for "+(string)ob->GetCapName() ! +" to go!", this_player() ); ! return 1; ! } ! NewLocation = Exits[ random(sizeof(Exits)) ]; ! NewLocation = environment(ob)->GetExit(NewLocation); ! OldLocation = base_name(environment(ob)); ! message("my_action", "You shove "+(string)ob->GetCapName()+" out " ! "of the way!", ! this_player() ); ! message("other_action", "You are shoved out of the way by "+ ! (string)this_player()->GetCapName()+"!", ! ob); ! message("other_action", (string)this_player()->GetCapName()+" shoves "+ ! (string)ob->GetCapName()+" out of the way!", ! environment(ob), ({ ob, this_player() }) ); ! if( !(int)ob->eventMove(NewLocation) ) { ! message("other_action", (string)ob->GetCapName()+" is bounced " ! "back into the room.", environment(ob), ob); ! message("my_action", "You are bounced back to your original " ! "location.", ! ob); ! } else { ! ob->eventDescribeEnvironment(0); ! if( !userp(ob) ) ! call_out((: MoveBack :), 12 + random(6), ob, OldLocation); ! } ! if( (int)ob->GetHealthPoints() > 5 ) ! ob->eventReceiveDamage(this_player(), BLUNT, random(5)); ! return 1; } ! return 0; } ! void MoveBack(object ob, string where) { ! if( !ob ) return; ! ob->eventMoveLiving(where, "$N leaves angrily", "$N enters angrily"); ! ob->eventForce("growl"); } ! diff -c -r --new-file ds1.1/lib/verbs/players/cast.c ds2.0r27/lib/verbs/players/cast.c *** ds1.1/lib/verbs/players/cast.c Sun Feb 1 21:31:00 1998 --- ds2.0r27/lib/verbs/players/cast.c Wed Jul 5 00:01:06 2006 *************** *** 14,29 **** verb::create(); SetVerb("cast"); SetRules("STR", "STR on OBJ", "STR on STR", "STR on STR of OBJ", ! "STR against STR"); SetErrorMessage("Cast what spell? On whom?"); SetHelp("Syntax: <cast SPELL>\n" ! " <cast SPELL on LIMB>\n" ! " <cast SPELL against STRING>\n" ! " <cast SPELL on TARGET>\n" ! " <cast SPELL on LIMB of TARGET>\n\n" ! "Allows you to cast any spell using whatever syntax the " ! "spell in question requires. To heal someone, for example, " ! "\"cast heal on descartes\"."); } mixed can_cast_str(string spell) { --- 14,29 ---- verb::create(); SetVerb("cast"); SetRules("STR", "STR on OBJ", "STR on STR", "STR on STR of OBJ", ! "STR against STR"); SetErrorMessage("Cast what spell? On whom?"); SetHelp("Syntax: <cast SPELL>\n" ! " <cast SPELL on LIMB>\n" ! " <cast SPELL against STRING>\n" ! " <cast SPELL on TARGET>\n" ! " <cast SPELL on LIMB of TARGET>\n\n" ! "Allows you to cast any spell using whatever syntax the " ! "spell in question requires. To heal someone, for example, " ! "\"cast heal on descartes\"."); } mixed can_cast_str(string spell) { *************** *** 36,42 **** return "That is not a spell you cast."; } } ! return this_player()->CanCast(tmp); } mixed can_cast_str_on_obj(string spell) { --- 36,42 ---- return "That is not a spell you cast."; } } ! if(intp(this_player()->CanManipulate())) return this_player()->CanCast(tmp); } mixed can_cast_str_on_obj(string spell) { diff -c -r --new-file ds1.1/lib/verbs/players/crawl.c ds2.0r27/lib/verbs/players/crawl.c *** ds1.1/lib/verbs/players/crawl.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/verbs/players/crawl.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,59 ---- + #pragma save_binary + + #include <lib.h> + #include <position.h> + //#include "include/crawl.h" + + inherit LIB_VERB; + + static void create() { + verb::create(); + SetVerb("crawl"); + SetRules("STR", "into STR"); + SetErrorMessage("Crawl in which direction?"); + SetHelp("Syntax: <crawl DIRECTION>\n" + " <crawl into PLACE>\n\n" + "Moves you towards the direction you specify, or into the place " + "you specify. The command \"crawl into\" is synonymous with the " + "\"enter\" command."); + } + + + mixed can_crawl_str(string str) { + if( !environment(this_player()) ) return "You are nowhere."; + if( (int)this_player()->GetStaminaPoints() <3 ) + return "You are too tired to crawl anywhere right now."; + if(this_player()->GetPosition() != POSITION_LYING && + this_player()->GetPosition() != POSITION_SITTING){ + return "You can't crawl in your current position."; + } + return 1; + } + + mixed can_crawl_into_str(string str) { + if( !environment(this_player()) ) return "You are nowhere."; + if( (int)this_player()->GetStaminaPoints() <3 ) + return "You are too tired right now."; + if(this_player()->GetPosition() != POSITION_LYING && + this_player()->GetPosition() != POSITION_SITTING){ + return "You can't crawl in your current position."; + } + return 1; + } + + mixed do_crawl_str(string str) { + this_player()->AddStaminaPoints(-5); + (mixed)environment(this_player())->eventGo(this_player(), str); + return 1; + } + + mixed do_crawl_into_str(string str) { + object targ; + str = remove_article(lower_case(str)); + targ = present(str,environment(this_player())); + if(!targ) targ = present(str,this_player()); + if(!targ) return "That's not possible."; + this_player()->AddStaminaPoints(-5); + return targ->eventEnter(this_player(), str,"crawl"); + } + // diff -c -r --new-file ds1.1/lib/verbs/players/describe.c ds2.0r27/lib/verbs/players/describe.c *** ds1.1/lib/verbs/players/describe.c Sun Feb 1 21:31:01 1998 --- ds2.0r27/lib/verbs/players/describe.c Wed Jul 5 00:01:06 2006 *************** *** 15,40 **** SetRules("LIV"); SetErrorMessage("Describe syntax: describe <message>"); SetHelp("Syntax: describe MESSAGE\n" ! "\n" ! "Provides a player with a description. You must include " ! "an instance of $N at least once in your description to " ! "denote your name. Example: If I typed 'describe $N is " ! "nondescript.', my description would be 'Rush is " ! "nondescript.'\n"); parse_add_rule("describe", "STR"); } mixed can_describe_str(string str) { ! if(strsrch(str, "$N") == -1) ! return("Your description must include a minimum of one '$N' " ! + "to specify your name."); ! return 1; } mixed do_describe_str(string str) { ! this_player()->SetLong(str); ! write("Ok."); ! return 1; } --- 15,40 ---- SetRules("LIV"); SetErrorMessage("Describe syntax: describe <message>"); SetHelp("Syntax: describe MESSAGE\n" ! "\n" ! "Provides a player with a description. You must include " ! "an instance of $N at least once in your description to " ! "denote your name. Example: If I typed 'describe $N is " ! "nondescript.', my description would be 'Rush is " ! "nondescript.'\n"); parse_add_rule("describe", "STR"); } mixed can_describe_str(string str) { ! if(strsrch(str, "$N") == -1) ! return("Your description must include a minimum of one '$N' " ! + "to specify your name."); ! return 1; } mixed do_describe_str(string str) { ! this_player()->SetLong(str); ! write("Ok."); ! return 1; } diff -c -r --new-file ds1.1/lib/verbs/players/evade.c ds2.0r27/lib/verbs/players/evade.c *** ds1.1/lib/verbs/players/evade.c Sun Feb 1 21:31:01 1998 --- ds2.0r27/lib/verbs/players/evade.c Wed Jul 5 00:01:06 2006 *************** *** 10,34 **** inherit LIB_VERB; static void create() { ! verb::create(); ! SetVerb("evade"); ! SetRules("LIV"); ! SetErrorMessage("Who are you trying to evade?"); ! SetHelp("Syntax: evade LIVING\n" ! "\n" ! "Allows one to attempt to evade a living being " ! "who is currently following.\n" ! "\n" ! "See also: follow, lead, tracking, stealth\n"); } mixed can_evade_liv() { return 1; } mixed do_evade_liv(object ob) { ! if(!this_player()->SetAllowed(ob, 0)) ! this_player()->eventPrint("You are now evading " + ob->GetName() + "."); ! else this_player()->eventPrint("You are not empowered to evade " + ob->GetName() + "."); ! return 1; } --- 10,34 ---- inherit LIB_VERB; static void create() { ! verb::create(); ! SetVerb("evade"); ! SetRules("LIV"); ! SetErrorMessage("Who are you trying to evade?"); ! SetHelp("Syntax: evade LIVING\n" ! "\n" ! "Allows one to attempt to evade a living being " ! "who is currently following.\n" ! "\n" ! "See also: follow, lead, tracking, stealth\n"); } mixed can_evade_liv() { return 1; } mixed do_evade_liv(object ob) { ! if(!this_player()->SetAllowed(ob, 0)) ! this_player()->eventPrint("You are now evading " + ob->GetName() + "."); ! else this_player()->eventPrint("You are not empowered to evade " + ob->GetName() + "."); ! return 1; } diff -c -r --new-file ds1.1/lib/verbs/players/follow.c ds2.0r27/lib/verbs/players/follow.c *** ds1.1/lib/verbs/players/follow.c Sun Feb 1 21:31:01 1998 --- ds2.0r27/lib/verbs/players/follow.c Wed Jul 5 00:01:06 2006 *************** *** 10,91 **** inherit LIB_VERB; static void create() { ! ::create(); ! SetVerb("follow"); ! SetRules("", "LIV"); ! SetErrorMessage("Who would you like to follow?"); ! SetHelp("Syntax: follow\n" ! " follow LIV\n" ! "\n" ! "If a living object is specified, this command allows " ! "you to begin trailing the living being as it moves " ! "through Dead Souls.\n" ! "Otherwise, your following status is reported.\n" ! "\n" ! "See also: evade, lead, tracking, stealth\n"); } mixed can_follow() { return 1; } mixed do_follow() { ! object* followers; ! string* obs; ! object leader; ! int size; ! string tmp; ! ! // Format follow string. ! if(this_player()->CanLead() && leader = this_player()->GetLeader()) { ! tmp = "You are "; ! if(leader->GetAllowed(this_player())) tmp += "following"; ! else tmp += "trailing"; ! tmp += " " + leader->GetName() + ".\n"; ! } ! else tmp = "You are trailing no one." + "\n"; ! ! // Get the followers. ! followers = this_player()->GetFollowers(); ! if(!followers) followers = ({}); ! ! // Format lead string. ! tmp += "You are leading "; ! obs = map( ! filter(followers, (:this_player()->GetAllowed($1):)), ! (:$1->GetName():)); ! size = sizeof(obs); ! if(size) tmp += conjunction(obs); ! else tmp += "no one"; ! tmp += ".\n"; ! ! // Format evasion string. ! tmp += "You are evading "; ! obs = map( ! filter(followers, (:!this_player()->GetAllowed($1):)), ! (:$1->GetName():)); ! size = sizeof(obs); ! if(size) tmp += conjunction(obs); ! else tmp += "no one"; ! tmp += ".\n"; ! this_player()->eventPrint(tmp); ! return 1; } mixed can_follow_liv() { return 1; } mixed do_follow_liv(object ob) { ! object leader; ! if(leader = this_player()->GetLeader()) { ! leader->RemoveFollower(this_player()); ! this_player()->eventPrint("You stop trailing " + leader->GetName() + "."); ! } ! ! if(member_array(this_player(), ob->AddFollower(this_player())) == -1) ! this_player()->eventPrint("You are not empowered to follow " + ob->GetName() + "."); ! else this_player()->eventPrint("You are now trailing " + ob->GetName() + "."); ! return 1; } --- 10,94 ---- inherit LIB_VERB; static void create() { ! ::create(); ! SetVerb("follow"); ! SetRules("", "LIV"); ! SetErrorMessage("Who would you like to follow?"); ! SetHelp("Syntax: follow\n" ! " follow LIV\n" ! "\n" ! "If a living object is specified, this command allows " ! "you to begin trailing the living being as it moves " ! "through Dead Souls.\n" ! "Otherwise, your following status is reported.\n" ! "If the living being is interested in having you " ! "follow them, they can issue the \"lead\" command " ! "in order to avoid accidentally evading you.\n" ! "\n" ! "See also: evade, lead, tracking, stealth\n"); } mixed can_follow() { return 1; } mixed do_follow() { ! object* followers; ! string* obs; ! object leader; ! int size; ! string tmp; ! ! // Format follow string. ! if(this_player()->CanLead() && leader = this_player()->GetLeader()) { ! tmp = "You are "; ! if(leader->GetAllowed(this_player())) tmp += "following"; ! else tmp += "trailing"; ! tmp += " " + leader->GetName() + ".\n"; ! } ! else tmp = "You are trailing no one." + "\n"; ! ! // Get the followers. ! followers = this_player()->GetFollowers(); ! if(!followers) followers = ({}); ! ! // Format lead string. ! tmp += "You are leading "; ! obs = map( ! filter(followers, (:this_player()->GetAllowed($1):)), ! (:$1->GetName():)); ! size = sizeof(obs); ! if(size) tmp += conjunction(obs); ! else tmp += "no one"; ! tmp += ".\n"; ! ! // Format evasion string. ! tmp += "You are evading "; ! obs = map( ! filter(followers, (:!this_player()->GetAllowed($1):)), ! (:$1->GetName():)); ! size = sizeof(obs); ! if(size) tmp += conjunction(obs); ! else tmp += "no one"; ! tmp += ".\n"; ! this_player()->eventPrint(tmp); ! return 1; } mixed can_follow_liv() { return 1; } mixed do_follow_liv(object ob) { ! object leader; ! if(leader = this_player()->GetLeader()) { ! leader->RemoveFollower(this_player()); ! this_player()->eventPrint("You stop trailing " + leader->GetName() + "."); ! } ! ! if(member_array(this_player(), ob->AddFollower(this_player())) == -1) ! this_player()->eventPrint("You are not empowered to follow " + ob->GetName() + "."); ! else this_player()->eventPrint("You are now trailing " + ob->GetName() + "."); ! return 1; } diff -c -r --new-file ds1.1/lib/verbs/players/ignore.c ds2.0r27/lib/verbs/players/ignore.c *** ds1.1/lib/verbs/players/ignore.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/verbs/players/ignore.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,74 ---- + #pragma save_binary + + #include <lib.h> + + inherit LIB_VERB; + + static void create() { + verb::create(); + SetVerb("ignore"); + SetRules("LVS",""); + SetErrorMessage("Whom are you trying to ignore?"); + SetHelp("Syntax: <ignore LIVING>\n" + " <ignore all>\n" + "\n" + "Allows one to stop attacking a living being " + "or beings. Helpful for not wasting time on the " + "wrong targets.\n\n" + "See also: attack\n"); + } + + mixed can_ignore(){ return 1; } + + mixed can_ignore_liv() { return 1; } + + mixed do_ignore(){ + if(sizeof(this_player()->GetNonTargets())){ + string tmp; + tmp = item_list(this_player()->GetNonTargets()); + this_player()->eventPrint("You are ignoring " + tmp + "."); + return 1; + } + else { + this_player()->eventPrint("Ignore whom?"); + return 0; + } + } + + mixed do_ignore_liv(object ob) { + this_player()->AddNonTargets(ob); + if(member_array(ob,this_player()->GetNonTargets()) != -1){ + + this_player()->eventPrint("You are now ignoring " + ob->GetName() + "."); + ob->eventPrint((string)this_player()->GetName() + " ignores you!"); + environment(this_player())->eventPrint((string)this_player()->GetName() + + " ignores " + ob->GetName() + "!", + ({ this_player(), ob })); + } + else this_player()->eventPrint("You are unable to ignore " + ob->GetName() + "."); + return 1; + } + + mixed do_ignore_lvs(mixed *targets) { + object *obs; + string tmp; + + obs = filter(targets, (: objectp :)); + if( !sizeof(obs) ) { + mixed *ua; + + ua = unique_array(targets, (: $1 :)); + foreach(string *lines in ua) this_player()->eventPrint(lines[0]); + return 1; + } + if(member_array(this_player(),obs) != -1) obs -= ({ this_player() }); + this_player()->AddNonTargets(obs); + tmp = item_list(obs); + obs->eventPrint((string)this_player()->GetName() + " ignores you!"); + environment(this_player())->eventPrint((string)this_player()->GetName() + + " ignores" + tmp + "!", + ({ this_player(), obs... })); + this_player()->eventPrint("You ignore " + tmp + "."); + return 1; + } + diff -c -r --new-file ds1.1/lib/verbs/players/include/attack.h ds2.0r27/lib/verbs/players/include/attack.h *** ds1.1/lib/verbs/players/include/attack.h Sun Feb 1 21:30:59 1998 --- ds2.0r27/lib/verbs/players/include/attack.h Wed Jul 5 00:01:12 2006 *************** *** 6,11 **** mixed can_attack_liv(object target); mixed do_attack_liv(object target); ! mixed do_attack_lvs(mixed *targets); #endif /* l_attack_h */ --- 6,11 ---- mixed can_attack_liv(object target); mixed do_attack_liv(object target); ! varargs mixed do_attack_lvs(mixed *targets, int exclusive); #endif /* l_attack_h */ diff -c -r --new-file ds1.1/lib/verbs/players/include/crawl.h ds2.0r27/lib/verbs/players/include/crawl.h *** ds1.1/lib/verbs/players/include/crawl.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/verbs/players/include/crawl.h Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,12 ---- + #ifndef l_crawl_h + #define l_crawl_h + + static void create(); + + mixed can_crawl_str(string str); + mixed can_crawl_into_str(string str); + + mixed do_crawl_str(string str); + mixed do_crawl_into_str(string str); + + #endif /* l_crawl_h */ diff -c -r --new-file ds1.1/lib/verbs/players/include/target.h ds2.0r27/lib/verbs/players/include/target.h *** ds1.1/lib/verbs/players/include/target.h Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/verbs/players/include/target.h Wed Jul 5 00:01:12 2006 *************** *** 0 **** --- 1,11 ---- + #ifndef l_target_h + #define l_target_h + + static void create(); + + mixed can_target_liv(object target); + + mixed do_target_liv(object target); + varargs mixed do_target_lvs(mixed *targets, int exclusive); + + #endif /* l_target_h */ diff -c -r --new-file ds1.1/lib/verbs/players/lead.c ds2.0r27/lib/verbs/players/lead.c *** ds1.1/lib/verbs/players/lead.c Sun Feb 1 21:31:01 1998 --- ds2.0r27/lib/verbs/players/lead.c Wed Jul 5 00:01:06 2006 *************** *** 10,40 **** inherit LIB_VERB; static void create() { ! verb::create(); ! SetVerb("lead"); ! SetRules("LIV"); ! SetErrorMessage("Who would you like to lead?"); ! SetHelp("Syntax: lead LIVING\n" ! "\n" ! "Allows one to assist a living being who is " ! "attempting to follow.\n" ! "\n" ! "See also: evade, follow, tracking, stealth\n"); } mixed can_lead_liv() { return 1; } mixed do_lead_liv(object ob) { ! if(!ob->IsFollowing(this_player())) { ! this_player()->eventPrint(ob->GetName() + " is not following you."); return 1; - } - if( this_player()->SetAllowed(ob, 1) ) { - ob->eventPrint((string)this_player()->GetName() + " is now leading you."); - this_player()->eventPrint("You are now leading " + ob->GetName() + "."); - } - else this_player()->eventPrint("You are not empowered to lead " + ob->GetName() + "."); - return 1; } --- 10,40 ---- inherit LIB_VERB; static void create() { ! verb::create(); ! SetVerb("lead"); ! SetRules("LIV"); ! SetErrorMessage("Who would you like to lead?"); ! SetHelp("Syntax: lead LIVING\n" ! "\n" ! "Allows one to assist a living being who is " ! "attempting to follow.\n" ! "\n" ! "See also: evade, follow, tracking, stealth\n"); } mixed can_lead_liv() { return 1; } mixed do_lead_liv(object ob) { ! if(!ob->IsFollowing(this_player())) { ! this_player()->eventPrint(ob->GetName() + " is not following you."); ! return 1; ! } ! if( this_player()->SetFollowed(ob, 1) ) { ! ob->eventPrint((string)this_player()->GetName() + " is now leading you."); ! this_player()->eventPrint("You are now leading " + ob->GetName() + "."); ! } ! else this_player()->eventPrint("You are not empowered to lead " + ob->GetName() + "."); return 1; } diff -c -r --new-file ds1.1/lib/verbs/players/lie.c ds2.0r27/lib/verbs/players/lie.c *** ds1.1/lib/verbs/players/lie.c Sun Feb 1 21:31:00 1998 --- ds2.0r27/lib/verbs/players/lie.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/players/lie.c ! * from the Dead Souls V Object Library * created by Descartes of Borg 960711 * Version: @(#) lie.c 1.4@(#) * Last Modified: 96/12/21 --- 1,5 ---- /* /verbs/players/lie.c ! * from the Dead Souls Object Library * created by Descartes of Borg 960711 * Version: @(#) lie.c 1.4@(#) * Last Modified: 96/12/21 *************** *** 18,35 **** SetErrorMessage("Lie down?"); SetSynonyms("lay"); SetHelp("Syntax: <lie down>\n" ! " <lie down in OBJECT>\n\n" ! "Allows you to lie down on the ground or in a bed. " ! "It can be really exciting.\n\n" ! "Synonyms: lay (bad english)\n\n" ! "See also: sit, stand"); } mixed can_lie_down() { if( this_player()->GetParalyzed() ) { return "You cannot do anything."; } ! if( this_player()->GetPosition() != POSITION_STANDING ) { return "You are already lying down!"; } return 1; --- 18,35 ---- SetErrorMessage("Lie down?"); SetSynonyms("lay"); SetHelp("Syntax: <lie down>\n" ! " <lie down in OBJECT>\n\n" ! "Allows you to lie down on the ground or in a bed. " ! "It can be really exciting.\n\n" ! "Synonyms: lay (bad english)\n\n" ! "See also: sit, stand"); } mixed can_lie_down() { if( this_player()->GetParalyzed() ) { return "You cannot do anything."; } ! if( this_player()->GetPosition() == POSITION_LYING ) { return "You are already lying down!"; } return 1; diff -c -r --new-file ds1.1/lib/verbs/players/marry.c ds2.0r27/lib/verbs/players/marry.c *** ds1.1/lib/verbs/players/marry.c Sun Feb 1 21:31:00 1998 --- ds2.0r27/lib/verbs/players/marry.c Wed Jul 5 00:01:06 2006 *************** *** 19,54 **** SetRules("LIV to LIV"); SetErrorMessage("Marry whom to whom?"); SetHelp("Syntax: <marry PLAYER to PLAYER>\n\n" ! "Allows people of great faith to join to souls in marriage. " ! "In order to marry to people, you must however be in a place " ! "which you find holy.\n\n" ! "See also: divorce"); } mixed can_marry_liv_to_liv() { ! mixed tmp; ! ! if( (int)this_player()->GetSkillLevel("faith") < 15 ) ! return "You do not have enough faith to join to people."; return 1;; } mixed do_marry_liv_to_liv(object spouse1, object spouse2) { mixed tmp; if( this_player() == spouse1 || this_player() == spouse2 ) ! return "You may not perform a marriage on yourself."; tmp = (mixed)environment(this_player())->CanMarry(this_player(), ! spouse1, spouse2); if( !tmp ) { ! this_player()->eventPrint("This place is not holy to you."); ! return 1; } ! else if( stringp(tmp) ) { ! this_player()->eventPrint(tmp); ! return 1; } tmp = (mixed)environment(this_player())->eventMarry(this_player(), ! spouse1, spouse2); if( tmp == 1 ) { object ring; --- 19,53 ---- SetRules("LIV to LIV"); SetErrorMessage("Marry whom to whom?"); SetHelp("Syntax: <marry PLAYER to PLAYER>\n\n" ! "Allows people of great faith to join to souls in marriage. " ! "In order to marry to people, you must however be in a place " ! "which you find holy.\n\n" ! "See also: divorce"); } mixed can_marry_liv_to_liv() { ! ! if( (int)this_player()->GetSkillLevel("faith") < 5 ) ! return "You do not have enough faith to join to people."; return 1;; } mixed do_marry_liv_to_liv(object spouse1, object spouse2) { mixed tmp; if( this_player() == spouse1 || this_player() == spouse2 ) ! return "You may not perform a marriage on yourself."; tmp = (mixed)environment(this_player())->CanMarry(this_player(), ! spouse1, spouse2); if( !tmp ) { ! this_player()->eventPrint("This place is not holy to you."); ! return 1; } ! else if( stringp(tmp) ) { ! this_player()->eventPrint(tmp); ! return 1; } tmp = (mixed)environment(this_player())->eventMarry(this_player(), ! spouse1, spouse2); if( tmp == 1 ) { object ring; diff -c -r --new-file ds1.1/lib/verbs/players/news.c ds2.0r27/lib/verbs/players/news.c *** ds1.1/lib/verbs/players/news.c Sun Feb 1 21:31:01 1998 --- ds2.0r27/lib/verbs/players/news.c Wed Jul 5 00:01:06 2006 *************** *** 10,40 **** inherit LIB_VERB; static void create() { ! ::create(); ! SetVerb("news"); ! SetRules("", "STR"); ! SetErrorMessage("See \"help news\" for more info on this command."); ! SetHelp("Syntax: news [<classname>|general]\n" ! "\n" ! "This command allows you to replay the login news."); } mixed can_news() { return can_news_str("general"); } mixed can_news_str(string str) { ! if(!str) return 0; ! if(!file_exists(DIR_NEWS + "/" + str)) return "No " + str + " news."; ! if(str == "general" || this_player()->ClassMember(str)) return 1; ! if(str == "creator" && creatorp(this_player())) return 1; ! if(archp(this_player())) return 1; ! return "The " + str + " news is not for to your eyes."; } mixed do_news() { return do_news_str("general"); } mixed do_news_str(string str) { ! this_player()->eventPage(DIR_NEWS + "/" + str); ! return 1; } --- 10,41 ---- inherit LIB_VERB; static void create() { ! ::create(); ! SetVerb("news"); ! SetRules("", "STR"); ! SetErrorMessage("See \"help news\" for more info on this command."); ! SetHelp("Syntax: news [<classname>|general]\n" ! "\n" ! "This command allows you to replay the login news."); } mixed can_news() { return can_news_str("general"); } mixed can_news_str(string str) { ! if(!str) return 0; ! if(!file_exists(DIR_NEWS + "/" + str)) return "No " + str + " news."; ! if(str == "general" || this_player()->ClassMember(str)) return 1; ! if(str == "creator" && creatorp(this_player())) return 1; ! if(archp(this_player())) return 1; ! return "The " + str + " news is not for to your eyes."; } mixed do_news() { return do_news_str("general"); } mixed do_news_str(string str) { ! //tc("The moops."); ! this_player()->eventPage(DIR_NEWS + "/" + str); ! return 1; } diff -c -r --new-file ds1.1/lib/verbs/players/nominate.c ds2.0r27/lib/verbs/players/nominate.c *** ds1.1/lib/verbs/players/nominate.c Sun Feb 1 21:31:00 1998 --- ds2.0r27/lib/verbs/players/nominate.c Wed Jul 5 00:01:06 2006 *************** *** 18,24 **** SetRules("STR"); SetErrorMessage("Who would you like to nominate?"); SetHelp("Syntax: <nominate STR>\n" ! "Nominates a candidate"); } mixed can_nominate_str() { --- 18,24 ---- SetRules("STR"); SetErrorMessage("Who would you like to nominate?"); SetHelp("Syntax: <nominate STR>\n" ! "Nominates a candidate"); } mixed can_nominate_str() { *************** *** 35,39 **** object env; if( !str || !(env = environment(this_player())) ) return 0; ! return (mixed)env->eventNominate( this_player(), str ); } --- 35,39 ---- object env; if( !str || !(env = environment(this_player())) ) return 0; ! return (mixed)env->eventNominate( this_player(), str ); } diff -c -r --new-file ds1.1/lib/verbs/players/party.c ds2.0r27/lib/verbs/players/party.c *** ds1.1/lib/verbs/players/party.c Sun Feb 1 21:31:00 1998 --- ds2.0r27/lib/verbs/players/party.c Wed Jul 5 00:01:06 2006 *************** *** 27,87 **** mixed can_party_wrd(string cmd) { if( !cmd ) return 0; switch( cmd ) { ! case "disband": return (mixed)PARTY_D->CanRemoveParty(this_player()); ! case "leave": return (mixed)PARTY_D->CanLeaveParty(this_player()); ! default: ! return "That is an unknown party action."; } } mixed can_party_wrd_wrd(string cmd, string party) { if( !cmd || !party ) return 0; switch(cmd) { ! case "create": ! if( creatorp(this_player()) ) return "Not gonna happen."; return (mixed)PARTY_D->CanCreateParty(this_player(), party); ! case "join": return (mixed)PARTY_D->CanJoinParty(this_player(), party); ! default: ! return "That is an unknown party action."; } } mixed can_party_wrd_liv(string cmd) { if( !cmd ) return 0; switch(cmd) { ! case "invite": ! case "leader": ! case "remove": return 1; ! default: return "That is an unknown party action."; } } mixed do_party_wrd(string cmd) { switch(cmd) { ! case "disband": return (mixed)PARTY_D->eventRemoveParty(this_player()); ! case "leave": return (mixed)PARTY_D->eventLeaveParty(this_player()); } } mixed do_party_wrd_wrd(string cmd, string party) { switch(cmd) { ! case "create": return (mixed)PARTY_D->eventCreateParty(this_player(), party); ! case "join": return (mixed)PARTY_D->eventJoinParty(this_player(), party); } } --- 27,94 ---- mixed can_party_wrd(string cmd) { if( !cmd ) return 0; switch( cmd ) { ! case "disband": return (mixed)PARTY_D->CanRemoveParty(this_player()); ! case "leave": return (mixed)PARTY_D->CanLeaveParty(this_player()); ! default: ! return "That doesn't seem to be something you can do."; } } mixed can_party_wrd_wrd(string cmd, string party) { if( !cmd || !party ) return 0; + if(cmd == "invite"){ + if(!party || !present(party,environment(this_player()))){ + return "That person isn't here."; + } + if(!living(present(party,environment(this_player())))){ + return "That is not a living thing."; + } + } switch(cmd) { ! case "create": return (mixed)PARTY_D->CanCreateParty(this_player(), party); ! case "join": return (mixed)PARTY_D->CanJoinParty(this_player(), party); ! default: ! return "It doesn't work that way."; } } mixed can_party_wrd_liv(string cmd) { if( !cmd ) return 0; switch(cmd) { ! case "invite": ! case "leader": ! case "remove": return 1; ! default: return "That is an unknown party action."; } } mixed do_party_wrd(string cmd) { switch(cmd) { ! case "disband": return (mixed)PARTY_D->eventRemoveParty(this_player()); ! case "leave": return (mixed)PARTY_D->eventLeaveParty(this_player()); } } mixed do_party_wrd_wrd(string cmd, string party) { switch(cmd) { ! case "create": return (mixed)PARTY_D->eventCreateParty(this_player(), party); ! case "join": return (mixed)PARTY_D->eventJoinParty(this_player(), party); } } *************** *** 89,142 **** mixed do_party_wrd_liv(string cmd, object targ) { mixed foo; switch(cmd) { ! case "invite": ! foo = (mixed)PARTY_D->CanInviteMember(this_player(), targ); ! break; ! case "leader": ! foo = (mixed)PARTY_D->CanChangeLeader(this_player(), targ); ! break; ! case "remove": ! foo = (mixed)PARTY_D->CanRemoveMember(this_player(), targ); ! break; ! default: ! return "That is an unknown party action."; } if( stringp(foo) ) ! return this_player()->eventPrint(foo), 1; if( !foo || !intp(foo) ) return foo; switch(cmd) { ! case "invite": return (mixed)PARTY_D->eventInviteMember(this_player(), targ); ! case "leader": return (mixed)PARTY_D->eventChangeLeader(this_player(), targ); ! ! case "remove": return (mixed)PARTY_D->eventRemoveMember(this_player(), targ); } } string GetHelp(string str) { return ("Syntax: <party create PARTY>\n" ! " <party disband>\n" ! " <party invite PLAYER>\n" ! " <party join PARTY>\n" ! " <party leader PLAYER>\n" ! " <party leave>\n" ! " <party remove PLAYER>\n\n" ! "This command is the interface to the Dead Souls party system. " ! "A party is simply a group of players who are adventuring " ! "together. The advantage of a party is that it allows people " ! "to share the bounties of a quest or other such venture " ! "together.\n\nIt is important that this party system is extremely " ! "different from other party systems. The first thing is that " ! "it does not support the sharing of experience, since players " ! "have no experience. It allows such things as group " ! "responses to danger and group completions of quests. For " ! "example, if the party completes a quest, each member of the " ! "party is credited with completing the quest. Note that in " ! "order to get such credit, the party must be together upon " ! "completion of the quest.\n\n"); } ! --- 96,149 ---- mixed do_party_wrd_liv(string cmd, object targ) { mixed foo; switch(cmd) { ! case "invite": ! foo = (mixed)PARTY_D->CanInviteMember(this_player(), targ); ! break; ! case "leader": ! foo = (mixed)PARTY_D->CanChangeLeader(this_player(), targ); ! break; ! case "remove": ! foo = (mixed)PARTY_D->CanRemoveMember(this_player(), targ); ! break; ! default: ! return "You fail to do that."; } if( stringp(foo) ) ! return this_player()->eventPrint(foo), 1; if( !foo || !intp(foo) ) return foo; switch(cmd) { ! case "invite": return (mixed)PARTY_D->eventInviteMember(this_player(), targ); ! case "leader": return (mixed)PARTY_D->eventChangeLeader(this_player(), targ); ! ! case "remove": return (mixed)PARTY_D->eventRemoveMember(this_player(), targ); } } string GetHelp(string str) { return ("Syntax: <party create PARTY>\n" ! " <party disband>\n" ! " <party invite PLAYER>\n" ! " <party join PARTY>\n" ! " <party leader PLAYER>\n" ! " <party leave>\n" ! " <party remove PLAYER>\n\n" ! "This command is the interface to the Dead Souls party system. " ! "A party is simply a group of players who are adventuring " ! "together. The advantage of a party is that it allows people " ! "to share the bounties of a quest or other such venture " ! "together. It allows such things as group completions of quests. " ! "For example, if the party completes a quest, each member of the " ! "party is credited with completing the quest. Note that in " ! "order to get such credit, the party must be together upon " ! "completion of the quest.\n\nNOTE: In order to invite someone " ! "into your party, they must be in the same room as you. Also, " ! "joining a party does not mean you automatically follow the " ! "leader. To do that, you must use the \"lead\" and \"follow\" " ! "commands."); } ! diff -c -r --new-file ds1.1/lib/verbs/players/pray.c ds2.0r27/lib/verbs/players/pray.c *** ds1.1/lib/verbs/players/pray.c Sun Feb 1 21:31:01 1998 --- ds2.0r27/lib/verbs/players/pray.c Wed Jul 5 00:01:06 2006 *************** *** 14,26 **** verb::create(); SetVerb("pray"); SetRules("for STR", "for STR against STR", "for STR against STR for LIV", ! "for STR for OBJ"); SetErrorMessage("Pray for what?"); SetHelp("Syntax: <pray for PRAYER>\n" ! " <pray for PRAYER against SOMETHING>\n" ! " <pray for PRAYER against SOMETHING for SOMEONE>\n\n" ! "Allows you to say a prayer to whatever deity you believe in.\n\n" ! "See also: prayers"); } mixed can_pray_for_str(string spell) { --- 14,26 ---- verb::create(); SetVerb("pray"); SetRules("for STR", "for STR against STR", "for STR against STR for LIV", ! "for STR for OBJ"); SetErrorMessage("Pray for what?"); SetHelp("Syntax: <pray for PRAYER>\n" ! " <pray for PRAYER against SOMETHING>\n" ! " <pray for PRAYER against SOMETHING for SOMEONE>\n\n" ! "Allows you to say a prayer to whatever deity you believe in.\n\n" ! "See also: prayers"); } mixed can_pray_for_str(string spell) { diff -c -r --new-file ds1.1/lib/verbs/players/request.c ds2.0r27/lib/verbs/players/request.c *** ds1.1/lib/verbs/players/request.c Sun Feb 1 21:31:00 1998 --- ds2.0r27/lib/verbs/players/request.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/players/request.c ! * from the Dead Souls V Object Library * created by Descartes of Borg 951219 */ --- 1,5 ---- /* /verbs/players/request.c ! * from the Dead Souls Object Library * created by Descartes of Borg 951219 */ *************** *** 13,23 **** SetRules("STR from LIV"); SetErrorMessage("Request what from whom?"); SetHelp("Syntax: <request SOMETHING from LIVING>\n\n" ! "This allows you to ask livings things for particular things. " ! "For example, in Newbieland, you might 'request clothes from " ! "man'. This command behaves identically to 'ask LIVING for " ! "SOMETHING'.\n\n" ! "See also: ask"); } mixed can_request_str_from_liv() { --- 13,23 ---- SetRules("STR from LIV"); SetErrorMessage("Request what from whom?"); SetHelp("Syntax: <request SOMETHING from LIVING>\n\n" ! "This allows you to ask livings things for particular things. " ! "For example, in Newbieland, you might 'request clothes from " ! "man'. This command behaves identically to 'ask LIVING for " ! "SOMETHING'.\n\n" ! "See also: ask"); } mixed can_request_str_from_liv() { *************** *** 31,44 **** mixed do_request_str_from_liv(string str, object who) { this_player()->eventPrint("You request " + str + " from " + ! (string)who->GetName() + "."); environment(this_player())->eventPrint((string)this_player()->GetName() + ! " requests " + str + " from " + ! (string)who->GetName() + ".", ! ({ who, this_player() })); if( !((int)who->eventRequest(this_player(), ! remove_article(lower_case(str)))) ) ! who->eventPrint((string)this_player()->GetName() + " requests " + ! str + " from you."); return 1; } --- 31,44 ---- mixed do_request_str_from_liv(string str, object who) { this_player()->eventPrint("You request " + str + " from " + ! (string)who->GetName() + "."); environment(this_player())->eventPrint((string)this_player()->GetName() + ! " requests " + str + " from " + ! (string)who->GetName() + ".", ! ({ who, this_player() })); if( !((int)who->eventRequest(this_player(), ! remove_article(lower_case(str)))) ) ! who->eventPrint((string)this_player()->GetName() + " requests " + ! str + " from you."); return 1; } diff -c -r --new-file ds1.1/lib/verbs/players/sit.c ds2.0r27/lib/verbs/players/sit.c *** ds1.1/lib/verbs/players/sit.c Sun Feb 1 21:31:00 1998 --- ds2.0r27/lib/verbs/players/sit.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/players/sit.c ! * from the Dead Souls V Object Library * created by Descartes of Borg 960711 * Version: @(#) sit.c 1.7@(#) * Last Modified: 96/12/21 --- 1,5 ---- /* /verbs/players/sit.c ! * from the Dead Souls Object Library * created by Descartes of Borg 960711 * Version: @(#) sit.c 1.7@(#) * Last Modified: 96/12/21 *************** *** 14,26 **** static void create() { verb::create(); SetVerb("sit"); ! SetRules("", "down", "down in OBJ", "down on OBJ", "in OBJ", "on OBJ"); SetErrorMessage("Sit down?"); SetHelp("Syntax: <sit down>\n" ! " <sit down in OBJ>\n\n" ! "Allows you to sit down on the ground or in a chair-like object. " ! "It can be really exciting.\n\n" ! "See also: lie, stand"); } mixed can_sit_down() { --- 14,26 ---- static void create() { verb::create(); SetVerb("sit"); ! SetRules("", "up","down", "down in OBJ", "down on OBJ", "in OBJ", "on OBJ"); SetErrorMessage("Sit down?"); SetHelp("Syntax: <sit down>\n" ! " <sit down in OBJ>\n\n" ! "Allows you to sit down on the ground or in a chair-like object. " ! "It can be really exciting.\n\n" ! "See also: lie, stand"); } mixed can_sit_down() { *************** *** 28,38 **** return "You cannot do anything!"; } if( this_player()->GetPosition() != POSITION_STANDING ) { ! return "You must be standing in order to sit!"; } return 1; } mixed can_sit_word_obj() { return can_sit_down(); } --- 28,54 ---- return "You cannot do anything!"; } if( this_player()->GetPosition() != POSITION_STANDING ) { ! return "You must be standing in order to sit down!"; } return 1; } + mixed can_sit_up() { + if( this_player()->GetParalyzed() ) { + return "You cannot do anything!"; + } + if( this_player()->GetPosition() != POSITION_LYING ) { + return "You must be lying in order to sit up!"; + } + return 1; + } + + mixed can_sit(){ + if(this_player()->GetPosition() == POSITION_LYING) return can_sit_up(); + if(this_player()->GetPosition() == POSITION_STANDING) return can_sit_down(); + else return 0; + } + mixed can_sit_word_obj() { return can_sit_down(); } *************** *** 41,50 **** --- 57,75 ---- return can_sit_down(); } + mixed do_sit(){ + return this_player()->eventSit(); + } + mixed do_sit_down() { return this_player()->eventSit(); } + mixed do_sit_up() { + return this_player()->eventSit(); + } + + mixed do_sit_word_obj(string word, object target) { return this_player()->eventSit(target); } diff -c -r --new-file ds1.1/lib/verbs/players/sleep.c ds2.0r27/lib/verbs/players/sleep.c *** ds1.1/lib/verbs/players/sleep.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/verbs/players/sleep.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,39 ---- + #include <lib.h> + + inherit LIB_VERB; + + static void create() { + verb::create(); + SetVerb("sleep"); + SetRules(""); + SetErrorMessage("Sleep?"); + SetSynonyms("go to sleep"); + SetHelp("Syntax: sleep\n" + "If lying down, you fall asleep. If not, you collapse " + "asleep. Being attacked will usually wake you up, " + "otherwise you will awaken after a few minutes, stronger " + "and more refreshed.\n\n"); + } + + mixed can_sleep() { + + if( this_player()->GetCaffeine() > 10 ) { + return "You are too wired to sleep right now."; + } + + if(creatorp(this_player())){ + return "Creators are not permitted this kind of slack. Get back to work."; + } + + return 1; + } + + mixed do_sleep() { + tell_player(this_player(),"You fall asleep."); + tell_room(environment(this_player()), this_player()->GetName()+ + " closes "+possessive(this_player())+" eyes and appears to "+ + "lose consciousness.", ({this_player()}) ); + return (mixed)this_player()->SetSleeping(random(10)+5); + } + + diff -c -r --new-file ds1.1/lib/verbs/players/stand.c ds2.0r27/lib/verbs/players/stand.c *** ds1.1/lib/verbs/players/stand.c Sun Feb 1 21:31:00 1998 --- ds2.0r27/lib/verbs/players/stand.c Wed Jul 5 00:01:06 2006 *************** *** 1,11 **** /* /verbs/players/stand.c ! * from the Dead Souls V Object Library * created by Descartes of Borg 960711 * Version: @(#) stand.c 1.5@(#) * Last Modified: 96/12/21 */ #include <lib.h> #include <position.h> inherit LIB_VERB; --- 1,12 ---- /* /verbs/players/stand.c ! * from the Dead Souls Object Library * created by Descartes of Borg 960711 * Version: @(#) stand.c 1.5@(#) * Last Modified: 96/12/21 */ #include <lib.h> + #include <daemons.h> #include <position.h> inherit LIB_VERB; *************** *** 17,37 **** SetErrorMessage("Stand up?"); SetSynonyms("get"); SetHelp("Syntax: <stand up>\n" ! "When sitting down or lying down, you can get up in this " ! "most intuitive manner.\n\n" ! "See also: lie, sit"); } mixed can_stand_up() { if( this_player()->GetParalyzed() ) { return "You cannot do anything."; } if( this_player()->GetPosition() != POSITION_STANDING ) { return 1; } return "You are already standing up!"; } mixed do_stand_up() { return (mixed)this_player()->eventStand(); } --- 18,51 ---- SetErrorMessage("Stand up?"); SetSynonyms("get"); SetHelp("Syntax: <stand up>\n" ! "When sitting down or lying down, you can get up in this " ! "most intuitive manner.\n\n" ! "See also: lie, sit"); } mixed can_stand_up() { if( this_player()->GetParalyzed() ) { return "You cannot do anything."; } + if(RACES_D->GetLimblessRace(this_player()->GetRace()) ){ + return "You aren't endowed with limbs with which to stand."; + } + if( this_player()->GetPosition() != POSITION_STANDING ) { return 1; } return "You are already standing up!"; } + mixed can_stand(){ + return can_stand_up(); + } + mixed do_stand_up() { return (mixed)this_player()->eventStand(); } + + mixed do_stand() { + return (mixed)this_player()->eventStand(); + } + diff -c -r --new-file ds1.1/lib/verbs/players/stealth.c ds2.0r27/lib/verbs/players/stealth.c *** ds1.1/lib/verbs/players/stealth.c Sun Feb 1 21:31:01 1998 --- ds2.0r27/lib/verbs/players/stealth.c Wed Jul 5 00:01:06 2006 *************** *** 2,20 **** * by BillGates 961109 * allows players to move silently from room to room */ ! #include <lib.h> #include "include/stealth.h" ! inherit LIB_DAEMON; ! static void create() { ! ::create(); parse_init(); parse_add_rule("stealth",""); parse_add_rule("stealth","WRD"); } ! mixed can_stealth() { return this_player()->CanCastMagic(0, "stealth"); } --- 2,20 ---- * by BillGates 961109 * allows players to move silently from room to room */ ! #include <lib.h> #include "include/stealth.h" ! inherit LIB_DAEMON; ! static void create() { ! ::create(); parse_init(); parse_add_rule("stealth",""); parse_add_rule("stealth","WRD"); } ! mixed can_stealth() { return this_player()->CanCastMagic(0, "stealth"); } *************** *** 24,100 **** } mixed do_stealth() { ! return do_stealth_wrd(""); } mixed do_stealth_wrd(string args) { object caster = this_player(); object env = environment(caster); ! int skill = (int)this_agent()->GetSkillLevel("stealth"); if( skill < 20 ) { ! caster->eventPrint("You are not devious enough."); ! return 1; } ! ! ! if( args == "on" ) { ! if( (int)caster->GetStaminaPoints() < 50 ) { ! caster->eventPrint("You are too tired to move silently.",env); ! env->eventPrint((string)caster->GetName() + " looks tired.",caster); ! return 0; ! } ! ! ! if( caster->GetInCombat() ) { ! caster->eventPrint("You are too busy fighting at the moment.",env); ! return 0; ! } } eventStealth(caster, args, skill); return 1; } ! ! ! int eventStealth(object caster, string args, int skill) { ! if( !(caster) ) return 0; ! if( !environment(caster) ) { ! caster->eventPrint("You are nowhere."); ! return 0; } ! if(args == "") { ! if(caster->GetProperty("stealthy")) { ! caster->eventPrint("You are currently moving silently."); ! } ! else caster->eventPrint("You are moving as noisily as ever."); ! return 1; ! } ! ! if(args == "on") { ! if(caster->GetProperty("stealthy")) { ! caster->eventPrint("You are already moving quietly!"); ! return 0; ! } ! caster->SetProperty("stealthy",1); ! caster->eventPrint("%^RED%^You begin to sneak around."); ! caster->AdStaminaPoints(-30 - random(40)); ! caster->AddSkillPoints("stealth",skill*skill/8); ! return 1; ! } ! ! if(args == "off") { ! if(caster->GetProperty("stealthy")) { ! caster->SetProperty("stealthy",0); caster->eventPrint("%^BOLD%^%^CYAN%^You stop your sneaky ways.", ! environment(caster)); ! return 1; ! } ! else caster->eventPrint("You are not currently sneaking around!"); ! return 0; ! } ! ! return 1; } --- 24,100 ---- } mixed do_stealth() { ! return do_stealth_wrd(""); } mixed do_stealth_wrd(string args) { object caster = this_player(); object env = environment(caster); ! int skill = (int)this_agent()->GetSkillLevel("stealth"); if( skill < 20 ) { ! caster->eventPrint("You are not devious enough."); ! return 1; } ! ! ! if( args == "on" ) { ! if( (int)caster->GetStaminaPoints() < 50 ) { ! caster->eventPrint("You are too tired to move silently.",env); ! env->eventPrint((string)caster->GetName() + " looks tired.",caster); ! return 0; ! } ! ! ! if( caster->GetInCombat() ) { ! caster->eventPrint("You are too busy fighting at the moment.",env); ! return 0; ! } } eventStealth(caster, args, skill); return 1; } ! ! ! int eventStealth(object caster, string args, int skill) { ! if( !(caster) ) return 0; ! if( !environment(caster) ) { ! caster->eventPrint("You are nowhere."); ! return 0; } ! if(args == "") { ! if(caster->GetProperty("stealthy")) { ! caster->eventPrint("You are currently moving silently."); ! } ! else caster->eventPrint("You are moving as noisily as ever."); ! return 1; ! } ! ! if(args == "on") { ! if(caster->GetProperty("stealthy")) { ! caster->eventPrint("You are already moving quietly!"); ! return 0; ! } ! caster->SetProperty("stealthy",1); ! caster->eventPrint("%^RED%^You begin to sneak around."); ! caster->AdStaminaPoints(-30 - random(40)); ! caster->AddSkillPoints("stealth",skill*skill/8); ! return 1; ! } ! ! if(args == "off") { ! if(caster->GetProperty("stealthy")) { ! caster->SetProperty("stealthy",0); caster->eventPrint("%^BOLD%^%^CYAN%^You stop your sneaky ways.", ! environment(caster)); ! return 1; ! } ! else caster->eventPrint("You are not currently sneaking around!"); ! return 0; ! } ! ! return 1; } diff -c -r --new-file ds1.1/lib/verbs/players/target.c ds2.0r27/lib/verbs/players/target.c *** ds1.1/lib/verbs/players/target.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/verbs/players/target.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,86 ---- + #include <lib.h> + #include <position.h> + #include "include/target.h" + + inherit LIB_VERB; + + static void create() { + verb::create(); + SetVerb("target"); + SetRules("LVS", "only LVS","LVS only"); + SetErrorMessage("Target whom?"); + SetHelp("Syntax: <target LIVING>\n" + " <target all of LIVING>\n" + " <target all>\n\n" + "This command initiates exclusive combat with a living " + "being or group of living beings using any wielded weapons " + "or your bare hands. Anyone else in the room at the time " + "you issue this command will be ignored by you, even if " + "they attack you. \n\n" + "See also: attack, wimpy, ignore"); + } + + mixed can_target_liv(object target) { + int pos = this_player()->GetPosition(); + + if( (int)this_player()->GetParalyzed() ) { + return "You cannot move!"; + } + if( pos == POSITION_SITTING || pos == POSITION_LYING ) { + return "You cannot target in that position!"; + } + if( (int)environment(this_player())->GetProperty("no target") ) { + message("environment", "A mystical force prevents your malice.", + this_player()); + return this_player()->CanManipulate(); + } + return this_player()->CanManipulate(); + } + + mixed can_target_only_liv(object target){ + return can_target_liv(target); + } + + mixed can_target_liv_only(object target){ + return can_target_liv(target); + } + + mixed do_target_liv(object target) { + return do_target_lvs(({ target }), 1); + } + + mixed do_target_only_liv(object target){ + return do_target_lvs(({ target }), 1); + } + + mixed do_target_liv_only(object target){ + return do_target_lvs(({ target }), 1); + } + + varargs mixed do_target_lvs(mixed *targets, int exclusive) { + object *obs; + object *notarget; + string tmp; + + notarget = ({}); + obs = filter(targets, (: objectp :)); + if( !sizeof(obs) ) { + mixed *ua; + + ua = unique_array(targets, (: $1 :)); + foreach(string *lines in ua) this_player()->eventPrint(lines[0]); + return 1; + } + foreach(object entity in get_livings(environment(this_player()))){ + if(member_array(entity,obs) == -1) notarget += ({ entity }); + } + if(sizeof(notarget)) this_player()->AddNonTargets(notarget); + this_player()->SetAttack(obs); + tmp = item_list(obs); + obs->eventPrint((string)this_player()->GetName() + " targets you!"); + environment(this_player())->eventPrint((string)this_player()->GetName() + + " targets " + tmp + "!", + ({ this_player(), obs... })); + this_player()->eventPrint("You target " + tmp + "."); + return 1; + } diff -c -r --new-file ds1.1/lib/verbs/players/vote.c ds2.0r27/lib/verbs/players/vote.c *** ds1.1/lib/verbs/players/vote.c Sun Feb 1 21:31:00 1998 --- ds2.0r27/lib/verbs/players/vote.c Wed Jul 5 00:01:06 2006 *************** *** 16,24 **** verb::create(); SetVerb("vote"); SetRules("for STR"); ! SetErrorMessage("Who would you like to vote for?"); SetHelp("Syntax: <vote for STR>\n" ! "Casts your vote for a candidate"); } mixed can_vote_for_str() { --- 16,24 ---- verb::create(); SetVerb("vote"); SetRules("for STR"); ! SetErrorMessage("For whom would you like to vote?"); SetHelp("Syntax: <vote for STR>\n" ! "Casts your vote for a candidate"); } mixed can_vote_for_str() { *************** *** 35,39 **** object env; if( !str || !(env = environment(this_player())) ) return 0; ! return (mixed)env->eventVote( this_player(), str ); } --- 35,39 ---- object env; if( !str || !(env = environment(this_player())) ) return 0; ! return (mixed)env->eventVote( this_player(), str ); } diff -c -r --new-file ds1.1/lib/verbs/players/wake.c ds2.0r27/lib/verbs/players/wake.c *** ds1.1/lib/verbs/players/wake.c Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/verbs/players/wake.c Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,40 ---- + #include <lib.h> + + inherit LIB_VERB; + + static void create() { + verb::create(); + SetVerb("wake"); + SetRules(""); + SetErrorMessage("Wake?"); + SetSynonyms(({"wake up","awaken"})); + SetHelp("Syntax: wake\n" + "If asleep, you become less so."); + } + + mixed can_wake() { + + if( this_player()->GetAlcohol() > 70 ) { + return "You are too drunk to wake right now."; + } + + if(this_player()->GetSleeping() < 1) { + return "You are already awake."; + } + + return 1; + } + + mixed do_wake() { + if(this_player()->GetSleeping() > 1){ + tell_player(this_player(),"You become somewhat more wakeful."); + tell_room(environment(this_player()), this_player()->GetName()+ + " appears to rouse somewhat from "+possessive(this_player())+ + " slumber.", ({this_player()}) ); + return (mixed)this_player()->SetSleeping(this_player()->GetSleeping() - 1); + } + else tell_player(this_player(),"You are nearing full wakefulness..."); + return 1; + } + + diff -c -r --new-file ds1.1/lib/verbs/players/withdraw.c ds2.0r27/lib/verbs/players/withdraw.c *** ds1.1/lib/verbs/players/withdraw.c Sun Feb 1 21:31:01 1998 --- ds2.0r27/lib/verbs/players/withdraw.c Wed Jul 5 00:01:06 2006 *************** *** 17,23 **** SetVerb("withdraw"); SetRules(""); SetHelp("Syntax: <withdraw>\n" ! "Allows you to withdraw from the elections"); } mixed can_withdraw() { --- 17,23 ---- SetVerb("withdraw"); SetRules(""); SetHelp("Syntax: <withdraw>\n" ! "Allows you to withdraw from the elections"); } mixed can_withdraw() { *************** *** 34,38 **** object env; if( !(env = environment(this_player())) ) return 0; ! return (mixed)env->eventWithdraw( this_player() ); } --- 34,38 ---- object env; if( !(env = environment(this_player())) ) return 0; ! return (mixed)env->eventWithdraw( this_player() ); } diff -c -r --new-file ds1.1/lib/verbs/rooms/cast.c ds2.0r27/lib/verbs/rooms/cast.c *** ds1.1/lib/verbs/rooms/cast.c Sun Feb 1 21:30:51 1998 --- ds2.0r27/lib/verbs/rooms/cast.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/rooms/cast.c ! * from the Dead Soulsr2 Object Library * cast OBJ in STR * cast OBJ * created by Descartes of Borg 951016 --- 1,5 ---- /* /verbs/rooms/cast.c ! * from the Dead Souls Object Library * cast OBJ in STR * cast OBJ * created by Descartes of Borg 951016 *************** *** 25,34 **** if( !ob ) return 0; if( (err = (int)ob->CanCast(this_player())) != 1 ) ! return (err || "You can't cast " + (string)ob->GetShort() + "."); if( !(env = environment(this_player())) ) return 0; err = (mixed)env->CanCast(this_player(), ob); ! if( err == 1 ) return 1; else if( !err ) return "It doesn't look like there is much fishing here."; else return err; } --- 25,34 ---- if( !ob ) return 0; if( (err = (int)ob->CanCast(this_player())) != 1 ) ! return (err || "You can't cast " + (string)ob->GetShort() + "."); if( !(env = environment(this_player())) ) return 0; err = (mixed)env->CanCast(this_player(), ob); ! if( err == 1 ) return this_player()->CanManipulate(); else if( !err ) return "It doesn't look like there is much fishing here."; else return err; } *************** *** 43,49 **** string GetHelp(string str) { return "Syntax: <cast OBJ>\n\n" ! "Starts you fishing so long as OBJ is something you can fish with " ! "and you are in a place that allows fishing.\n\n" ! "See also: fish, stop"; } --- 43,49 ---- string GetHelp(string str) { return "Syntax: <cast OBJ>\n\n" ! "Starts you fishing so long as OBJ is something you can fish with " ! "and you are in a place that allows fishing.\n\n" ! "See also: fish, stop"; } diff -c -r --new-file ds1.1/lib/verbs/rooms/climb.c ds2.0r27/lib/verbs/rooms/climb.c *** ds1.1/lib/verbs/rooms/climb.c Sun Feb 1 21:30:51 1998 --- ds2.0r27/lib/verbs/rooms/climb.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/items/climb.c ! * from the Dead Soulsr2 Object Library * climb WRD OBJ * created by Descartes of Borg 951018 * Version: @(#) climb.c 1.3@(#) --- 1,5 ---- /* /verbs/items/climb.c ! * from the Dead Souls Object Library * climb WRD OBJ * created by Descartes of Borg 951018 * Version: @(#) climb.c 1.3@(#) *************** *** 10,15 **** --- 10,16 ---- #include <lib.h> #include <climb.h> + #include <position.h> inherit LIB_VERB; *************** *** 20,42 **** SetVerb("climb"); SetErrorMessage("Climb up or down what?"); SetRules("up OBJ", "down OBJ", "out of OBJ", "out OBJ", "into OBJ", ! "in OBJ", "through OBJ", "OBJ"); SetHelp("Syntax: <climb OBJECT>\n" ! " <climb up OBJECT>\n" ! " <climb down OBJECT>\n" ! " <climb out of OBJECT>\n" ! " <climb into OBJECT>\n" ! " <climb through OBJECT>\n\n" ! "Allows you to use another object to climb down or out of an " ! "area.\n\n" ! "See also: enter, go, jump"); } mixed can_climb_obj() { if( this_player()->GetParalyzed() ) { return "You cannot do anything!"; } ! return 1; } mixed can_climb_word_obj() { --- 21,47 ---- SetVerb("climb"); SetErrorMessage("Climb up or down what?"); SetRules("up OBJ", "down OBJ", "out of OBJ", "out OBJ", "into OBJ", ! "in OBJ", "through OBJ", "OBJ"); SetHelp("Syntax: <climb OBJECT>\n" ! " <climb up OBJECT>\n" ! " <climb down OBJECT>\n" ! " <climb out of OBJECT>\n" ! " <climb into OBJECT>\n" ! " <climb through OBJECT>\n\n" ! "Allows you to use another object to climb down or out of an " ! "area.\n\n" ! "See also: enter, go, jump"); } mixed can_climb_obj() { if( this_player()->GetParalyzed() ) { return "You cannot do anything!"; } ! if(this_player()->GetPosition() != POSITION_STANDING ) { ! return "You must be standing in order to climb."; ! } ! if(!stringp(hobbled(this_player()))) return "Your injuries prevent that movement."; ! return this_player()->CanManipulate(); } mixed can_climb_word_obj() { *************** *** 55,66 **** int type; switch(word) { ! case "up": type = CLIMB_UP; break; ! case "down": type = CLIMB_DOWN; break; ! case "out": type = CLIMB_OUT; break; ! case "in": case "into": type = CLIMB_INTO; break; ! case "through": type = CLIMB_THROUGH; ! default: type = CLIMB_UP; break; } return ob->eventClimb(this_player(), type); } --- 60,71 ---- int type; switch(word) { ! case "up": type = CLIMB_UP; break; ! case "down": type = CLIMB_DOWN; break; ! case "out": type = CLIMB_OUT; break; ! case "in": case "into": type = CLIMB_INTO; break; ! case "through": type = CLIMB_THROUGH; ! default: type = CLIMB_UP; break; } return ob->eventClimb(this_player(), type); } diff -c -r --new-file ds1.1/lib/verbs/rooms/enter.c ds2.0r27/lib/verbs/rooms/enter.c *** ds1.1/lib/verbs/rooms/enter.c Sun Feb 1 21:30:51 1998 --- ds2.0r27/lib/verbs/rooms/enter.c Wed Jul 5 00:01:06 2006 *************** *** 1,43 **** /* /verbs/rooms/enter.c ! * from the Dead Soulsr2 Object Library * created by Descartes of Borg 951104 * Version: @(#) enter.c 1.2@(#) * Last modified: 96/10/15 */ ! #include <lib.h> #include "include/enter.h" ! inherit LIB_VERB; ! static void create() { verb::create(); SetVerb("enter"); SetRules("into OBJ", "OBJ"); SetErrorMessage("Enter what?"); SetHelp("Syntax: <enter PLACE>\n" ! " <enter into PLACE>\n\n" ! "Moves you into the place you specify. Whereas the \"go\" " ! "command is designed for motion towards something, the " ! "\"enter\" command is designed for motion into something.\n\n" ! "See also: go"); } ! mixed can_enter_obj() { if( this_player()->GetParalyzed() ) { return "You cannot do anything."; } return 1; } ! mixed can_enter_into_obj() { return can_enter_obj(); } ! mixed do_enter_obj(object targ, string what) { return targ->eventEnter(this_player(), remove_article(lower_case(what))); } ! mixed do_enter_into_obj(object targ, string what) { do_enter_obj(targ, what); } --- 1,44 ---- /* /verbs/rooms/enter.c ! * from the Dead Souls Object Library * created by Descartes of Borg 951104 * Version: @(#) enter.c 1.2@(#) * Last modified: 96/10/15 */ ! #include <lib.h> #include "include/enter.h" ! inherit LIB_VERB; ! static void create() { verb::create(); SetVerb("enter"); SetRules("into OBJ", "OBJ"); SetErrorMessage("Enter what?"); SetHelp("Syntax: <enter PLACE>\n" ! " <enter into PLACE>\n\n" ! "Moves you into the place you specify. Whereas the \"go\" " ! "command is designed for motion towards something, the " ! "\"enter\" command is designed for motion into something.\n\n" ! "See also: go"); } ! mixed can_enter_obj() { if( this_player()->GetParalyzed() ) { return "You cannot do anything."; } + if(!stringp(hobbled(this_player()))) return "Your injuries prevent easy movement. Perhaps you should try crawling."; return 1; } ! mixed can_enter_into_obj() { return can_enter_obj(); } ! mixed do_enter_obj(object targ, string what) { return targ->eventEnter(this_player(), remove_article(lower_case(what))); } ! mixed do_enter_into_obj(object targ, string what) { do_enter_obj(targ, what); } diff -c -r --new-file ds1.1/lib/verbs/rooms/fish.c ds2.0r27/lib/verbs/rooms/fish.c *** ds1.1/lib/verbs/rooms/fish.c Sun Feb 1 21:30:51 1998 --- ds2.0r27/lib/verbs/rooms/fish.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/rooms/fish.c ! * from the Dead Soulsr2 Object Library * fish with OBJ * created by Descartes of Borg 951016 */ --- 1,5 ---- /* /verbs/rooms/fish.c ! * from the Dead Souls Object Library * fish with OBJ * created by Descartes of Borg 951016 */ *************** *** 17,25 **** SetRules("with OBJ"); SetErrorMessage("Fish with what?"); SetHelp("Syntax: <fish with OBJ>\n\n" ! "Starts you fishing so long as OBJ is something you can fish " ! "with and you are in a place that allows fishing.\n\n" ! "See also: cast, stop"); } mixed can_fish_with_obj() { --- 17,25 ---- SetRules("with OBJ"); SetErrorMessage("Fish with what?"); SetHelp("Syntax: <fish with OBJ>\n\n" ! "Starts you fishing so long as OBJ is something you can fish " ! "with and you are in a place that allows fishing.\n\n" ! "See also: cast, stop"); } mixed can_fish_with_obj() { *************** *** 28,34 **** if( !(env = environment(this_player())) ) return 0; err = (mixed)env->CanCast(this_player()); ! if( err == 1 ) return 1; else if( !err ) return "It doesn't look like there is much fishing here."; else return err; } --- 28,34 ---- if( !(env = environment(this_player())) ) return 0; err = (mixed)env->CanCast(this_player()); ! if( err == 1 ) return this_player()->CanManipulate(); else if( !err ) return "It doesn't look like there is much fishing here."; else return err; } diff -c -r --new-file ds1.1/lib/verbs/rooms/fly.c ds2.0r27/lib/verbs/rooms/fly.c *** ds1.1/lib/verbs/rooms/fly.c Sun Feb 1 21:30:52 1998 --- ds2.0r27/lib/verbs/rooms/fly.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/rooms/fly.c ! * from the Dead Souls V Object Library * Like go, except for flying around * created by Descartes of Borg 961013 * Version: @(#) fly.c 1.2@(#) --- 1,5 ---- /* /verbs/rooms/fly.c ! * from the Dead Souls Object Library * Like go, except for flying around * created by Descartes of Borg 961013 * Version: @(#) fly.c 1.2@(#) *************** *** 8,13 **** --- 8,15 ---- #include <lib.h> #include <medium.h> + #include <daemons.h> + #include <position.h> #include "include/fly.h" inherit LIB_VERB; *************** *** 18,72 **** SetRules("", "STR", "into STR"); SetErrorMessage("Fly in which direction?"); SetHelp("Syntax: <fly DIRECTION>\n" ! " <fly into PLACE>\n\n" ! "Moves you towards the direction you specify, or into the place " ! "you specify. The command \"fly into\" is synonymous with the " ! "\"enter\" command.\n\n" ! "See also: climb, enter, go, jump"); } mixed can_fly() { object env = environment(this_player()); if( !env ) { ! return "You are nowhere tobegin with!"; } switch( env->GetMedium() ) { case MEDIUM_LAND: ! return env->CanFly(this_player()); case MEDIUM_AIR: ! return "Fly where?"; default: return "You can't fly here."; } } ! mixed can_fly_str(string str) { if( !environment(this_player()) ) { return "You are nowhere."; } ! if( !creatorp(this_player()) && (int)this_player()->GetStaminaPoints() < 15 ) ! return "You are too tired to fly anywhere right now."; ! return (mixed)environment(this_player())->CanFly(this_player(), str); } mixed can_fly_into_str(string str) { if( !environment(this_player()) ) { return "You are nowhere."; } ! if( !creatorp(this_player()) && (int)this_player()->GetStaminaPoints() < 3 ) return "You are too tired right now."; ! return (mixed)environment(this_player())->CanEnter(this_player(), str); } mixed do_fly() { ! return environment(this_player())->eventFly(this_player()); } mixed do_fly_str(string str) { ! return (mixed)environment(this_player())->eventFly(this_player(), str); } mixed do_fly_into_str(string str) { return (mixed)environment(this_player())->eventEnter(this_player(), str); } --- 20,89 ---- SetRules("", "STR", "into STR"); SetErrorMessage("Fly in which direction?"); SetHelp("Syntax: <fly DIRECTION>\n" ! " <fly into PLACE>\n\n" ! "Moves you towards the direction you specify, or into the place " ! "you specify. The command \"fly into\" is synonymous with the " ! "\"enter\" command.\n\n" ! "See also: climb, enter, go, jump"); } mixed can_fly() { object env = environment(this_player()); if( !env ) { ! return "You are nowhere to begin with!"; } + switch( env->GetMedium() ) { case MEDIUM_LAND: ! if(env->CanFly(this_player())) return this_player()->CanFly(); case MEDIUM_AIR: ! return this_player()->CanFly(); default: return "You can't fly here."; } } ! mixed can_fly_str(string str) { if( !environment(this_player()) ) { return "You are nowhere."; } ! if( (int)this_player()->GetStaminaPoints() < 15 ) ! return "You are too tired to fly anywhere right now."; ! if(this_player()->GetPosition() != POSITION_FLYING){ ! return "You are not flying."; ! } ! if((mixed)environment(this_player())->CanFly(this_player(), str)){ ! return this_player()->CanFly(); ! } ! else return 0; } mixed can_fly_into_str(string str) { if( !environment(this_player()) ) { return "You are nowhere."; } ! if( (int)this_player()->GetStaminaPoints() < 3 ) return "You are too tired right now."; ! if(this_player()->GetPosition() != POSITION_FLYING){ ! return "You are not flying."; ! } ! if((mixed)environment(this_player())->CanEnter(this_player(), str)){ ! return this_player()->CanFly(); ! } ! else return 0; } mixed do_fly() { ! return this_player()->eventFly(); } mixed do_fly_str(string str) { ! this_player()->AddStaminaPoints(-1); ! return (mixed)environment(this_player())->eventGo(this_player(), str); } mixed do_fly_into_str(string str) { + this_player()->AddStaminaPoints(-1); return (mixed)environment(this_player())->eventEnter(this_player(), str); } diff -c -r --new-file ds1.1/lib/verbs/rooms/go.c ds2.0r27/lib/verbs/rooms/go.c *** ds1.1/lib/verbs/rooms/go.c Sun Feb 1 21:30:51 1998 --- ds2.0r27/lib/verbs/rooms/go.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/rooms/go.c ! * from the Dead Soulsr2 Object Library * go STR * go into STR * created by Descartes of Borg 951104 --- 1,5 ---- /* /verbs/rooms/go.c ! * from the Dead Souls Object Library * go STR * go into STR * created by Descartes of Borg 951104 *************** *** 18,43 **** SetRules("STR", "into STR"); SetErrorMessage("Go in which direction?"); SetHelp("Syntax: <go DIRECTION>\n" ! " <go into PLACE>\n\n" ! "Moves you towards the direction you specify, or into the place " ! "you specify. The command \"go into\" is synonymous with the " ! "\"enter\" command. Note that most directions are pre-aliased " ! "for you to the proper \"go\" commands. For example, " ! "\"go south\" has been pre-aliased to \"s\".\n\n" ! "See also: climb, enter, jump"); } mixed can_go_str(string str) { if( !environment(this_player()) ) return "You are nowhere."; ! if( !creatorp(this_player()) && (int)this_player()->GetStaminaPoints() <3 ) ! return "You are too tired to go anywhere right now."; return (mixed)environment(this_player())->CanGo(this_player(), str); } mixed can_go_into_str(string str) { if( !environment(this_player()) ) return "You are nowhere."; ! if( !creatorp(this_player()) && (int)this_player()->GetStaminaPoints() <3 ) ! return "You are too tired right now."; return (mixed)environment(this_player())->CanEnter(this_player(), str); } --- 18,46 ---- SetRules("STR", "into STR"); SetErrorMessage("Go in which direction?"); SetHelp("Syntax: <go DIRECTION>\n" ! " <go into PLACE>\n\n" ! "Moves you towards the direction you specify, or into the place " ! "you specify. The command \"go into\" is synonymous with the " ! "\"enter\" command. Note that most directions are pre-aliased " ! "for you to the proper \"go\" commands. For example, " ! "\"go south\" has been pre-aliased to \"s\".\n\n" ! "See also: climb, enter, jump"); } + mixed can_go_str(string str) { if( !environment(this_player()) ) return "You are nowhere."; ! if( (int)this_player()->GetStaminaPoints() <3 ) ! return "You are too tired to go anywhere right now."; ! if(!stringp(hobbled(this_player()))) return "Your injuries prevent easy movement. Perhaps you should try crawling."; return (mixed)environment(this_player())->CanGo(this_player(), str); } mixed can_go_into_str(string str) { if( !environment(this_player()) ) return "You are nowhere."; ! if( (int)this_player()->GetStaminaPoints() <3 ) ! return "You are too tired right now."; ! if(!stringp(hobbled(this_player()))) return "Your injuries prevent easy movement. Perhaps you should try crawling."; return (mixed)environment(this_player())->CanEnter(this_player(), str); } *************** *** 48,50 **** --- 51,54 ---- mixed do_go_into_str(string str) { return (mixed)environment(this_player())->eventEnter(this_player(), str); } + // diff -c -r --new-file ds1.1/lib/verbs/rooms/jump.c ds2.0r27/lib/verbs/rooms/jump.c *** ds1.1/lib/verbs/rooms/jump.c Sun Feb 1 21:30:51 1998 --- ds2.0r27/lib/verbs/rooms/jump.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/rooms/jump.c ! * from the Dead Souls V Object Library * jump in OBJ * jump into OBJ * jump off OBJ --- 1,5 ---- /* /verbs/rooms/jump.c ! * from the Dead Souls Object Library * jump in OBJ * jump into OBJ * jump off OBJ *************** *** 25,51 **** verb::create(); SetVerb("jump"); SetRules("in OBJ", "into OBJ", "off OBJ", "off of OBJ", "from OBJ", ! "through OBJ", "across OBJ", "over OBJ", "onto OBJ", "on OBJ"); SetSynonyms("leap"); SetErrorMessage("Jump from, into, over, on, or through something?"); SetHelp("Syntax: <jump into PLACE>\n" ! " <jump off PLACE>\n" ! " <jump through THING>\n" ! " <jump over THING>\n" ! " <jump on THING>\n\n" ! "These six different syntaxes actually represent three very " ! "different types of motion. They are thus often used in very " ! "different circumstances. All of them do, however, allow you " ! "to jump.\n\n" ! "Synonyms: leap\n\n" ! "See also: enter, go"); } mixed can_jump_word_obj() { return 1; } mixed can_jump_word_word_obj() { return 1; } --- 25,53 ---- verb::create(); SetVerb("jump"); SetRules("in OBJ", "into OBJ", "off OBJ", "off of OBJ", "from OBJ", ! "through OBJ", "across OBJ", "over OBJ", "onto OBJ", "on OBJ"); SetSynonyms("leap"); SetErrorMessage("Jump from, into, over, on, or through something?"); SetHelp("Syntax: <jump into PLACE>\n" ! " <jump off PLACE>\n" ! " <jump through THING>\n" ! " <jump over THING>\n" ! " <jump on THING>\n\n" ! "These six different syntaxes actually represent three very " ! "different types of motion. They are thus often used in very " ! "different circumstances. All of them do, however, allow you " ! "to jump.\n\n" ! "Synonyms: leap\n\n" ! "See also: enter, go"); } mixed can_jump_word_obj() { + if(!stringp(hobbled(this_player()))) return "Your injuries prevent that movement."; return 1; } mixed can_jump_word_word_obj() { + if(!stringp(hobbled(this_player()))) return "Your injuries prevent that movement."; return 1; } diff -c -r --new-file ds1.1/lib/verbs/rooms/stop.c ds2.0r27/lib/verbs/rooms/stop.c *** ds1.1/lib/verbs/rooms/stop.c Sun Feb 1 21:30:51 1998 --- ds2.0r27/lib/verbs/rooms/stop.c Wed Jul 5 00:01:06 2006 *************** *** 1,5 **** /* /verbs/rooms/stop.c ! * from the Dead Soulsr2 Object Library * stop STR * created by Descartes of Borg 951016 */ --- 1,5 ---- /* /verbs/rooms/stop.c ! * from the Dead Souls Object Library * stop STR * created by Descartes of Borg 951016 */ *************** *** 37,42 **** string GetHelp(string str) { return ("Syntax: <stop fishing>\n\n" ! "If you are fishing, this command will stop you from fishing.\n\n" ! "See also: cast, fish"); } --- 37,42 ---- string GetHelp(string str) { return ("Syntax: <stop fishing>\n\n" ! "If you are fishing, this command will stop you from fishing.\n\n" ! "See also: cast, fish"); } diff -c -r --new-file ds1.1/lib/www/articles/copyright.html ds2.0r27/lib/www/articles/copyright.html *** ds1.1/lib/www/articles/copyright.html Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/www/articles/copyright.html Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,69 ---- + <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + <html> + <head> + <meta content="text/html; charset=ISO-8859-1" + http-equiv="content-type"> + <title>Intellectual property and Dead Souls + + + + +
Intellectual Property and Dead Souls

updated 23 June 2006


When I began work on Dead Souls, I hadn't
thought that I'd have much to worry about, in terms
of intellectual property, or IP. Given that Dead Souls
was itself "public domain" software, it didn't seem
like it would be an issue. Little did I know!

There have been some areas of concern for
folks in this regard, and this article is intended
to clarify my actions and intent when it comes to
Dead Souls and IP. The main issues break down into
three main categories:

The legal status of Dead Souls

The controversy over Cygwin GPL violation

The question of MudOS distribution



The legal status of Dead Souls

Dead Souls 1.1 was the final release of the
Dead Souls lib made by
Descartes in the late 1990's.
DS 1.1 was placed into the public domain, meaning
that Descartes released all copyright to the lib,
making it freely distributable in any form by any
one in any way, including commercially.

This was in stark contrast to the strict
reservation of copyright for his other mudlib, Nightmare IV.
Nightmare IV remained under his copyright, and it
further had a highly restrictive license which
imposed limits to its use beyond that which is normally
enforced through copyright law.

Descartes vigorously defended his NM IV licensing
and copyright, and to this day old-timers in the LP
mud community look back on Descartes's withdrawal of the
NM IV lib from public distribution with some bemusement.
Whatever one thinks of his motives, it must be said that
Descartes was effective at squelching the unauthorized
distribution of the Nightmare IV lib.

This has left some people with the impression
that Dead Souls is somehow tainted by restrictive
licensing. For Dead Souls 1.1, this is not true. DS 1.1
can be used in any way one sees fit.

Dead Souls 1.2 and above, however, are not public
domain. They are GPL, meaning that whatever one finds
in Dead Souls 1.x to 2.x that is *not* found in DS 1.1
does in fact retain copyright and its distribution is
subject to the requirements of the GPL.

Translated into layman's terms, this means that
the current versions of Dead Souls cannot be distributed
unless their source code is also distributed, they are
otherwise entirely free to be distributed whether
commercially or otherwise. The experienced LP coder at
this point will object: "Hey, that doesn't make sense! LPC
is an interpreted language, so distributing it is de facto
distribution of code!"

From a technical standpoint, it's pretty senseless
(with some exceptions) to GPL Dead Souls. The lib itself
runs in the form of plain text..there's no way to hide
the source even if you wanted to. In this sense, GPL'ing
DS is meaningless.

However, I wanted to distribute DS in Windows
binary format, which meant in this case using Cygwin. To
use Cygwin, I needed to comply with their licensing which
as GPL made it a prerequisite that Cygwin was to be distributed
porting other software only if that software complied with
GPL-style licensing. By making Dead Souls explicitly
GPL, I could comply with Cygwin licensing and distribute
the driver binary I created.

To clarify, whatever is in Dead Souls now that
was in Dead Souls 1.1 is still public domain software.
Whatever is in Dead Souls now that was not in Dead Souls
1.1 is copyrighted.

UPDATE: 23 June 06

Dead Souls is not GPL. Due to the incessant nitpicking
of pedants who are overconcerned with software licensing, I
am revoking GPL. Dead Souls is copyrighted, and you can download
it and use it under no obligation to share anything. However,
I retain distribution rights. When I have nothing better to
think about I will decide on some "official" license to slap
on it, or come up with my own.

But all I want to do is code the greatest LP lib ever,
and I am just through with thinking about licensing.

My guess is that some licensing Nazi will read this and
try to find a way to make my life difficult because I revoked
GPL. There is just no pleasing some people. Just leave me alone,
please. Can't you just leave me alone?


The controversy over Cygwin GPL violation

In early 2006, one of the sites that provided
downloads of Dead Souls to the public abruptly pulled it
from distribution. Apparently someone had complained
to the site administrator that Dead Souls was in violation
of the GPL, and it was improper to host it.

This was a shock to me, because I thought I
had been scrupulous in my adherence to Cygwin policy.

To summarize, there was a Windows version of DS
which contained a pre-compiled Windows executable, to
permit the mud to run in Windows. This executable was
created in the Cygwin environment, and the
only way it would run on a Windows computer is if that
computer had some files called dll's, or "dynamic link
libraries" from the Cygwin environment. Since the point
was sharing the lib with people unwilling or unable to
compile for Windows, including the dll's along with the
executable seemed like the reasonable thing to do.

I examined Cygwin's policy on distributing their
dll's, and based on my interpretation, it seemed ok. It
turns out my interpretation of their licensing was incorrect.

What I thought they meant was that if you have
possibly modified their dll's, you cannot distribute them unless
you also distribute the source code.

What they actually meant was that whether or not
you had modified the dll's, you cannot distribute them unless
you also distribute the source code.
 
I queried the Cygwin licensing discussion list and
searched their archives until I found an example like Dead Souls.
A software company used Cygwin dll's and distributed them
without source, but when told they were in violation of the
Cygwin license, they simply added the dll's source code to their
download page, and this satisfied the Cygwin licensing folks.

I changed the download pages for Dead Souls to
make available the source code for the Cygwin dll's I was
distributing, and the site administrator allowed the
Dead Souls downloads to continue.

That's it. That's the whole story. Some folks have
chosen to inflate this event into allegations of Dead Souls
containing "stolen" code, which is as baffling to me as it
is untrue.

UPDATE: 05 June 2006
It turns out that despite the efforts outlined above,
distributing the Cygwin linked executable is still impermissible
according to Cygwin. The problem is that MudOS is not Open
Source, meaning linking with it is considered (by many, though
not all) a violation of the Cygwin's GPL.

Please see the news page item on this issue.

UPDATE: 06 June 2006

Dead Souls no longer uses Cygwin in any way. Questions
of GPL compliance with Cygwin linked libraries are now dead.
There is a new Windows version of Dead Souls available, and
it is a native Windows executable.
 


The question of MudOS distribution

The question of MudOS distribution hinges partly on
the meaning of "fair use," which is a notoriously slippery
concept in the already hard to grasp field of copyright law.
I'd like to make a disclaimer here that I am not a
lawyer, and am therefore most certainly not a copyright
lawyer, which is a field as full of necromancy as any
mud you're likely to play. What I state here are my
opinions based on my layman's understanding of the law.

Copyright in the U.S. is generally understood
to mean the set of exclusive rights an author holds over
her work, and these rights flow from the Constitution of
the United States which empowers Congress to legislate
in this area. Congress has done so. In order to promote
the arts and innovation, the U.S. has made it law that the
only person with the right to distribute a work (such as a
book, music, etc) is the author. She may negotiate with
others to permit them to distribute also, but absent this
positive action on her part, the distribution or
reproduction of her work or even a derivative of it
is flatly against the law, be it commercial
or otherwise.

Unless...

Here's where it gets tricky. It is illegal to
copy and distribute Bon Jovi's music, period....unless
you're making a mix CD for a friend. The principle at work
here is "fair use," which is an extremely ill-defined
standard by which actually it's ok sometimes to
do things that ordinarily constitute violations of
copyright.

Other known fair uses are quoting for journalistic
purposes, mimicking for parody or satire, copying for
personal backups, etc.

The "known fair uses" are generally not enshrined
in statute law. They are known from precedent. When
a court rules that something is fair use, then we have
a general rule of thumb we can follow...until another
court rules otherwise. That's about as close to written
law as you're going to get on this: court decisions.

This means that in a case where things are not
spelled out for you in black and white, you have to
follow your best judgment and hope you don't get sued,
and if you do, hope you don't lose, and if you do, hope
you haven't caused actual harm to the complainant.

This is the situation with the distribution of
MudOS. I have asked Marius, the current maintainer, for
his permission to bundle MudOS with Dead Souls. I got
no reply, but I came upon this: Marius tells someone off

In that document you can see that Marius would
have been happy to let someone not only copy MudOS, but
actually take it over completely and lead it forward...
if only they had emailed him first. The key part of this
document is where he states,

"That's all it would have taken to get my blessing, either
implicitly as a result of my silence (which is most likely
what you would have gotten), or explicitly by my saying so
in response."

This is about as clear a signal as I'm likely
to get as to how the copyright holder feels about the
general distribution of MudOS. I hope he reads this and
goes on to give me explicit permission, but in the
absence of that, my good faith interpretation of his
statements leads me to the conclusion that he really
does not care and it's ok with him.

Which, in my layman's view, does not fall squarely
into "fair use" territory, but between that and a
tacit passive permission and the fact that no
action has been taken against web sites which feature
MudOS as a download, it is reasonable cause to interpret
the bundling of Dead Souls with MudOS as "not wrong."

This doesn't mean that Marius has somehow allowed
his copyright to lapse. Should he contact me to order
me to stop bundling MudOS with Dead Souls, I would be
obligated to do so.

For anyone in the Dead Souls community worried
about that, please note that this would not be a fatal
blow to the UNIX lib. It would just make downloading a
two step process, thus making it more difficult for
beginners. For Windows users, however, the effect *would*
be devastating, because most Windows users don't have
the skill or experience to compile their own driver
executable. Let's hope this doesn't come to pass.


Update, 09 June 2006


Thanks to the sharp looking out of Skout, I
was able to find Marius and we had the following conversation.
The only editing done here was excluding the noisy "Joe enters the room."
type messages, and formatting for clarity:

You tell Verbal: howdy. i'm the maintainer of dead souls, and i'm told you
maintain mudos. i'd like to ask for your explicit blessing in what I'm doing:
http://dead-souls.net/articles/copyright.html#3

Verbal tells you: Yep, that's me. I am also Marius of mudos.org
Verbal tells you: I got your email, but unfortunately my response bounced.
Verbal tells you: I'm fine with you distributing the MudOS driver bundled with Dead Souls.
Verbal tells you: I would ask that you contribute any patches you've applied to the mudos-patches mailing list, though.

You tell Verbal: sure thing. sorry i had to idle, visiting a friend in the hospital
You tell Verbal: i'll submit the diffs for sure...i'd just thought the list was dead
You tell Verbal: if you don't mind, i'll use a transcript of our conversation
on my webpage, so anyone in doubt can have their mind set at ease.

Verbal tells you: no problem. all of the lists are still alive, though there's
not much traffic.
Verbal tells you: go ahead and use the transcript. that's cool.

To the best of my ability to tell, it really is the
man himself I was talking to. Anyway, I hope it was, because
if it wasn't and he reads this, he might get awful pissed!

Dead Souls Homepage

+ + Binary files ds1.1/lib/www/articles/favicon.ico and ds2.0r27/lib/www/articles/favicon.ico differ diff -c -r --new-file ds1.1/lib/www/articles/forum_chat.html ds2.0r27/lib/www/articles/forum_chat.html *** ds1.1/lib/www/articles/forum_chat.html Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/www/articles/forum_chat.html Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,278 ---- + + + + + security bug forum chat + + + tacitus - 2006/06/17 05:48 
+
+ I'm all for healthy competition + and needling each other. I think
+ anyone who knows me knows I'm + anything but thin-skinned.
+ I enjoy a good romp either on gjs + or on justrage, or whatever.
+
+ This thing, though, crossed the + line between rough play
+ and actual harm.
+
+ I figured Tacitus would be + insufferably smug if he found
+ the bug he was looking for, but I + figured that was a small
+ price to pay for getting help + securing DS. What I did
+ not count on was him taking it + upon himself to delete
+ log files.
+
+ This is a serious problem, + because he was messing with
+ security, and if I can't tell + what he did, I have to
+ stop everything and reconstruct + the events by hand.
+
+ Whether it was malicious is + actually beside the point.
+ Either he's untrustworthy because + he was concealing bad
+ behavior, or he's untrustworthy + because he doesn't know
+ better than to tromp around + someone's logs as he pleases,
+ without so much as a hint of his + intentions to the
+ owner.
+
+ Either way, it was a breach of + trust I did not expect
+ from someone I've been supporting + as a leader in the
+ community.
+
+ I've been granted guest creator + and sometimes even guest
+ admin privileges on other + people's muds, and I have
+ never done anything but exactly + what I've announced
+ and only with permission, because + it's not my mud
+ and I understand that. This is + basic. It's obvious.
+ In someone else's house, you ask + before you perform
+ potentially irreversible changes, + or you can just
+ consider yourself a boor.
+
+ So there's that.
+
+ According to Tacitus he attempted + to delete logs without
+ asking permission out of a + concern that other people
+ might happen upon them and learn + the exploit. Aside
+ from the obvious objection that + he could have just
+ told me so I could decide for + myself, is the bizarre
+ fact that he went on gjs + intergossip to announce there
+ his achievement, and allowed + thespread of information about how
+ he did it. Any casual reader of + the gjs i3 log is
+ now in full possession of all the + details needed to
+ compromise a Dead Souls mud, if + given Creator status.
+
+ How this squares with his stated + intention of protecting
+ the community by deleting my logs + I can't say.
+
+ There are some folks out there + who find exploits in
+ commercial software, and share + the information
+ with the public in an attempt to + help people get
+ ahead of the curve. Even assuming + this is not
+ dangerous, it is common for + professional, responsible
+ programmers who find serious + flaws to give the
+ manufacturer a few days or weeks + to develop a
+ patch before outing the info. As + a colleague, this
+ is the least I would have + expected.
+
+ Instead I'm now spending what + little of the weekend
+ I had for myself reconstructing + free space to
+ find potentially deleted files, + and exhaustively
+ nailing down each exploit and + subexploit related to
+ this incident. Just because + Tacitus couldn't contain
+ his glee and pride at rooting me, + and couldn't
+ give me a couple of days to deal + with it
+ in a more deliberate and measured + way.
+
+ Well, Tacitus, you win. The big + bad Dead Souls
+ juggernaut had feet of clay, + after all.
+
+ However, you've lost any trust I + had in you, any
+ good will. Maybe it will change, + but at the moment
+ I just don't see myself feeling + up to dealing
+ with you. You didn't have to do + it this way.
+ I hope the schadenfreude was + worth it.
+
+ When you came back from watching + your
+ movie, this was your message:
+
+ Tacitus@TimMUD + <intergossip> How is that audit coming?
+
+
+ It's coming along fine. Thanks.
+
+ -Crat
+  
+

+
+ Re:tacitus - 2006/06/17 06:00
+
+ I think Cratylus made some very + valid points however I think we all know that I wasn't trying to be + malicious - I was simply excited by my discovery. Furthermore, you told + me you were snooping and then I paged the log file and then proceeded + to delete (However, either the access file hadn't reparsed or you had + already removed me from the arch group so it failed) the log file that + contained the commands (eval and call logs) I used to find the exploit. + From today's events, I can only conclude we didn't truly realize the + lack of trust we had in each other in the first place or you are trying + to use this as some sort of publicity stunt.
+
+ As for the information being + released on intermud, I did not release the information directly. + Rather Duuk was cleaver enough to pry enough out of him to figure it + out on his own and then proceed to make fun of you - I can see how your + feelings can be a bit hurt.
+
+ I know if this happened to my + lib, I'd be very much embarassed too and I can understand why you are + making this post. I humbly appologize.
+
+ P.S. The audit comment was to + Hellmonger because he joking said that he'd audit my mudlib for me. If + you know this and that means that you are now auditing my mudlib, I + look forward to the results.
+
+ Post edited by: somerville32, at: + 2006/06/17 06:02 Tacitus
+ Executive Director
+ Research, Education, and + Development
+ LPUniversity Foundation
+
+

+
+ Re:tacitus - 2006/06/17 + 06:18 
+
+ For the record, I don't remember + saying anything about
+ watching you. While you were + messing with my lib, I was
+ in the middle of helping Samael. + That was the level of
+ trust I had in you. When you + started crowing about your
+ success, I started snooping you, + and saw you trying
+ to delete logs. You can imagine + my dismay. Given
+ that you were admin, were + deleting logs without telling me,
+ and I didn't know what you'd do + next, I ridded you on the spot
+ and locked the mud, but alas, + you'd already made yourself
+ an elder, so you recreated your + character and logged back
+ in. Not knowing what you *had* + done or what you *planned*
+ to do, I killed the mud process, + unmounted the filesystem,
+ and began the tedious process of + intrusion forensics.
+
+ You really don't need to suggest + I feel hurt because of Duuk.
+
+ I feel betrayed because of *you*.
+
+ You seem intent on provoking me + by claiming that my
+ statements are for some purpose + other than telling the truth.
+
+ I would suggest you read my + statements as declarations
+ of what I believe to be true, + regardless of how uncomfortable
+ that might make you.
+
+ -Crat
+ + diff -c -r --new-file ds1.1/lib/www/articles/lpu.html ds2.0r27/lib/www/articles/lpu.html *** ds1.1/lib/www/articles/lpu.html Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/www/articles/lpu.html Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,15 ---- + + + + + Dead Souls and LPU + + + + +
Dead Souls and LPUniversity Libs

There is some question about the
relationship between the Dead Souls mudlib and
the LPUniversity mudlib. Hopefully the description
below will unmuddy those waters.

Think of LPUniversity as a lib designed
from the ground up with LPC education in mind. It
is intended to be a lib coder's lib: crafted to
precise specifications and tight tolerances.

You'll have to ask him, but it's my
impression that Tacitus intends the LPUniversity
lib to be a sort of gold standard of how
LP libs should be.

As such, it's going to take a long time
to get the LPUniversity lib into the kind of
shape it needs to be in order to have a high
adoption rate. You can think of it as a Rolls
Royce under construction, still up on the lift.

Dead Souls is ready for prime-time. Though
it lacks some fun stuff that will be added in
the future, everything you need is there for
making almost whatever you want, right away. It's
not perfect, but it works. If LPUniversity is
a Rolls on the build lift, Dead Souls is the
Honda Civic in your driveway. Nothing to scream
about, really, but it works great and takes you
where you need to go.

The two libs complement each other. The
point of Dead Souls has always been to get more
people using LPC. The point of the LPUniversity
umbrella project (which includes the LPUlib) has
been to get more people using LPC.

By affiliating with Dead Souls, LPU gains
a larger potential base of interested people.
Dead Souls can be downloaded and run now, and put
into production as quickly as you can build your
world for it. This active user base strengthens
the LPUniversity project by participating in the
LPC community.

By affiliating with the LPU project, Dead
Souls gains a resource for LPC discussion that
has been sorely needed. Discussion forums and healthy
competition between libs is the sort of thing that
breeds interest in Dead Souls, breeding interest in
LPC at large.

Everyone wins.

So that's pretty much it. The LPU lib is
the car that's going to r0x0r but isn't ready to
to roll yet. Dead Souls is the car that may not
look as pretty, but has it where it counts. It
actually turns over and gets you around.


Dead Souls Homepage

+ + diff -c -r --new-file ds1.1/lib/www/articles/mudmagic.html ds2.0r27/lib/www/articles/mudmagic.html *** ds1.1/lib/www/articles/mudmagic.html Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/www/articles/mudmagic.html Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,20 ---- + + + + + Kyndig and Dead Souls + + + + +
Kyndig and Dead Souls

Back in 2005, when the first prototype versions
of Dead Souls were ready to be released, I looked around
for a means to distribute the lib. I hit upon the
obvious, Sourceforge, immediately.

Eventually mudmagic.com came to my attention
because of its widespread recognition, influence in the
"mud community" (whatever *that* is), and obvious
depth and quality of its software archives. My code
was accepted, and soon enough I was granted ownership
of my little Dead Souls corner of the site.

There was a moment during which I found Kyndig's
enforcement a bit precipitous
, but at the time I
reasoned that, lacking thorough documentation on the
issue, I might have pulled the trigger on a GPL
violator just as quickly.

I shrugged off complaints against Kyndig as a
familiar variation of the "admins suck!!1!" song I've
often heard before. Non-admins typically have no idea
how punishing it is to be diligent in your duties, and
the Kyndig complaints sounded pretty much like the
ill-justified wailing of children I was familiar with.
I even went so far as to try to articulate this in
a flame thread that started over a controversial
banning on mudmagic. To my dismay, not only did my
post disappear, the entire mudmagic flame board went
away. This was the event that made me start to see
things differently. Like the "big twist" in an M. Night
Shyamalan movie, everything shifted over just one
degree, but it changed the meaning of everything
that had gone before. And, like an M. Night Shyamalan
movie, I felt dumb for not having seen it before it
was rubbed in my face.

I began to reevaluate the controversial banning
itself. Back when it happened, I'd thought that Tyche
richly deserved some sort of sanction because, well,
frankly, I just didn't like him much. When I heard
that Kyndig banned him, I thought that sounded way too
harsh, but assumed that as much as Tyche had been an
asshat with me, he'd probably been plenty annoying
to Kyndig too, and Kyndig probably just got sick of
dealing with his shit. I've gotten fed up with people
myself, and I wasn't in a position to judge Tyche's
punishment, really. I just shrugged and said, "good
riddance."

When I heard Samson had been banned, I was very
surprised. Based on the dispute I had seen on the
moderator list, it seemed clear to me that Samson
was pretty well justified in being angry, and that his
responses, though intemperate, were reasoned, non-
flaming, and pretty humorous to boot. Nothing I
saw seemed to justify Samson getting kicked, and
this made me extremely uneasy, but, again, I just
assumed I didn't know the whole story, and on Kyndig's
site, he's the boss. I let it go, and, as mentioned
above, even chided people for leaping to conclusions
about it.

The next straw was "the dog that didn't bark."
You know the Sherlock Holmes story where he figures out
the owner was was the culprit because on the night of
the crime the dog didn't bark? The next thing I
expected was a public declaration from Kyndig about
his reasons for his actions. I have led people before,
and good leadership requires that when you cut major
players from a team, you need to explain why in a way
that clearly demonstrates your reasoning, your
justification, and gets buy-in from everyone that you
did it for legitimate reasons, and not pettiness.

The reason this is important is that if you
don't let people in on your decision-making, then
cutting people doesn't look like a justified act of
administration. It looks like a vindictive purge.
There may have been some vague mention about keeping
the site stable and such, but nothing that spoke to
the remaining contributors and moderators in a way
that made the actions sound *right*. To me, anyway.

Even then I thought, "Well, maybe he's not a
good leader. Doesn't make him *wrong*."

Then came the removal of the flame board, and it
started to dawn on me that Kyndig's administration
might not just be flawed, it might be fundamentally
misguided. I'd heard rumors about Kyndig brooking no
dissent, but this was stunning all the same. It's one
thing to frown on people complaining, but to remove a
forum dedicated to complaining, because people complain
about *you*, is damned hard for me to sign off on. To
me it doesn't matter that there are business interests
to protect. Controlling information actually does work,
and it is an efficient means to protect your business,
but an organization that operates this way loses my
respect. It seems to me especially foolhardy to operate
this way in an internet business, where spirits tend to
be high and resistant to censorship.

It was at this time that I made a compromise I
regret. I decided that I might not like the way Kyndig
does business, but it *is* his business, and it is of
benefit to me in distributing my software. I mightn't
like it but his site was useful, and I wanted to continue
to use it to promote my work.

In rapid succession I have learned of more
outrages. I can't know for sure it's all true, because
it isn't first hand experience. But as best as I can
gather, the following has happened:

* People speaking up for Samson and/or Tyche on mudmagic
have been banned.

* People speaking against Kyndig on sites other than
mudmagic have been banned.

* Kyndig has enforced restrictive policies on people
unrelated to these issues, based on affiliation with Samson
and/or Tyche.

These are the things that to the best of my
knowledge actually have happened. There are many other
rumors and allegations I've heard, equally appalling,
that I cannot fairly say probably are true, so I'm
omitting them.

I've come to the conclusion that I can't in good
conscience continue to have Dead Souls hosted on Kyndig's
repository. I find his behavior abhorrent to the
ideals of openness, fairness, and good judgment. I find
his hostility to criticism to be failure of character. I
believe that his weaknesses as a leader make him unfit
to hold any authority over the distribution of Dead Souls.

This will come at some cost to me, I suspect.
Mudmagic was a swell place to host my content, and I
respect and admire many of the the folks still there. I
hold no grudge against them for their decision to stay
there and keep their mouths shut. They have their own
consciences and their own reasons, over which I am
not qualified to pass judgment. For me, I know this will
mean a slower adoption rate of Dead Souls in general.

But I cannot abide the idea of the mud community
seeing any affiliation between Dead Souls and Kyndig.
His association with my software taints it, corrupts
its image, and I find it intolerable.

I am therefore asserting my authority as
copyright holder of post v1.1 Dead Souls, and revoking
the privilege of distribution of that software from
Kyndig or any site under his control.


Dead Souls Homepage

+ + diff -c -r --new-file ds1.1/lib/www/articles/olc.html ds2.0r27/lib/www/articles/olc.html *** ds1.1/lib/www/articles/olc.html Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/www/articles/olc.html Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,16 ---- + + + + + Dead Souls and LPU + + + + +
Is On-Line Creation Good for LPC? 

Dead Souls includes a quick creation system, named,
aptly enough, QCS.

It was an incredible bitch to make, because it had to
account for and parse code that might be written
carelessly, or in accordance with odd formatting rules.

Additionally, the number of possible things to modify
on an LPMud is so mindbogglingly large that it made
for a task that was challenging both in complexity
and in scale.

I sweated through the months of pain not because I
felt it would be a nice feature, but because I felt it was
a *necessary* feature. Early in DS development, I wondered
why it wasn't being adopted more, and started looking
at what other libs had that DS didn't. When I took a
serious look at CoffeeMud, I was totally blown away. Granted,
CM has had 5 or more years of constant development
by a team of more than one person, but the results
really are remarkable.

Their build system was simple and elegant. It
allowed people who were not interested in learning
code to make neat stuff right away. It became immediately
obvious that to a new mud admin, deciding which way to
go, there was really no contest.

Should they go with a mud that requires effort,
discipline, and weeks/months of study before doing
anything cool? Or with CM which they can set up and
build on immediately?

I realized that there was no way at all to compete in
the modern lib marketplace without an OLC.

The arguments in favor of an OLC are predicated on
"wide adoption of one's codebase" being the goal. The
arguments I arrived at were the following:


* Experienced admins already have a codebase preference.
There is no need or point in trying to convert people.

* N00b admins generally will not accept having to work
hard to get a mud up.

* Getting n00bs to use DS necessarily means making it
easy to set up from the start.

* Without an OLC, DS was greek to most n00b admins.

* Even though most n00b muds will fail, having many failed
DS muds is still good progress, because it means many
non-admins will have been exposed to the codebase. It is from
this sort of initial code exposure that preferences
develop.

It was obvious to me that I couldn't get people to
use Dead Souls just because it was technically superior
under the hood. Ask the makers of the Betamax if technical
superiority equals market share. Ask the Macintosh.

Hoping people would see the genius in my code would
not suffice to make them adopt it. The only way to make
DS widely adopted was to make it easy, and make it fun.
That LPC has had a history of being difficult is
irrelevant. Having been one way doesn't mean it had to
stay that way, and indeed, it's probably the main reason
LPC is in decline.

In my mind, Dead Souls's Quick Creation System isn't
really about advocating a feature that makes it
technically superior to other LPMuds. QCS is entirely
neutral in this respect. It does nothing for the
fundamental lib on its own: it just interprets it. If
the underlying code is crap, the QCS can do nothing
to change that.

No, DS QCS isn't about technical superiority. It's
purely marketing. I didn't spend months slaving over
QCS because I thought it made DS *better*. I did it
because I thought it made DS *viable*. Not having it would
be like trying to sell a car without windshield, doors, or
mirrors. It pretty much doesn't matter how good the
engine is. People want what they want, and if you don't
give it to them, they'll go somewhere else.

The obvious argument against this position is
"it doesn't matter if lots of people use the lib, it
just matters that it is pure and beautiful".

That is a valid opinion, but it is not mine. That
opinion assumes that one is the best coder, and
nobody can improve on one's work, and one's work is
perfect. I don't believe that is true of anyone.

I want DS to be great. I know that I am limited
by my experiences, ideas, and expertise. Others
can help DS better. By making DS widespread, more
eyeballs examine it, and the chances are greater
that someone will make DS better in some way. With
enough of this agglutination of minor improvements,
DS can be better than anything I could have made it on
my own. Making sweaty 13 year olds happy with an easy
mudlib is a by-product. By making it easy, and making
it so many people will use it, it increases the
chances that a great coder will find it, love it,
and contribute to its greatness.

So, as goofy and lame as I felt, making a
n00b-friendly "anyone can build here" system, I felt
it was not only important, but *vital* to advancing
my agenda of making Dead Souls the best LPC mudlib
on the planet.



Dead Souls Homepage

+ + diff -c -r --new-file ds1.1/lib/www/articles/patches.html ds2.0r27/lib/www/articles/patches.html *** ds1.1/lib/www/articles/patches.html Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/www/articles/patches.html Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,22 ---- + + + + + Patches?!? + + + + +
Patches?!?


For the impatient, you may skip down to the "Summary"
section at the bottom of this post.


The Disclaimer
The first thing to understand is that I don't profit
from DS, and I'm the only guy developing the core lib.
I'm not saying this because I want sympathy. I'm
saying it because this makes me have a very tight
focus on what I can and can't do within the short
time I've been granted here on Earth.

My goal is to make Dead Souls the best, most kick-ass
LPC lib ever. I interpret this to mean that when I
see a flaw, or someone else points one out, I want
it fixed. And, well, the fixing falls to me.


The History
Over the past year, what this has meant is that I
fix a given version, and after a while of fixes
accumulating, I declare it to be a new release and
off it goes, into the world. At first this caused a
lot of grumbling, because it meant people had to
reinstall from scratch every time I made a release,
and this was a bit much for many people.

It occurred to me that I could compile a package that
had only the files that changed between releases. I
put this together, and people seemed to really like
being able to upgrade from one release to another,
without a full reinstall. Over time, this system
has been tweaked and refined somewhat, but in the
end, it's roughly the same type of thing it was back
when I produced the first one: a bunch of files.


The Mechanics
The patching process is just as primitive as it
sounds. You uncompress these files and copy them
over your existing mud. Simple. Efficient.

Player files, directories, and domains that are
created by you are left untouched.

For some people this system is problematic. Some folks
are proficient at modifying lib code, and if they
just overwrite their mud with the contents of a patch,
they might find that their lib work has been clobbered. This
would be bad. That is why my patch instructions
strenuously remind people to back up the current mud
before patching it.

There is no practical solution for this problem that
I can see. Because I am just one guy, and my goal
is lib code, and not patch-process-design, I have
decided to leave things as they are. In theory I could
write code that would analyze and modify files as
needed, rather than simply have the owner overwrite.
However, this is a lot more complicated than it sounds
to implement in LPC within the lib, and it is also
non-trivial to implement this at the OS level, given
that the process would have to work on multiple different
platforms.

It's my opinion that people sophisticated enough to
need a more specialized patching system are
sophisticated enough to work around my shortcomings
in this area. Indeed, I've heard of folks who just
download the complete new version, run diffs against the
old one, and then pick and choose what to add.

For now and the foreseeable future, upgrades are just
a Big Dumb Ball of Files...with one exception.

Each patch includes a file called /secure/daemon/update.c
which carries out special functions that are not dealt
with by just overwriting files. When you reboot the mud,
update.c will do things like remove broken/dangerous files,
rename files with incorrect names, and modify text in
files (such as config.h) which should not be overwritten
but need to be changed.


The Philosophy and Controversy
Believe it or not, I've had people become irrationally
angry at how often I make releases. Not just "That darn
Crat is driving me crazy", but actual, unhinged flaming
well beyond any reasonable context.

Don't believe me? Check it out for yourself:

http://www.justrage.com/article.php?story=cratylus_dead_souls_mudlib


It *is* true that I'm averaging a release every week
or two. The person is correct in that there are a lot
of bugs to fix, and that releases happen much, much
more often than they do for other muds.

I have no defense against this charge. All I can do
is explain the reason for it, and hope it is justification
enough.

When someone tells me Dead Souls has a bug, I want to
help them. I want to fix it. I feel responsible to the
mud community to do what I can to fix whatever problems
they've run into because they've adopted the lib I
wanted them to. This is probably irrational on my part,
and if I'm lucky, I'll stop feeling this way sometime
soon. But until I do, I feel driven to be a responsive
lib coder, and I fix stuff. And I release it.

The question is, "If Dead Souls is so lame it needs
constant patching, shouldn't you kill it?"

The thing is, Dead Souls is the best LPmud lib out
there that I know of, *right now*. If the standard is
going to be perfection, then there's no lib out there
that should be available. There's no LPC mudlib
out there that you can download that is as featured,
solid, widely adopted, and supported as Dead Souls. If
the criteria for killing a lib is that it's not
perfect, and if Dead Souls is among the libs to be killed,
then just about everything needs a good flush.

It should be noted that Dead Souls doesn't *need*
constant patching. With the exception of security
fixes, any patch, upgrade, or hotfix is entirely
optional. You can stop patching and upgrading at
any time, and strike out in your own direction with
the lib. And as a matter of fact, I'd be tickled
pink if you did. The sprouting of evolutionary branches
off Dead Souls would delight me, because it would be
good evidence that I have begun something that's
going to continue beyond what I've done with my own
little brain.


Summary

* Yes, I'm a bit defensive on this topic. To me, "there
are too many updates" sounds a lot like "stop working on
the lib", which (I think, understandably) makes me testy.

* Dead Souls is fine just the way it is. If you don't
want to update, don't. As it is, right now, it's better
than any other LP lib I know of that you can download.

* If you do update, make sure you back up your mud.

* If you have ideas about how I can make the update
process less painful, KEEP THEM TO YOURSELF. I am not in
the business of patch/upgrade design, and, I'm sorry,
but I am not going to spend more time on it. All I
want to do is make DS the best ever.

* If you want to design and write a less painful upgrade method
that I can implement on DS, that's great. Let me know
about it so that I can avoid doing anything that makes
your work more difficult. Just don't expect me to work on
it *with* you.


I know this sounds a bit harsh...I hope you folks know
me well enough that you'll forgive a bit of the rudeness.

What it boils down to is a decision on where my time is
spent, and I'm pretty much sticking to my original plan.

For what it's worth, the vast majority of upgraders that
follow the patch install instructions report nothing
but a smooth process.


Dead Souls Homepage

+ + diff -c -r --new-file ds1.1/lib/www/articles/tacitus.html ds2.0r27/lib/www/articles/tacitus.html *** ds1.1/lib/www/articles/tacitus.html Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/www/articles/tacitus.html Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,18 ---- + + + + + Tacitus + + + + +
Tacitus

Hey folks,

I'm getting the drift that some people feel there is some
sort of political big deal going on between Tacitus and me.

I just wanted to take this opportunity to clarify things
a bit.

Yes, I *do* have a problem with Tacitus-the-person, who has
personally offended me, put people at risk, and been an
all around source of unpleasantness for me lately.

However, I am not interested in, nor do I have the time for,
some kind of Kyndig/Samson style feud. I appreciate all the
supportive emails, and the kind words both on- and off- the
record. But in the end, all I want to do is make Dead Souls
the best LPC lib ever, and getting into a juvenile pissing match
is exactly the sort of thing that makes that difficult.

So, be aware of the fact that I want people to contribute to his
site, and I want LPU to be successful, because that is an
overall plus for Dead Souls. Please keep up the community
participation.

Whatever I've been doing lately to express my displeasure
with Tacitus has nothing to do with you guys, and I am not
interested in ganging up on anyone. Please just let me
be angry with Tacitus, and carry on with your business.

Thanks.

-Crat


Update 27 June 2006

People who missed the original event have been
puzzled over what I'm talking about here. For their
benefit, I'm posting three consecutive messages from
then which will help illustrate the problem. They
were originally posted on the LPU site.

Dead Souls Homepage

+ + diff -c -r --new-file ds1.1/lib/www/articles/why_ds.html ds2.0r27/lib/www/articles/why_ds.html *** ds1.1/lib/www/articles/why_ds.html Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/www/articles/why_ds.html Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1,15 ---- + + + + + Dead Souls and LPU + + + + +
Why New Muds Should Use Dead Souls 

Normally I like to stay neutral, and say stuff like
'Use whatever codebase you're comfortable with, I don't
want to start a flamewar.' And today that would be half
right. I don't want to start a flamewar.

But I'd like to take a moment out to advocate LPmuds
for new mud admins. If this is going to get you all pissy
and flamey, you can just stop reading here.

I was inspired in part by recent discussions about the
division of labor between 'coders' and 'owners' and such on
other codebases. This seems bizarre to me. It's my opinion
that a mud 'owner' should be just as capable as any person
on her mud to build and code, and manage personnel besides. I
see it kind of like the role of a captain on a ship. The captain
may not have to be in the engine room answering 'ahead one
third', but she damn well should know *how* to, if the
situation calls for it.

A ship captain should know every inch of her ship, how
many lifeboats, etc. If the ship is not performing well,
she should be able to identify this and she should be able
to supervise the corrections, if necessary.

Obviously any metaphor has its limits. You can come up
with all sorts of reasons why the ship metaphor is flawed.
But the main reason I use it is the sense it carries of
ultimate responsibility resting on the shoulders of one
officer. Whatever happens on a ship, however successful its
mission, whatever disaster it incurs, all of it, is the
responsibility of the captain. The buck stops there.

So, to me, 'my mud is failing because I can't get a
coder' doesn't make any sense at all. Obviously a successful
mud will usually have a staff of more than one, but at
first, it's just you and your dream, man. You gotta build
that boat by yourself at first, before you can convince a
proper crew to join you.

And if you just get a prebuilt boat you don't know how
to customize, why should anyone join you, when they can just
get their own? And why should they listen to you, if you
don't even know enough to run it yourself? I see lots of
muds adrift at sea here, with a lone 'captain' at the bow,
calling out in the darkness for an experienced crew that
will never come.

I can only guess that the problem here is either fear
of C or inability to learn it fast enough to suit the admin.
I'm not addressing the newbie admins who are diligently
studying their C textbooks, determined to make a proper go
of it. I'm talking to those newbie admins who have decided
to make a mud and are determined to be admins and not C
coders.

If this is so, then my proposition is, forget about
starting a mud whose guts you don't intend to know inside
out. If C is too hard, and you doubt ever knowing it
well enough to rewrite commands and system code, then
you should drop your C based mud. You should think about
a codebase that uses a language you stand a chance of
picking up quickly and easily.

Yep. LPC. LPC is a 'coding language' in that it has
variables and objects and such. But these variables and
objects are not the 'bare metal' code elements
that you see in naked C. In LPC you have a level of
abstraction between you and that cold, hard C that makes
coding much easier...more like scripting than C coding.

Ok, let me ask you, in a Diku
style mud, how do you set a room so that you can't magically
teleport in or out? In Dead Souls, all you do is add this
to the file:

SetProperty('no teleport', 1);

In a Diku style mud, how would you have a mob respond
to a player saying something to them? In Dead Souls, you
just add this line to the mob's file:

AddTalkResponse('hello', 'hi!');

To make the mob do something when asked, you use AddCommandResponse.
To make it do or say something when *asked*, you use AddRequestResponse.
How would you do it in Diku?

Now, remember. This is not a 'Diku sucks' thread. For Diku
people, this stuff is presumably not that difficult. What I'm
showing you is how *trivial* this is to do, even for non-LPC people,
on LP muds. Don't get me wrong...you still need to spend a lot
of time going through docs, and looking at examples. But the
amount of time it takes to become LPC proficient is a tiny
fraction of the amount of time it takes to become C proficient
enough to handle mud coding.

You want a mud, you're not sure you can learn C fast enough,
and you aren't having luck finding a talented coder that will
bend to your will. I say your choice is obvious. Try an LP mud on
for size. Get your mud on.

Or wait for your knight in shining armor. Whichever comes first.

There are plenty of LP mud libs out there. I suggest you
take a look at Dead Souls. It's super easy to set up, and there is
an online intermud chat community ready to help answer your
questions.


Dead Souls Homepage

+ + diff -c -r --new-file ds1.1/lib/www/articles.html ds2.0r27/lib/www/articles.html *** ds1.1/lib/www/articles.html Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/www/articles.html Wed Jul 5 00:00:59 2006 *************** *** 0 **** --- 1,21 ---- + + + + + Dead Souls Articles + + + + +
Dead Souls Articles

No, this page isn't about parts of speech. Occasionally
I'll wax long-winded, and my rantings can qualify as free-standing
articles on a subject. This page allows me to separate that from
the rest of the site, so you can read my rants if you want,
or avoid them if you prefer.

These articles tend to be opinions, not technical
docs, so you can skip them without feeling pain.

If folks submit articles they've written they'd like
me to post here, I'll gladly accept them for consideration.



Why New Muds Should Use Dead Souls

Is OLC Good for LPC?

Intellectual Property and Dead Souls

Kyndig and Dead Souls

Patches?!?

Tacitus


Dead Souls Homepage

+ + diff -c -r --new-file ds1.1/lib/www/debugging.html ds2.0r27/lib/www/debugging.html *** ds1.1/lib/www/debugging.html Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/www/debugging.html Wed Jul 5 00:00:59 2006 *************** *** 0 **** --- 1,405 ---- + + + + + Dead Souls debugging + + + + + Debugging + in Dead Souls
+
+ So you've + made some cool stuff but darn it, it doesn't work. There are + various
+ tools + available in the Dead Souls lib to hunt down the source of the + problem:
+
+ 1 elog
+ 2 + dbxframe and dbxwhere
+ 3 + tell_player() and debug()
+ 4 tail
+ 5 bk + and restore
+
+
+ elog
+
If the file is somewhere in your home directory, just type: elog 

This will provide you a listing of the last few lines of your personal
error log. Warning lines tell you about code that works but should
be fixed in some way. Lines that don't contain the word "Warning" are
error lines: they indicate something about your code that prevents
it from working. For example:

+
> update + sample_room
+
---
*Error in loading object '/realms/cratylus/area/room/sample_room'
Object: /secure/cmds/creators/update at line 148

'<function>' at /secure/save/creators/c/cratylus (<function>) at /:0
'cmdAll' at /secure/save/creators/c/cratylus (/lib/command.c) at line 84
'cmd' at /secure/cmds/creators/update at line 109
'eventUpdate' at /secure/cmds/creators/update at line 148
'CATCH' at /secure/cmds/creators/update at line 148
Trace written to /log/catch
/realms/cratylus/area/room/sample_room: Error in update
*Error in loading object '/realms/cratylus/area/room/sample_room'
+
+


This output lets you know something is wrong, but
isn't very specific as to exactly what. If you look at your error
log, you probably will see something more detailed and helpful:


+
> elog
+
/log/errors/cratylus:

/realms/cratylus/area/room/sample_room.c line 10: Undefined variable 'Sample'
/realms/cratylus/area/room/sample_room.c line 10: parse error
+
+


Now you can see that the error is my syntax on
line 10. I would then use ed to examine the code, and specifically lines 9
through 11. It turns out that I forgot to put quotes around the room name,
so the parser tried to use it as a variable, which, of course, it couldn't.

If the file in question is in /secure, you'd type elog secure , or if
it's in /cmds, elog cmds , and so on.


dbxwhere & dbxframe

Two helpful debugging commands are dbxframe and dbxwhere. Let's
take a look at my broken sample_room.c file. We'll start with dbxwhere,
which lists for us the chain of events that led to the error. The
individual steps are called frames.

> dbxwhere
*Error in loading object '/realms/cratylus/area/room/sample_room'
Object: /secure/cmds/creators/update at line 148

#0: '<function>' at /secure/save/creators/c/cratylus (<function>) at /:0
#1: 'cmdAll' at /secure/save/creators/c/cratylus (/lib/command.c) at line 84
#2: 'cmd' at /secure/cmds/creators/update at line 109
#3: 'eventUpdate' at /secure/cmds/creators/update at line 148
#4: 'CATCH' at /secure/cmds/creators/update at line 148
+
+ The output is + similar to the update error we saw above, but in + enumerating the steps, dbxwhere
+ lets us use dbxframe to get + tighter detail on a given error frame:
+
+ > dbxframe + 4
+ ------
+     + /secure/cmds/creators/update.c:148 - CATCH(0)
+     + ----------------------------------------------------------------
+         + if( args == base_name(this_object()) ) {
+             + this_player()->eventPrint("Cannot reload update after destruct.\n"
+               + "It will be reloaded at next reference.");
+             + return 0;
+         + }
+     + =>  + tmp = catch(call_other(args, "???"));
+         + if( !tmp ) {
+             + if(identify(flags ^ U_AUTOMATED) ==
+     + "8")this_player()->eventPrint(args + ": Ok");
+             + return 1;
+         + } else this_player()->eventPrint(args + ": Error in update\n" + tmp);
+         + return 0;
+
+
+     + We're now looking at the error context for error + frame 4. The output of the command shows
+ us part of + the file that was performing the evaluation when the error + occurred, and even
+ points out + the offending line using a text arrow: =>
+
+     + In this particular case, the information is not that + helpful. We are being told that
+ the error + occurred while we were using the update command, and it + failed at the line
+ where update + does its thing. Duh, we knew that. The elog command was much + more helpful.
+
+     + Where this kind of tracing comes in handy is when + you encounter a runtime error
+ when you're + not updating a file. For example, if I tried to enter that + room, rather than
+ update it, + I'd get a big pukey error message and not know why. If you + run into an
+ unexpected + error, dbxwhere + will help you pinpoint it if elog + doesn't provide useful information,
+ and dbxframe will help detail + the source of the problem.
+
+
+
tell_player(), + debug()
+
+     Sometimes it's hard to fix code if you don't know + what it's doing. In
+ the above example, you might want to know what the variable "args" is, + if
+ your code is behaving unexpectedly. You could find out by adding a line + like:
+
+ tell_player("cratylus", "args is: + "+identify(args));
+
+ or:
+
+
tell_player("cratylus", + "%^BLUE%^args + is: "+identify(args)+"%^RESET%^");

+
+     You could also use:
+
+ debug("args is: ", args);
+
+ or:
+
+
debug("args is: ", args, + "blue");

+
+     ...which has the advantage of being shorter to type + and you'll get
+ the message more promptly. To be able to receive debug messages,
+ you need to enable your debugging mode by typing:
+
+ debug on
+
+     debug() is available in 2.0r20 and above.
+

+
tail
+
+     + This is a version of the unix tail command. It + displays the last few lines of a file.
+ This command + is important for examining crucial log files:
+
+ tail + /log/catch
+ tail /log/runtime
+
tail + /log/player_errors
+
+
+
bk + & restore
+
+
These commands + aren't so much for debugging as they + are for safe coding. Before you
+ edit a file, + it is a very good idea to back it up first. The bk command lets you
+ quickly and + conveniently back up a file before you edit it. When I + typed:
+
+ bk + sample_room
+
+ A file with a + unique identifying number was created in my bak/ + directory. If I
+ were to type + it again, then sample_room.c would get copied again to + bak/, with
+ a new unique + number added to the name.
+
+     + The number is basically the number of seconds + elapsed since January 1, 1970.
+ Adding this + number, we can keep track of which backed up version of a + file
+ is most + recent by looking at the name.
+
+     + Suppose I edited a file called sample_npc.c. I use + bk to back it up, make some changes,
+ then use bk + again, make some more changes, but now it won't update. I + don't
+ feel like + debugging, I just need this file working again, so I want to + restore from
+ backup. The + sequence of commands would look something like this:
+
+ ed + sample_npc.c
+ bk + sample_npc
+ ed + sample_npc.c
+ update + sample_npc.c
+ <error + occurs here>
+ restore + sample_npc
+
+     + The reason identifying numbers are used is that you + can also choose to
+ restore the + second-to-last backup version of a file, and other previous
+ versions.
+     + The very last backup version is effectively version + 0, so it's not
+ necessary to + specify a number. If I wanted to restore the version I + backed
+ up before + that one, I would type something like this:
+
+ restore + sample_npc 1
+
+     + And if I wanted the version before that one, I'd + specify 2 instead of 1,
+ and so on.
+
+     + Please note that this is an intentionally simple + system. There are
+ no menus, no + version branches, or diff tracking. The reason for this is
+ that it is + not a versioning + system. It is a backup + system. It is a convenient
+ tool to back + out of screwups, not a development tool to test file + versions.
+
+
+
Dead Souls Homepage
+
+
+
+ + diff -c -r --new-file ds1.1/lib/www/downloads.html ds2.0r27/lib/www/downloads.html *** ds1.1/lib/www/downloads.html Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/www/downloads.html Wed Jul 5 00:00:59 2006 *************** *** 0 **** --- 1,62 ---- + + + + + Dead Souls Downloads + + + + +
Useful Downloads and Applications

Written by Cratylus @ Frontiers, June 2006

No program exists in a vacuum. For many people, their
operating systems generally provide all the software they
need to operate Dead Souls
adequately. But sometimes there
is just a better way.

In the spirit of the poor college student I was when I
started mudding, I will try to include only freeware or free
shareware apps here.

Windows editors

Windows clients

UNIX clients

Mudsbuilder client stuff


Windows editors:

The #1 problem in Windows is that the default plaintext
editor, Notepad, produces text that is not 100% compatible with the
mud. Windows plaintext and UNIX plaintext differ, believe it
or not. If you use notepad for editing mudos.cfg, for example,
your mud is likely to just fail to boot. This is because it
can no longer read the "incorrectly" formatted file.

The other big problem with Notepad and Wordpad is that
they often add formatting and characters to text files that
make them very ugly and hard to read from inside the mud.

The solution is to use a text editor that can save in
UNIX text format. The following URLs point to editors that I
have been told will do a good job of this. I can't vouch for
them, as they are 3rd party apps and I've never tested them, but
I am assured they are very good for this.

Notepad++ http://notepad-plus.sourceforge.net/uk/site.htm

WinVi http://www.winvi.de/en/



Windows clients:

I can't imagine using the default Windows telnet client for
long. It is so bereft of features as to be actually worse than the
crappiest UNIX (or even VMS!) clients from 1993...Windows telnet is
worse than the worst from thirteen years ago.

There are a ton of great Windows mud clients out there.
Anyway, that's what I hear. Back when I used windows, I used a free
version of Zmud, and sometimes a less preferred Gmud. Zmud is now
a non-free application, so you have to buy it to use it. However,
they do still allow free distribution of a crappy, super old
version of the client.

Some people swear by the free mudmagic telnet client.
I haven't tried it, so I can't vouch for it, but here's a link
to it too.

Gmud http://frontiers.wcsu.ctstateu.edu/gmud.exe


Old Zmud 3 from 1996 (not my prob if it's broken)
http://rugose.com/zmud.zip

MudMagic http://www.mudmagic.com/mud-client/downloads/mudmagic-1.8-setup.exe


UNIX clients:

The client I use is gmoo 0.5.6. It has its drawbacks, but it
works ok, in general, and I'm used to it. An older version of it is
gMOO 0.4.8, and I've found it's a little easier to compile on some
newer UNIXes, for reasons beyond me.

As with the Windows version, some people like the mudmagic
Linux client. As with the Windows version, I wouldn't know, but
here it is.

gmoo 0.5.6 http://frontiers.wcsu.ctstateu.edu/gmoo-0.5.6.tar.gz

gMOO 0.4.8 http://frontiers.wcsu.ctstateu.edu/gMOO-0.4.8.tar.gz

MudMagic http://www.mudmagic.com/mud-client/linux_download
+
+
+ Mudsbuilder + client stuff
+
+     There's a GUI client for building LPC areas called + Mudsbuilder.
+ Download + it from Sourceforge and see if it suits you. There is
+ also a related Windows + app. You can use this template file to create +
+ Dead Souls rooms in the Windows app(Thanks Saquivor!). You'll have
+ to modify the template a bit to get it working on the Linux app.
+
+     See the LPUniversity + forums posts from Saquivor.
+
+
+ The end.
+
+ Dead Souls Homepage
+
+
+ + diff -c -r --new-file ds1.1/lib/www/ds-admin-faq.html ds2.0r27/lib/www/ds-admin-faq.html *** ds1.1/lib/www/ds-admin-faq.html Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/www/ds-admin-faq.html Wed Jul 5 00:00:59 2006 *************** *** 0 **** --- 1,590 ---- + + + + + Dead Souls Admin FAQ + + + + +
Dead Souls Admin FAQ, v3.4

Written by Cratylus @ Frontiers, October 2005
Updated June 2006

Note: commands are displayed in boldface, like this: ls -a

What's this FAQ about?


The point of this document is to orient a new admin in
Dead Souls 2. Starting a MUD with a lib that is completely new to
you can be confusing and discouraging. Hopefully this FAQ will
make the experience less difficult.


0 How do I start?

1 Is there a MUD somewhere running Dead Souls I can log into?

2 I like Dead Souls and I want to use it, but I don't want to run a mud.

3 I want to invite my friends to help me code. How do I promote
them to creator status?

4 What about intermud? How do I talk on that?

5 I talk on intermud but nobody replies. What's up with that?

6 How did you know my mud started up?

7 I heard there's an I3 router included in Dead Souls.

8 What's this about a manual on Frontiers?

9 How do I add limbs to a race?

10 How do I add a race?

11 How do I make my friend an admin?

12 I don't like how the who command output looks! You should change it.

13 Can you please make the FAQ easier to read? It's too long and complicated.

14 Most of the file headers have only Descartes's name on them.
Did you really develop this lib or did he?

15 How can I change the colors of the channel messages?

16 How do I know what other muds use Dead Souls?

17 I was hanging out in the Arch room and the loudspeaker went off. WTF?

18 I want to test the intermud channel but I don't want to spam the ds line.

19 What's this "Network room"?

20 The web server and FTP server don't work

21 I tried to log in to the FTP server but I can't!

22 I can't do anything with FTP. It just hangs there.

23 The web server gives me a 404 but I know the directory is there.

24 I'm using an external FTP server, but the files I transfer
become read only!

25 I moved a command from one directory to another. How do I
get the new location recognized?

26 The mudtime is all wrong!

27 The time of day is all wrong!

28 What happened to the roommaker and thingmaker?

29 I keep getting 'Connection to address server (localhost 9999) refused.'

30 Can I charge players a fee for playing on my mud?

31 Can people donate money to me for the mud?

32 I found a bug. For real. Can you please fix it?

33 Where would I edit to change how long someone can be idle
before they get disconnected?

34 How do I permit all users who log in to become
creators automatically?

35 How do I limit the use of intermud channels?

36 How do I get off intermud completely?

37 How do I change the start room for the mud?

38 I don't like having newbies get special treatment.

39 I don't want players to be able to pick non-human races.

40 I want everyone to speak the same language.

41 I made a change to /lib/player.c and updated it, but I'm not
seeing a difference in my character.

42 How do I change the items new players receive?

43 Hey, there's no <foo> class! What's up with that?

44 Where can I get a Dead Souls mud hosted?

45 Your LIB_MXLPLX system is all screwy. I changed it and it
works. Wanna see?

46 How are files organized in Dead Souls?

47 What are sefuns and efuns?

48 Whew! Ok now I know where stuff is. What's next?

49 Oh, man, you're kidding! Those are, like, books! Can't I
just start making stuff?

50 Everything is su-u-u-u-p-e-e-r-r-r s-s-l-o-o-o-o-w-w-w

51 Dude! One of my creators just kicked me off my own mud!

52 Is Dead Souls secure?

53 I sent you my code a week ago. Is it in or out?

54 Did you finish the bfd() sefun modification I asked you for last night?

55 QUEEG_D is a horrendous mess. It's inefficient and frankly offensive.

56 You implemented my code but didn't give me credit.

57 Intermud mail doesn't work

58 The admintool menus let you pick options that aren't visible

59 What does locking the mud do, exactly?

60 The race help output is inadequate for role-playing. How do I change it?

61 I need to know what features to expect in the next release so
I don't waste time duplicating effort

62 You need a development roadmap and task tracking

63 How do I update a sefun without rebooting the mud?

64 My new sefun updates but I can't seem to use it.

65 What's the point of the apostrophe-stripping for args in lib/command.c?

66 How does one achieve 'high mortal' or 'ambassador' positions?

67 I would like XYZ and PDQ to happen every time the mud boots

68 I can't login! I keep getting: "It seems some work is being done
right now, try later."

69 I had a really great idea that revolutionizes ds and you refuse
to include it. I am forking ds development and making my dream come true.

70 What do the version numbers mean?

71 The Dead Souls router is down. How do I switch back to *gjs?

72 I'm going to totally revamp <insert highly complex system here>.
Will that be difficult?


73 I've hired an area coder to make a new domain. I want her
to be able to use QCS in /domains/MistyDragonShireMysts.


74 How does player voting work?

75 What are "estates"?

76 What are "events"?

77 Where does user monitor data go?

78 How would you set a race to be selectable by new players?

79 Where is emote data kept?

80 What are .h and .o files? Where are they kept?

81 But my friend forgot his password! I *have* to edit his playerfile!

82 How do I change my mud's name?

83 Help! I locked myself out!

84 What are the privileges associated with the groups in groups.cfg?


85 Why does the documentation refer to LIB_ARMOUR and armour_types.h?

86 Where are read/write restrictions kept?

87 I need to test day/night descriptions, but I can't wait around all day.

88 How can I change the default prompt? Can I make it dynamic?

89 What is "unguarded"?

90 Is intermud communication secure?

100 What should I not do?


How do I start?

The first thing to do is follow the installation FAQ
to get Dead Souls installed. Then log in, and start reading
the administrator's guide, by typing these commands:

read index in guide

read chapter 1 in guide

read chapter 2 in guide

etc.


Is there a MUD somewhere running Dead Souls I can log into?

As a convenience to the curious, I have set up a "demo" mud
at rugose.com, port 6666. To connect, either click on
this link with your browser, or open a terminal window
(or for windows users, Start -> Run ) and
type: telnet
rugose.com 6666

When you log in, the system will read your playerfile for
a few seconds and then it will turn you into a creator. This
is so that you can examine code, try out the QCS, etc.

Please note that in the regular, non-demo version of the
mud, people are NOT automatically given creator status.

On the regular non-demo version of the mud, Only
the admin (basically, the first person to log on to the new mud)
gets automatic creatorship.

After logging in, you will be transported
to your workroom. Some useful commands:

look
look at me
look at chest
open chest
look in chest
get tricorder from chest
read index in handbook
read chapter 1 in handbook
who
stat
wiz
create new npc generic
look at board
read 1 on board
home


I like Dead Souls and I want to use it, but I don't want to run a mud.

Being a mud admin is very different from being just a coder
or builder, and many people just don't feel like dealing with
the hassle of running a mud.
There are a few Dead Souls muds out there that could
use help from you. Telnet to the Dead Souls development mud
and type: mudlist -m dead to see a list of Dead Souls muds
that might be hiring.
You can also just code on the Dead Souls development
mud. You're welcome to create as you please, and if your
building gets to the point where you'd like it included in
the lib, let me know and I'll inspect it for approval.
Please note that anything you code on the Dead Souls
development mud becomes property of Dead Souls mudlib
distribution, meaning you don't have copyright to it and you
can't prevent me from publishing it. So if you want
to prevent your code from being used that way, don't code
on my mud.


I want to invite my friends to help me code. How do I
promote them to creator status?

As admin, you have access to the admintool
command. This opens a menu-driven admin system you
can use to manage some basic aspects of your new MUD.

Everything on admintool can be done with
commands, system calls, or file editing, but until
you get the hang of all that stuff, admintool
is a convenient shortcut.
In this example, you would type: admintool ,
then select option 3, then option l (that's a lowercase "L").

The oldfashioned way, if the new creator
were named dude, would be: encre dude

I know. But people like menus, so I made it.


What about intermud? How do I talk on that?

The intermud3 (or i3) network is available
to you, and you are probably already connected to it. Type
mudlist to see a list of other muds on the network.

By default, the "Dead Souls intermud channel" is
enabled for creators. Type: ds blah blah
and other Dead Souls muds on the i3 network will see
your message like this:

You@YourMud <ds> blah blah

Please note that intercre is where you ask coding
and technical questions only. Random chatting is not
tolerated on that channel. Newbie questions that are
Dead Souls specific or that obviously have answers in
Dead Souls documentation may meet a hostile reception on
intercre.

Conversely, intergossip is mostly chat.

NOTE: If you use the switchrouter command to use
the *gjs Intermud 3 instead of the default *yatmim, Please
be warned that discussions on intergossip there are usually
offensive, argumentative, and generally aggressive.
This hostility is especially sharp when you
are identified as a "newbie". You will almost certainly
be mocked and insulted no matter what you say, but
especially if your first messages betray you as
ignorant of intergossip standards and traditions. I
strongly recommend you lurk on this channel for a few
days before saying anything.

Really, I recommend you avoid the *gjs router entirely.
Leave the default router settings alone and you won't
have to worry about this sort of thing.

The lpuni channel is a mix of
chat and official LPUniversity business. As of June 5 2006,
Blackdawn mud is bridging that channel, so it is accessible
from both i3 routers.


I talk on intermud but nobody replies. What's up with that?

I3 uses a hub topology. All muds communicating on intermud
connect to the router to do so. If that router is down all
i3 communication stops, until it comes back up. To check
network status, ping Frontiers or Dead Souls. If the
ping command gets no answer, i3 is probably down, or
your connection to it has been interrupted. Your mud will
be aware of this and retry to connect to i3 every
fifteen minutes or so.

There's also the possibility that nobody who wants to
chat is listening.

It's also possible that the Dead Souls I3 router has
changed address or port. Visit this page to get the
latest connection info:

Dead Souls I3 Router Page



How did you know my mud started up?

The same way your mud knows that i3 is up or
down. A while ago I noticed that i3 can be very
unreliable, and sometimes when it goes down and
comes back up, people's muds don't refresh their
connection, and they can be off intermud for days
without realizing it.

I implemented a "keepalive" system which
uses the intermud "auth" packets as pings. Every
fifteen minutes or so, you mud tries to ping Frontiers
and Dead Souls. If it gets a reply from at least one,
then it's happy. If neither reply, then your mud
alerts the Arch room that intermud is down, and it
will reload the intermud daemon every 15 minutes
in an attempt to reconnect. Once i3 is back up and
you are reconnected, you go back to pinging.

This means that Frontiers and Dead Souls
get a bunch of pings all the time. When a mud we've
never heard of before pings us, we get a message
about it, and so we know a new mud is online.

If this makes you feel like Big Brother
is watching you, you can edit "PINGING_MUDS" in
/secure/include/config.h to have the name of
your own mud only, so you just ping yourself.

You can also DISABLE_INTERMUD in that
same file.

Dont' edit that file with a default Windows
editor. Back up the file before you edit it. Reboot
the mud after making the changes. If it won't reboot,
you probably munged the format and need to restore
the original.


I heard there's an I3 router included in Dead Souls.

Please see the router page for details.


What's this about a manual on Frontiers?

It's no longer relevant. All the docs
we were making available on Frontiers are now included
in Dead Souls, starting from version 1.9r9.

In your workroom is a chest. Open the
chest and the new Dead Souls Creators Manual is
inside. The text files are in /doc/manual .


How do I add limbs to a race?

Edit /secure/cfg/races/<race> and make the changes
you want. Then use admintool to remove the race from the
races daemon, then add re-add the race.


How do I add a race?

Copy a race in
/secure/cfg/races/ and edit it.
For example:

cp
/secure/cfg/races/bear /secure/cfg/races/wampa

Edit the wampa file to reflect what you think a
wampa is like. If you want new players to be able
to select wampa as their race, make sure the file
has this line in it:

PLAYER_RACE 1

Make especially sure to change the lines RACE and
LANGUAGE. When you're done editing, type:

addrace wampa


For details:
help addrace


How do I make my friend an admin?

Use the groups menu in admintool, and select
"Modify a group". Select the ASSIST or SECURE group,
and enter the names of all the members it should have. If
I wanted to make xyzzy an assistant admin, I would
make him a creator, then I would edit the
ASSIST group and make the contents look like this:

cratylus:xyzzy

Xyzzy then needs to log out and log back in.


I don't like how the who command output looks! You should change it.

Believe it or not, I actually get requests like this. I also
get stuff like "the inventory list should be chronological in
order of acquisition." Maybe that's a good idea, but it's
your mud, not mine. Make it so for yourself.

If there is something broken about the lib itself, such as
an insta-death bug or a command that crashes the mud, I am
happy and eager to hear about it, so I can implement the fix
in the next lib release. If a normal action causes a runtime
error or abnormal behavior, I need to know that. Also typoes, null
error messages, etc...in short, tell me what's broken.
However, if the problem you're having is that the lib,
by design, behaves in a way not to your liking, this isn't something
I'm likely to "fix" for you. For example, if you want a "who"
command with a cooler look, that's up to you to make. You're
the one coding a mud, so you need to take it upon yourself to
understand the code and modify it to suit your tastes.
Similarly, "orcs are too strong!" or "advancing levels
should increase your eyesight" are issues you need to deal
with on your own, using the coding skills learned from reading the
Creators Manual.


Can you please make the FAQ easier to read? It's too long and complicated.

I'm a lib coder, not a web designer. Cut me slack. Or, edit it
for me and show me how it's done.


Most of the file headers have only Descartes's name on them. Did
you really develop this lib or did he?

Both. The lib he released in 1997 was his, and so almost every
file on it had his name. I've been working on it since, but
I am very lazy about headers. I work on lots of files at the
same time, and authorship attribution tends to rank very low
on my priority list. Therefore, even though a great majority
of the files in the lib have been either heavily modified or
created by me, my name is on very few.

I haven't bothered to go back and revise headers either,
because, honestly, what a pain in the butt that would be. I'm
satisfied knowing there's little doubt who has made the many
changes on the lib.


How can I change the colors of the channel messages?

The colors are specified in /secure/daemon/chat.c


How do I know what other muds use Dead Souls?


mudlist -m dead

See the creator's FAQ for more intermud command info.


I was hanging out in the Arch room and the loudspeaker went off. WTF?

Your mud receives all sorts of network requests from the
intermud network, such are remote who (asking who is logged on),
remote finger (info on users), locate (trying to find a user
somewhere on i3), etc. Whenever your mud receives such a request,
it used to be announced in the Arch room. If that is still happening,
you are probably not running a current version of the lib.

The current behavior is that network messages are
announced in the network room (below the arch room) and router
messages are announced in the router room (south of the
network room).

Note that these messages are normal,
and do not represent an attempt to undermine your security.


I want to test the intermud channel but I don't want to spam the ds line.

Type: ds_test test

The ds_test channel is specifically for communication
testing so that ds can remain spam free.


What's this "Network room"?

There is a room below the Arch room called the network room.
It is intended to facilitate troubleshooting of network
and intermud problems. Unless you're intimately familiar
with Dead Souls network code, I suggest avoiding this
room, as it is very messy and very noisy.


The web server and FTP server don't work

To enable them at mud boot time, uncomment the "inet" line in
/secure/cfg/preload.cfg

To enable it temporarily, type: update /secure/daemon/inet

These servers do not use the standard ports. The internet standard
http port is 80 and for ftp it is 21. Your mud ftp and web servers
do not use these.
Instead, the network port for your web server is 5 less
than your mud's port, and the ftp port is 1 less.
This means that if your mud is reached by telnetting
to port 6666, your ftp server will be at 6665 and your web server
will be at 6661.

Please note that the web and ftp server are not supported. They work,
but whatever security risk they pose is entirely on you.


I tried to log in to the FTP server but I can't!

Make sure you use your mud name and mud password, not the
username and password of the computer you are on.


I can't do anything with FTP. It just hangs there.

FTP is a funny sort of protocol. If you don't have a direct
connection to an FTP server (for example, you are behind a
firewall), you have to use PASV (or passive) mode. Unfortunately,
at this time, PASV is not implemented in the mud FTP server.


The web server gives me a 404 but I know the directory is there.

Like the FTP server, the web server is a very simple program.
It does not do directory listings at all. If you request
a directory, and it can't find an "index.html" file, it
just errors out.

It will also barf if a file you try to serve is
unusually large.

Let me make this point one final, excruciatingly clear time:
If you need a webserver, use apache. The mud www server is available
as a convenience, not as a production-quality standards-compliant
intarweb server.


I'm using an external FTP server, but the files I transfer
become read only!

You need to make sure that the FTP server you use
runs as the same user as the mud driver does, otherwise
you'll have permissions conflicts.


I moved a command from one directory to another. How do I get the new location recognized?

First, run update on the command in question.
then:
If it's not a verb: update /daemon/command
If it's a verb: update /daemon/verbs


The mudtime is all wrong!

The mudtime command tells you what time it is in the game, not what time
it is in the real world.


The time of day is all wrong!

If you used admintool to change your timezone and the time of day is still
wrong, you may be using an OS with timekeeping that Dead Souls doesn't
understand. If this is so, figure out how many hours off you are, and
enter that value into the EXTRA_TIME_OFFSET parameter in /secure/include/config.h

Also make sure to change your timezone during daylight saving
changes. For example, EDT to EST, and vice versa.


What happened to the roommaker and thingmaker?

They produced code that was often incompatible with QCS. They are no
longer supported.


I keep getting 'Connection to address server (localhost 9999) refused.'

This is a harmless error. Dead Souls uses a program called addr_server to
try to resolve hostnames. However, hostname resolution is not important
to running the mud, so it's not automatically configured. If you run
addr_server with a specific port as an argument, and edit mudos.cfg to
point to that port for the addr_server, then reboot the mud, then you
will probably have hostname resolution in your mud.

However, not all OS'es handle name resolution the same, so this may not
work, even if you do everything exactly right. Either way, it doesn't
affect the mud.


Can I charge players a fee for playing on my mud?

NO.

Dead Souls uses MudOS, and MudOS has a license that specifically
and strictly forbids its use in a commercial way. I don't care how
you use the lib, but if you use it with MudOS, you need to comply
with MudOS licensing. If you were to port Dead Souls to some other
driver that allows commercial use, then you'd be all set.

Can people donate money to me for the mud?

Yes.

So long as there is no quid-pro-quo, or anything
about the transaction that is legally regarded as "commercial",
receiving money from people for the purpose of running the
mud is ok. However, I am not a lawyer, so read the MudOS
license yourself.

You should not try to bend the rules. For
example, public television channels often give trinkets to
donors as a token of their appreciation. If someone donates
money to you for your mud and they get a "thank you gift",
this is a quid-pro-quo, or "something for something", and
it's not right.

This is a MudOS thing, not a Dead Souls thing.
If you can't abide by MudOS licensing, just port Dead
Souls to some driver that lets you do commercial stuff.
Then please tell me how you did it, so I can pass on the
leetness to others.


I found a bug. For real. Can you please fix it?

Email me: <put my name here>@comcast.net

Please include a detailed description of the bug, and the exact
error text and commands that produced it. A log file or
screencap would be helpful.


Where would I edit to change how long someone can be idle before they get disconnected?

1) Modify IDLE_TIMEOUT in /secure/include/config.h
Don't do this with a Windows editor.

2) update /secure/daemon/master

3) update -r /lib/player

Instead of the updates you can reboot the mud.


How do I permit all users who log in to become creators automatically?

1) Set AUTO_WIZ
in /secure/include/config.h to 1
Don't do this with a Windows editor.

2) update /secure/daemon/master

3) update /secure/lib/connect

Instead of the updates you can reboot the mud.


How do I limit the use of intermud channels?

1) Set RESTRICTED_INTERMUD in /secure/include/config.h to 1
Don't do this with a Windows editor.

2) Add the players who are allowed to use intermud channels to
the intermud group using admintool.

3) update /secure/daemon/master

4) update /daemon/services/*

5) update /daemon/services

6) update /daemon/intermud

7) update /secure/daemon/chat

Instead of these updates, you could just reboot the mud.


How do I get off intermud completely?

1) Set DISABLE_INTERMUD in /secure/include/config.h to 1
Don't do this with a Windows editor.

2) update /secure/daemon/master

3) update /daemon/intermud


How do I change the start room for the mud?

1) change ROOM_START in /secure/include/rooms.h
Don't do this with a Windows editor.

2) reboot the mud


I don't like having newbies get special treatment.

1) Set MAX_NEWBIE_LEVEL in /secure/include/config.h to 0
Don't do this with a Windows editor.

2) reboot the mud


I don't want players to be able to pick non-human races.

1) Set HUMANS_ONLY in
/secure/include/config.h to 1
Don't do this with a Windows editor.

2) reboot the mud

* Note that this will not affect players who are
already non-human.


I want everyone to speak the same language.

1) Set ENGLISH_ONLY in /secure/include/config.h to 1
Don't do this with a Windows editor.

2) reboot the mud

* Note that this may not affect players who already
are not native English speakers. To change them,
type:

call players_name_here->SetNativeLanguage("English")



I made a change to /lib/player.c and updated it, but I'm
not seeing a difference in my character.


If an object (you) is loaded into memory, it contains
the features and functions of its file and inherited files
at the time it was loaded.

Changing those files and updating them doesn't do
anything to an object that is already loaded using the
old code.

In a case like this, what you want to do is
recursively update the file of the object in question,
then reload the object.

Let's say you modified /lib/npc.c so that
npc's sit down by default. Say you want the fighter in
your test room to possess this new functionality.

If you type: reload -r fighter

then the fighter's file is recursively updated,
the current version of the fighter is whisked away, and
a new version of the fighter is created, incorporating
the new auto-sit feature.

If the change in question is to lib/player.c
or some other file inherited by you, you would
type:

update -r /lib/creator

But you are still using that same old body as
before, so you'll need to quit and log back in to
get a new body using the new code.


How do I change the items new players receive?

Look in /lib/player.c for the function that gives
new players jeans and a t-shirt. Modify this
function to suit you. Make absolutely sure that
the objects you put there actually clone
correctly.

Remember to bk /lib/player before editing this file,
because if you screw it, then log off without
restoring a working copy, you will be sad.


Hey, there's no <foo> class! What's up with that?

True, there is no samurai class, and in fact, as of
this writing there is no cleric, acrobat, frombotzer,
or basketweaver.

The reason for this is that the Dead Souls
mudlib distribution isn't intended to be 100% ready for
players to show up and start doing quests.

What quests there are, what races, classes,
areas, objects, rooms, and NPC's you find in the
distribution are examples. If you open your mud
to players and what you've got is the Orcslayer and
newbie mansion quests, you might as well just close down.
In fact, please do.

Dead Souls is a starting point for a mud.
I have no way of knowing if you're going to have
mermen in an aquatic-theme mud. I have no clue
whether your space aliens will have 8 tentacles or
16 (they like base2, dontcha know).

So, no, there's no <foo>, because the
responsibility for making the mud in your creative
vision is yours, not mine. My job is to give you
a lib with enough working examples and enough
documentation so that you can code your own
basketweaving bugblatter beasts.



Where can I get a Dead Souls mud hosted?

That's a heck of a good question. There are many mud hosting services
out there. I hear good things about MudDomain, but that isn't specific
to Dead Souls. A good host will have a high level of service, shell
and file transfer access, etc, for which you obviously will need
to pay money.

There there used to be one free mud hosting service I
was aware of, and that's FrostMud. It was basically a guy and a Linux
server with room on it for muds. However, there's some sort
of problem he has and it's going away.

There's no such thing as a free lunch. If you want
a reliably solid, well supported, feature-rich platform for your
mud, quit being a cheapskate and cough up the $20/mo. That's
like, what, one espresso every couple of days.

If you have a DSL or cable modem, and your computer is
up all the time, you can just use that, too. Your IP may be
dynamic, making it tough for people to find you, but there are
dynamic-dns services out there that help keep your ip
tied to a specific name.

If you're really hard up you can email me and beg for
me to host you for free, but you'll get no fancy schmutz like a
web page or shell access. And if your mud gets on my nerves
(being inactive for a long time is enough to do that) I'll just
wipe it. Possibly without even warning you. It's not that I'm
a jerk or I like being mean. I just don't have a lot of time
for nonsense.


Your LIB_MXLPLX system is all screwy. I changed it and it works. Wanna see?

Hell yes. I'm not just in this for my health. I want
more people coding in LPC so I can look at the fresh ideas and
new perspectives of other people (read: swipe code).

Send me an invitation to your mud by email or <ds>. I'd
love to look at your work.

If it is code you are willing to donate to Dead Souls, I
will gladly accept its submission, also by email. There's no
guarantee it will make it into any future release, but it just might.

Please be aware that by doing so, you signal you claim no
copyright to the code, allowing me to publish it and
preventing you from ever revoking my right to distribute it.

You also represent that no third party has copyright to
the code, and hold me harmless in any subsequent
dispute between you and any other third party.

If you want to email me code but wish to retain
copyright, please state so clearly in the body of your email. I
will honor that request
(and it's the law so I don't really
have a choice). Just be aware I will not put code into Dead
Souls that anyone other than me has copyright to. I can't
afford the risk of someone deciding I can't distribute
code that DS may eventually rely on.

Also, I don't want to hear from anyone about my
use of legal terms of art. I know damn well it's more complicated
than I make it sound. My phrasing is sufficient to make
the legal practical transaction of ideas possible here.


How are files organized in Dead Souls?

cd / and ls to view the top level directory. The
list may be largely meaningless to you, so let's review it here:

cfg/

General configuration files for timezone and such.

cmds/

Main location of commands that don't require special access
privileges. Commands are different from verbs in that they tend
not to manipulate your environment, but rather deal with
the player's relationship to the system and/or files.


daemon/

Daemons are files that provide access to data files in an
organized way. For example, adding an occupational class
(like, say, assassin) to the game needs to be done in a
precise way in order for it not to break things. By sending
the data to the daemon first, you can be sure that the
new system configuration is entered properly. Daemons also
provide a means to access data, like "how much is silver
worth compared to gold", that is uniform across the mud, and
prevents accidental overwrites of data files by multiple
editors.


doc/

General documentation.


domains/

This is where MUD game areas go when they are complete
and ready for general play by the public. Once here, only
admins have write access to the files.


ftp/

The base for the MUD ftpd. Using the ftpd is probably dangerous
in terms of your system security, and I discourage it, but if
you are determined to have mud ftp access for your creators,
this is one way. See /secure/lib/net for the actual server. It
may or may not work. I won't support it.


include/

Include files provide a set of constants for your files. For
example, if you include <damage_types.h>, you can specify in
the code for your chainmail that it protects against
the damage type "BLADE" at a certain level.


lib/

This is the heart of the Dead Souls lib. This is the location
of the files that your objects, be they swords, shoes, or
handguns, will use as their configuration base.


log/

Log files.


news/

Announcements are made here. For example, in /news/creator
you can post a notice that you have added a teleportation
spell, and when your creators log on, they will see the message.


obj/

Contains some important templates, especially some for the QCS.

open/

Legacy directory. Kept for compatibility. Historically this
directory has served as a place where creators can put code
for others to freely modify.


realms/

This is where creator home directories are.


save/

Files that describe properties of the MUD's systems live
here. The number of limbs that a bat has, for example,
is in races.o. In classes.o you'll find the skill ranges
for fighters. Do not edit these files. They must be
modified by daemons only, or you risk corrupting them.


secure/

This directory will be described in a separate section below.


shadows/

Shadows are a controversial feature of LPC. This directory
is designed for shadow objects, but they should be very
rarely, if ever used. Basically shadow objects are objects
that attach themselves to another object, intercepting
function calls. For obvious reasons this is a security
risk, so unless you really really know what you're doing,
avoid them.


spells/

Pretty self explanatory. The spells daemon looks for spells here.


tmp/

A directory anyone can write to. Generally for swapping
data between objects, systems, or people.


verbs/

Another controversial topic. Verbs are a kind of command. For
example, go and sit and open are verbs. Specifically, verbs
are commands that interact with the user's environment. The
idea is that throw my first red rock at the green goblin
should work, and should work the same everywhere on the
MUD. Verbs are a source of debate among some people, because
to folks accustomed to add_action commands, verbs seem
excessively complex.

www/

Like the ftp directory, but for the MUD webserver.


Ok now let's take a quick look at the /secure directory: ls /secure
As you can see, /secure seems to have many of the same directories
that the root filesystem has.
The reason a /secure directory is needed is that
there are files that should not be readable by everyone, and
there are files that must be writable only by a few. The MUD security
system uses the /secure directory as a means to control access to
such files.
For example, the average creator has no business
accessing the player data files of other creators or players. Therefore
/secure/save/creators and /secure/save/players is offlimits to them.

A directory without a counterpart in / is /secure/sefun. This
is where simulated external functions reside.


What are sefuns and efuns?

First let me explain that the driver has built-in
functions that are available to the mud. For example,
type eval return find_player("cratylus") , but replace my name
with yours. Your player object pointer will be found and returned
to you (more or less. strictly speaking it's more complicated).
The driver provides this function. Because it is "external"
to the mudlib, that is, it's in the driver and not the lib,
it is called an external function, or more commonly, "efun". The
idea is that certain actions you ask the mud to perform are
so common that they are made available MUD-wide.

Efuns are ridiculously useful and powerful, and because
they are in the driver as compiled code, very fast. A near-complete
set of efun documentation is available in /doc/efun.

However, the driver does not contain every possible
MUD-wide function you might want. For example, there is a
tell_object() efun, which lets you send a message to an object
such as a player. The syntax is something like this:

tell_object(find_player("cratylus"),"Hi.");

Which doesn't look like much, but believe me, this
kind of stuff adds up. I wanted to make this simpler, so I
used what is called a sefun, or a simulated efun. It is
a function that is available lib-wide, but it isn't in
the driver. Instead it is provided by the lib itself (the
master daemon, specifically). By adding the appropriate code
in /secure/sefun/ I have now made available a tell_player() sefun,
which works like this:

tell_player("cratylus","Hi.")

This simplification of code will become more obviously
useful to you as you get more coding under your belt. Most
sefuns are documented in /doc/sefun.



Whew! Ok now I know where stuff is. What's next?

You probably want to examine how objects are written.
Type goto /domains/town/room/road and wander around town
a bit. If you want to see the code for something, for example,
the beggar, about beggar should do it, provided the beggar is
in the room.

To see the filenames of the objects around you,
type scan here, or scan me to scan your own inventory.

If you've never coded before, this is the hard part.
To understand what you're looking at when you run commands like
more /domains/town/weap/orcslayer.c you need to get comfortable
with LPC.
The brute force way of doing this is copying stuff
and then changing the descriptions, thus making new stuff.
This will work, but you'll waste time looking for examples of
exactly what you want to do..and you may not find them.
Instead, learning LPC will let you create whatever
you want, without relying on templates.

This means that now you must read the LPC Basic
manual, then the LPC Intermediate manual. As admin, your
creators will expect you to know what's in there.

On your person or in the chest in your workroom is
the Creators Manual. Read both the Players Handbook and
the Creators Manual from cover to cover.

It's also important to read the Administrator's
Guidebook.


Oh, man, you're kidding! Those are, like, books! Can't I
just start making stuff?

Well...ok. But you need to go through the docs
soon, ok? In the meantime, read the QCS chapters in the
Creators Manual to get you quick-started in the creation
process. Remember you need to be holding your Creator
Staff in order to access the QCS commands.

Start with chapter 31, like this:

read chapter 31 in my manual


Everything is su-u-u-u-p-e-e-r-r-r s-s-l-o-o-o-o-w-w-w

First, make sure you are using the latest available version of
Dead Souls (check here). Older versions of Dead Souls
are known to have nasty memory leaks.

Next, see if you have runaway objects. An object can be coded
to do really unpleasant stuff like replicate itself over and
over until it brings the mud to its knees. Find out how many
objects are loaded by typing: eval return sizeof(objects())

If the count is in the thousands, and only a few people are
logged on, you may have a runaway. Most often this involves
NPC's doing stuff you didn't expect. Reset all loaded rooms
with the following command:

resetall

perhaps followed by a:

flushobs

If the lag clears up, you found the culprit. If not, see if
the callouts list is clogged with the command: callouts

If all else fails, reboot the mud and ask for help on the ds line.

Please note that the rage virus (especially if unleashed
in the menagerie) is notorious for redlining the mud. Having
hundreds of NPC's all engaging in simultaneous combat
while infecting each other with a rapidly spreading hostility
virus can be expected to impact overall performance. So please try
to avoid the rage virus unless you are specifically stress testing
your system.


Dude! One of my creators just kicked me off my own mud!

One of the virtues of LPC is that it is flexible and powerful.
One of the drawbacks of LPC is that it is flexible and powerful.

It is not possible to make an LP mud that is
immune to abuse from creators. You just can't. The MudOS
function set is just too complex and sophisticated to eliminate
every possibility of abuse.

You will therefore *always* be vulnerable to things
like people coding objects that crash the mud on purpose (I
won't detail how that can be done, but anyone with intermediate
LPC skill can do it, and utter newbies can even do it with
a stupid enough mistake), finding a way to dest admins, or
continually updating recursively the /lib filesystem. A
jackass will always find a way to expose you to her jackassery.

This means that you need to know who is coding on your
mud and what they are doing. Your job as an admin is to
immediately deal with coders who pose a discipline problem.
If they fool you once, shame on them. If they fool you
twice..the..they...they shouldn't fool you twice is what I'm
saying.

This does not mean that Dead Souls is somehow
impossible to secure. You can easily prevent unauthorized
access to lib data. See the next section for how this works.

What you can't prevent is some dude off the internet
you just met and made a creator from wreaking havoc on your
mud and creating a nuisance of himself. You have to know who
these people are and you have to have a level of trust and
confidence in them, otherwise you need to use the decre
command.


Is Dead Souls secure?

The short answer is no, nothing I know of is "secure" in the
sense that you don't need to continually pay attention to it. If the
question is "Is Dead Souls particularly unsafe to run?" then the
answer is no. Just like any other Internet program you use, Dead Souls
is not an obvious security risk, so long as it is not used carelessly.
And, obviously, games of any kind, including Dead Souls, should never
be installed on any mission-critical, national security, public
safety, or health care server.

Dead Souls security involves two separate spheres:

1) The binary executable and the system that runs it.

2) The mudlib and the code that you use and create.

The first sphere is probably most important. Presumably
you plan to run a mud on a computer that does other things too,
and you want to keep those things separate from your mud. The
most important thing to do is to avoid running Dead Souls as a
privileged user. In the case of Windows, this means that the
program should not be run by Administrator or anyone in the
Administrator group.
For unix users, this means that the driver should not run
under uid 0 (root).

The reason for this precaution is that if some genius
hacker manages to exploit some unknown weakness in the program,
it is better that the process they hack doesn't have full admin
privileges to the box.
This caution has little to do with Dead Souls specifically.
It is a warning I'd give to anyone planning to run any kind of network
server. You should take your own security seriously, and
if you do not understand your own security situation, you need to take
a step back and ask yourself if running a mud at all is a good idea.

Sphere 2 is lib security. In older muds, file and directory
privileges were handled by attributes on the files. If a file's
user id (UID) matched a user's UID, then that user had full access
to it. Such systems often had complex systems that evaluated
effective UID (EUID) based on the file's attributes, its parent
directory, the user's ID, possibly group id, etc. This is an
entirely valid security model, but because of its complexity,
it tended to be exploited easily and often. If you don't
stay 100% on top of such a system (just like any OS), there's
no way to be sure you won't rooted.

With stack security, privilege management is much, much
easier. A file's privilege is based solely on its location. If
a user doesn't have read access to /foo/bar/ then she can't read
or modify /foo/bar/file.c. If someone with privs to that location
copies the file to somewhere else, then the privs of that new location
are in force on the file.
The "stack" part of stack security comes from the mud
evaluating the privileges of all the objects involved in the
access request. If you're unprivileged and you manage to get a
privileged object to make the access request for you, the access
will fail, because you are unprivileged, and you are still part
of the function call stack (i.e., the list of instructions that
form a chain between the command and the intended event).

Granular (more detailed) modification of user privileges
can be done by changing files in /secure/cfg to grant
users and groups specific privileges.


I sent you my code a week ago. Is it in or out?

How long it takes me to review code submissions has nothing
to do with what I think of you, your skills, or your
code. It takes me a long time because Dead Souls isn't
actually my job, and is not a physical member of my
family, so it has to wait its turn sometimes, for my attention.
Sometimes I will get to someone else's code sooner even
though I received yours first. What can I say. Sometimes
I feel like dealing with a particular thing at a particular
time.


Did you finish the bfd() sefun modification I asked you for last night?

I'm on the ds line a lot, and generally accommodate people's
requests right away if I have time. This makes it seem
sometimes like I can turn orders around in minutes or
hours, like a short-order cook.
This is an illusion. I do this sometimes
for requests that strike my fancy or that are so simple
they are not inconvenient, or maybe because I happen to
be bored at that moment. But my sometimes doing this
doesn't mean folks should expect some sort of prompt
turnaround on special requests.
In general, I am not sitting at my desk waiting
for code orders. I'm doing something else. If I get to
your request right away, then good for you. If I don't,
then I'll get to it when I get to it.


The queeg daemon is a horrendous mess. It's inefficient and frankly offensive.

I'm not an especially gifted programmer. In fact, I view
myself rather as a Pakled from the Star Trek series. I
look for things that make the code go. I look for things
that make the code strong. Sometimes, because I am not
a trained or professional programmer, things are done
in a way that shock the conscience of more sophisticated
practitioners.
If you find such code (and I do hope it is rare),
bringing to my attention that it has been implemented in a
wretched way doesn't help me. I know that. I wrote it. If
you want to help, send me an email with the fixed code.

You implemented my code but didn't give me credit.

Whoops. Send me an email telling me where I goofed and I'll fix it.


Intermud mail doesn't work

No it doesn't. It's actually a pretty complicated system to
implement, so get used to just local mud mail for now. It
is definitely planned for the future, though.


The admintool menus let you pick options that aren't visible

I can't decide whether this is a feature or a bug. I'm
leaning toward "laziness".


What does locking the mud do, exactly?

When the mud is locked, only members of the authorized
groups are permitted to log in. By default, these
groups are SECURE, ASSIST, ELDER, and TEST. Anyone
who is not a member of these groups, whether they are
a creator or a player, is prevented from logging in.

To lock the mud, use the admintool command, option a.
To add people to groups, use the admintool command, option v.


The race help output is inadequate for role-playing. How do I change it?

By default, help human will output various characteristics
of the human race, as known to the race daemon. If you
want instead to provide your own help data on the history and
lore of humans, simply create a file called /doc/help/races/human
and put your information in it. That information will then
be what is displayed when requesting help on that race.


I need to know what features to expect in the next release so I don't
waste time duplicating effort

Visit http://dead-souls.net/RELEASE_NOTES for information on
the latest releases and what they contain. The topmost
version is usually not yet available for download, and
is listed so that folks know what's coming in the
next release. If this is so the version name will have
"(unreleased)" next to it.

As of 2.0r19, the dsversion command is available to
allow you to query that site from the mud itself.

To see what I'm working on, see http://dead-souls.net/plan.txt


You need a development roadmap and task tracking

No, I don't. If I had developers and teams and
such things, then I'd use all the fancy project
management stuff available on Sourceforge.
But I don't want to manage developers,
I want to lib code. If you want to help develop
the lib, then that's really great. Follow the instructions
from the previous question and look at my plan file
for something that looks interesting and that
doesn't have an asterisk. Tell me you'd like
to take that project, and I'll mark it as yours.
That's it. Send it to me when yer done.
If I get tired of waiting I'll tell you
I'm going to do it myself, like I was planning
all along, and you'll be relieved of that expectation.
Setting up some kind of sophisticated
collaboration tool to get 3 pieces of code from
2 people, and me having to be on people's backs
for results and stuff...this is not what I
signed up for and I'm not doing it.


How do I update a sefun without rebooting the mud?

To have your new nit_pick() sefun take effect in the
running mud, you might do something like this:

update /secure/sefun/nit_pick.c

update /secure/sefun/sefun.c


My new sefun updates but I can't seem to use it.

Make sure the sefun is prototyped in /secure/sefun/sefun.h

If the sefun is in a new file you created, make sure
that /secure/sefun/sefun.c inherits that file.


What's the point of the apostrophe-stripping for args in lib/command.c?

It's a cheap workaround for a parser problem. The full fix
is forthcoming.


How does one achieve 'high mortal' or 'ambassador' positions?

Those are legacy positions from Pre v1 Dead Souls. They are
basically groups, managed by an arch with admintool, which
can be granted privileges not normally enjoyed by mortals.
In the current implementation of Dead Souls, those
positions are vestigial. You can implement them on your
own mud however you please.


I would like XYZ and PDQ to happen every time the mud boots

The most common way to have this happen is to add
your daemon (and typically that's what you'll
want to start at boot) to /secure/cfg/preload.cfg .
This will ensure that it gets loaded
before the mud accepts any connections. It has the
added advantage of being included in the list of daemons
that the mud periodically checks and restarts if they
have died.

If it isn't a daemon, but rather some
specific function you want to happen at boot, simply
add the relevant code to /secure/daemon/autoexec.c


I can't login! I keep getting: "It seems some work is being
done right now, try later."

This is very bad. What this means is that some
files that are needed in order to load your player
object cannot be loaded. It can be any of a very large
number of files, which is the problem. Usually this
happens if you've been, for example, messing around
with player.c, then broke it, and rebooted the mud. Now
since player.c can't be loaded, you're locked out.
It could be any of the files loaded by your
player object, or other daemon files needed by your
login. The only way to narrow down the possible list of
files you corrupted is by examining the output of the
console (the window where you type the command line
to start the mud) and reviewing log/runtime and
log/catch for clues.
Once you've found the culprit, either fix it,
or replace it with the original version from the
Dead Souls distribution package.


I had a really great idea that revolutionizes ds and you
refuse to include it. I am forking ds development and
making my dream come true.

Ok then, have fun. All I ask is that you give your
project a name that isn't going to confuse people
as to which lib is which. Confusing your user base
isn't a good way to get started on such an enterprise.
Send us a post card once in a while.


What do the version numbers mean?

2.0r16 means "Major version 2, minor version 0, release number 16".
Releases happen pretty frequently, to add functionality and fix bugs
from the previous release. When the basic functionality of a minor
version is as bug free as reasonably possible, a new minor version
change happens.
Major version number changes are very rare and represent a
vast difference from the old major version. Versions 1 and 2 of
Dead Souls are so different as to be largely incompatible with each
other's code.
As of this writing, the goal of releasing version 2.1 looms.
The significance of this milestone is that Dead Souls 2.1 is
intended to be the fulfillment of the promise that there was in
version 1.1. After the release of Dead Souls 2.1, the focus of
development will be in adding major systems and functionality
that 1.1 was hoped to have, but never did.


The Dead Souls router is down. How do I switch back to *gjs?

Use the switchrouter command to change between
routers. The new default I3 router for Dead Souls muds is called
*yatmim. So far it's been dramatically more reliable than
the old intermud.org router, which is known as *gjs.
The advantage to *yatmim is that it is dependable
and the bulk of the Dead Souls community (a vital resource for
DS-specific technical support) uses that router.
The advantage to *gjs is that many more muds are
connected to it, and you can have more opportunity for random
chatting and gossiping. Also, the intercre channel on *gjs
is an excellent resource for general technical questions.
For more information on switching between routers, type:

help switchrouter

If the *yatmim router goes down for more than a
few minutes, make sure to check the router page to see if
the IP address or port have changed.

There's also a good chance that what has happened
is your mud's IP address has changed, and *yatmim interprets
your connection from a different IP as an impostor. Eventually
this will clear. You may have to wait up to 24 hours.

It is unwise for newbies to talk on intergossip
while connected to the *gjs router. I don't know how many
times or ways I can warn you about this. Please keep in
in mind.


I'm going to totally revamp <insert highly complex system here>.
Will that be difficult?

This is, surprisingly, a fairly common question.
Basically, the answer is:

"If you have to ask, then the answer is yes."

It's not an impossible task to, say, rewrite
combat to be just like the combat you're used to on LeetFooMud.
It's totally doable, and not *all* that difficult for
an experienced coder.

But if you're new to LPC, you need to concentrate
on getting the basics down before you put that cart in
front of that horse. Let me phrase it like this:

"If there's any part of the Creator's Manual you don't
know and understand, you aren't ready to do lib coding yet."

If you are at 100% grok with the manual, then
please read chapter 8 of the Admin's Guide to get started
on serious lib work.


I've hired an area coder to make a new domain. I want her
to be able to use QCS in /domains/MistyDragonShireMysts

The default behavior of QCS is to try to figure out
what directory makes most sense to write in. It assumes
that it's only going to write into areas you have write
permission to. Since your new coder doesn't have write
access to /domains/
MistyDragonShireMysts, QCS instead will
write to the next most logical place: her home area directory.

This is true even if you use the grant command
to enhance her access. QCS's authentication mechanism is
entirely separate from the grant/access system, which works
fine for non-QCS editing.

To make your new domain, use the domaincreate command:

domaincreate MistyDragonShireMysts

To enable your new coder to use QCS in that domain,
use the domainadmin command to manage the admins of that
domain. A domain may have more than one admin at the same time.

For more information on domainadmin, type:
help domainadmin

For more details on where QCS puts things, be sure
to read this Creator FAQ section.



How does player voting work?

The voting system enables players to nominate and
vote for class leaders. A Fighter can nominate and vote for
his Fighter leader, Mages can vote for a Mage leader, etc.
The nomination period usually lasts about a week, then
nomination closes and voting begins. Voting ends when
an arch enters the voting room (it's in Town Hall) and
issues the appropriate command. See the voting room printed
material for instructions.
When the voting is ended, the winner becomes
council member. The high council is composed of
representatives (the leaders) of the classes. What kinds
of authority the council should have is entirely up to
you and your mud. No default powers are enabled, you'll
need to code your own sets of privileges and responsibilities
for your councilors.
Because creators have no business meddling in the
affairs of mortals, they cannot vote, regardless of their
class affiliation.


What are "estates"?

Any references to estates in Dead Souls code or
documentation are artifacts of pre-1.1 Nightmare code.
Estates in the Nightmare lib were player-owned areas,
which were granted to players of specific rank, status,
etc who could afford to buy the rights to them.
There is currently no estate support in Dead Souls,
though it is on the post 2.1 feature list.


What are "events"?

Some things should happen regularly. Perhaps
log rotation, or backing up some .o files. The events
daemon, or EVENTS_D handles this. To add or remove
events use the add_event() sefun. For example, to add the
log rotation event, I issued this command:

eval return add_event("/secure/daemon/log","/secure/daemon/log","RotateLogs",({ }),7200,1)

Which said: "Every two hours, call the RotateLogs function in the log daemon."

To see what events have been scheduled, type:
events

To remove an event from the events schedule, find its
next runtime, and use it as an argument to the remove_event() sefun,
like this:

events

The following events are pending:
1145159511 RotateLogs Sun Apr 16 03:51:51 2006 EDT

eval return remove_event(
1145159511)
+
+
Where does user monitor data go?

When you monitor someone, or if you enable
GLOBAL_MONITOR, monitor data is logged into /secure/log/adm.


How would you set a race to be selectable by new players?

Edit the race file and have this line near the top:

PLAYER_RACE 1

Then use the removerace and addrace commands. For example:

removerace tauren
addrace tauren
+
For details:
help addrace


Where is emote data kept? Can I edit it by hand?

Emote data is saved in /save/soul.o

You must never, ever, edit an .o file. Period. It
is possible to do it without corrupting data, but I do
not condone it, I don't recommend it, and if you fux your
mud because you did it anyway, I won't support it.

If you edit an .o file, and now things don't
work, it is your own fault. If you didn't back things up
before editing system files, there's nothing anyone can
do to retroactively save your data.


What are .h and .o files? Where are they kept?

Files with the extension of .h are called header
files. They have code or variables that are helpful when
creating some things, so that an armor object uses
armor_types.h to load some useful information without having
to hard code it every time you make a piece of armor.
These global header files are most typically found in
/include or /secure/include , although local header files
that are specific to a particular directory (such as
header files for lib objects) are commonly found in an
./include subdirectory of the given directory.

Files with an .o extension are object persistence
files. They contain data, not code. There are some things
that happen in the lib that should persist across
reboots, such as races, classes, economy, etc. You could
just hard code this stuff, but what if you need to make
changes? What if your economy needs to be flexible to
accommodate inflation? What if you want to be able to
add or remove emotes on the fly?
Persistence files allow you to save data which
is subject to manipulation, but which needs to be available
in case the mud restarts.

Because .o files tend to contain information
that is structured and formatted in a very specific way,
they should never be edited by hand. They are intended to
be loaded and saved by objects like daemons. Monkeying
around with the contents of an .o file is an excellent
way to damage your mud.
Another reason to avoid it is that even if you
make a valid change, it's liable to be overwritten unless
you fully understand the daemon that uses that file.


But my friend forgot his password! I *have* to edit his playerfile!

Use the command: resetpasswd


How do I change my mud's name?

1) type: admintool

2) select the "Driver" menu option

3) select the "change the MUD's name" option

4) answer yes to rebooting


Help! I locked myself out!

For UNIX administrators, it is natural to create an
admin character for special admin tasks, and then use
a regular character for routine stuff.
There's nothing wrong with that, but if you
lock the mud, you'll need to have your regular character
be in either the ELDER or TEST groups in order to log
in. For more information on modifying groups: help admintool


What are the privileges associated with the groups in groups.cfg?

SECURE gives you 100% admin privs to the mud.

ASSIST gives you most. The assistant admin position can
be fine tuned by reading the security code in /secure/daemon/master.c
and modifying it to suit you. This should only be done by
someone who fully understands every line in that file.

ELDER is just a nice thing to have show up in the who list.

TEST lets the lib know you are a test character.

All members of the above four groups are permitted to log in when
the mud is locked.

INTERMUD lets the member use intermud, if RESTRICTED_INTERMUD
is enabled.

Any additional special groups or privileges you'll have to code yourself.


Why does the documentation refer to LIB_ARMOUR and armour_types.h?

The LPC documentation in the Creator's Manual was written by
Descartes. I have been reluctant to make any changes to it,
because first, it isn't mine, and second, deviations from the
current lib are very small.

In this particular case, you evidently have noted that
the lib uses American spelling for "armor". The original Dead
Souls distribution, version 1, and the Nightmare lib used the
British spelling of "armour".
Aside from finding it unnecessary and affected, I
felt it was distracting and potentially confusing for coders,
because it was the only word in the lib spelled this way. There
were no instances of "colour" or "honour", etc. Rather than
make things uniform by Britishizing them, I made them uniform
by Americanizing them.
To this day I don't know the reason for that original
spelling. It may be that Descartes intended to make a
distinction between, say, an armoury that sells things you
wear, and an armory that sells things you wield.
If I remember to, I'll ask him next time we talk.


Where are read/write restrictions kept?

The global perms are listed in /secure/cfg/read.cfg
and /secure/cfg/write.cfg . However, additional permissions
may be available to a user based on the access privileges
defined in a given adm/ subdirectory. See help grant for
more details on that system.


I need to test day/night descriptions, but I can't wait around all day.

Type: help ticktock


How can I change the default prompt? Can I make it dynamic?

The default prompt is defines in /secure/include/config.h .
It is static. Eventually a revamp of the command shell will permit
dynamic prompts (listing, for example, health status, or current
working directory) but for now that is not available.


What is "unguarded"?

Unguarded is the mechanism used to obviate the stack
security model. Under some tightly controlled circumstances, it
may be desirable to have an object access privileged data, even though
an unprivileged object is in the command stack.

When the unguarded() sefun is called, the object containing
the sefun overrides the security permissions on any other object
in the stack, allowing, for example, an unprivileged object
to read from your home directory.

See man unguarded for syntax and usage, and examine
files like /secure/obj/snooper.c for examples. Use with EXTREME caution.


Is intermud communication secure?

Not in the slightest. Here's how it works:

1) Whoever is running the router has 100% access to every bit
of communication that happens across that intermud network. All
messages are plaintext, and although I personally can promise
I don't read "private" messages, there is no way for you to
be sure I'm not lying.

2) All muds connected to an i3 router can hear anything that
is said on public channels.

3) Any admin on any mud has 100% access to the i3 packet data
that comes in and out, meaning they can listen to "private" tells
between someone on that mud and someone on another mud.

4) Nobody on any client mud is able to "sniff" or "snoop" data from
tells between other muds. If Alice@AlphaMud and Bob@BravoMud are
having a heated "tell" discussion, Carol@CharlieMud can't listen in,
even if she's an admin on her mud. However, Dave@DeltaMud is
the admin on the i3 router mud, and he can "hear" everything.

5) Local channels (cre, admin, newbie, etc) do not get broadcast
to the i3 router. There is one exception to this. Dead Souls 2.0r22
had a bug that did just this thing. This bug is not
seen in earlier versions, and later versions have been fixed to
prevent this. However, any local admin has full access to any
local channel.

6) Since this is all plaintext, anyone at all along the
network stream (you ISP, their ISP, etc) can listen in,
whether at the intermud point, or at the point where you
or your message target telnetted into their mud.


Therefore: do not tell secrets across intermud.


What should I not do?

There aren't too many "don'ts", but they tend to
be important, so try to follow these guidelines:

- Don't mess with /realms/template/ unless you know exactly
what you're doing. Breaking anything there will hose up
new creators. The same goes for /secure/sefun/make_workroom.c

- Don't let just anyone off the street become Creator. You
need to know and trust your builders.

- Don't let a week go by without a full backup of your mud.


+ - + Cratylus
+
+ Dead + Souls + Homepage
+
+ + diff -c -r --new-file ds1.1/lib/www/ds-creator-faq.html ds2.0r27/lib/www/ds-creator-faq.html *** ds1.1/lib/www/ds-creator-faq.html Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/www/ds-creator-faq.html Wed Jul 5 00:00:59 2006 *************** *** 0 **** --- 1,1059 ---- + + + + + Dead Souls Creator FAQ + + + + +
Dead Souls Creator FAQ, v3.2

Written by Cratylus @ Frontiers, March 2006
Updated July 2006.

Note: commands are displayed in boldface, like this: ls -a

What's this FAQ about?


There are common issues and questions that crop
up for most new creators. This document is intended to
ease or at least shorten what can be a steep learning
curve.


Section 1: Getting Started

1.1 My question isn't on here. Where can I get an answer?

1.2 The ds channel is too spammy. It's distracting me.

1.3 All I did was change one thing in a file, and now it won't update. Help!

1.4 The mud editor is confusing the heck out of me. It's too hard to use.

1.5 When I log in, everything is screwed up, and I can't do anything!

1.6 Ok, I'm a creator now. What am I supposed to do?

1.7 This is weird...where is the online builder? How does new stuff get compiled?

1.8 I explored around in /domains/Ylsrim and <XYZ> is broken

1.9 I explored around in /domains/town and <XYZ> is broken


Section 2: Code

2.1 What's the QCS?

2.2 SetUnique doesn't work.

2.3 I made a magic wand that disappears after 10 minutes.
But if a player logs out and log back in, they have another 10 minutes!
How do I fix this?

2.4 Where is it saved?

2.5 How do I add or remove emotes?

2.6 How can I tell what files something inherits?


2.7 How can I find the filename of something?

2.8 What's the largest integer usable by the mud?

2.9 How can I find out what functions exist in something?

2.10 object::init() is broken!

2.11 if(ob->GetFoo()) seems to break, but I don't know why

2.12 How do I add color to my descriptions?

2.13 How do I turn the integer 42 into the string "forty-two"?

2.14 Can I use !=NULL as a test?

2.15 I want to create and test a new command for the mud,
but I'm not admin so I can't put anything in the normal command paths.
What can I do?

2.16 How do skills work?

2.17 How do classes work?

2.18 How do virtual rooms work?

2.19 How are files organized in Dead Souls?

2.20 What are lfuns, sefuns and efuns?

2.21 Why are there more sefun doc files than sefun files?

2.22 I edited a file but now the reload command is complaining.

2.23 this_player()->GetName() returns "A shadow" when the player is invis.

2.24 Is there a sefun for making a whole string uppercase?

2.25 What is the difference between filter() and foreach()? How do I use them?

2.26 member_array() is returning exactly the wrong thing

2.27 I'm trying to add two mappings together and the results are bizarre

2.28 When str = "abc", str[1] is 98, not "b". What gives?

2.29 How do I make an array1 that is the same as array2 but without an element?

2.30 How do I pass arguments to a pointer in a functional?

2.31 What does the tc() sefun do?

2.32 How can I find out how many items are in an array quickly?

2.33 My SetRead isn't working

2.34 My SetEnters/SetSmells/SetListens isn't working

2.35 Can I nest loops?

2.36 What should I do or not do in my code?

2.37 How much different or heavily modified is Dead Souls than stock LPC?

2.38 Is there a way to change the "default exit" room messages?

2.39 This dummy item is not at all behaving like I expected.

2.40 Clan objects do nothing but screw things up.

2.41 My NPC's stats are all hosed up.

2.42 This squirrel is taking *forever* to kill.

2.43 My room should not be entered/exited by just anyone. How
do I control this?


2.44 I zapped a monster, but instead of being dead, now it's undead!

2.45 How does the format for race files work?

2.46 How does the format for class files work?

2.47 What do Properties do?

2.48 How do I add a prehensile limb to a player or NPC?

2.49 How do I make a room occasionally display messages?

2.50 My functional isn't working!

2.51 I've read the Creator's Manual but I still don't understand mappings and arrays.

2.52 Why are call_outs so bad?

2.53 Fine. How am I supposed to create timed events, then?

2.54 I need a list of all the functions available.

2.55 How do I make an object you can [ jump on | climb | etc ] ?

2.56 Where is the list of available skills? How do I add skills?

2.57 Where is the list of available classes? How do I add a class?


2.58 Where is the list of available races?

2.59 How do languages work? Is there a list of them?

2.60 When I try to call test->SetLanguage("Bozo", 50), it sets it to 100%

2.61 How do I update an .h file?


Section 3: Intermud and channel stuff

3.1 How do I know what other muds are online on intermud?

3.2 Hey, LeetFooMud is online! How can I tell if Biff is logged on?

3.3 That's weird...mudlist says LeetFooMud is there but I'm not getting anything back.

3.4 I heard there are intermud channels that talk between other muds,
not just Dead Souls muds. How can I use them?

3.5 How do I emote on a channel?

3.6 How do I see what I missed on a channel?

3.7 I am sick and tired of the intermud network going down. Please fix it.

3.8 I just wanna chat. Is there a dschat channel?

3.9 I'll spam if I want to. You're not the boss of me.

3.10 This guy keeps hassling me on an intermud channel


Section 4: Miscellanea

4.1 I'm fighting the beggar with my staff and he's kicking my ass

4.2 Someone amputated all my limbs and I can't do anything!

4.3 How do I change my class?

4.4 People are talking to me in gibberish, even though it says they're speaking English.

4.5 What's this about Biff "unknowingly" telling me something?

4.6 How do I find the location of a verb or command?

4.7 Where is the "exa" command? Where is the "n" command?

4.8 How do I get something to happen to a random person in a room?

4.9 My wandering monster escaped from my workroom! How can I find him?

4.10 I ran findobj on something but it says no environment. Where is it?

4.11 How do I update everything in a directory?

4.12 I don't like getting colors on my screen. How do I stop it?

4.13 Um...I want colors back now please

4.14 I can type 'n' and move north, but 'north' doesn't work.

4.15 Why is there a bunch of stuff in ROOMS_FURNACE?

4.16 How do I change my screen and terminal settings?

4.17 ZOMG this is the best mudlib evar how can I evar thank you?

4.18 Dude this mudlib sux0rz @ss. What a waste of my time.

4.19 I'm seeing a filename but I can't read it.

4.20 Is there a command to go back to your previous directory
without having to type it all out again?



Section 5: Building

5.1 QCS is putting stuff where I don't want it.

5.2 How do I make a blank room, instead of copying the current one?

5.3 How do I build an area?

5.4 How do I make a quest?

5.5 Where's Leo?

5.6 Where are the vehicles and mounts?

5.7 I'm having trouble adding meals to my barkeep with QCS.

5.8 I heard DS has stargates. Where's an example?


5.9 I created a vendor, but he isn't responding to the "list" command.

5.10 I gave room with a default smell but I cannot get any other smells in there,

such as 'smell object' for example


+
+
Section 1: Getting Started


1.1 My question isn't on here. Where can I get an answer?

There are four main ways to get specific answers:

1) Ask your mud's administrator, or other creators on
your mud by using the cre channel, like this:

cre does the flux capacitor use verbs or add_actions?

To know what local channels are available on your
mud, type: lines


2) Your mud is probably on the intermud3 network. If
your administrator has not restricted intermud channels,
you should be able to ask questions on the Dead Souls
intermud channel, with a command like this:

ds hi! can someone tell me what room Leo lives in?

3) If intermud is down, or nobody is answering, or
you have a bug to report, you can also try emailing
me, the author of this doc, at: <my name here>@comcast.net


4) If intermud is down, you can also log into the
Dead Souls demo mud at rugose.com 6666
This mud automatically promotes users to
creator status, allowing guests to get a feel for
what developing on Dead Souls is like.
You can try to log into that mud and see if anyone
is available to answer your question. Intermud is disabled
there, though, so you won't be able to use the ds line
to ask questions.


Important note about asking on <ds>:

Part of the reason this FAQ was written is that
people who ask questions on the ds channel often do not
realize that same question has been asked many times
before. If you ask something like "how do I read the
channel messages I missed?" without first bothering to
read this doc and others, you just might get a response
that's less friendly than you might have expected.
People on the channel really want to help you,
but if it seems like you're not willing to put in the
time to try to help yourself, they might choose to
ignore you until you gather some clues on your own.

Something else to remember is that we are not
on your mud and we don't see what you see. "Why won't
my workroom update?" lacks enough information to let
anyone try to help, but "when i try to update my
workroom I get <error message>" might.

Similarly, some things don't have an answer
that is suited to ds. "could someone help me
understand the score.c file?" or "how do quests work?"
have answers that are long and complex, or are
already covered in the documentation available
to you.

Some stuff just doesn't have an answer
that can be explained to you unless you already
have the experience you'd need to know the answer.
for example:

- How do I make a stargate that has a dial for
going to different places?

- How do I make it so a player can be on different
planes of existence, and what they see when they
look around depends on what plane they're on?

- How do I add limbs so people can wear stuff
like kneepads on the knee only?

These three questions illustrate things that are
totally doable, but whose explanation is so
complex and full of judgment calls that there
is no way of satisfying the question without
making you magically understand intermediate-level
LPC coding.
That doesn't mean they're bad ideas, or
even that hard to implement. It's just that
the questions can't be answered until you read
and understand the Creator's Manual, and by that
time, you'll know the answer on your own.

Make sure you've read the docs, then ask
the question in a way that makes it clear you aren't
just a lazy person who wants other people to do her
work, but rather a hardworking builder who has
tried to fix something and needs a specific answer
to a specific question that isn't already in the
FAQ's or the docs.

Critiques are welcome, but they should
be constructive. "This combat system is slow and
stupid" is unhelpful and might be taken as a
hostile statement. Instead you could phrase it
in a way such as: "Combat is slower than I
expected. Why? I used to play on LeetFooMud and it
took less than a minute to kill Tiamat." It's still
a bit clueless, but it's a fair question that can
be answered on its own terms without starting
a flamestorm.


The ds channel is too spammy. It's distracting me.

Enable or disable a channel by typing just its name. Like:

ds


All I did was change one thing in a file, and now it won't update. Help!

You should make it a habit to make backup copies of files
before editing them. That way, if you screw up the code, you can
just copy the backup to the original filename.

A convenient way to do this is the bk command. See
the debugging page for an example of its use.

If your file is in the /tmp directory, it won't update.
The lib uses /tmp for temporary system files, and as
a result, it is a security feature that files in /tmp can't
be loaded into memory.

If you are using Windows, you need to be aware of the
linefeed problem. unix text files and DOS text files have different
formatting. If you edit files in Notepad, then try to update them,
you may find that the file no longer updates, no matter what
you do. The difference is usually invisible to you, so you can't
tell why a file that looks exactly the same as before now won't
work.

Dead Souls expects unix-formatted text, and if you feed it
something else, the results aren't likely to be to your
satisfaction. Make sure you use an editor that respects unix
text. In Windows 2000, WordPad seems to do a reasonable job of not
completely screwing things. It does, however, add carriage
returns to your lines, so when you look at them in ed, you'll
see a bunch of "^M"'s all over the place.

Take a look at the third party downloads page for
some suggestions as to what to use instead of the default
Windows editors.

If you still have trouble, take a look at the debugging page.


The mud editor is confusing the heck out of me. It's too hard to use.

Check out the MUD Editor tutorial. It should ease the pain a little.


When I log in, everything is screwed up, and I can't do anything!

This happens sometimes when you log out while carrying an object
with broken code. If for example, you are wearing a vest, and then you
edit the code for it, but it doesn't work anymore, then you log out,
what happens is the next time you log in the mud will try to restore an
item in your inventory that throws an error, and your login
gets stuck halfway.

If you find that when you log in things are all screwed up for
you, use the rescue login feature. For me, this means I would
login as cratylus_rescue instead of cratylus. My inventory
will get wiped before my playerfile is loaded, and I'll
be able to log in with no problems.

If this doesn't work, there's a good chance that the room
you're spawning in has a problem. Try quitting and logging
in again. If that works ok, then it's very likely the
room was at fault. See if there are any messages in
/log/runtime pointing to it.


Ok, I'm a creator now. What am I supposed to do?

Ask your admin.

If you're like most other creators, you have
a creative vision you want to implement and share with others.
you want to create dragons, or spaceships, perhaps dragons
in spaceships. This makes you a "builder".

As a builder, your job is to learn how your mud
works so you can get your neat ideas turned into a
virtual reality. As you might have guessed, nobody is
going to jack into your brain and upload coding ability
into you. You need to learn how to move around, how
the creation system works, and yes, you'll need at least
some passing acquaintance with the stuff your mud is
made of: files written in the LPC language format.

The good news is that it's nowhere near as hard
to learn as C++. LPC is very powerful, but it doesn't
require you to be a master to get simple things done.

Your first steps as a new creator probably should
go something like this:

1) Talk to your admin. Understand what is expected of
you, and what the rules of your mud are.

2) Go to your workroom by typing: home. Read the helpful
notes that are posted there for you.

3) Read the Player's Handbook, cover to cover. It isn't
long, and you will need every bit of information in there.
This is not a suggestion. You need to read the handbook.

4) Open the chest in your workroom, and play around
with the tools and toys in there. Having read the
handbook will help you deal with any issues you have
handling these items.

5) Type wiz to go to the Creator's Hall, and if there
are any posts on the board, read them. To read the
first post: read 1. To read the second, read 2, and so on.
If you decide to write on the board,
remember that to exit "writing" or "input" mode,
you need to enter a dot on a line all by itself,
like this:

.

6) Once you get a feel for how to move around,
what playing here is like, and how to do stuff, you
can start exploring your creator powers. To get
a grasp of the very basics of navigating through
files and directories, type:

more /doc/BASICS

Yes, you must include capital letters. Dead
Souls distinguishes between upper and lower case
letters in filenames.

To get a feel for what Dead Souls LPC code looks like,
wander about town and use the about command to read
code that compose the objects there. For example:

goto /domains/town/room/road

about here

about beggar

Or move around in your own home
directory and check out the defaults and templates
there:

cd /realms/<yourname>/area/npc

more fighter.c

To bring a copy of that fighter to life:

clone fighter

To make him dance:

force fighter to dance

To kill him:

zap fighter

To get rid of his corpse:

dest corpse

7) Once you're done having fun with your godlike
powers, it's time to start learning how to make
fun stuff of your own.

For a quick start in building, you
can start reading the Creator's Manual at
chapter 31, which is where the QCS section begins:

read chapter 31 in manual

read chapter 32 in manual

and so on.

That's fine to start with, but eventually
you'll need to read the whole Creator's Manual.
If you don't, 90% of the questions you ask about
code could be fairly answered with: "read the manual."


This is weird...where is the online builder? How does
new stuff get compiled?

Dead Souls can be very strange to people used
to non-LPC muds. This is because many other kinds of
muds use a system where the mud is written in C++,
and to make changes, you need to add C++ code to the
source, recompile it, then reboot the mud.
In that kind of system, building is done with
tools where you fill in blanks and code is generated
for you. I presume that some C++ expertise is
required for doing anything unusual or fancy.

If you come from this kind of environment,
you may be in for a little disorientation. On a Dead
Souls mud, there is no need for compiling code. You
don't need to reboot the mud for new stuff to
be available.

You can add your new Orc God of War to the
game (after you code him, of course) with two
simple commands:

update /realms/<you>/area/npc/grimmash.c

clone /realms/<you>/area/npc/grimmash.c

You're now face to face with him. This makes
Dead Souls, like most LPC muds, very flexible in
what can be done, and very stable in terms of
needing few reboots. Reboots typically are
necessary only when someone breaks important
code, or to implement major mud-wide changes.

So, just write your code, and update it.
It's that simple. There are two main ways to do
this. The easiest way is with the QCS, or quick
creation system. With the QCS, you don't even need
to look at code. You just issue a few commands,
and your new whatever is there. Check out an example
of the QCS here.


To learn the QCS, read the Creator's
Manual starting on chapter 31.

The other way to create on-line is
with the ed command. The ed editor is a powerful
and flexible way of editing files. Some people
find it difficult at first, and you might even
be able to avoid it for a while if you mostly
just use QCS. However, you'll eventually need to
know a little about ed. For a tutorial, go here.

For more detailed documentation,
type: help ed


I explored around in /domains/Ylsrim and <XYZ> is broken

Ylsrim is kept in the distribution as a kind of
sentimental artifact. It's the demo area that the
original Dead Souls shipped with, and although
it's mostly been fixed up to work with Dead Souls 2,
things can behave unexpectedly. There will be
no new fixes to Ylsrim. Please consider it a museum
exhibit that stands as-is.


I explored around in /domains/town and <XYZ> is broken

Please send me an email and let me know, so I
can fix it. Also let me know if something in the default,
campus, or examples domain is hosed up.

+
+
Section 2: Code

What's the QCS?

Please see the QCS example page for an explanation of this
important Dead Souls system.


SetUnique doesn't work.

SetUnique() is probably doing something you
don't expect. When an item is loaded into memory, and
it has an inventory, it first checks each of those items
for whether it's supposed to be unique.
If it is supposed to be unique, then we look
through the list of loaded objects to see if there is
one of these items already cloned. If there is, then
we don't clone a new one.
What this means is that if I kidnap Leo the
archwizard and hold him in my workroom, another one will
not appear in the basement until my Leo is dested.

Note, however, that this does NOT mean that the
mud will never have two Leos. I can clone however many
Leos I want. But as long as one or more cloned Leos
exist, the basement will not make another. That's
what SetUnique means.

Now, if the behavior you're seeing is different
from what I described, maybe SetUnique is broken,
and you should email me with what you're seeing.


I made a magic wand that disappears after 10 minutes.
But if a player logs out and log back in, they have
another 10 minutes! How do I fix this?

What's happening is that you are keeping
track of how old the wand is, perhaps with a
variable named Age. But if the player quits and
logs back in, then the wand gets cloned again, resetting
all its values, including Age, to the original.

The way to make the Age variable survive
logouts is with AddSave. If you give your variable to
AddSave as an argument, that variable gets saved when
the user quits, and when they log back in, it is restored,
preventing cheating.

See /obj/wed_ring.c for an example.


Where is it saved?

In the player's playerfile, along with the values of all
the objects they were carrying when they quit. The file is
in /secure/save/[ players | creators ]/<first initial>/<name>.o


How do I add or remove emotes?

That is an admin job. You admin would use the
addemote or removeemote commands.


How can I tell what files something inherits?

Use the showtree command. To know what files
are inherited by your robe, for example:

showtree /domains/default/armor/robe


How can I find the filename of something?

If it's in your environment: scan here
If it's in your possession: scan me

The number sign (#) and numbers at the end are that
object's unique identifier.


What's the largest integer usable by the mud?

2147483647


How can I find out what functions exist in something?

Get its filename and use the functions efun. For example:

eval return functions(load_object("/domains/town/obj/sign"))


object::init() is broken!

It isn't really. Unless you're coding a lib
item, you should not be inheriting LIB_OBJECT for
"tangible things" anyway. You should inherit LIB_ITEM.

The reason object::init() fails is that LIB_OBJECT
doesn't have an init() function to call.


if(ob->GetFoo()) seems to break, but I don't know why

This function will error if ob does not exist. Unless
you are 100% positive ob will exist (and really, even if so),
it should look like this:

if(ob && ob->GetFoo())

Which means "if ob exists, and it has a foo".
This way, if there is no ob, the check stops right there
without getting hosed up on the next step.


How do I add color to my descriptions?

There are various markup tokens you can use for this. They look like this:

write("%^BOLD%^GREEN%^ This text would be in bold green letters %^RESET%^ and this would not.");

To make text blink, use this tag: %^FLASH%^

The %^RESET% is important. Without it, unpredictable things can happen.

To know what colors are available, type: colors

You should probably avoid color unless there is a compelling
reason for its use. Many mud admins discourage it because it can
distract from the game and cause uniformity issues: most mud
admins feel their mud text should look more or less
the same everywhere.


How do I turn the integer 42 into the string "forty-two"?

cardinal(42)


Can I use !=NULL as a test?

In theory, I guess so, but I doubt it'll work by default, and I'd
discourage you from doing anything so non-LPC-standard.
Instead try something like one of the following:

if(variable)
if(sizeof(variable))
if(variable != "")


I want to create and test a new command for the mud,
but I'm not admin so I can't put anything in the
normal command paths. What can I do?

Put your new command in your homedir's cmd/
subdirectory. A sample command is there already
to serve as a template. When you add a command, type:

update /daemon/command

for it to show up in your path.


How do skills work?

Skills are generally class-based, meaning that they are
specified in the class files found in /secure/cfg/classes.
Skills are only meaningful in terms of library objects that
understand them.

For example, a fighter's blade attack is useful because
player.c and combat.c make use of this skill as a
modifier.

But adding a basketweaving skill to a class is not
helpful unless there are library objects (looms, perhaps,
or straw) and verbs (weaving, maybe?) that make
use of that skill.

There are also race-based skills, such
as poison bite or breath attack. These skills are
specified in /secure/cfg/races.


How do classes work?

Basically, having a class gives you special skills.
That's it. See the above section, "How do skills work?"


How do virtual rooms work?

Virtual rooms are rooms generated on the fly by a
virtual room server. You program that server with
the room descriptions, the number of them,
etc, and the virtual server can make available
a grid of rooms with your descriptions.

This allows you to create, for example,
a vast desert, or a large jungle, comprised of
dozens, or hundreds, or thousands of rooms
without having to manually code each and every
single room.

For an example, take a look at

/domains/town/virtual/


How are files organized in Dead Souls?


See the admin FAQ.


What are lfuns, sefuns and efuns?


Sefuns and efuns are functions available to all objects on the
mud. Any object may need to know what time() it is, so rather
than have a time() function in every file that needs it, which
could be many, there is a time() function built into the
game that any object can use. An efun is built into the
driver, so there is no LPC code to look at. A sefun is a
simulated efun, coded in LPC. Sefuns are kept in /secure/sefun.

Lfuns are functions specific to library objects. A shirt,
for example, has functions that a sword may not need, so
the LIB_ARMOR and LIB_WEAPON files contain their own functions,
not shared by other files (it's more complicated than this,
but that's the idea). These functions are library
functions, or lfuns. Typically they are found in the objects
defined by the files in /lib.

For a lot more detail on efuns and sefuns, see the admin FAQ.


Why are there more sefun doc files than sefun files?

Sefun files, like /secure/sefun/strings.c, often contain
more than just one sefun. Therefore, there will be more
files documenting individual functions than there are
files containing sefuns.


I edited a file but now the reload command is complaining.

There are two commonly used commands for loading
objects: update and reload.

When you want to load a file into memory, you use
update, for example: update /domains/default/room/road

When you want to replace a cloned object with a
version that uses the latest code in a file, you
use reload, for example: reload my first red sword

reload doesn't work on files.

update doesn't work on cloned objects.

The reason there are two commands, instead of one all-purpose
one, is both historical and functional. The reason "reload"
exists is that I got sick of having to dest a thing, update
its file, then clone the thing every time I wanted to
test changes in its code. This was annoyingly tedious, so I
coded the reload() sefun and reload command.

However, update works just fine, and I wasn't about
to try to fix something that wasn't broken. It works, and
LPC old timers are used to it.

Further, it has a function sufficiently separate from
reload that it stands as a command on its own merits.


this_player()->GetName() returns "A shadow" when the player is invis.

Use this_player()->GetKeyName() instead.


Is there a sefun for making a whole string uppercase?

upper_case("omgwtfroflmao")


What is the difference between filter() and foreach()? How do I use them?

Both of these efuns can act on the individual members of an array.

For example, if you wanted to have an array named mystuff which
contains the filenames of all objects in your inventory that
inherit LIB_ARMOR:

using filter:

object *stuff = filter(deep_inventory(this_player()), (: inherits(LIB_ARMOR,$1) :) );
string *mystuff = filter(stuff, (: base_name($1)+".c" :) );

using foreach:

string *mystuff = ({});
foreach( object ob in deep_inventory(this_player())){
if( inherits(LIB_ARMOR, ob) ) mystuff += ({ base_name(ob)+".c" });
}

There are arguments favoring the use of either. I won't get into
it. As far as I can tell, it's really a question of preference.
You can structure these functions more elegantly
than shown here, to best suit you. But this is the idea.


member_array() is returning exactly the wrong thing

It probably isn't. member_array() seems somewhat counterintuitive
at first, because it often returns a 0 as a "hit".

What this function is doing is checking to see whether the
first argument is a member of the array specified in the second
argument, and then tells you *which* element it is. for example:

member_array( "bar", ({ "foo", "bar", "baz" }) ) returns: 1

member_array( "foo", ({ "foo", "bar", "baz" }) ) returns: 0

Why does it return 0? Because "foo" is element 0 of the
array. If this_array == ({ "foo", "bar", "baz" }), then
this_array[0] is "foo". So member_array("foo", this_array)
would return 0.

If the first argument is not a member of the array, member
array returns -1. So that:

member_array( "shiz", ({ "foo", "bar", "baz" }) ) returns: -1


Example:

Does this player know how to polka? Return 1 for yes:

RIGHT: if(member_array("polka dancing", this_player()->GetSkills()) != -1) return 1;

WRONG: if(member_array("polka dancing", this_player()->GetSkills()) ) return 1;
 
The first way says "If 'polka dancing' has an element number that isn't -1,
then it is a member, so let's return 1"

The second way says "If 'polka dancing' has an element number that isn't 0,
then it is a member, so let's return 1"

The problem with the second way is that it is possible for "polka dancing"
to be element 0 in that array, and if it is, your code will incorrectly
tell you that you can't polka dance. But worse than this is that if
you actually can't polka dance, this second way will incorrectly tell
you that you can. Given random input, the second way would be wrong more than
half the time.


I'm trying to add two mappings together and the results are bizarre

Adding mappings together has to be done just so in order for
it to work the way one might expect. What can happen in
mapping arithmetic is that in the process of trying to
add the values of one mapping to another, you can change the
values of a mapping you didn't intend to. The deal is a
conflict between passing data by reference or by value. To
be sure that you don't accidentally modify an innocent
bystander, use the add_maps() sefun. For example:

MyMap = add_maps(HisMap, HerMap);

or

MyMap = add_maps(MyMap, HerMap);


When str = "abc", str[1] is 98, not "b". What gives?

What you're getting here is the ASCII code of element 1.
If you have to have that element as a string, use the
convert_ascii() sefun, like this:

convert_ascii(str[1])

You can instead use ranges, so that:

str[0..0] == "a"
str[1..1] == "b"
str[1..2] == "bc"

If you use ranges, do not use the convert_ascii() sefun.


How do I make an array1 that is the same as array2 but without an element?

Two ways:

1) array1 = array2 - ({ element });

2) array1 = filter(array2, (: $1 != element :) );


How do I pass arguments to a pointer in a functional?

With commas, like this:

(: eventKill, player :)

Your arguments will likely need to be constants, tokens, and/or global variables.


What does the tc() sefun do?

It's something I coded for myself long ago, basically
a personalized debug(). However, people have been
asking for that functionality for themselves, so
the debug() sefun now carries this functionality. For
more information, type:

man debug


How can I find out how many items are in an array quickly?

sizeof(array)


My SetRead isn't working

You may need an item for each read. For example,
SetRead( ([ ({"alpha", "bravo", "charlie"}) : "Delta.", ]) )

May need something like this *above* it:

SetItems( ([ ({"alpha", "bravo", "charlie"}) : "A thing you can read.", ]) )


My SetEnters/SetSmells/SetListens isn't working

See above.


Can I nest loops?

Can you? Probably. Should you? Almost certainly not.
For loops and while loops are legal LPC, and you may even
see them here or there in older lib code. But they
should be avoided because they generate much more
lag than the more efficient foreach() and filter() efuns.


What should I do or not do in my code?

1) Avoid using call_out() as much as humanly possible.
Use heart_beat() to time things instead.

2) Don't code stuff that replicates itself.

3) Don't code stuff that circumvents security. For
example, knowing that an admin is logged on but
invisible isn't much help to you if he bans you
for coding a tool to find him.

4) foreach() and filter() are faster than for() loops,
and harder to screw up.

5) switch() is faster and more economical than if()
for multiple evaluations.

6) Don't use callouts.

7) Don't use add_action for something that already
has a verb. There is no point in making an add_action
for "throw", for example. It's just going to confuse
players when your "throw" doesn't behave the way
"throw" does everywhere else on the mud.

8) Callouts are bad, mkay?

9) Don't code delays by using loops. This affects the
whole mud. If an action is to be delayed, use heart_beat().


How much different or heavily modified is Dead Souls than stock LPC?

This is a difficult question to answer on its own terms. It's
roughly equivalent to:

Is Fedora different from stock UNIX, or will my Solaris programs work on it?

This DVD movie is in NTSC format, so my TV can handle it, right?

The terms used roughly correspond to the same
general thing, but the assumption here is that there is a
"stock" LPC, and you can transplant code from one LP mud to
another.
Sometimes these transplants can be done. Oftentimes not.
This is because LPC has been interpreted and implemented in
many slightly different ways by many slightly different versions
of many different drivers. The end product of the DVD is a movie
playing on your TV, but how it gets there is very different from
how a videocassette does it, even if it's the same movie and its
signal is encoded in NTSC in both cases.

If you have two LPmuds that use different drivers, it
can be much like the difference between a DVD and a videotape.
Sometimes, if the drivers are related, the difference is smaller,
like VHS versus Betamax, but you'll still be embarking on a
major project getting the movies from one to play on the other.

The result is that a coder from Discworld and a coder
from Nightmare can roughly speak the same language, and discuss
solutions to their problems that make sense. And each coder
could probably visit the other mud and work with a very
small learning curve.
But the code itself would probably require substantial
retooling to be interchanged.


Is there a way to change the "default exit" room messages?

Yes, but it involves some understanding of LPC. See
if Brodbane@Eve is listening on the ds channel. He
may have some tips.


This dummy item is weird.

Dummy items *are* weird. They exist because the
parsing system requires objects to act on. When you "look
at painting", the parser doesn't take "painting" as a
string to match. Through a magical mystical process
deep in the MudOS driver, the parser turns "painting" into
an object to act on.
It tries to find object in the area that match
this keyword, and if it finds one, it sends that object
a query about whether it can be looked at. Depending
on the response, the parser continues on to determine
what the verb (the command you issued) thinks should
happen to objects that can be looked at, and tries to
evaluate that event with the object as its target. The
process continues in a complex dance of "may I?
how so?" etc, until finally the painting, the verb, the
parser, and you come to an agreement as to what the
result of this looking should be.
Crucial to this process is that the painting
actually *exist* as an object, so it can be queried
for various functions. Without a "painting object" in
the room, there's no parsing that's going to
happen with it.
But what if this painting is just part of the
room description? You don't want to add a painting
to the inventory of a room just so people can look
at it. You want people to be able to "look at painting",
or "look at wall", or "look at ceiling" without
having to have all of these items be part of the
room's inventory. What a chore that would be!
This is where dummy items come in. They are
invisible objects that are set to respond to the names
they are assigned, such as "ceiling", "wall", etc,
handling the job of providing a description when
a person looks at the ceiling, wall, etc. These kinds
of dummy items are automatically created when a room
is loaded, based on what the SetItems directive of
the room contains.
You'll also find dummy items for special
tasks, like a dummy button to push in the town church.

Because of this specialized role, dummy
items are not intended to be picked up or manipulated
the way regular items are. If you clone a dummy
item, it's not going to behave the way you want
it to. A dummy item should only ever be brought into
existence by your code, not by the clone command.

 
Clan objects do nothing but screw things up.

Quite right! If you don't code a clan object
properly, it's extremely likely to have little effect
aside from screwing up a player's savefile so badly
that it needs to be destroyed.
Why is this? Clan object code is basically
legacy guild code from Dead Souls 1.x. In the old
versions of Dead Souls, guilds were player-run
institutions, operating basically as clubs, with
guild objects as a kind of membership token.
The version of LIB_GUILD that came with
Dead Souls 1.x was fatally buggy in various ways.
The most important way is that even if you got it
to work right, it did nothing useful. There was
no interaction with a guild or player daemon,
so if the guild leader quit, they lost their
guild leader status. Aside from holding an object
which designated them as a member of a particular
guild, LIB_GUILD provided no advantage.
I renamed it to LIB_CLAN, because as a
social-club object, that's a bit closer to its
role than "guild", which tended to cause much
confusion.
Eventually there will be a CLAN_D, and more
sophisticated error handling to prevent character
file corruption. For now (version 2.0 of Dead Souls),
just avoid using it.


My NPC's stats are all hosed up.

Make sure you have SetLevel() *after* SetRace() and SetClass().
Also make sure there's a working ::create() in your create
function. Some examples are:

::create();
npc::create();
vendor::create();

And make sure your init() function has an:

::init();


This squirrel is taking *forever* to kill.

The mud is calculating its health points based on level and
race. If your squirrel has 340hp, it'll seem unreasonably
tough. Use SetMaxHealthPoints() to cap its vitality to
something like, say, 5.


My room should not be entered/exited by just anyone. How
do I control this?

There are a couple of ways of controlling entry to a room.
Take a look at the "AddExit" method in:
/domains/town/room/valley.c

And also review the "CanReceive" style in:
/domains/town/room/wiz_hall.c

To prevent a room being exited unless certain conditions
are met, use CanRelease().

These strategies are not discussed in detail in the Creators Manual,
but the examples above should provide ample information as
to how to structure them.

Note that in general, objects with a CanReceive() override
should return ::CanReceive() unless there is a
good reason otherwise. It would look like this:

int CanReceive(object ob){

<if blah return 1>
<if bleh return 0>
<etc and so on>

return ::CanReceive();
}

Obviously the stuff between the <> symbols is pseudocode and
not LPC.


I zapped a monster, but instead of being dead, now it's undead!

Take a look at the code for this NPC. It probably has
eventDie() overridden in a way that does not return 1. This is
not necessarily wrong. You may *want* a monster that doesn't
die like normal monsters do. But if this behavior is unintended,
that is probably the cause.


How does the format for race files work?

Here's a template with parameters in parentheses for clarity:

RACE (race name here)
SENSITIVITY (low light threshold):(bright light threshold)
LANGUAGE (self-explanatory)
RESISTANCE (damage type):(how resistant we are to the damage)
STATS (name of the stat):(the average):(how important. 1 is high)
LIMB (limb name):(where it attaches):(how important. 1 is high):(armor types)
SKILL (skill name):(unused):(how important. 1 is high):(unused):(unused)

The unused fields in the skill section are reserved for
future implementation.

If the third field in the LIMB line is 1, losing that
limb will cause immediate death.

Special keywords can be appended for particular functionality.
These are:

FLYINGRACE (enables flying)
LIMBLESSRACE (enables limbless travel)
LIMBLESSCOMBATRACE (enables limbless combat)
NONBITINGRACE (some races can't or won't bite)
PLAYER_RACE 1 (enables the selection of this race for players)

Please note that while the LIB_BODY object does
specify a number of fingers, they aren't items that
can be severed, and their purpose mostly is determining
what kind of gloves you can wear.


How does the format for class files work?

Class files have only two types of
entry lines that Dead Souls currently supports.
The first is the name of the class.

Every line after that is presumed to be
a skill specification line, in the following
format:

skill name:starting level:importance to the class


What do Properties do?

Properties are a way to provide flexibility in
the lib. Objects usually work by having variables
that are modified by functions. This allows a player
to have, for example, a SpellBook variable which
contains the spells she knows, and this variable in
turn is affected by "spell learning" functions, etc.

Suppose, however, that I want to set a
variable in a player, but that variable does not
exist. This is tricky indeed, because it would
involve a modification to one or more library objects,
and reloading them...possibly requiring re-logins
or (very rarely) even rebooting the mud.

Instead you can use properties as a quick
and dirty way to get that functionality without
rewriting lib objects. For example, if you do
something like this:

present("lamp",this_player())->SetProperty("blessed", 1);

Then that lamp is blessed, and maybe now
a monster has a function like this:

if(present("lamp",this_player())->GetProperty("blessed")) RunAway();

SetProperty() and SetProperties() are just
convenient ways to create and modify custom variables in
objects and players on the fly. Strictly speaking this
is not good coding practice. Anything useful enough to
make into a Property is useful enough to do in another way.
However, it is available to you as another implement
in your coders' toolbox.


How do I add a prehensile limb to a player or NPC?

victim->AddLimb("tail", "torso", 2, ({A_WEAPON }))

See the Creator's Manual for details on adding, desting,
and removing limbs.


How do I make a room occasionally display messages?

Use SetAction. There is a well-commented example
of this in /domains/town/room/shore.c .


My functional isn't working!

Functionals are a kind of reference to a function. They
won't work everywhere. For the most part they serve as a pointer,
and are used the way a variable would be used. If the place you
put the functional wouldn't make sense for a variable, it wouldn't
make sense for the functional either. For example,

SetLong( (: ShowLong :) );

makes sense, because what's happening is that instead of
a string, your argument is a function that returns a string.

However, something like this wouldn't work,

if( Cabbages == Kings ) (: eventTalk :);

because you're treating a functional as if it were a function.
It isn't. In a case like this, your line should look like this:

if( Cabbages == Kings ) eventTalk();


I've read the Creator's Manual but I still don't understand mappings and arrays.

Yeah, they can be tricky to get a handle on. Let's suppose you're
going to set up a nautical commerce system, where you have to keep track
of ships and their data. You store ship data in a daemon, which is
an object that stays loaded in memory to manage information, but doesn't
actually exist as a cloned item in the game. We'll call it SHIPPING_D.

So, SHIPPING_D needs to keep track of how many ships there are.
I would do this with an array, not a mapping, because it is a simple
list, like this:

string *ship_list = ({ "Caine", "Bounty" });

That way, when SHIPPING_D gets queried for a list of all known
ships, it can just return that simple list. If you needed to add a
ship, you'd have the daemon perform this operation:

ship_list += ({ "Pequod" });

To remove a ship:

ship_list -= ({ "Caine" });

Suppose, however, that not only do you need to keep track of
ship names, but also their captains, crew complement, etc. You could try
to use an array for this, but it would be very unwieldy. This is because
to pick out specific elements, you need to use a number. For example,
if the ship_list array is ({ "Caine", "Bounty", "Pequod" }) then
ship_list[0] is "Caine" and ship_list[2] is "Pequod".
If you were to try having an array for each ship that
contained complex information, you'd have stuff like this:

ship_list += ({ "Caine", "Queeg", 117, "military", "destroyer minesweeper", 0 })

There are a couple of problems with this. First, the ship_list
array is going to be a bit of a mess. Second, you'll have to address the
ship's data elements by their array index number. For example, to know
the Caine's crew complement, you'll need to do something like this:

foreach(string *ship_data in ship_list){
if(ship_data[0] == "Caine") return ship_data[2];
}

The first step is to check each element in ship_list to
know if its first element is "Caine", then return its third element,
which is 117. Not only is this inelegant and overcomplicated,
it is not guaranteed to work. Careless manipulation of your subarrays
can result in elements being out of order, with potentially
disastrous results on your code. It's just not a wise way to
go about this. This is where mappings come in. Rather than the mess
above, we'd do it like this:

mapping AllShips = ([]);

AllShips["Caine"] = ([ "captain" : "Queeg", "complement" : 117, "type" : "military",
"class" : "destroyer minesweeper", "cargo" : 0 ]);

It looks more complicated, but in fact it's a major simplification
of your data and its access. Now you have a sure-fire way to query
a specific ship and its specific data elements without a shadow of doubt
as to what you'll get back.

Now if you want to know the name of the Caine's captain,
it looks like this:

return AllShips["Caine"]["captain"];

Basically this is a mapping inside a mapping. The mapping called
Caine contains the element "captain". Because the mapping Caine is an
element in the mapping AllShips, you access an element in it in the way
shown above.

In a less complicated example, mappings might be used, for
example to store information about, say, fish:

mapping FishTypes = ([ "carp" : "freshwater", "tuna" : "saltwater" ]);

So that FishTypes["carp"] is "freshwater".

To remove a mapping element, use the map_delete efun:

map_delete( FishTypes, "carp" );


Why are call_outs so bad?

Garfield@M*U*D <ds> I'm wondering.. Why are call_outs so bad?

Cratylus <ds> ya good question

Cratylus <ds> in themselves they arent. One call_out more or less wont make the angels cry

Garfield@M*U*D <ds> From what I can tell, they shouldn't be too bad if not implemented poorly.

Cratylus <ds> the problem is that if your creators get the idea call_outs are ok, you'll be swamped with them

Garfield@M*U*D <ds> Right. You want 10s of them, not 100s.

Cratylus <ds> and they, for reasons i cant explain to you because it's driver related, are expensive to run

Garfield@M*U*D <ds> Can't explain because you're not familiar with the driver?

Cratylus <ds> right

Garfield@M*U*D <ds> Right. Fair 'nuff.

Cratylus <ds> but i can vouch for the truth of the proposition

Cratylus <ds> limbs used to decompose, each with a call_out of its own

Cratylus <ds> if you released the rage virus into the menagerie, your mud would eventually crawl to a stop

<ds> Garfield@M*U*D hehs.

Garfield@M*U*D <ds> What amount of call_outs are we talking here? Hundreds? Thousands?

Cratylus <ds> fewer than 200 as i recall

Cratylus <ds> but the memory is hazy

Garfield@M*U*D <ds> Hrm. Ick.

Garfield@M*U*D <ds> I might peek at how they work.

Cratylus <ds> it also redlined the processor

Garfield@M*U*D <ds> Right.

Cratylus <ds> lucky for me i have a 4-way box


Fine. How am I supposed to create timed events, then?

There is a built in timing system that uses the heart_beat()
efun. To enable it, use set_heart_beat() on the object that is
to have a timed effect. set_heart_beat(1) gives the object about one
heart_beat per second. set_heart_beat(60) gives it a heart_beat
about once a minute.

Whenever the object has a heart_beat happen, the function
heart_beat() is called in it. So, for example, an NPC might have
a heart_beat function like this:

void heart_beat(){
this_object()->eventForce("say hi!");
}

If the NPC's create() function contains a set_heart_beat(10)
then it will say "Hi!" every ten seconds.

Another way to control it would be to have a counter.
You would define a global integer variable by putting in in the body
of the NPC's file before any functions are defined. For example:

int counter = 0;

somewhere before the create() function. Then your heart_beat
function might look like this:

void heart_beat(){
counter++;
if(counter > 10) {
this_object()->eventForce("say hi!");
counter = 0;
}
}

If the NPC's heart_beat is set to 1, then the NPC will make
his greeting about every ten seconds. If its heart_beat is set to
ten, then it'll take a minute and forty seconds per greeting. Note
that at the end of the if() check, the counter is reset to 0 if
the action is triggered.


I need a list of all the functions available.

If you read the section on efuns and sefuns, you have an
idea of what they are. They are documented in /doc/sefun and
/doc/efun , and doing a list of the dirs and subdirs there
will give you a "list" of them. The documentation on individual
sefuns and efuns is generally available through the man command,
for example: man sscanf

If you're looking for lists of library functions,
such as SetClass in LIB_WEAPON, your best bet is the help
command, like this:

help library objects weapon

help library objects creator

That will list the functions in the library object
you specify. As of this writing, the documentation on lfuns
is not yet as thorough as the documentation on efuns and sefuns,
but this documentation is an ongoing project whose output
should eventually improve.

A contributor to the mud community has made
available a wikified cross-reference of Dead Souls funs,
which you can find here:

http://lpuni.org/components/com_mambowiki/index.php/DeadSouls_Reference


How do I make an object you can [ jump on | climb | etc ] ?

Look for an example, and copy it. Take a look at the
code in the newbie mansion ladder for climb code. Take a look
at /domains/Ylsrim/room/bank_roof.c for an example of something
you can jump from. Other actions will have similar examples. The
sample domains are there for you to explore and find examples
of what you want to do.


Where is the list of available skills? How do I add skills?

Please read the Administrator's Guidebook chapter
entitled "Understanding the Lib", and skip to section named
"
Section IV: Skills".


Where is the list of available classes? How do I add a class?

Type: ls /secure/cfg/classes

To add a class, copy one of those files and call it
whatever the class should be. For example:

cd /secure/cfg/classes
cp thief farmer

The modify the new file to suit you. When
you're done, use admintool to add the class to the class
daemon. Type help admintool for information on that command.

Obviously, you'll need to be an admin or assistant
admin for this to work.


Where is the list of available races?

Type: ls /secure/cfg/races

For details on adding races, see the admin FAQ.


How do languages work? Is there a list of them?

There is no list of languages. It doesn't work that way.
There is no centralized language database, daemon, or anything
like that. Languages are basically like a skill: only useful to
the extent that lib objects make use of them.

A player might be able to understand Tamarian, but if
nobody else in the lib does, it isn't much use. If no written material
is in Tamarian besides, then the player's language ability is a waste.

On the other hand, if a player wants to be able to
understand orcs, all she has to do is find a language teacher
that can instruct her in that tongue. After enough lessons,
she will be at 100% fluency, and if she encounters written or
spoken information in Tangetto, she'll be able to understand
all of it.

To know what languages you understand, and to what
extent, use the command:

language

To make yourself fluent in English, type:

anglicize me

To make yourself fluent in all languages, type:

polyglottize me

Obviously these commands are available only to creators.


When I try to call test->SetLanguage("Bozo", 50), it sets it to 100%

Bozo is probably a newbie. If Bozo's player level is at or below
what is defined as newbie in /secure/include/config.h, then he understands
all languages at 100%. Raise his level above that, and you should see
his proficiency in that language drop to what you specified.


How do I update an .h file?

You don't, really. That's a header file, which contains code to
be included by a .c file. Only a .c file gets loaded into memory, so
to "update" an .h file, you update the .c file that includes it. In
the case of a global include, like daemons.h, you would update the
master object (also called the master daemon) thusly:

update /secure/daemon/master


+
+
Section 3: Intermud and channel stuff


How do I know what other muds are online on intermud?

Type: mudlist

To see online Dead Souls muds type: mudlist -m dead


Hey, LeetFooMud is online! How can I tell if Biff is logged on?

To see who's logged on: rwho leetfoomud
To tell Biff hello: tell biff@leetfoomud hello
To see if Biff is listening to <ds>: list ds@leetfoomud
To check out Biff's personal info: finger biff@leetfoomud


That's weird...mudlist says LeetFooMud is there but I'm not getting anything back.

The mudlist command reports on data retrieved the last time
the intermud daemon received an update. This means that if
LeetFooMud dropped off, say, 10 minutes ago, or if your own
intermud connection is down, your intermud commands are falling
into the void.

To see if your intermud connection is up, type: wiz
This takes you to the Creator's Hall, where a sign indicates
your mud's intermud connection status. This sign may be up
to 15 minutes out of date.

You can also test your mud's intermud connection with
the ping command, like this:

ping dead souls

ping frontiers


I heard there are intermud channels that talk between other muds,
not just Dead Souls muds. How can I use them?

Ask your admin. Those channels may not be open for
use on your mud.

If you talk on <intercre>, be polite, and use the same rules
of common sense and intelligent questioning that you need
to follow for <ds>. <intercre> is for code and technical
questions ONLY. Do not ever spam it or use it for chatting.

I strongly discourage you from talking on <intergossip>. I
assure you nothing good will come of it. This warning only
applies to the old intermud.org router, known as *gjs. The
intermud channel on the new *yatmim router is much
friendlier to newbies.

How do I emote on a channel?

Add the word
"emote" to the channel command. For example:

creemote compels your silence.

gets seen on the channel as:
<cre> Cratylus compels your silence.

You can also add a colon to the message, like this:

cre :compels your silence.


How do I see what I missed on a channel?

To see the recent messages, use hist. For example:

hist ds

To see older stuff, look in /log/chan


I am sick and tired of the *gjs intermud network going down. Please fix it.

See the Dead Souls Intermud Router page.


I just wanna chat. Is there a dschat channel?

If you really want just to chat, then use <intergossip>,
since that's what it's there for. Ask your admin for how to
do this. I'd rather you expose <intergossip> to your boredom
than <ds>. Note that <intergossip> on *gjs is usually hostile to
newbies.
Alternately, there's a <ds_test> channel which is
intended specifically for spammy channel tests and such.


I'll spam if I want to. You're not the boss of me.

It's true, I can't do much if you're determined to be a
jerk. If you consistently abuse channels, your admin may
be asked to limit your channel access. In extreme cases,
your mud may find itself banned from the channel in
question.
I can only appeal to your sense of fair play.
Spamming hurts people who have nothing to do with whatever
you're pissed off about. Please don't make whatever your
problem is with someone a headache for everyone.

This guy keeps hassling me on an intermud channel

Sometimes people just can't leave well enough alone,
and they spam. Some people just don't have anything
to say that you want to hear. For such situation,
use the earmuff command. For example:

earmuff tatianna

And you will not receive channel messages from
that person. The reverse command is unmuff.
Earmuffing is also good when someone from
a non-European-language mud sends well-meaning
but garbled, escape-code filled gibberish. If
she doesn't understand your English language
requests to stop spamming, you can just earmuff her.

+
Section + 4: Miscellanea
+
+
+
I'm fighting the beggar with my staff and he's kicking my ass
+
+     + For one thing, you're a creator. Quit goofing around. If
+ you want to + fight monsters and stuff, create a test
+ player + character.
+
+     + Next, you're probably still a Level 1 character. This
+ makes you a + wimp. Raise your level with this command:
+
+ call + me->SetLevel(20)
+
+     + Now get the medical tricorder from your workroom's
+ chest and + raise your stats. Give yourself 100 strength.
+ Why not?
+
+     If you're carrying a chest, table, chair, and + everything
+ else you've come across, you will be unable to do much
+ during combat. Try to wield a weapon, hold a couple of
+ shopping bags and boxes, and see how well you do against
+ a pissed off real-life enemy. You won't last long. So either
+ drop all the crap you're lugging around, or put it in
+ a backpack and wear the pack.
+
+     + Put the staff in your robe and quit using it as
+ a weapon. + It's a creating tool. Not only is it a
+ poor weapon, + by default you lack double-handed
+ weapon + skills, making you really crappy at using
+ a really + crappy weapon. No wonder the orcs were
+ beating you + like an animal. Get a carving knife
+ from the + mansion. Or an orcslayer. Or hell, just
+ use the zap + command and stop wasting time. You
+ should have + characters for this.
+
+
+
+
Someone amputated all my limbs and I can't do anything!
+
+ If your body + gets damaged you can restore yourself to your
+ normal + physical status by typing:
+
+ heal + me
+
+
+
How do I change my class?
+
+
Again + with the pretending to be a + player. Seriously,
+ you need a + test player char so that if you screw something
+ up, you don't + screw *yourself* up.
+
+ But, if + you're determined:
+
+ call me->ChangeClass("thief")
+
+
Your + stats and levels will probably be all weird and
+ hosed up. + Just raise your player level, that will probably
+ fix it.
+

+
+
+
People are talking to me in gibberish, even though it 
says they're
speaking English.

+
+ If your race + is not human, your default language is not English, + therefore
+ someone + speaking in English would not be understood by you. As a
+ creator, you + can avoid players' tedious language learning process
+ and simply + type:
+
+ call + me->SetLanguage("English",100)
+
+     + Obviously this will work for other languages too.
+
+
+
+
+ What's + this about Biff "unknowingly" telling me something?
+
+ If you are + invis and a player or someone on another mud tells
+ to you, they + get an error message about you not being around. So,
+ they told to + you, but do not know you actually got the message,
+ since you + don't seem logged on.
+
+
+
+
How do I find the location of a verb or command?
+
+ Use the which + command. For example:
+
+ which + zap
+
+ which + update
+
+ If 'which' + doesn't find it, the command is probably built into
+ some object + you inherit, like the command shell or the
+ hooks for the + chat daemon. Or it may be an add_action bound to a
+ nearby + object. To see what commands objects or inherited
+ files might + be providing you, type:
+
+ localcmds
+
+
+
+
 Where are the "exa" and "n" commands?

When you type some commands, like exa, n, or i,
what happens is that your command shell recognizes
them as aliases, and turns the alias into the appropriate
command.
An alias is like a nickname, or shorter word,
for a command or series of commands. To see the aliases
you currently have, type:
alias

To make a new alias:
alias ml mudlist

To make an alias that replaces a specific command
while permitting you to supply arguments to it:
alias ig intergossip $*

To remove an alias:
alias ig

After modifying aliases, make sure to type:
save 
+     +
+
+
 How do I get something to happen to a random person in a room?
+ You can + pick a + random winner (or victim) for your action by using the + get_random_living()
+ sefun. For + details on its usage:
+
+ man + get_random_living
+
+ You may also + find the get_livings() sefun useful.
+
+
+
+
My wandering monster escaped from my workroom! How can
I find him?

If its name is jabberwock, try:

findobj jabberwock

You can also probably just:

goto jabberwock
+
+
+
I ran findobj on something but it says no environment. Where is it?
+
+ Right where + it says. Some objects create a "master copy" of themselves
+ when they are + cloned. This copy remains loaded in memory even if
+ that cloned + object goes away. You can distinguish between cloned
+ objects and + master copies by the number sign  and number at the end
+ of cloned + objects. The master copy has no instance number. It is
+ simply loaded + code, and does not "exist" in a way accessible to your player
+ object on the + mud.
+
+ Sometimes a + cloned object will lose its environment. This is usually
+ caused by an + error and is not a good thing. Dead Souls runs a
+ "reaper" + daemon that periodically searches memory for cloned
+ objects that + lack an environment, and they are destroyed.
+
+
+
+
How do I update everything in a directory?
+
+ You really + shouldn't. There are very few cases I can think
+ of where + updating an entire directory is something an average
+ creator needs + to do. How often do you edit multiple
+ files at once + without individually updating them? Good
+ coding + practice is to update the one file you just worked on to know
+ if it works + at all.
+
+ I also + discourage it because when you do this, you lag the mud
+ considerably. + I/O is the most resource intensive kind of operation,
+ and updating + is on its own quite resource intensive. Updating a
+ directory + with dozens of files in it will cause a noticeable hiccup
+ in the rest + of the mud.
+
+ If you are + determined to do this, though, the + command is :
+
+ update + /path/to/dir/*
+
+
+
+
I don't like getting colors on my screen. How do I stop it?
+
+ Type: terminal + unknown
+
+ then type: save
+
+
+
+
Um...I want colors back now please
+
+ Type: terminal + ansi
+
+ then type: save
+
+
+
+
 I can type 'n' and move north, but 'north' doesn't work.
+
+ Technically, + you can't 'n' either. When you type 'n', what
+ it happening + is that your preset alias turns that 'n'
+ into the + command line 'go + north'.
+     + Because you do not have an alias 'north' that expands
+ to 'go + north', + 'north' doesn't + take you anywhere. But
+ go + north + will.
+
+
+
+
 Why is there a bunch of stuff in ROOMS_FURNACE?
+
+ The QCS is + designed to attempt the graceful handling
+ of unusual + events. Sloppy code, non-working objects,
+ etc. Part of + this design is avoiding a situation
+ where an + object's destruction affects your local
+ environment + (and this happens a bit more often than
+ you might + think).
+     + To avoid some types of unpleasantness, QCS doesn't
+ try to + immediately destruct objects when replacing them.
+ Instead, they + are moved, along with whatever problems
+ they might + have, to ROOMS_FURNACE. That is a room
+ where things + go to be destructed quietly. Every
+ second or so, + the contents of that room are destroyed,
+ and their + bits recycled.
+     + A few other items in the lib use the furnace,
+ notably the + recycling bins and the reload command.
+
+
+ How + do I change + my screen and terminal settings?
+
+ help + terminal
+
+ help + screen
+
+ screen + 79 24
+
+
+
 ZOMG this is the best mudlib evar how can I evar thank you?
+
+ No need, + citizen. Merely doing my job.
+
+ Just let me + know what bugs you find, and how I can
+ make the lib + better.
+
+
+
Dude this mudlib sux0rz @ss. What a waste of my time.

I'm sure Dead Souls has lots of things that you don't
like, but I can't fix them if I don't know what they are.
Email me so that I can understand the lameness, and so
others can benefit for your suggestions.


I'm seeing a filename but I can't read it.

If you try command and you get something like:

/secure/foo/bar: No such reference.

It means you don't have read access to that
file or directory. I've someone make a stink about
how a file they can't read shouldn't be visible to them
or some such thing. However, I think he was just
being difficult. Some files you can't read, even
though you have access to the directory they're in.
That's the story.


Is there a command to go back to your previous directory
without having to type it all out again?

The shell has a few handy builtins.

To go up a directory: cd ..

To go to your home dir: cd ~

To go to your area directory cd ~/area

To go to the /domains dir: cd ^

To go to /domains/default: cd ^default

To go to the directory you were in before the current one: cd ~-


+

+ Section + 5: Building
+
+
+
QCS is putting stuff where I don't want it.

QCS is a way to use simple commands to manipulate
complex files. Sometimes the conversion between simple
and complex causes unusual compromises and outcomes.

When you create a new room, what QCS does
is look at the room you're currently in. Let's say
you're standing in /realms/you/area/room/test1.c. And
you issue the command

create room east test2

In this case, "test2" is considered a "relative path",
which means that you didn't provide QCS with *exactly* where
you want the file to be. You told QCS to figure out where
to put that file.
When QCS has to guess where a new room goes,
it simply assumes that the room goes in the same directory
as the current room. So, in this case, you're going to
make a file with this path:

/realms/you/area/room/test2.c

Suppose that this is not where you want the new
room to be. you want it to go into /realms/you/testrooms/.
In this case, you need to tell QCS the "full path", like this:

create room east /realms/you/testrooms/test2

When you create non-room objects, also known as
tangible items, QCS guesses in a slightly different way.
If you provide a relative name, then QCS looks at your
current working directory (cwd). Based on the type of item,
QCS looks for a directory with the appropriate name. For
example, if your cwd is /realms/you/foo, and the type of
object is a weapon, then QCS looks for a directory named
"/realms/you/foo/weap/". If it exists, it puts your new
file there. Otherwise it tries to put it in "/realms/you/weap/".
And if that doesn't work, it'll default to your home area
weapon directory, which is "/realms/you/area/weap/".

If you've been granted domain admin status, and
you are using QCS to work on your new domain, it's therefore
very important that your cwd be in the right place in the
domain directory for it to work. Otherwise, your new stuff may
wind up in your default area dir, and you could go nuts
trying to find it.

Of course, you can avoid all ambiguity by simply
using a full path, like:

create weapon /domains/My_Spiffy_Domain/weap/fruitcake

 
How do I make a blank room, instead of copying the current one?
+     + You'll always copy the old room, that's just how
+ QCS works. But you can quickly change it to a blank
+ room by entering the new room and issuing this command:
+
+ copy /obj/room
+
+
+ How do I create an area?
+
+     You have a default area directory in your
+ homedir. By default, your QCS creations get put in there.
+ However, if your area is ever going to be put into
+ play, it could be inconvenient to move it into the
+ /domains directory, because every file reference will
+ have to be changed.
+     If your admins use unix and perl, this is trivial.
+ If not, it's a real obstacle.
+
+     Therefore, if you're going to work on an area
+ that will someday be open to the public, it's a
+ good idea to start in the /domains dir. Your admin
+ will need to create the appropriate directories.
+ For example, if the domain is to be FunkyTown, you'll
+ need /domains/FunkyTown, /domains/FunkyTown/room, and
+ so on.
+
+     You will also need to have your admin make
+ you a domain admin of FunkyTown with the domainadmin
+ command. This will permit you to use QCS there.
+
+     That's the technical part of getting started
+ with an area. The hard part is that you need to
+ know what you're doing, you have to have a creative
+ vision, and the language skills to make it evocative,
+ immersive, and worth playing in. That's up
+ to you...I can't help you with that.
+
+
+
How do I make a quest?
  
Think of a quest in terms of the result.
The result of a quest is a player receiving quest
points and a quest title.
   
This means that pretty much anything can
be a quest. If you've coded a rock to provide
quest points and a quest title when it is
picked up, well, there's your Rock Quest. However,
you usually want to make things a bit more challenging.

A quest can be as boring as "pick up the red rock"
or it can be a challenging metaphysical inquiry into the
nature of consciousness. If quest points and a quest title are
at the end of a series of actions, then that series of actions
is a quest. What those actions should be are entirely up
to your imagination. Review the orcslayer quest in the
Player's Handbook for an example. You did read the
Player's Handbook, right?
  
Take a look at Leo the Archwizard's code for an example of the
mechanics of solving a quest.
+ Where's + Leo?
+
+ Read the + Player's Handbook already, please.
+

+
+
Where are the vehicles and mounts?

There are none yet. After 2.1 is released, I'll
be able to concentrate on adding new systems like that.
For now, it's just bugfixes and vital functionality
I'm working on. However, 2.1 should be released
Real Soon Now.


I'm having trouble adding meals to my barkeep with QCS.

Cratylus <ds> ok here's the deal

<ds> Daelas@Moraelinost scrunches on the edge of his seat.

Cratylus <ds> menu items can have more than one id

<ds> Daelas@Moraelinost nods solemnly.

Cratylus <ds> "ale","first class ale","beer"

Daelas@Moraelinost <ds> with you so far.

Cratylus <ds> when you: modify barkeep menuitems

Cratylus <ds> it asks you for the id's

Daelas@Moraelinost <ds> I didn't get that.

Cratylus <ds> when you're done entering id's, you hit a period

Daelas@Moraelinost <ds> is it SetMenuItems or menuitmes.

Cratylus <ds> then you enter the filename to the item sold


I heard DS has stargates. Where's an example?

The following rooms have stargates:

/domains/Ylsrim/room/tower.c

/domains/default/room/stargate_lab.c

For info on valid gates, type: stargate
+
+
I created a vendor, but he isn't responding to the "list" command.

The list command isn't part of the vendor object. It's
part of LIB_SHOP, which is a room that acts as a sort of front-end
for the vendor. The commands list, show, price, and appraise are
not in the vendor, but in the shop. To get the appropriate responses
from the vendor, you would use the following syntax:

list: ask vendor to browse
show: ask vendor to show <item>
price: ask vendor to price <item>
appraise: ask vendor to appraise <item>

+ I + gave room with a default smell but I cannot get any other smells in + there,
+ such as 'smell object' for example

+
+     SetSmell, like + SetListen, is in the form of a mapping. When using the
+ QCS, the correct formatting is automatically made for you. If coding
+ by hand, take a look at /domains/town/room/riverbank.c for what it
+ looks like. Note that for each Smell or Listen, you need a corresponding
+ SetItems element.
+

+
+ - + Cratylus
+
+ <my name here>@comcast.net
+
+ Dead + Souls Homepage
+
+
+ + diff -c -r --new-file ds1.1/lib/www/ds-faq.html ds2.0r27/lib/www/ds-faq.html *** ds1.1/lib/www/ds-faq.html Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/www/ds-faq.html Wed Jul 5 00:00:59 2006 *************** *** 0 **** --- 1,90 ---- + + + + + Dead Souls FAQ + + + + +
Dead Souls FAQ, v2.4

Written by Cratylus @ Frontiers, October 2005
Updated June 2006

1 What is Dead Souls?

2 What is it for?

3 What is a MUD?

4 What's a mudlib?


5 When I configure Dead Souls, it says it is a MUD.
If it is really a mudlib, why would that be?


6 Is Dead Souls really Nightmare in disguise?


7 What is Nightmare?

8 What is the relationship between Nightmare and Dead Souls?

9 How close?

10 Why mess with Dead Souls, then?

11 Fine, but what's so special about Nightmare/Dead Souls? Why are you
making such a big deal of wanting people to use it? It isn't
better than everything else, surely. [insert mudlib name here]
is newer and has [insert feature here] and [other feature]!


12 What's LPC?

13 How do I get started?


14 Anything else?


What is Dead Souls?

Dead Souls is a "mudlib".

Dead Souls 1 was a public domain release of a mudlib
called "Nightmare". It was difficult to use, and buggy.

Dead Souls 2 is a re-release that fixes the bugs and
makes it super easy to use for both beginners and advanced admins.

There is also a Dead Souls MUD, but this is not what people
usually mean when they refer to Dead Souls as a game.


What is it for?

It's for building a game. If what you want to do
is play a game, you're looking for something else.
 

What is a MUD?

A MUD is a computer program that uses text (very rarely do MUDs
use graphics or sound) to describe virtual environments you can manipulate.
You enter a command, the program tells you how the virtual world responds
around you. Typically there are other people connected to the same program
over the Internet, and you can interact with them as well. A MUD can be mostly
social, or mostly game oriented, with quests and puzzles to solve or
villains to defeat. The name MUD is an acronym that originally stood for
"Multi-User Dungeon", in accord with the "Dungeons and Dragons" style of
many early MUDs. Now it stands for different things to different people,
but the basic concept of operation is the same, whether the game is set
on the moon, in Manhattan, or in Middle Earth.

See also:
http://www.catb.org/~esr/jargon/html/M/MUD.html


What's a mudlib?

There are many different types of MUD programs. Some are
executable programs, with all of their virtual worlds
defined in one big file. Others are entirely interpreted,
such as java muds, which are composed of thick forests
of folders containing java files.

LP MUDs are something between the two.

Generally there are two main parts to an LP MUD
program. First is the "driver". This is an executable program
file (in Windows, you'd see the driver has an .EXE extension)
that enables the input and output of data, accepts network
connections, performs basic calculations, etc. The other part
is the mudlib, or, more properly, MUD object library. This is
usually a large set of files in plain text that the driver
reads and uses as a basis for the game. Some files provide
information about rooms and environments, some files provide
information about objects or creatures, etc. When players
connect, the driver provides them the world that these
files describe.


When I configure Dead Souls, it says it is a MUD.
If it is really a mudlib,
why would that be?

Dead Souls is not intended to be a fully-developed
MUD when you install it. Instead it provides you with
the basic framework you need to make a MUD of your own.
After you set up Dead Souls, you should rename it, and
customize the lib (that is, library) files to create your
own world. When you first run Dead Souls, you will
have some rooms available to explore. This is not your mud.
It is just a set of sample places and objects to help
you understand how to build a MUD of your own. So in a
way, Dead Souls provides you a kind of "starter" MUD,
but since it's just examples, you can't really
consider it a MUD until you change it to suit
your creative vision.


Is Dead Souls really Nightmare in disguise?

Let's break this question down into its components:

What is Nightmare?

Nightmare was a mud. It was part of a branching of mud development
that occurred early in the days of popularized mudding. Some folks
decided to take MUD library development in a particular direction,
and eventually made available what is now known as the Nightmare mudlib.
Nightmare went through a few major changes, most notably from version 3
to version IV. By that time, the development of Nightmare was solely
managed by a coder who called himself Descartes.

What is the relationship between Nightmare and Dead Souls?

It appears that Dead Souls began as a "development" MUD. This means
that while Descartes ran his own MUD, he also worked on improving that MUD's
lib. It is unwise to make major changes to a MUD that people are playing on,
so the Dead Souls development MUD was one which served as a platform to
develop, extend, and improve the Nightmare lib without risking harm to active players.
Sometime after the release of the Nightmare IV mudlib, Descartes decided to
withdraw it from distribution. Based on their interpretation of copyright
law, people now do not distribute the Nightmare mudlib on Internet servers.
However, somewhat inexplicably, Descartes released the mudlib for his
development mud, Dead Souls, into the public domain. This meant that the
Dead Souls mudlib was completely free to be used by anyone in any way they
chose, be it distribution, modification, spindling or folding. Because Dead
Souls was the development mud for Nightmare Mud, which was the base of the
Nightmare mudlib, the relationship between the two is a very close one.


How close?


The similarity between Nightmare and Dead Souls can
now best be described as close cousins, rather than twins.


At one time it was almost identical. A close comparison of the
Dead Souls lib that Descartes released (version 1.1pre) against the
last released Nightmare lib (IVr6) reveals that they are very
nearly the same thing, file for file.

The main differences between the two are:

* A small number of Nightmare library files aren't on Dead Souls.
* Dead Souls doesn't come with the driver or install script the Nightmare had.
* All documentation files were removed from Dead Souls.
* "Nightmare" in file headers was changed to say "Dead Souls"

This might sound like a lot of difference, but consider this: not counting
documentation, Nightmare IVr6 lib contained 1064 files and directories, and
the Dead Souls 1.1pre lib contains 1082. Dead Souls 1.1pre actually had more
lib material in it than the last release of Nightmare.


Why mess with Dead Souls, then?

The main problem was that Dead Souls was a bear to set up. Because
driver development had not stopped (the driver is a separate software project),
but lib development had, incompatibilities grew in number over time. Using
the original driver from 1997 created a MUD that lacked important features
of modern muds, and risked instability. Using a modern driver required a
modification of fundamental lib systems that required some expertise to
perform. People stopped using Nightmare because they couldn't get it, and
they didn't use Dead Souls because the damn thing didn't work right. My own
Nightmare lib MUD, Frontiers, continued to chug along, quietly fading into
obscurity along with all other Nightmare IV based MUDs, while scrappy young
newcomers like CoffeeMud lib started elbowing their way into the MUD community.

Then a funny thing happened. I really got into lib coding. I mean, full-on
lib obsession. I can't really explain it, other than to say that when I was
younger it seemed hard and impenetrable, but now that I've been working in a
technical field for years, I have the mental tools (and patience) required to
disassemble and understand complex systems. I got turned on by analyzing and
understanding stuff that I'd considered over my head in years past.
But I was living in the past. I couldn't share my exciting lib ideas
and discoveries with anyone else, because the Nightmare LPC community was
in the very last stages of extinction.

I decided to do something about it. Maybe I'd be whistling into the wind,
tilting at windmills, or even worse, just talking to myself. But I decided
I'd make Dead Souls a viable lib for people to use, because it would be fun,
and because it might be nice to have other people to bounce ideas off of and
steal code from. At worst, I'd be doing nothing more pathetic than, say,
building model ships in my basement. At best, I might revive a once-thriving
MUD development community. Either way, it sounded like an enjoyable project,
so I proceeded.


Fine, but what's so special about Nightmare/Dead Souls? Why are you
making such a
big deal of wanting people to use it? It isn't
better than everything else,
surely. [insert mudlib name here]
is newer and has [insert feature here] and [other feature]!


Yes, that may be. My experience with other libs is limited, and I'm sure
that Dead Souls pales in comparison to others in one feature or another. My only
answer to that is, go ahead and use the lib you're comfortable with. I make no
claims of superiority. Hell, I'll be the first to admit there are still things
to fix and systems to implement. But if you are not sure which lib to pick,
Dead Souls is an excellent choice as a solid, stable, flexible and powerful platform
to build your MUD. You can do anything in a MUD with LPC, and I mean anything.
If you happen to have Nightmare experience, Dead Souls will be a homecoming...
like an old comfortable shoe, but without the holes or the stink.


What's LPC?

LPC is a kind of programming language. Dead Souls lib files don't
just contain descriptions of places and things: they have a format that describes
their relationships to the driver and permits you to do fancy stuff...pretty much
any text MUD thing you can think of, you can do in LPC.


How do I get started?

Download the latest version from http://dead-souls.net/
and install it.
There is only one distribution file, which includes both the
Windows and UNIX versions. Read the installation FAQ for details.

Once you log in, read the Players Handbook and the Creators Manual.



Anything else?

Read the Dead Souls Admin FAQ.

Read the Dead Souls Creator's FAQ.

Read the Dead Souls Installation FAQ.

Read the Quick Creation System Example Page.

Read the Debugging Guide.

Read the Editor Tutorial.

+ The end.
+
+ Dead Souls Homepage
+
+
+ + diff -c -r --new-file ds1.1/lib/www/ds-inst-faq.html ds2.0r27/lib/www/ds-inst-faq.html *** ds1.1/lib/www/ds-inst-faq.html Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/www/ds-inst-faq.html Wed Jul 5 00:00:59 2006 *************** *** 0 **** --- 1,476 ---- + + + + Dead Souls Mudlib - Installation FAQ + + + + + + + + + + + +

IMPORTANT NOTE: After installation, check the HOTFIX PAGE for late-breaking patches.
+

+

NOTE: As of June 6 + 2006 the Windows version IS AVAILABLE + AGAIN.
+

+

FAQ Index

+ + +

Is this FAQ really necessary? (Back + to Top)

+

Normally, no. If you just follow the instructions included in the + Dead Souls packages, you'll be fine 90% of the time. However, a + non-trivial number of folks have run into difficult circumstances. For + those folks, this document is meant to illuminate how the install + process works, why some things are as they are, and suggest some + solutions to the more common obstacles.

+ +

Where do I get Dead Souls? (Back + to Top)

+

You should only ever download from the site listed below. Some other + sites tend to mirror these or copy data, then fail to update their data + regularly. The following will always have the most recent version, and + it is the only one officially authorized to distribute Dead Souls.

+

Download the latest version from the following: +

+ + +

Why is there only one version? Where are the UNIX and Windows + versions? (Back to Top)

+

Starting in Dead Souls 2.0r22 the two separate versions have been + merged into one distribution download file. Now it doesn't matter + whether you want to use Dead Souls on Windows or UNIX, there's just one + file to download, and it contains everything you need for both + operating systems.

+

This merge accomplishes the following: +

+
    +
  • Ensures 100% identical lib versions for the different OSes.
  • +
  • Limits the clutter involved with releasing new versions.
  • +
  • Lowers the amount of labor and time involved in releasing new + versions.
  • +
  • Simplifies installation and upgrades for new users.
  • +
+ +

Where do I get patches? (Back to + Top)

+

+

+
+ + +

Should I apply the available patches during an install? (Back to Top)

+

No. Patches are for already-installed Dead Souls muds. A new Dead + Souls install does not need and must not use patches. If you're + upgrading from one Dead Souls version to another, please read the + upgrade section further down in this document.

+ +

How do I install Dead Souls in Windows? (Back to Top)

+

NOTE: If you are using Windows, USE THESE INSTRUCTIONS. There is no + benefit in trying to download Cygwin and modify the UNIX source code + and trying to get it to compile in Windows, unless you know exactly + what you're doing. Yes, people have tried to do this and complained.

+

First make sure you are running Windows NT 4, Windows 2000 or above, + Then: +

+
    +
  1. unzip the distribution file
  2. +
  3. move and rename it so that it is c:\ds, and that the folders + c:\ds\win32 + and c:\ds\lib are where the binary and library files are, respectively.
  4. +
  5. run c:\ds\runmud.bat
  6. +
  7. if you lack a favorite telnet client, open a command line window + by clicking on Start->Run... and entering: cmd
  8. +
  9. connect to your Windows computer by telnetting to port 6666. If + you are using the command window, type: telnet + localhost 6666
  10. +
  11. Enter the name you want your admin to have, and answer the + questions provided. Make sure you are the first person to log in, + because that + first person is automatically made admin.
  12. +
  13. When you finish entering the admin's info, the mud will + automatically reboot.
  14. +
  15. log in as your admin character.
  16. +
  17. change your mud's name with the admintool command. Navigate to + the "driver" + menu (as of this writing, it's option 4, and then the "change the MUD's + name" option (as of this writing, it's option r). Enter the name + desired, allow the mud to shut down.
  18. +
  19. log in again after the mud reboots.
  20. +
  21. check the HOTFIX PAGE + for + late-breaking fixes.
  22. +
  23. start reading the guide and the handbook and the manual.
  24. +
+ +

Hold up, these Windows instructions aren't working (Back to Top)

+

There are a few common reasons for this. +

+
    +
  • A recent fix may be available. Check the HOTFIX + PAGE for late-breaking fixes.
  • +
  • Download only from the sites mentioned above. Those are the only + ones sure to have the latest version. Other sites can be out of date.
  • +
  • On at least one occasion, Winzip has somehow corrupted the + archive as it was extracted. Try using another decompression utility, + like winrar.
  • +
  • Most Windows PC's these days have firewall software installed. + If you + try to connect but aren't able to, there's a good chance your + connection is being blocked by your firewall. Disable your firewall + temporarily and try to reconnect. If the problem goes away, you know + now that you have to somehow configure your firewall to allow incoming + TCP connections on port 6666.
    + Note: You may also have to permit outbound TCP connections to + port 23 on IP address 149.152.218.102 if you want your mud to join the + Intermud3 + network.
  • +
  • You might not be using c:\ds as your base directory. Make sure + you are. Putting the mud files on another drive or another folder will + cause the mud not to run.
  • +
  • Trying to use Windows 98, 95, Me, or 3.x will simply not work. + Sorry. Those are not server class operating systems and they use + technology incompatible with the mud's requirements.
  • +
  • If the mud starts but you get lots of bizarre errors, there may + be a couple of reasons for this: +
      +
    • If the c:\ filesystem is NTFS, and the user you logged in as + does not + own the ds:\ folder, things will fail in odd ways. What is happening is + that the + mud is trying to write files in a folder it doesn't have permission to, + and + things get all hosed up. Make sure you have read/write privileges to + the c:\ds + folder.
    • +
    • Zip problems. Some unzipping utilities are known to + incorrectly decompress + zip files. Specifically, sometimes an archive that contains empty + folders will + not write those empty folders to your disk. This could cause problems + for the + mud. If you get lots of errors and things don't work right, and you are + sure + that you have read/write access to c:\ds, then try reinstalling but + with a different unzip utility.
    • +
    +
  • +
+ +

How do I install Dead Souls in a Linux/UNIX box? (Back to Top)

+

First make sure of a couple of things: +

+
    +
  • DO NOT use fileroller (a GUI based app) to decompress the + package. If + you ignore this warning you are very likely to end up with really + confusing errors and problems. Instead use the normal unix command + line. For example: unzip -d ds ds2.1.zip
  • +
  • NOTE: If you don't use the "-d" flag to specify the name of the + new directory you want to create, the archive will dump everything + into your current working directory, which may look ugly if that's + not your intention.
  • +
  • Don't use an existing driver binary, even if it's from a + previous + (or even the same) Dead Souls distribution. If you're doing a fresh + install, always, always, always do the complete and exact installation + procedure, including the driver compile. If what you're looking to do + is an + upgrade, read the upgrade section further down in this document. Once + we're set on those requirements and you've uncompressed the tarball, we + can continue with the installation procedure.
  • +
  • cd to the directory where all mud files reside. Called $MUDHOME + in the rest of these UNIX instructions.
  • +
  • cd to v22.2b14
  • +
  • type: ./configure
  • +
  • type: make
  • +
  • type: make install
  • +
  • If the previous step fails, just manually copy the "driver" file + into + $MUDHOME/bin/
  • +
  • edit $MUDHOME/bin/mudos.cfg (provided). The two lines to change + are mudlib directory and binary directory. For example, if your + $MUDHOME is /home/joe/mud, then the mudlib directory line will look + like this:
    + /home/joe/mud/lib
    +
    + and bin:
    + /home/joe/mud/bin
  • +
  • edit $MUDHOME/bin/startmud (provided) and change the $MUDHOME + definition.
  • +
  • manually run the mud: $MUDHOME/bin/driver + $MUDHOME/bin/mudos.cfg . + If you properly edited the startmud script, you can just type: ./startmud
  • +
  • telnet to your machine, using the port specified in mudos.cfg. + For + example: telnet localhost 6666
  • +
  • Create a new user. Just answer the questions. Make sure you are + the first person to log in, because that person is automatically given + admin privileges.
  • +
  • You'll get booted out. Reboot the MUD, telnet back in, and you're + now running Your Very Own MUD. If startmud is running, the MUD should + restart automatically.
  • +
  • check the HOTFIX PAGE + for + late-breaking fixes.
  • +
+ +

I'm having trouble getting Dead Souls for UNIX to work (Back to Top)

+
    +
  • first, stop using Fedora. Ha ha just kidding.
  • +
  • Your compiler may be trying to run a distributed "make" by + default. That's a no-go for MudOS. Try disabling that at compile time + by using this instead of the normal make command line:
    + make -j 1
    + make install
    +
  • +
  • A recent fix may be available. Check the HOTFIX + PAGE for late-breaking fixes.
  • +
  • Download only from the sites mentioned above. Those are the only + ones sure to have the latest version. Other sites can be out of date.
  • +
  • Most of the problems with unix installs involve permissions + conflicts. If + you uncompress the package as root user, for example, then try to run + it as an unprivileged user, the process won't be able to read and write + to the directories it uses, and errors will result. If you uncompressed + as root and want to run it as another user (in this example, username: + joe), then you'll want to cd to the directory that contains the mud + directory and issue a chown + command, like this:
    + su - root
    + cd /home/joe
    + chown -R joe ds2.1
  • +
  • If you don't follow the instructions, and instead use a + previously compiled driver, you may skip a step which copies a + unix-compatible mudos.cfg file over the default Windows-compatible + mudos.cfg. To correct this, copy the template config into the proper + directory:
    + cd /home/joe/ds2.1
    + cp bin/mudos.cfg.orig lib/secure/cfg/mudos.cfg
  • +
  • Then edit lib/secure/cfg/mudos.cfg to point to the correct bin + and + lib directories.
  • +
  • Another problem that can occur if you use an older driver is that + the lib may expect options or features that the older driver doesn't + support. If this is what's happening, you need to start over, but this + time actually follow the instructions exactly, step by step.
  • +
  • If you get a bunch of errors about a missing log directory, you + probably used fileroller to uncompress the tarball. Fileroller is + apparently the default uncompression utility for Fedora. Other Linux + distros may also use it. Start your installation over and this time use + the command line as directed in the installation instructions.
  • +
  • If the driver compile fails complaining about extra_ref in + parser.c, then you probably followed older instructions, and not the + instructions included in the latest package. You should no longer use + ./build.MudOS (unless you know exactly the ramifications of what you're + doing). Instead use the ./configure script as per the current + instructions, which you should follow closely.
  • +
  • If the driver craps out complaining about a hosed up swap file, + you're + probably running Fedora, and you probably haven't changed your hostname + from the original "localhost.localdomain" or whatever nonsense they + use. What mudos expects is that when it asks your machine for its + hostname, that it receive something like "alpha", and not something + like "alpha.bravo". If your machine is under the impression that its + name is localhost.localdomain, it will supply that name to mudos, which + will eventually choke on it.
    +
    + If you're good at C, you can edit lines 66 and 76 of + v22.2b14/swap.c and correct this behavior. But the common sense fix is + to stop being a noob and give your computer a proper hostname already.
  • +
  • Some hosting services may provide you unix shells so tightly + restricted that you cannot successfully compile the mudos driver. You + may need to submit a problem ticket with your hosting service to + resolve the issue. Let them know that the source compiles fine on + various versions of SuSE and Fedora, as well as Solaris 8, 9, and 10, + various BSD's, and even IRIX (!). If you can get them to give me a free + temporary account for testing purposes, I'll take a look and see if I + can help.
    +
  • +
    +
+ +

Why does compiling MudOS for Dead Souls throw so many warnings? + (Back to Top)

+

Beats me. This is one of those complaints I don't really know how + to respond to. At the end of the compile, you'll have a driver that + works. It's been tested on GCC 2, 3, and 4. It's worked for Fedora + Linux, SuSE Linux, and various versions of Solaris. It works. Ignore + the compile schmutz.

+ +

Why is there a windows-format mudos.cfg in /secure/cfg? I'm running + unix. + (Back to Top)

+

This is a symptom of my obsession to have the Windows lib and the + unix lib be absolutely identical. During a fresh install, this file is + overwritten with a unix version, if you follow the install instructions.

+ +

How do I enable database support? + (Back to Top)

+

I don't know. I don't understand databases at all, so it's pointless + for me + to try to get that MudOS functionality working. If you develop a + procedure for it, please share it with me and I will document it so + others can + benefit from your leetness. I might suggest that it's probably easier + to do this using LPC sockets in the lib, rather than trying to do it + using driver-level support. If you don't know what that means, you'll + need to play around with Dead Souls for a while, get the hang of it, + and then revisit the question.
+

+ +

How do I upgrade from one version of Dead Souls to another? + (Back to Top)

+

For your convenience, patches are available to move from one minor + revision of Dead Souls to another. But there isn't a patch for every + possible upgrade. + There is a patch to upgrade from ds2.0r12 to ds2.0r14, for example, but + there is no patch to upgrade from ds2.0r10 to ds2.0r14. As of now, + there are no plans to make patches to upgrade from one version of Dead + Souls to another. For example, do not expect a ds2.0 -> ds2.1 patch.

+

The upgrade for both Windows and UNIX is the same. Basically a Dead + Souls patch is a pretty unsophisticated upgrade system. In the case of + the UNIX patch, you use the tar command to copy the patch files over + your existing lib directory.

+

In the case of the Windows patch, it is a folder called lib which + you copy over your mud's c:\ds\lib folder. Sometimes just overwriting + is insufficient to fully bring up a previous release to the current + release. In such cases, a daemon called update.c is included, which + contains instructions for detailed modification of specific files. + These instructions are read by the mud and executed automatically after + reboot.

+

Obviously, this kind of update patching is intended for muds that do + not do extensive lib system rewrites. For example, if you are running + ds2.0r21, and + your mud creation has been limited to individual home directories and + the domains/ directories, then an upgrade to ds2.0r22 and beyond will + be utterly + painless.

+

On the other hand, if you've done extensive customizing of the + player object, + simulated efun subsystem, daemons, and so forth, then you may run into + problems after an update. The typical update patch does include some + changes to the player object, for example, so the indiscriminate + overwriting of the previous information with the updated files means + that your work basically disappears.

+

For this reason it is critical always to perform a full backup of + all your mud files before implementing a patch upgrade. Carefully + follow the instructions included in the patch releases to ensure + optimal effect. Because these instructions are not expected to be + static, the details will not be included in this document. Read the /doc/RELEASE_NOTES file + to know what has changed between releases and to determine whether an + upgrade is worth the risk. Please note that RELEASE_NOTES contains an + overview of major changes. It does not document every difference + between versions. +

+

The patch doesn't work! I'm getting a million errors! + (Back to Top)

+

If you're getting lots and lots of errors when you try to run after + patching, it may be that your driver is too old. Some Dead Souls + releases include tweaks to the driver. If enough time has passed since + the install of your driver, it may be that the current lib expects + things of the driver that your old lib didn't, and you now can't run. + To get around this you could just do a fresh install of the lib. Or you + could follow these instructions:

+

For UNIX: +

+
    +
  1. Download the full version of the latest Dead Souls distribution.
  2. +
  3. Uncompress it to some temporary directory other than your mud dir.
  4. +
  5. Compile the driver as if you were going to do a new install.
  6. +
  7. Copy the new driver binary over your old one.
  8. +
  9. Restart the mud.
  10. +
+

For Windows: +

+
    +
  1. Shut down the mud.
  2. +
  3. Download the full version of the latest Dead Souls distribution.
  4. +
  5. Uncompress it to some temporary directory other than your mud dir.
  6. +
  7. Copy the new driver binary over your old one ( + c:\ds\win32\driver.exe ).
  8. +
  9. Restart the mud.
  10. +
+ +

Ok, it's running. Now what? (Back + to Top)

+

Log in and read the following:

+ +

The End (Back to Top)

+

Return to Dead Souls + Homepage

+
+

Last Updated June 2006

+ + diff -c -r --new-file ds1.1/lib/www/editor.html ds2.0r27/lib/www/editor.html *** ds1.1/lib/www/editor.html Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/www/editor.html Wed Jul 5 00:00:59 2006 *************** *** 0 **** --- 1,177 ---- + + + + + Mud Editor Tutorial + + + + +
The ed Editor


This has always been the aspect of coding that new
creators have most trouble with. It's what discourages most
people from creating lots of stuff, in fact.

With Dead Souls, you can get away with avoiding ed
most of the time, by using the room maker and the thing maker.

But to add special functions to your code, like
magic items, smart NPC's (aka mobs), traps, hidden objects,
etc, you need to use ed, if you're going to be editing inside
the mud.

ed is a simple editing program. It is designed to
work on a line-by-line basis, so it is called a "line editor".

Let's start by looking at, and editing, a small file.
We've coded a sword, and we want to change its description
from "short sword" to "plain sword":


+
+

> cd /realms/cratylus/area/weap
1) I changed my working directory to my area weapons dir
/realms/cratylus/area/weap:
> ls
I listed the contents of that dir:
/realms/cratylus/area/weap/:
1 dagger.c 1 nco_sword.c~ 1 std_sword.c~
1 gsword.c 1 sharpsword.c 1 sword.c
001 gsword.c~ 1 staff.c
1 nco_sword.c 1 std_sword.c


> ed sword.c
I ran the ed command on the file sword.c.
/realms/cratylus/area/weap/sword.c, 641 bytes
:n
This makes the editor display line numbers next to the lines.
number on, list off
:1z This lists about 20 lines of text
1 /* /domains/Examples/weapon/sword.c
2 * from the Nightmare IV LPC Library
3 * a simple sword example, nothing fancy
4 * created by Descartes of Borg 950402
5 */
6
7 #include <lib.h>
8 #include <damage_types.h>
9 #include <vendor_types.h>
10
11 inherit LIB_ITEM;
12
13 static void create() {
14 item::create();
15 SetKeyName("short sword");
16 SetId( ({ "sword", "short sword" }) );
17 SetAdjectives( ({ "short" }) );
18 SetShort("a short sword");
19 SetLong("A cheap and rather dull short sword.");
20 SetMass(150);
21 SetDollarCost(50);
22 SetVendorType(VT_WEAPON);
:z
22 SetVendorType(VT_WEAPON);
23 SetClass(20);
24 SetDamageType(BLADE);
25 SetWeaponType("blade");
26 }
:15 I displayed line 15
15 SetKeyName("short sword");
:15c I used 'c' to replace line 15
15. * SetKeyName("plain sword"); I entered my replacement text
16. * . I entered a single dot on a blank line
:
16 SetId( ({ "sword", "short sword" }) );
:1z I listed about 20 lines, starting from line 1
1 /* /domains/Examples/weapon/sword.c
2 * from the Nightmare IV LPC Library
3 * a simple sword example, nothing fancy
4 * created by Descartes of Borg 950402
5 */
6
7 #include <lib.h>
8 #include <damage_types.h>
9 #include <vendor_types.h>
10
11 inherit LIB_ITEM;
12
13 static void create() {
14 item::create();
15 SetKeyName("plain sword");
16 SetId( ({ "sword", "short sword" }) );
17 SetAdjectives( ({ "short" }) );
18 SetShort("a short sword");
19 SetLong("A cheap and rather dull short sword.");
20 SetMass(150);
21 SetDollarCost(50);
22 SetVendorType(VT_WEAPON);
:18 I displayed line 18
18 SetShort("a short sword");
:18c I started the replacement of line 18
18. * SetShort("a plain sword"); I entered my replacement text
19. * . I entered a single dot on a blank line
:1z I displayed about 20 lines starting from line 1
1 /* /domains/Examples/weapon/sword.c
2 * from the Nightmare IV LPC Library
3 * a simple sword example, nothing fancy
4 * created by Descartes of Borg 950402
5 */
6
7 #include <lib.h>
8 #include <damage_types.h>
9 #include <vendor_types.h>
10
11 inherit LIB_ITEM;
12
13 static void create() {
14 item::create();
15 SetKeyName("plain sword");
16 SetId( ({ "sword", "short sword" }) );
17 SetAdjectives( ({ "short" }) );
18 SetShort("a plain sword");
19 SetLong("A cheap and rather dull short sword.");
20 SetMass(150);
21 SetDollarCost(50);
22 SetVendorType(VT_WEAPON);
:x I saved and exited
"/realms/cratylus/area/weap/sword.c" 26 lines 633 bytes
Exit from ed.
> update sword I loaded the file into memory
/realms/cratylus/area/weap/sword: Ok
+
+


Let's take this step by step:

1) I changed my working directory to my area weapons dir:
cd /realms/cratylus/area/weap

2) I listed the contents of that dir: ls

3) I ran the ed command on the file sword.c: ed sword.c

4) Within the editor, I issued the 'n' command. This makes the editor
display line numbers next to the lines.

5) Within the editor, I issued the '1z' command. What 'z' does is display
about 20 lines of the file (the exact number depends on your screen
settings. In my case it's 22). If you happen to be looking at line 1, it
will display lines 1 through to about 20. If you happen to be looking
at line 40, it will display from line 40 to about 60.
If you want to start looking at lines starting at line 15, you
can issue the '15z' command, which basically means "display about 20
lines starting at line 15".
In this case, I wanted to start from the beginning of the file,
so I issued '1z'.

6) '1z' stopped listing the file at line 22, so I entered 'z' again to
list the rest.

7) Since I want to change "short sword" to "plain sword", I examined each
line to find the word "short". I noticed that line 15 has "short" in it,
so to get a look at that line alone, I entered '15'.

8) Now that I'm sure line 15 needs to change, I issue the '15c' command.
'c' indicates that I want to change a line. '15c' means "delete whatever
was in line 15, and replace it with what I am about to type".

9) You can see that my editor prompt changed from ":" to "*". What this
means is that I am now in "input mode". Whatever I type now will be
added to the file. Since my last command in "command mode" was '15c',
I am now replacing that line with what I want the line to contain:
SetKeyName("plain sword");

10) Ok, I replaced the line, but I'm still in input mode. To go back to
command mode, I type a single period and enter, like this:
.

11) I'm back in command mode now. When I list the file contents with
'1z' I can see that line 15 now says what I wanted.

12) Now I see another line that needs changing, so I enter '18' to
get a closer look.

13) Sure enough, 18 needs to change, so I issue '18c'.

14) Like I did for line 15, I enter what the line should be.

15) To return to command mode, I enter a single period on a blank line.

16) I list the file contents, and see that my change was successful.

17) I'm finished making my changes, so I issue the 'x' command. 'x'
means "save the changes I have made, and exit the editor".

18) I am now at my regular command prompt. To load my changes to this
file, I type 'update sword'.


Editor basics, part 2



In the last section you saw what a simple line
replacement looks like in ed. Next we'll talk about some common
ed actions.

ADDING STUFF:

Suppose I want to specify that this sword requires only
one hand to wield it:

+
+

> ed sword.c started the editor
/realms/cratylus/area/weap/sword.c, 633 bytes
:n enabled line number printing
number on, list off
:15,22 listed lines 15 to 22
15 SetKeyName("plain sword");
16 SetId( ({ "sword", "short sword" }) );
17 SetAdjectives( ({ "short" }) );
18 SetShort("a plain sword");
19 SetLong("A cheap and rather dull short sword.");
20 SetMass(150);
21 SetDollarCost(50);
22 SetVendorType(VT_WEAPON);
:20a appended to the file after line 20
21. * SetHands(1); entered my added text
22. * . single dot on a blank line to exit input mode
:18,22 displayed line 18 through 22
18 SetShort("a plain sword");
19 SetLong("A cheap and rather dull short sword.");
20 SetMass(150);
21 SetHands(1);
22 SetDollarCost(50);
:x exited editor and saved
"/realms/cratylus/area/weap/sword.c" 27 lines 646 bytes
Exit from ed.
+
+


Here you can see that instead of 'c', which replaces, I
used 'a', which adds. I decided my new line would go after line
20, so I issued the command '20a'. Once I was done, I typed
a single dot on a blank line to exit "input mode". You'll notice
I didn't use the 'z' command. Instead, since I knew where my
changes would go, I decided to list lines 18 through 22 with
the command '18,22'. I then issued the 'x' command to save my
changes and exit the editor.
If had I wanted my addition to go in front of line 20,
I could have used the '20i' command.

DELETING LINES

Suppose I'm tired of seeing header lines that no
longer apply to this file. We can delete a single line, or
a range of lines, with the 'd' commmand:

+
> ed sword.c
+
/realms/cratylus/area/weap/sword.c, 646 bytes
:n enabled line number printing
number on, list off
:1,10 listed lines 1 to 10
1 /* /domains/Examples/weapon/sword.c
2 * from the Nightmare IV LPC Library
3 * a simple sword example, nothing fancy
4 * created by Descartes of Borg 950402
5 */
6
7 #include <lib.h>
8 #include <damage_types.h>
9 #include <vendor_types.h>
10
:1,5d deleted lines 1 to 5
:1,5 listed (the new) lines 1 to 5
1
2 #include <lib.h>
3 #include <damage_types.h>
4 #include <vendor_types.h>
5
:1d deleted blank line 1
:1z displayed the file starting at line 1
1 #include <lib.h>
2 #include <damage_types.h>
3 #include <vendor_types.h>
4
5 inherit LIB_ITEM;
6
7 static void create() {
8 item::create();
9 SetKeyName("plain sword");
10 SetId( ({ "sword", "short sword" }) );
11 SetAdjectives( ({ "short" }) );
12 SetShort("a plain sword");
13 SetLong("A cheap and rather dull short sword.");
14 SetMass(150);
15 SetHands(1);
16 SetDollarCost(50);
17 SetVendorType(VT_WEAPON);
18 SetClass(20);
19 SetDamageType(BLADE);
20 SetWeaponType("blade");
21 }
:x exited and saved
"/realms/cratylus/area/weap/sword.c" 21 lines 476 bytes
Exit from ed.
+
+


First I deleted lines 1 through 5 with the command '1,5d'.
Then, for good measure, I removed the remaining blank line '1d'.
Voila. Cleaner code.

REPLACING STRINGS

Well now I want to replace all instances of "short" with
"plain", and I don't feel like editing each matching line
manually. I can do a search and replace. First I will list which
lines need to change, then I will change them:

+
> ed sword.c
+
/realms/cratylus/area/weap/sword.c, 476 bytes
:n
enabled line number printing
number on, list off
:g/short/p
searched for and displayed lines containing "short"
10 SetId( ({ "sword", "short sword" }) );
11 SetAdjectives( ({ "short" }) );
13 SetLong("A cheap and rather dull short sword.");
:g/short/s/short/plain
searched for "short" and replaced with "plain"
:g/short/p
searched for "short" again but found none
:1z
listed file from line 1
1 #include <lib.h>
2 #include <damage_types.h>
3 #include <vendor_types.h>
4
5 inherit LIB_ITEM;
6
7 static void create() {
8 item::create();
9 SetKeyName("plain sword");
10 SetId( ({ "sword", "plain sword" }) );
11 SetAdjectives( ({ "plain" }) );
12 SetShort("a plain sword");
13 SetLong("A cheap and rather dull plain sword.");
14 SetMass(150);
15 SetHands(1);
16 SetDollarCost(50);
17 SetVendorType(VT_WEAPON);
18 SetClass(20);
19 SetDamageType(BLADE);
20 SetWeaponType("blade");
21 }
:1
moved to line 1
1 #include <lib.h>
:I
ran automatic indentation
Indenting entire code...
Indentation complete.
:1z
listed file from line 1
#include <lib.h>
#include <damage_types.h>
#include <vendor_types.h>

inherit LIB_ITEM;

static void create() {
item::create();
SetKeyName("plain sword");
SetId( ({ "sword", "plain sword" }) );
SetAdjectives( ({ "plain" }) );
SetShort("a plain sword");
SetLong("A cheap and rather dull plain sword.");
SetMass(150);
SetHands(1);
SetDollarCost(50);
SetVendorType(VT_WEAPON);
SetClass(20);
SetDamageType(BLADE);
SetWeaponType("blade");
}
:x
exited and saved
"/realms/cratylus/area/weap/sword.c" 21 lines 488 bytes
Exit from ed.
+
+


The command g/short/p showed me all the lines
that contained the substring "short". Then I ran the global
search and replace command to substitute "plain" for "short",
:g/short/s/short/plain
Then I searched again for the string "short" and
nothing came up, because it had been replaced.

Finally I went to line number 1 and issued the 'I'
command. This auto-indents the code, making it neater and
easier to read.


Editor basics, part 3



Now let's look at some common problems:


1) Accidental deletion


If you type 1,20d when you meant to type 1,2d you will end
up with a file 18 lines shorter than you intended. ed does not
have an "undo" command, so those lines will never come back.
However, if you quit the editor *without saving*, then that
deletion will not be committed to the file. You can issue the 'Q'
command:

:Q

To force quit without saving. Of course, if those lines
weren't already in the file, this won't help much.


2) Can't leave the editor


You try to write and exit, but get this:

:x
File command failed.

What this means is that for some reason, you can't write
to the file, so you don't exit the editor. What this usually means is that
you tried to edit a file that does not belong to you. Since you do not
have permission to modify the file, ed refuses to commit your changes.

There are two ways around this. If you don't really care
whether your changes are saved or not, you can just force quit the
editor with 'Q':

:Q
Exit from ed.

Your changes will be lost, but you'll be out of the editor.

If you really want to save this file, you'll have to save it
somewhere other than your current working directory (cwd). You can save
it to your home directory with the 'w' command, then force quit:

:w /realms/cratylus/sword.c
"/realms/cratylus/sword.c" 20 lines 478 bytes
:Q
Exit from ed.


3) Indent command fails


You try to auto-indent your code but get an error like this:

:I
Indenting entire code...
Unterminated string in line 13
Indentation halted.

This is pretty self explanatory. Indent relies on a certain
amount of coherence in your code, and if your syntax is sufficiently
munged, it can't figure out how to properly do its thing.
Examine the line that indent complains about, and also the
line before it. Sometimes a good line is accused of being bad, just
because it comes after a bad line.


4) I need to [something] in ed, but don't know how!


While in command mode, type 'h' and enter. You'll get
a handy list of ed commands available to you.


5) My ability/patience/time is limited. I want not to use ed.


I feel your pain. The currently available ways around
this are:

1) Shell account. If you can get shell, or command line access
to the computer that is running the mud, then you can probably
use an editor local to that computer (like vim) to edit files.
Chances are, though, that if you are a regular rank-and-file
creator, you will not be given shell access. Most system admins
consider giving random people off the net shell access
an abomination.

2) Server FTP/SFTP. The server that runs the mud might have an
ftp server or sftpd access. Again, most security-conscious sysadmins
will not permit Just Some Person Off The Internet to have this
kind of access.

3) Mud FTP. I don't like this option. Unix FTPD is a security
concern as it is. Using unsupported, un-warrantied mud network code
to provide ftp access to files seems to me to be equivalent to pulling
down your pants, bending over, and whistling for the Internet to
come visit. But...it's an option.

4) Client upload. This is actually the most sensible option, if
you are truly allergic to ed. You still need to use ed, but what
you can do is write your code in your favorite local editor, like
notepad or gvim or whatever. Then use your mud client (most of them
have an option to "send text") to send the code by running ed,
entering input mode, copying the code from your editor, and
pasting it into your client.
This is a somewhat awkward system, and ill-suited to
making minor changes. But it has the virtue of working well and
being a widely available option.

5) Suck it up. Really, you need to just get used to it. Don't
make me tell you stories about how when I was younger I had to
code using a VT terminal with no cut-and-paste, in an unheated,
locked computer lab 20'x10' in size, at 9600 bps. In a snowstorm.
Uphill both ways.



Dead Souls Homepage



+ + diff -c -r --new-file ds1.1/lib/www/errors/badcmd.html ds2.0r27/lib/www/errors/badcmd.html *** ds1.1/lib/www/errors/badcmd.html Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/www/errors/badcmd.html Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1 ---- + Bad command. diff -c -r --new-file ds1.1/lib/www/errors/badgate.html ds2.0r27/lib/www/errors/badgate.html *** ds1.1/lib/www/errors/badgate.html Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/www/errors/badgate.html Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1 ---- + Bad gateway. diff -c -r --new-file ds1.1/lib/www/errors/notfound.html ds2.0r27/lib/www/errors/notfound.html *** ds1.1/lib/www/errors/notfound.html Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/www/errors/notfound.html Wed Jul 5 00:01:06 2006 *************** *** 0 **** --- 1 ---- + 404 diff -c -r --new-file ds1.1/lib/www/example.html ds2.0r27/lib/www/example.html *** ds1.1/lib/www/example.html Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/www/example.html Wed Jul 5 00:00:59 2006 *************** *** 0 **** --- 1,739 ---- + + + + Dead Souls Mudlib - Quick Creation System + + + + + + + + + + + +

Index

+ +

QCS Described

+

The Quick Creation System (or QCS) is a series of commands and + modules that lets you create rooms, objects, exits, and NPCs easily and + quickly. Before the QCS, if you wanted to make an orc, you would edit + the text file by hand, or copy a template file and use an editor to + manually change the lines you needed to modify. This could be a + tiresome process, as the standard editor can be a bit awkward, and + making dozens of objects this way could be real torture for beginners.

+

The QCS changes all of that. Rather than use an editor to modify + files, the QCS gives you commands that permit you to modify objects on + the fly. This means that orc creation, for example, could involve just + the following simple steps (please note "NPC" is another word for + "Mob"):

+
+
    +
  • create npc new_orc
  • +
  • modify npc name orc
  • +
  • modify orc short a mean-looking orc
  • +
  • modify orc long A typical orc: nasty, + brutish, and short.
  • +
  • modify orc race orc
  • +
+
+

And that's it. All your modifications automatically get written to + new_orc.c (usually in your area directory), and you now have an npc you + can add to a room. Adding things to rooms is just as easy. Creating + weapons, armor, and other objects are done the same way. For complete + details and examples, read the + QCS chapters in the Creators Manual. The QCS section starts in chapter + 31.

+

Example Log

+

Below you will find an excerpt from an short building session using + Dead Souls. This should be more or less exactly what you'll see by + entering + the commands hilighted in red.

+
+

The first thing we need to do is get back to our personal work room. + We can + do this using the home command.

+
+ home +
/realms/testycre/workroom
Testycre's workroom [e,d]
You are standing in the workroom of the mighty Testycre!
You may return to the Creators' Hall by going down.
A sample room is east.
There is a sign here you can read.
There is a sheet here you can read.
A wooden chest is here.
+
+

Next, we move east to a sample room that is created automatically + for us. + We'll be experimenting in here.

+
+ east
+
+
/realms/testycre/area/room/sample_room
Sample Room [e, w]
This is a room you can use as a template.
A simple table is here.
A fighter is standing here.
+
+ +

Room Creation (Back to Top)

+

This is the standard sample room. We're about to create a new room + to the north of it via the create command.

+
+ create room north test1 +
It appears you have write access to this area.
It's a null mapping
Indenting file...
"/tmp/indent.1134436511.tmp.dat" 20 lines 330 bytes
Exit from ed.

You wave your hand, and a new exit appears.
You begin uttering a magical incantation.
Indenting file...
"/tmp/indent.1134436511.tmp.dat" 27 lines 543 bytes
Exit from ed.

Indenting file...
"/tmp/indent.1134436511.tmp.dat" 27 lines 544 bytes
Exit from ed.
+
+

We can now move east to our new room. Notice how it says it's a copy + of our sample room.

+
+ n +
/realms/testycre/area/room/test1
Copy of /realms/testycre/area/room/sample_room.c [s]
This is a room you can use as a template.
A simple table is here.
A fighter is standing here.
+
+

Now we'll change the short description to avoid confusion between + our + original sample room and the newly created one. Note that a room's + short + description appears as its title or name near the top of the text when + a + user looks at it.

+
+ modify here short Room One +
Indenting file...
"/tmp/indent.1134436526.tmp.dat" 27 lines 515 bytes
Exit from ed.
+
+

We don't need the fighter from the other room here, so we remove him + from this new room's inventory.

+
+ delete fighter +
Indenting
file...
"/tmp/indent.1134436532.tmp.dat" 26 lines 507 bytes
Exit from ed.

/realms/testycre/area/room/test1: Ok
/realms/testycre/area/room/test1
Room One [w]
This is a room you can use as a template.
A simple table is here.

SetInventory modification complete.
+
+

Now we'll make another room.

+
+ create room east test2 +
It appears you have write access to this area.
It's a null mapping
Indenting file...
"/tmp/indent.1134436578.tmp.dat" 20 lines 324 bytes
Exit from ed.

You wave your hand, and a new exit appears.
You begin uttering a magical incantation.
Indenting file...
"/tmp/indent.1134436578.tmp.dat" 27 lines 557 bytes
Exit from ed.

Indenting file...
"/tmp/indent.1134436578.tmp.dat" 27 lines 525 bytes
Exit from ed.
+
+

We'll move east into the newly created room.

+
+ e +
/realms/testycre/area/room/test2
Copy of /realms/testycre/area/room/test1.c [w]
This is a room you can use as a template.
A simple table is here.
+
+

Once again, we'll rename our new room.

+
+ modify here short Room 2 +
Indenting file...
"/tmp/indent.1134436590.tmp.dat" 26 lines 499 bytes
Exit from ed.
+
+

We can now set the room's long description. This will show up as the + body of the room when a player types look.

+
+ modify here long This is the second test room. +
Indenting file...
"/tmp/indent.1134436608.tmp.dat" 26 lines 487 bytes
Exit from ed.
+
+

We don't need that table here, let's delete it.

+
+ delete table +
Indenting file...
"/tmp/indent.1134436612.tmp.dat" 25 lines 447 bytes
Exit from ed.

/realms/testycre/area/room/test2: Ok
/realms/testycre/area/room/test2
Room 2 [w]
This is the second test room.
SetInventory modification complete.
+
+

For the sake of self-assurance, we can look at the room's file to + make + sure that our modifications are actually being saved.

+
+ more here +
#include <lib.h>
#include "/realms/testycre/customdefs.h"

inherit LIB_ROOM;

static void create() {
room::create();
SetClimate("indoors");
SetAmbientLight(30);
SetShort("Room 2");
SetLong("This is the second test room.");
SetExits(([
"west" : "/realms/testycre/area/room/test1",
]));

SetItems( ([
"template" : "That's what this is.",
]) );

SetInventory(([
]));
}

void init(){
::init();
}
+
+ +

NPC Creation (Back to Top)

+

Now we'll create a new NPC (Mob) called "guy". The file name will + also + be "guy".

+
+ create npc guy +
I'm going to go with the appropriate area directory:
/realms/testycre/area/npc/guy.c
You wave your hand mysteriously and a generic npc materializes!
+
+

We can look at our new room and see + the NPC + standing there.

+
+ l +
/realms/testycre/area/room/test2
Room 2 [w]
This is the second test room.
A generic npc is standing here.
+
+

The first thing to do is to rename the new NPC in order to avoid + confusion. An NPC's name is what the lib refers to the NPC as.

+
+ modify npc name guy +
Indenting file...
"/tmp/indent.1134436801.tmp.dat" 15 lines 417 bytes
Exit from ed.
+
+

We can now set one or more NPC aliases, called "ids". Note that in + the + following example, we enter three different ones, all of which point to + the + same NPC. A player could look at any of + these + IDs and get the NPC.

+
+ modify npc id +
This setting takes multiple values. If you have no more values to
enter, then enter a dot on a blank line. To cancel, enter a single q on a blank
line.
You may now enter the next value. So far, it is blank.
If you're done entering values, enter a dot on a blank line.
dude + You may now enter the next value. So far, we have: ({ "dude" }) + If you're done entering values, enter a dot on a blank line. + fellow + You may now enter the next value. So far, we have: ({ "dude", "fellow" + }) + If you're done entering values, enter a dot on a blank line. + fella + You may now enter the next value. So far, we have: ({ "dude", "fellow", + "fella" + }) + If you're done entering values, enter a dot on a blank line. + . + Entries complete. Final array is: ({ "dude", "fellow", "fella" }) + Indenting file... + "/tmp/indent.1134436831.tmp.dat" 19 lines 442 bytes + Exit from ed. + + /realms/testycre/tmp/guy1134436805: Ok + /realms/testycre/area/npc/guy: Ok + SetId modification complete. +
+
+

Now we'll set the NPCs short description, or name. Any condition + such as + "is standing here" is appended to the end of the NPC's short + description, + so don't end it with a period or any other punctuation.

+
+ modify guy short The Dude +
Indenting file...
"/tmp/indent.1134436855.tmp.dat" 19 lines 437 bytes
Exit from ed.
+
+

We'll set the long description. This is what is shown when someone + actually + looks directly at the NPC.

+
+ modify guy long This is just some random guy +
Indenting file...
"/tmp/indent.1134436904.tmp.dat" 19 lines 408 bytes
Exit from ed.
+
+

Adjectives are useful for complementing NPCs and other objects. For + example, if our guy is 'oily' or 'hairy' as described in his long + description, a player + would be able to do a look oily guy and + see the guy even if "oily" isn't in his actual name/id.

+
+ modify guy adj +
This setting takes multiple values. If you have no more values to
enter, then enter a dot on a blank line. To cancel, enter a single q on a blank
line.
You may now enter the next value. So far, it is blank.
If you're done entering values, enter a dot on a blank line.
hairy + You may now enter the next value. So far, we have: ({ "just some" }) + If you're done entering values, enter a dot on a blank line. + stinky + You may now enter the next value. So far, we have: ({ "just some", + "random" }) + If you're done entering values, enter a dot on a blank line. + oily + You may now enter the next value. So far, we have: ({ "just some", + "random", + "some" }) + If you're done entering values, enter a dot on a blank line. + . + Entries complete. Final array is: ({ "just some", "random", "some" }) + Indenting file... + "/tmp/indent.1134436924.tmp.dat" 19 lines 402 bytes + Exit from ed. + + /realms/testycre/tmp/guy1134436912: Ok + /realms/testycre/area/npc/guy: Ok + SetAdjectives modification complete. +
+
+

Let's look at our room and see if the Dude is appearing as expected.

+
+ look +
/realms/testycre/area/room/test2
Room 2 [w]
This is the second test room.
The Dude is standing here.
+
+

We'll check out the Dude's file and see how QCS has set up the NPC + for us.

+
+ about dude +
/realms/testycre/area/npc/guy.c

#include <lib.h>

inherit LIB_SENTIENT;

static void create() {
sentient::create();
SetKeyName("guy");
SetAdjectives( ({"just some", "random", "some"}) );
SetId( ({"dude", "fellow", "fella"}) );
SetShort("The Dude");
SetLong("This is just some random guy.");
SetLevel(1);
SetRace("human");
SetClass("explorer");
SetGender("male");
}

void init(){
::init();
+
+ +

Weapon Creation (Back to Top)

+

Now we'll create a weapon for our NPC. "hammer" is the filename.

+
+ create weapon hammer +
I'm going to go with the appropriate area directory:
/realms/testycre/area/weap/hammer.c
You wave your hand mysteriously and a generic weapon materializes!
+
+

And then set the hammer's ID(s)

+
+ modify weapon id hammer +
This setting takes multiple values. If you have no more values to
enter, then enter a dot on a blank line. To cancel, enter a single q on a blank
line.
You may now enter the next value. So far, we have: ({ "hammer" })
If you're done entering values, enter a dot on a blank line.
warhammer + You may now enter the next value. So far, we have: ({ "hammer", + "warhammer" }) + If you're done entering values, enter a dot on a blank line. + . + Entries complete. Final array is: ({ "hammer", "warhammer" }) + Indenting file... + "/tmp/indent.1134437181.tmp.dat" 19 lines 453 bytes + Exit from ed. + + /realms/testycre/tmp/hammer1134437165: Ok + /realms/testycre/area/weap/hammer: Ok + SetId modification complete. +
+
+

And now we will set the weapon's name to "hammer".

+
+ modify weapon name hammer +
There is no weapon here.
look + /realms/testycre/area/room/test2 + Room 2 [w] + This is the second test room. + A generic weapon is here. + The Dude is standing here. +
+
+

What's happened here is that we changed the weapon's ID before the + name. + Luckily, this is easy to fix.

+
+ modify hammer name hammer +
Indenting file...
"/tmp/indent.1134437205.tmp.dat" 22 lines 474 bytes
Exit from ed.
+
+

Now we'll look at the hammer's file to see how it looks.

+
+ about hammer +
/realms/testycre/area/weap/hammer.c

#include <lib.h>
#include <damage_types.h>
#include <vendor_types.h>

inherit LIB_ITEM;

static void create() {
item::create();
SetKeyName("hammer");
SetId( ({"hammer", "warhammer"}) );
SetAdjectives( ({ "generic" }));
SetShort("a generic weapon");
SetLong("A weapon of indeterminate proportions.");
SetMass(50);
SetVendorType(VT_WEAPON);
SetClass(30);
SetDamageType(BLADE);
SetWeaponType("blade");

}
void init(){
::init();
}
+
+

We can now set the hammer's damage type to blunt for a nice crushing + effect.

+
+ modify hammer damagetype blunt +
Indenting file...
"/tmp/indent.1134437392.tmp.dat" 22 lines 474 bytes
Exit from ed.
+
+

And now set the weapon type.

+
+ modify hammer weapontype blunt +
Indenting file...
"/tmp/indent.1134437398.tmp.dat" 22 lines 474 bytes
Exit from ed.
+
+

Similarly, set the mass.

+
+ modify hammer mass 700 +
Indenting file...
"/tmp/indent.1134437414.tmp.dat" 22 lines 475 bytes
Exit from ed.
+
+

We will now make the weapon require two hands to use.

+
+ modify hammer hands 2 +
Indenting file...
"/tmp/indent.1134437422.tmp.dat" 23 lines 492 bytes
Exit from ed.
+
+

We'll double-check our hammer's file now to see if everything was + set.

+
+ about hammer +
/realms/testycre/area/weap/hammer.c

#include <lib.h>
#include <damage_types.h>
#include <vendor_types.h>

inherit LIB_ITEM;

static void create() {
item::create();
SetKeyName("hammer");
SetId( ({"hammer", "warhammer"}) );
SetAdjectives( ({ "generic" }));
SetShort("a generic weapon");
SetLong("A weapon of indeterminate proportions.");
SetHands(2);
SetMass(700);
SetVendorType(VT_WEAPON);
SetClass(30);
SetDamageType(BLUNT);

SetWeaponType("blunt");
}

void init(){
::init();
}
+
+

Now we'll set that short description.

+
+ modify hammer short a heavy war hammer +
Indenting file...
"/tmp/indent.1134437450.tmp.dat" 23 lines 494 bytes
Exit from ed.
+
+

And our long description...

+
+ modify hammer long This is an extremely large and + heavy hammer designed to be wielded in both hands and used to hurt + people very badly indeed. +
Indenting file...
"/tmp/indent.1134437509.tmp.dat" 23 lines 579 bytes
Exit from ed.
+
+

Setting some adjectives.

+
+ modify hammer adj +
This setting takes multiple values. If you have no more values to
enter, then enter a dot on a blank line. To cancel, enter a single q on a blank
line.
You may now enter the next value. So far, it is blank.
If you're done entering values, enter a dot on a blank line.
large + You may now enter the next value. So far, we have: ({ "large" }) + If you're done entering values, enter a dot on a blank line. + heavy + You may now enter the next value. So far, we have: ({ "large", "heavy" + }) + If you're done entering values, enter a dot on a blank line. + war + You may now enter the next value. So far, we have: ({ "large", "heavy", + "war" }) + If you're done entering values, enter a dot on a blank line. + . + Entries complete. Final array is: ({ "large", "heavy", "war" }) + Indenting file... + "/tmp/indent.1134437531.tmp.dat" 23 lines 592 bytes + Exit from ed. + + /realms/testycre/tmp/hammer1134437521: Ok + /realms/testycre/area/weap/hammer: Ok + SetAdjectives modification complete. +
+
+

And finally, look at our hammer file.

+
+ about hammer +
/realms/testycre/area/weap/hammer.c

#include <lib.h>
#include <damage_types.h>
#include <vendor_types.h>

inherit LIB_ITEM;

static void create() {
item::create();
SetKeyName("hammer");
SetAdjectives( ({"large", "heavy", "war"}) );
SetId( ({"hammer", "warhammer"}) );
SetShort("a heavy war hammer");
SetLong("This is an extremely large and heavy hammer designed to be wielded
in both hands and used to hurt people very badly indeed.");
SetHands(2);
SetMass(700);
SetVendorType(VT_WEAPON);
SetClass(30);
SetDamageType(BLUNT);

SetWeaponType("blunt");
}

void init(){
::init();
}
+
+

It's a pretty heavy hammer, so let's make sure our guy can wield it.

+
+ modify guy level 10 +
Indenting file...
"/tmp/indent.1134437557.tmp.dat" 19 lines 403 bytes
Exit from ed.
+
+

With this simple command we add the hammer to the permanent + inventory of our guy.

+
+ add hammer to guy +
ob2: /realms/testycre/area/npc/guy.c
ob: /realms/testycre/area/weap/hammer.c
Please enter a command for the NPC to perform with this item. If you
have no such command to enter, enter the number of these items you want to add:
wield hammer + Indenting file... + "/tmp/indent.1134437569.tmp.dat" 22 lines 489 bytes + Exit from ed. + + /realms/testycre/area/npc/guy: Ok + Guy wields a heavy war hammer. + SetInventory modification complete. +
+
+

And now we take a look at our guy.

+
+ exa guy +
This is just some random guy.
The male human is in top condition.
Guy is carrying:
A heavy war hammer (wielded in left hand and right hand)
+
+

And check the guy's file.

+
+ about guy +
/realms/testycre/area/npc/guy.c

#include <lib.h>

inherit LIB_SENTIENT;

static void create() {
sentient::create();
SetKeyName("guy");
SetAdjectives( ({"just some", "random", "some"}) );
SetId( ({"dude", "fellow", "fella"}) );
SetShort("The Dude");
SetLong("This is just some random guy.");
SetInventory(([
"/realms/testycre/area/weap/hammer" : "wield hammer",
]));
SetLevel(10);
SetRace("human");
SetClass("explorer");
SetGender("male");
}

void init(){
::init();
}
+
+ +

Armor Creation (Back to Top)

+

Making armor is just as easy.

+
+ create armor helmet +
I'm going to go with the appropriate area directory:
/realms/testycre/area/armor/helmet.c
You wave your hand mysteriously and generic armor materializes!
modify armor name helmet + Indenting file... + "/tmp/indent.1134437645.tmp.dat" 18 lines 483 bytes + Exit from ed. + + modify helmet id + This setting takes multiple values. If you have no more values to + enter, then enter a dot on a blank line. To cancel, enter a single q on a blank + line. + You may now enter the next value. So far, it is blank. + If you're done entering values, enter a dot on a blank line. + helm + You may now enter the next value. So far, we have: ({ "helm" }) + If you're done entering values, enter a dot on a blank line. + headgear + You may now enter the next value. So far, we have: ({ "helm", + "headgear" }) + If you're done entering values, enter a dot on a blank line. + cover + You may now enter the next value. So far, we have: ({ "helm", + "headgear", + "cover" }) + If you're done entering values, enter a dot on a blank line. + . + Entries complete. Final array is: ({ "helm", "headgear", "cover" }) + Indenting file... + "/tmp/indent.1134437661.tmp.dat" 22 lines 535 bytes + Exit from ed. + + /realms/testycre/tmp/helmet1134437649: Ok + /realms/testycre/area/armor/helmet: Ok + SetId modification complete. + modify helmet short a horned viking helmet + Indenting file... + "/tmp/indent.1134437692.tmp.dat" 22 lines 544 bytes + Exit from ed. + + modify helmet long Vikings
didn't really wear horned helmets into combat, but this one does look
formidable with its large bull horns and thick iron construction. It
should prove very protective.
+ Indenting file... + "/tmp/indent.1134437772.tmp.dat" 22 lines 666 bytes + Exit from ed. +
+ modify helmet adj + This setting takes multiple values. If you have no more values to + enter, then enter a dot on a blank line. To cancel, enter a single q on a blank + line. + You may now enter the next value. So far, it is blank. + If you're done entering values, enter a dot on a blank line. + iron + You may now enter the next value. So far, we have: ({ "iron" }) + If you're done entering values, enter a dot on a blank line. + thick + You may now enter the next value. So far, we have: ({ "iron", "thick" }) + If you're done entering values, enter a dot on a blank line. + viking + You may now enter the next value. So far, we have: ({ "iron", "thick", + "viking" + }) + If you're done entering values, enter a dot on a blank line. + horned + You may now enter the next value. So far, we have: ({ "iron", "thick", + "viking", + "horned" }) + If you're done entering values, enter a dot on a blank line. + formidable + You may now enter the next value. So far, we have: ({ "iron", "thick", + "viking", + "horned", "formidable" }) + If you're done entering values, enter a dot on a blank line. + protective + You may now enter the next value. So far, we have: ({ "iron", "thick", + "viking", + "horned", "formidable", "protective" }) + If you're done entering values, enter a dot on a blank line. + . + Entries complete. Final array is: ({ "iron", "thick", "viking", + "horned", + "formidable", "protective" }) + Indenting file... + "/tmp/indent.1134437802.tmp.dat" 22 lines 722 bytes + Exit from ed. + + /realms/testycre/tmp/helmet1134437782: Ok + /realms/testycre/area/armor/helmet: Ok + SetAdjectives modification complete. + about helmet + /realms/testycre/area/armor/helmet.c + + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("helmet"); + SetAdjectives( ({"iron", "thick", "viking", + "horned", "formidable", + "protective"}) ); + SetId( ({"helm", "headgear", "cover"}) ); + SetShort("a horned viking helmet"); + SetLong("Vikings didn't really wear horned helmets into combat, but this one + does look formidable with its large bull horns and thick iron construction. It + should prove very protective."); + SetMass(50); + SetDamagePoints(100); + SetArmorType(A_BODY_ARMOR); + SetProtection(BLUNT, 20); + SetProtection(BLADE, 20); + SetProtection(KNIFE, 20); + } + + void init(){ + ::init(); + } + modify helmet armortype helmet + Indenting file... + "/tmp/indent.1134437818.tmp.dat" 22 lines 718 bytes + Exit from ed. + + modify helmet mass 200 + Indenting file... + "/tmp/indent.1134437830.tmp.dat" 22 lines 719 bytes + Exit from ed. + + modify helmet protection + Your armor can protect against one or more of the following types of + damage: + blunt, blade, knife, water, shock, cold, heat, gas, acid, magic, poison, + disease, trauma, .. + + Please enter which ones your armor should protect from, one at a time. + When you are done, please type a dot on a blank line. + blunt + You may now enter the next value. So far, we have: ({ "blunt" }) + If you're done entering values, enter a dot on a blank line. + blade + You may now enter the next value. So far, we have: ({ "blunt", "blade" + }) + If you're done entering values, enter a dot on a blank line. + knife + You may now enter the next value. So far, we have: ({ "blunt", "blade", + "knife" + }) + If you're done entering values, enter a dot on a blank line. + trauma + You may now enter the next value. So far, we have: ({ "blunt", "blade", + "knife", + "trauma" }) + If you're done entering values, enter a dot on a blank line. + . + Protections list complete. + Please enter the protection value for: BLUNT + 15 + Please enter the protection value for: BLADE + 20 + Please enter the protection value for: KNIFE + 25 + Please enter the protection value for: TRAUMA + 10 + This is where the mapping gets sent somewhere. + ProtectionsMap is: ([ "BLADE" : 20, "BLUNT" : 15, "TRAUMA" : 10, + "KNIFE" : 25 ]) + Indenting file... + "/tmp/indent.1134437901.tmp.dat" 23 lines 750 bytes + Exit from ed. + + about helmet + /realms/testycre/area/armor/helmet.c + + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("helmet"); + SetAdjectives( ({"iron", "thick", "viking", + "horned", "formidable", + "protective"}) ); + SetId( ({"helm", "headgear", "cover"}) ); + SetShort("a horned viking helmet"); + SetLong("Vikings didn't really wear horned helmets into combat, but this one + does look formidable with its large bull horns and thick iron construction. + It should prove very protective."); + SetMass(200); + SetDamagePoints(100); + SetArmorType(A_HELMET); + SetProtection(BLADE, 20); + SetProtection(BLUNT, 15); + SetProtection(TRAUMA, 10); + + SetProtection(KNIFE, 25); + } + + void init(){ + ::init(); + } + l + /realms/testycre/area/room/test2 + Room 2 [w] + This is the second test room. + A horned viking helmet and a heavy war hammer are here. + The Dude is standing here. + + exa dude + This is just some random guy. + The male human is in top condition. + Guy is carrying: + A heavy war hammer (wielded in left hand and right hand) + + add helmet to dude + ob2: /realms/testycre/area/npc/guy.c + ob: /realms/testycre/area/armor/helmet.c + Please enter a command for the NPC to perform with this item. If you have no + such command to enter, enter the number of these items you want to add: + wear helmet + Indenting file... + "/tmp/indent.1134437927.tmp.dat" 23 lines 544 bytes + Exit from ed. + + /realms/testycre/area/npc/guy: Ok + Guy wields a heavy war hammer. + Guy wears a horned viking helmet. + SetInventory modification complete. + exa dude + This is just some random guy. + The male human is in top condition. + Guy is carrying: + A heavy war hammer (wielded in left hand and right hand) + A horned viking helmet (worn) +
+
+ +

Adding Room Resets (Back to Top)

+

Ok our dude is done. Let's clean up the room by updating it.

+
+ update +
Updating environment
/realms/testycre/area/room/test2: Ok
look + /realms/testycre/area/room/test2 + Room 2 [w] + This is the second test room. + pwd + /realms/testycre: + cd area/npc + /realms/testycre/area/npc: +
+
+

We need to have the guy present in order to add him to the room:

+
+ clone guy +
Guy wields a heavy war hammer.
Guy wears a horned viking helmet.
You clone The Dude (/realms/testycre/area/npc/guy.c).
add guy to room + ob2: /realms/testycre/area/room/test2.c + ob: /realms/testycre/area/npc/guy.c + Please enter the number of these that you want to add: + 1
Indenting file... + "/tmp/indent.1134437999.tmp.dat" 26 lines 485 bytes + Exit from ed. + + /realms/testycre/area/room/test2: Ok + /realms/testycre/area/room/test2 + Room 2 [w] + This is the second test room. + The Dude is standing here. + + SetInventory modification complete. + update + Updating environment + /realms/testycre/area/room/test2: Ok +
+
+

That's it. Easy, huh? Think of how much slogging through ed this + would save you when making a large area. +

+
look +
/realms/testycre/area/room/test2
Room 2 [w]
This is the second test room.
The Dude is standing here.

exa dude + This is just some random guy. + The male human is in top condition. + Guy is carrying: + A heavy war hammer (wielded in left hand and right hand) + A horned viking helmet (worn) + + more here + #include <lib.h> + #include "/realms/testycre/customdefs.h" + + inherit LIB_ROOM; + + static void create() { + room::create(); + SetClimate("indoors"); + SetAmbientLight(30); + SetShort("Room 2"); + SetLong("This is the second test room."); + SetExits(([ + "west" : "/realms/testycre/area/room/test1", + ])); + + SetItems( ([ + "template" : "That's what this is.", + ]) ); + + SetInventory(([ + "/realms/testycre/area/npc/guy" : 1, + ])); + } + + void init(){ + ::init(); + } + + quit + Please come back another time! +
+
+
+

The End (Back to Top)

+

Obviously you still need to code some LPC in ed for complex stuff. + But knocking out rooms and NPC's and objects quickly helps you avoid + getting bogged down in mechanics when what you really want to do is + build.

+ Return to Dead Souls Homepage + + Binary files ds1.1/lib/www/favicon.ico and ds2.0r27/lib/www/favicon.ico differ diff -c -r --new-file ds1.1/lib/www/hotfix.html ds2.0r27/lib/www/hotfix.html *** ds1.1/lib/www/hotfix.html Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/www/hotfix.html Wed Jul 5 00:00:59 2006 *************** *** 0 **** --- 1,67 ---- + + + + Dead Souls Mudlib - Hotfixes + + + + + + + + + + +

Nothing's prefect. This is + most certainly true of anything I've + touched.

+

This page contains the late-breaking bugfixes found between Dead + Souls releases. Only important bugs are addressed here. Feature + enhancements and minor bugfixes become available on full release.

+

All of the fixes listed here will be included in the next release. + They + are provided here early in order to address potential problems.

+

For Dead Souls 2.0r25 + and below, + the + following fixes are available: +

+
    +
  • There is a serious + security problem that + affects all versions of Dead Souls below 2.0r26. The only fix + is to apply the patch to upgrade to 2.0r26. That patch + is available now. Try a sourceforege mirror for the patch + download. This patch can be applied to any version of Dead Souls + above 2.0r20.
    +
  • +
+
+

For Dead Souls 2.0r26, + the + following fixes are available: +

+
    +
  • The patch to 2.0r26 had to be done in great haste, to prevent the + unnecessary exposure of muds to hacking. As a result, I had to drop + some stuff in the middle. This bug is the result: copy this version of about.c + over /secure/cmds/creators/about.c + and the about command will work for rooms again.
    +
  • +
+
+
+ + + Binary files ds1.1/lib/www/images/Thumbs.db and ds2.0r27/lib/www/images/Thumbs.db differ Binary files ds1.1/lib/www/images/lpuni_afiliated.png and ds2.0r27/lib/www/images/lpuni_afiliated.png differ diff -c -r --new-file ds1.1/lib/www/index.html ds2.0r27/lib/www/index.html *** ds1.1/lib/www/index.html Fri Jan 3 22:16:56 1997 --- ds2.0r27/lib/www/index.html Wed Jul 5 00:49:19 2006 *************** *** 1,11 **** ! ! ! ! Nightmare V Object Library ! ! ! ! This is a starter home page for a new Nightmare V mud. ! ! ! --- 1,133 ---- ! ! ! ! Dead Souls Mudlib ! ! ! ! ! ! ! ! ! ! ! !
!

The Frontiers LPC Preservation ! Foundation is proud to present the release of Dead Souls 2 after a long ! period of development.

!

This distribution is optimized for the latest version of MudOS, and ! the lib has been thoroughly updated. Extensive documentation has been ! added for players and for creators, and a Quick ! Creation System ! makes world creation an absolute breeze. The download package also ! includes a version that will run on Microsoft Windows.
!

!

What is Dead Souls?

!

The Dead ! Dead Souls MUD Library is a multi-user text based adventure ! creation system. It allows the user to build their own adventure game ! which can be played over the internet simultaneously by many people. It ! is designed for both experienced and beginner MUD admins.

!

Why use Dead Souls?

!

If you love another mudlib, then go ahead and keep using it. We're ! not here to persuade anyone to stop doing what they prefer. Dead Souls ! is targeted at three main audiences:

!
    !
  1. People who are new to creating and running a MUD, and need a ! mudlib that is well-coded, well-featured, well-documented, and works ! great right out of the box. ! Dead Souls comes configured with a working combat system, races (with ! limbs and detailed body stats), classes, magic system, emotes, postures ! (even flying), built-in ftp and web servers, menu-driven MUD ! administration tool, intermud network channels, QCS, a sample town ! loaded with examples of objects and quests, banking, economics, ! variable description based on time-of-day, and much, much more.
  2. !
  3. People who liked the old Nightmare code base and want to get ! their hands on a lib with the old Nightmare magic that actually works.
  4. !
  5. Folks who tried their hand at older, unsupported mudlibs but are ! looking for something more modern and currently maintained.
  6. !
! ! ! ! ! ! ! ! ! ! ! !
!

Download Links:

! !
!

Frequently Asked Questions and Docs

! !
!

Non-Technical Information

! !
!

Additional Technical Docs

! !
!

New! ! See the LPMud information page
!

! !
! ! ! ! ! Binary files ds1.1/lib/www/lpuni_afiliated.png and ds2.0r27/lib/www/lpuni_afiliated.png differ diff -c -r --new-file ds1.1/lib/www/news.html ds2.0r27/lib/www/news.html *** ds1.1/lib/www/news.html Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/www/news.html Wed Jul 5 00:00:59 2006 *************** *** 0 **** --- 1,307 ---- + + + + Dead Souls News Page + + + + + + +
+
+
+
+
+
The + Dead Souls News + Page
+
+
+

+ 23 June 2006
+
+     I've been frustrated for some time with the way
+ the LPUniversity site seems almost intentionally
+ designed to be confusing and inscrutable to newbie
+ mudders. For example, if I didn't happen to know
+ the site is supposed to be an LPC mud resource, the
+ front page wouldn't be much help in informing me.
+
+     So I bought a domain with the single purpose
+ of clarifying things. It's a shame I had to take it
+ upon myself, but you know what they say about things
+ done right.
+
+     The lpmuds.net site + is intended to be a simple,
+ easy-to-read description of LP muds. What they are,
+ where you can get some, and where you can go to
+ talk about them. None of this fancy calendaring,
+ plenipotentiary council executive meetings, soup for
+ the needy, whatever.
+
+     It's just a web site with information that I
+ hope is useful.
+
+     If you have any suggestions or requests about
+ what the site should have, please let me know.
+
+     On another note, please be aware that Dead Souls
+ is no longer GPL. For more information, please see
+ this + article.
+
+     Saquivor has found a neat creation GUI that he's
+ adapting for DS use. Keep an eye on the downloads page
+ for a DS template. It should be available soon.
+
+
+ 18 June 2006
+
+     The 2.0r26 + patch is out. Anyone under that rev is
+ subject to having their mud compromised by any creator
+ at any time. Please upgrade NOW if + you haven't already
+ done so.
+
+     As to the issue of Tacitus, please see this link.
+
+
+ 16 June 2006
+
+     As usual, good news and bad news. The good news + first. Tacitus
+ helped discover a serious security flaw in Dead Souls. Woot!
+ Congratulations to him for being clever, and thanks for
+ helping secure DS.
+
+     The bad news is that all versions of DS are + affected, so
+ you should lock your DS muds (using admintool) and avoid
+ promoting anyone to a Creator position until the patch
+ is in place. Hopefully I'll be able to cook something up
+ this evening.
+
+     The other bad news is that I found Tacitus trying
+ to delete log files on the dev Dead Souls mud. I think I
+ was fortunate that he missed a couple of details in rooting
+ me, so he failed. However, until I can account for every
+ free inode with recovery software, the dev mud will
+ be locked also. Sadface.
+
+     For some reason, he also chose to go online and + announce
+ the details of the flaw without giving me a chance to
+ address it. This means you are rather exposed, so please
+ make sure to only allow very + trusted people to Creator postions.
+
+
+
+ 13 June 2006
+
+     The I3 + router box suffered a storage subsystem failure:
+ around 8pm the fiber array crapped out and took down the raid volume
+ the I3 router mud was on. As of 9:20 I3 is back up.
+
+
+ 09 June 2006
+
+     ROXOR. I discussed with Marius the MudOS bundling
+ question. Here's the + scoop.
+
+
+
+ 06 June 2006
+
+     I am so delighted I could pop any moment. Earlier
+ today I checked the LPU forums while at a work site,
+ and was just blown away to see Saquivor had solved
+ the Windows sockets problem. I was all smiles, and
+ could barely wait to get to my desk to poke at it.
+
+     Then...sadface. It looked like we solved the + technical
+ problem of networking, but the next problem involved GPL
+ code. MinGW used libcrypto that I could not be sure
+ was not GPL, and the native Win32 binary we made required
+ that dll.
+
+     In a burst of uncharacteristic optimism, I went
+ about seeing if I could obviate the GPL library in
+ question, and eventually solved the problem by using
+ the MudOS built-in MD5 hash auth mechanism. JOY. I
+ had to get pretty violent with the crypto code, but
+ it appears to work well, and is far more secure than
+ the old system.
+
+     The only drawback is that new passwords are not + compatible
+ with old passwords. A driver change will mean some
+ pain. Fortunately this is an unusual situation.
+
+     In the interest of cross-platform compatibility I
+ plan to make the Unix side of the DS distro MD5 auth
+ also. This will probably happen in the release following
+ the release I plan to make this evening.
+
+
+
+ 05 June 2006
+
+     I spent the entire weekend hacking at MudOS to
+ try to compile a native Win32 binary. I made a solid
+ amount of progress, and I'm almost there, but I
+ need help. Please see if you + can lend a hand.
+
+     I called RedHat bright and early today, to get
+ in touch with the Cygwin licensing people. Predictably,
+ I got no straight answers, and I am now officially waiting
+ for a call beck from a Sales Rep named Mike within
+ then next two to three business days.
+
+     What do you suppose are the chances that a Sales
+ representative will offer me what I want for free?
+ ----
+
+     He got back to me! And the verdict is:
+
+ " That license costs 25K per + year.  I did not mention it as an option + because you mentioned you we looking for a free/low cost option. The + Buyout license doesn't qualify.
+ Mike "
+ ----
+
+    
CASE CLOSED.
+
+
+
+
03 June 2006
+
+     The good news is that version 2.0r24 of Dead Souls
+ is now available for download + from Sourceforge.
+
+     The bad news is that thanks to another + observation
+ from that member of the mud community
, it's come to my
+ attention that despite my best efforts, the Windows
+ version of Dead Souls *still* may violate GPL.
+
+     I am erring on the side of caution and have unbundled
+ the Windows binary and Cygwin dll's from the Dead Souls
+ distribution.
+
+     I very much hope to have a Windows solution soon,
+ as a substantial number of the Dead Souls userbase
+ is on Windows, and presumably there are other folks
+ interested in using it.
+
+     If you can provide me with instructions on how to
+ make a non-license-violating MudOS binary, or if
+ you wish to provide me that binary already compiled,
+ I'd be delighted to accept that contribution for
+ consideration.
+
+ Until then, hang tight. We'll figure something out.
+
+
+
+
01Jun06
+
+
+     Dead Souls has been removed from the mudmagic file
+ repository. For details, please read this article.
+
+     I'm delighted to announce that Alexander + Tau has been
+ promoted to a position of substantial admin authority at
+ LPUniversity, and he has created a Dead + Souls forum just
+ for us! W00t! Congratulations, Alex. I'm certain you will
+ do an excellent job.
+
+     I've released a new article dealing with Dead Souls
+ and intellectual property
, which tends toward the dry side,
+ but it addresses issues that Dead Souls admins may have
+ brought up to them. It's intended as a reference for the
+ "official" position of Dead Souls on such matters.
+
+     You may have noticed a sexy new CSS style format for
+ some of the pages on the DS site. This is thanks to
+ Kelvin's + efforts. He took my challenge of "if you don't
+ like the site's look, do something about it" seriously,
+ and boy, it sure is easier to read, isn't it? Thank you,
+ Kelvin.
+
+
+
+
+ 22May06
+
+     If there's one thing that bugs me it's news pages for
+ projects that turn into personal blogs. I can't promise it
+ won't happen here, but I'll make the effort.
+
+     I've updated the front page a bit for clarity. It was
+ getting so *I* couldn't read it. I'm a fan of simple readable
+ text, and I hope it's easier to get what you need from it.
+     Also added a cute little favicon.
+
+     As of the current version, 2.0r22, Dead Souls is now + a
+ single download package...just one file to download whether
+ you run the Windows version or the UNIX/source code version.
+     The same is true for the patch. One file to rule + them.
+
+     I've been asked by people how they can give back to
+ the Dead Souls community. Easy. Evangelize. Tell people what
+ you honestly think of the lib. If someone's in doubt as
+ to which codebase to choose, point them our way.
+
+     If you can help me promote the lib, you've done a
+ good service. The more people use Dead Souls, the stronger
+ we are as a community. Join the MUD forums and spread the
+ word, or if that's not your style, lurk until the opportunity
+ presents itself to give us a good old shameless plug.
+
+     Also, spend some time on the LPUniversity + forums.
+ Create a login, and chat a bit. Liven the place up.
+
+
+ +
+
+
Dead Souls Home  +
+ + diff -c -r --new-file ds1.1/lib/www/qcs.html ds2.0r27/lib/www/qcs.html *** ds1.1/lib/www/qcs.html Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/www/qcs.html Wed Jul 5 00:00:59 2006 *************** *** 0 **** --- 1,1166 ---- + + + + Dead Souls Mudlib - Quick Creation System + + + + + + + + + + + + +

Index

+ + +

QCS Described

+

The Quick Creation System (or QCS) is a series of commands and modules that + lets you create rooms, objects, exits, and NPCs easily and quickly. Before the + QCS, if you wanted to make an orc, you would edit the text file by hand, or + copy a template file and use an editor to manually change the lines you needed + to modify. This could be a tiresome process, as the standard editor can be a bit + awkward, and making dozens of objects this way could be real torture for + beginners.

+

The QCS changes all of that. Rather than use an editor to modify files, the + QCS gives you commands that permit you to modify objects on the fly. This means + that orc creation, for example, could involve just the following simple steps + (please note "NPC" is another word for "Mob"):

+ +
+
    +
  • create npc new_orc
  • +
  • modify npc name orc
  • +
  • modify orc short a mean-looking orc
  • +
  • modify orc long A typical orc: nasty, brutish, and short.
  • +
  • modify orc race orc
  • +
+
+ +

And that's it. All your modifications automatically get written to new_orc.c + (usually in your area directory), and you now have an npc you can add to a room. + Adding things to rooms is just as easy. Creating weapons, armor, and other + objects are done the same way. For complete details and examples, read the + QCS chapters in the Creators Manual. The QCS section starts in chapter 31.

+ +

Example Log

+

Below you will find an excerpt from an short building session using + Dead Souls. This should be more or less exactly what you'll see by entering + the commands hilighted in red.

+
+ +

The first thing we need to do is get back to our personal work room. We can + do this using the home command.

+ +
+ home +
+ /realms/testycre/workroom
+ Testycre's workroom [e,d]
+ You are standing in the workroom of the mighty Testycre!
+ You may return to the Creators' Hall by going down.
+ A sample room is east.
+ There is a sign here you can read.
+ There is a sheet here you can read.
+ A wooden chest is here.
+ 
+
+ +

Next, we move east to a sample room that is created automatically for us. + We'll be experimenting in here.

+ +
+ east +
+ /realms/testycre/area/room/sample_room
+ Sample Room [w]
+ This is a room you can use as a template.
+ A simple table is here.
+ A fighter is standing here.
+ 
+
+ + +

Room Creation (Back to Top)

+

This is the standard sample room. We're about to create a new room to the + east of it via the create command.

+ +
+ create room east test1 +
+ It appears you have write access to this area.
+ It's a null mapping
+ Indenting file...
+ "/tmp/indent.1134436511.tmp.dat" 20 lines 330 bytes
+ Exit from ed.
+ 
+ You wave your hand, and a new exit appears.
+ You begin uttering a magical incantation.
+ Indenting file...
+ "/tmp/indent.1134436511.tmp.dat" 27 lines 543 bytes
+ Exit from ed.
+ 
+ Indenting file...
+ "/tmp/indent.1134436511.tmp.dat" 27 lines 544 bytes
+ Exit from ed.
+ 
+
+ +

We can now move east to our new room. Notice how it says it's a copy + of our sample room.

+ +
+ e +
+ /realms/testycre/area/room/test1
+ Copy of /realms/testycre/area/room/sample_room.c [w]
+ This is a room you can use as a template.
+ A simple table is here.
+ A fighter is standing here.
+ 
+
+ +

Now we'll change the short description to avoid confusion between our + original sample room and the newly created one. Note that a room's short + description appears as its title or name near the top of the text when a + user looks at it.

+ +
+ modify here short Room One +
+ Indenting file...
+ "/tmp/indent.1134436526.tmp.dat" 27 lines 515 bytes
+ Exit from ed.
+ 
+
+ +

We don't need the fighter from the other room here, so we remove him from + this new room's inventory.

+ +
+ delete fighter +
+ Indenting
+ file...
+ "/tmp/indent.1134436532.tmp.dat" 26 lines 507 bytes
+ Exit from ed.
+ 
+ /realms/testycre/area/room/test1: Ok
+ /realms/testycre/area/room/test1
+ Room One [w]
+ This is a room you can use as a template.
+ A simple table is here.
+ 
+ SetInventory modification complete.
+ 
+
+ +

Now we'll make another room.

+ +
+ create room east test2 +
+ It appears you have write access to this area.
+ It's a null mapping
+ Indenting file...
+ "/tmp/indent.1134436578.tmp.dat" 20 lines 324 bytes
+ Exit from ed.
+ 
+ You wave your hand, and a new exit appears.
+ You begin uttering a magical incantation.
+ Indenting file...
+ "/tmp/indent.1134436578.tmp.dat" 27 lines 557 bytes
+ Exit from ed.
+ 
+ Indenting file...
+ "/tmp/indent.1134436578.tmp.dat" 27 lines 525 bytes
+ Exit from ed.
+ 
+
+ +

We'll move east into the newly created room.

+ +
+ e +
+ /realms/testycre/area/room/test2
+ Copy of /realms/testycre/area/room/test1.c [w]
+ This is a room you can use as a template.
+ A simple table is here.
+ 
+
+ +

Once again, we'll rename our new room.

+ +
+ modify here short Room 2 +
+ Indenting file...
+ "/tmp/indent.1134436590.tmp.dat" 26 lines 499 bytes
+ Exit from ed.
+ 
+
+ +

We can now set the room's long description. This will show up as the + body of the room when a player types look.

+ +
+ modify here long This is the second test room. +
+ Indenting file...
+ "/tmp/indent.1134436608.tmp.dat" 26 lines 487 bytes
+ Exit from ed.
+ 
+
+ +

We don't need that table here, let's delete it.

+ +
+ delete table +
+ Indenting file...
+ "/tmp/indent.1134436612.tmp.dat" 25 lines 447 bytes
+ Exit from ed.
+ 
+ /realms/testycre/area/room/test2: Ok
+ /realms/testycre/area/room/test2
+ Room 2 [w]
+ This is the second test room.
+ SetInventory modification complete.
+ 
+
+ +

For the sake of self-assurance, we can look at the room's file to make + sure that our modifications are actually being saved.

+ +
+ more here +
+ #include <lib.h>
+ #include "/realms/testycre/customdefs.h"
+ 
+ inherit LIB_ROOM;
+ 
+ static void create() {
+  room::create();
+  SetClimate("indoors");
+  SetAmbientLight(30);
+  SetShort("Room 2");
+  SetLong("This is the second test room.");
+  SetExits(([
+  "west" : "/realms/testycre/area/room/test1",
+  ]));
+ 
+  SetItems( ([
+  "template" : "That's what this is.",
+  ]) );
+ 
+  SetInventory(([
+  ]));
+ }
+ 
+ void init(){
+  ::init();
+ }
+ 
+
+ + +

NPC Creation (Back to Top)

+

Now we'll create a new NPC (Mob) called "guy". The file name will also + be "guy".

+ +
+ create npc guy +
+ I'm going to go with the appropriate area directory:
+ /realms/testycre/area/npc/guy.c
+ You wave your hand mysteriously and a generic npc materializes!
+ 
+
+ +

We can look at our new room and see the NPC + standing there.

+ +
+ l +
+ /realms/testycre/area/room/test2
+ Room 2 [w]
+ This is the second test room.
+ A generic npc is standing here.
+ 
+
+ +

The first thing to do is to rename the new NPC in order to avoid + confusion. An NPC's name is what the lib refers to the NPC as.

+ +
+ modify npc name guy +
+ Indenting file...
+ "/tmp/indent.1134436801.tmp.dat" 15 lines 417 bytes
+ Exit from ed.
+ 
+
+ +

We can now set one or more NPC aliases, called "ids". Note that in the + following example, we enter three different ones, all of which point to the + same NPC. A player could look at any of these + IDs and get the NPC.

+ +
+ modify npc id +
+ This setting takes multiple values. If you have no more values to
+ enter, then enter a dot on a blank line. To cancel, enter a single q on a blank
+ line.
+ You may now enter the next value. So far, it is blank.
+ If you're done entering values, enter a dot on a blank line.
+ dude
+ You may now enter the next value. So far, we have: ({ "dude" })
+ If you're done entering values, enter a dot on a blank line.
+ fellow
+ You may now enter the next value. So far, we have: ({ "dude", "fellow"
+ })
+ If you're done entering values, enter a dot on a blank line.
+ fella
+ You may now enter the next value. So far, we have: ({ "dude", "fellow",
+ "fella"
+ })
+ If you're done entering values, enter a dot on a blank line.
+ .
+ Entries complete. Final array is: ({ "dude", "fellow", "fella" })
+ Indenting file...
+ "/tmp/indent.1134436831.tmp.dat" 19 lines 442 bytes
+ Exit from ed.
+ 
+ /realms/testycre/tmp/guy1134436805: Ok
+ /realms/testycre/area/npc/guy: Ok
+ SetId modification complete.
+ 
+
+ +

Now we'll set the NPCs short description, or name. Any condition such as + "is standing here" is appended to the end of the NPC's short description, + so don't end it with a period or any other punctuation.

+ +
+ modify guy short The Dude +
+ Indenting file...
+ "/tmp/indent.1134436855.tmp.dat" 19 lines 437 bytes
+ Exit from ed.
+ 
+
+ +

We'll set the long description. This is what is shown when someone actually + looks directly at the NPC.

+ +
+ modify guy long This is just some +
+ random guy.
+ Indenting file...
+ "/tmp/indent.1134436904.tmp.dat" 19 lines 408 bytes
+ Exit from ed.
+ 
+
+ +

Adjectives are useful for complementing NPCs and other objects. For example, + if our guy is 'oily' or 'hairy' as described in his long description, a player + would be able to do a look oily guy and + see the guy even if "oily" isn't in his actual name/id.

+ +
+ modify guy adj +
+ This setting takes multiple values. If you have no more values to
+ enter, then enter a dot on a blank line. To cancel, enter a single q on a blank
+ line.
+ You may now enter the next value. So far, it is blank.
+ If you're done entering values, enter a dot on a blank line.
+ hairy
+ You may now enter the next value. So far, we have: ({ "just some" })
+ If you're done entering values, enter a dot on a blank line.
+ stinky
+ You may now enter the next value. So far, we have: ({ "just some",
+ "random" })
+ If you're done entering values, enter a dot on a blank line.
+ oily
+ You may now enter the next value. So far, we have: ({ "just some",
+ "random",
+ "some" })
+ If you're done entering values, enter a dot on a blank line.
+ .
+ Entries complete. Final array is: ({ "just some", "random", "some" })
+ Indenting file...
+ "/tmp/indent.1134436924.tmp.dat" 19 lines 402 bytes
+ Exit from ed.
+ 
+ /realms/testycre/tmp/guy1134436912: Ok
+ /realms/testycre/area/npc/guy: Ok
+ SetAdjectives modification complete.
+ 
+
+ +

Let's look at our room and see if the Dude is appearing as expected.

+ +
+ look +
+ /realms/testycre/area/room/test2
+ Room 2 [w]
+ This is the second test room.
+ The Dude is standing here.
+ 
+
+ +

We'll check out the Dude's file and see how QCS has set up the NPC for us.

+ +
+ about dude +
+ /realms/testycre/area/npc/guy.c
+ 
+ #include <lib.h>
+ 
+ inherit LIB_SENTIENT;
+ 
+ static void create() {
+  sentient::create();
+  SetKeyName("guy");
+  SetAdjectives( ({"just some", "random", "some"}) );
+  SetId( ({"dude", "fellow", "fella"}) );
+  SetShort("The Dude");
+  SetLong("This is just some random guy.");
+  SetLevel(1);
+  SetRace("human");
+  SetClass("explorer");
+  SetGender("male");
+ }
+ 
+ void init(){
+  ::init();
+ 
+
+ + +

Weapon Creation (Back to Top)

+

Now we'll create a weapon for our NPC. "hammer" is the filename.

+ +
+ create weapon hammer +
+ I'm going to go with the appropriate area directory:
+ /realms/testycre/area/weap/hammer.c
+ You wave your hand mysteriously and a generic weapon materializes!
+ 
+
+ +

And then set the hammer's ID(s)

+ +
+ modify weapon id hammer +
+ This setting takes multiple values. If you have no more values to
+ enter, then enter a dot on a blank line. To cancel, enter a single q on a blank
+ line.
+ You may now enter the next value. So far, we have: ({ "hammer" })
+ If you're done entering values, enter a dot on a blank line.
+ warhammer
+ You may now enter the next value. So far, we have: ({ "hammer",
+ "warhammer" })
+ If you're done entering values, enter a dot on a blank line.
+ .
+ Entries complete. Final array is: ({ "hammer", "warhammer" })
+ Indenting file...
+ "/tmp/indent.1134437181.tmp.dat" 19 lines 453 bytes
+ Exit from ed.
+ 
+ /realms/testycre/tmp/hammer1134437165: Ok
+ /realms/testycre/area/weap/hammer: Ok
+ SetId modification complete.
+ 
+
+ +

And now we will set the weapon's name to "hammer".

+ +
+ modify weapon name hammer +
+ There is no weapon here.
+ look
+ /realms/testycre/area/room/test2
+ Room 2 [w]
+ This is the second test room.
+ A generic weapon is here.
+ The Dude is standing here.
+ 
+
+ +

What's happened here is that we changed the weapon's ID before the name. + Luckily, this is easy to fix.

+ +
+ modify hammer name hammer +
+ Indenting file...
+ "/tmp/indent.1134437205.tmp.dat" 22 lines 474 bytes
+ Exit from ed.
+ 
+
+ +

Now we'll look at the hammer's file to see how it looks.

+ +
+ about hammer +
+ /realms/testycre/area/weap/hammer.c
+ 
+ #include <lib.h>
+ #include <damage_types.h>
+ #include <vendor_types.h>
+ 
+ inherit LIB_ITEM;
+ 
+ static void create() {
+  item::create();
+  SetKeyName("hammer");
+  SetId( ({"hammer", "warhammer"}) );
+  SetAdjectives( ({ "generic" }));
+  SetShort("a generic weapon");
+  SetLong("A weapon of indeterminate proportions.");
+  SetMass(50);
+  SetVendorType(VT_WEAPON);
+  SetClass(30);
+  SetDamageType(BLADE);
+  SetWeaponType("blade");
+ 
+ }
+ void init(){
+  ::init();
+ }
+ 
+
+ +

We can now set the hammer's damage type to blunt for a nice crushing + effect.

+ +
+ modify hammer damagetype blunt +
+ Indenting file...
+ "/tmp/indent.1134437392.tmp.dat" 22 lines 474 bytes
+ Exit from ed.
+ 
+
+ +

And now set the weapon type.

+ +
+ modify hammer weapontype blunt +
+ Indenting file...
+ "/tmp/indent.1134437398.tmp.dat" 22 lines 474 bytes
+ Exit from ed.
+ 
+
+ +

Similarly, set the mass.

+ +
+ modify hammer mass 700 +
+ Indenting file...
+ "/tmp/indent.1134437414.tmp.dat" 22 lines 475 bytes
+ Exit from ed.
+ 
+
+ +

We will now make the weapon require two hands to use.

+ +
+ modify hammer hands 2 +
+ Indenting file...
+ "/tmp/indent.1134437422.tmp.dat" 23 lines 492 bytes
+ Exit from ed.
+ 
+
+ +

We'll double-check our hammer's file now to see if everything was set.

+ +
+ about hammer +
+ /realms/testycre/area/weap/hammer.c
+ 
+ #include <lib.h>
+ #include <damage_types.h>
+ #include <vendor_types.h>
+ 
+ inherit LIB_ITEM;
+ 
+ static void create() {
+  item::create();
+  SetKeyName("hammer");
+  SetId( ({"hammer", "warhammer"}) );
+  SetAdjectives( ({ "generic" }));
+  SetShort("a generic weapon");
+  SetLong("A weapon of indeterminate proportions.");
+  SetHands(2);
+  SetMass(700);
+  SetVendorType(VT_WEAPON);
+  SetClass(30);
+  SetDamageType(BLUNT);
+ 
+  SetWeaponType("blunt");
+ }
+ 
+ void init(){
+  ::init();
+ }
+ 
+
+ +

Now we'll set that short description.

+ +
+ modify hammer short a heavy war hammer +
+ Indenting file...
+ "/tmp/indent.1134437450.tmp.dat" 23 lines 494 bytes
+ Exit from ed.
+ 
+
+ +

And our long description...

+ +
+ modify hammer long This is an extremely large and heavy + hammer designed to be wielded in both hands and used to hurt people very badly + indeed. +
+ Indenting file...
+ "/tmp/indent.1134437509.tmp.dat" 23 lines 579 bytes
+ Exit from ed.
+ 
+
+ +

Setting some adjectives.

+ +
+ modify hammer adj +
+ This setting takes multiple values. If you have no more values to
+ enter, then enter a dot on a blank line. To cancel, enter a single q on a blank
+ line.
+ You may now enter the next value. So far, it is blank.
+ If you're done entering values, enter a dot on a blank line.
+ large
+ You may now enter the next value. So far, we have: ({ "large" })
+ If you're done entering values, enter a dot on a blank line.
+ heavy
+ You may now enter the next value. So far, we have: ({ "large", "heavy"
+ })
+ If you're done entering values, enter a dot on a blank line.
+ war
+ You may now enter the next value. So far, we have: ({ "large", "heavy",
+ "war" })
+ If you're done entering values, enter a dot on a blank line.
+ .
+ Entries complete. Final array is: ({ "large", "heavy", "war" })
+ Indenting file...
+ "/tmp/indent.1134437531.tmp.dat" 23 lines 592 bytes
+ Exit from ed.
+ 
+ /realms/testycre/tmp/hammer1134437521: Ok
+ /realms/testycre/area/weap/hammer: Ok
+ SetAdjectives modification complete.
+ 
+
+ +

And finally, look at our hammer file.

+ +
+ about hammer +
+ /realms/testycre/area/weap/hammer.c
+ 
+ #include <lib.h>
+ #include <damage_types.h>
+ #include <vendor_types.h>
+ 
+ inherit LIB_ITEM;
+ 
+ static void create() {
+  item::create();
+  SetKeyName("hammer");
+  SetAdjectives( ({"large", "heavy", "war"}) );
+  SetId( ({"hammer", "warhammer"}) );
+  SetShort("a heavy war hammer");
+  SetLong("This is an extremely large and heavy hammer designed to be wielded
+   in both hands and used to hurt people very badly indeed.");
+  SetHands(2);
+  SetMass(700);
+  SetVendorType(VT_WEAPON);
+  SetClass(30);
+  SetDamageType(BLUNT);
+ 
+  SetWeaponType("blunt");
+ }
+ 
+ void init(){
+  ::init();
+ }
+ 
+
+ +

It's a pretty heavy hammer, so let's make sure our guy can wield it.

+ +
+ modify guy level 10 +
+ Indenting file...
+ "/tmp/indent.1134437557.tmp.dat" 19 lines 403 bytes
+ Exit from ed.
+ 
+
+ +

With this simple command we add the hammer to the permanent inventory of our + guy.

+ +
+ add hammer to guy +
+ ob2: /realms/testycre/area/npc/guy.c
+ ob: /realms/testycre/area/weap/hammer.c
+ Please enter a command for the NPC to perform with this item. If you
+ have no such command to enter, enter the number of these items you want to add:
+ wield hammer
+ Indenting file...
+ "/tmp/indent.1134437569.tmp.dat" 22 lines 489 bytes
+ Exit from ed.
+ 
+ /realms/testycre/area/npc/guy: Ok
+ Guy wields a heavy war hammer.
+ SetInventory modification complete.
+ 
+
+ +

And now we take a look at our guy.

+ +
+ exa guy +
+ This is just some random guy.
+ The male human is in top condition.
+ Guy is carrying:
+ A heavy war hammer (wielded in left hand and right hand)
+ 
+
+ +

And check the guy's file.

+ +
+ about guy +
+ /realms/testycre/area/npc/guy.c
+ 
+ #include <lib.h>
+ 
+ inherit LIB_SENTIENT;
+ 
+ static void create() {
+  sentient::create();
+  SetKeyName("guy");
+  SetAdjectives( ({"just some", "random", "some"}) );
+  SetId( ({"dude", "fellow", "fella"}) );
+  SetShort("The Dude");
+  SetLong("This is just some random guy.");
+  SetInventory(([
+  "/realms/testycre/area/weap/hammer" : "wield hammer",
+  ]));
+  SetLevel(10);
+  SetRace("human");
+  SetClass("explorer");
+  SetGender("male");
+ }
+ 
+ void init(){
+  ::init();
+ }
+ 
+
+ + +

Armor Creation (Back to Top)

+

Making armor is just as easy.

+ +
+ create armor helmet +
+ I'm going to go with the appropriate area directory:
+ /realms/testycre/area/armor/helmet.c
+ You wave your hand mysteriously and generic armor materializes!
+ modify armor name helmet
+ Indenting file...
+ "/tmp/indent.1134437645.tmp.dat" 18 lines 483 bytes
+ Exit from ed.
+ 
+ modify helmet id
+ This setting takes multiple values. If you have no more values to
+ enter, then enter a dot on a blank line. To cancel, enter a single q on a blank
+ line.
+ You may now enter the next value. So far, it is blank.
+ If you're done entering values, enter a dot on a blank line.
+ helm
+ You may now enter the next value. So far, we have: ({ "helm" })
+ If you're done entering values, enter a dot on a blank line.
+ headgear
+ You may now enter the next value. So far, we have: ({ "helm",
+ "headgear" })
+ If you're done entering values, enter a dot on a blank line.
+ cover
+ You may now enter the next value. So far, we have: ({ "helm",
+ "headgear",
+ "cover" })
+ If you're done entering values, enter a dot on a blank line.
+ .
+ Entries complete. Final array is: ({ "helm", "headgear", "cover" })
+ Indenting file...
+ "/tmp/indent.1134437661.tmp.dat" 22 lines 535 bytes
+ Exit from ed.
+ 
+ /realms/testycre/tmp/helmet1134437649: Ok
+ /realms/testycre/area/armor/helmet: Ok
+ SetId modification complete.
+ modify helmet short a horned viking helmet
+ Indenting file...
+ "/tmp/indent.1134437692.tmp.dat" 22 lines 544 bytes
+ Exit from ed.
+ 
+ modify helmet long Vikings
+ didn't really wear horned helmets into combat, but this one does look
+ formidable with its large bull horns and thick iron construction. It
+ should prove very protective.
+ Indenting file...
+ "/tmp/indent.1134437772.tmp.dat" 22 lines 666 bytes
+ Exit from ed.
+ 
+ modify helmet adj + This setting takes multiple values. If you have no more values to + enter, then enter a dot on a blank line. To cancel, enter a single q on a blank + line. + You may now enter the next value. So far, it is blank. + If you're done entering values, enter a dot on a blank line. + iron + You may now enter the next value. So far, we have: ({ "iron" }) + If you're done entering values, enter a dot on a blank line. + thick + You may now enter the next value. So far, we have: ({ "iron", "thick" }) + If you're done entering values, enter a dot on a blank line. + viking + You may now enter the next value. So far, we have: ({ "iron", "thick", + "viking" + }) + If you're done entering values, enter a dot on a blank line. + horned + You may now enter the next value. So far, we have: ({ "iron", "thick", + "viking", + "horned" }) + If you're done entering values, enter a dot on a blank line. + formidable + You may now enter the next value. So far, we have: ({ "iron", "thick", + "viking", + "horned", "formidable" }) + If you're done entering values, enter a dot on a blank line. + protective + You may now enter the next value. So far, we have: ({ "iron", "thick", + "viking", + "horned", "formidable", "protective" }) + If you're done entering values, enter a dot on a blank line. + . + Entries complete. Final array is: ({ "iron", "thick", "viking", + "horned", + "formidable", "protective" }) + Indenting file... + "/tmp/indent.1134437802.tmp.dat" 22 lines 722 bytes + Exit from ed. + + /realms/testycre/tmp/helmet1134437782: Ok + /realms/testycre/area/armor/helmet: Ok + SetAdjectives modification complete. + about helmet + /realms/testycre/area/armor/helmet.c + + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("helmet"); + SetAdjectives( ({"iron", "thick", "viking", + "horned", "formidable", + "protective"}) ); + SetId( ({"helm", "headgear", "cover"}) ); + SetShort("a horned viking helmet"); + SetLong("Vikings didn't really wear horned helmets into combat, but this one + does look formidable with its large bull horns and thick iron construction. It + should prove very protective."); + SetMass(50); + SetDamagePoints(100); + SetArmorType(A_BODY_ARMOR); + SetProtection(BLUNT, 20); + SetProtection(BLADE, 20); + SetProtection(KNIFE, 20); + } + + void init(){ + ::init(); + } + modify helmet armortype helmet + Indenting file... + "/tmp/indent.1134437818.tmp.dat" 22 lines 718 bytes + Exit from ed. + + modify helmet mass 200 + Indenting file... + "/tmp/indent.1134437830.tmp.dat" 22 lines 719 bytes + Exit from ed. + + modify helmet protection + Your armor can protect against one or more of the following types of + damage: + blunt, blade, knife, water, shock, cold, heat, gas, acid, magic, poison, + disease, trauma, .. + + Please enter which ones your armor should protect from, one at a time. + When you are done, please type a dot on a blank line. + blunt + You may now enter the next value. So far, we have: ({ "blunt" }) + If you're done entering values, enter a dot on a blank line. + blade + You may now enter the next value. So far, we have: ({ "blunt", "blade" + }) + If you're done entering values, enter a dot on a blank line. + knife + You may now enter the next value. So far, we have: ({ "blunt", "blade", + "knife" + }) + If you're done entering values, enter a dot on a blank line. + trauma + You may now enter the next value. So far, we have: ({ "blunt", "blade", + "knife", + "trauma" }) + If you're done entering values, enter a dot on a blank line. + . + Protections list complete. + Please enter the protection value for: BLUNT + 15 + Please enter the protection value for: BLADE + 20 + Please enter the protection value for: KNIFE + 25 + Please enter the protection value for: TRAUMA + 10 + This is where the mapping gets sent somewhere. + ProtectionsMap is: ([ "BLADE" : 20, "BLUNT" : 15, "TRAUMA" : 10, + "KNIFE" : 25 ]) + Indenting file... + "/tmp/indent.1134437901.tmp.dat" 23 lines 750 bytes + Exit from ed. + + about helmet + /realms/testycre/area/armor/helmet.c + + #include <lib.h> + #include <armor_types.h> + #include <damage_types.h> + inherit LIB_ARMOR; + + static void create(){ + armor::create(); + SetKeyName("helmet"); + SetAdjectives( ({"iron", "thick", "viking", + "horned", "formidable", + "protective"}) ); + SetId( ({"helm", "headgear", "cover"}) ); + SetShort("a horned viking helmet"); + SetLong("Vikings didn't really wear horned helmets into combat, but this one + does look formidable with its large bull horns and thick iron construction. + It should prove very protective."); + SetMass(200); + SetDamagePoints(100); + SetArmorType(A_HELMET); + SetProtection(BLADE, 20); + SetProtection(BLUNT, 15); + SetProtection(TRAUMA, 10); + + SetProtection(KNIFE, 25); + } + + void init(){ + ::init(); + } + l + /realms/testycre/area/room/test2 + Room 2 [w] + This is the second test room. + A horned viking helmet and a heavy war hammer are here. + The Dude is standing here. + + exa dude + This is just some random guy. + The male human is in top condition. + Guy is carrying: + A heavy war hammer (wielded in left hand and right hand) + + add helmet to dude + ob2: /realms/testycre/area/npc/guy.c + ob: /realms/testycre/area/armor/helmet.c + Please enter a command for the NPC to perform with this item. If you have no + such command to enter, enter the number of these items you want to add: + wear helmet + Indenting file... + "/tmp/indent.1134437927.tmp.dat" 23 lines 544 bytes + Exit from ed. + + /realms/testycre/area/npc/guy: Ok + Guy wields a heavy war hammer. + Guy wears a horned viking helmet. + SetInventory modification complete. + exa dude + This is just some random guy. + The male human is in top condition. + Guy is carrying: + A heavy war hammer (wielded in left hand and right hand) + A horned viking helmet (worn) +
+
+ + +

Adding Room Resets (Back to Top)

+

Ok our dude is done. Let's clean up the room by updating it.

+ +
+ update +
+ Updating environment
+ /realms/testycre/area/room/test2: Ok
+ look
+ /realms/testycre/area/room/test2
+ Room 2 [w]
+ This is the second test room.
+ pwd
+ /realms/testycre:
+ cd area/npc
+ /realms/testycre/area/npc:
+ 
+
+ +

We need to have the guy present in order to add him to the room:

+ +
+ clone guy +
+ Guy wields a heavy war hammer.
+ Guy wears a horned viking helmet.
+ You clone The Dude (/realms/testycre/area/npc/guy.c).
+ add guy to room
+ ob2: /realms/testycre/area/room/test2.c
+ ob: /realms/testycre/area/npc/guy.c
+ Please enter the number of these that you want to add:
+ 1ook
+ Indenting file...
+ "/tmp/indent.1134437999.tmp.dat" 26 lines 485 bytes
+ Exit from ed.
+ 
+ /realms/testycre/area/room/test2: Ok
+ /realms/testycre/area/room/test2
+ Room 2 [w]
+ This is the second test room.
+ The Dude is standing here.
+ 
+ SetInventory modification complete.
+ update
+ Updating environment
+ /realms/testycre/area/room/test2: Ok
+ 
+
+ +

That's it. Easy, huh? Think of how much slogging through ed this would save + you when making a large area. +

+ look +
+ /realms/testycre/area/room/test2
+ Room 2 [w]
+ This is the second test room.
+ The Dude is standing here.
+ 
+ exa dude
+ This is just some random guy.
+ The male human is in top condition.
+ Guy is carrying:
+ A heavy war hammer (wielded in left hand and right hand)
+ A horned viking helmet (worn)
+ 
+ more here
+ #include <lib.h>
+ #include "/realms/testycre/customdefs.h"
+ 
+ inherit LIB_ROOM;
+ 
+ static void create() {
+  room::create();
+  SetClimate("indoors");
+  SetAmbientLight(30);
+  SetShort("Room 2");
+  SetLong("This is the second test room.");
+  SetExits(([
+  "west" : "/realms/testycre/area/room/test1",
+  ]));
+ 
+  SetItems( ([
+  "template" : "That's what this is.",
+  ]) );
+ 
+  SetInventory(([
+  "/realms/testycre/area/npc/guy" : 1,
+  ]));
+ }
+ 
+ void init(){
+  ::init();
+ }
+ 
+ quit
+ Please come back another time!
+ 
+
+ +
+

The End (Back to Top)

+

Obviously you still need to code some LPC in ed for complex stuff. But + knocking out rooms and NPC's and objects quickly helps you avoid getting bogged + down in mechanics when what you really want to do is build.

+ Return to Dead Souls Homepage + + diff -c -r --new-file ds1.1/lib/www/router.html ds2.0r27/lib/www/router.html *** ds1.1/lib/www/router.html Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/www/router.html Wed Jul 5 00:00:59 2006 *************** *** 0 **** --- 1,229 ---- + + + + Dead Souls I3 router + + + + + + +
+ +
+
+
+
+
The + Dead Souls + Intermud3 Router
+
+
+
This page is for folks + already using Dead Souls and modifying
+
+
+
their intermud configuration. If + this does not apply to you, please
+ return to the main site for general + information:
+
+
+
+ + Or the following FAQs:
+
+
The General FAQ  http://dead-souls.net/ds-faq.html
+
+
The Admin FAQ  http://dead-souls.net/ds-admin-faq.html
+
+
The Creator FAQ: http://dead-souls.net/ds-creator-faq.html
+
+
The Installation FAQ: http://dead-souls.net/ds-inst-faq.html
+

+
+ What is + the Dead Souls router? + It's an intermud protocol version 3
+ router which follows intermud standards ( http://intermud.org + ) and
+ was written by the + legendary Tim@TimMUD.
+
+
+ Is it + private?
+
+ No. Everyone is welcome.
+
+
+ What is the IP and port?  + This may occasionally change. Such changes
+ will be posted here when they happen. The current port and address is:
+
+
+
Name: *yatmim IP: 149.152.218.102 +     port: 23
+
+
+
How + do I set it up?
+
+
To + switch back and forth between the routers, use the
+ switchrouter command. For syntax and instructions,
+ type: help switchrouter
+
+
+ It doesn't + work
+
+
     There are a few possible reasons for + this, mostly
+ centered around the router being paranoid about
+ security. The router resets frequently, and on that
+ reset, your mud will be authenticated. Just be patient.
+ If it's been more than a day or so, email me at
+ <my name here>@comcast.net
+

+
+ What's the + point of a new router? Who died and made you intermud king?
+
+     On the morning of 27 March 2006, the intermud.org i3 + router stopped
+ functioning. There had been some talk on the dead_souls channel of how
+ unreliable the i3 router was, and how we should make our own,
+ etc, yakety schmakety.
+     March 27th was the last straw. For Dead Souls + developers, the
+ dead_souls intermud channel was a vital resource for development + discussion
+ and support. After being down for 24 hours, I decided it was time to
+ implement a router that the Dead Souls muds could count on.
+
+
+ Why did + you change it from port 25 to port 23?
+
+     During testing, it was discovered that some ISP's + and hosting services block
+ outbound connections to port 25, presumably for anti-spam reasons. Since
+ port 23 is very often open for outbound connections, and it is rarely
+ spam-firewalled, it seemed like a good choice. It's not like we were + doing
+ anything else with it.
+
+
+ Isn't a + low port a security risk?
+
+     It's not running the way you think.
+
+
+
Is this + router actually any more stable? What's the uptime?
+
+     It looks like there's good potential for this
+ router to be just as stable as the old *gjs, if not
+ more so. The biggest danger comes from the fact that
+ it's running on a computer on the campus of a university
+ I went to 15 years ago, so some bored network admin
+ might notice it and pull the plug. Should that ever
+ happen, the new IP will be posted here.
+
+     The most likely thing to happen is that the machine
+ it's on could lose power, despite being on UPS. If
+ this happens, channel communication will be limited
+ until someone emails me and tells me I need to
+ reload channels. On the todo list is a plan to make
+ channel data persist across server resets.
+
+     In general, however, in the past few months,
+ *gjs has failed quite a few times, while *yatmim has
+ been going strong without a single hiccup.
+
+
+ You should + integrate your router with *gjs and enable failover
+
+     I will, just as soon as you send me the network code
+ to do it. Until then, this is what you get.
+
+
+ Does it + bridge to the *gjs router?
+
+ No.
+
+
+ How does + the router work?
+
+     Tim@TimMUD wrote a swell LPC based router that is
+ basically a bunch of .h files you put into a TMI-2
+ mud. You tinker with the settings a bit, and your TMI-2
+ mud becomes an intermud router.
+     I got rather violent on his code and shoehorned it
+ into Dead Souls. It's a testament to Tim's skill that
+ my crude fumblings were able to get the thing ported
+ and working.
+
+
+ Is router + code part of Dead Souls?
+
+ With Tim's blessing I've included his I3 router
+ in the Dead Souls distribution, after removing/replacing
+ some non-Tim code. This means that any Dead Souls
+ mud can serve as a router, should it wish to
+ establish its own private intermud network. Eventually
+ these individual routers may be part of a failover
+ network, but there are no firm plans for this in place.
+
+
+ How do I + become my own I3 router?
+
+ Read the code in /secure/daemon/i3router. Understand it.
+ Then modify it to suit you. I won't be posting step-
+ by-step instructions on how to do this, because I believe
+ this is one of those things that you really need to
+ figure out on your own. If you can't figure it out
+ by reading the code, I argue you have no business
+ running the router.
+
+
+ - Cratylus
+
+
+
+
+
+
More technical docs:
+ Creator FAQ             + Debugging FAQ         + Editor Tutorial     +   +   The Quick Creation System         +

+
+
+
+
+
+
+
+
+
+ + Binary files ds1.1/lib/www/sflogo.php and ds2.0r27/lib/www/sflogo.php differ diff -c -r --new-file ds1.1/lib/www/style.css ds2.0r27/lib/www/style.css *** ds1.1/lib/www/style.css Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/www/style.css Wed Jul 5 00:00:59 2006 *************** *** 0 **** --- 1,133 ---- + div#header { + border-bottom:3px outset blue; + } + + p#headertext { + text-align:center; + font-size:x-large; + margin:0px; + padding-top:5px; + } + + p#subheadertext { + text-align:center; + margin:0px; + padding:0px; + padding-bottom:10px; + } + + div#bodytextcontainer { + margin-left:7px; + margin-right:7px; + } + + div#footer { + border-top:3px inset blue; + padding:2px; + text-align:right; + padding-top:5px; + margin-top:10px; + height:45px; + } + + div#footer img, p, a, div { + vertical-align:middle; + } + + table { + margin-left:auto; + margin-right:auto; + } + + td { + vertical-align: top; + padding:3px; + padding-left:8px; + border:1px outset navy; + padding-bottom:15px; + background: rgb(236,240,255); + color:black; + } + + h1 { + font-size:large; + } + + h2 { + padding:2px; + margin:2px; + font-size:medium; + border-bottom:1px solid gray; + } + + ul { + padding-top:0px; + padding-bottom:0px; + margin:0px; + } + + li { + padding-top:2px; + padding-bottom:2px; + } + + ul.input { + list-style-type:none; + padding-left:10px; + } + + div.inputcontainer { + border:1px solid gray; + background:rgb(236,240,255); + color:black; + font-family:monospace; + padding:5px; + } + + hr { + border: 1px dashed navy; + } + + img { + border:none; + } + + a { + color:blue; + } + + a:visited { + color:navy; + } + + a:hover { + color:red; + } + + a:active { + color:purple; + } + + p { + padding:0px; + } + + .centered { + margin-left:auto; + margin-right:auto; + } + + .centered_txt { + text-align:center; + } + + .command { + color:red; + font-weight:bold; + font-family:monospace; + } + + .backtotop { + font-size:small; + font-weight:normal; + } diff -c -r --new-file ds1.1/lib/www/verbs.html ds2.0r27/lib/www/verbs.html *** ds1.1/lib/www/verbs.html Wed Dec 31 19:00:00 1969 --- ds2.0r27/lib/www/verbs.html Wed Jul 5 00:00:59 2006 *************** *** 0 **** --- 1,126 ---- + + + + + Verb Tutorial + + + + +
The Verb

Note: This page is for advanced coders who need to
create new verbs, or modify existing ones. Newbie
coders should not assume they need to know everything
here.

The verb is like anything else. Exactly as
good as you make it, no more and no less. Deconstructing
a new verb for the first time can be confusing, but
in doing so you will gain a better understanding of
the parsing system Dead Souls uses.

Please note, if there's anything here hard to
follow or understand, you need to review the Creator's
Manual for key LPC concepts.


The verb itself

Rules and tokens

can's and do's

The objects

References


The verb itself

Let's take a look at the code for a verb, and dissect
it for meaning.
+
#include <lib.h>

inherit LIB_VERB;

static void create() {
verb::create();
SetVerb("buy");
SetSynonyms("purchase");
SetRules("STR from LIV");
SetErrorMessage("Buy what from whom?");
SetHelp("Syntax: <buy ITEM from VENDOR>\n\n"
"Blah blah this is the help message.");
}

mixed can_buy_str_from_liv(string str) {
if( this_player()->GetParalyzed() ) {
return "You cannot do anything.";
}
return this_player()->CanManipulate();
}

mixed do_buy_str_from_liv(string str, object vendor) {
return vendor->eventSell(this_player(), remove_article(lower_case(str)));
}


If you never looked at a verb before, it can
look rather alien and disgusting, like a dead facehugger.
But like the facehugger, it's actually quite beautiful
in its own way.
Let's dissect and comment it now:


#include <lib.h>
// This include statement allows us to use macros, or nicknames,
// for certain things. Specifically, the lib include gives us
// knowledge of what we mean by LIB_VERB.

inherit LIB_VERB;
// This line tells us that we will be inheriting all the
// functions and variables defined in /lib/verb.c .

static void create() {
// The create function is like main() in C/C++. A function that
// is *always* called when an object is loaded. Therefore,
// anything important goes inside here.

verb::create();
// The :: operator is called the "scope resolution operator".
// That's a fancy way of saying that we are trying to use
// a function that exists somewhere in the inheritance tree, and
// not in this individual file. The verb::create() line above
// is saying "At this point, execute any directives in the
// create() function of LIB_VERB". This is necessary because
// the create() function we define here will override the create()
// function we inherit, and that overridden function might have
// had important stuff in it we need to have happen.
// If you didn't understand any of that, you should probably
// stop reading this tutorial and get started on reading
// the Creator's manual.

SetVerb("buy");
// This identifies what word the parser should associate
// with this verb.

SetSynonyms("purchase");
// Self explanatory. This is where you specify words with a
// similar meaning that should also be associated with this verb.

SetRules("STR from LIV");
// Here's one of the new and exotic features of verbs. Rules and tokens.
// When the parser catches the "buy" word from the user's input,
// it will check to see if the rest of the words in the
// command line conform the the known set of rules for the verb.
// if they don't, the parser will error. We'll go over the rules
// a bit further on.

SetErrorMessage("Buy what from whom?");
// By default, the parser's error messages aren't terribly
// descriptive or helpful...usually it's along the lines
// of "You can't X the Y". The line above lets you provide the
// user a clue as to how to better avail themselves of the
// verb's functionality.

SetHelp("Blah blah this is the help message.");
// When the user types "help buy", this is what they get.

// The create function ends here, with the close brace
// below this line.
}


mixed can_buy_str_from_liv(string str) {
// This function does some very rudimentary checks of
// whether the user can use the verb. The can_* type
// functions will be discussed in more detail a bit
// further on.

if( this_player()->GetParalyzed() ) {
return "You cannot do anything.";
}
// Pretty self-explanatory. An obvious check.

return this_player()->CanManipulate();
// The player object has a CanManipulate() function. If
// the player has no prehensile limbs (i.e. "wielding limbs",
// like hands) then the CanManipulate() function in their
// object returns 0. Since the line above returns whatever
// CanManipulate() returns, that means that if the player
// is missing both hands, he can't sell anything. The verb
// will fail.

mixed do_buy_str_from_liv(string str, object vendor) {
// Like the can_* functions, do_ functions will get more
// treatment further on. This is generally where the actual
// "doing" of the verb gets fired off, if appropriate.

return vendor->eventSell(this_player(), remove_article(lower_case(str)));
// Did you notice that this function is declared as type "mixed"?
// This allows us to return weird stuff, like in this case where
// we're returning the result of a function call. We're not
// 100% sure what data type eventSell() in the vendor returns,
// so mixed covers all the bases. Whatever eventSell() returns,
// that's what gets returned here. If the parser got this far,
// then the verb's execution was successful.
// That doesn't necessarily mean that the player successfully
// sold anything. It may be he lacks enough quatloos for the
// shizbat. But that is no concern of the verb. That is the
// business of the eventSell() function it called on the vendor.
}


Rules and tokens

By a magic I do not fully understand myself, the
parser (which lives in the compiled driver binary, meaning
it was written in C and therefore inscrutable to me) can
actually work out from your command line what object you meant
to do what to with what.

For example, if you are in a room full of orcs,
and you type:

kill orcs

The parser actually susses out that orcs are objects
in your environment, and that you intend to act on more than
one of them. The parser will go on to check the attack verb
for its known rules. The rules for "attack" look like this:

SetRules("LVS", "only LVS","LVS only")

The parser sees that you meant two objects that
are living, and sure enough, the attack verb will accept
"multiple living things" as a rule. In this case, the
matched rule is the first one, with the token LVS.

Hold on there, you say. What if I typed kill orc ,
in the singular? This would still match the first rule,
because LVS doesn't just stand for "multiple living things".
It's rather more like "one or more living things".

If the first attack token were LIV instead, then
killing a singular orc would succeed in the parser, but
killing plural orcs would probably fail.

The second rule has two tokens. One is an object
token, LVS, where object is meant in a semi-grammatical sense.
The other is a prepositional token, which is also meant in
a semi-grammatical sense.

The way "object" and "preposition" are handled in
the parser's grammar is not the way they are handled in
English grammar. For example, you may be feeling indignant
at being told that "only" is a preposition. Obviously, in
English, it isn't. However, the parser isn't as linguistically
sophisticated as you. For the parser, anything used
periverbally that isn't an object is a preposition. Please don't
email me telling me I don't know my English grammar. When I
talk subject, object, and preposition here, I am using
the parser's simplified grammar.

As you might have guessed, an "object token" in this case
is the noun that the verb will be working with. Note that the
subject is assumed to be the caller, or player, that invoked the
verb's execution, and does not have an explicit token identified.

So, back to our second rule. "only LVS" means that
I can issue a command like this:

kill only the second orc

And the parser will not reject it. However, failing
to use the preposition token explicitly allowed in a rule
will cause the parser to error. Trying to:

kill merely the second orc

will not bring joy.

The known object tokens are:

LIV - one living thing
LVS - one or more living things
OBJ - one object
OBS - one or more objects
STR - a string of characters
WRD - a generic thing that may be a string, object, or living thing

To get a list of known preposition tokens, type:

eval return MASTER_D->parse_command_prepos_list()


can's and do's

Following the create() fun you saw two types of functions:
can_* and do_*. These are sometimes called "applies". When you see
someone referring to an apply, they mean a function called by the driver.

Notionally, the can_ applies are meant to test the
validity of the verb's execution, and the do_ applies are
meant to perform the actions required.

In practice, this is only somewhat the case. Whether
it's a bug or feature, the can_ applies tend to mangle the
arguments they receive. Pretty much no matter what the
argument is, it gets turned into a string. It's a peculiar
"gotcha" that will have you spinning your wheels for a long time
if you don't happen to know it.

That doesn't mean the can_ applies are useless. They are
in fact necessary. If the can_ apply doesn't exist, or doesn't
return a positive integer, the do_ apply won't happen, meaning your
verb won't execute. Since the can_ applies are somewhat hobbled,
use them for quick, obvious sanity checks, like "is this
player dead" or "does she have hands to manipulate anything with".

If you need to do a check, for example, to ensure that
the vendor is an elf, that means that you need to make a
call to that vendor object. Since the can_ applies won't
handle object arguments, this check will need to happen in the
do_ function.

Some examples of can_ and do_ verb applies:

can_throw_obj()

Pretty obvious. The command in question would be something
like "throw switch" perhaps.

can_throw_obj_word_obj()

A little trickier. Now we're allowing for a wildcard prepositional token. Here
the command might be "throw ball at benny", but because the token
is not explicitly listed (that would be
something like can_throw_obj_at_obj())
and the target is not explicitly a living thing, this apply
also matches "throw the sword in the lake". Note it won't match
"throw the jacks on the floor".


do_read_str_on_obj(string str, object ob)

If your verb has a can
_read_str_word_obj(string str, object ob) apply that
returned 1, then this sweet baby gets called. Presumably here you'd
have the verb call the object and tell it to do something with the
arguments provided. Here is where the actual reading action begins.


Alas, the work of parser applies is not done. The object in
question must have matching direct_ and indirect_ applies, otherwise,
error occurs. These applies are discussed in the next section.



The objects

As you can see, the thing that gives a do_ apply
its whammy is a call to an object. That's the point of a verb,
is doing something, and in the case above, its:

return vendor->eventSell(this_player(), remove_article(lower_case(str)));

However, if you make a verb like this, and then
just try to use it, it'll fail. This is because the driver
needs the objects it acts on to have applies that
correspond to the do_ applies.

The corresponding applies are direct_ and indirect_ ,
and the appropriate one must exist in the subject and
object...that is, both you and the thing you're trying to
act on.

Verb applies are usually added to the lib
objects that are appropriate. For example, let's take
the "press" verb. When you "push the button", the parser
checks with the verb daemon, VERBS_D, to find out if
"push" means anything. Sure enough, it's a synonym for
"press", so the parser checks out the rules for press.

Eventually the parser decides all the t's are
crossed and i's are dotted, and it's tim to actually
see whether the "button" you're talking about is
pressable. It does this by calling the following apply
in the button object:

direct_press_obj(<the button object is the argument here>)

If the button does not have this function,
or if the function returns 0, the parser errors, assuming
that you're trying to press something that isn't
supposed to be pressable. Therefore, if you're going to
make a button somewhere, or a wall or anything that
should do something when pushed, it will need to
have that function in it. The way it looks is something
like this:


mixed direct_press_obj(object target) {
return CanPress(this_player());
}

Now, this gets complicated, because the CanPress()
fun is a function that checks to see whether the
relationship between the button, the presser, and the lib
permits the pressing.

If you're going to have an object that is
pressed, it's going to be a right pain in the butt to
code all the necessary checks into that object. Fortunately,
you don't need to. If you make a pressable thing, you don't
need to code all that stuff yourself. Just have it
inherit LIB_PRESS, which is a file that already
contains the applies you need.


But, we're not done. You'll need to understand
a couple more things to be able to construct your new verb.

direct and indirect refer to the relationship
of two objects on a command line. If all you have is
"throw ball", there's no need to worry about object relationship.
But what if the command is "shoot nice guy eddy with pistol"?
Or, supposer the player types "shoot pistol at eddy"?

The parser needs to differentiate between the two,
but it isn't nearly sophisticated enough to understand the
concept of who is acting on whom. The parser just needs to
know which is first and which is second. therefore, in
LIB_SELL you'll see:


mixed direct_sell_obj_to_liv()

where the direct object is obj and the indirect object
is liv, and:

mixed indirect_sell_liv_obj()

where the direct object is liv and the indirect object is obj.
Again, this is not English grammar, it's parser grammar.



References

Though sparse, there are other sources of information
on verbs and the parser. Some of it is quite thorough but
incomprehensible. Some of it is crystal clear but not applicable
to the current version of MudOS and/or Dead Souls.

You're encouraged to visit the following sites
to gain more insight into the parser, but be warned that I
cannot vouch for the intelligibility or applicability of
their information.

Please let me know if you find others.


http://www.dnd.utwente.nl/~krimud/Docs/NMAdmin/Parser/


http://www.islandsofmyth.org/wiz/parser_guide.html



Within the mud, you should read and understand the
parser related man page, specifically:

man parse_command



Dead Souls Homepage

+ +