MAJOR UPDATE: Admin Levels split from Mortal Levels

This commit is contained in:
JamDog 2010-11-24 20:07:22 +00:00
parent 2b30509371
commit dcba9d6441
77 changed files with 2882 additions and 2067 deletions

View file

@ -16,10 +16,10 @@
#define IMM_LMARG " "
#define IMM_NSIZE 16
#define LINE_LEN 64
#define MIN_LEVEL LVL_IMMORT
#define MIN_LEVEL ADMLVL_IMMORT
/* max level that should be in columns instead of centered */
#define COL_LEVEL LVL_IMMORT
#define COL_LEVEL ADMLVL_IMMORT
struct name_rec {
char name[25];
@ -39,10 +39,10 @@ struct level_rec {
struct control_rec level_params[] =
{
{LVL_IMMORT, "Immortals"},
{LVL_GOD, "Gods"},
{LVL_GRGOD, "Greater Gods"},
{LVL_IMPL, "Implementors"},
{ADMLVL_IMMORT, "Immortals"},
{ADMLVL_GOD , "Gods"},
{ADMLVL_GRGOD , "Greater Gods"},
{ADMLVL_IMPL , "Implementors"},
{0, ""}
};
@ -70,7 +70,7 @@ void read_file(void)
bitvector_t asciiflag_conv(char *flag);
FILE *fl;
int recs, i, last = 0, level = 0, flags = 0;
int recs, i, last = 0, level = 0, flags = 0, admlevel = 0;
char index_name[40], line[256], bits[64];
char name[MAX_NAME_LENGTH];
long id = 0;
@ -89,13 +89,14 @@ void read_file(void)
for (i = 0; i < recs; i++) {
get_line(fl, line);
sscanf(line, "%ld %s %d %s %d", &id, name, &level, bits, &last);
sscanf(line, "%ld %s %d %d %s %d", &id, name, &level, &admlevel, bits, &last);
CAP(name);
flags = asciiflag_conv(bits);
if (level >= MIN_LEVEL &&
!(IS_SET(flags, PINDEX_NOWIZLIST)) &&
!(IS_SET(flags, PINDEX_DELETED)))
add_name(level, name);
!(IS_SET(flags, PINDEX_DELETED)) &&
!(IS_SET(flags, PINDEX_MORTAL)) )
add_name(admlevel, name);
}
fclose(fl);
}
@ -232,7 +233,7 @@ int main(int argc, char **argv)
sort_names();
fl = fopen(argv[2], "w");
write_wizlist(fl, wizlevel, LVL_IMPL);
write_wizlist(fl, wizlevel, ADMLVL_IMPL);
fclose(fl);
fl = fopen(argv[4], "w");
@ -253,9 +254,9 @@ char *CAP(char *txt)
return (txt);
}
/* get_line reads the next non-blank line off of the input stream. The newline
* character is removed from the input. Lines which begin with '*' are
* considered to be comments. Returns the number of lines advanced in the
/* get_line reads the next non-blank line off of the input stream. The newline
* character is removed from the input. Lines which begin with '*' are
* considered to be comments. Returns the number of lines advanced in the
* file. */
int get_line(FILE * fl, char *buf)
{

View file

@ -23,6 +23,8 @@
#define MAX_SKILLS 200 /* Used in char_file_u *DO*NOT*CHANGE* */
#define MAX_AFFECT 32 /* Used in char_file_u *DO*NOT*CHANGE* */
#define MAX_LEVEL 30 /* Same as CONFIG_MAX_LEVEL */
/* Char's abilities. Used in char_file_u *DO*NOT*CHANGE* */
struct char_ability_data_plrtoascii {
sbyte str;
@ -54,7 +56,7 @@ struct char_point_data_plrtoascii {
};
/*
/*
* char_special_data_saved: specials which both a PC and an NPC have in
* common, but which must be saved to the playerfile for PC's.
*
@ -186,7 +188,7 @@ void convert(char *filename)
exit(1);
printf("writing: %s\n", outname);
fprintf(index_file, "%ld %s %d 0 %ld\n",
fprintf(index_file, "%ld %s %d 0 %ld\n",
player.char_specials_saved.idnum, bits, player.level,
(long)player.last_logon);
@ -205,11 +207,13 @@ void convert(char *filename)
if (player.description && *player.description)
fprintf(outfile, "Desc:\n%s~\n", player.description);
if (player.sex != PFDEF_SEX)
fprintf(outfile, "Sex : %d\n", (int)player.sex);
fprintf(outfile, "Sex : %d\n", (int)player.sex);
if (player.chclass != PFDEF_CLASS)
fprintf(outfile, "Clas: %d\n", (int)player.chclass);
fprintf(outfile, "Clas: %d\n", (int)player.chclass);
if (player.level != PFDEF_LEVEL)
fprintf(outfile, "Levl: %d\n", (int)player.level);
fprintf(outfile, "Levl: %d\n", (int)player.level);
if (player.level > MAX_LEVEL)
fprintf(outfile, "Admn: %d\n", (int)(player.level-MAX_LEVEL));
fprintf(outfile, "Brth: %d\n", (int)player.birth);
fprintf(outfile, "Plyd: %d\n", (int)player.played);
fprintf(outfile, "Last: %d\n", (int)player.last_logon);
@ -243,7 +247,7 @@ void convert(char *filename)
/* player_special_data_saved */
psds = &(player.player_specials_saved);
if (player.level < LVL_IMMORT) {
if (player.level < (ADMLVL_IMMORT+MAX_LEVEL)) {
fprintf(outfile, "Skil:\n");
for (i = 1; i <= MAX_SKILLS; i++) {
if (psds->skills[i])
@ -263,13 +267,13 @@ void convert(char *filename)
sprintascii(bits, psds->pref);
fprintf(outfile, "Pref: %s\n", bits);
}
if (psds->conditions[HUNGER] && player.level < LVL_IMMORT &&
if (psds->conditions[HUNGER] && player.level < (ADMLVL_IMMORT+MAX_LEVEL) &&
psds->conditions[HUNGER] != PFDEF_HUNGER)
fprintf(outfile, "Hung: %d\n", (int)psds->conditions[0]);
if (psds->conditions[THIRST] && player.level < LVL_IMMORT &&
if (psds->conditions[THIRST] && player.level < (ADMLVL_IMMORT+MAX_LEVEL) &&
psds->conditions[THIRST] != PFDEF_THIRST)
fprintf(outfile, "Thir: %d\n", (int)psds->conditions[1]);
if (psds->conditions[2] && player.level < LVL_IMMORT &&
if (psds->conditions[2] && player.level < (ADMLVL_IMMORT+MAX_LEVEL) &&
psds->conditions[DRUNK] != PFDEF_DRUNK)
fprintf(outfile, "Drnk: %d\n", (int)psds->conditions[2]);
if (psds->spells_to_learn != PFDEF_PRACTICES)