AutoGold [by BoxBoy]
Snippet Posted Tuesday, August 1st @ 12:22:23 PM, by Brandon Brown in the Players dept.
Boxboy supplies a simple way of coding 'autogold'.
Autogold

This is how I added autogold.


/********* start here **********/
open act.informative.c,

Look for the line,
	  "    Color Level: %s\r\n",
and above it add,
	  "       AutoGold: %-3s    "

then in act.other.c,

look for the line,
    "Will now track through doors.\r\n"}
and below it add,
	{"AutoGold disabled.\r\n",
	"AutoGold enabled.\r\n"}

not also add a ',' on the track through doors statement so it looks like
    "Will now track through doors.\r\n"},

now look for,
  case SCMD_TRACK:
    result = (track_through_doors = !track_through_doors);
    break;
and below it add,
  case SCMD_AUTOGOLD:
	result = PRF_TOG_CHK(ch, PRF_AUTOGOLD);
	break;

now in constants.c,

find the line,
  "TRACK",
and below it add
  "AUTOGOLD",

now in fight.c,
in int damage(),
under the header add,
ACMD(do_get);

find the second 'die(victim);' and below it add,
    /* If Autogold enabled, get gold corpse */
	if (IS_NPC(victim) && !IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTOGOLD)) {
	  do_get(ch,"gold corpse",0,0);
	}

now onto interpreter.c,

find the line,
  { "autoexit" , POS_DEAD    , do_gen_tog  , 0, SCMD_AUTOEXIT },
and below it add,
  { "autogold" , POS_DEAD, do_gen_tog, 0, SCMD_AUTOGOLD},

and in interprecter.h find the line,
#define SCMD_TRACK	16
and below it add,
#define SCMD_AUTOGOLD  17

and finally goto structs.h,
find the line,
#define PRF_ROOMFLAGS	(1 << 21) /* Can see room flags (ROOM_x)	*/
and below it add,
#define PRF_AUTOGOLD  (1 << 30)

/****** Finish Here **********/

Basically, if you have autogold on and you kill someone you will get the gold from their corpse.

This can be used as a autoloot, if you modify it slightly.

Boxboy, says, 'Bye bye'

<< Two-Handed weapons [by Boxboy] | Reply | Threaded | Disarm Skill [by BoxBoy] >>

 


Related Links
  Boxboy
Related Articles
More by bbrown
 
 

Quick Links
 
The CircleMUD FAQ
The CircleMUD home page
Alex's Snippets
Wintermute Snippets
CircleMUD Bug Reporting or Help
CircleMUD List Archives
CircleMUD Resources
Death Gate's Scripts
(Author of C conversion)
Sammy's code site
Erwin S. Andreasen's page
(Author of mudFTP and other goodies)
Death's Gate Scripting site
Help for CircleMUD in Windows
The OasisOLC Maintenance Effort
George's Random Stuff
Imaginary Realities
MUD Dictionary