tbamud/src/dg_mobcmd.c

1153 lines
28 KiB
C
Raw Normal View History

2006-12-19 22:56:18 +00:00
/**************************************************************************
* File: dg_mobcmd.c Part of tbaMUD *
* Usage: Contains the mobile script commands. *
2006-12-19 22:56:18 +00:00
* *
* $Author: N'Atas-ha/Mark A. Heilpern/egreen/Welcor $ *
* $Date: 2004/10/11 12:07:00$ *
* $Revision: 1.0.14 $ *
**************************************************************************/
#include "conf.h"
#include "sysdep.h"
#include "structs.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 "utils.h"
2006-12-19 22:56:18 +00:00
#include "screen.h"
#include "dg_scripts.h"
#include "db.h"
#include "handler.h"
#include "interpreter.h"
#include "comm.h"
#include "spells.h"
#include "constants.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 "genzon.h" /* for real_zone_by_thing */
#include "act.h"
#include "fight.h"
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
/* Local file scope functions. */
static void mob_log(char_data *mob, const char *format, ...);
2006-12-19 22:56:18 +00:00
/* attaches mob's name and vnum to msg and sends it to script_log */
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 mob_log(char_data *mob, const char *format, ...)
2006-12-19 22:56:18 +00:00
{
va_list args;
char output[MAX_STRING_LENGTH];
snprintf(output, sizeof(output), "Mob (%s, VNum %d):: %s",
2006-12-19 22:56:18 +00:00
GET_SHORT(mob), GET_MOB_VNUM(mob), format);
va_start(args, format);
script_vlog(output, args);
va_end(args);
}
/* Macro to determine if a mob is permitted to use these commands. */
2006-12-19 22:56:18 +00:00
#define MOB_OR_IMPL(ch) \
(IS_NPC(ch) && (!(ch)->desc || GET_LEVEL((ch)->desc->original)>=LVL_IMPL))
/* mob commands */
/* prints the argument to all the rooms aroud the mobile */
ACMD(do_masound)
{
room_rnum was_in_room;
int door;
2006-12-19 22:56:18 +00:00
if (!MOB_OR_IMPL(ch))
{
send_to_char(ch, "Huh?!?\r\n");
return;
}
if (AFF_FLAGGED(ch, AFF_CHARM))
return;
2006-12-19 22:56:18 +00:00
if (!*argument)
{
mob_log(ch, "masound called with no argument");
return;
}
skip_spaces(&argument);
2006-12-19 22:56:18 +00:00
was_in_room = IN_ROOM(ch);
for (door = 0; door < NUM_OF_DIRS; door++)
{
struct room_direction_data *newexit;
2006-12-19 22:56:18 +00:00
if (((newexit = world[was_in_room].dir_option[door]) != NULL) &&
newexit->to_room != NOWHERE && newexit->to_room != was_in_room)
{
IN_ROOM(ch) = newexit->to_room;
sub_write(argument, ch, TRUE, TO_ROOM);
}
}
2006-12-19 22:56:18 +00:00
IN_ROOM(ch) = was_in_room;
}
/* lets the mobile kill any player or mobile without murder*/
ACMD(do_mkill)
{
char arg[MAX_INPUT_LENGTH];
char_data *victim;
2006-12-19 22:56:18 +00:00
if (!MOB_OR_IMPL(ch)) {
send_to_char(ch, "Huh?!?\r\n");
return;
}
if (AFF_FLAGGED(ch, AFF_CHARM))
return;
2006-12-19 22:56:18 +00:00
one_argument(argument, arg);
2006-12-19 22:56:18 +00:00
if (!*arg) {
mob_log(ch, "mkill called with no argument");
return;
}
if (*arg == UID_CHAR) {
if (!(victim = get_char(arg))) {
mob_log(ch, "mkill: victim (%s) not found",arg);
return;
}
} else if (!(victim = get_char_room_vis(ch, arg, NULL))) {
mob_log(ch, "mkill: victim (%s) not found",arg);
return;
}
if (victim == ch) {
mob_log(ch, "mkill: victim is self");
return;
}
if (!IS_NPC(victim) && PRF_FLAGGED(victim, PRF_NOHASSLE)) {
mob_log(ch, "mkill: target has nohassle on");
return;
}
if (FIGHTING(ch)) {
mob_log(ch, "mkill: already fighting");
return;
}
2006-12-19 22:56:18 +00:00
hit(ch, victim, TYPE_UNDEFINED);
return;
}
/* Lets the mobile destroy an object in its inventory it can also destroy a
* worn object and it can destroy items using all.xxxxx or just plain all of
* them. */
2006-12-19 22:56:18 +00:00
ACMD(do_mjunk)
{
char arg[MAX_INPUT_LENGTH];
int pos, junk_all = 0;
obj_data *obj;
obj_data *obj_next;
2006-12-19 22:56:18 +00:00
if (!MOB_OR_IMPL(ch)) {
send_to_char(ch, "Huh?!?\r\n");
return;
}
2006-12-19 22:56:18 +00:00
if (AFF_FLAGGED(ch, AFF_CHARM))
return;
one_argument(argument, arg);
2006-12-19 22:56:18 +00:00
if (!*arg) {
mob_log(ch, "mjunk called with no argument");
return;
}
if (!str_cmp(arg, "all")) junk_all = 1;
if ((find_all_dots(arg) != FIND_INDIV) && !junk_all) {
2006-12-19 22:56:18 +00:00
/* Thanks to Carlos Myers for fixing the line below */
if ((pos = get_obj_pos_in_equip_vis(ch, arg, NULL, ch->equipment)) >= 0) {
extract_obj(unequip_char(ch, pos));
return;
}
if ((obj = get_obj_in_list_vis(ch, arg, NULL, ch->carrying)) != NULL )
extract_obj(obj);
return;
} else {
for (obj = ch->carrying; obj != NULL; obj = obj_next) {
obj_next = obj->next_content;
if (arg[3] == '\0' || isname(arg+4, obj->name)) {
extract_obj(obj);
}
}
/* Thanks to Carlos Myers for fixing the line below */
while ((pos = get_obj_pos_in_equip_vis(ch, arg, NULL, ch->equipment)) >= 0)
extract_obj(unequip_char(ch, pos));
}
return;
}
/* prints the message to everyone in the room other than the mob and victim */
ACMD(do_mechoaround)
{
char arg[MAX_INPUT_LENGTH];
char_data *victim;
char *p;
if (!MOB_OR_IMPL(ch)) {
send_to_char(ch, "Huh?!?\r\n");
return;
}
2006-12-19 22:56:18 +00:00
if (AFF_FLAGGED(ch, AFF_CHARM))
return;
2006-12-19 22:56:18 +00:00
p = one_argument(argument, arg);
skip_spaces(&p);
2006-12-19 22:56:18 +00:00
if (!*arg) {
mob_log(ch, "mechoaround called with no argument");
return;
}
2006-12-19 22:56:18 +00:00
if (*arg == UID_CHAR) {
if (!(victim = get_char(arg))) {
mob_log(ch, "mechoaround: victim (%s) does not exist",arg);
return;
}
} else if (!(victim = get_char_room_vis(ch, arg, NULL))) {
mob_log(ch, "mechoaround: victim (%s) does not exist",arg);
return;
}
sub_write(p, victim, TRUE, TO_ROOM);
}
/* sends the message to only the victim */
ACMD(do_msend)
{
char arg[MAX_INPUT_LENGTH];
char_data *victim;
char *p;
if (!MOB_OR_IMPL(ch)) {
send_to_char(ch, "Huh?!?\r\n");
return;
}
if (AFF_FLAGGED(ch, AFF_CHARM))
return;
2006-12-19 22:56:18 +00:00
p = one_argument(argument, arg);
skip_spaces(&p);
2006-12-19 22:56:18 +00:00
if (!*arg) {
mob_log(ch, "msend called with no argument");
return;
}
if (*arg == UID_CHAR) {
if (!(victim = get_char(arg))) {
mob_log(ch, "msend: victim (%s) does not exist",arg);
return;
}
} else if (!(victim = get_char_room_vis(ch, arg, NULL))) {
mob_log(ch, "msend: victim (%s) does not exist",arg);
return;
}
2006-12-19 22:56:18 +00:00
sub_write(p, victim, TRUE, TO_CHAR);
}
/* prints the message to the room at large */
ACMD(do_mecho)
{
char *p;
2006-12-19 22:56:18 +00:00
if (!MOB_OR_IMPL(ch)) {
send_to_char(ch, "Huh?!?\r\n");
return;
}
2006-12-19 22:56:18 +00:00
if (AFF_FLAGGED(ch, AFF_CHARM))
return;
2006-12-19 22:56:18 +00:00
if (!*argument) {
mob_log(ch, "mecho called with no arguments");
return;
}
p = argument;
skip_spaces(&p);
2006-12-19 22:56:18 +00:00
sub_write(p, ch, TRUE, TO_ROOM);
}
ACMD(do_mzoneecho)
{
int zone;
char room_number[MAX_INPUT_LENGTH], buf[MAX_INPUT_LENGTH], *msg;
2006-12-19 22:56:18 +00:00
msg = any_one_arg(argument, room_number);
skip_spaces(&msg);
if (!*room_number || !*msg)
mob_log(ch, "mzoneecho called with too few args");
else if ((zone = real_zone_by_thing(atoi(room_number))) == NOWHERE)
mob_log(ch, "mzoneecho called for nonexistant zone");
else {
2006-12-19 22:56:18 +00:00
sprintf(buf, "%s\r\n", msg);
send_to_zone(buf, zone);
}
}
/* Lets the mobile load an item or mobile. All items are loaded into
* inventory, unless it is NO-TAKE. */
2006-12-19 22:56:18 +00:00
ACMD(do_mload)
{
char arg1[MAX_INPUT_LENGTH], arg2[MAX_INPUT_LENGTH];
int number = 0;
char_data *mob;
obj_data *object;
char *target;
char_data *tch;
obj_data *cnt;
int pos;
2006-12-19 22:56:18 +00:00
if (!MOB_OR_IMPL(ch)) {
send_to_char(ch, "Huh?!?\r\n");
return;
}
if (AFF_FLAGGED(ch, AFF_CHARM))
return;
if( ch->desc && GET_LEVEL(ch->desc->original) < LVL_IMPL)
return;
2006-12-19 22:56:18 +00:00
target = two_arguments(argument, arg1, arg2);
2006-12-19 22:56:18 +00:00
if (!*arg1 || !*arg2 || !is_number(arg2) || ((number = atoi(arg2)) < 0)) {
mob_log(ch, "mload: bad syntax");
return;
}
/* load mob to target room - Jamie Nelson, April 13 2004 */
if (is_abbrev(arg1, "mob")) {
room_rnum rnum;
if (!target || !*target) {
rnum = IN_ROOM(ch);
} else {
if (!isdigit(*target) || (rnum = real_room(atoi(target))) == NOWHERE) {
mob_log(ch, "mload: room target vnum doesn't exist "
"(loading mob vnum %d to room %s)", number, target);
return;
}
}
if ((mob = read_mobile(number, VIRTUAL)) == NULL) {
mob_log(ch, "mload: bad mob vnum");
return;
}
2006-12-19 22:56:18 +00:00
char_to_room(mob, rnum);
if (SCRIPT(ch)) { /* It _should_ have, but it might be detached. */
2006-12-19 22:56:18 +00:00
char buf[MAX_INPUT_LENGTH];
sprintf(buf, "%c%ld", UID_CHAR, GET_ID(mob));
add_var(&(SCRIPT(ch)->global_vars), "lastloaded", buf, 0);
}
load_mtrigger(mob);
}
else if (is_abbrev(arg1, "obj")) {
if ((object = read_object(number, VIRTUAL)) == NULL) {
mob_log(ch, "mload: bad object vnum");
return;
}
if (SCRIPT(ch)) { /* It _should_ have, but it might be detached. */
2006-12-19 22:56:18 +00:00
char buf[MAX_INPUT_LENGTH];
sprintf(buf, "%c%ld", UID_CHAR, GET_ID(object));
add_var(&(SCRIPT(ch)->global_vars), "lastloaded", buf, 0);
}
/* special handling to make objects able to load on a person/in a container/worn etc. */
if (!target || !*target) {
if (CAN_WEAR(object, ITEM_WEAR_TAKE)) {
obj_to_char(object, ch);
} else {
obj_to_room(object, IN_ROOM(ch));
}
load_otrigger(object);
return;
}
two_arguments(target, arg1, arg2); /* recycling ... */
tch = (arg1 && *arg1 == UID_CHAR) ? get_char(arg1) : get_char_room_vis(ch, arg1, NULL);
if (tch) {
if (arg2 && *arg2 &&
(pos = find_eq_pos_script(arg2)) >= 0 &&
!GET_EQ(tch, pos) &&
can_wear_on_pos(object, pos)) {
equip_char(tch, object, pos);
load_otrigger(object);
return;
}
obj_to_char(object, tch);
load_otrigger(object);
return;
}
cnt = (arg1 && *arg1 == UID_CHAR) ? get_obj(arg1) : get_obj_vis(ch, arg1, NULL);
if (cnt && GET_OBJ_TYPE(cnt) == ITEM_CONTAINER) {
obj_to_obj(object, cnt);
load_otrigger(object);
return;
}
/* neither char nor container found - just dump it in room */
obj_to_room(object, IN_ROOM(ch));
2006-12-19 22:56:18 +00:00
load_otrigger(object);
return;
}
else
mob_log(ch, "mload: bad type");
}
/* Lets the mobile purge all objects and other npcs in the room, or purge a
* specified object or mob in the room. It can purge itself, but this will
* be the last command it does. */
2006-12-19 22:56:18 +00:00
ACMD(do_mpurge)
{
char arg[MAX_INPUT_LENGTH];
char_data *victim;
obj_data *obj;
2006-12-19 22:56:18 +00:00
if (!MOB_OR_IMPL(ch)) {
send_to_char(ch, "Huh?!?\r\n");
return;
}
2006-12-19 22:56:18 +00:00
if (AFF_FLAGGED(ch, AFF_CHARM))
return;
if (ch->desc && (GET_LEVEL(ch->desc->original) < LVL_IMPL))
return;
2006-12-19 22:56:18 +00:00
one_argument(argument, arg);
2006-12-19 22:56:18 +00:00
if (!*arg) {
/* 'purge' */
char_data *vnext;
obj_data *obj_next;
2006-12-19 22:56:18 +00:00
for (victim = world[IN_ROOM(ch)].people; victim; victim = vnext) {
vnext = victim->next_in_room;
if (IS_NPC(victim) && victim != ch)
extract_char(victim);
}
for (obj = world[IN_ROOM(ch)].contents; obj; obj = obj_next) {
obj_next = obj->next_content;
extract_obj(obj);
}
return;
}
if (*arg == UID_CHAR)
victim = get_char(arg);
else victim = get_char_room_vis(ch, arg, NULL);
if (victim == NULL) {
if (*arg == UID_CHAR)
obj = get_obj(arg);
else
2006-12-19 22:56:18 +00:00
obj = get_obj_vis(ch, arg, NULL);
2006-12-19 22:56:18 +00:00
if (obj) {
extract_obj(obj);
obj = NULL;
} else
2006-12-19 22:56:18 +00:00
mob_log(ch, "mpurge: bad argument");
2006-12-19 22:56:18 +00:00
return;
}
2006-12-19 22:56:18 +00:00
if (!IS_NPC(victim)) {
mob_log(ch, "mpurge: purging a PC");
return;
}
if (victim==ch) dg_owner_purged = 1;
2006-12-19 22:56:18 +00:00
extract_char(victim);
}
/* lets the mobile goto any location it wishes that is not private */
ACMD(do_mgoto)
{
char arg[MAX_INPUT_LENGTH];
room_rnum location;
2006-12-19 22:56:18 +00:00
if (!MOB_OR_IMPL(ch)) {
send_to_char(ch, "Huh?!?\r\n");
return;
}
if (AFF_FLAGGED(ch, AFF_CHARM))
return;
2006-12-19 22:56:18 +00:00
one_argument(argument, arg);
if (!*arg) {
mob_log(ch, "mgoto called with no argument");
return;
}
2006-12-19 22:56:18 +00:00
if ((location = find_target_room(ch, arg)) == NOWHERE) {
mob_log(ch, "mgoto: invalid location");
return;
}
2006-12-19 22:56:18 +00:00
if (FIGHTING(ch))
stop_fighting(ch);
2006-12-19 22:56:18 +00:00
char_from_room(ch);
char_to_room(ch, location);
enter_wtrigger(&world[IN_ROOM(ch)], ch, -1);
}
/* lets the mobile do a command at another location. Very useful */
ACMD(do_mat)
{
char arg[MAX_INPUT_LENGTH];
room_rnum location, original;
2006-12-19 22:56:18 +00:00
if (!MOB_OR_IMPL(ch)) {
send_to_char(ch, "Huh?!?\r\n");
return;
}
2006-12-19 22:56:18 +00:00
if (AFF_FLAGGED(ch, AFF_CHARM))
return;
2006-12-19 22:56:18 +00:00
argument = one_argument( argument, arg );
2006-12-19 22:56:18 +00:00
if (!*arg || !*argument) {
mob_log(ch, "mat: bad argument");
return;
}
2006-12-19 22:56:18 +00:00
if ((location = find_target_room(ch, arg)) == NOWHERE) {
mob_log(ch, "mat: invalid location");
return;
}
2006-12-19 22:56:18 +00:00
original = IN_ROOM(ch);
char_from_room(ch);
char_to_room(ch, location);
command_interpreter(ch, argument);
/* See if 'ch' still exists before continuing! Handles 'at XXXX quit' case. */
2006-12-19 22:56:18 +00:00
if (IN_ROOM(ch) == location) {
char_from_room(ch);
char_to_room(ch, original);
}
}
/* Lets the mobile transfer people. The all argument transfers everyone in the
* current room to the specified location. */
2006-12-19 22:56:18 +00:00
ACMD(do_mteleport)
{
char arg1[MAX_INPUT_LENGTH], arg2[MAX_INPUT_LENGTH];
room_rnum target;
char_data *vict, *next_ch;
if (!MOB_OR_IMPL(ch)) {
send_to_char(ch, "Huh?!?\r\n");
return;
}
2006-12-19 22:56:18 +00:00
if (AFF_FLAGGED(ch, AFF_CHARM))
return;
argument = two_arguments(argument, arg1, arg2);
2006-12-19 22:56:18 +00:00
if (!*arg1 || !*arg2) {
mob_log(ch, "mteleport: bad syntax");
return;
}
target = find_target_room(ch, arg2);
if (target == NOWHERE) {
mob_log(ch, "mteleport target is an invalid room");
return;
}
2006-12-19 22:56:18 +00:00
if (!str_cmp(arg1, "all")) {
if (target == IN_ROOM(ch)) {
mob_log(ch, "mteleport all target is itself");
return;
}
for (vict = world[IN_ROOM(ch)].people; vict; vict = next_ch) {
next_ch = vict->next_in_room;
if (valid_dg_target(vict, DG_ALLOW_GODS)) {
char_from_room(vict);
char_to_room(vict, target);
enter_wtrigger(&world[IN_ROOM(ch)], ch, -1);
}
}
} else {
if (*arg1 == UID_CHAR) {
if (!(vict = get_char(arg1))) {
mob_log(ch, "mteleport: victim (%s) does not exist",arg1);
return;
}
} else if (!(vict = get_char_vis(ch, arg1, NULL, FIND_CHAR_WORLD))) {
mob_log(ch, "mteleport: victim (%s) does not exist",arg1);
return;
}
if (valid_dg_target(ch, DG_ALLOW_GODS)) {
char_from_room(vict);
char_to_room(vict, target);
enter_wtrigger(&world[IN_ROOM(ch)], ch, -1);
}
}
}
ACMD(do_mdamage) {
char name[MAX_INPUT_LENGTH], amount[MAX_INPUT_LENGTH];
int dam = 0;
char_data *vict;
if (!MOB_OR_IMPL(ch)) {
send_to_char(ch, "Huh?!?\r\n");
return;
}
2006-12-19 22:56:18 +00:00
if (AFF_FLAGGED(ch, AFF_CHARM))
return;
two_arguments(argument, name, amount);
/* who cares if it's a number ? if not it'll just be 0 */
if (!*name || !*amount) {
mob_log(ch, "mdamage: bad syntax");
return;
}
dam = atoi(amount);
if (*name == UID_CHAR) {
if (!(vict = get_char(name))) {
mob_log(ch, "mdamage: victim (%s) does not exist", name);
return;
}
} else if (!(vict = get_char_room_vis(ch, name, NULL))) {
mob_log(ch, "mdamage: victim (%s) does not exist", name);
return;
}
script_damage(vict, dam);
}
/* Lets the mobile force someone to do something. must be mortal level and the
* all argument only affects those in the room with the mobile. */
2006-12-19 22:56:18 +00:00
ACMD(do_mforce)
{
char arg[MAX_INPUT_LENGTH];
if (!MOB_OR_IMPL(ch)) {
send_to_char(ch, "Huh?!?\r\n");
return;
}
2006-12-19 22:56:18 +00:00
if (AFF_FLAGGED(ch, AFF_CHARM))
return;
2006-12-19 22:56:18 +00:00
if (ch->desc && (GET_LEVEL(ch->desc->original) < LVL_IMPL))
return;
2006-12-19 22:56:18 +00:00
argument = one_argument(argument, arg);
2006-12-19 22:56:18 +00:00
if (!*arg || !*argument) {
mob_log(ch, "mforce: bad syntax");
return;
}
2006-12-19 22:56:18 +00:00
if (!str_cmp(arg, "all")) {
struct descriptor_data *i;
char_data *vch;
2006-12-19 22:56:18 +00:00
for (i = descriptor_list; i ; i = i->next) {
if ((i->character != ch) && !i->connected &&
(IN_ROOM(i->character) == IN_ROOM(ch))) {
vch = i->character;
if (GET_LEVEL(vch) < GET_LEVEL(ch) && CAN_SEE(ch, vch) &&
valid_dg_target(vch, 0)) {
command_interpreter(vch, argument);
}
}
}
} else {
char_data *victim;
2006-12-19 22:56:18 +00:00
if (*arg == UID_CHAR) {
if (!(victim = get_char(arg))) {
mob_log(ch, "mforce: victim (%s) does not exist",arg);
return;
}
} else if ((victim = get_char_room_vis(ch, arg, NULL)) == NULL) {
mob_log(ch, "mforce: no such victim");
return;
}
2006-12-19 22:56:18 +00:00
if (victim == ch) {
mob_log(ch, "mforce: forcing self");
return;
}
2006-12-19 22:56:18 +00:00
if (valid_dg_target(victim, 0))
command_interpreter(victim, argument);
}
}
/* hunt for someone */
ACMD(do_mhunt)
{
char_data *victim;
char arg[MAX_INPUT_LENGTH];
if (!MOB_OR_IMPL(ch)) {
send_to_char(ch, "Huh?!?\r\n");
return;
}
2006-12-19 22:56:18 +00:00
if (AFF_FLAGGED(ch, AFF_CHARM))
return;
2006-12-19 22:56:18 +00:00
if (ch->desc && (GET_LEVEL(ch->desc->original) < LVL_IMPL))
return;
2006-12-19 22:56:18 +00:00
one_argument(argument, arg);
if (!*arg) {
mob_log(ch, "mhunt called with no argument");
return;
}
2006-12-19 22:56:18 +00:00
if (FIGHTING(ch)) return;
if (*arg == UID_CHAR) {
if (!(victim = get_char(arg))) {
mob_log(ch, "mhunt: victim (%s) does not exist", arg);
return;
}
} else if (!(victim = get_char_vis(ch, arg, NULL, FIND_CHAR_WORLD))) {
mob_log(ch, "mhunt: victim (%s) does not exist", arg);
return;
}
HUNTING(ch) = victim;
2006-12-19 22:56:18 +00:00
}
/* place someone into the mob's memory list */
ACMD(do_mremember)
{
char_data *victim;
struct script_memory *mem;
char arg[MAX_INPUT_LENGTH];
if (!MOB_OR_IMPL(ch)) {
send_to_char(ch, "Huh?!?\r\n");
return;
}
2006-12-19 22:56:18 +00:00
if (AFF_FLAGGED(ch, AFF_CHARM))
return;
2006-12-19 22:56:18 +00:00
if (ch->desc && (GET_LEVEL(ch->desc->original) < LVL_IMPL))
return;
2006-12-19 22:56:18 +00:00
argument = one_argument(argument, arg);
2006-12-19 22:56:18 +00:00
if (!*arg) {
mob_log(ch, "mremember: bad syntax");
return;
}
if (*arg == UID_CHAR) {
if (!(victim = get_char(arg))) {
mob_log(ch, "mremember: victim (%s) does not exist", arg);
return;
}
} else if (!(victim = get_char_vis(ch, arg, NULL, FIND_CHAR_WORLD))) {
mob_log(ch,"mremember: victim (%s) does not exist", arg);
return;
}
/* create a structure and add it to the list */
CREATE(mem, struct script_memory, 1);
if (!SCRIPT_MEM(ch)) SCRIPT_MEM(ch) = mem;
else {
struct script_memory *tmpmem = SCRIPT_MEM(ch);
while (tmpmem->next) tmpmem = tmpmem->next;
tmpmem->next = mem;
}
/* fill in the structure */
mem->id = GET_ID(victim);
if (argument && *argument) {
mem->cmd = strdup(argument);
}
}
/* remove someone from the list */
ACMD(do_mforget)
{
char_data *victim;
struct script_memory *mem, *prev;
char arg[MAX_INPUT_LENGTH];
if (!MOB_OR_IMPL(ch)) {
send_to_char(ch, "Huh?!?\r\n");
return;
}
2006-12-19 22:56:18 +00:00
if (AFF_FLAGGED(ch, AFF_CHARM))
return;
2006-12-19 22:56:18 +00:00
if (ch->desc && (GET_LEVEL(ch->desc->original) < LVL_IMPL))
return;
2006-12-19 22:56:18 +00:00
one_argument(argument, arg);
2006-12-19 22:56:18 +00:00
if (!*arg) {
mob_log(ch, "mforget: bad syntax");
return;
}
if (*arg == UID_CHAR) {
if (!(victim = get_char(arg))) {
mob_log(ch, "mforget: victim (%s) does not exist", arg);
return;
}
} else if (!(victim = get_char_vis(ch, arg, NULL, FIND_CHAR_WORLD))) {
mob_log(ch, "mforget: victim (%s) does not exist", arg);
return;
}
mem = SCRIPT_MEM(ch);
prev = NULL;
while (mem) {
if (mem->id == GET_ID(victim)) {
if (mem->cmd) free(mem->cmd);
if (prev==NULL) {
SCRIPT_MEM(ch) = mem->next;
free(mem);
mem = SCRIPT_MEM(ch);
} else {
prev->next = mem->next;
free(mem);
mem = prev->next;
}
} else {
prev = mem;
mem = mem->next;
}
}
}
/* transform into a different mobile */
ACMD(do_mtransform)
{
char arg[MAX_INPUT_LENGTH];
char_data *m, tmpmob;
obj_data *obj[NUM_WEARS];
mob_rnum this_rnum = GET_MOB_RNUM(ch);
int keep_hp = 1; /* new mob keeps the old mob's hp/max hp/exp */
int pos;
if (!MOB_OR_IMPL(ch)) {
send_to_char(ch, "Huh?!?\r\n");
return;
}
2006-12-19 22:56:18 +00:00
if (AFF_FLAGGED(ch, AFF_CHARM))
return;
2006-12-19 22:56:18 +00:00
if (ch->desc) {
send_to_char(ch, "You've got no VNUM to return to, dummy! try 'switch'\r\n");
return;
}
2006-12-19 22:56:18 +00:00
one_argument(argument, arg);
if (!*arg)
mob_log(ch, "mtransform: missing argument");
else if (!isdigit(*arg) && *arg!='-')
mob_log(ch, "mtransform: bad argument");
else {
if (isdigit(*arg))
m = read_mobile(atoi(arg), VIRTUAL);
else {
keep_hp = 0;
m = read_mobile(atoi(arg+1), VIRTUAL);
}
if (m==NULL) {
mob_log(ch, "mtransform: bad mobile vnum");
return;
}
/* move new obj info over to old object and delete new obj */
for (pos = 0; pos < NUM_WEARS; pos++) {
if (GET_EQ(ch, pos))
obj[pos] = unequip_char(ch, pos);
else
obj[pos] = NULL;
}
/* put the mob in the same room as ch so extract will work */
char_to_room(m, IN_ROOM(ch));
memcpy(&tmpmob, m, sizeof(*m));
/* Thanks to Russell Ryan for this fix. RRfon we need to copy the
the strings so we don't end up free'ing the prototypes later */
if(m->player.name)
tmpmob.player.name = strdup(m->player.name);
if(m->player.title)
tmpmob.player.title = strdup(m->player.title);
if(m->player.short_descr)
tmpmob.player.short_descr = strdup(m->player.short_descr);
if(m->player.long_descr)
tmpmob.player.long_descr = strdup(m->player.long_descr);
if(m->player.description)
tmpmob.player.description = strdup(m->player.description);
tmpmob.id = ch->id;
tmpmob.affected = ch->affected;
tmpmob.carrying = ch->carrying;
tmpmob.proto_script = ch->proto_script;
tmpmob.script = ch->script;
tmpmob.memory = ch->memory;
tmpmob.next_in_room = ch->next_in_room;
tmpmob.next = ch->next;
tmpmob.next_fighting = ch->next_fighting;
tmpmob.followers = ch->followers;
tmpmob.master = ch->master;
GET_WAS_IN(&tmpmob) = GET_WAS_IN(ch);
if (keep_hp) {
GET_HIT(&tmpmob) = GET_HIT(ch);
GET_MAX_HIT(&tmpmob) = GET_MAX_HIT(ch);
GET_EXP(&tmpmob) = GET_EXP(ch);
}
GET_GOLD(&tmpmob) = GET_GOLD(ch);
GET_POS(&tmpmob) = GET_POS(ch);
IS_CARRYING_W(&tmpmob) = IS_CARRYING_W(ch);
IS_CARRYING_N(&tmpmob) = IS_CARRYING_N(ch);
FIGHTING(&tmpmob) = FIGHTING(ch);
HUNTING(&tmpmob) = HUNTING(ch);
memcpy(ch, &tmpmob, sizeof(*ch));
for (pos = 0; pos < NUM_WEARS; pos++) {
if (obj[pos])
equip_char(ch, obj[pos], pos);
}
ch->nr = this_rnum;
extract_char(m);
}
}
ACMD(do_mdoor)
{
char target[MAX_INPUT_LENGTH], direction[MAX_INPUT_LENGTH];
char field[MAX_INPUT_LENGTH], *value;
room_data *rm;
struct room_direction_data *newexit;
int dir, fd, to_room;
const char *door_field[] = {
"purge",
"description",
"flags",
"key",
"name",
"room",
"\n"
};
if (!MOB_OR_IMPL(ch)) {
send_to_char(ch, "Huh?!?\r\n");
return;
}
2006-12-19 22:56:18 +00:00
if (AFF_FLAGGED(ch, AFF_CHARM))
return;
2006-12-19 22:56:18 +00:00
argument = two_arguments(argument, target, direction);
value = one_argument(argument, field);
skip_spaces(&value);
if (!*target || !*direction || !*field) {
mob_log(ch, "mdoor called with too few args");
return;
}
2006-12-19 22:56:18 +00:00
if ((rm = get_room(target)) == NULL) {
mob_log(ch, "mdoor: invalid target");
return;
}
2006-12-19 22:56:18 +00:00
if ((dir = search_block(direction, dirs, FALSE)) == -1) {
mob_log(ch, "mdoor: invalid direction");
return;
}
if ((fd = search_block(field, door_field, FALSE)) == -1) {
mob_log(ch, "odoor: invalid field");
return;
}
newexit = rm->dir_option[dir];
/* purge exit */
if (fd == 0) {
if (newexit) {
if (newexit->general_description)
free(newexit->general_description);
if (newexit->keyword)
free(newexit->keyword);
free(newexit);
rm->dir_option[dir] = NULL;
}
}
else {
if (!newexit) {
CREATE(newexit, struct room_direction_data, 1);
rm->dir_option[dir] = newexit;
2006-12-19 22:56:18 +00:00
}
2006-12-19 22:56:18 +00:00
switch (fd) {
case 1: /* description */
if (newexit->general_description)
free(newexit->general_description);
CREATE(newexit->general_description, char, strlen(value) + 3);
strcpy(newexit->general_description, value);
strcat(newexit->general_description, "\r\n");
break;
case 2: /* flags */
newexit->exit_info = (sh_int)asciiflag_conv(value);
break;
case 3: /* key */
newexit->key = atoi(value);
break;
case 4: /* name */
if (newexit->keyword)
free(newexit->keyword);
CREATE(newexit->keyword, char, strlen(value) + 1);
strcpy(newexit->keyword, value);
break;
case 5: /* room */
if ((to_room = real_room(atoi(value))) != NOWHERE)
newexit->to_room = to_room;
else
mob_log(ch, "mdoor: invalid door target");
break;
}
}
}
ACMD(do_mfollow)
{
char buf[MAX_INPUT_LENGTH];
struct char_data *leader;
struct follow_type *j, *k;
if (!MOB_OR_IMPL(ch)) {
send_to_char(ch, "Huh?!?\r\n");
return;
}
2006-12-19 22:56:18 +00:00
if (AFF_FLAGGED(ch, AFF_CHARM))
return;
one_argument(argument, buf);
if (!*buf) {
mob_log(ch, "mfollow: bad syntax");
return;
}
2006-12-19 22:56:18 +00:00
if (*buf == UID_CHAR) {
if (!(leader = get_char(buf))) {
mob_log(ch, "mfollow: victim (%s) does not exist", buf);
return;
}
} else if (!(leader = get_char_vis(ch, buf, NULL, FIND_CHAR_ROOM))) {
mob_log(ch,"mfollow: victim (%s) not found", buf);
return;
}
if (ch->master == leader) /* already following */
return;
if (AFF_FLAGGED(ch, AFF_CHARM) && (ch->master)) /* can't override charm */
return;
2006-12-19 22:56:18 +00:00
/* stop following someone else first */
if (ch->master) {
if (ch->master->followers->follower == ch) { /* Head of follower-list? */
k = ch->master->followers;
ch->master->followers = k->next;
free(k);
} else { /* locate follower who is not head of list */
for (k = ch->master->followers; k->next->follower != ch; k = k->next);
2006-12-19 22:56:18 +00:00
j = k->next;
k->next = j->next;
free(j);
}
ch->master = NULL;
}
if (ch == leader)
2006-12-19 22:56:18 +00:00
return;
2006-12-19 22:56:18 +00:00
if (circle_follow(ch, leader)) {
mob_log(ch, "mfollow: Following in circles.");
return;
}
ch->master = leader;
CREATE(k, struct follow_type, 1);
k->follower = ch;
k->next = leader->followers;
leader->followers = k;
}
/* Prints the message to everyone in the range of numbers. Thanks to Jamie
* Nelson of 4D for this contribution */
2006-12-19 22:56:18 +00:00
ACMD(do_mrecho)
{
char start[MAX_INPUT_LENGTH], finish[MAX_INPUT_LENGTH], *msg;
if (!MOB_OR_IMPL(ch)) {
send_to_char(ch, "Huh?!?\r\n");
return;
}
msg = two_arguments(argument, start, finish);
skip_spaces(&msg);
if (!*msg || !*start || !*finish || !is_number(start) || !is_number(finish))
mob_log(ch, "mrecho called with too few args");
else
2006-12-19 22:56:18 +00:00
send_to_range(atoi(start), atoi(finish), "%s\r\n", msg);
}