vampires.zip
snippets · 5.2 KB · 2010-03-30
Vampire code by Geoffrey Noland (FireWolf): vamp.c with install notes.
Download « Back to the snippets list
Install.txt
This is my vampire code: It's not finished, so don't expect it to be perfect.
first, add the following code anywhere in merc.h
/****************************************************************************
Vampire code written by Geoffrey Noland, aka FireWolf
(C) 2001 - All Rights Reserved
FireWolf Industries
****************************************************************************/
#define IS_VAMPAFF(ch, sn) ( IS_SET( (ch)->pcdata->stats[AFF], (sn) ) )
#define IS_VAMP(ch) ch->race == race_lookup("vampire")
// bits for ch->pcdata->stats[AFF]
#define VAMP_FANGS 1
#define VAMP_CLAWS 2
#define VAMP_REVEAL 3
#define FORM_HUMAN 1
#define FORM_BAT 2
#define FORM_WOLF 3
#define FORM_MIST 4
#define MAX_BLOOD 100
#define GEN 0 /* vampgen */
#define AFF 1 /* vampaff */
#define CURRENT 2 /* vamppass */
also, in merc.h, find this line:
struct char_data
and add these lines at the bottom of the structure:
short protean;
short auspex;
short quietus;
short obfuscate;
short domination;
short presence;
short celerity;
short fortitude;
short potence;
short disc;
sh_int blood;
also, in merc.h, find this line
#define MAX_PC_RACE 5
and increment it by one.
also, in merc.h, find this line
struct pc_data
and add this line at the bottom of the structure:
int stats[12];
Then, open const.c, and find these line:
{
"elf", TRUE,
0, AFF_INFRARED, 0,
0, RES_CHARM, VULN_IRON,
A|H|M|V, A|B|C|D|E|F|G|H|I|J|K
},
and below that, add these lines: (make any changes you wish)
{
"vampire", TRUE,
0, 0, 0,
0, RES_DISEASE|RES_COLD, VULN_FIRE|VULN_HOLY,
A|H|M|V, A|B|C|D|E|F|G|H|I|J|K
},
Also in const.c, find this line:
{
"elf", "{X|{X", 5, { 100, 125, 100, 120 },
{ "sneak", "hide" },
{ 12, 14, 13, 15, 11 }, { 16, 20, 18, 21, 15 }, SIZE_SMALL
},
and add these lines, again making any desired customizations:
{
"vampire", "{X|{X", 8, { 125, 125, 125, 125 },
{ "berserk" },
{ 16, 16, 16, 16, 16 }, { 20, 20, 20, 20, 20 }, SIZE_MEDIUM
},
Then, open interp.h, and add these lines to the bottom of the file. This declares all the vampire
commands that have been written at the time of this files creation.
// Vampire Commands
DECLARE_DO_FUN( do_fangs );
DECLARE_DO_FUN( do_embrace );
DECLARE_DO_FUN( do_discipline );
DECLARE_DO_FUN( do_feed );
DECLARE_DO_FUN( do_regenerate );
DECLARE_DO_FUN( do_improve );
DECLARE_DO_FUN( do_reveal );
DECLARE_DO_FUN( do_sense );
DECLARE_DO_FUN( do_soulsight );
DECLARE_DO_FUN( do_claws );
DECLARE_DO_FUN( do_shift );
then, open interp.c, find this line:
{ "prefix", do_prefix, POS_DEAD, IM, LOG_NORMAL, 1 },
right below it, add these lines:
{ "fangs", do_fangs, POS_STANDING, 0, LOG_NORMAL, 0 },
{ "embrace", do_embrace, POS_STANDING, 0, LOG_ALWAYS, 0 },
{ "discipline", do_discipline, POS_DEAD, 0, LOG_NORMAL, 0 },
{ "feed", do_feed, POS_STANDING, 0, LOG_NORMAL, 0 },
{ "regenerate", do_regenerate, POS_STANDING, 0, LOG_NORMAL, 0 },
{ "reveal", do_reveal, POS_STANDING, 0, LOG_NORMAL, 0 },
{ "sense", do_sense, POS_STANDING, 0, LOG_NORMAL, 0 },
{ "soulsight", do_soulsight, POS_STANDING, 0, LOG_NORMAL, 0 },
{ "claws", do_claws, POS_STANDING, 0, LOG_NORMAL, 0 },
{ "shift", do_shift, POS_STANDING, 0, LOG_NORMAL, 0 },
then, open save.c and find this line:
fprintf( fp, "Levl %d\n", ch->level );
and add these lines:
fprintf( fp, "Blood %d\n", ch->blood );
fprintf( fp, "Disc %d\n", ch->disc );
fprintf( fp, "Auspex %d\n", ch->auspex );
fprintf( fp, "Celerity %d\n", ch->celerity );
fprintf( fp, "Domination %d\n", ch->domination );
fprintf( fp, "Fortitude %d\n", ch->fortitude );
fprintf( fp, "Obfuscate %d\n", ch->obfuscate );
fprintf( fp, "Potence %d\n", ch->potence );
fprintf( fp, "Presence %d\n", ch->presence );
fprintf( fp, "Protean %d\n", ch->protean );
fprintf( fp, "Quietus %d\n", ch->quietus );
Then, in the function fwrite_char, add these lines where appropriate.
If the case statements for the letter you need doesn't exist, just add it, and
don't forget the break statement at the end of the case statements you add.
(if you can't figure it out, email me at firewolf_industries@hotmail.com):
KEY( "Auspex", ch->auspex, fread_number( fp ) );
KEY( "Blood", ch->blood, fread_number( fp ) );
KEY( "Celerity", ch->celerity, fread_number( fp ) );
KEY( "Disc", ch->disc, fread_number( fp ) );
KEY( "Domination", ch->domination, fread_number( fp ) );
KEY( "Fortitude", ch->fortitude, fread_number( fp ) );
KEY( "Obfuscate", ch->obfuscate, fread_number( fp ) );
KEY( "Potence", ch->potence, fread_number( fp ) );
KEY( "Presence", ch->presence, fread_number( fp ) );
KEY( "Protean", ch->protean, fread_number( fp ) );
KEY( "Quietus", ch->quietus, fread_number( fp ) );
Then, upload vamp.c to your src directory.
Add vamp.o to your makefile.
Do a make.
Customize as desired.
Archive contents (3 files)
| File | Size |
|---|---|
| Install.txt | 5.1 KB |
| vamp.c | 13.5 KB |
| ftp.kyndig.com | 935 B |