tbamud/src/act.other.c

975 lines
29 KiB
C
Raw Normal View History

/**************************************************************************
* File: act.other.c Part of tbaMUD *
* Usage: Miscellaneous player-level commands. *
2006-12-19 22:56:18 +00:00
* *
* All rights reserved. See license for complete information. *
2006-12-19 22:56:18 +00:00
* *
* Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University *
* CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. *
**************************************************************************/
2006-12-19 22:56:18 +00:00
jeremyosborne | 2008-04-04 02:36:38 +0200 (Fri, 04 Apr 2008) | 1 line Minor Bugfix: All game configuration settings now reference the world config structure, not the individual config variables found in config.c. ------------------------------------------------------------------------ rumble | 2008-03-22 13:27:00 +0100 (Sat, 22 Mar 2008) | 1 line Added lib/world/qst/ directory, index, index.mini, and 0.qst. ------------------------------------------------------------------------ jeremyosborne | 2008-03-08 03:27:51 +0100 (Sat, 08 Mar 2008) | 3 lines Bugfix: the include directory (for .h files) is now referenced correctly in the depend statement. Deletion: listrent.c removed as a separate utility. ------------------------------------------------------------------------ jeremyosborne | 2008-03-08 03:08:51 +0100 (Sat, 08 Mar 2008) | 1 line Enhancement: utils/ Makefile will now use a depends file, and looks for dependen cies in the ../ directory (shrinks the necessary information to make each utilit y). ------------------------------------------------------------------------ Rumble | 2008-03-06 23:39:35 +0100 (Thu, 06 Mar 2008) | 1 line Made TBA specific changes. do_cheat, removed help level checking, and advance to level 32. ------------------------------------------------------------------------ jeremyosborne | 2008-03-06 18:37:12 +0100 (Thu, 06 Mar 2008) | 1 line Minor Update: Changed header of Makefile.in to read 'tbaMUD' and also added in a ttribution for the changes. (Thanks seqwith.) ------------------------------------------------------------------------ jeremyosborne | 2008-03-06 18:31:07 +0100 (Thu, 06 Mar 2008) | 4 lines Changed Makefile.in to use glob expressions when building the objects. This translates into no longer a need to update Makefile.in whenever a new .c file is added to the mud code. Other Makefile.* have not yet been changed (and need review, anyway). All CXREF cruft left in Makefile.in has been removed. tbaMUD is now using Doxygen. Technically, CXREF provides a bit more auto-documentation than Doxygen does, however the tbaMUD (and legacy circle code) has never been marked-up with the special CXREF codes required to effectively use the program. Since Doxygen is easier to use, and provides almost as much functionality as CXREF, CXREF support has been dropped. ------------------------------------------------------------------------ jeremyosborne | 2008-03-06 08:31:02 +0100 (Thu, 06 Mar 2008) | 1 line Bug Fix: asciiflag_conv* functions now can handle a negative numeric value. ------------------------------------------------------------------------ jeremyosborne | 2008-03-06 08:16:06 +0100 (Thu, 06 Mar 2008) | 1 line Bug fix/enhancement: Charmed mobs (specifically charmed mobs with a ->master) will no longer attempt to wander off. ------------------------------------------------------------------------ jeremyosborne | 2008-03-06 08:13:38 +0100 (Thu, 06 Mar 2008) | 6 lines Based on the compiler warning about mag_materials being an unused function, and the clone spell being unused. Bug fix: Clone can now be cast. It is an 'ignore' target spell. Fix and Modification: Clone, being an effectively unused spell that is only used by mortal Magic Users at level 30, is now implemented as very simple example of how to use mag_materials(). The item required by mag_materials is vnum 161, which in stock tbaMUD is some sacrificial entrails. ------------------------------------------------------------------------ jeremyosborne | 2008-03-05 01:43:09 +0100 (Wed, 05 Mar 2008) | 3 lines Bug Fix for "Did you mean:" including DG commands. ------------------------------------------------------------------------ jeremyosborne | 2008-03-05 01:29:18 +0100 (Wed, 05 Mar 2008) | 3 lines Bug Fix: do_simple_move slightly rewritten to handle Leave triggers that purge a door. Documentation: do_simple_move documented. ------------------------------------------------------------------------ Laoris | 2008-03-01 08:22:12 +0100 (Sat, 01 Mar 2008) | 1 line Trial run of columnizer function on commands list to see how people like it. ------------------------------------------------------------------------ jeremyosborne | 2008-02-26 22:36:17 +0100 (Tue, 26 Feb 2008) | 1 line asciimap, an in game automap, along with a couple of minor bug fixes to do with the automap, patched in (Thanks Jamdog). ------------------------------------------------------------------------ jeremyosborne | 2008-02-22 04:08:05 +0100 (Fri, 22 Feb 2008) | 1 line Minor update: Relocate local variable declaration to the top of ACMD(do_help) ------------------------------------------------------------------------ jeremyosborne | 2008-02-22 04:04:37 +0100 (Fri, 22 Feb 2008) | 6 lines Checked in the following placeholders for do_gen_tog: #define SCMD_AUTOLOOT 24 #define SCMD_AUTOGOLD 25 #define SCMD_AUTOSPLIT 26 #define SCMD_AUTOSAC 27 #define SCMD_AUTOASSIST 28 ------------------------------------------------------------------------ jeremyosborne | 2008-02-22 03:57:06 +0100 (Fri, 22 Feb 2008) | 1 line The Autoquest patch, along with a couple of minor bug fixes, has been integrated into tbaMUD. (Thanks Jamdog, Kenneth Ray and Morgaelin.) ------------------------------------------------------------------------ jeremyosborne | 2008-02-18 21:46:45 +0100 (Mon, 18 Feb 2008) | 2 lines Minor Fix: Casted NOWHERE, NOTHING, NOBODY and NOFLAG as IDXTYPE for the signed short int index types. ------------------------------------------------------------------------ jeremyosborne | 2008-02-18 03:36:16 +0100 (Mon, 18 Feb 2008) | 7 lines Added a new atoidx() conversion function for dealing with string to IDXTYPE conversions (in utils.c, prototype exported through utils.h). Added IDXTYPE_MIN and IDXTYPE_MAX defines (in structs.h). Replaced atoi references with atoidx in do_oasis_zedit (in zedit.c). ------------------------------------------------------------------------ Rumble | 2008-02-18 01:44:13 +0100 (Mon, 18 Feb 2008) | 1 line Fixed direction mapping to give readable directions instead of sub commands. ------------------------------------------------------------------------ jeremyosborne | 2008-02-18 00:26:15 +0100 (Mon, 18 Feb 2008) | 5 lines Since general olc editing are automatically saved to disk, 'shutdown reboot' has been changed to not-autosave by default. (Small change made to do_shutdown in act.wizard.c). ------------------------------------------------------------------------ jeremyosborne | 2008-02-18 00:12:12 +0100 (Mon, 18 Feb 2008) | 3 lines Changed: struct attack_hit_type moved to fight.h attack_hit_text exported through fight.h ------------------------------------------------------------------------ jeremyosborne | 2008-02-17 22:32:51 +0100 (Sun, 17 Feb 2008) | 7 lines - do_file heads or tails files correctly and has also been enhanced to return file info (act.wizard.c) - defines made for common log files created by autorun, and those used by do_file (db.h) - utility functions added: file_head(), file_tail(), file_sizeof(), and file_numlines() (defined utils.c and exported through utils.h) ------------------------------------------------------------------------ Rumble | 2008-02-16 23:24:05 +0100 (Sat, 16 Feb 2008) | 1 line Fixed export command. (thanks Kyle) ------------------------------------------------------------------------ jeremyosborne | 2008-02-16 22:42:46 +0100 (Sat, 16 Feb 2008) | 1 line Files are now tagged as executable. Should be able to be checked out from subver sion and executed without running chmod. ------------------------------------------------------------------------ Rumble | 2008-02-15 17:03:06 +0100 (Fri, 15 Feb 2008) | 1 line Fixed strcat() writing out of bounds in cedit.c since strdup() only malloc() strlen(str)+1 bytes. (thanks Buggo) and moved attack_hit_text back. ------------------------------------------------------------------------ jeremyosborne | 2008-02-13 20:41:02 +0100 (Wed, 13 Feb 2008) | 1 line Event queue function definitions, global variables and defines doxygenated. ------------------------------------------------------------------------ Rumble | 2008-02-12 00:23:38 +0100 (Tue, 12 Feb 2008) | 1 line Updated levels command to use an arg/range and added color parsing to greetings. (thanks Jamdog) ------------------------------------------------------------------------ jeremyosborne | 2008-02-11 21:06:10 +0100 (Mon, 11 Feb 2008) | 1 line Doxygen comments completed for weather.c ------------------------------------------------------------------------ Rumble | 2008-02-11 03:52:50 +0100 (Mon, 11 Feb 2008) | 1 line Corrected several 64-bit warnings. (thanks Buggo) ------------------------------------------------------------------------ Rumble | 2008-02-10 22:56:56 +0100 (Sun, 10 Feb 2008) | 1 line Added get_flag_by_name allowing for new trigedit variable checks like %actor.pref(FLAG)% checks. (thanks Jamdog) ------------------------------------------------------------------------ jeremyosborne | 2008-02-08 21:22:26 +0100 (Fri, 08 Feb 2008) | 3 lines COMPLETE: tbaMUD code re-org of global and local scope function and variable declarations. There may be a few things that I did not catch (some non extern keyword declarations of function prototypes within other functions, for example). BUG FIX: Unused functions encrypt_hex() and decrypt_hex() removed from mail.c. ------------------------------------------------------------------------ jeremyosborne | 2008-02-05 23:31:09 +0100 (Tue, 05 Feb 2008) | 2 lines Continued clean-up of 'extern' references to functions and variables. BUG UNCOVERED: set_title() in class.c incorrectly handles the const nature of the char * returned from title_female and title_male. ------------------------------------------------------------------------ jeremyosborne | 2008-02-05 19:38:17 +0100 (Tue, 05 Feb 2008) | 3 lines More work on mud clean-up. New file: spec_procs.h Created this file to house the legacy special procedures (spec_procs.c and castle.c) and special feature assignment in general. ------------------------------------------------------------------------ jeremyosborne | 2008-02-05 00:59:44 +0100 (Tue, 05 Feb 2008) | 3 lines - Minor Bugfix: Fixed parse error in mobact.c - Minor Bugfix: act.h is now included in all of the act functions. Forgot to do that the first time :( - Additions: ban.h has been added as the external entry point into the ban.c globals and functions. Files needing ban.h have been updated. ------------------------------------------------------------------------ jeremyosborne | 2008-02-04 20:02:11 +0100 (Mon, 04 Feb 2008) | 1 line All act*.c functions, defines and globals have been prototyped/declared in act.h. The file act.h does not contain every ACMD, only those ACMDs and utility functions available within the act*.c files. ------------------------------------------------------------------------ Rumble | 2008-02-04 17:59:47 +0100 (Mon, 04 Feb 2008) | 1 line Fixed the last few flags missed for the 128 bit conversion. ------------------------------------------------------------------------ Laoris | 2008-02-04 07:27:56 +0100 (Mon, 04 Feb 2008) | 3 lines Adding a column formatter for lists. Accepts printf-like arguments. Only used by medit right now. ------------------------------------------------------------------------ jeremyosborne | 2008-02-04 07:09:19 +0100 (Mon, 04 Feb 2008) | 2 lines - Changed the 'struct queue' to 'struct dg_queue' to avoid namespace conflicts. - Ongoing cleanup to mud project. ------------------------------------------------------------------------ Rumble | 2008-02-04 00:07:09 +0100 (Mon, 04 Feb 2008) | 1 line Fixed run_autowiz which ran twice on advancement. ------------------------------------------------------------------------ jeremyosborne | 2008-02-03 03:46:22 +0100 (Sun, 03 Feb 2008) | 1 line act.h created and added. This header will be the external entry point for the functions, function subcommands and variables within the act*.c files. It is not designed to be the entry point for all ACMD functions. ------------------------------------------------------------------------ jeremyosborne | 2008-02-03 02:44:29 +0100 (Sun, 03 Feb 2008) | 1 line Merge of another part of the code cleanup, the dg script stuff. ------------------------------------------------------------------------ jeremyosborne | 2008-02-02 08:56:03 +0100 (Sat, 02 Feb 2008) | 1 line Modularizing and organizing files continues. Committing comm.c and comm.h because they are hairy, and I don't want to do them over if my hard drive crashes. ------------------------------------------------------------------------ jeremyosborne | 2008-02-02 07:05:08 +0100 (Sat, 02 Feb 2008) | 4 lines - Marking all file scope functions as 'static' - Reorganization of the global variables and functions. ------------------------------------------------------------------------ jeremyosborne | 2008-01-31 10:20:47 +0100 (Thu, 31 Jan 2008) | 1 line * Protected the conf.h.* system config files from multiple calls. ------------------------------------------------------------------------ jeremyosborne | 2008-01-31 09:56:18 +0100 (Thu, 31 Jan 2008) | 1 line * Removed extraneous references to TRUE / FALSE and YES / NO defines. ------------------------------------------------------------------------ jeremyosborne | 2008-01-31 09:46:20 +0100 (Thu, 31 Jan 2008) | 2 lines * BUGFIX: NUM_POSITIONS set to 8 (was incorrectly set to 15 before) * Migrated NUM_* settings from oasis.h to more appropriate locations near where they are defined. (For Example: NUM_POSITIONS moved to structs.h next to the POSITION_* defines.) ------------------------------------------------------------------------ jeremyosborne | 2008-01-31 03:58:28 +0100 (Thu, 31 Jan 2008) | 1 line Added Appendix A - Coder Support. Right now, it simply speaks to the fact that we have included doxygen config files, are working to document the source code, and provides a rudimentary "do this" guide to create the doxygen cross references. ------------------------------------------------------------------------ jeremyosborne | 2008-01-30 07:12:07 +0100 (Wed, 30 Jan 2008) | 2 lines - All .h files now have doxygen recognized headers, and the format is slightly altered to ease editing of headers. - Protected all .h files from multiple calls. (Standard format is #ifndef _HEADE R_H_ #define _HEADER_H_ .... #endif) ------------------------------------------------------------------------ jeremyosborne | 2008-01-29 11:18:14 +0100 (Tue, 29 Jan 2008) | 1 line constants.h, structs.h and utils.h now protected from multiple includes. This is sometimes overkill, but good practice overall. ------------------------------------------------------------------------ jeremyosborne | 2008-01-29 10:38:18 +0100 (Tue, 29 Jan 2008) | 1 line Updated documentation for constants.c and constants.h. ------------------------------------------------------------------------ jeremyosborne | 2008-01-29 10:15:25 +0100 (Tue, 29 Jan 2008) | 3 lines The standard Doxygen configuration doxyfiles (config files) for tbaMUD. One is to be used with the Graphviz DOT (dox_withGraphs), one is designed to be used if Graphviz is not available. Now just need a short document describing the usage of doxygen. ------------------------------------------------------------------------ jeremyosborne | 2008-01-29 10:11:36 +0100 (Tue, 29 Jan 2008) | 1 line Minor document correction in struct dex_app_tpe. ------------------------------------------------------------------------ jeremyosborne | 2008-01-28 20:53:51 +0100 (Mon, 28 Jan 2008) | 1 line *bugfix* do_drink command: When a container is empty, the correct, "It is empty." message is now displayed. ------------------------------------------------------------------------ jeremyosborne | 2008-01-28 07:58:15 +0100 (Mon, 28 Jan 2008) | 3 lines Merging changes to trunk for: * utils.h, utils.c and structs.h doxygen comments * adding file dox_withGraphs.doxyfile
2008-04-12 01:31:58 +00:00
/* needed by sysdep.h to allow for definition of <sys/stat.h> */
2006-12-19 22:56:18 +00:00
#define __ACT_OTHER_C__
#include "conf.h"
#include "sysdep.h"
#include "structs.h"
#include "utils.h"
#include "comm.h"
#include "interpreter.h"
#include "handler.h"
#include "db.h"
#include "spells.h"
#include "screen.h"
#include "house.h"
#include "constants.h"
#include "dg_scripts.h"
jeremyosborne | 2008-04-04 02:36:38 +0200 (Fri, 04 Apr 2008) | 1 line Minor Bugfix: All game configuration settings now reference the world config structure, not the individual config variables found in config.c. ------------------------------------------------------------------------ rumble | 2008-03-22 13:27:00 +0100 (Sat, 22 Mar 2008) | 1 line Added lib/world/qst/ directory, index, index.mini, and 0.qst. ------------------------------------------------------------------------ jeremyosborne | 2008-03-08 03:27:51 +0100 (Sat, 08 Mar 2008) | 3 lines Bugfix: the include directory (for .h files) is now referenced correctly in the depend statement. Deletion: listrent.c removed as a separate utility. ------------------------------------------------------------------------ jeremyosborne | 2008-03-08 03:08:51 +0100 (Sat, 08 Mar 2008) | 1 line Enhancement: utils/ Makefile will now use a depends file, and looks for dependen cies in the ../ directory (shrinks the necessary information to make each utilit y). ------------------------------------------------------------------------ Rumble | 2008-03-06 23:39:35 +0100 (Thu, 06 Mar 2008) | 1 line Made TBA specific changes. do_cheat, removed help level checking, and advance to level 32. ------------------------------------------------------------------------ jeremyosborne | 2008-03-06 18:37:12 +0100 (Thu, 06 Mar 2008) | 1 line Minor Update: Changed header of Makefile.in to read 'tbaMUD' and also added in a ttribution for the changes. (Thanks seqwith.) ------------------------------------------------------------------------ jeremyosborne | 2008-03-06 18:31:07 +0100 (Thu, 06 Mar 2008) | 4 lines Changed Makefile.in to use glob expressions when building the objects. This translates into no longer a need to update Makefile.in whenever a new .c file is added to the mud code. Other Makefile.* have not yet been changed (and need review, anyway). All CXREF cruft left in Makefile.in has been removed. tbaMUD is now using Doxygen. Technically, CXREF provides a bit more auto-documentation than Doxygen does, however the tbaMUD (and legacy circle code) has never been marked-up with the special CXREF codes required to effectively use the program. Since Doxygen is easier to use, and provides almost as much functionality as CXREF, CXREF support has been dropped. ------------------------------------------------------------------------ jeremyosborne | 2008-03-06 08:31:02 +0100 (Thu, 06 Mar 2008) | 1 line Bug Fix: asciiflag_conv* functions now can handle a negative numeric value. ------------------------------------------------------------------------ jeremyosborne | 2008-03-06 08:16:06 +0100 (Thu, 06 Mar 2008) | 1 line Bug fix/enhancement: Charmed mobs (specifically charmed mobs with a ->master) will no longer attempt to wander off. ------------------------------------------------------------------------ jeremyosborne | 2008-03-06 08:13:38 +0100 (Thu, 06 Mar 2008) | 6 lines Based on the compiler warning about mag_materials being an unused function, and the clone spell being unused. Bug fix: Clone can now be cast. It is an 'ignore' target spell. Fix and Modification: Clone, being an effectively unused spell that is only used by mortal Magic Users at level 30, is now implemented as very simple example of how to use mag_materials(). The item required by mag_materials is vnum 161, which in stock tbaMUD is some sacrificial entrails. ------------------------------------------------------------------------ jeremyosborne | 2008-03-05 01:43:09 +0100 (Wed, 05 Mar 2008) | 3 lines Bug Fix for "Did you mean:" including DG commands. ------------------------------------------------------------------------ jeremyosborne | 2008-03-05 01:29:18 +0100 (Wed, 05 Mar 2008) | 3 lines Bug Fix: do_simple_move slightly rewritten to handle Leave triggers that purge a door. Documentation: do_simple_move documented. ------------------------------------------------------------------------ Laoris | 2008-03-01 08:22:12 +0100 (Sat, 01 Mar 2008) | 1 line Trial run of columnizer function on commands list to see how people like it. ------------------------------------------------------------------------ jeremyosborne | 2008-02-26 22:36:17 +0100 (Tue, 26 Feb 2008) | 1 line asciimap, an in game automap, along with a couple of minor bug fixes to do with the automap, patched in (Thanks Jamdog). ------------------------------------------------------------------------ jeremyosborne | 2008-02-22 04:08:05 +0100 (Fri, 22 Feb 2008) | 1 line Minor update: Relocate local variable declaration to the top of ACMD(do_help) ------------------------------------------------------------------------ jeremyosborne | 2008-02-22 04:04:37 +0100 (Fri, 22 Feb 2008) | 6 lines Checked in the following placeholders for do_gen_tog: #define SCMD_AUTOLOOT 24 #define SCMD_AUTOGOLD 25 #define SCMD_AUTOSPLIT 26 #define SCMD_AUTOSAC 27 #define SCMD_AUTOASSIST 28 ------------------------------------------------------------------------ jeremyosborne | 2008-02-22 03:57:06 +0100 (Fri, 22 Feb 2008) | 1 line The Autoquest patch, along with a couple of minor bug fixes, has been integrated into tbaMUD. (Thanks Jamdog, Kenneth Ray and Morgaelin.) ------------------------------------------------------------------------ jeremyosborne | 2008-02-18 21:46:45 +0100 (Mon, 18 Feb 2008) | 2 lines Minor Fix: Casted NOWHERE, NOTHING, NOBODY and NOFLAG as IDXTYPE for the signed short int index types. ------------------------------------------------------------------------ jeremyosborne | 2008-02-18 03:36:16 +0100 (Mon, 18 Feb 2008) | 7 lines Added a new atoidx() conversion function for dealing with string to IDXTYPE conversions (in utils.c, prototype exported through utils.h). Added IDXTYPE_MIN and IDXTYPE_MAX defines (in structs.h). Replaced atoi references with atoidx in do_oasis_zedit (in zedit.c). ------------------------------------------------------------------------ Rumble | 2008-02-18 01:44:13 +0100 (Mon, 18 Feb 2008) | 1 line Fixed direction mapping to give readable directions instead of sub commands. ------------------------------------------------------------------------ jeremyosborne | 2008-02-18 00:26:15 +0100 (Mon, 18 Feb 2008) | 5 lines Since general olc editing are automatically saved to disk, 'shutdown reboot' has been changed to not-autosave by default. (Small change made to do_shutdown in act.wizard.c). ------------------------------------------------------------------------ jeremyosborne | 2008-02-18 00:12:12 +0100 (Mon, 18 Feb 2008) | 3 lines Changed: struct attack_hit_type moved to fight.h attack_hit_text exported through fight.h ------------------------------------------------------------------------ jeremyosborne | 2008-02-17 22:32:51 +0100 (Sun, 17 Feb 2008) | 7 lines - do_file heads or tails files correctly and has also been enhanced to return file info (act.wizard.c) - defines made for common log files created by autorun, and those used by do_file (db.h) - utility functions added: file_head(), file_tail(), file_sizeof(), and file_numlines() (defined utils.c and exported through utils.h) ------------------------------------------------------------------------ Rumble | 2008-02-16 23:24:05 +0100 (Sat, 16 Feb 2008) | 1 line Fixed export command. (thanks Kyle) ------------------------------------------------------------------------ jeremyosborne | 2008-02-16 22:42:46 +0100 (Sat, 16 Feb 2008) | 1 line Files are now tagged as executable. Should be able to be checked out from subver sion and executed without running chmod. ------------------------------------------------------------------------ Rumble | 2008-02-15 17:03:06 +0100 (Fri, 15 Feb 2008) | 1 line Fixed strcat() writing out of bounds in cedit.c since strdup() only malloc() strlen(str)+1 bytes. (thanks Buggo) and moved attack_hit_text back. ------------------------------------------------------------------------ jeremyosborne | 2008-02-13 20:41:02 +0100 (Wed, 13 Feb 2008) | 1 line Event queue function definitions, global variables and defines doxygenated. ------------------------------------------------------------------------ Rumble | 2008-02-12 00:23:38 +0100 (Tue, 12 Feb 2008) | 1 line Updated levels command to use an arg/range and added color parsing to greetings. (thanks Jamdog) ------------------------------------------------------------------------ jeremyosborne | 2008-02-11 21:06:10 +0100 (Mon, 11 Feb 2008) | 1 line Doxygen comments completed for weather.c ------------------------------------------------------------------------ Rumble | 2008-02-11 03:52:50 +0100 (Mon, 11 Feb 2008) | 1 line Corrected several 64-bit warnings. (thanks Buggo) ------------------------------------------------------------------------ Rumble | 2008-02-10 22:56:56 +0100 (Sun, 10 Feb 2008) | 1 line Added get_flag_by_name allowing for new trigedit variable checks like %actor.pref(FLAG)% checks. (thanks Jamdog) ------------------------------------------------------------------------ jeremyosborne | 2008-02-08 21:22:26 +0100 (Fri, 08 Feb 2008) | 3 lines COMPLETE: tbaMUD code re-org of global and local scope function and variable declarations. There may be a few things that I did not catch (some non extern keyword declarations of function prototypes within other functions, for example). BUG FIX: Unused functions encrypt_hex() and decrypt_hex() removed from mail.c. ------------------------------------------------------------------------ jeremyosborne | 2008-02-05 23:31:09 +0100 (Tue, 05 Feb 2008) | 2 lines Continued clean-up of 'extern' references to functions and variables. BUG UNCOVERED: set_title() in class.c incorrectly handles the const nature of the char * returned from title_female and title_male. ------------------------------------------------------------------------ jeremyosborne | 2008-02-05 19:38:17 +0100 (Tue, 05 Feb 2008) | 3 lines More work on mud clean-up. New file: spec_procs.h Created this file to house the legacy special procedures (spec_procs.c and castle.c) and special feature assignment in general. ------------------------------------------------------------------------ jeremyosborne | 2008-02-05 00:59:44 +0100 (Tue, 05 Feb 2008) | 3 lines - Minor Bugfix: Fixed parse error in mobact.c - Minor Bugfix: act.h is now included in all of the act functions. Forgot to do that the first time :( - Additions: ban.h has been added as the external entry point into the ban.c globals and functions. Files needing ban.h have been updated. ------------------------------------------------------------------------ jeremyosborne | 2008-02-04 20:02:11 +0100 (Mon, 04 Feb 2008) | 1 line All act*.c functions, defines and globals have been prototyped/declared in act.h. The file act.h does not contain every ACMD, only those ACMDs and utility functions available within the act*.c files. ------------------------------------------------------------------------ Rumble | 2008-02-04 17:59:47 +0100 (Mon, 04 Feb 2008) | 1 line Fixed the last few flags missed for the 128 bit conversion. ------------------------------------------------------------------------ Laoris | 2008-02-04 07:27:56 +0100 (Mon, 04 Feb 2008) | 3 lines Adding a column formatter for lists. Accepts printf-like arguments. Only used by medit right now. ------------------------------------------------------------------------ jeremyosborne | 2008-02-04 07:09:19 +0100 (Mon, 04 Feb 2008) | 2 lines - Changed the 'struct queue' to 'struct dg_queue' to avoid namespace conflicts. - Ongoing cleanup to mud project. ------------------------------------------------------------------------ Rumble | 2008-02-04 00:07:09 +0100 (Mon, 04 Feb 2008) | 1 line Fixed run_autowiz which ran twice on advancement. ------------------------------------------------------------------------ jeremyosborne | 2008-02-03 03:46:22 +0100 (Sun, 03 Feb 2008) | 1 line act.h created and added. This header will be the external entry point for the functions, function subcommands and variables within the act*.c files. It is not designed to be the entry point for all ACMD functions. ------------------------------------------------------------------------ jeremyosborne | 2008-02-03 02:44:29 +0100 (Sun, 03 Feb 2008) | 1 line Merge of another part of the code cleanup, the dg script stuff. ------------------------------------------------------------------------ jeremyosborne | 2008-02-02 08:56:03 +0100 (Sat, 02 Feb 2008) | 1 line Modularizing and organizing files continues. Committing comm.c and comm.h because they are hairy, and I don't want to do them over if my hard drive crashes. ------------------------------------------------------------------------ jeremyosborne | 2008-02-02 07:05:08 +0100 (Sat, 02 Feb 2008) | 4 lines - Marking all file scope functions as 'static' - Reorganization of the global variables and functions. ------------------------------------------------------------------------ jeremyosborne | 2008-01-31 10:20:47 +0100 (Thu, 31 Jan 2008) | 1 line * Protected the conf.h.* system config files from multiple calls. ------------------------------------------------------------------------ jeremyosborne | 2008-01-31 09:56:18 +0100 (Thu, 31 Jan 2008) | 1 line * Removed extraneous references to TRUE / FALSE and YES / NO defines. ------------------------------------------------------------------------ jeremyosborne | 2008-01-31 09:46:20 +0100 (Thu, 31 Jan 2008) | 2 lines * BUGFIX: NUM_POSITIONS set to 8 (was incorrectly set to 15 before) * Migrated NUM_* settings from oasis.h to more appropriate locations near where they are defined. (For Example: NUM_POSITIONS moved to structs.h next to the POSITION_* defines.) ------------------------------------------------------------------------ jeremyosborne | 2008-01-31 03:58:28 +0100 (Thu, 31 Jan 2008) | 1 line Added Appendix A - Coder Support. Right now, it simply speaks to the fact that we have included doxygen config files, are working to document the source code, and provides a rudimentary "do this" guide to create the doxygen cross references. ------------------------------------------------------------------------ jeremyosborne | 2008-01-30 07:12:07 +0100 (Wed, 30 Jan 2008) | 2 lines - All .h files now have doxygen recognized headers, and the format is slightly altered to ease editing of headers. - Protected all .h files from multiple calls. (Standard format is #ifndef _HEADE R_H_ #define _HEADER_H_ .... #endif) ------------------------------------------------------------------------ jeremyosborne | 2008-01-29 11:18:14 +0100 (Tue, 29 Jan 2008) | 1 line constants.h, structs.h and utils.h now protected from multiple includes. This is sometimes overkill, but good practice overall. ------------------------------------------------------------------------ jeremyosborne | 2008-01-29 10:38:18 +0100 (Tue, 29 Jan 2008) | 1 line Updated documentation for constants.c and constants.h. ------------------------------------------------------------------------ jeremyosborne | 2008-01-29 10:15:25 +0100 (Tue, 29 Jan 2008) | 3 lines The standard Doxygen configuration doxyfiles (config files) for tbaMUD. One is to be used with the Graphviz DOT (dox_withGraphs), one is designed to be used if Graphviz is not available. Now just need a short document describing the usage of doxygen. ------------------------------------------------------------------------ jeremyosborne | 2008-01-29 10:11:36 +0100 (Tue, 29 Jan 2008) | 1 line Minor document correction in struct dex_app_tpe. ------------------------------------------------------------------------ jeremyosborne | 2008-01-28 20:53:51 +0100 (Mon, 28 Jan 2008) | 1 line *bugfix* do_drink command: When a container is empty, the correct, "It is empty." message is now displayed. ------------------------------------------------------------------------ jeremyosborne | 2008-01-28 07:58:15 +0100 (Mon, 28 Jan 2008) | 3 lines Merging changes to trunk for: * utils.h, utils.c and structs.h doxygen comments * adding file dox_withGraphs.doxyfile
2008-04-12 01:31:58 +00:00
#include "act.h"
#include "spec_procs.h"
#include "class.h"
#include "fight.h"
#include "mail.h" /* for has_mail() */
#include "shop.h"
#include "quest.h"
/* Local defined utility functions */
/* do_group utility functions */
static int perform_group(struct char_data *ch, struct char_data *vict);
static void print_group(struct char_data *ch);
2006-12-19 22:56:18 +00:00
ACMD(do_quit)
{
if (IS_NPC(ch) || !ch->desc)
return;
if (subcmd != SCMD_QUIT && !IS_ADMIN(ch, ADMLVL_IMMORT))
2006-12-19 22:56:18 +00:00
send_to_char(ch, "You have to type quit--no less, to quit!\r\n");
else if (GET_POS(ch) == POS_FIGHTING)
send_to_char(ch, "No way! You're fighting for your life!\r\n");
else if (GET_POS(ch) < POS_STUNNED) {
send_to_char(ch, "You die before your time...\r\n");
die(ch, NULL);
} else {
act("$n has left the game.", TRUE, ch, 0, 0, TO_ROOM);
mudlog(NRM, MAX(ADMLVL_IMMORT, GET_INVIS_LEV(ch)), TRUE, "%s has quit the game.", GET_NAME(ch));
jeremyosborne | 2008-04-04 02:36:38 +0200 (Fri, 04 Apr 2008) | 1 line Minor Bugfix: All game configuration settings now reference the world config structure, not the individual config variables found in config.c. ------------------------------------------------------------------------ rumble | 2008-03-22 13:27:00 +0100 (Sat, 22 Mar 2008) | 1 line Added lib/world/qst/ directory, index, index.mini, and 0.qst. ------------------------------------------------------------------------ jeremyosborne | 2008-03-08 03:27:51 +0100 (Sat, 08 Mar 2008) | 3 lines Bugfix: the include directory (for .h files) is now referenced correctly in the depend statement. Deletion: listrent.c removed as a separate utility. ------------------------------------------------------------------------ jeremyosborne | 2008-03-08 03:08:51 +0100 (Sat, 08 Mar 2008) | 1 line Enhancement: utils/ Makefile will now use a depends file, and looks for dependen cies in the ../ directory (shrinks the necessary information to make each utilit y). ------------------------------------------------------------------------ Rumble | 2008-03-06 23:39:35 +0100 (Thu, 06 Mar 2008) | 1 line Made TBA specific changes. do_cheat, removed help level checking, and advance to level 32. ------------------------------------------------------------------------ jeremyosborne | 2008-03-06 18:37:12 +0100 (Thu, 06 Mar 2008) | 1 line Minor Update: Changed header of Makefile.in to read 'tbaMUD' and also added in a ttribution for the changes. (Thanks seqwith.) ------------------------------------------------------------------------ jeremyosborne | 2008-03-06 18:31:07 +0100 (Thu, 06 Mar 2008) | 4 lines Changed Makefile.in to use glob expressions when building the objects. This translates into no longer a need to update Makefile.in whenever a new .c file is added to the mud code. Other Makefile.* have not yet been changed (and need review, anyway). All CXREF cruft left in Makefile.in has been removed. tbaMUD is now using Doxygen. Technically, CXREF provides a bit more auto-documentation than Doxygen does, however the tbaMUD (and legacy circle code) has never been marked-up with the special CXREF codes required to effectively use the program. Since Doxygen is easier to use, and provides almost as much functionality as CXREF, CXREF support has been dropped. ------------------------------------------------------------------------ jeremyosborne | 2008-03-06 08:31:02 +0100 (Thu, 06 Mar 2008) | 1 line Bug Fix: asciiflag_conv* functions now can handle a negative numeric value. ------------------------------------------------------------------------ jeremyosborne | 2008-03-06 08:16:06 +0100 (Thu, 06 Mar 2008) | 1 line Bug fix/enhancement: Charmed mobs (specifically charmed mobs with a ->master) will no longer attempt to wander off. ------------------------------------------------------------------------ jeremyosborne | 2008-03-06 08:13:38 +0100 (Thu, 06 Mar 2008) | 6 lines Based on the compiler warning about mag_materials being an unused function, and the clone spell being unused. Bug fix: Clone can now be cast. It is an 'ignore' target spell. Fix and Modification: Clone, being an effectively unused spell that is only used by mortal Magic Users at level 30, is now implemented as very simple example of how to use mag_materials(). The item required by mag_materials is vnum 161, which in stock tbaMUD is some sacrificial entrails. ------------------------------------------------------------------------ jeremyosborne | 2008-03-05 01:43:09 +0100 (Wed, 05 Mar 2008) | 3 lines Bug Fix for "Did you mean:" including DG commands. ------------------------------------------------------------------------ jeremyosborne | 2008-03-05 01:29:18 +0100 (Wed, 05 Mar 2008) | 3 lines Bug Fix: do_simple_move slightly rewritten to handle Leave triggers that purge a door. Documentation: do_simple_move documented. ------------------------------------------------------------------------ Laoris | 2008-03-01 08:22:12 +0100 (Sat, 01 Mar 2008) | 1 line Trial run of columnizer function on commands list to see how people like it. ------------------------------------------------------------------------ jeremyosborne | 2008-02-26 22:36:17 +0100 (Tue, 26 Feb 2008) | 1 line asciimap, an in game automap, along with a couple of minor bug fixes to do with the automap, patched in (Thanks Jamdog). ------------------------------------------------------------------------ jeremyosborne | 2008-02-22 04:08:05 +0100 (Fri, 22 Feb 2008) | 1 line Minor update: Relocate local variable declaration to the top of ACMD(do_help) ------------------------------------------------------------------------ jeremyosborne | 2008-02-22 04:04:37 +0100 (Fri, 22 Feb 2008) | 6 lines Checked in the following placeholders for do_gen_tog: #define SCMD_AUTOLOOT 24 #define SCMD_AUTOGOLD 25 #define SCMD_AUTOSPLIT 26 #define SCMD_AUTOSAC 27 #define SCMD_AUTOASSIST 28 ------------------------------------------------------------------------ jeremyosborne | 2008-02-22 03:57:06 +0100 (Fri, 22 Feb 2008) | 1 line The Autoquest patch, along with a couple of minor bug fixes, has been integrated into tbaMUD. (Thanks Jamdog, Kenneth Ray and Morgaelin.) ------------------------------------------------------------------------ jeremyosborne | 2008-02-18 21:46:45 +0100 (Mon, 18 Feb 2008) | 2 lines Minor Fix: Casted NOWHERE, NOTHING, NOBODY and NOFLAG as IDXTYPE for the signed short int index types. ------------------------------------------------------------------------ jeremyosborne | 2008-02-18 03:36:16 +0100 (Mon, 18 Feb 2008) | 7 lines Added a new atoidx() conversion function for dealing with string to IDXTYPE conversions (in utils.c, prototype exported through utils.h). Added IDXTYPE_MIN and IDXTYPE_MAX defines (in structs.h). Replaced atoi references with atoidx in do_oasis_zedit (in zedit.c). ------------------------------------------------------------------------ Rumble | 2008-02-18 01:44:13 +0100 (Mon, 18 Feb 2008) | 1 line Fixed direction mapping to give readable directions instead of sub commands. ------------------------------------------------------------------------ jeremyosborne | 2008-02-18 00:26:15 +0100 (Mon, 18 Feb 2008) | 5 lines Since general olc editing are automatically saved to disk, 'shutdown reboot' has been changed to not-autosave by default. (Small change made to do_shutdown in act.wizard.c). ------------------------------------------------------------------------ jeremyosborne | 2008-02-18 00:12:12 +0100 (Mon, 18 Feb 2008) | 3 lines Changed: struct attack_hit_type moved to fight.h attack_hit_text exported through fight.h ------------------------------------------------------------------------ jeremyosborne | 2008-02-17 22:32:51 +0100 (Sun, 17 Feb 2008) | 7 lines - do_file heads or tails files correctly and has also been enhanced to return file info (act.wizard.c) - defines made for common log files created by autorun, and those used by do_file (db.h) - utility functions added: file_head(), file_tail(), file_sizeof(), and file_numlines() (defined utils.c and exported through utils.h) ------------------------------------------------------------------------ Rumble | 2008-02-16 23:24:05 +0100 (Sat, 16 Feb 2008) | 1 line Fixed export command. (thanks Kyle) ------------------------------------------------------------------------ jeremyosborne | 2008-02-16 22:42:46 +0100 (Sat, 16 Feb 2008) | 1 line Files are now tagged as executable. Should be able to be checked out from subver sion and executed without running chmod. ------------------------------------------------------------------------ Rumble | 2008-02-15 17:03:06 +0100 (Fri, 15 Feb 2008) | 1 line Fixed strcat() writing out of bounds in cedit.c since strdup() only malloc() strlen(str)+1 bytes. (thanks Buggo) and moved attack_hit_text back. ------------------------------------------------------------------------ jeremyosborne | 2008-02-13 20:41:02 +0100 (Wed, 13 Feb 2008) | 1 line Event queue function definitions, global variables and defines doxygenated. ------------------------------------------------------------------------ Rumble | 2008-02-12 00:23:38 +0100 (Tue, 12 Feb 2008) | 1 line Updated levels command to use an arg/range and added color parsing to greetings. (thanks Jamdog) ------------------------------------------------------------------------ jeremyosborne | 2008-02-11 21:06:10 +0100 (Mon, 11 Feb 2008) | 1 line Doxygen comments completed for weather.c ------------------------------------------------------------------------ Rumble | 2008-02-11 03:52:50 +0100 (Mon, 11 Feb 2008) | 1 line Corrected several 64-bit warnings. (thanks Buggo) ------------------------------------------------------------------------ Rumble | 2008-02-10 22:56:56 +0100 (Sun, 10 Feb 2008) | 1 line Added get_flag_by_name allowing for new trigedit variable checks like %actor.pref(FLAG)% checks. (thanks Jamdog) ------------------------------------------------------------------------ jeremyosborne | 2008-02-08 21:22:26 +0100 (Fri, 08 Feb 2008) | 3 lines COMPLETE: tbaMUD code re-org of global and local scope function and variable declarations. There may be a few things that I did not catch (some non extern keyword declarations of function prototypes within other functions, for example). BUG FIX: Unused functions encrypt_hex() and decrypt_hex() removed from mail.c. ------------------------------------------------------------------------ jeremyosborne | 2008-02-05 23:31:09 +0100 (Tue, 05 Feb 2008) | 2 lines Continued clean-up of 'extern' references to functions and variables. BUG UNCOVERED: set_title() in class.c incorrectly handles the const nature of the char * returned from title_female and title_male. ------------------------------------------------------------------------ jeremyosborne | 2008-02-05 19:38:17 +0100 (Tue, 05 Feb 2008) | 3 lines More work on mud clean-up. New file: spec_procs.h Created this file to house the legacy special procedures (spec_procs.c and castle.c) and special feature assignment in general. ------------------------------------------------------------------------ jeremyosborne | 2008-02-05 00:59:44 +0100 (Tue, 05 Feb 2008) | 3 lines - Minor Bugfix: Fixed parse error in mobact.c - Minor Bugfix: act.h is now included in all of the act functions. Forgot to do that the first time :( - Additions: ban.h has been added as the external entry point into the ban.c globals and functions. Files needing ban.h have been updated. ------------------------------------------------------------------------ jeremyosborne | 2008-02-04 20:02:11 +0100 (Mon, 04 Feb 2008) | 1 line All act*.c functions, defines and globals have been prototyped/declared in act.h. The file act.h does not contain every ACMD, only those ACMDs and utility functions available within the act*.c files. ------------------------------------------------------------------------ Rumble | 2008-02-04 17:59:47 +0100 (Mon, 04 Feb 2008) | 1 line Fixed the last few flags missed for the 128 bit conversion. ------------------------------------------------------------------------ Laoris | 2008-02-04 07:27:56 +0100 (Mon, 04 Feb 2008) | 3 lines Adding a column formatter for lists. Accepts printf-like arguments. Only used by medit right now. ------------------------------------------------------------------------ jeremyosborne | 2008-02-04 07:09:19 +0100 (Mon, 04 Feb 2008) | 2 lines - Changed the 'struct queue' to 'struct dg_queue' to avoid namespace conflicts. - Ongoing cleanup to mud project. ------------------------------------------------------------------------ Rumble | 2008-02-04 00:07:09 +0100 (Mon, 04 Feb 2008) | 1 line Fixed run_autowiz which ran twice on advancement. ------------------------------------------------------------------------ jeremyosborne | 2008-02-03 03:46:22 +0100 (Sun, 03 Feb 2008) | 1 line act.h created and added. This header will be the external entry point for the functions, function subcommands and variables within the act*.c files. It is not designed to be the entry point for all ACMD functions. ------------------------------------------------------------------------ jeremyosborne | 2008-02-03 02:44:29 +0100 (Sun, 03 Feb 2008) | 1 line Merge of another part of the code cleanup, the dg script stuff. ------------------------------------------------------------------------ jeremyosborne | 2008-02-02 08:56:03 +0100 (Sat, 02 Feb 2008) | 1 line Modularizing and organizing files continues. Committing comm.c and comm.h because they are hairy, and I don't want to do them over if my hard drive crashes. ------------------------------------------------------------------------ jeremyosborne | 2008-02-02 07:05:08 +0100 (Sat, 02 Feb 2008) | 4 lines - Marking all file scope functions as 'static' - Reorganization of the global variables and functions. ------------------------------------------------------------------------ jeremyosborne | 2008-01-31 10:20:47 +0100 (Thu, 31 Jan 2008) | 1 line * Protected the conf.h.* system config files from multiple calls. ------------------------------------------------------------------------ jeremyosborne | 2008-01-31 09:56:18 +0100 (Thu, 31 Jan 2008) | 1 line * Removed extraneous references to TRUE / FALSE and YES / NO defines. ------------------------------------------------------------------------ jeremyosborne | 2008-01-31 09:46:20 +0100 (Thu, 31 Jan 2008) | 2 lines * BUGFIX: NUM_POSITIONS set to 8 (was incorrectly set to 15 before) * Migrated NUM_* settings from oasis.h to more appropriate locations near where they are defined. (For Example: NUM_POSITIONS moved to structs.h next to the POSITION_* defines.) ------------------------------------------------------------------------ jeremyosborne | 2008-01-31 03:58:28 +0100 (Thu, 31 Jan 2008) | 1 line Added Appendix A - Coder Support. Right now, it simply speaks to the fact that we have included doxygen config files, are working to document the source code, and provides a rudimentary "do this" guide to create the doxygen cross references. ------------------------------------------------------------------------ jeremyosborne | 2008-01-30 07:12:07 +0100 (Wed, 30 Jan 2008) | 2 lines - All .h files now have doxygen recognized headers, and the format is slightly altered to ease editing of headers. - Protected all .h files from multiple calls. (Standard format is #ifndef _HEADE R_H_ #define _HEADER_H_ .... #endif) ------------------------------------------------------------------------ jeremyosborne | 2008-01-29 11:18:14 +0100 (Tue, 29 Jan 2008) | 1 line constants.h, structs.h and utils.h now protected from multiple includes. This is sometimes overkill, but good practice overall. ------------------------------------------------------------------------ jeremyosborne | 2008-01-29 10:38:18 +0100 (Tue, 29 Jan 2008) | 1 line Updated documentation for constants.c and constants.h. ------------------------------------------------------------------------ jeremyosborne | 2008-01-29 10:15:25 +0100 (Tue, 29 Jan 2008) | 3 lines The standard Doxygen configuration doxyfiles (config files) for tbaMUD. One is to be used with the Graphviz DOT (dox_withGraphs), one is designed to be used if Graphviz is not available. Now just need a short document describing the usage of doxygen. ------------------------------------------------------------------------ jeremyosborne | 2008-01-29 10:11:36 +0100 (Tue, 29 Jan 2008) | 1 line Minor document correction in struct dex_app_tpe. ------------------------------------------------------------------------ jeremyosborne | 2008-01-28 20:53:51 +0100 (Mon, 28 Jan 2008) | 1 line *bugfix* do_drink command: When a container is empty, the correct, "It is empty." message is now displayed. ------------------------------------------------------------------------ jeremyosborne | 2008-01-28 07:58:15 +0100 (Mon, 28 Jan 2008) | 3 lines Merging changes to trunk for: * utils.h, utils.c and structs.h doxygen comments * adding file dox_withGraphs.doxyfile
2008-04-12 01:31:58 +00:00
if (GET_QUEST_TIME(ch) != -1)
quest_timeout(ch);
2006-12-19 22:56:18 +00:00
send_to_char(ch, "Goodbye, friend.. Come back soon!\r\n");
/* We used to check here for duping attempts, but we may as well do it right
* in extract_char(), since there is no check if a player rents out and it
* can leave them in an equally screwy situation. */
2006-12-19 22:56:18 +00:00
if (CONFIG_FREE_RENT)
Crash_rentsave(ch, 0);
GET_LOADROOM(ch) = GET_ROOM_VNUM(IN_ROOM(ch));
/* Stop snooping so you can't see passwords during deletion or change. */
if (ch->desc->snoop_by) {
write_to_output(ch->desc->snoop_by, "Your victim is no longer among us.\r\n");
ch->desc->snoop_by->snooping = NULL;
ch->desc->snoop_by = NULL;
}
2006-12-19 22:56:18 +00:00
extract_char(ch); /* Char is saved before extracting. */
}
}
ACMD(do_save)
{
if (IS_NPC(ch) || !ch->desc)
return;
send_to_char(ch, "Saving %s.\r\n", GET_NAME(ch));
2006-12-19 22:56:18 +00:00
save_char(ch);
Crash_crashsave(ch);
if (ROOM_FLAGGED(IN_ROOM(ch), ROOM_HOUSE_CRASH))
House_crashsave(GET_ROOM_VNUM(IN_ROOM(ch)));
GET_LOADROOM(ch) = GET_ROOM_VNUM(IN_ROOM(ch));
}
/* Generic function for commands which are normally overridden by special
* procedures - i.e., shop commands, mail commands, etc. */
2006-12-19 22:56:18 +00:00
ACMD(do_not_here)
{
send_to_char(ch, "Sorry, but you cannot do that here!\r\n");
}
ACMD(do_sneak)
{
struct affected_type af;
byte percent;
if (IS_NPC(ch) || !GET_SKILL(ch, SKILL_SNEAK)) {
send_to_char(ch, "You have no idea how to do that.\r\n");
return;
}
send_to_char(ch, "Okay, you'll try to move silently for a while.\r\n");
if (AFF_FLAGGED(ch, AFF_SNEAK))
affect_from_char(ch, SKILL_SNEAK);
percent = rand_number(1, 101); /* 101% is a complete failure */
if (percent > GET_SKILL(ch, SKILL_SNEAK) + dex_app_skill[GET_DEX(ch)].sneak)
return;
new_affect(&af);
2006-12-19 22:56:18 +00:00
af.type = SKILL_SNEAK;
af.duration = GET_LEVEL(ch);
SET_BIT_AR(af.bitvector, AFF_SNEAK);
2006-12-19 22:56:18 +00:00
affect_to_char(ch, &af);
}
ACMD(do_hide)
{
byte percent;
if (IS_NPC(ch) || !GET_SKILL(ch, SKILL_HIDE)) {
send_to_char(ch, "You have no idea how to do that.\r\n");
return;
}
send_to_char(ch, "You attempt to hide yourself.\r\n");
if (AFF_FLAGGED(ch, AFF_HIDE))
2007-05-08 15:20:59 +00:00
REMOVE_BIT_AR(AFF_FLAGS(ch), AFF_HIDE);
2006-12-19 22:56:18 +00:00
percent = rand_number(1, 101); /* 101% is a complete failure */
if (percent > GET_SKILL(ch, SKILL_HIDE) + dex_app_skill[GET_DEX(ch)].hide)
return;
2007-05-08 15:20:59 +00:00
SET_BIT_AR(AFF_FLAGS(ch), AFF_HIDE);
2006-12-19 22:56:18 +00:00
}
ACMD(do_steal)
{
struct char_data *vict;
struct obj_data *obj;
char vict_name[MAX_INPUT_LENGTH], obj_name[MAX_INPUT_LENGTH];
int percent, gold, eq_pos, pcsteal = 0, ohoh = 0;
if (IS_NPC(ch) || !GET_SKILL(ch, SKILL_STEAL)) {
send_to_char(ch, "You have no idea how to do that.\r\n");
return;
}
if (ROOM_FLAGGED(IN_ROOM(ch), ROOM_PEACEFUL)) {
send_to_char(ch, "This room just has such a peaceful, easy feeling...\r\n");
return;
}
two_arguments(argument, obj_name, vict_name);
if (!(vict = get_char_vis(ch, vict_name, NULL, FIND_CHAR_ROOM))) {
send_to_char(ch, "Steal what from who?\r\n");
return;
} else if (vict == ch) {
send_to_char(ch, "Come on now, that's rather stupid!\r\n");
return;
}
/* 101% is a complete failure */
percent = rand_number(1, 101) - dex_app_skill[GET_DEX(ch)].p_pocket;
if (GET_POS(vict) < POS_SLEEPING)
percent = -1; /* ALWAYS SUCCESS, unless heavy object. */
if (!CONFIG_PT_ALLOWED && !IS_NPC(vict))
pcsteal = 1;
if (!AWAKE(vict)) /* Easier to steal from sleeping people. */
percent -= 50;
/* No stealing if not allowed. If it is no stealing from Imm's or Shopkeepers. */
if (IS_ADMIN(vict, ADMLVL_IMMORT) || pcsteal || GET_MOB_SPEC(vict) == shop_keeper)
2006-12-19 22:56:18 +00:00
percent = 101; /* Failure */
if (str_cmp(obj_name, "coins") && str_cmp(obj_name, "gold")) {
if (!(obj = get_obj_in_list_vis(ch, obj_name, NULL, vict->carrying))) {
for (eq_pos = 0; eq_pos < NUM_WEARS; eq_pos++)
if (GET_EQ(vict, eq_pos) &&
(isname(obj_name, GET_EQ(vict, eq_pos)->name)) &&
CAN_SEE_OBJ(ch, GET_EQ(vict, eq_pos))) {
obj = GET_EQ(vict, eq_pos);
break;
}
if (!obj) {
act("$E hasn't got that item.", FALSE, ch, 0, vict, TO_CHAR);
return;
} else { /* It is equipment */
if ((GET_POS(vict) > POS_STUNNED)) {
send_to_char(ch, "Steal the equipment now? Impossible!\r\n");
return;
} else {
if (!give_otrigger(obj, vict, ch) ||
2006-12-19 22:56:18 +00:00
!receive_mtrigger(ch, vict, obj) ) {
send_to_char(ch, "Impossible!\r\n");
return;
}
act("You unequip $p and steal it.", FALSE, ch, obj, 0, TO_CHAR);
act("$n steals $p from $N.", FALSE, ch, obj, vict, TO_NOTVICT);
obj_to_char(unequip_char(vict, eq_pos), ch);
}
}
} else { /* obj found in inventory */
percent += GET_OBJ_WEIGHT(obj); /* Make heavy harder */
if (percent > GET_SKILL(ch, SKILL_STEAL)) {
ohoh = TRUE;
send_to_char(ch, "Oops..\r\n");
act("$n tried to steal something from you!", FALSE, ch, 0, vict, TO_VICT);
act("$n tries to steal something from $N.", TRUE, ch, 0, vict, TO_NOTVICT);
} else { /* Steal the item */
if (IS_CARRYING_N(ch) + 1 < CAN_CARRY_N(ch)) {
if (!give_otrigger(obj, vict, ch) ||
2006-12-19 22:56:18 +00:00
!receive_mtrigger(ch, vict, obj) ) {
send_to_char(ch, "Impossible!\r\n");
return;
}
if (IS_CARRYING_W(ch) + GET_OBJ_WEIGHT(obj) < CAN_CARRY_W(ch)) {
obj_from_char(obj);
obj_to_char(obj, ch);
send_to_char(ch, "Got it!\r\n");
}
} else
send_to_char(ch, "You cannot carry that much.\r\n");
}
}
} else { /* Steal some coins */
if (AWAKE(vict) && (percent > GET_SKILL(ch, SKILL_STEAL))) {
ohoh = TRUE;
send_to_char(ch, "Oops..\r\n");
act("You discover that $n has $s hands in your wallet.", FALSE, ch, 0, vict, TO_VICT);
act("$n tries to steal gold from $N.", TRUE, ch, 0, vict, TO_NOTVICT);
} else {
/* Steal some gold coins */
gold = (GET_GOLD(vict) * rand_number(1, 10)) / 100;
gold = MIN(1782, gold);
if (gold > 0) {
GET_GOLD(ch) += gold;
GET_GOLD(vict) -= gold;
if (gold > 1)
send_to_char(ch, "Bingo! You got %d gold coins.\r\n", gold);
else
send_to_char(ch, "You manage to swipe a solitary gold coin.\r\n");
} else {
send_to_char(ch, "You couldn't get any gold...\r\n");
}
}
}
if (ohoh && IS_NPC(vict) && AWAKE(vict))
hit(vict, ch, TYPE_UNDEFINED);
}
ACMD(do_practice)
{
char arg[MAX_INPUT_LENGTH];
if (IS_NPC(ch))
return;
one_argument(argument, arg);
if (*arg)
send_to_char(ch, "You can only practice skills in your guild.\r\n");
else
list_skills(ch);
}
ACMD(do_visible)
{
if (IS_ADMIN(ch, ADMLVL_IMMORT)) {
2006-12-19 22:56:18 +00:00
perform_immort_vis(ch);
return;
}
if AFF_FLAGGED(ch, AFF_INVISIBLE) {
appear(ch);
send_to_char(ch, "You break the spell of invisibility.\r\n");
} else
send_to_char(ch, "You are already visible.\r\n");
}
ACMD(do_title)
{
skip_spaces(&argument);
delete_doubledollar(argument);
if (IS_NPC(ch))
send_to_char(ch, "Your title is fine... go away.\r\n");
else if (PLR_FLAGGED(ch, PLR_NOTITLE))
send_to_char(ch, "You can't title yourself -- you shouldn't have abused it!\r\n");
else if (strstr(argument, "(") || strstr(argument, ")"))
send_to_char(ch, "Titles can't contain the ( or ) characters.\r\n");
else if (strlen(argument) > MAX_TITLE_LENGTH)
send_to_char(ch, "Sorry, titles can't be longer than %d characters.\r\n", MAX_TITLE_LENGTH);
else {
set_title(ch, argument);
send_to_char(ch, "Okay, you're now %s%s%s.\r\n", GET_NAME(ch), *GET_TITLE(ch) ? " " : "", GET_TITLE(ch));
2006-12-19 22:56:18 +00:00
}
}
jeremyosborne | 2008-04-04 02:36:38 +0200 (Fri, 04 Apr 2008) | 1 line Minor Bugfix: All game configuration settings now reference the world config structure, not the individual config variables found in config.c. ------------------------------------------------------------------------ rumble | 2008-03-22 13:27:00 +0100 (Sat, 22 Mar 2008) | 1 line Added lib/world/qst/ directory, index, index.mini, and 0.qst. ------------------------------------------------------------------------ jeremyosborne | 2008-03-08 03:27:51 +0100 (Sat, 08 Mar 2008) | 3 lines Bugfix: the include directory (for .h files) is now referenced correctly in the depend statement. Deletion: listrent.c removed as a separate utility. ------------------------------------------------------------------------ jeremyosborne | 2008-03-08 03:08:51 +0100 (Sat, 08 Mar 2008) | 1 line Enhancement: utils/ Makefile will now use a depends file, and looks for dependen cies in the ../ directory (shrinks the necessary information to make each utilit y). ------------------------------------------------------------------------ Rumble | 2008-03-06 23:39:35 +0100 (Thu, 06 Mar 2008) | 1 line Made TBA specific changes. do_cheat, removed help level checking, and advance to level 32. ------------------------------------------------------------------------ jeremyosborne | 2008-03-06 18:37:12 +0100 (Thu, 06 Mar 2008) | 1 line Minor Update: Changed header of Makefile.in to read 'tbaMUD' and also added in a ttribution for the changes. (Thanks seqwith.) ------------------------------------------------------------------------ jeremyosborne | 2008-03-06 18:31:07 +0100 (Thu, 06 Mar 2008) | 4 lines Changed Makefile.in to use glob expressions when building the objects. This translates into no longer a need to update Makefile.in whenever a new .c file is added to the mud code. Other Makefile.* have not yet been changed (and need review, anyway). All CXREF cruft left in Makefile.in has been removed. tbaMUD is now using Doxygen. Technically, CXREF provides a bit more auto-documentation than Doxygen does, however the tbaMUD (and legacy circle code) has never been marked-up with the special CXREF codes required to effectively use the program. Since Doxygen is easier to use, and provides almost as much functionality as CXREF, CXREF support has been dropped. ------------------------------------------------------------------------ jeremyosborne | 2008-03-06 08:31:02 +0100 (Thu, 06 Mar 2008) | 1 line Bug Fix: asciiflag_conv* functions now can handle a negative numeric value. ------------------------------------------------------------------------ jeremyosborne | 2008-03-06 08:16:06 +0100 (Thu, 06 Mar 2008) | 1 line Bug fix/enhancement: Charmed mobs (specifically charmed mobs with a ->master) will no longer attempt to wander off. ------------------------------------------------------------------------ jeremyosborne | 2008-03-06 08:13:38 +0100 (Thu, 06 Mar 2008) | 6 lines Based on the compiler warning about mag_materials being an unused function, and the clone spell being unused. Bug fix: Clone can now be cast. It is an 'ignore' target spell. Fix and Modification: Clone, being an effectively unused spell that is only used by mortal Magic Users at level 30, is now implemented as very simple example of how to use mag_materials(). The item required by mag_materials is vnum 161, which in stock tbaMUD is some sacrificial entrails. ------------------------------------------------------------------------ jeremyosborne | 2008-03-05 01:43:09 +0100 (Wed, 05 Mar 2008) | 3 lines Bug Fix for "Did you mean:" including DG commands. ------------------------------------------------------------------------ jeremyosborne | 2008-03-05 01:29:18 +0100 (Wed, 05 Mar 2008) | 3 lines Bug Fix: do_simple_move slightly rewritten to handle Leave triggers that purge a door. Documentation: do_simple_move documented. ------------------------------------------------------------------------ Laoris | 2008-03-01 08:22:12 +0100 (Sat, 01 Mar 2008) | 1 line Trial run of columnizer function on commands list to see how people like it. ------------------------------------------------------------------------ jeremyosborne | 2008-02-26 22:36:17 +0100 (Tue, 26 Feb 2008) | 1 line asciimap, an in game automap, along with a couple of minor bug fixes to do with the automap, patched in (Thanks Jamdog). ------------------------------------------------------------------------ jeremyosborne | 2008-02-22 04:08:05 +0100 (Fri, 22 Feb 2008) | 1 line Minor update: Relocate local variable declaration to the top of ACMD(do_help) ------------------------------------------------------------------------ jeremyosborne | 2008-02-22 04:04:37 +0100 (Fri, 22 Feb 2008) | 6 lines Checked in the following placeholders for do_gen_tog: #define SCMD_AUTOLOOT 24 #define SCMD_AUTOGOLD 25 #define SCMD_AUTOSPLIT 26 #define SCMD_AUTOSAC 27 #define SCMD_AUTOASSIST 28 ------------------------------------------------------------------------ jeremyosborne | 2008-02-22 03:57:06 +0100 (Fri, 22 Feb 2008) | 1 line The Autoquest patch, along with a couple of minor bug fixes, has been integrated into tbaMUD. (Thanks Jamdog, Kenneth Ray and Morgaelin.) ------------------------------------------------------------------------ jeremyosborne | 2008-02-18 21:46:45 +0100 (Mon, 18 Feb 2008) | 2 lines Minor Fix: Casted NOWHERE, NOTHING, NOBODY and NOFLAG as IDXTYPE for the signed short int index types. ------------------------------------------------------------------------ jeremyosborne | 2008-02-18 03:36:16 +0100 (Mon, 18 Feb 2008) | 7 lines Added a new atoidx() conversion function for dealing with string to IDXTYPE conversions (in utils.c, prototype exported through utils.h). Added IDXTYPE_MIN and IDXTYPE_MAX defines (in structs.h). Replaced atoi references with atoidx in do_oasis_zedit (in zedit.c). ------------------------------------------------------------------------ Rumble | 2008-02-18 01:44:13 +0100 (Mon, 18 Feb 2008) | 1 line Fixed direction mapping to give readable directions instead of sub commands. ------------------------------------------------------------------------ jeremyosborne | 2008-02-18 00:26:15 +0100 (Mon, 18 Feb 2008) | 5 lines Since general olc editing are automatically saved to disk, 'shutdown reboot' has been changed to not-autosave by default. (Small change made to do_shutdown in act.wizard.c). ------------------------------------------------------------------------ jeremyosborne | 2008-02-18 00:12:12 +0100 (Mon, 18 Feb 2008) | 3 lines Changed: struct attack_hit_type moved to fight.h attack_hit_text exported through fight.h ------------------------------------------------------------------------ jeremyosborne | 2008-02-17 22:32:51 +0100 (Sun, 17 Feb 2008) | 7 lines - do_file heads or tails files correctly and has also been enhanced to return file info (act.wizard.c) - defines made for common log files created by autorun, and those used by do_file (db.h) - utility functions added: file_head(), file_tail(), file_sizeof(), and file_numlines() (defined utils.c and exported through utils.h) ------------------------------------------------------------------------ Rumble | 2008-02-16 23:24:05 +0100 (Sat, 16 Feb 2008) | 1 line Fixed export command. (thanks Kyle) ------------------------------------------------------------------------ jeremyosborne | 2008-02-16 22:42:46 +0100 (Sat, 16 Feb 2008) | 1 line Files are now tagged as executable. Should be able to be checked out from subver sion and executed without running chmod. ------------------------------------------------------------------------ Rumble | 2008-02-15 17:03:06 +0100 (Fri, 15 Feb 2008) | 1 line Fixed strcat() writing out of bounds in cedit.c since strdup() only malloc() strlen(str)+1 bytes. (thanks Buggo) and moved attack_hit_text back. ------------------------------------------------------------------------ jeremyosborne | 2008-02-13 20:41:02 +0100 (Wed, 13 Feb 2008) | 1 line Event queue function definitions, global variables and defines doxygenated. ------------------------------------------------------------------------ Rumble | 2008-02-12 00:23:38 +0100 (Tue, 12 Feb 2008) | 1 line Updated levels command to use an arg/range and added color parsing to greetings. (thanks Jamdog) ------------------------------------------------------------------------ jeremyosborne | 2008-02-11 21:06:10 +0100 (Mon, 11 Feb 2008) | 1 line Doxygen comments completed for weather.c ------------------------------------------------------------------------ Rumble | 2008-02-11 03:52:50 +0100 (Mon, 11 Feb 2008) | 1 line Corrected several 64-bit warnings. (thanks Buggo) ------------------------------------------------------------------------ Rumble | 2008-02-10 22:56:56 +0100 (Sun, 10 Feb 2008) | 1 line Added get_flag_by_name allowing for new trigedit variable checks like %actor.pref(FLAG)% checks. (thanks Jamdog) ------------------------------------------------------------------------ jeremyosborne | 2008-02-08 21:22:26 +0100 (Fri, 08 Feb 2008) | 3 lines COMPLETE: tbaMUD code re-org of global and local scope function and variable declarations. There may be a few things that I did not catch (some non extern keyword declarations of function prototypes within other functions, for example). BUG FIX: Unused functions encrypt_hex() and decrypt_hex() removed from mail.c. ------------------------------------------------------------------------ jeremyosborne | 2008-02-05 23:31:09 +0100 (Tue, 05 Feb 2008) | 2 lines Continued clean-up of 'extern' references to functions and variables. BUG UNCOVERED: set_title() in class.c incorrectly handles the const nature of the char * returned from title_female and title_male. ------------------------------------------------------------------------ jeremyosborne | 2008-02-05 19:38:17 +0100 (Tue, 05 Feb 2008) | 3 lines More work on mud clean-up. New file: spec_procs.h Created this file to house the legacy special procedures (spec_procs.c and castle.c) and special feature assignment in general. ------------------------------------------------------------------------ jeremyosborne | 2008-02-05 00:59:44 +0100 (Tue, 05 Feb 2008) | 3 lines - Minor Bugfix: Fixed parse error in mobact.c - Minor Bugfix: act.h is now included in all of the act functions. Forgot to do that the first time :( - Additions: ban.h has been added as the external entry point into the ban.c globals and functions. Files needing ban.h have been updated. ------------------------------------------------------------------------ jeremyosborne | 2008-02-04 20:02:11 +0100 (Mon, 04 Feb 2008) | 1 line All act*.c functions, defines and globals have been prototyped/declared in act.h. The file act.h does not contain every ACMD, only those ACMDs and utility functions available within the act*.c files. ------------------------------------------------------------------------ Rumble | 2008-02-04 17:59:47 +0100 (Mon, 04 Feb 2008) | 1 line Fixed the last few flags missed for the 128 bit conversion. ------------------------------------------------------------------------ Laoris | 2008-02-04 07:27:56 +0100 (Mon, 04 Feb 2008) | 3 lines Adding a column formatter for lists. Accepts printf-like arguments. Only used by medit right now. ------------------------------------------------------------------------ jeremyosborne | 2008-02-04 07:09:19 +0100 (Mon, 04 Feb 2008) | 2 lines - Changed the 'struct queue' to 'struct dg_queue' to avoid namespace conflicts. - Ongoing cleanup to mud project. ------------------------------------------------------------------------ Rumble | 2008-02-04 00:07:09 +0100 (Mon, 04 Feb 2008) | 1 line Fixed run_autowiz which ran twice on advancement. ------------------------------------------------------------------------ jeremyosborne | 2008-02-03 03:46:22 +0100 (Sun, 03 Feb 2008) | 1 line act.h created and added. This header will be the external entry point for the functions, function subcommands and variables within the act*.c files. It is not designed to be the entry point for all ACMD functions. ------------------------------------------------------------------------ jeremyosborne | 2008-02-03 02:44:29 +0100 (Sun, 03 Feb 2008) | 1 line Merge of another part of the code cleanup, the dg script stuff. ------------------------------------------------------------------------ jeremyosborne | 2008-02-02 08:56:03 +0100 (Sat, 02 Feb 2008) | 1 line Modularizing and organizing files continues. Committing comm.c and comm.h because they are hairy, and I don't want to do them over if my hard drive crashes. ------------------------------------------------------------------------ jeremyosborne | 2008-02-02 07:05:08 +0100 (Sat, 02 Feb 2008) | 4 lines - Marking all file scope functions as 'static' - Reorganization of the global variables and functions. ------------------------------------------------------------------------ jeremyosborne | 2008-01-31 10:20:47 +0100 (Thu, 31 Jan 2008) | 1 line * Protected the conf.h.* system config files from multiple calls. ------------------------------------------------------------------------ jeremyosborne | 2008-01-31 09:56:18 +0100 (Thu, 31 Jan 2008) | 1 line * Removed extraneous references to TRUE / FALSE and YES / NO defines. ------------------------------------------------------------------------ jeremyosborne | 2008-01-31 09:46:20 +0100 (Thu, 31 Jan 2008) | 2 lines * BUGFIX: NUM_POSITIONS set to 8 (was incorrectly set to 15 before) * Migrated NUM_* settings from oasis.h to more appropriate locations near where they are defined. (For Example: NUM_POSITIONS moved to structs.h next to the POSITION_* defines.) ------------------------------------------------------------------------ jeremyosborne | 2008-01-31 03:58:28 +0100 (Thu, 31 Jan 2008) | 1 line Added Appendix A - Coder Support. Right now, it simply speaks to the fact that we have included doxygen config files, are working to document the source code, and provides a rudimentary "do this" guide to create the doxygen cross references. ------------------------------------------------------------------------ jeremyosborne | 2008-01-30 07:12:07 +0100 (Wed, 30 Jan 2008) | 2 lines - All .h files now have doxygen recognized headers, and the format is slightly altered to ease editing of headers. - Protected all .h files from multiple calls. (Standard format is #ifndef _HEADE R_H_ #define _HEADER_H_ .... #endif) ------------------------------------------------------------------------ jeremyosborne | 2008-01-29 11:18:14 +0100 (Tue, 29 Jan 2008) | 1 line constants.h, structs.h and utils.h now protected from multiple includes. This is sometimes overkill, but good practice overall. ------------------------------------------------------------------------ jeremyosborne | 2008-01-29 10:38:18 +0100 (Tue, 29 Jan 2008) | 1 line Updated documentation for constants.c and constants.h. ------------------------------------------------------------------------ jeremyosborne | 2008-01-29 10:15:25 +0100 (Tue, 29 Jan 2008) | 3 lines The standard Doxygen configuration doxyfiles (config files) for tbaMUD. One is to be used with the Graphviz DOT (dox_withGraphs), one is designed to be used if Graphviz is not available. Now just need a short document describing the usage of doxygen. ------------------------------------------------------------------------ jeremyosborne | 2008-01-29 10:11:36 +0100 (Tue, 29 Jan 2008) | 1 line Minor document correction in struct dex_app_tpe. ------------------------------------------------------------------------ jeremyosborne | 2008-01-28 20:53:51 +0100 (Mon, 28 Jan 2008) | 1 line *bugfix* do_drink command: When a container is empty, the correct, "It is empty." message is now displayed. ------------------------------------------------------------------------ jeremyosborne | 2008-01-28 07:58:15 +0100 (Mon, 28 Jan 2008) | 3 lines Merging changes to trunk for: * utils.h, utils.c and structs.h doxygen comments * adding file dox_withGraphs.doxyfile
2008-04-12 01:31:58 +00:00
static int perform_group(struct char_data *ch, struct char_data *vict)
2006-12-19 22:56:18 +00:00
{
if (AFF_FLAGGED(vict, AFF_GROUP) || !CAN_SEE(ch, vict))
return (0);
2007-05-08 15:20:59 +00:00
SET_BIT_AR(AFF_FLAGS(vict), AFF_GROUP);
2006-12-19 22:56:18 +00:00
if (ch != vict)
act("$N is now a member of your group.", FALSE, ch, 0, vict, TO_CHAR);
act("You are now a member of $n's group.", FALSE, ch, 0, vict, TO_VICT);
act("$N is now a member of $n's group.", FALSE, ch, 0, vict, TO_NOTVICT);
return (1);
}
jeremyosborne | 2008-04-04 02:36:38 +0200 (Fri, 04 Apr 2008) | 1 line Minor Bugfix: All game configuration settings now reference the world config structure, not the individual config variables found in config.c. ------------------------------------------------------------------------ rumble | 2008-03-22 13:27:00 +0100 (Sat, 22 Mar 2008) | 1 line Added lib/world/qst/ directory, index, index.mini, and 0.qst. ------------------------------------------------------------------------ jeremyosborne | 2008-03-08 03:27:51 +0100 (Sat, 08 Mar 2008) | 3 lines Bugfix: the include directory (for .h files) is now referenced correctly in the depend statement. Deletion: listrent.c removed as a separate utility. ------------------------------------------------------------------------ jeremyosborne | 2008-03-08 03:08:51 +0100 (Sat, 08 Mar 2008) | 1 line Enhancement: utils/ Makefile will now use a depends file, and looks for dependen cies in the ../ directory (shrinks the necessary information to make each utilit y). ------------------------------------------------------------------------ Rumble | 2008-03-06 23:39:35 +0100 (Thu, 06 Mar 2008) | 1 line Made TBA specific changes. do_cheat, removed help level checking, and advance to level 32. ------------------------------------------------------------------------ jeremyosborne | 2008-03-06 18:37:12 +0100 (Thu, 06 Mar 2008) | 1 line Minor Update: Changed header of Makefile.in to read 'tbaMUD' and also added in a ttribution for the changes. (Thanks seqwith.) ------------------------------------------------------------------------ jeremyosborne | 2008-03-06 18:31:07 +0100 (Thu, 06 Mar 2008) | 4 lines Changed Makefile.in to use glob expressions when building the objects. This translates into no longer a need to update Makefile.in whenever a new .c file is added to the mud code. Other Makefile.* have not yet been changed (and need review, anyway). All CXREF cruft left in Makefile.in has been removed. tbaMUD is now using Doxygen. Technically, CXREF provides a bit more auto-documentation than Doxygen does, however the tbaMUD (and legacy circle code) has never been marked-up with the special CXREF codes required to effectively use the program. Since Doxygen is easier to use, and provides almost as much functionality as CXREF, CXREF support has been dropped. ------------------------------------------------------------------------ jeremyosborne | 2008-03-06 08:31:02 +0100 (Thu, 06 Mar 2008) | 1 line Bug Fix: asciiflag_conv* functions now can handle a negative numeric value. ------------------------------------------------------------------------ jeremyosborne | 2008-03-06 08:16:06 +0100 (Thu, 06 Mar 2008) | 1 line Bug fix/enhancement: Charmed mobs (specifically charmed mobs with a ->master) will no longer attempt to wander off. ------------------------------------------------------------------------ jeremyosborne | 2008-03-06 08:13:38 +0100 (Thu, 06 Mar 2008) | 6 lines Based on the compiler warning about mag_materials being an unused function, and the clone spell being unused. Bug fix: Clone can now be cast. It is an 'ignore' target spell. Fix and Modification: Clone, being an effectively unused spell that is only used by mortal Magic Users at level 30, is now implemented as very simple example of how to use mag_materials(). The item required by mag_materials is vnum 161, which in stock tbaMUD is some sacrificial entrails. ------------------------------------------------------------------------ jeremyosborne | 2008-03-05 01:43:09 +0100 (Wed, 05 Mar 2008) | 3 lines Bug Fix for "Did you mean:" including DG commands. ------------------------------------------------------------------------ jeremyosborne | 2008-03-05 01:29:18 +0100 (Wed, 05 Mar 2008) | 3 lines Bug Fix: do_simple_move slightly rewritten to handle Leave triggers that purge a door. Documentation: do_simple_move documented. ------------------------------------------------------------------------ Laoris | 2008-03-01 08:22:12 +0100 (Sat, 01 Mar 2008) | 1 line Trial run of columnizer function on commands list to see how people like it. ------------------------------------------------------------------------ jeremyosborne | 2008-02-26 22:36:17 +0100 (Tue, 26 Feb 2008) | 1 line asciimap, an in game automap, along with a couple of minor bug fixes to do with the automap, patched in (Thanks Jamdog). ------------------------------------------------------------------------ jeremyosborne | 2008-02-22 04:08:05 +0100 (Fri, 22 Feb 2008) | 1 line Minor update: Relocate local variable declaration to the top of ACMD(do_help) ------------------------------------------------------------------------ jeremyosborne | 2008-02-22 04:04:37 +0100 (Fri, 22 Feb 2008) | 6 lines Checked in the following placeholders for do_gen_tog: #define SCMD_AUTOLOOT 24 #define SCMD_AUTOGOLD 25 #define SCMD_AUTOSPLIT 26 #define SCMD_AUTOSAC 27 #define SCMD_AUTOASSIST 28 ------------------------------------------------------------------------ jeremyosborne | 2008-02-22 03:57:06 +0100 (Fri, 22 Feb 2008) | 1 line The Autoquest patch, along with a couple of minor bug fixes, has been integrated into tbaMUD. (Thanks Jamdog, Kenneth Ray and Morgaelin.) ------------------------------------------------------------------------ jeremyosborne | 2008-02-18 21:46:45 +0100 (Mon, 18 Feb 2008) | 2 lines Minor Fix: Casted NOWHERE, NOTHING, NOBODY and NOFLAG as IDXTYPE for the signed short int index types. ------------------------------------------------------------------------ jeremyosborne | 2008-02-18 03:36:16 +0100 (Mon, 18 Feb 2008) | 7 lines Added a new atoidx() conversion function for dealing with string to IDXTYPE conversions (in utils.c, prototype exported through utils.h). Added IDXTYPE_MIN and IDXTYPE_MAX defines (in structs.h). Replaced atoi references with atoidx in do_oasis_zedit (in zedit.c). ------------------------------------------------------------------------ Rumble | 2008-02-18 01:44:13 +0100 (Mon, 18 Feb 2008) | 1 line Fixed direction mapping to give readable directions instead of sub commands. ------------------------------------------------------------------------ jeremyosborne | 2008-02-18 00:26:15 +0100 (Mon, 18 Feb 2008) | 5 lines Since general olc editing are automatically saved to disk, 'shutdown reboot' has been changed to not-autosave by default. (Small change made to do_shutdown in act.wizard.c). ------------------------------------------------------------------------ jeremyosborne | 2008-02-18 00:12:12 +0100 (Mon, 18 Feb 2008) | 3 lines Changed: struct attack_hit_type moved to fight.h attack_hit_text exported through fight.h ------------------------------------------------------------------------ jeremyosborne | 2008-02-17 22:32:51 +0100 (Sun, 17 Feb 2008) | 7 lines - do_file heads or tails files correctly and has also been enhanced to return file info (act.wizard.c) - defines made for common log files created by autorun, and those used by do_file (db.h) - utility functions added: file_head(), file_tail(), file_sizeof(), and file_numlines() (defined utils.c and exported through utils.h) ------------------------------------------------------------------------ Rumble | 2008-02-16 23:24:05 +0100 (Sat, 16 Feb 2008) | 1 line Fixed export command. (thanks Kyle) ------------------------------------------------------------------------ jeremyosborne | 2008-02-16 22:42:46 +0100 (Sat, 16 Feb 2008) | 1 line Files are now tagged as executable. Should be able to be checked out from subver sion and executed without running chmod. ------------------------------------------------------------------------ Rumble | 2008-02-15 17:03:06 +0100 (Fri, 15 Feb 2008) | 1 line Fixed strcat() writing out of bounds in cedit.c since strdup() only malloc() strlen(str)+1 bytes. (thanks Buggo) and moved attack_hit_text back. ------------------------------------------------------------------------ jeremyosborne | 2008-02-13 20:41:02 +0100 (Wed, 13 Feb 2008) | 1 line Event queue function definitions, global variables and defines doxygenated. ------------------------------------------------------------------------ Rumble | 2008-02-12 00:23:38 +0100 (Tue, 12 Feb 2008) | 1 line Updated levels command to use an arg/range and added color parsing to greetings. (thanks Jamdog) ------------------------------------------------------------------------ jeremyosborne | 2008-02-11 21:06:10 +0100 (Mon, 11 Feb 2008) | 1 line Doxygen comments completed for weather.c ------------------------------------------------------------------------ Rumble | 2008-02-11 03:52:50 +0100 (Mon, 11 Feb 2008) | 1 line Corrected several 64-bit warnings. (thanks Buggo) ------------------------------------------------------------------------ Rumble | 2008-02-10 22:56:56 +0100 (Sun, 10 Feb 2008) | 1 line Added get_flag_by_name allowing for new trigedit variable checks like %actor.pref(FLAG)% checks. (thanks Jamdog) ------------------------------------------------------------------------ jeremyosborne | 2008-02-08 21:22:26 +0100 (Fri, 08 Feb 2008) | 3 lines COMPLETE: tbaMUD code re-org of global and local scope function and variable declarations. There may be a few things that I did not catch (some non extern keyword declarations of function prototypes within other functions, for example). BUG FIX: Unused functions encrypt_hex() and decrypt_hex() removed from mail.c. ------------------------------------------------------------------------ jeremyosborne | 2008-02-05 23:31:09 +0100 (Tue, 05 Feb 2008) | 2 lines Continued clean-up of 'extern' references to functions and variables. BUG UNCOVERED: set_title() in class.c incorrectly handles the const nature of the char * returned from title_female and title_male. ------------------------------------------------------------------------ jeremyosborne | 2008-02-05 19:38:17 +0100 (Tue, 05 Feb 2008) | 3 lines More work on mud clean-up. New file: spec_procs.h Created this file to house the legacy special procedures (spec_procs.c and castle.c) and special feature assignment in general. ------------------------------------------------------------------------ jeremyosborne | 2008-02-05 00:59:44 +0100 (Tue, 05 Feb 2008) | 3 lines - Minor Bugfix: Fixed parse error in mobact.c - Minor Bugfix: act.h is now included in all of the act functions. Forgot to do that the first time :( - Additions: ban.h has been added as the external entry point into the ban.c globals and functions. Files needing ban.h have been updated. ------------------------------------------------------------------------ jeremyosborne | 2008-02-04 20:02:11 +0100 (Mon, 04 Feb 2008) | 1 line All act*.c functions, defines and globals have been prototyped/declared in act.h. The file act.h does not contain every ACMD, only those ACMDs and utility functions available within the act*.c files. ------------------------------------------------------------------------ Rumble | 2008-02-04 17:59:47 +0100 (Mon, 04 Feb 2008) | 1 line Fixed the last few flags missed for the 128 bit conversion. ------------------------------------------------------------------------ Laoris | 2008-02-04 07:27:56 +0100 (Mon, 04 Feb 2008) | 3 lines Adding a column formatter for lists. Accepts printf-like arguments. Only used by medit right now. ------------------------------------------------------------------------ jeremyosborne | 2008-02-04 07:09:19 +0100 (Mon, 04 Feb 2008) | 2 lines - Changed the 'struct queue' to 'struct dg_queue' to avoid namespace conflicts. - Ongoing cleanup to mud project. ------------------------------------------------------------------------ Rumble | 2008-02-04 00:07:09 +0100 (Mon, 04 Feb 2008) | 1 line Fixed run_autowiz which ran twice on advancement. ------------------------------------------------------------------------ jeremyosborne | 2008-02-03 03:46:22 +0100 (Sun, 03 Feb 2008) | 1 line act.h created and added. This header will be the external entry point for the functions, function subcommands and variables within the act*.c files. It is not designed to be the entry point for all ACMD functions. ------------------------------------------------------------------------ jeremyosborne | 2008-02-03 02:44:29 +0100 (Sun, 03 Feb 2008) | 1 line Merge of another part of the code cleanup, the dg script stuff. ------------------------------------------------------------------------ jeremyosborne | 2008-02-02 08:56:03 +0100 (Sat, 02 Feb 2008) | 1 line Modularizing and organizing files continues. Committing comm.c and comm.h because they are hairy, and I don't want to do them over if my hard drive crashes. ------------------------------------------------------------------------ jeremyosborne | 2008-02-02 07:05:08 +0100 (Sat, 02 Feb 2008) | 4 lines - Marking all file scope functions as 'static' - Reorganization of the global variables and functions. ------------------------------------------------------------------------ jeremyosborne | 2008-01-31 10:20:47 +0100 (Thu, 31 Jan 2008) | 1 line * Protected the conf.h.* system config files from multiple calls. ------------------------------------------------------------------------ jeremyosborne | 2008-01-31 09:56:18 +0100 (Thu, 31 Jan 2008) | 1 line * Removed extraneous references to TRUE / FALSE and YES / NO defines. ------------------------------------------------------------------------ jeremyosborne | 2008-01-31 09:46:20 +0100 (Thu, 31 Jan 2008) | 2 lines * BUGFIX: NUM_POSITIONS set to 8 (was incorrectly set to 15 before) * Migrated NUM_* settings from oasis.h to more appropriate locations near where they are defined. (For Example: NUM_POSITIONS moved to structs.h next to the POSITION_* defines.) ------------------------------------------------------------------------ jeremyosborne | 2008-01-31 03:58:28 +0100 (Thu, 31 Jan 2008) | 1 line Added Appendix A - Coder Support. Right now, it simply speaks to the fact that we have included doxygen config files, are working to document the source code, and provides a rudimentary "do this" guide to create the doxygen cross references. ------------------------------------------------------------------------ jeremyosborne | 2008-01-30 07:12:07 +0100 (Wed, 30 Jan 2008) | 2 lines - All .h files now have doxygen recognized headers, and the format is slightly altered to ease editing of headers. - Protected all .h files from multiple calls. (Standard format is #ifndef _HEADE R_H_ #define _HEADER_H_ .... #endif) ------------------------------------------------------------------------ jeremyosborne | 2008-01-29 11:18:14 +0100 (Tue, 29 Jan 2008) | 1 line constants.h, structs.h and utils.h now protected from multiple includes. This is sometimes overkill, but good practice overall. ------------------------------------------------------------------------ jeremyosborne | 2008-01-29 10:38:18 +0100 (Tue, 29 Jan 2008) | 1 line Updated documentation for constants.c and constants.h. ------------------------------------------------------------------------ jeremyosborne | 2008-01-29 10:15:25 +0100 (Tue, 29 Jan 2008) | 3 lines The standard Doxygen configuration doxyfiles (config files) for tbaMUD. One is to be used with the Graphviz DOT (dox_withGraphs), one is designed to be used if Graphviz is not available. Now just need a short document describing the usage of doxygen. ------------------------------------------------------------------------ jeremyosborne | 2008-01-29 10:11:36 +0100 (Tue, 29 Jan 2008) | 1 line Minor document correction in struct dex_app_tpe. ------------------------------------------------------------------------ jeremyosborne | 2008-01-28 20:53:51 +0100 (Mon, 28 Jan 2008) | 1 line *bugfix* do_drink command: When a container is empty, the correct, "It is empty." message is now displayed. ------------------------------------------------------------------------ jeremyosborne | 2008-01-28 07:58:15 +0100 (Mon, 28 Jan 2008) | 3 lines Merging changes to trunk for: * utils.h, utils.c and structs.h doxygen comments * adding file dox_withGraphs.doxyfile
2008-04-12 01:31:58 +00:00
static void print_group(struct char_data *ch)
2006-12-19 22:56:18 +00:00
{
struct char_data *k;
struct follow_type *f;
if (!AFF_FLAGGED(ch, AFF_GROUP))
send_to_char(ch, "But you are not the member of a group!\r\n");
else {
char buf[MAX_STRING_LENGTH];
send_to_char(ch, "Your group consists of:\r\n");
k = (ch->master ? ch->master : ch);
if (AFF_FLAGGED(k, AFF_GROUP)) {
snprintf(buf, sizeof(buf), " [%3dH %3dM %3dV] [%2d %s] $N (Head of group)",
GET_HIT(k), GET_MANA(k), GET_MOVE(k), GET_LEVEL(k), CLASS_ABBR(k));
act(buf, FALSE, ch, 0, k, TO_CHAR);
}
for (f = k->followers; f; f = f->next) {
if (!AFF_FLAGGED(f->follower, AFF_GROUP))
continue;
snprintf(buf, sizeof(buf), " [%3dH %3dM %3dV] [%2d %s] $N", GET_HIT(f->follower),
GET_MANA(f->follower), GET_MOVE(f->follower),
GET_LEVEL(f->follower), CLASS_ABBR(f->follower));
act(buf, FALSE, ch, 0, f->follower, TO_CHAR);
}
}
}
ACMD(do_group)
{
char buf[MAX_STRING_LENGTH];
struct char_data *vict;
struct follow_type *f;
int found;
one_argument(argument, buf);
if (!*buf) {
print_group(ch);
return;
}
if (ch->master) {
act("You cannot enroll group members without being head of a group.",
2006-12-19 22:56:18 +00:00
FALSE, ch, 0, 0, TO_CHAR);
return;
}
if (!str_cmp(buf, "all")) {
perform_group(ch, ch);
for (found = 0, f = ch->followers; f; f = f->next)
found += perform_group(ch, f->follower);
if (!found)
send_to_char(ch, "Everyone following you is already in your group.\r\n");
return;
}
if (!(vict = get_char_vis(ch, buf, NULL, FIND_CHAR_ROOM)))
send_to_char(ch, "%s", CONFIG_NOPERSON);
else if ((vict->master != ch) && (vict != ch))
act("$N must follow you to enter your group.", FALSE, ch, 0, vict, TO_CHAR);
else {
if (!AFF_FLAGGED(vict, AFF_GROUP))
perform_group(ch, vict);
else {
if (ch != vict)
act("$N is no longer a member of your group.", FALSE, ch, 0, vict, TO_CHAR);
act("You have been kicked out of $n's group!", FALSE, ch, 0, vict, TO_VICT);
act("$N has been kicked out of $n's group!", FALSE, ch, 0, vict, TO_NOTVICT);
2007-05-08 15:20:59 +00:00
REMOVE_BIT_AR(AFF_FLAGS(vict), AFF_GROUP);
2006-12-19 22:56:18 +00:00
}
}
}
ACMD(do_ungroup)
{
char buf[MAX_INPUT_LENGTH];
struct follow_type *f, *next_fol;
struct char_data *tch;
one_argument(argument, buf);
if (!*buf) {
if (ch->master || !(AFF_FLAGGED(ch, AFF_GROUP))) {
send_to_char(ch, "But you lead no group!\r\n");
return;
}
for (f = ch->followers; f; f = next_fol) {
next_fol = f->next;
if (AFF_FLAGGED(f->follower, AFF_GROUP)) {
2007-05-08 15:20:59 +00:00
REMOVE_BIT_AR(AFF_FLAGS(f->follower), AFF_GROUP);
2006-12-19 22:56:18 +00:00
act("$N has disbanded the group.", TRUE, f->follower, NULL, ch, TO_CHAR);
if (!AFF_FLAGGED(f->follower, AFF_CHARM))
stop_follower(f->follower);
}
}
2007-05-08 15:20:59 +00:00
REMOVE_BIT_AR(AFF_FLAGS(ch), AFF_GROUP);
2006-12-19 22:56:18 +00:00
send_to_char(ch, "You disband the group.\r\n");
return;
}
if (!(tch = get_char_vis(ch, buf, NULL, FIND_CHAR_ROOM))) {
send_to_char(ch, "There is no such person!\r\n");
return;
}
if (tch->master != ch) {
send_to_char(ch, "That person is not following you!\r\n");
return;
}
if (!AFF_FLAGGED(tch, AFF_GROUP)) {
send_to_char(ch, "That person isn't in your group.\r\n");
return;
}
2007-05-08 15:20:59 +00:00
REMOVE_BIT_AR(AFF_FLAGS(tch), AFF_GROUP);
2006-12-19 22:56:18 +00:00
act("$N is no longer a member of your group.", FALSE, ch, 0, tch, TO_CHAR);
act("You have been kicked out of $n's group!", FALSE, ch, 0, tch, TO_VICT);
act("$N has been kicked out of $n's group!", FALSE, ch, 0, tch, TO_NOTVICT);
2006-12-19 22:56:18 +00:00
if (!AFF_FLAGGED(tch, AFF_CHARM))
stop_follower(tch);
}
ACMD(do_report)
{
char buf[MAX_STRING_LENGTH];
struct char_data *k;
struct follow_type *f;
if (!AFF_FLAGGED(ch, AFF_GROUP)) {
send_to_char(ch, "But you are not a member of any group!\r\n");
return;
}
snprintf(buf, sizeof(buf), "$n reports: %d/%dH, %d/%dM, %d/%dV\r\n",
GET_HIT(ch), GET_MAX_HIT(ch),
GET_MANA(ch), GET_MAX_MANA(ch),
GET_MOVE(ch), GET_MAX_MOVE(ch));
k = (ch->master ? ch->master : ch);
for (f = k->followers; f; f = f->next)
if (AFF_FLAGGED(f->follower, AFF_GROUP) && f->follower != ch)
act(buf, TRUE, ch, NULL, f->follower, TO_VICT);
if (k != ch)
act(buf, TRUE, ch, NULL, k, TO_VICT);
send_to_char(ch, "You report to the group.\r\n");
}
ACMD(do_split)
{
char buf[MAX_INPUT_LENGTH];
int amount, num, share, rest;
size_t len;
struct char_data *k;
struct follow_type *f;
if (IS_NPC(ch))
return;
one_argument(argument, buf);
if (is_number(buf)) {
amount = atoi(buf);
if (amount <= 0) {
send_to_char(ch, "Sorry, you can't do that.\r\n");
return;
}
if (amount > GET_GOLD(ch)) {
send_to_char(ch, "You don't seem to have that much gold to split.\r\n");
return;
}
k = (ch->master ? ch->master : ch);
if (AFF_FLAGGED(k, AFF_GROUP) && (IN_ROOM(k) == IN_ROOM(ch)))
num = 1;
else
num = 0;
for (f = k->followers; f; f = f->next)
if (AFF_FLAGGED(f->follower, AFF_GROUP) &&
(!IS_NPC(f->follower)) &&
(IN_ROOM(f->follower) == IN_ROOM(ch)))
num++;
if (num && AFF_FLAGGED(ch, AFF_GROUP)) {
share = amount / num;
rest = amount % num;
} else {
send_to_char(ch, "With whom do you wish to share your gold?\r\n");
return;
}
GET_GOLD(ch) -= share * (num - 1);
/* Abusing signed/unsigned to make sizeof work. */
len = snprintf(buf, sizeof(buf), "%s splits %d coins; you receive %d.\r\n",
GET_NAME(ch), amount, share);
if (rest && len < sizeof(buf)) {
snprintf(buf + len, sizeof(buf) - len,
"%d coin%s %s not splitable, so %s keeps the money.\r\n", rest,
(rest == 1) ? "" : "s", (rest == 1) ? "was" : "were", GET_NAME(ch));
}
if (AFF_FLAGGED(k, AFF_GROUP) && IN_ROOM(k) == IN_ROOM(ch) &&
!IS_NPC(k) && k != ch) {
GET_GOLD(k) += share;
send_to_char(k, "%s", buf);
}
for (f = k->followers; f; f = f->next) {
if (AFF_FLAGGED(f->follower, AFF_GROUP) &&
(!IS_NPC(f->follower)) &&
(IN_ROOM(f->follower) == IN_ROOM(ch)) &&
f->follower != ch) {
GET_GOLD(f->follower) += share;
send_to_char(f->follower, "%s", buf);
}
}
send_to_char(ch, "You split %d coins among %d members -- %d coins each.\r\n",
amount, num, share);
if (rest) {
send_to_char(ch, "%d coin%s %s not splitable, so you keep the money.\r\n",
rest, (rest == 1) ? "" : "s", (rest == 1) ? "was" : "were");
GET_GOLD(ch) += rest;
}
} else {
send_to_char(ch, "How many coins do you wish to split with your group?\r\n");
return;
}
}
ACMD(do_use)
{
char buf[MAX_INPUT_LENGTH], arg[MAX_INPUT_LENGTH];
struct obj_data *mag_item;
half_chop(argument, arg, buf);
if (!*arg) {
send_to_char(ch, "What do you want to %s?\r\n", CMD_NAME);
return;
}
mag_item = GET_EQ(ch, WEAR_HOLD);
if (!mag_item || !isname(arg, mag_item->name)) {
switch (subcmd) {
case SCMD_RECITE:
case SCMD_QUAFF:
if (!(mag_item = get_obj_in_list_vis(ch, arg, NULL, ch->carrying))) {
send_to_char(ch, "You don't seem to have %s %s.\r\n", AN(arg), arg);
return;
}
break;
case SCMD_USE:
send_to_char(ch, "You don't seem to be holding %s %s.\r\n", AN(arg), arg);
return;
default:
log("SYSERR: Unknown subcmd %d passed to do_use.", subcmd);
/* SYSERR_DESC: This is the same as the unhandled case in do_gen_ps(),
* but in the function which handles 'quaff', 'recite', and 'use'. */
2006-12-19 22:56:18 +00:00
return;
}
}
switch (subcmd) {
case SCMD_QUAFF:
if (GET_OBJ_TYPE(mag_item) != ITEM_POTION) {
send_to_char(ch, "You can only quaff potions.\r\n");
return;
}
break;
case SCMD_RECITE:
if (GET_OBJ_TYPE(mag_item) != ITEM_SCROLL) {
send_to_char(ch, "You can only recite scrolls.\r\n");
return;
}
break;
case SCMD_USE:
if ((GET_OBJ_TYPE(mag_item) != ITEM_WAND) &&
(GET_OBJ_TYPE(mag_item) != ITEM_STAFF)) {
send_to_char(ch, "You can't seem to figure out how to use it.\r\n");
return;
}
break;
}
mag_objectmagic(ch, mag_item, buf);
}
ACMD(do_display)
{
size_t i;
if (IS_NPC(ch)) {
2008-07-26 15:43:57 +00:00
send_to_char(ch, "Monsters don't need displays. Go away.\r\n");
2006-12-19 22:56:18 +00:00
return;
}
skip_spaces(&argument);
if (!*argument) {
send_to_char(ch, "Usage: prompt { { H | M | V } | all | auto | none }\r\n");
return;
}
if (!str_cmp(argument, "auto")) {
2007-05-08 15:20:59 +00:00
TOGGLE_BIT_AR(PRF_FLAGS(ch), PRF_DISPAUTO);
2006-12-19 22:56:18 +00:00
send_to_char(ch, "Auto prompt %sabled.\r\n", PRF_FLAGGED(ch, PRF_DISPAUTO) ? "en" : "dis");
return;
}
2007-05-08 19:52:43 +00:00
if (!str_cmp(argument, "on") || !str_cmp(argument, "all")) {
SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPHP);
SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPMANA);
SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPMOVE);
} else if (!str_cmp(argument, "off") || !str_cmp(argument, "none")) {
REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_DISPHP);
REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_DISPMANA);
REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_DISPMOVE);
} else {
REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_DISPHP);
REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_DISPMANA);
REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_DISPMOVE);
2006-12-19 22:56:18 +00:00
for (i = 0; i < strlen(argument); i++) {
switch (LOWER(argument[i])) {
case 'h':
2007-05-08 15:20:59 +00:00
SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPHP);
2006-12-19 22:56:18 +00:00
break;
case 'm':
2007-05-08 15:20:59 +00:00
SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPMANA);
2006-12-19 22:56:18 +00:00
break;
case 'v':
2007-05-08 15:20:59 +00:00
SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPMOVE);
2006-12-19 22:56:18 +00:00
break;
default:
send_to_char(ch, "Usage: prompt { { H | M | V } | all | auto | none }\r\n");
return;
}
}
}
send_to_char(ch, "%s", CONFIG_OK);
}
#define TOG_OFF 0
#define TOG_ON 1
ACMD(do_gen_tog)
{
long result;
const char *tog_messages[][2] = {
{"You are now safe from summoning by other players.\r\n",
"You may now be summoned by other players.\r\n"},
{"Nohassle disabled.\r\n",
"Nohassle enabled.\r\n"},
{"Brief mode off.\r\n",
"Brief mode on.\r\n"},
{"Compact mode off.\r\n",
"Compact mode on.\r\n"},
{"You can now hear tells.\r\n",
"You are now deaf to tells.\r\n"},
{"You can now hear auctions.\r\n",
"You are now deaf to auctions.\r\n"},
{"You can now hear shouts.\r\n",
"You are now deaf to shouts.\r\n"},
{"You can now hear gossip.\r\n",
"You are now deaf to gossip.\r\n"},
{"You can now hear the congratulation messages.\r\n",
"You are now deaf to the congratulation messages.\r\n"},
{"You can now hear the Wiz-channel.\r\n",
"You are now deaf to the Wiz-channel.\r\n"},
{"You are no longer part of the Quest.\r\n",
"Okay, you are part of the Quest!\r\n"},
{"You will no longer see the room flags.\r\n",
"You will now see the room flags.\r\n"},
{"You will now have your communication repeated.\r\n",
"You will no longer have your communication repeated.\r\n"},
{"HolyLight mode off.\r\n",
"HolyLight mode on.\r\n"},
{"Nameserver_is_slow changed to NO; IP addresses will now be resolved.\r\n",
"Nameserver_is_slow changed to YES; sitenames will no longer be resolved.\r\n"},
{"Autoexits disabled.\r\n",
"Autoexits enabled.\r\n"},
{"Will no longer track through doors.\r\n",
"Will now track through doors.\r\n"},
{"Will no longer clear screen in OLC.\r\n",
"Will now clear screen in OLC.\r\n"},
{"Buildwalk Off.\r\n",
"Buildwalk On.\r\n"},
{"AFK flag is now off.\r\n",
"AFK flag is now on.\r\n"},
{"Autoloot disabled.\r\n",
"Autoloot enabled.\r\n"},
{"Autogold disabled.\r\n",
"Autogold enabled.\r\n"},
{"Autosplit disabled.\r\n",
"Autosplit enabled.\r\n"},
{"Autosacrifice disabled.\r\n",
"Autosacrifice enabled.\r\n"},
{"Autoassist disabled.\r\n",
"Autoassist enabled.\r\n"},
{"Automap disabled.\r\n",
"Automap enabled.\r\n"},
{"Autokey disabled.\r\n",
"Autokey enabled.\r\n"},
{"Autodoor disabled.\r\n",
"Autodoor enabled.\r\n"}
};
if (IS_NPC(ch))
return;
switch (subcmd) {
case SCMD_NOSUMMON:
result = PRF_TOG_CHK(ch, PRF_SUMMONABLE);
break;
case SCMD_NOHASSLE:
result = PRF_TOG_CHK(ch, PRF_NOHASSLE);
break;
case SCMD_BRIEF:
result = PRF_TOG_CHK(ch, PRF_BRIEF);
break;
case SCMD_COMPACT:
result = PRF_TOG_CHK(ch, PRF_COMPACT);
break;
case SCMD_NOTELL:
result = PRF_TOG_CHK(ch, PRF_NOTELL);
break;
case SCMD_NOAUCTION:
result = PRF_TOG_CHK(ch, PRF_NOAUCT);
break;
case SCMD_NOSHOUT:
result = PRF_TOG_CHK(ch, PRF_NOSHOUT);
break;
case SCMD_NOGOSSIP:
result = PRF_TOG_CHK(ch, PRF_NOGOSS);
break;
case SCMD_NOGRATZ:
result = PRF_TOG_CHK(ch, PRF_NOGRATZ);
break;
case SCMD_NOWIZ:
result = PRF_TOG_CHK(ch, PRF_NOWIZ);
break;
case SCMD_QUEST:
result = PRF_TOG_CHK(ch, PRF_QUEST);
break;
case SCMD_SHOWVNUMS:
result = PRF_TOG_CHK(ch, PRF_SHOWVNUMS);
break;
case SCMD_NOREPEAT:
result = PRF_TOG_CHK(ch, PRF_NOREPEAT);
break;
case SCMD_HOLYLIGHT:
result = PRF_TOG_CHK(ch, PRF_HOLYLIGHT);
break;
case SCMD_AUTOEXIT:
result = PRF_TOG_CHK(ch, PRF_AUTOEXIT);
break;
case SCMD_CLS:
result = PRF_TOG_CHK(ch, PRF_CLS);
break;
case SCMD_BUILDWALK:
if (!ADM_FLAGGED(ch, ADM_BUILD)) {
send_to_char(ch, "Builders only, sorry.\r\n");
return;
}
result = PRF_TOG_CHK(ch, PRF_BUILDWALK);
if (PRF_FLAGGED(ch, PRF_BUILDWALK))
mudlog(CMP, GET_ADMLEVEL(ch), TRUE,
"OLC: %s turned buildwalk on. Allowed zone %d", GET_NAME(ch), GET_OLC_ZONE(ch));
else
mudlog(CMP, GET_ADMLEVEL(ch), TRUE,
"OLC: %s turned buildwalk off. Allowed zone %d", GET_NAME(ch), GET_OLC_ZONE(ch));
break;
case SCMD_AFK:
result = PRF_TOG_CHK(ch, PRF_AFK);
if (PRF_FLAGGED(ch, PRF_AFK))
act("$n has gone AFK.", TRUE, ch, 0, 0, TO_ROOM);
else {
act("$n has come back from AFK.", TRUE, ch, 0, 0, TO_ROOM);
if (has_mail(GET_IDNUM(ch)))
send_to_char(ch, "You have mail waiting.\r\n");
}
break;
case SCMD_AUTOLOOT:
result = PRF_TOG_CHK(ch, PRF_AUTOLOOT);
break;
case SCMD_AUTOGOLD:
result = PRF_TOG_CHK(ch, PRF_AUTOGOLD);
break;
case SCMD_AUTOSPLIT:
result = PRF_TOG_CHK(ch, PRF_AUTOSPLIT);
break;
case SCMD_AUTOSAC:
result = PRF_TOG_CHK(ch, PRF_AUTOSAC);
break;
case SCMD_AUTOASSIST:
result = PRF_TOG_CHK(ch, PRF_AUTOASSIST);
break;
case SCMD_AUTOMAP:
result = PRF_TOG_CHK(ch, PRF_AUTOMAP);
break;
case SCMD_AUTOKEY:
result = PRF_TOG_CHK(ch, PRF_AUTOKEY);
break;
case SCMD_AUTODOOR:
result = PRF_TOG_CHK(ch, PRF_AUTODOOR);
break;
default:
log("SYSERR: Unknown subcmd %d in do_gen_toggle.", subcmd);
return;
}
if (result)
send_to_char(ch, "%s", tog_messages[subcmd][TOG_ON]);
else
send_to_char(ch, "%s", tog_messages[subcmd][TOG_OFF]);
return;
}
void show_happyhour(struct char_data *ch)
{
char happyexp[80], happygold[80], happyqp[80];
int secs_left;
if ( (IS_HAPPYHOUR) || (IS_ADMIN(ch, ADMLVL_GRGOD)) )
{
if (HAPPY_TIME)
secs_left = ((HAPPY_TIME - 1) * SECS_PER_MUD_HOUR) + next_tick;
else
secs_left = 0;
sprintf(happyqp, "%s+%d%%%s to Questpoints per quest\r\n", CCYEL(ch, C_NRM), HAPPY_QP, CCNRM(ch, C_NRM));
sprintf(happygold, "%s+%d%%%s to Gold gained per kill\r\n", CCYEL(ch, C_NRM), HAPPY_GOLD, CCNRM(ch, C_NRM));
sprintf(happyexp, "%s+%d%%%s to Experience per kill\r\n", CCYEL(ch, C_NRM), HAPPY_EXP, CCNRM(ch, C_NRM));
send_to_char(ch, "tbaMUD Happy Hour!\r\n"
"------------------\r\n"
"%s%s%sTime Remaining: %s%d%s hours %s%d%s mins %s%d%s secs\r\n",
(IS_HAPPYEXP || IS_ADMIN(ch, ADMLVL_GOD)) ? happyexp : "",
(IS_HAPPYGOLD || IS_ADMIN(ch, ADMLVL_GOD)) ? happygold : "",
(IS_HAPPYQP || IS_ADMIN(ch, ADMLVL_GOD)) ? happyqp : "",
CCYEL(ch, C_NRM), (secs_left / 3600), CCNRM(ch, C_NRM),
CCYEL(ch, C_NRM), (secs_left % 3600) / 60, CCNRM(ch, C_NRM),
CCYEL(ch, C_NRM), (secs_left % 60), CCNRM(ch, C_NRM) );
}
else
{
send_to_char(ch, "Sorry, there is currently no happy hour!\r\n");
}
}
ACMD(do_happyhour)
{
char arg[MAX_INPUT_LENGTH], val[MAX_INPUT_LENGTH];
int num;
if (IS_ADMIN(ch, ADMLVL_GOD))
{
show_happyhour(ch);
return;
}
/* Only Imms get here, so check args */
two_arguments(argument, arg, val);
if (is_abbrev(arg, "experience"))
{
num = MIN(MAX((atoi(val)), 0), 1000);
HAPPY_EXP = num;
send_to_char(ch, "Happy Hour Exp rate set to +%d%%\r\n", HAPPY_EXP);
}
else if ((is_abbrev(arg, "gold")) || (is_abbrev(arg, "coins")))
{
num = MIN(MAX((atoi(val)), 0), 1000);
HAPPY_GOLD = num;
send_to_char(ch, "Happy Hour Gold rate set to +%d%%\r\n", HAPPY_GOLD);
}
else if ((is_abbrev(arg, "time")) || (is_abbrev(arg, "ticks")))
{
num = MIN(MAX((atoi(val)), 0), 1000);
if (HAPPY_TIME && !num)
game_info("Happyhour has been stopped!");
else if (!HAPPY_TIME && num)
game_info("A Happyhour has started!");
HAPPY_TIME = num;
send_to_char(ch, "Happy Hour Time set to %d ticks (%d hours %d mins and %d secs)\r\n",
HAPPY_TIME,
(HAPPY_TIME*SECS_PER_MUD_HOUR)/3600,
((HAPPY_TIME*SECS_PER_MUD_HOUR)%3600) / 60,
(HAPPY_TIME*SECS_PER_MUD_HOUR)%60 );
}
else if ((is_abbrev(arg, "qp")) || (is_abbrev(arg, "questpoints")))
{
num = MIN(MAX((atoi(val)), 0), 1000);
HAPPY_QP = num;
send_to_char(ch, "Happy Hour Questpoints rate set to +%d%%\r\n", HAPPY_QP);
}
else if (is_abbrev(arg, "show"))
{
show_happyhour(ch);
}
else if (is_abbrev(arg, "default"))
{
HAPPY_EXP = 100;
HAPPY_GOLD = 50;
HAPPY_QP = 50;
HAPPY_TIME = 48;
game_info("A Happyhour has started!");
}
else
{
send_to_char(ch, "Usage: %shappyhour %s- show usage (this info)\r\n"
" %shappyhour show %s- display current settings (what mortals see)\r\n"
" %shappyhour time <ticks> %s- set happyhour time and start timer\r\n"
" %shappyhour qp <num> %s- set qp percentage gain\r\n"
" %shappyhour exp <num> %s- set exp percentage gain\r\n"
" %shappyhour gold <num> %s- set gold percentage gain\r\n"
" @yhappyhour default @w- sets a default setting for happyhour\r\n\r\n"
"Configure the happyhour settings and start a happyhour.\r\n"
"Currently 1 hour IRL = %d ticks\r\n"
"If no number is specified, 0 (off) is assumed.\r\nThe command @yhappyhour time@n will therefore stop the happyhour timer.\r\n",
CCYEL(ch, C_NRM), CCNRM(ch, C_NRM),
CCYEL(ch, C_NRM), CCNRM(ch, C_NRM),
CCYEL(ch, C_NRM), CCNRM(ch, C_NRM),
CCYEL(ch, C_NRM), CCNRM(ch, C_NRM),
CCYEL(ch, C_NRM), CCNRM(ch, C_NRM),
CCYEL(ch, C_NRM), CCNRM(ch, C_NRM),
(3600 / SECS_PER_MUD_HOUR) );
}
}