clankeys.install
clankeys.install · 4.5 KB
From the archive clankeys.zip
Download the archive « Back to the archive contents
This text file contains the step by step instructions for installing
Feydrex's load_clankey snippet. This file just shows you what code
to add and where. Please read the README.FIRST file before you
install this code as it gives an overall description of what this
code does and what else you have to do besides just put in this code.
This code created by Feydrex in June of 1999 and is subject to the
simple license agreement in the clankeys.license file. Enjoy.
NOTE: This snippet was written on a ROT based mud that had clans.c
If your MUD is a ROM based MUD without clans.c, you will find that
the clan_table is in const.c I believe. Grep for it if not.
1) In "tables.h" in "struct clan_type" add a new member variable
(for holding the clan's key vnum) below the last member variable
already there. Example (the line with the + is the line to add
[don't type the + character though]):
bool independant; /* true for loners */
bool pkill; /* true for pkilling clans */
char *exname;
+ sh_int keyvnum; /* holds the vnum of the clan's key */
};
2) In "clans.c" in "const struct clan_type clan_table[MAX_CLAN]"
add the following:
a) At the begining of the structure add "key vnum" to the remarked
out section that says what each field in the table is. It will
follow after the last field that you already have there. Example:
/* name, who entry,
death-transfer room, clan room entrance,
clan pit vnum,
independent, pkill?, ext name,
+ key vnum
b) Next go through and put in the vnums for each clan key. If a clan
doesn't have a key then use 0. Remember the clan key vnum is now
going to be the last field in each clan, so don't forget to put
a comma after what was the last field before.
Example of a clan without a key (also example of clanless):
{"", "",
ROOM_VNUM_ALTAR, ROOM_VNUM_ALTAR,
OBJ_VNUM_PIT,
TRUE, FALSE, "Unused",
0 },
Example of a clan with a key:
{"Vision", " {DV{wi{Ws{wi{Wo{Dn{x ",
26100, 26100,
OBJ_VNUM_PIT,
FALSE, TRUE, "Pending",
26102 },
3) Next you need to put the following function at the end of clans.c
void load_clankey(CHAR_DATA *ch)
{
/* This function is the main part of the clan key loading
code written by Feydrex. In order to use this code you
must keep in the comments, including this one, and also
keep the install directions in your doc directory.
This code is currently available on the web at:
http://www.intnet.net/~feydrex/code.html
*/
int vnum;
OBJ_INDEX_DATA *pObjIndex;
OBJ_DATA *obj;
if ((vnum = clan_table[ch->clan].keyvnum) == 0)
return;
if ( ( pObjIndex = get_obj_index( vnum ) ) == NULL )
{
bug( "Object vnum error, key vnum %d", vnum );
send_to_char( "Bug (load_clankey): No object has that vnum.\n\r", ch );
return;
}
obj = create_object( pObjIndex, pObjIndex->level );
obj_to_char( obj, ch );
send_to_char( "\n\r{YYour clan key appears in your inventory.{x\n\r", ch );
return;
}
4) In merc.h add the load_clankey line shown below. This is the
load_clankey function prototype. It goes down near the end of merc.h
with the rest of the function prototypes, as shown in the example:
/* clans.c */
void update_clanlist args( ( CHAR_DATA *ch, int clannum, bool add, bool clead
) );
void load_clankey args( ( CHAR_DATA *ch ) ); /* Feydrex's clankey code */
/* comm.c */
void show_string args( ( struct descriptor_data *d, char *input) );
5) In comm.c add the function call to load_clankey at the bottom right
before the end of the nanny function. An example of what it might
look like (depending on your MUD) is shown below. Add the line with
the + in front of it (but dont key the + sign itself of course).
act( "$n has entered the game.", ch, NULL, NULL, TO_ROOM );
do_look( ch, "auto" );
wiznet("$N has left real life behind.",ch,NULL,
WIZ_LOGINS,WIZ_SITES,get_trust(ch));
if (ch->pet != NULL)
{
char_to_room(ch->pet,ch->in_room);
act("$n has entered the game.",ch->pet,NULL,NULL,TO_ROOM);
}
send_to_char("\n", ch);
do_board(ch, ""); /* Show board status */
+ load_clankey(ch); /* Feydrex's clan key code */